Uses of Class
org.antlr.v4.runtime.ParserRuleContext
-
Packages that use ParserRuleContext Package Description org.antlr.v4.runtime org.antlr.v4.runtime.atn org.antlr.v4.runtime.tree org.antlr.v4.tool -
-
Uses of ParserRuleContext in org.antlr.v4.runtime
Subclasses of ParserRuleContext in org.antlr.v4.runtime Modifier and Type Class Description class
InterpreterRuleContext
This class extendsParserRuleContext
by allowing the value ofInterpreterRuleContext.getRuleIndex()
to be explicitly set for the context.class
RuleContextWithAltNum
A handy class for use with options {contextSuperClass=org.antlr.v4.runtime.RuleContextWithAltNum;} that provides a backing field / impl for the outer alternative number matched for an internal parse tree node.Fields in org.antlr.v4.runtime declared as ParserRuleContext Modifier and Type Field Description protected ParserRuleContext
Parser. _ctx
TheParserRuleContext
object for the currently executing rule.static ParserRuleContext
RuleContext. EMPTY
Fields in org.antlr.v4.runtime with type parameters of type ParserRuleContext Modifier and Type Field Description protected Deque<Pair<ParserRuleContext,Integer>>
ParserInterpreter. _parentContextStack
This stack corresponds to the _parentctx, _parentState pair of locals that would exist on call stack frames with a recursive descent parser; in the generated function for a left-recursive rule you'd see: private EContext e(int _p) throws RecognitionException { ParserRuleContext _parentctx = _ctx; // Pair.a int _parentState = getState(); // Pair.b ...Methods in org.antlr.v4.runtime with type parameters of type ParserRuleContext Modifier and Type Method Description <T extends ParserRuleContext>
TParserRuleContext. getRuleContext(Class<? extends T> ctxType, int i)
<T extends ParserRuleContext>
List<T>ParserRuleContext. getRuleContexts(Class<? extends T> ctxType)
Methods in org.antlr.v4.runtime that return ParserRuleContext Modifier and Type Method Description ParserRuleContext
Parser. getContext()
ParserRuleContext
Parser. getInvokingContext(int ruleIndex)
ParserRuleContext
ParserRuleContext. getParent()
ParserRuleContext
Parser. getRuleContext()
ParserRuleContext
ParserInterpreter. parse(int startRuleIndex)
Begin parsing at startRuleIndexMethods in org.antlr.v4.runtime with parameters of type ParserRuleContext Modifier and Type Method Description void
ParserRuleContext. copyFrom(ParserRuleContext ctx)
COPY a ctx (I'm deliberately not using copy constructor) to avoid confusion with creating node with parent.protected InterpreterRuleContext
ParserInterpreter. createInterpreterRuleContext(ParserRuleContext parent, int invokingStateNumber, int ruleIndex)
Provide simple "factory" for InterpreterRuleContext's.void
Parser.TraceListener. enterEveryRule(ParserRuleContext ctx)
void
Parser.TrimToSizeListener. enterEveryRule(ParserRuleContext ctx)
void
Parser. enterOuterAlt(ParserRuleContext localctx, int altNum)
void
Parser. enterRecursionRule(ParserRuleContext localctx, int ruleIndex)
Deprecated.void
Parser. enterRecursionRule(ParserRuleContext localctx, int state, int ruleIndex, int precedence)
void
ParserInterpreter. enterRecursionRule(ParserRuleContext localctx, int state, int ruleIndex, int precedence)
void
Parser. enterRule(ParserRuleContext localctx, int state, int ruleIndex)
Always called by generated parsers upon entry to a rule.void
Parser.TraceListener. exitEveryRule(ParserRuleContext ctx)
void
Parser.TrimToSizeListener. exitEveryRule(ParserRuleContext ctx)
void
Parser. pushNewRecursionContext(ParserRuleContext localctx, int state, int ruleIndex)
LikeParser.enterRule(org.antlr.v4.runtime.ParserRuleContext, int, int)
but for recursive rules.void
Parser. setContext(ParserRuleContext ctx)
void
Parser. unrollRecursionContexts(ParserRuleContext _parentctx)
Constructors in org.antlr.v4.runtime with parameters of type ParserRuleContext Constructor Description InterpreterRuleContext(ParserRuleContext parent, int invokingStateNumber, int ruleIndex)
Constructs a newInterpreterRuleContext
with the specified parent, invoking state, and rule index.NoViableAltException(Parser recognizer, TokenStream input, Token startToken, Token offendingToken, ATNConfigSet deadEndConfigs, ParserRuleContext ctx)
ParserRuleContext(ParserRuleContext parent, int invokingStateNumber)
RecognitionException(String message, Recognizer<?,?> recognizer, IntStream input, ParserRuleContext ctx)
RecognitionException(Recognizer<?,?> recognizer, IntStream input, ParserRuleContext ctx)
RuleContextWithAltNum(ParserRuleContext parent, int invokingStateNumber)
-
Uses of ParserRuleContext in org.antlr.v4.runtime.atn
Fields in org.antlr.v4.runtime.atn declared as ParserRuleContext Modifier and Type Field Description protected ParserRuleContext
ParserATNSimulator. _outerContext
Methods in org.antlr.v4.runtime.atn with parameters of type ParserRuleContext Modifier and Type Method Description int
ParserATNSimulator. adaptivePredict(TokenStream input, int decision, ParserRuleContext outerContext)
int
ProfilingATNSimulator. adaptivePredict(TokenStream input, int decision, ParserRuleContext outerContext)
protected boolean
ParserATNSimulator. evalSemanticContext(SemanticContext pred, ParserRuleContext parserCallStack, int alt, boolean fullCtx)
Evaluate a semantic context within a specific parser context.protected BitSet
ParserATNSimulator. evalSemanticContext(DFAState.PredPrediction[] predPredictions, ParserRuleContext outerContext, boolean complete)
Look through a list of predicate/alt pairs, returning alts for the pairs that win.protected boolean
ProfilingATNSimulator. evalSemanticContext(SemanticContext pred, ParserRuleContext parserCallStack, int alt, boolean fullCtx)
protected int
ParserATNSimulator. execATN(DFA dfa, DFAState s0, TokenStream input, int startIndex, ParserRuleContext outerContext)
Performs ATN simulation to compute a predicted alternative based upon the remaining input, but also updates the DFA cache to avoid having to traverse the ATN again for the same input sequence.protected int
ParserATNSimulator. execATNWithFullContext(DFA dfa, DFAState D, ATNConfigSet s0, TokenStream input, int startIndex, ParserRuleContext outerContext)
protected int
ParserATNSimulator. getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(ATNConfigSet configs, ParserRuleContext outerContext)
This method is used to improve the localization of error messages by choosing an alternative rather than throwing aNoViableAltException
in particular prediction scenarios where theATNSimulator.ERROR
state was reached during ATN simulation.protected NoViableAltException
ParserATNSimulator. noViableAlt(TokenStream input, ParserRuleContext outerContext, ATNConfigSet configs, int startIndex)
protected Pair<ATNConfigSet,ATNConfigSet>
ParserATNSimulator. splitAccordingToSemanticValidity(ATNConfigSet configs, ParserRuleContext outerContext)
Walk the list of configurations and split them according to those that have preds evaluating to true/false. -
Uses of ParserRuleContext in org.antlr.v4.runtime.tree
Methods in org.antlr.v4.runtime.tree that return ParserRuleContext Modifier and Type Method Description static ParserRuleContext
Trees. getRootOfSubtreeEnclosingRegion(ParseTree t, int startTokenIndex, int stopTokenIndex)
Find smallest subtree of t enclosing range startTokenIndex..stopTokenIndex inclusively using postorder traversal.Methods in org.antlr.v4.runtime.tree with parameters of type ParserRuleContext Modifier and Type Method Description void
ParseTreeListener. enterEveryRule(ParserRuleContext ctx)
void
ParseTreeListener. exitEveryRule(ParserRuleContext ctx)
static void
Trees. stripChildrenOutOfRange(ParserRuleContext t, ParserRuleContext root, int startIndex, int stopIndex)
Replace any subtree siblings of root that are completely to left or right of lookahead range with a CommonToken(Token.INVALID_TYPE,"...") node. -
Uses of ParserRuleContext in org.antlr.v4.tool
Subclasses of ParserRuleContext in org.antlr.v4.tool Modifier and Type Class Description class
GrammarInterpreterRuleContext
AnInterpreterRuleContext
that knows which alternative for a rule was matched.Methods in org.antlr.v4.tool that return types with arguments of type ParserRuleContext Modifier and Type Method Description static List<ParserRuleContext>
GrammarParserInterpreter. getAllPossibleParseTrees(Grammar g, Parser originalParser, TokenStream tokens, int decision, BitSet alts, int startIndex, int stopIndex, int startRuleIndex)
Given an ambiguous parse information, return the list of ambiguous parse trees.static List<ParserRuleContext>
GrammarParserInterpreter. getLookaheadParseTrees(Grammar g, ParserInterpreter originalParser, TokenStream tokens, int startRuleIndex, int decision, int startIndex, int stopIndex)
Return a list of parse trees, one for each alternative in a decision given the same input.Methods in org.antlr.v4.tool with parameters of type ParserRuleContext Modifier and Type Method Description protected InterpreterRuleContext
GrammarParserInterpreter. createInterpreterRuleContext(ParserRuleContext parent, int invokingStateNumber, int ruleIndex)
Constructors in org.antlr.v4.tool with parameters of type ParserRuleContext Constructor Description GrammarInterpreterRuleContext(ParserRuleContext parent, int invokingStateNumber, int ruleIndex)
-