changed automaton implementation to be independent from dk.brics.automaton