Class RuleContextWithAltNum
java.lang.Object
org.graalvm.shadowed.org.antlr.v4.runtime.RuleContext
org.graalvm.shadowed.org.antlr.v4.runtime.ParserRuleContext
org.graalvm.shadowed.org.antlr.v4.runtime.RuleContextWithAltNum
- All Implemented Interfaces:
ParseTree,RuleNode,SyntaxTree,Tree
A handy class for use with
options {contextSuperClass=org.graalvm.shadowed.org.antlr.v4.runtime.RuleContextWithAltNum;}
that provides a backing field / impl for the outer alternative number
matched for an internal parse tree node.
I'm only putting into Java runtime as I'm certain I'm the only one that
will really every use this.
-
Field Summary
FieldsFields inherited from class org.graalvm.shadowed.org.antlr.v4.runtime.ParserRuleContext
children, EMPTY, exception, start, stopFields inherited from class org.graalvm.shadowed.org.antlr.v4.runtime.RuleContext
invokingState, parent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintFor rule associated with this parse tree internal node, return the outer alternative number used to match the input.voidsetAltNumber(int altNum) Set the outer alternative number for this context node.Methods inherited from class org.graalvm.shadowed.org.antlr.v4.runtime.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 org.graalvm.shadowed.org.antlr.v4.runtime.RuleContext
accept, depth, getPayload, getRuleContext, getRuleIndex, getText, isEmpty, setParent, toString, toString, toString, toString, toString, toStringTree, toStringTree, toStringTree
-
Field Details
-
altNum
public int altNum
-
-
Constructor Details
-
RuleContextWithAltNum
public RuleContextWithAltNum() -
RuleContextWithAltNum
-
-
Method Details
-
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 altNum) 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
-