[antlr-interest] Problem with MismatchedTokenException

Kazuki kazuki.rebirth at hotmail.fr
Sat Apr 9 13:56:49 PDT 2011


Hi,

I have just started using ANTLR and I get stuck with this trivial grammar : 

grammar Test;

options {
       language = Java;
}

test  :       NAME '=' VALUE;

NAME    :       LETTER+;
VALUE   :       (LETTER | DIGIT)+;

fragment
LETTER
       :       'a'..'z'|'A'..'Z'
       ;

fragment
DIGIT
       :       '0'..'9'
       ;

With the input "test=toto" I have a MismatchedTokenException on the token
"toto" while I get a correct syntax with an input using a digit like
"test=toto0".
Can someone explain what is my mistake in the grammar ?

Thank you.

--
View this message in context: http://antlr.1301665.n2.nabble.com/Problem-with-MismatchedTokenException-tp6257670p6257670.html
Sent from the ANTLR mailing list archive at Nabble.com.


More information about the antlr-interest mailing list