[antlr-interest] antlr python-grammar

ak 12345alex at gmx.net
Wed Apr 19 05:01:50 PDT 2006


hi, loring.

thanks for your answer.

Am Dienstag, den 18.04.2006, 16:59 -0700 schrieb Loring Craymer:
> I can do something about that.  However, I have to ask what you intend to
> use it for--just for pretty printing (minimal tree structure requirements)
> or for custom analysis (probably with specific structure requirements).  How
> I annotate the parser grammar depends on the answer--there are multiple
> possible tree structures.
i agree that the tree structure depends on custom needs. my needs will
evolve, so i can't tell exactly what the tree should look like.

to be honest, i'm still not sure whether i need a tree or not.

what i want to do is build up a structure of java-instances that
represents entities of the parsed python-file(s). something like
PythonModule, PythonClass, PythonFunction(bound or not). anything i
can't handle yet(expressions, loops, etc.) should be available as a
string which i can put somewhere.

perhaps you can give me some hints. should i write a treeparser-grammar
from scratch? should i add the tree-related stuff to a copy of your
python.g? should i just put in some actions?

i think a tree would make life easier, any thoughts and comments are
welcome.

thanks in advance.

alexander
> 
> I did the original version of the parser grammar as a machine translation of
> the grammar that comes with the Python distro; Ter modified it a bit and
> added the lexer for use in the classroom.  Neither of us took it far enough
> to need a tree grammar:  at the time, I just wanted to do a BNF translator
> as a matter of sheer elegance; Ter needed something simple for classroom
> use.
> 
> --Loring
> 
> > -----Original Message-----
> > From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> > bounces at antlr.org] On Behalf Of ak
> > Sent: Tuesday, April 18, 2006 6:25 AM
> > To: antlr-interest at antlr.org
> > Subject: [antlr-interest] antlr python-grammar
> > 
> > hi.
> > 
> > i've started to play around with antlr using the python-grammar from
> > antlr.org. i've noticed that there is no treeparser-grammar.
> > 
> > will this be the case sometime? on whose nerves can i get until? ;)
> > 
> > mfg
> > 
> > alexander
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20060419/1bfb88a6/attachment-0001.bin


More information about the antlr-interest mailing list