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

Kay Röpke kroepke at classdump.org
Wed Aug 13 18:05:03 PDT 2008


On Aug 14, 2008, at 2:24 AM, Foust wrote:

>>>
>>> Do you think C++ compilers are really doing character ->
>>> column# translations (with Tab translation) before
>>> outputting syntax errors?
>>
>> Yes, I do.
>
> Then that settles it, does it not?


:)

I don't get tired maintaining that handling all this should be in user  
code, not in the default generated code.
It's not hard to add, not everyone needs it, and in the face of syntax  
errors speed is not the primary concern anymore - so it's not a huge  
problem going back and doing the extra bit of computation to format an  
error message.

Another thing: How often do your recognizers communicate with other  
tools via text messages? (i.e. via printing line/col info so that the  
other tool has to parse your output)
Mine most often are compiled into the application that needs a parser,  
and thus I'm primarily interested in the actual character index into  
the text buffer, not the column it is displayed in. Might just be me,  
but I guess not many people are writing command line tools that get  
invoked and need to communicate line/col info that way.

However, I agree that ANTLR's error messages can be improved (in the  
sense of presentation).

cheers,
-k

P.S.: Did anyone else notice that in the time we've discussing this,  
everyone of us could've written the code and supplied to interested  
parties? ;)
-- 
Kay Röpke
http://classdump.org/








More information about the antlr-interest mailing list