Parsing library for Python?

Edward C. Jones edcjones at erols.com
Tue Feb 24 10:56:03 EST 2004


Tim Roberts wrote:
> "Edward C. Jones" <edcjones at erols.com> wrote:
> 
>>When looking for a parser generator, I think it is important that full 
>>grammars be provided for at least C and Python and preferably for C++, 
>>Java, and FORTRAN.
> 
> 
> Are you kidding with this?  I can't tell.
> 
> C, C++, and Fortran are parsing nightmares, where end-of-line and spacing
> are important sometimes and ignored at other times, and so on.
> 
> I expect to find the canonical desk calculator example, and perhaps a
> Pascal-based language, but any more than that is asking a bit much from all
> but the most mature parser generators.

Not kidding. Nothing can be parsed without a grammar. I think parsing 
the standard computer languages is a common need. I am sporatically 
developing software to automatically generate Pyrex code for wrapping C 
libraries in Python. I use ANTLR because it comes with a good C grammar.

And then there is HTML. I wonder how Mozilla parses all the ill-formed 
html that is on the web.



More information about the Python-list mailing list