How do I fix this error: Incompatible type for method. Can't convert arev.ArevAST to int.
Created Sep 3, 1999
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);
}
;