C parsing fun

Károly Kiripolszky karoly.kiripolszky at gmail.com
Thu Feb 8 12:16:35 EST 2007


Yes, of course. But you can still fine-tune the code for the sources
you want to parse. The C++ header files I needed to analyze contained
no such strings. I believe there are very few real-life .h files out
there containing those. In fact I chose #::OPEN::# and #::CLOSE::#
because they're more foreign to C++ like eg. ::OPEN or #OPEN would be.
I hope this makes sense. :)

Roberto Bonvallet írta:
> Károly Kiripolszky <karoly.kiripolszky at gmail.com> wrote:
> > I've found a brute-force solution. In the preprocessing phase I simply
> > strip out the comments (things inside comments won't appear in the
> > result) and replace curly brackets with these symbols: #::OPEN::# and
> > #::CLOSE::#.
>
> This fails when the code already has the strings "#::OPEN::#" and
> "#::CLOSE::" in it.
>
> --
> Roberto Bonvallet




More information about the Python-list mailing list