help-flex
[Top][All Lists]
Advanced

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

Re: Location revisited, column tracking...


From: Hans Aberg
Subject: Re: Location revisited, column tracking...
Date: Thu, 25 Jul 2002 19:17:33 +0200

At 18:52 +0200 2002/07/25, Akim Demaille wrote:
>But, and this is a different issue, do not rely on some definition of
>Bison's location_t, as it is valid only for gran'pa Yacc parsers, it
>is not valid for C++ output, and GLR parsers.

I agree on this one: Flex should try to make location tracking as good as
it can relating to its lexer generating problems, not looking elsewhere
like to Bison.

The old Bison location tracking features seems to be somewhat dubious: One
would get out the region of the syntax error. In more normal error
reporting, one instead wants to have the location of the token causing the
error (as well as the parser can determine that).

In an IDE, this token might be high-lighted using the stream position
number, which is why I think one should be able to pin-point that token
location using C/C++ semi-open [begin, end) location pairs.

Thus, if the scanning first starts with stripping out some whitespace after
which it identifies a token, the location tracking should be such that the
white-space is not included in the location tracking of the token.

  Hans Aberg





reply via email to

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