protected void AddDFAEdge(DFAState p, int t, DFAState q)
{
if (t < MIN_DFA_EDGE || t > MAX_DFA_EDGE)
{
// Only track edges within the DFA bounds
return;
}
if (debug)
{
Console.WriteLine("EDGE " + p + " -> " + q + " upon " + ((char)t));
}
lock (p)
{
if (p.edges == null)
{
// make room for tokens 1..n and -1 masquerading as index 0
p.edges = new DFAState[MAX_DFA_EDGE - MIN_DFA_EDGE + 1];
}
p.edges[t - MIN_DFA_EDGE] = q; // connect
}
}