Same lexical analyzer but made in Java