Choosing the right parser for parsing C headers

Fredrik Lundh fredrik at pythonware.com
Tue Feb 8 06:22:39 EST 2005


Jean de Largentaye wrote:

> I need to parse a subset of C (a header file), and generate some unit
> tests for the functions listed in it. I thus need to parse the code,
> then rewrite function calls with wrong parameters. What I call "shaking
> the broken tree" :)
>
> I chose to make my UT-generator in Python 2.4. However, I am now
> encountering problems in choosing the right parser for the job. I
> struggle in choosing between the inappropriate, the out-of-date, the
> alpha, or the too-big-for-the task...

why not use a real compiler?

    http://www.boost.org/libs/python/pyste/
    http://www.gccxml.org/HTML/Index.html

</F> 






More information about the Python-list mailing list