protected DFAState ComputeTargetState(ICharStream input, DFAState s, int t)
{
ATNConfigSet reach = new OrderedATNConfigSet();
// if we don't find an existing DFA state
// Fill reach starting from closure, following t transitions
GetReachableConfigSet(input, s.configSet, reach, t);
if (reach.Empty)
{ // we got nowhere on t from s
if (!reach.hasSemanticContext)
{
// we got nowhere on t, don't throw out this knowledge; it'd
// cause a failover from DFA later.
AddDFAEdge(s, t, ERROR);
}
// stop when we can't match any more char
return ERROR;
}
// Add an edge from s to target DFA found/created for reach
return AddDFAEdge(s, t, reach);
}