[antlr-interest] eclipse plugin unexpected token, grammar.
jabon
elekis at gmail.com
Mon Mar 31 09:03:28 PDT 2008
heu... I use the update manager
http://antlreclipse.sourceforge.net/
http://antlreclipse.sourceforge.net/updates/
a++
Edgar Espina a écrit :
> What plugin are you using?
>
> On Sun, Mar 30, 2008 at 5:19 AM, jabon <elekis at gmail.com
> <mailto:elekis at gmail.com>> wrote:
>
> hi all
>
> I try to use the antlr plugin but I have a error.
>
> I ve create a file named yaflplug.g and inside I have a simple grammar
> (see below).
>
> In command line, no problem but in the antlr éditor. I have the
> following error.
> unexpected error : grammar.
>
> do you have any idea?? thanks
>
> a++
>
> grammar yaflplug;
> tokens {
> PLUS = '+' ;
> MINUS = '-' ;
> MULT = '*' ;
> DIV = '/' ;
> }
> /*------------------------------------------------------------------
> * PARSER RULES
> *------------------------------------------------------------------*/
>
> expr : term ( ( PLUS | MINUS ) term )* ;
>
> term : factor ( ( MULT | DIV ) factor )* ;
>
> factor : NUMBER ;
>
>
> /*------------------------------------------------------------------
> * LEXER RULES
> *------------------------------------------------------------------*/
>
> NUMBER : (DIGIT)+ ;
>
> WHITESPACE : ( '\t' | ' ' | '\r' | '\n'| '\u000C' )+ { $channel =
> HIDDEN; } ;
>
> fragment DIGIT : '0'..'9' ;
>
More information about the antlr-interest
mailing list