Class GrammarInterpreterRuleContext
java.lang.Object
org.antlr.v4.runtime.RuleContext
org.antlr.v4.runtime.ParserRuleContext
org.antlr.v4.runtime.InterpreterRuleContext
org.antlr.v4.tool.GrammarInterpreterRuleContext
- All Implemented Interfaces:
ParseTree, RuleNode, SyntaxTree, Tree
An
InterpreterRuleContext that knows which alternative
for a rule was matched.- Since:
- 4.5.1
- See Also:
-
Field Summary
FieldsFields inherited from class InterpreterRuleContext
ruleIndexFields inherited from class RuleContext
invokingState, parent -
Constructor Summary
ConstructorsConstructorDescriptionGrammarInterpreterRuleContext(ParserRuleContext parent, int invokingStateNumber, int ruleIndex) -
Method Summary
Modifier and TypeMethodDescriptionintFor rule associated with this parse tree internal node, return the outer alternative number used to match the input.intThe predicted outermost alternative for the rule associated with this context object.voidsetAltNumber(int altNumber) Set the outer alternative number for this context node.voidsetOuterAltNum(int outerAltNum) Methods inherited from class InterpreterRuleContext
getRuleIndexMethods inherited from class ParserRuleContext
addAnyChild, addChild, addChild, addChild, addErrorNode, addErrorNode, copyFrom, enterRule, exitRule, getChild, getChild, getChildCount, getParent, getRuleContext, getRuleContexts, getSourceInterval, getStart, getStop, getToken, getTokens, removeLastChild, toInfoStringMethods inherited from class RuleContext
accept, depth, getPayload, getRuleContext, getText, isEmpty, setParent, toString, toString, toString, toString, toString, toStringTree, toStringTree, toStringTree
-
Field Details
-
outerAltNum
protected int outerAltNum
-
-
Constructor Details
-
GrammarInterpreterRuleContext
public GrammarInterpreterRuleContext(ParserRuleContext parent, int invokingStateNumber, int ruleIndex)
-
-
Method Details
-
getOuterAltNum
public int getOuterAltNum()The predicted outermost alternative for the rule associated with this context object. If this node left recursive, the true original outermost alternative is returned. -
setOuterAltNum
public void setOuterAltNum(int outerAltNum) -
getAltNumber
public int getAltNumber()Description copied from class:RuleContextFor rule associated with this parse tree internal node, return the outer alternative number used to match the input. Default implementation does not compute nor store this alt num. Create a subclass of ParserRuleContext with backing field and set option contextSuperClass. to set it.- Overrides:
getAltNumberin classRuleContext
-
setAltNumber
public void setAltNumber(int altNumber) Description copied from class:RuleContextSet the outer alternative number for this context node. Default implementation does nothing to avoid backing field overhead for trees that don't need it. Create a subclass of ParserRuleContext with backing field and set option contextSuperClass.- Overrides:
setAltNumberin classRuleContext
-