Hi all, I'm using ANTLR v3.0.1 on ubuntu with a Python target and I keep
getting nil nodes where I don't expect them. For example, I have the following
rule:
argument : ID COLON ID (EQUAL expression)? -> ^(ARGSPEC ID ID expression?)
;
I expect this to generate an ARGSPEC tree with three children. Instead, I'm
getting a nil root with one child (the ARGSPEC tree with three children). I
could simply add an action like so:
{ root_0 = root_1 }
and this would take care of the problem, but it definitely feels like the wrong
way to handle things. Is there something I'm doing wrong in my rule, or is
this just normal and I should ignore it? I should note that I'm using my own
TreeAdaptor and nodes to create a custom AST, maybe the nil node is
automatically ignored by the CommonTree code?
Thanks,
Douglas Mayle
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.