[antlr-interest] Antlr Design Patterns

kibab at icehouse.net kibab at icehouse.net
Thu Feb 26 16:48:00 PST 2004


I'm just starting to use antlr and wanted some suggestions about how it should 
best be used, basically the suggested design patterns.  Most of the parser 
generators that I have used don't generate trees, so typically I would 
manually create the AST structure that I wanted in my actions, and then let 
everything else happen in/after the semantic analysis phase. 
 
So, I guess these are my questions: 
 
1) Antlr allows me to generate a tree structure and create custom nodes. Would 
I be better off just generating a standard parser (not a tree parser) and 
using the default node type or a custom node type? (Obviously, it will depend 
some on the complexity that I need.) 
 
2) Should I create a standard parser that generates some subset of the tree 
that I need and then create a tree parser to handle the AST the way I would 
like it. 
 
3) Any other suggestions on design/usage?  I presume any of the above 
possibilities are better than manually generating my own AST? 
 
Thanks for the help. 
 
--Kaleb 



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list