Martijn Reuvers wrote:
> Hi Gavin,
>
> I tried as you suggested ( I use antlr 3.1.3 ):
>
> bool_function_content[Boolean value]
> : {$value != null && $value.booleanValue()}?=> function_content*
> | .*
> ;
> But weird enough it comes with a lot of compile errors (92) that it
> cannot find the 'value' symbol (I already tried without $ in front of
> it and that does not help), e.g:
>
> cannot find symbol
> [javac] symbol : variable value
> [javac] location: class basic.test07.ResTree.DFA19
> [javac] if ( (LA19_74==DOWN) && ((value !=
> null && value.booleanValue()))) {s = 15;}
>
> If I look at the source generated (treeparser) these errors are inside
> a DFA19 (which extends DFA), and indeed there the value parameter is
> not defined. If I remove the | .* option, it generates properly and
> compiles fine. Any idea why this is happening?
>
> Martijn
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
You cannot use local parameters in predicates. You need to assign them
into a scope and reference the scope.
Jim
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
-~----------~----~----~----~------~----~------~--~---