[antlr-interest] Simple ANTLR questions

Uladzislau Latynski uladzislau.latynski+antlr at gmail.com
Tue Oct 3 00:27:06 PDT 2006


Hello, I'm new to ANTLR and have little question.
Here is the example grammar:

grammar TTT;
ab      :
       AB+
;
bd      :
       BD+
;
AB      :
       'a'..'b'
;
BD      :
       'b'..'d'
;

and I'm trying to parse 'bbb'. When I'm parsing it with "ab" rule all
goes well, but when I'm parsing with "bd" rule, I get exception:
MismatchedTokenException (4!=5). Why? :) (antlr-3.0b4,
antlrworks-1.0b3)

And the second question: does the syntax of the ANTLR v3 grammar files
described anywhere?
-- 
Best regards.
Vlad.


More information about the antlr-interest mailing list