Package org.antlr.v4.runtime.dfa
Class DFA
java.lang.Object
org.antlr.v4.runtime.dfa.DFA
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal DecisionState
From which ATN state did we create this DFA?final int
private final boolean
true
if this DFA is for a precedence decision; otherwise,false
.A set of all DFA states. -
Constructor Summary
ConstructorsConstructorDescriptionDFA
(DecisionState atnStartState) DFA
(DecisionState atnStartState, int decision) -
Method Summary
Modifier and TypeMethodDescriptionfinal DFAState
getPrecedenceStartState
(int precedence) Get the start state for a specific precedence value.Return a list of all states in this DFA, ordered by state number.final boolean
Gets whether this DFA is a precedence DFA.final void
setPrecedenceDfa
(boolean precedenceDfa) Deprecated.This method no longer performs any action.final void
setPrecedenceStartState
(int precedence, DFAState startState) Set the start state for a specific precedence value.toString()
Deprecated.UsetoString(Vocabulary)
instead.toString
(Vocabulary vocabulary)
-
Field Details
-
states
-
s0
-
decision
public final int decision -
atnStartState
From which ATN state did we create this DFA? -
precedenceDfa
private final boolean precedenceDfatrue
if this DFA is for a precedence decision; otherwise,false
. This is the backing field forisPrecedenceDfa()
.
-
-
Constructor Details
-
DFA
-
DFA
-
-
Method Details
-
isPrecedenceDfa
public final boolean isPrecedenceDfa()Gets whether this DFA is a precedence DFA. Precedence DFAs use a special start states0
which is not stored instates
. TheDFAState.edges
array for this start state contains outgoing edges supplying individual start states corresponding to specific precedence values.- Returns:
true
if this is a precedence DFA; otherwise,false
.- See Also:
-
getPrecedenceStartState
Get the start state for a specific precedence value.- Parameters:
precedence
- The current precedence.- Returns:
- The start state corresponding to the specified precedence, or
null
if no start state exists for the specified precedence. - Throws:
IllegalStateException
- if this is not a precedence DFA.- See Also:
-
setPrecedenceStartState
Set the start state for a specific precedence value.- Parameters:
precedence
- The current precedence.startState
- The start state corresponding to the specified precedence.- Throws:
IllegalStateException
- if this is not a precedence DFA.- See Also:
-
setPrecedenceDfa
Deprecated.This method no longer performs any action.Sets whether this is a precedence DFA.- Parameters:
precedenceDfa
-true
if this is a precedence DFA; otherwise,false
- Throws:
UnsupportedOperationException
- ifprecedenceDfa
does not match the value ofisPrecedenceDfa()
for the current DFA.
-
getStates
Return a list of all states in this DFA, ordered by state number. -
toString
-
toString
Deprecated.UsetoString(Vocabulary)
instead. -
toString
-
toLexerString
-