[Pyrex] Codegen for C headers.

Mark Heslep mark at mitre.org
Wed Jun 28 18:10:22 UTC 2006


The subject of  automatic parsing and Pyrex code generation for C 
headers has come up on this list in the past:
http://lists.copyleft.no/pipermail/pyrex/2005-October/001496.html
http://lists.copyleft.no/pipermail/pyrex/2004-March/000643.html

As far as I know nothing stable has come to the surface thus far.   
Thomas Heller has written some code generation tools for his Ctypes 
package, with which I've had good luck (on ctypes.)  
(http://starship.python.net/crew/theller/ctypes/codegen.html)
It uses GccXML to parse and generate an XML representation, and then 
principally uses a python based code generator module to produce ctypes 
lingo.  
(http://ctypes.cvs.sourceforge.net/ctypes/ctypes/codegen/ctypes_codegen/codegenerator.py?view=log).  
It appears to me it would be straightforward to modify or merely 
subclass this module to similarly generate Pyrex definition and 
implementation files.  Given Ctypes is going into the Py 2.5 standard 
library and the parsing competence of the underlying gccxml I thought 
this a good way to proceed to perform autogen. for Pyrex.  I'm looking 
pointers to  any prior work I may have missed, and for comment / advice 
on this gccxml/codegen approach  before embarking

Regards,
Mark



More information about the Pyrex mailing list