[antlr-interest] Tedious newbie lexer question re keywords an d identifiers - antlr 2.7.2

mzukowski at yci.com mzukowski at yci.com
Wed Feb 18 13:26:08 PST 2004


You need to look up "literals" in the documentation for lexers.

Monty

-----Original Message-----
From: loanshark992001 [mailto:mark.buckle at intechsolutions.co.uk] 
Sent: Wednesday, February 18, 2004 8:44 AM
To: antlr-interest at yahoogroups.com
Subject: [antlr-interest] Tedious newbie lexer question re keywords and
identifiers - antlr 2.7.2


I have 2 problems,

1. I need to recognise lots of keywords with common prefixes ( k=10 
has silenced the warnings coming from that one ), I also need to 
treat most other things as identifiers, although I'm using 
testLiterals=true, I'm still getting warnings about lexical non-
determinism (simple cut-down example follows) :- 

PLSQL.g: warning:lexical nondeterminism between rules ALL and 
IDENTIFIER upon
PLSQL.g:     k==1:'a'
PLSQL.g:     k==2:'l'

2. If I take the generated parser/lexer and run it, I get 
things like ALLWORDS being treated as 2 tokens, ALL and IDENTIFIER
(value WORDS) instead of one token of type IDENTIFIER and value 
ALLWORDS, which is what I want.  I'm also getting misbehaviour from
antlr which seems to give up parsing the input correctly.

I have a reasonable degree of expertise in lex and yacc and was 
hoping antlr would eventually seem easier to use than those 2 tools.
Please say it is !







 
Yahoo! Groups Links



 


 
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