skip to navigation
skip to content

PrattParse 0.2

Toolbox for writing Pratt parsers

Downloads ↓ | Package Documentation

In the 70s, Vaughan Pratt published a paper describing a "Top Down Operator Precedence parser". Also known as "Pratt parser", it is a simple, terse and efficient approach to top-down parsing. Although this approach never received as much attention as some think it deserves, a few clever guys have re-discovered it and spread the word:

If you want a throughout introduction to the technique, any of these articles will do. I suppose most will find the second useful as it uses Python, but if you speak Javascript or Java, the others work as well.

This package, PrattParse, is a minimalistic toolsbox for writing such parsers and offers:

  • A bare-bones parser with the parsing primitives to add symbols and actions to.
  • Various helper functions that seem to crop up every single time someone writes a Pratt parser.
  • Lack of global state, allowing multiple different parsers to work side by side.

Disclaimer

This is a work-in progress. Embarassing bugs, breaking changes, radical design/API changes, etc. are to be expected for the first few versions.

 
File Type Py Version Uploaded on Size # downloads
PrattParse-0.2.tar.gz (md5) Source 2011-07-10 209KB 257