Top Description Fields Constructors Methods
org.antlr.v4.runtime

public Class RuleContextWithAltNum

extends ParserRuleContext
Class Inheritance
Imports
org.antlr.v4.runtime.atn.ATN

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

Modifier and TypeField and Description
private int
Inherited from org.antlr.v4.runtime.ParserRuleContext:
childrenexceptionstartstop

Constructor Summary

AccessConstructor and Description
public
public
RuleContextWithAltNum(ParserRuleContext parent, int invokingStateNumber)

Method Summary

Modifier and TypeMethod and Description
public int
getAltNumber()

Overrides org.antlr.v4.runtime.RuleContext.getAltNumber.

For rule associated with this parse tree internal node, return the outer alternative number used to match the input.
public void
setAltNumber(int altNum)

Overrides org.antlr.v4.runtime.RuleContext.setAltNumber.

Set the outer alternative number for this context node.
Inherited from org.antlr.v4.runtime.ParserRuleContext:
addAnyChildaddChildaddChildaddChildaddErrorNodeaddErrorNodecopyFromemptyContextenterRuleexitRulegetChildgetChildgetChildCountgetParentgetRuleContextgetRuleContextsgetSourceIntervalgetStartgetStopgetTokengetTokensremoveLastChildtoInfoString

Field Detail

altNumberback to summary
private int altNumber

Constructor Detail

RuleContextWithAltNumback to summary
public RuleContextWithAltNum()
RuleContextWithAltNumback to summary
public RuleContextWithAltNum(ParserRuleContext parent, int invokingStateNumber)

Method Detail

getAltNumberback to summary
public int getAltNumber()

Overrides org.antlr.v4.runtime.RuleContext.getAltNumber.

Doc from org.antlr.v4.runtime.RuleContext.getAltNumber.

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.

Annotations
@Override
setAltNumberback to summary
public void setAltNumber(int altNum)

Overrides org.antlr.v4.runtime.RuleContext.setAltNumber.

Doc from org.antlr.v4.runtime.RuleContext.setAltNumber.

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.

Annotations
@Override