Take a look at antlr.markmail.org for other examples but where are you trying to get the parent, in the parser before you have built the AST (it sounds like this) or in the tree walker? You should not need to change any of the runtime functions; you are probably just making them do things that are going to get done anyway at the end of the rule. Look at the generated code for ways to traverse the tree. I suppose there could be a bug, but ut seems a bit unlikely at this point.
Jim > -----Original Message----- > From: [email protected] [mailto:antlr-interest- > [email protected]] On Behalf Of ??????? ????? > Sent: Wednesday, April 27, 2011 11:15 AM > To: [email protected] > Subject: [antlr-interest] [C-target] Child-parent relationship > > Sorry, I have no exp in using mailing lists, so I hope i'm doing right. > I'm trying to get parent of AST node, but "getParent" function returns > 0x00000001c address. Because pointer to parent of the node's super is > equal to NULL. But when I've changed functions "addChild" and > "setParent" all child-parent relationships become correct. > Dmitry Ilyin > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your- > email-address 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.
