[antlr-interest] [Newbie] "keywords vs. identifiers": how can I fix this?

mzukowski at yci.com mzukowski at yci.com
Thu Apr 10 08:30:54 PDT 2003


http://www.antlr.org/doc/metalang.html#TokensSection
-----Original Message-----
From: Thiago F.G. Albuquerque [mailto:tfga at terra.com.br]
Sent: Thursday, April 10, 2003 8:28 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] [Newbie] "keywords vs. identifiers": how can I
fix this?


Hi,

I know this is probably a FAQ, but I couldn't figure it out for myself.

This is the classic "keywords vs. identifiers" problem.

I'm trying to make a lexer (just the lexer, no parser yet). Here are the
rules:

ID : LETRA (LETRA | DIGITO)* ;

INT : (DIGITO)+ ;

BOOL : "true"
      | "false"
      ;

ANTLR Parser Generator   Version 2.7.2   1989-2003 jGuru.com
grammar.g: warning:lexical nondeterminism between rules ID and BOOL upon
grammar.g:     k==1:'f','t'

How can I fix this?

The docs say:

"(...) literals may be specified in the lexer grammar by means of the 
literal option."

But there's no option named "literal".

I looked in the FAQ, but still didn't manage to get an answer.

Any help is apreciated.

Thiago


 

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