Pharsec, a parser combinator library in PHP Pharsec lets you write powerful parsers with a very simple syntax. For an example of what you can do with Pharsec, see POD, a small language compiling to PHP.