protected DFAState AddDFAEdge(DFAState from,
int t,
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.
*/
bool suppressEdge = q.hasSemanticContext;
q.hasSemanticContext = false;
DFAState to = AddDFAState(q);
if (suppressEdge)
{
return to;
}
AddDFAEdge(from, t, to);
return to;
}