How do I fix this error: Incompatible type for method. Can't convert arev.ArevAST to int.

Monty Zukowski

Lets say you have something like this:

functionargs
    :   #(FUNCTIONARGS ((a:expr) (b:expr)?)? )
        {
	## = #(#[FUNCTIONARGS, "FUNCTIONARGS"], #a);
        }
    ;

What happens is that inside tree building actions delimited by #() or #[] you can use a shorthand of FUNCTIONARGS to refer to the match of FUNCTIONARGS in the rule. This is, of course, not what you want in the #[], you need an int. You can work around this by giving FUNCTIONARGS it's own label:

functionargs
    :   #(f:FUNCTIONARGS ((a:expr) (b:expr)?)? )
        {
	## = #(#[FUNCTIONARGS, "FUNCTIONARGS"], #a);
        }
    ;
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact