[antlr-interest] Flagging better errors

Terence Parr parrt at cs.usfca.edu
Tue Jun 26 00:33:50 PDT 2007


That's like the paraphrase of v2.  You can fake with v3 (I have  
something in the book about how to do it).

Ter

On Jun 26, 2007, at 2:57 PM, chintan rao wrote:

> Hi,
> The code genrated by antlr currently gives errors like
> line 0:1 : expected token WS found WHATEVER
> or some thing similar
>
> suppose antlr grammar allows one to describe what WS tokes is
> would it not be better
> it is better to get warnings like
>
> line 0:1:expected whitespace found whatever
>
> can't the grammar have a facility to provide the decription of the  
> token
> some thing like
> WS
> description
> {
>      return "whitespace";
> }
> :
> ('  '|'\t') ;
>
> now while flaggng errors WS would be replaced by description :)
>
> I dont whether antlr has this already
>
>
> cheers,
> Chintan



More information about the antlr-interest mailing list