| java.lang.Object org.antlr.analysis.NFAConfiguration
NFAConfiguration | public class NFAConfiguration (Code) | | An NFA state, predicted alt, and syntactic/semantic context.
The syntactic context is a pointer into the rule invocation
chain used to arrive at the state. The semantic context is
the unordered set semantic predicates encountered before reaching
an NFA state.
|
Method Summary | |
public boolean | equals(Object o) An NFA configuration is equal to another if both have
the same state, the predict the same alternative, and
syntactic/semantic contexts are the same. | public int | hashCode() | public String | toString() | public String | toString(boolean showAlt) |
alt | public int alt(Code) | | What alt is predicted by this configuration
|
context | public NFAContext context(Code) | | What is the stack of rule invocations that got us to state?
|
numberEpsilonTransitionsEmanatingFromState | protected int numberEpsilonTransitionsEmanatingFromState(Code) | | Lots of NFA states have only epsilon edges (1 or 2). We can
safely consider only n>0 during closure.
|
resolveWithPredicate | protected boolean resolveWithPredicate(Code) | | This bit is used to indicate a semantic predicate will be
used to resolve the conflict. Method
DFA.findNewDFAStatesAndAddDFATransitions will add edges for
the predicates after it performs the reach operation. The
nondeterminism resolver sets this when it finds a set of
nondeterministic configurations (as it does for "resolved" field)
that have enough predicates to resolve the conflit.
|
resolved | protected boolean resolved(Code) | | Indicate that this configuration has been resolved and no further
DFA processing should occur with it. Essentially, this is used
as an "ignore" bit so that upon a set of nondeterministic configurations
such as (s|2) and (s|3), I can set (s|3) to resolved=true (and any
other configuration associated with alt 3).
|
semanticContext | public SemanticContext semanticContext(Code) | | The set of semantic predicates associated with this NFA
configuration. The predicates were found on the way to
the associated NFA state in this syntactic context.
Set: track nodes in grammar containing the predicate
for error messages and such (nice to know where the predicate
came from in case of duplicates etc...). By using a set,
the equals() method will correctly show {pred1,pred2} as equals()
to {pred2,pred1}.
|
singleAtomTransitionEmanating | protected boolean singleAtomTransitionEmanating(Code) | | Indicates that the NFA state associated with this configuration
has exactly one transition and it's an atom (not epsilon etc...).
|
state | public int state(Code) | | The NFA state associated with this configuration
|
equals | public boolean equals(Object o)(Code) | | An NFA configuration is equal to another if both have
the same state, the predict the same alternative, and
syntactic/semantic contexts are the same. I don't think
the state|alt|ctx could be the same and have two different
semantic contexts, but might as well define equals to be
everything.
|
hashCode | public int hashCode()(Code) | | |
|
|