public class DFA
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
DecisionState |
atnStartState
From which ATN state did we create this DFA?
|
int |
decision |
private boolean |
precedenceDfa
true if this DFA is for a precedence decision; otherwise,
false. |
DFAState |
s0 |
java.util.Map<DFAState,DFAState> |
states
A set of all DFA states.
|
| Constructor and Description |
|---|
DFA(DecisionState atnStartState) |
DFA(DecisionState atnStartState,
int decision) |
| Modifier and Type | Method and Description |
|---|---|
DFAState |
getPrecedenceStartState(int precedence)
Get the start state for a specific precedence value.
|
java.util.List<DFAState> |
getStates()
Return a list of all states in this DFA, ordered by state number.
|
boolean |
isPrecedenceDfa()
Gets whether this DFA is a precedence DFA.
|
void |
setPrecedenceDfa(boolean precedenceDfa)
Deprecated.
This method no longer performs any action.
|
void |
setPrecedenceStartState(int precedence,
DFAState startState)
Set the start state for a specific precedence value.
|
java.lang.String |
toLexerString() |
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String[] tokenNames)
Deprecated.
Use
toString(Vocabulary) instead. |
java.lang.String |
toString(Vocabulary vocabulary) |
public final java.util.Map<DFAState,DFAState> states
Map so we can get old state back
(Set only allows you to see if it's there).public volatile DFAState s0
public final int decision
public final DecisionState atnStartState
private final boolean precedenceDfa
true if this DFA is for a precedence decision; otherwise,
false. This is the backing field for isPrecedenceDfa().public DFA(DecisionState atnStartState)
public DFA(DecisionState atnStartState, int decision)
public final boolean isPrecedenceDfa()
s0 which is not stored in states. The
DFAState.edges array for this start state contains outgoing edges
supplying individual start states corresponding to specific precedence
values.true if this is a precedence DFA; otherwise,
false.Parser.getPrecedence()public final DFAState getPrecedenceStartState(int precedence)
precedence - The current precedence.null if no start state exists for the specified precedence.java.lang.IllegalStateException - if this is not a precedence DFA.isPrecedenceDfa()public final void setPrecedenceStartState(int precedence,
DFAState startState)
precedence - The current precedence.startState - The start state corresponding to the specified
precedence.java.lang.IllegalStateException - if this is not a precedence DFA.isPrecedenceDfa()@Deprecated public final void setPrecedenceDfa(boolean precedenceDfa)
precedenceDfa - true if this is a precedence DFA; otherwise,
falsejava.lang.UnsupportedOperationException - if precedenceDfa does not
match the value of isPrecedenceDfa() for the current DFA.public java.util.List<DFAState> getStates()
public java.lang.String toString()
toString in class java.lang.Object@Deprecated public java.lang.String toString(java.lang.String[] tokenNames)
toString(Vocabulary) instead.public java.lang.String toString(Vocabulary vocabulary)
public java.lang.String toLexerString()