[antlr-interest] lexical nondeterminism

howardk at fatdog.com howardk at fatdog.com
Tue Nov 20 19:52:41 PST 2001


Sigh, I hate to bother people with this one. I thought I'd gotten 
reasonably ok at working out nondeterminism problems, but I can't see 
why the following (slightly simplified) lexical grammar isn't
working. antlr is complaining about the production QName. Lookahead
is k=2.

QName:		(NCName COLON)? NCName;

protected
NCName:		( Letter | '_' ) (NCNameChar)*;

protected
NCNameChar:	Letter | Digit | DOT | '-' | '_';

protected
Letter:		'A' .. 'Z';

Here's the message I get:

warning: lexical nondeterminism upon
k==1: 'A' .. 'Z', '_'
k==2: '-','.','0'..'9','A'..'Z','_'
between alts 1 and 2 of block

I know this isn't hard, but I'm going blind (and I'm not even doing 
THAT!) Any help much appreciated,

Howard



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list