Use {{...}} to force action evaluation during backtrack
ter
On Nov 13, 2009, at 1:42 AM, Philippe Faes wrote:
> Hi everybody,
>
> I can't figure out how to set a return value during backtracking.
> While backtracking, I'd like to do a semantic check on a return
> value of an underlying rule, but the return values are not set
> during backtracking.
>
> Example:
>
> some_rule
> : designator operand {someCheck($designator.text)}? // this will
> never work
> ;
> designator returns [Node node, String text]
> : identifier { $node = $identifier.node; $text=$identifier.text; }
> | operator_symbol {$node = $operator_symbol.node; $text=
> $operator_symbol.text; }
> ;
>
> Any ideas?
>
> Thanks
>
> Philippe
>
> 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].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=.