Basic implementation of a Deterministic Finite Automaton