Class AntlrBaseParser<N extends AntlrNode<N>,R extends BaseAntlrInnerNode<N> & RootNode>
- java.lang.Object
-
- net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrBaseParser<N,R>
-
- Type Parameters:
N
- Supertype of all nodes for the language, eg SwiftNodeR
- Type of the root node
- All Implemented Interfaces:
Parser
public abstract class AntlrBaseParser<N extends AntlrNode<N>,R extends BaseAntlrInnerNode<N> & RootNode> extends Object implements Parser
Generic Antlr parser adapter for all Antlr parsers. This wraps a parser generated by antlr, sooAntlrGeneratedParserBase
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.sourceforge.pmd.lang.ast.Parser
Parser.ParserTask
-
-
Constructor Summary
Constructors Constructor Description AntlrBaseParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract org.antlr.v4.runtime.Lexer
getLexer(org.antlr.v4.runtime.CharStream source)
R
parse(Parser.ParserTask task)
Parses an entire tree for this language.protected abstract R
parse(org.antlr.v4.runtime.Lexer parser, Parser.ParserTask task)
-
-
-
Method Detail
-
parse
public R parse(Parser.ParserTask task) throws ParseException
Description copied from interface:Parser
Parses an entire tree for this language. This may perform some semantic analysis, like name resolution.- Specified by:
parse
in interfaceParser
- Parameters:
task
- Description of the parsing task- Returns:
- The root of the tree corresponding to the source code.
- Throws:
ParseException
-
parse
protected abstract R parse(org.antlr.v4.runtime.Lexer parser, Parser.ParserTask task)
-
getLexer
protected abstract org.antlr.v4.runtime.Lexer getLexer(org.antlr.v4.runtime.CharStream source)
-
-