[antlr-interest] C# rules cannot return chars

Vaclav Barta vbar at comp.cz
Tue Jul 3 03:35:54 PDT 2007


Hi,

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'

The work-around is obviously to return an object containing a char, but 
still, somebody might be interested in fixing the problem... BTW what's 
the official way to report ANTLR bugs (for the C# target)? 
http://www.antlr.org:8888/browse/ANTLR sems to be read-only?

	Bye
		Vasek


More information about the antlr-interest mailing list