[antlr-interest] Explain this lexical nondeterminism

mzukowski at yci.com mzukowski at yci.com
Mon Oct 28 09:33:29 PST 2002


Look at the FAQ about "linear approximate lookahead".  Also look at the
generated code and you will see what antlr is thinking.  It's been answered
on this list before too.

Monty

> -----Original Message-----
> From: Paul J. Lucas [mailto:dude at darkfigure.org]
> Sent: Thursday, October 24, 2002 9:54 PM
> To: antlr-interest at yahoogroups.com
> Subject: [antlr-interest] Explain this lexical nondeterminism
> 
> 
> Given:
> 
> 	class MyLexer extends Lexer;
> 	options {
> 		k = 3;
> 	}
> 
> 	LT : "lt" | "A1" ;
> 	GT : "gt" | "A2" ;
> 
> I get:
> 
> 	warning: lexical nondeterminism between rules LT and GT upon
> 	test.g:0:       k==1:'A'
> 	test.g:0:       k==2:'t'
> 	test.g:0:       k==3:<end-of-token>
> 
> but why?  'l' is clearly distinguishable from 'g' and '1' is 
> clearly distinguishable from '2'.
> 
> - Paul
> 
> 
>  
> 
> Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/ 


 

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



More information about the antlr-interest mailing list