[antlr-interest] Re: Differentiating keywords in parser and identifiers in lexers

micheal_jor <open.zone at virgin.net> open.zone at virgin.net
Wed Jan 29 01:58:14 PST 2003


--- In antlr-interest at yahoogroups.com, Sharon Li <hushlee83 at y...> 
wrote:
> 
> hi,
> 
> how do I prevent Antlr from recognising keywords to be identifiers? 
I can't think of a way in which i can specify which words can be 
identifiers and which should not.

Have you actually tried the advice from my previous reply about the 
using the "tokens {...}" section in your grammar?

http://www.antlr.org/doc/metalang.html#TokensSection

> I have looked at previous messages but it still doesn't register. 
Perhaps someone can provide an example. 

The link above has one that shows "void" and "int" as "keywords" and 
not identifiers.

Micheal



 

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



More information about the antlr-interest mailing list