[antlr-interest] antlr vs. javacc+jjtree tree construction

Robert Enyedi renyedi at yahoo.com
Wed Mar 27 05:23:25 PST 2002


Yes, but as far as I know you can apply the '^' operator to a token. So what
if the rule has no tokens?

----- Original Message -----
From: "Bogdan Mitu" <bogdan_mt at yahoo.com>
To: <antlr-interest at yahoogroups.com>
Sent: Wednesday, March 27, 2002 1:47 PM
Subject: Re: [antlr-interest] antlr vs. javacc+jjtree tree construction


> Hi Robert,
>
> In ANTLR you normally use the '^' operator to direct the AST construction.
> Sometimes you need to add manually some nodes, but most of the time '^'
and
> '!' do the job.
>
> Regards,
> Bogdan
>
> --- Robert Enyedi <renyedi at yahoo.com> wrote:
> > Hi, everyone
> >
> > I have worked previously with JavaCC and I used JJTree to build syntax
> > trees. By default, it creates a root node for each grammar rule
> > (identified by the constant JJT<RULENAME>) and attaches to it as child
> > nodes the nodes that come from its sub rules.
> >
> > When I got to use buildAST in ANTLR for the first time, I noticed a
> > fundamental difference: by default it creates a list of token nodes. It
is
> > true that if I want the same behavior as in JavaCC, I can use the action
> > {#ruleName=#([NODE_TYPE_NAME],#ruleName);} and define NODE_TYPE_NAME in
> > the tokens section.
> >
> > But why do I have to do this manually? Isn't there a workaround to
> > automate this task? And, somehow, isn't JJTree's behavior the natural
one?
> >
> > I would really like to discuss this issue with you, guys.
> >
> > Robert
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Movies - coverage of the 74th Academy Awards®
> http://movies.yahoo.com/
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


 

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



More information about the antlr-interest mailing list