In "Language Implementation Patterns" on page 285, Figure 11.4 Model-Driven Translator With Tree Rewriting, the picture shows a Rewriter.
The rewriter takes in an IR, alters IR structure then outputs an IR. The only mention in the book is "The role of tree rewriting in translator design is a pretty big topic and too much to go into here." I have no doubt that it is a pretty big topic if one tries to rewrite the processing logic of a language, however I am only working on the data structures which should be a lot simpler. For those who have seen my earlier questions, I have set aside trying to get ANTLR 3 to read a data structure directly and am now creating a DSL to read data structure definitions. In other words I am not abusing predicates this round and using ANTLR as intended. What I am hoping can be done, but have little hope, is that one can define a grammar that takes in an AST, alters the AST with ANTLR rewrite rules, and outputs an AST. So how is a rewrite implemented with ANTLR3? Can you provide a reference to an example. Thanks Eric List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address -- You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.
