[antlr-interest] [fixed] Fixing a Tree -> Tree transformation problem

Tommy Nordgren tommy.nordgren at comhem.se
Thu Jul 30 19:37:05 PDT 2009


On Jul 31, 2009, at 4:16 AM, Tommy Nordgren wrote:

> Hi all. I have the following rule in my tree to tree rewrite grammar.
> method_decl : ^(ATTRIBUTE type_decl ID .) -> ^(ATTRIBUTE type_decl  
> ID )
> 	| 	^(METHOD returntype ID formal_parameter_list .) -> ^(METHOD
> returntype ID formal_parameter_list )
> 	;
>
> For some reason, the part of the input tree matched by '.'   remains
> in the output tree. How do I fix this?


	When experimenting some further, I found that the problem could be  
fixed by addin
rewrite = true                 to the options section.
-------------------------------------------
Engineers supporting greenpeace: Comparable to Afroamericans who wants  
to join the Ku Klux Klan
----------------------------------------
Tommy Nordgren
tommy.nordgren at comhem.se





More information about the antlr-interest mailing list