Package antlr
Class TreeParser
java.lang.Object
antlr.TreeParser
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AST
Where did this rule leave off parsing; avoids a return parameterprotected ASTFactory
AST support code; parser and treeparser delegate to this objectstatic ASTNULLType
The AST Null object; the parsing cursor is set to this when it is found to be null.protected TreeParserSharedInputState
Nesting level of registered handlersprotected AST
AST return value for a rule is squirreled away hereprotected String[]
Table of token type to token namesprotected int
Used 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 void
void
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.protected void
static void
panic()
Deprecated.as of 2.7.2.void
Parser error-reporting function can be overridden in subclassvoid
Parser error-reporting function can be overridden in subclassvoid
Parser warning-reporting function can be overridden in subclassvoid
Specify an object with support code (shared by Parser and TreeParser.void
setASTNodeClass
(String nodeType) Specify the type of node to create during tree buildingvoid
setASTNodeType
(String nodeType) Deprecated.since 2.7.2void
void
void
-
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
-