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.
Map a predicate to a predicted alternative. |
| Modifier and Type | Field and Description |
|---|---|
| public ATNConfigSet | |
| public DFAState[] | edges
|
| public boolean | |
| public LexerActionExecutor | |
| public DFAState. | predicates
During SLL parsing, this is a list of predicates associated with the ATN configurations of the DFA state. |
| public int | prediction
if accept state, what ttype do we match or alt do we predict? |
| public boolean | requiresFullContext
Indicates that this state was created during SLL prediction that discovered a conflict between the configurations in the state. |
| public int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| 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 Set | |
| public int | |
| public String |
| configs | back to summary |
|---|---|
| public ATNConfigSet configs | |
| edges | back to summary |
|---|---|
| public DFAState[] edges
| |
| isAcceptState | back to summary |
|---|---|
| public boolean isAcceptState | |
| lexerActionExecutor | back to summary |
|---|---|
| public LexerActionExecutor lexerActionExecutor | |
| predicates | back to summary |
|---|---|
| public DFAState. During SLL parsing, this is a list of predicates associated with the
ATN configurations of the DFA state. When we have predicates,
We only use these for non- This list is computed by | |
| prediction | back to summary |
|---|---|
| public int prediction if accept state, what ttype do we match or alt do we predict?
This is set to | |
| requiresFullContext | back to summary |
|---|---|
| public boolean requiresFullContext Indicates that this state was created during SLL prediction that
discovered a conflict between the configurations in the state. Future
| |
| stateNumber | back to summary |
|---|---|
| public int stateNumber | |
| DFAState | back to summary |
|---|---|
| public DFAState() | |
| DFAState | back to summary |
|---|---|
| public DFAState(int stateNumber) | |
| DFAState | back to summary |
|---|---|
| public DFAState(ATNConfigSet configs) | |
| 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
| |
| getAltSet | back to summary |
|---|---|
| public Set Get the set of all alts mentioned by all ATN configurations in this DFA state. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| 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 |
| 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. | |