[antlr-interest] Rewrite Problem; Rule terminates without exception.

Gavin Lambert antlr at mirality.co.nz
Sun Mar 16 06:15:32 PDT 2008


At 01:57 17/03/2008, Michael Ernst wrote:
 >When I rewrite the tree and referencing the label twice, I get
 >no tree duplicate attached to the tree. I thought I could
 >duplicate nodes and trees by referencing them more than one
 >time in a rewrite rule (Chapter 7; Duplicating Nodes and
 >Trees (sample: dump : INT -> INT INT ;)).

I think you have to give them explicit labels when duplicating, 
otherwise it assumes you're referring to separate instances.  So 
this should work:

   dump : a=INT -> $a $a;



More information about the antlr-interest mailing list