[antlr-interest] C# rules cannot return chars
Vaclav Barta
vbar at comp.cz
Tue Jul 3 05:32:05 PDT 2007
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...
Bye
Vasek
More information about the antlr-interest
mailing list