Robert Soule wrote: > Hi, > > I'd like to use my own custom AST instead of the pANTLR_BASE_TREE > provided in the C runtime. What I was wondering is if I can use antlr's > re-write > rules ( -> ^(...) ) to generate the tree with my own node implementation? If > so, can you provide any guidance on how to do that? > > I've been looking at antlr3basetree.h. Is the idea that we use this > base tree, but > set the "u" pointer to our own data structures? > That's by far the easiest way, which is why I did that. Mostly, that's all people need. However, you can also write your own tree adaptor that just passes around (void *). Not a task for the inexperienced C programmer though. But if you copy the adaptor code and fill in your own functions, that will work. Much easier to just add your nodes to the u pointer though and let the current stuff do all the work :-)
Jim 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 -~----------~----~----~----~------~----~------~--~---
