public class DFA extends Object
| Modifier and Type | Field and Description |
|---|---|
ATNState |
atnStartState
From which ATN state did we create this DFA?
|
int |
decision |
AtomicReference<DFAState> |
s0 |
AtomicReference<DFAState> |
s0full |
ConcurrentMap<DFAState,DFAState> |
states
A set of all DFA states.
|
| Constructor and Description |
|---|
DFA(ATNState atnStartState) |
DFA(ATNState atnStartState,
int decision) |
| Modifier and Type | Method and Description |
|---|---|
DFAState |
addState(DFAState state) |
EmptyEdgeMap<DFAState> |
getEmptyContextEdgeMap() |
EmptyEdgeMap<DFAState> |
getEmptyEdgeMap() |
int |
getMaxDfaEdge() |
int |
getMinDfaEdge() |
DFAState |
getPrecedenceStartState(int precedence,
boolean fullContext)
Get the start state for a specific precedence value.
|
boolean |
isContextSensitive() |
boolean |
isEmpty() |
boolean |
isPrecedenceDfa()
Gets whether this DFA is a precedence DFA.
|
void |
setPrecedenceDfa(boolean precedenceDfa)
Sets whether this is a precedence DFA.
|
void |
setPrecedenceStartState(int precedence,
boolean fullContext,
DFAState startState)
Set the start state for a specific precedence value.
|
String |
toLexerString() |
String |
toString() |
String |
toString(String[] tokenNames) |
String |
toString(String[] tokenNames,
String[] ruleNames) |
@NotNull public final ConcurrentMap<DFAState,DFAState> states
@NotNull public final AtomicReference<DFAState> s0
@NotNull public final AtomicReference<DFAState> s0full
public final int decision
public final int getMinDfaEdge()
public final int getMaxDfaEdge()
@NotNull public EmptyEdgeMap<DFAState> getEmptyEdgeMap()
@NotNull public EmptyEdgeMap<DFAState> getEmptyContextEdgeMap()
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, boolean fullContext)
precedence - The current precedence.null if no start state exists for the specified precedence.IllegalStateException - if this is not a precedence DFA.isPrecedenceDfa()public final void setPrecedenceStartState(int precedence,
boolean fullContext,
DFAState startState)
precedence - The current precedence.startState - The start state corresponding to the specified
precedence.IllegalStateException - if this is not a precedence DFA.isPrecedenceDfa()public final void setPrecedenceDfa(boolean precedenceDfa)
states map is clearedprecedenceDfa is false, the initial state
s0 is set to null; otherwise, it is initialized to a new
DFAState with an empty outgoing DFAState.edges array to
store the start states for individual precedence values.precedenceDfa field is updatedprecedenceDfa - true if this is a precedence DFA; otherwise,
falsepublic boolean isEmpty()
public boolean isContextSensitive()
public String toLexerString()
Copyright © 1992–2014 ANTLR. All rights reserved.