Package org.antlr.v4.runtime.atn
Class ATNState
java.lang.Object
org.antlr.v4.runtime.atn.ATNState
- Direct Known Subclasses:
BasicState
,BlockEndState
,DecisionState
,LoopEndState
,RuleStartState
,RuleStopState
,StarLoopbackState
The following images show the relation of states and
Greedy Closure:
Greedy Positive Closure:
Greedy Optional:
Non-Greedy Closure:
Non-Greedy Positive Closure:
Non-Greedy Optional:
transitions
for various grammar constructs.
- Solid edges marked with an ε indicate a required
EpsilonTransition
. - Dashed edges indicate locations where any transition derived from
Transition
might appear. - Dashed nodes are place holders for either a sequence of linked
BasicState
states or the inclusion of a block representing a nested construct in one of the forms below. - Nodes showing multiple outgoing alternatives with a
...
support any number of alternatives (one or more). Nodes without the...
only support the exact number of alternatives shown in the diagram.
Basic Blocks
Rule
Block of 1 or more alternatives
Greedy Loops
Greedy Closure: (...)*
Greedy Positive Closure: (...)+
Greedy Optional: (...)?
Non-Greedy Loops
Non-Greedy Closure: (...)*?
Non-Greedy Positive Closure: (...)+?
Non-Greedy Optional: (...)??
-
Field Summary
FieldsModifier and TypeFieldDescriptionWhich ATN are we in?static final int
static final int
static final int
boolean
static final int
static final int
static final int
static final int
Used to cache lookahead during parsing, not used during constructionstatic final int
static final int
static final int
static final int
int
static final int
static final int
static final int
int
static final int
protected final List
<Transition> Track the transitions emanating from this ATN state. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTransition
(int index, Transition e) void
boolean
int
abstract int
int
hashCode()
boolean
final boolean
removeTransition
(int index) void
setRuleIndex
(int ruleIndex) void
setTransition
(int i, Transition e) toString()
transition
(int i)
-
Field Details
-
INITIAL_NUM_TRANSITIONS
public static final int INITIAL_NUM_TRANSITIONS- See Also:
-
INVALID_TYPE
public static final int INVALID_TYPE- See Also:
-
BASIC
public static final int BASIC- See Also:
-
RULE_START
public static final int RULE_START- See Also:
-
BLOCK_START
public static final int BLOCK_START- See Also:
-
PLUS_BLOCK_START
public static final int PLUS_BLOCK_START- See Also:
-
STAR_BLOCK_START
public static final int STAR_BLOCK_START- See Also:
-
TOKEN_START
public static final int TOKEN_START- See Also:
-
RULE_STOP
public static final int RULE_STOP- See Also:
-
BLOCK_END
public static final int BLOCK_END- See Also:
-
STAR_LOOP_BACK
public static final int STAR_LOOP_BACK- See Also:
-
STAR_LOOP_ENTRY
public static final int STAR_LOOP_ENTRY- See Also:
-
PLUS_LOOP_BACK
public static final int PLUS_LOOP_BACK- See Also:
-
LOOP_END
public static final int LOOP_END- See Also:
-
serializationNames
-
INVALID_STATE_NUMBER
public static final int INVALID_STATE_NUMBER- See Also:
-
atn
Which ATN are we in? -
stateNumber
public int stateNumber -
ruleIndex
public int ruleIndex -
epsilonOnlyTransitions
public boolean epsilonOnlyTransitions -
transitions
Track the transitions emanating from this ATN state. -
nextTokenWithinRule
Used to cache lookahead during parsing, not used during construction
-
-
Constructor Details
-
ATNState
public ATNState()
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
isNonGreedyExitState
public boolean isNonGreedyExitState() -
toString
-
getTransitions
-
getNumberOfTransitions
public int getNumberOfTransitions() -
addTransition
-
addTransition
-
transition
-
setTransition
-
removeTransition
-
getStateType
public abstract int getStateType() -
onlyHasEpsilonTransitions
public final boolean onlyHasEpsilonTransitions() -
setRuleIndex
public void setRuleIndex(int ruleIndex)
-