[antlr-interest] AST construction problem??

Ric Klaren klaren at cs.utwente.nl
Mon Aug 4 07:47:01 PDT 2003


On Mon, Aug 04, 2003 at 01:06:06PM +0200, Ric Klaren wrote:
> > expr! : 
> > 	assignExpr EOF! 
>                  ^- this is the culprit.
> > 	{#expr = #(assignExpr, EOF);}
> > 	;

Hmm a tab crept in the bit before the ^. To be clear it's the !-operator on
the EOF that's the problem. For the rest see previous reply.

Another thing I missed, you need to label assignExpr as well to be able to
reference it. The doc is a bit fuzzy about it upon rereading it.

expr! :
  	a:assignExpr EOF
  	{#expr = #(a, EOF);}
  	;

Or
expr! :
  	a:assignExpr e:EOF
  	{#expr = #(a, e);}
  	;

Cheers,

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
  "You can't expect to wield supreme executive power just because some
   watery tot throws a sword at you!"
  --- Monty Python and the Holy Grail


 

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




More information about the antlr-interest mailing list