Hi, First decide if you really need step 3 (the tree parser). If you want to parse some program / script and then perform evaluation multiple times, or you want to work on the AST to optimize execution or make it easier to do translation etc. then the answer is yes. But if you just want to parse a program / script and run it once then it's optional - you could just embed actions in the parser grammar in step 2.
In my own apps I do more or less copy the parser grammar (minus actions and AST rewrite rules) and use this as the basis for the tree grammar. If the grammar is not huge this is practical, but if it is, or if there are multiple tree walking stages (ie. step 4, step 5 etc each of which generates a new AST) then it can get tricky. There was a recent discussion of this here... http://www.antlr.org/pipermail/antlr-interest/2009-February/032799.html Hope this helps Michael 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 -~----------~----~----~----~------~----~------~--~---
