## PLY and pycparser (and SPARK)

From: andrew cooke <andrew@...>

Date: Fri, 22 Jun 2012 14:56:53 -0400

I am using pycparser at work to parse C code.  It is a very nicely written
library that is a pleasure to read and which uses PLY to do the heavy lifting.
PLY is a lex/yacc implementation in Python, which means it's fairly efficient
even though it's pure Python.

From looking at the pycparser code it seems that you use PLY by placing the
grammar in docstrings for the methods that are called to process the results.
That looked very familiar - turns out I was remembering an old paper
"Compiling Little Languages in Python" by John Aycock -
http://pages.cpsc.ucalgary.ca/~aycock/spark/

Anyway, pycparser is at http://code.google.com/p/pycparser/ and PLY at
http://www.dabeaz.com/ply/

Andrew