[antlr-interest] ANTLR for Python

Marq Kole marq.kole at philips.com
Fri Nov 5 01:56:42 PST 2004



Hi,

I've just uploaded the latest patch in the Files/ANTLR Python 
directory. It now runs all examples flawlessly and has the build 
process for the Python runtime integrated in the ANTLR build 
process. 

I am looking for a few extensions in the way ANTLR handles Python 
grammars. At this moment the header { } block is supported, but just 
like the C++ runtime has the option to have different kinds of 
headers, whose contents are placed in different parts of the 
generated code, I would like to have something similar in Python. To 
be more precise, I would like to have a header whose contents are 
added to the __init__ method of the generated parser, and also a 
header whose contents are added at the end of all generated code, at 
the outer indentation level. That would allow one to add self-
testing code to the grammar, or add another class that uses the 
creater scanner/parser/treeparser classes directly.

Could someone give me a pointer to where in the ANTLR source code 
this kind of stuff is handled so I can add the 
abovementioned "headers"? Also, if anyone else has a good idea on 
what more could be added to the Python runtime, I am open to 
suggestions.

Regards,
Marq







 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list