[antlr-interest] Partial tree transformation

renyedi robert at alphatech2000.com
Sun Sep 8 05:16:19 PDT 2002


Greetings

Suppose we have an AST generated by ANTLR. Is there a way to perform a
transformation for only certain tree patterns without defining rules
that lead to that pattern?

For example, let's say that having a Java AST generated by the java.g
grammar (the one from the ANTLR example grammars) one wants to filter
out the final modifier. Based on java.tree.g, only the "modifier" rule
should be defined. The nodes that do not match the "modifier" pattern
should be copied by default to the resulting AST. However, if I do
this way, the "modifier" rule is never matched but I get an unexpected
node error.

Is there a way to do this?

Robert


 

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



More information about the antlr-interest mailing list