[antlr-interest] [C-target] Child-parent relationship

Jim Idle jimi at temporal-wave.com
Wed Apr 27 11:38:58 PDT 2011


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: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of ??????? ?????
> Sent: Wednesday, April 27, 2011 11:15 AM
> To: antlr-interest at antlr.org
> 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


More information about the antlr-interest mailing list