public class ParserInterpreter extends Parser
Parser.TraceListener, Parser.TrimToSizeListener| Modifier and Type | Field and Description |
|---|---|
protected Deque<Tuple2<ParserRuleContext,Integer>> |
_parentContextStack
Tracks LR rules for adjusting the contexts
|
protected ATN |
atn |
protected String |
grammarFileName |
protected int |
overrideDecision
We need a map from (decision,inputIndex)->forced alt for computing ambiguous
parse trees.
|
protected int |
overrideDecisionAlt |
protected int |
overrideDecisionInputIndex |
protected BitSet |
pushRecursionContextStates
This identifies StarLoopEntryState's that begin the (...)*
precedence loops of left recursive rules.
|
protected String[] |
ruleNames |
protected String[] |
tokenNames
Deprecated.
|
_buildParseTrees, _ctx, _errHandler, _input, _parseListeners, _precedenceStack, _syntaxErrors_interp, EOF| Constructor and Description |
|---|
ParserInterpreter(ParserInterpreter old)
A copy constructor that creates a new parser interpreter by reusing
the fields of a previous interpreter.
|
ParserInterpreter(String grammarFileName,
Collection<String> tokenNames,
Collection<String> ruleNames,
ATN atn,
TokenStream input)
Deprecated.
|
ParserInterpreter(String grammarFileName,
Vocabulary vocabulary,
Collection<String> ruleNames,
ATN atn,
TokenStream input) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDecisionOverride(int decision,
int tokenIndex,
int forcedAlt)
Override this parser interpreters normal decision-making process
at a particular decision and input token index.
|
void |
enterRecursionRule(ParserRuleContext localctx,
int state,
int ruleIndex,
int precedence) |
ATN |
getATN()
Get the
ATN used by the recognizer for prediction. |
protected ATNState |
getATNState() |
String |
getGrammarFileName()
For debugging and other purposes, might want the grammar name.
|
String[] |
getRuleNames() |
String[] |
getTokenNames()
Deprecated.
|
Vocabulary |
getVocabulary()
Get the vocabulary used by the recognizer.
|
ParserRuleContext |
parse(int startRuleIndex)
Begin parsing at startRuleIndex
|
protected void |
visitRuleStopState(ATNState p) |
protected void |
visitState(ATNState p) |
addContextToParseTree, addParseListener, compileParseTreePattern, compileParseTreePattern, consume, dumpDFA, enterLeftFactoredRule, enterOuterAlt, enterRecursionRule, enterRule, exitRule, getAmbiguousParseTrees, getATNWithBypassAlts, getBuildParseTree, getContext, getCurrentToken, getDFAStrings, getErrorHandler, getErrorListenerDispatch, getExpectedTokens, getExpectedTokensWithinCurrentRule, getInputStream, getInvokingContext, getNumberOfSyntaxErrors, getParseInfo, getParseListeners, getPrecedence, getRuleContext, getRuleIndex, getRuleInvocationStack, getRuleInvocationStack, getSourceName, getTokenFactory, getTrimParseTree, inContext, isExpectedToken, isTrace, match, matchWildcard, notifyErrorListeners, notifyErrorListeners, precpred, pushNewRecursionContext, removeParseListener, removeParseListeners, reset, setBuildParseTree, setContext, setErrorHandler, setInputStream, setProfile, setTrace, setTrimParseTree, triggerEnterRuleEvent, triggerExitRuleEvent, unrollRecursionContextsaction, addErrorListener, getErrorHeader, getErrorListeners, getInterpreter, getRuleIndexMap, getSerializedATN, getState, getTokenErrorDisplay, getTokenType, getTokenTypeMap, removeErrorListener, removeErrorListeners, sempred, setInterpreter, setStateprotected final String grammarFileName
protected final ATN atn
protected final BitSet pushRecursionContextStates
@Deprecated protected final String[] tokenNames
protected final String[] ruleNames
protected final Deque<Tuple2<ParserRuleContext,Integer>> _parentContextStack
protected int overrideDecision
protected int overrideDecisionInputIndex
protected int overrideDecisionAlt
public ParserInterpreter(@NotNull ParserInterpreter old)
old - The interpreter to copy@Deprecated public ParserInterpreter(String grammarFileName, Collection<String> tokenNames, Collection<String> ruleNames, ATN atn, TokenStream input)
ParserInterpreter(String, Vocabulary, Collection, ATN, TokenStream) instead.public ParserInterpreter(String grammarFileName, @NotNull Vocabulary vocabulary, Collection<String> ruleNames, ATN atn, TokenStream input)
public ATN getATN()
RecognizerATN used by the recognizer for prediction.getATN in class Recognizer<Token,ParserATNSimulator>ATN used by the recognizer for prediction.@Deprecated public String[] getTokenNames()
RecognizergetTokenNames in class Recognizer<Token,ParserATNSimulator>public Vocabulary getVocabulary()
RecognizergetVocabulary in class Recognizer<Token,ParserATNSimulator>Vocabulary instance providing information about the
vocabulary used by the grammar.public String[] getRuleNames()
getRuleNames in class Recognizer<Token,ParserATNSimulator>public String getGrammarFileName()
RecognizergetGrammarFileName in class Recognizer<Token,ParserATNSimulator>public ParserRuleContext parse(int startRuleIndex)
public void enterRecursionRule(ParserRuleContext localctx, int state, int ruleIndex, int precedence)
enterRecursionRule in class Parserprotected ATNState getATNState()
protected void visitState(ATNState p)
protected void visitRuleStopState(ATNState p)
public void addDecisionOverride(int decision,
int tokenIndex,
int forcedAlt)
Copyright © 1992–2015 ANTLR. All rights reserved.