Implements simple Deterministic Finite Automata machine