[antlr-interest] Basic question : howto differantiate value/pair combination

Bruno Delzant Bruno.Delzant at proximus.net
Thu Jul 29 02:20:30 PDT 2004


Hi,

I am new to ANTLR and I am stuck with a basic problem I think.

Here is my grammar file:

<!--
class TestParser extends Parser;

startRule        : arg (SEPARATOR arg)* ;
arg              : ID EQ VALUE ;

class TestLexer extends Lexer;

protected UPPER  : ('A'..'Z');
protected LOWER  : ('a'..'z');
protected LETTER : (LOWER | UPPER);
protected DIGIT  : ('0'..'9');

ID     : UPPER (LETTER | DIGIT)* ;
VALUE  : (LETTER | DIGIT)+ ;

protected ID_OR_VALUE : (ID EQ) => ID { $setType(ID); }
                      | (ID) => VALUE { $setType(VALUE); };

EQ          : '=';
SEPARATOR   : ','|';'|' ';

-->

I always get the error :

<!--
ANTLR Parser Generator   Version 2.7.3   1989-2004 jGuru.com
test.g: warning:lexical nondeterminism between rules ID and VALUE upon
test.g:     k==1:'A'..'Z'
-->

Did I miss something ?
How can I differantiate an ID from a VALUE ?

Thanks already for any help.

Bruno




 
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