help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bison-1.50: how to parse apostrophe?


From: Tim Van Holder
Subject: Re: bison-1.50: how to parse apostrophe?
Date: 10 Oct 2002 15:17:10 +0200

On Thu, 2002-10-10 at 14:18, Akim Demaille wrote:
> |     13:27:17 address@hidden:~/lily/lily
> |     $ make
> |     bison -o./out/parser.cc -d parser.yy
> |     parser.yy:1440.2-4: unrecognized escape: `\\\''
> |     parser.yy:1443.15-17: unrecognized escape: `\\\''
> 

> | Also, the new column-info breaks Emacs' error parsing, which is very
> | annoying.  It would be helpful if the column info would be more
> | standard (ie, just one column number: parser.yy:1440:2: unrecognized
> | ...), and if this feature would be turned off by default, at least
> | until Emacs can handle this.
> 
> This scheme is compatible with the GNU Coding Standards, and it is my
> understanding that Emacs has the right code to support this.  Maybe it
> is still in CVS Emacs :(

I'm afraid you're wrong Akim - emacs cannot handle the dot separator,
nor does it handle ranges properly.  It seems to expect the gcc-style
output (file:line[:column]: message).
Out of

foo:2:3: error
foo:2:3-7: error
foo:2.3: error
foo:2.3-7: error

only the first line works as expected (jumps to line 2, column 3); the
second sort of works (positions on line two, but not at column 3).  For
the last two, emacs doesn't even get the filename right.

Also, from the GNU coding standards from Feb 14 2002:

   Error messages from compilers should look like this:

     SOURCE-FILE-NAME:LINENO: MESSAGE

   If you want to mention the column number, use this format:

     SOURCE-FILE-NAME:LINENO:COLUMN: MESSAGE

   Line numbers should start from 1 at the beginning of the file, and
   column numbers should start from 1 at the beginning of the line.
   (Both of these conventions are chosen for compatibility.)  Calculate
   column numbers assuming that space and all ASCII printing characters
   have equal width, and assuming tab stops every 8 columns.

So Jan's suggestion is absolutely correct (and the only
standards-conforming way to do it).






reply via email to

[Prev in Thread] Current Thread [Next in Thread]