Implementation of an LALR parser in Java