Deterministic finite automaton simulator