[antlr-interest] Simple grammar with error

Alfonso barbolani at ya.com
Sun Sep 16 01:02:55 PDT 2007


>      : term ( (PLUS|MINUS) term )*
>   
>        atom ( (DIVIDE | ASTERISK) atom)*
>   
The changes seem to make the interpreter to do the right thing. However, 
as someone else has pointed out,the debugger still did the right thing 
with the original version. Is that a bug in the interpreter?
> Unless I misunderstand what you are trying to do, it looks like you
> translated a LALR(1) grammar (or BNF) verbatim, and that doesn't do what
> you expect with LL(k).
>   
Well, yes and no. I just used my dusty knowledge of BNF, but certainly 
have not studied the grammar and checked whether it is LARL(1) or LL(k) 
or anything else. I find very hard to find a tutorial on ANTLR beyond 
the basic expression calculator. I just cannot purchase Terrence's book 
at the moment (I wish I could)
> I've done this with every grammar I've implemented with ANTLR.  It works
> just fine.
>   

Do you mean apply the changes above to the grammar? Do you know of a 
good source for v3 documentation? The docs provided with v2 where for me 
at least more informative.


Thanks for the reply

Alfonso


More information about the antlr-interest mailing list