Package antlr
Class TreeParser
java.lang.Object
antlr.TreeParser
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ASTWhere did this rule leave off parsing; avoids a return parameterprotected ASTFactoryAST support code; parser and treeparser delegate to this objectstatic ASTNULLTypeThe AST Null object; the parsing cursor is set to this when it is found to be null.protected TreeParserSharedInputStateNesting level of registered handlersprotected ASTAST return value for a rule is squirreled away hereprotected String[]Table of token type to token namesprotected intUsed to keep track of indentdepth for traceIn/Out -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAST()Get the AST return value squirreled away in the parsergetTokenName(int num) String[]protected voidvoidMake sure current lookahead symbol matches the given set Throw an exception upon mismatch, which is catch by either the error handler or by the syntactic predicate.protected voidstatic voidpanic()Deprecated.as of 2.7.2.voidParser error-reporting function can be overridden in subclassvoidParser error-reporting function can be overridden in subclassvoidParser warning-reporting function can be overridden in subclassvoidSpecify an object with support code (shared by Parser and TreeParser.voidsetASTNodeClass(String nodeType) Specify the type of node to create during tree buildingvoidsetASTNodeType(String nodeType) Deprecated.since 2.7.2voidvoidvoid
-
Field Details
-
ASTNULL
The AST Null object; the parsing cursor is set to this when it is found to be null. This way, we can test the token type of a node without having to have tests for null everywhere. -
_retTree
Where did this rule leave off parsing; avoids a return parameter -
inputState
Nesting level of registered handlers -
tokenNames
Table of token type to token names -
returnAST
AST return value for a rule is squirreled away here -
astFactory
AST support code; parser and treeparser delegate to this object -
traceDepth
protected int traceDepthUsed to keep track of indentdepth for traceIn/Out
-
-
Constructor Details
-
TreeParser
public TreeParser()
-
-
Method Details
-
getAST
Get the AST return value squirreled away in the parser -
getASTFactory
-
getTokenName
-
getTokenNames
-
match
- Throws:
MismatchedTokenException
-
match
Make sure current lookahead symbol matches the given set Throw an exception upon mismatch, which is catch by either the error handler or by the syntactic predicate.- Throws:
MismatchedTokenException
-
matchNot
- Throws:
MismatchedTokenException
-
panic
public static void panic()Deprecated.as of 2.7.2. This method calls System.exit() and writes directly to stderr, which is usually not appropriate when a parser is embedded into a larger application. Since the method isstatic, it cannot be overridden to avoid these problems. ANTLR no longer uses this method internally or in generated code. -
reportError
Parser error-reporting function can be overridden in subclass -
reportError
Parser error-reporting function can be overridden in subclass -
reportWarning
Parser warning-reporting function can be overridden in subclass -
setASTFactory
Specify an object with support code (shared by Parser and TreeParser. Normally, the programmer does not play with this, using setASTNodeType instead. -
setASTNodeType
Deprecated.since 2.7.2Specify the type of node to create during tree building. -
setASTNodeClass
Specify the type of node to create during tree building -
traceIndent
public void traceIndent() -
traceIn
-
traceOut
-