I use a set of ATNConfig objects not simple states. An ATNConfig is both a state (ala normal conversion) and a RuleContext describing the chain of rules (if any) followed to arrive at that state.
A DFA state may have multiple references to a particular state, but with different ATN contexts (with same or different alts) meaning that state was reached via a different set of rule invocations.
| Modifier and Type | Class and Description |
|---|---|
| public static class | DFAState.PredPrediction
Map a predicate to a predicted alternative. |
| Modifier and Type | Field and Description |
|---|---|
| private AcceptStateInfo | |
| public final ATNConfigSet | |
| private volatile AbstractEdgeMap | contextEdges
These keys for these edges are the top level element of the global context. |
| private BitSet | contextSymbols
Symbols in this set require a global context transition before matching an input symbol. |
| private volatile AbstractEdgeMap | edges
|
| public DFAState. | predicates
This list is computed by |
| public int |
| Access | Constructor and Description |
|---|---|
| public | DFAState(DFA
The DFA. dfa, ATNConfigSet The set of ATN configurations defining this state. configs)Constructs a new |
| public | DFAState(EmptyEdgeMap<DFAState>
The empty edge map. emptyEdges, EmptyEdgeMap<DFAState> The empty context edge map. emptyContextEdges, ATNConfigSet The set of ATN configurations defining this state. configs)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. DFAState instances are equal if their ATN configuration sets
are the same.
|
| public final AcceptStateInfo | |
| public Map | |
| public synchronized DFAState | |
| public Map | |
| public final LexerActionExecutor | |
| public final int | |
| public DFAState | |
| public int | |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public final void | |
| public void | |
| public final void | |
| public synchronized void | |
| public void | |
| public String |
| acceptStateInfo | back to summary |
|---|---|
| private AcceptStateInfo acceptStateInfo | |
| configs | back to summary |
|---|---|
| public final ATNConfigSet configs
| |
| contextEdges | back to summary |
|---|---|
| private volatile AbstractEdgeMap<DFAState> contextEdges These keys for these edges are the top level element of the global context. | |
| contextSymbols | back to summary |
|---|---|
| private BitSet contextSymbols Symbols in this set require a global context transition before matching an input symbol. | |
| edges | back to summary |
|---|---|
| private volatile AbstractEdgeMap<DFAState> edges
| |
| predicates | back to summary |
|---|---|
| public DFAState. This list is computed by | |
| stateNumber | back to summary |
|---|---|
| public int stateNumber | |
| DFAState | back to summary |
|---|---|
| public DFAState(DFA dfa, ATNConfigSet configs) Constructs a new This constructor initializes the DFA state using empty edge maps provided by the specified DFA.
| |
| DFAState | back to summary |
|---|---|
| public DFAState(EmptyEdgeMap<DFAState> emptyEdges, EmptyEdgeMap<DFAState> emptyContextEdges, ATNConfigSet configs) Constructs a new The empty maps provided to this constructor contain information about the range of edge values which are allowed to be stored in the map. Since edges outside the allowed range are simply dropped from the DFA, this offers several potential benefits:
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Two Because the number of alternatives and number of ATN configurations are finite, there is a finite number of DFA states that can be processed. This is necessary to show that the algorithm terminates. Cannot test the DFA state numbers here because in
| |
| getAcceptStateInfo | back to summary |
|---|---|
| public final AcceptStateInfo getAcceptStateInfo() | |
| getContextEdgeMap | back to summary |
|---|---|
| public Map | |
| getContextTarget | back to summary |
|---|---|
| public synchronized DFAState getContextTarget(int invokingState) | |
| getEdgeMap | back to summary |
|---|---|
| public Map | |
| getLexerActionExecutor | back to summary |
|---|---|
| public final LexerActionExecutor getLexerActionExecutor() | |
| getPrediction | back to summary |
|---|---|
| public final int getPrediction() | |
| getTarget | back to summary |
|---|---|
| public DFAState getTarget(int symbol) | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isAcceptState | back to summary |
|---|---|
| public final boolean isAcceptState() | |
| isContextSensitive | back to summary |
|---|---|
| public final boolean isContextSensitive() | |
| isContextSymbol | back to summary |
|---|---|
| public final boolean isContextSymbol(int symbol) | |
| setAcceptState | back to summary |
|---|---|
| public final void setAcceptState(AcceptStateInfo acceptStateInfo) | |
| setContextSensitive | back to summary |
|---|---|
| public void setContextSensitive(ATN atn) | |
| setContextSymbol | back to summary |
|---|---|
| public final void setContextSymbol(int symbol) | |
| setContextTarget | back to summary |
|---|---|
| public synchronized void setContextTarget(int invokingState, DFAState target) | |
| setTarget | back to summary |
|---|---|
| public void setTarget(int symbol, DFAState target) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| public int | |
| public SemanticContext |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String |
| alt | back to summary |
|---|---|
| public int alt | |
| pred | back to summary |
|---|---|
| public SemanticContext pred
| |
| PredPrediction | back to summary |
|---|---|
| public PredPrediction(SemanticContext pred, int alt) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |