[antlr-interest] ANTLR 3.0.1: invalid character column in a mismatch character error message.
francis.andre.kampbell at orange.fr
Mon Aug 11 13:52:37 PDT 2008
The point is how do you interpret this error message :line 1:3
mismatched character '-' expecting set null
on parsing the text below that starts at line 1, column 1.
222-AAA = .2 + +3.4.
Cobol programmer's are used to think in term of line/column (the
indicator is in column 7 for example) and thus 'line1:3' will be
interpreted as line 1, column 3 and not line 1, pos 3(with the C
So my request is to just to make the error message not subject to
misinterpretation(even for non cobol error messages)...
and from my point of view: line1:col 4 is better than line 1:pos 3. This
does not require any change in the indexing or whatsoever...just in the
Gavin Lambert a écrit :
> At 03:44 12/08/2008, Terence Parr wrote:
> >Havent seen the thread but are we talking about lines 1... and
> >char position 0... ? If so, char position is not column so I
> >went with C-derivative language indexing as it is the relative
> >position from start of line not the column. Columns start with 1.
> Yes, and the issue being discussed is that when printing error
> messages ANTLR seems to display the char position in a format where
> you're expecting to see the column.
> Contrary to some other dissenting votes on the list, I think this does
> need to be changed -- however, if you're worried about breaking uses
> of it (which I doubt will affect anyone, except possibly ANTLRworks)
> then maybe it could be deferred until 3.2.
More information about the antlr-interest