![JAR search and dependency download from the Maven repository](/logo.png)
Java.target.apidocs.org.antlr.v4.runtime.RuleContextWithAltNum.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of antlr4-perf-testsuite Show documentation
Show all versions of antlr4-perf-testsuite Show documentation
The ANTLR 4 grammar compiler.
RuleContextWithAltNum (ANTLR 4 Runtime (Optimized) 4.13.1.3 API)
org.antlr.v4.runtime
Class RuleContextWithAltNum
- java.lang.Object
-
- org.antlr.v4.runtime.RuleContext
-
- org.antlr.v4.runtime.ParserRuleContext
-
- org.antlr.v4.runtime.RuleContextWithAltNum
-
- All Implemented Interfaces:
- ParseTree, RuleNode, SyntaxTree, Tree
public class RuleContextWithAltNum
extends ParserRuleContext
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.
I'm only putting into Java runtime as I'm certain I'm the only one that
will really every use this.
-
-
Field Summary
-
Fields inherited from class org.antlr.v4.runtime.ParserRuleContext
children, exception, start, stop
-
Fields inherited from class org.antlr.v4.runtime.RuleContext
invokingState, parent
-
Constructor Summary
Constructors
Constructor and Description
RuleContextWithAltNum()
RuleContextWithAltNum(ParserRuleContext parent,
int invokingStateNumber)
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
int
getAltNumber()
For rule associated with this parse tree internal node, return
the outer alternative number used to match the input.
void
setAltNumber(int altNum)
Set the outer alternative number for this context node.
-
Methods inherited from class org.antlr.v4.runtime.ParserRuleContext
addAnyChild, addChild, addChild, addChild, addErrorNode, addErrorNode, copyFrom, emptyContext, enterRule, exitRule, getChild, getChild, getChildCount, getParent, getRuleContext, getRuleContexts, getSourceInterval, getStart, getStop, getToken, getTokens, removeLastChild, toInfoString
-
Methods inherited from class org.antlr.v4.runtime.RuleContext
accept, depth, getChildContext, getPayload, getRuleContext, getRuleIndex, getText, isEmpty, setParent, toString, toString, toString, toString, toString, toStringTree, toStringTree, toStringTree
-
-
Constructor Detail
-
RuleContextWithAltNum
public RuleContextWithAltNum()
-
RuleContextWithAltNum
public RuleContextWithAltNum(ParserRuleContext parent,
int invokingStateNumber)
-
Method Detail
-
getAltNumber
public int getAltNumber()
Description copied from class: RuleContext
For 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:
getAltNumber
in class RuleContext
-
setAltNumber
public void setAltNumber(int altNum)
Description copied from class: RuleContext
Set 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:
setAltNumber
in class RuleContext
Copyright © 1992–2023 Daniel Sun. All rights reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy