[antlr-interest] context information through rule parameters

Terence Parr parrt at cs.usfca.edu
Tue Jul 1 12:19:58 PDT 2008


On Jul 1, 2008, at 7:34 AM, Gerard van de Glind wrote:

> Dear all,
>
> I want to pass context information along with the rules that are  
> parsed.
>
> Consider the following grammar:
>
> expression : rule1[false] | rule2[true];
>
> rule1[boolean bool]: rule3[true] | rule4[$bool];
>
> rule2[boolean bool]: rule3[false] | rule4[$bool];
>
>>
> However, rule4[$bool] is not accepted. Is this an invalid construct?  
> If yes, is there a work-around?

what is the error?  note rule4 is not defined in example.
Ter


More information about the antlr-interest mailing list