[antlr-interest] how to eliminate non-determinism warnings upon keywords and literals?

Fan Yang yhhf_dy at yahoo.com
Thu Mar 11 07:39:05 PST 2004


Hi,

There are some non-determinism warnings for the following grammar

////// snippit1
class TestLexer extends Lexer;
...
TOKEN_IFDEF	:	"ifdef" { semantic actions }
	;

ID	:	('a'..'z')+
	;
//////

I know I can use token {...} section to eliminate those warnings, but 
I can't add semantic actions in the tokens section, which is 
important for me. 

My question is how to get rid of those warnings by using the same way 
as snippit1 indicated.


I really appreciate your help,

fan 

////// snippit2
// One solution but I can't use semantics action
class TestLexer extends Lexer;
...
tokens {
        BEGIN="begin";
}

ID	:	('a'..'z')+
	;





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list