Coincidentally I too am puzzling over this topic, and blundered into error(117) just yesterday. So at the very least, you can feel like you have company :-)
The basic issue is what the arguments to -> ^(NEWTOKEN[args] are expected to be (ie: their types) and where such args can be obtained from.
Depending on which signature (version of [ ], ie: which set of required args) you're using, one of the args needs to be a Token. This is satisfied, I found, by supplying a token symbol (eg: a lexer token used in the pattern part of the rule). But I got error(117) if I tried to pass a parser rule name.
It wasn't clear to me if some form of this (eg: $parserRule.something) should work... ie: should it be possible to get a token from a parser rule? Some further light on this would be helpful.
-- Graham
At 8/8/2009 06:48 PM, Tomasz Jastrzebski wrote:
I tried replacing:
-> ^($o $addExpr $e)
with:
-> ^(BIN_EXPR<BinaryExpression>[$o.text, $addExpr, $e.tree]>) // instead of $addExpr.tree
but the tool (at least ver 3.1.1) dooes not allow this - error(117): missing attribute access on rule scope. Anyway, $addExpr is of type addExpr_return.
I do not know. This may be a bug.
Tomasz
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
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
