A PEG Packrat Parser Generator for JavaScript

I am releasing an MIT-licensed JavaScript packrat parser generator based on parser expression grammars or PEGs.

A parser generator takes a description of the grammar of a language (in this case in the form of a PEG) and gives back a parser (in this case a JavaScript program) which can then take an input conforming to that grammar and give back a parse tree.

This is the first release and more API features will be coming. Currently it is possible to generate a pure JavaScript parser from a PEG. The generated parser is a JavaScript function which takes a string and returns a parse tree or an error. For full details see the API docs.

There are two demo pages, one shows a simple arithmetic expression parser, and the second shows a parser for the full ECMAScript 5 grammar.

If you're interested in trying the code, read the API docs, get the code, and please report any problems or questions to inimino@inimino.org, or stop by #inimino on freenode IRC.

Update 2010-03-30

Note: the above links are to the first release, but a new version 0.0.5 is available.

2010-03-08: PEG Roadmap

2010-03-26: fixed broken links to README and code

2010-03-30: added link to new version