[antlr-interest] C# rules cannot return chars

Micheal J open.zone at virgin.net
Tue Jul 3 12:20:15 PDT 2007


Hi Vasek,

> Micheal J wrote:
>  >> for the C# target, a rule like
>  >>
>  >> test returns [ char value ] :
>  >> 	'test' { $value = 'a'; }
>  >> 	;
>  >>
>  >> produces code whose compilation fails with
>  >>
>  >> error CS0031: Constant value '0' cannot be converted to a 
> 'char'  > Thanks for the report. Do you have a simple grammar 
> that demonstrates  > this? Well, not a complete grammar - 
> I've just added the rule above to my work-in-progress grammar 
> to reproduce the problem. I believe any C# 
> grammar will do...

If you're able to build from the latest sources, please do so and try again.
I've just committed a possible fix.

Micheal

-----------------------
The best way to contact me is via the list/forum. My time is very limited.



More information about the antlr-interest mailing list