[antlr-interest] Tedious newbie lexer question re keywords and identifiers - antlr 2.7.2
    loanshark992001 
    mark.buckle at intechsolutions.co.uk
       
    Wed Feb 18 08:43:47 PST 2004
    
    
  
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
<*> 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