[antlr-interest] context information through rule parameters

Gerard van de Glind g.vandeglind at beinformed.nl
Tue Jul 1 07:34:14 PDT 2008


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?

 

Thanks a lot!

 

Cheers, Gerard

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080701/d721e811/attachment-0001.html 


More information about the antlr-interest mailing list