[antlr-interest] adding actions to rules breaks stuff

Jim Idle jimi at temporal-wave.com
Mon Feb 11 15:08:55 PST 2008



> -----Original Message-----
> From: Benjamin Shropshire [mailto:shro8822 at vandals.uidaho.edu]
> Sent: Monday, February 11, 2008 2:13 PM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] adding actions to rules breaks stuff
> 
> I have a grammar that Antlr will process. However when I try to add
> actions
> 
> example:
> ///////
> document [Object o]
>     : i+=import* c+=thing* EOF {o=new Doc(i,o);}
>     ;
> 
> import [Object s]
>     : 'import' s_=Text eol_ {s=s_;}
>     ;
> //////
> it says this:
> 
>     missing parameter(s) on rule reference: import
> 

The error message is as clear as it can be I think. You are using the 
rule import without giving it any calling parameters but you have 
declared it as taking a parameter. Perhaps you meant the import rule to 
use a returns [ Object s] ?

Jim



More information about the antlr-interest mailing list