Implement helper to find whether state in regex automaton is reachable without consuming input
Description
Since multiple rules require finding whether a state can reach another state without consuming input, there should be a common helper to accomplish this. This method should perform a simple DFS that only traverses epsilon edges.
We could also calculate the length of the shortest path and check that it's zero, but this is simpler and more efficient.
Since multiple rules require finding whether a state can reach another state without consuming input, there should be a common helper to accomplish this. This method should perform a simple DFS that only traverses epsilon edges.
We could also calculate the length of the shortest path and check that it's zero, but this is simpler and more efficient.