- TraceListener
class TraceListener
TODO add class description
- TrimToSizeListener
class TrimToSizeListener
TODO add class description
- _errHandler
ANTLRErrorStrategy _errHandler;
Undocumented in source.
- _input
TokenStream _input;
Undocumented in source.
- _precedenceStack
IntegerStack _precedenceStack;
Undocumented in source.
- ctx_
ParserRuleContext ctx_;
@uml
The {@link ParserRuleContext} object for the currently executing rule.
This is always non-null during the parsing process.
@read
@write
- _buildParseTrees
bool _buildParseTrees;
@uml
Specifies whether or not the parser should construct a parse tree during
the parsing process. The default value is {@code true}.
- _tracer
TraceListener _tracer;
Undocumented in source.
- _parseListeners
ParseTreeListener[] _parseListeners;
@uml
The list of {@link ParseTreeListener} listeners registered to receive
events during the parse.
- matchedEOF
bool matchedEOF;
@uml
Indicates parser has match()ed EOF token. See {@link #exitRule()}.
- reset
void reset()
@uml
reset the parser's state
- match
Token match(int ttype)
@uml
Match current input symbol against {@code ttype}. If the symbol type
matches, {@link ANTLRErrorStrategy#reportMatch} and {@link #consume} are
called to complete the match process.
- matchWildcard
Token matchWildcard()
@uml
Match current input symbol as a wildcard. If the symbol type matches
(i.e. has a value greater than 0), {@link ANTLRErrorStrategy#reportMatch}
and {@link #consume} are called to complete the match process.
- setBuildParseTree
void setBuildParseTree(bool buildParseTrees)
@uml
Track the {@link ParserRuleContext} objects during the parse and hook
them up using the {@link ParserRuleContext#children} list so that it
forms a parse tree. The {@link ParserRuleContext} returned from the start
rule represents the root of the parse tree.
- getBuildParseTree
bool getBuildParseTree()
@uml
Gets whether or not a complete parse tree will be constructed while
parsing. This property is {@code true} for a newly constructed parser.
- setTrimParseTree
void setTrimParseTree(bool trimParseTrees)
@uml
Trim the internal lists of the parse tree during parsing to conserve memory.
This property is set to {@code false} by default for a newly constructed parser.
- getTrimParseTree
bool getTrimParseTree()
@uml
The @return {@code true} if the {@link ParserRuleContext#children} list is trimed
using the default {@link Parser.TrimToSizeListener} during the parse process.
- getParseListeners
ParseTreeListener[] getParseListeners()
Undocumented in source. Be warned that the author may not have intended to support it.
- addParseListener
void addParseListener(ParseTreeListener listener)
@uml
Registers {@code listener} to receive events during the parsing process.
- removeParseListener
void removeParseListener(ParseTreeListener listener)
Undocumented in source. Be warned that the author may not have intended to support it.
- removeParseListeners
void removeParseListeners()
@uml
Remove all parse listeners.
- triggerEnterRuleEvent
void triggerEnterRuleEvent()
@uml
Notify any parse listeners of an enter rule event.
- triggerExitRuleEvent
void triggerExitRuleEvent()
@uml
Notify any parse listeners of an exit rule event.
- tokenFactory
TokenFactory!CommonToken tokenFactory()
- tokenFactory
void tokenFactory(TokenFactory!CommonToken factory)
Tell our token source and error strategy about a new way to create tokens.
@uml
@override
- getATNWithBypassAlts
ATN getATNWithBypassAlts()
@uml
The ATN with bypass alternatives is expensive to create so we create it
lazily.
- compileParseTreePattern
ParseTreePattern compileParseTreePattern(string pattern, int patternRuleIndex)
Undocumented in source. Be warned that the author may not have intended to support it.
- compileParseTreePattern
ParseTreePattern compileParseTreePattern(string pattern, int patternRuleIndex, Lexer lexer)
@uml
The same as {@link #compileParseTreePattern(String, int)} but specify a
{@link Lexer} rather than trying to deduce it from this parser.
- getErrorHandler
auto getErrorHandler()
Undocumented in source. Be warned that the author may not have intended to support it.
- setErrorHandler
void setErrorHandler(ANTLRErrorStrategy handler)
Undocumented in source. Be warned that the author may not have intended to support it.
- getInputStream
TokenStream getInputStream()
- setInputStream
void setInputStream(IntStream input)
- getTokenStream
TokenStream getTokenStream()
Undocumented in source. Be warned that the author may not have intended to support it.
- setTokenStream
void setTokenStream(TokenStream input)
@uml
Set the token stream and reset the parser.
- getCurrentToken
Token getCurrentToken()
@uml
Match needs to return the current input symbol, which gets put
into the label for the associated token ref; e.g., x=ID.
- notifyErrorListeners
void notifyErrorListeners(string msg)
- notifyErrorListeners
void notifyErrorListeners(Token offendingToken, string msg, RecognitionException e)
Undocumented in source. Be warned that the author may not have intended to support it.
- consume
Token consume()
@uml
Consume and return the {@linkplain #getCurrentToken current symbol}.
- addContextToParseTree
void addContextToParseTree()
Undocumented in source. Be warned that the author may not have intended to support it.
- enterRule
void enterRule(ParserRuleContext localctx, int state, int ruleIndex)
Undocumented in source. Be warned that the author may not have intended to support it.
- exitRule
void exitRule()
Undocumented in source. Be warned that the author may not have intended to support it.
- enterOuterAlt
void enterOuterAlt(ParserRuleContext localctx, int altNum)
Undocumented in source. Be warned that the author may not have intended to support it.
- getPrecedence
int getPrecedence()
@uml
Get the precedence level for the top-most precedence rule.
- enterRecursionRule
void enterRecursionRule(ParserRuleContext localctx, int ruleIndex)
@uml
. @deprecated Use
{@link #enterRecursionRule(ParserRuleContext, int, int, int)} instead.
- enterRecursionRule
void enterRecursionRule(ParserRuleContext localctx, int state, int ruleIndex, int precedence)
Undocumented in source. Be warned that the author may not have intended to support it.
- pushNewRecursionContext
void pushNewRecursionContext(ParserRuleContext localctx, int state, size_t ruleIndex)
@uml
Like {@link #enterRule} but for recursive rules.
Make the current context the child of the incoming localctx.
- unrollRecursionContexts
void unrollRecursionContexts(ParserRuleContext _parentctx)
Undocumented in source. Be warned that the author may not have intended to support it.
- getInvokingContext
ParserRuleContext getInvokingContext(int ruleIndex)
Undocumented in source. Be warned that the author may not have intended to support it.
- precpred
bool precpred(InterfaceRuleContext localctx, int precedence)
- inContext
bool inContext(string context)
Undocumented in source. Be warned that the author may not have intended to support it.
- isExpectedToken
bool isExpectedToken(int symbol)
@uml
Checks whether or not {@code symbol} can follow the current state in the
ATN. The behavior of this method is equivalent to the following, but is
implemented such that the complete context-sensitive follow set does not
need to be explicitly constructed.
- isMatchedEOF
bool isMatchedEOF()
Undocumented in source. Be warned that the author may not have intended to support it.
- getExpectedTokens
IntervalSet getExpectedTokens()
@uml
Computes the set of input symbols which could follow the current parser
state and context, as given by {@link #getState} and {@link #getContext},
espectively.
- getExpectedTokensWithinCurrentRule
IntervalSet getExpectedTokensWithinCurrentRule()
Undocumented in source. Be warned that the author may not have intended to support it.
- getRuleIndex
int getRuleIndex(string ruleName)
@uml
Get a rule's index (i.e., {@code RULE_ruleName} field) or -1 if not found.
- getRuleContext
ParserRuleContext getRuleContext()
Undocumented in source. Be warned that the author may not have intended to support it.
- getRuleInvocationStack
string[] getRuleInvocationStack()
@uml
Return List<String> of the rule names in your parser instance
leading up to a call to the current rule. You could override if
you want more details such as the file/line info of where
in the ATN a rule is invoked.
- getRuleInvocationStack
string[] getRuleInvocationStack(RuleContext p)
Undocumented in source. Be warned that the author may not have intended to support it.
- getDFAStrings
string[] getDFAStrings()
@uml
For debugging and other purposes.
- dumpDFA
void dumpDFA()
@uml
For debugging and other purposes.
- getSourceName
string getSourceName()
Undocumented in source. Be warned that the author may not have intended to support it.
- getParseInfo
ParseInfo getParseInfo()
- setProfile
void setProfile(bool profile)
Undocumented in source. Be warned that the author may not have intended to support it.
- setTrace
void setTrace(bool trace)
Undocumented in source. Be warned that the author may not have intended to support it.
- isTrace
bool isTrace()
@uml
Gets whether a {@link TraceListener} is registered as a parse listener
for the parser.
- ctx
ParserRuleContext ctx()
Undocumented in source. Be warned that the author may not have intended to support it.
- ctx
void ctx(ParserRuleContext ctx)
Undocumented in source. Be warned that the author may not have intended to support it.
- numberOfSyntaxErrors
int numberOfSyntaxErrors()
Undocumented in source. Be warned that the author may not have intended to support it.