PHP implementation of LALR grammar parser