PHP Lexer and Parser Generator?

I'd propose to give ANTLR a try. ANTLRWorks might be helpful.

I wrote an LL(1) parser generator myself in pure PHP, since I wasn't aware of other PHP-based solutions.


I've ported Jison, a Bison clone in javascript, to php. The results are a killer parser, able to handle very simple and very complex lexing/parsing. It is now part of Jison, but there are a few updates in my fork.

The files are here. See the readme in that page, you create a javascript and php parser at the same time that are capable of doing the same or different things.

It is stable, fast, easy and fun to use.


There is PEG for php https://github.com/hafriedlander/php-peg