[antlr-interest] unexpected char exception

jean.morissette666 at videotron.ca jean.morissette666 at videotron.ca
Sat Feb 26 13:44:15 PST 2005


Thank for your reply.

But now I have another kind of error.  In my grammar, rule ABC is a special 
case of IDENTIFIER and Antlr complain about it:
warning:lexical nondeterminism between rules ABC and IDENTIFIER

Also, I have read this  
http://www.doc.ic.ac.uk/lab/secondyear/Antlr/options.html#_bb8
but sadly I don't understand the purpose of the testLiterals option.  

Any help would be appreciated.


class P extends Parser;

startRule
    :   ABC
    ;

class L extends Lexer;

ABC
	:	"abc"
	;

IDENTIFIER
	:	( 'a'..'z' | 'A'..'Z' ) ( 'a'..'z' | 'A'..'Z' | '0'..'9' )*
	;


Le 26 Février 2005 16:17, Loring Craymer a écrit :
> You need at least a lexer rule which recognizes text; "abc" is a special
> case for that rule.  Also look at the testLiterals option.



More information about the antlr-interest mailing list