Java based Finite State Automata