[antlr-interest] ANTLR 3.0.1: invalid character column in a mismatch character error message.

Gerald Rosenberg gerald at certiv.net
Thu Aug 14 15:47:57 PDT 2008


At 02:43 PM 8/14/2008, Gavin Lambert wrote:

>Perhaps this is our fundamental point of difference then.  I've 
>written a couple of grammars that work the way you describe, but by 
>far the most grammars I've written are used as little standalone 
>mini-compilers, in order to turn a DSL into code compilable by some 
>other host language (generally one of C/C++/C#).  These tend to get 
>integrated into the build script as just another compilation step, 
>so the only stuff visible to the outside are the generated code 
>files themselves and whatever error messages get printed to the 
>console.  Hence why I really want those messages to be *right* :)

But isn't that the point.  There can never be any guarantee that a 
fixed value will be *right* -- at best just a happenstance the tab 
expansion set in whatever editor you are using matches some arbitrary 
value implemented by Antlr -- and no matter what value is chosen it 
will be likely wrong for the majority of users.

Could add an grammar option to define tab size -- increase the 
likelihood of being right, but still no guarantee.  Better solution 
is to use an Antlr-aware editor.



More information about the antlr-interest mailing list