[antlr-interest] expecting "class", found 'class'

Sven Busse mail at ghost23.de
Sun Feb 11 01:36:23 PST 2007


Hi,

i am very new to antlr. I am using antlr 2.7.7.

I have a parser rule like this (i am using the c# version):

startRule
	:	"class" cl:IDENT 
		{Console.WriteLine("classname: "+cl.getText());}
	;

IDENT is my Lexer rule:

IDENT
	:	('a'..'z'|'A'..'Z'|'_'|'$')
('a'..'z'|'A'..'Z'|'_'|'0'..'9'|'$')*
	;

But running the stuff with an example text, i allways get this error
message:

line 4:1: expecting "class", found 'class'

Can someone explain that to me?

Thank you



More information about the antlr-interest mailing list