[antlr-interest] semantic predicates using rule parameters

Benoit Fouletier benblo+ANTLR at gmail.com
Wed Jul 29 07:40:50 PDT 2009


How come this is valid...
*rule[Boolean condition]*
* **:** **a*
* **->** **{condition}?** **IMAGINARY a*
* **->** **a*
* **|** **b*
* **;*

... but this isn't?

*rule[Boolean condition]*
* **:** **{condition}?*
* **a*
* **->** **IMAGINARY a*
* **|** **b*
* **;*

How can I work around it? I'm having a hard time understanding how to pass
values around...

     Ben

PS: for the second version I get a "cannot find symbol" error...
[16:39:32] symbol  : variable condition
[16:39:32] location: class translatorParser
[16:39:32]         if ( !(evalPredicate(condition,"condition")) ) {
[16:39:32]                              ^
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090729/900f526e/attachment.html 


More information about the antlr-interest mailing list