[antlr-interest] AST Generation
Ric Klaren
klaren at cs.utwente.nl
Wed Apr 21 02:26:11 PDT 2004
On Sun, Apr 11, 2004 at 06:53:21PM -0700, Mohad Nur wrote:
> I am having some problems creating the correct AST. I have a rule like
>
> Decl: (varDecl)*;
>
> varDecl : varType idlist SEMI;
>
> There are different type of vartypes and i want the final Decl tree to
> contain all of them but what i am getting right now is only the last
> declaration as it overwrites the last one. I just want the new variable to
> be added to the currentAST.
Does the thing do the right thing if you change the Decl rule to:
Decl: (varDecl)+;
I'm not sure if you triggered a bug in treebuilding there. I assume you
have the option buildAST = true in your grammar ?
Cheers,
Ric
--
-----+++++*****************************************************+++++++++-------
---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722 ----
-----+++++*****************************************************+++++++++-------
"Never argue with an idiot, for they will bring you down to their
level and beat you with experience." --- Unknown
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