use of org.antlr.v4.runtime.atn.ATNConfigSet in project antlr4 by tunnelvisionlabs.
the class LexerATNSimulator method addDFAEdge.
@NotNull
protected DFAState addDFAEdge(@NotNull DFAState from, int t, @NotNull ATNConfigSet q) {
/* leading to this call, ATNConfigSet.hasSemanticContext is used as a
* marker indicating dynamic predicate evaluation makes this edge
* dependent on the specific input sequence, so the static edge in the
* DFA should be omitted. The target DFAState is still created since
* execATN has the ability to resynchronize with the DFA state cache
* following the predicate evaluation step.
*
* TJP notes: next time through the DFA, we see a pred again and eval.
* If that gets us to a previously created (but dangling) DFA
* state, we can continue in pure DFA mode from there.
*/
boolean suppressEdge = q.hasSemanticContext();
if (suppressEdge) {
q.clearExplicitSemanticContext();
}
@NotNull DFAState to = addDFAState(q);
if (suppressEdge) {
return to;
}
addDFAEdge(from, t, to);
return to;
}
Aggregations