getExistingTargetState method

DFAState? getExistingTargetState(
  1. DFAState previousD,
  2. int t
)

Get an existing target state for an edge in the DFA. If the target state for the edge has not yet been computed or is otherwise not available, this method returns null.

@param previousD The current DFA state @param t The next input symbol @return The existing target DFA state for the given input symbol t, or null if the target state for this edge is not already cached

Implementation

DFAState? getExistingTargetState(DFAState previousD, int t) {
  final edges = previousD.edges;
  if (edges == null || t + 1 < 0 || t + 1 >= edges.length) {
    return null;
  }

  return edges[t + 1];
}