help-flex
[Top][All Lists]
Advanced

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

Locations suggest


From: Hans Aberg
Subject: Locations suggest
Date: Mon, 31 Dec 2001 13:24:24 +0100

One should perhaps equip Flex with better token location recording, for use
with error messages, etc:

Flex currently has %option yylineno, which keeps track of the line number.
In addition one might want to keep track of the column number (position on
each line) and the position number (count since start of file).

Further, one should keep track of these numbers not only where the token
starts but where it ends as well. It would be fairly easy to make the
generate lexer to record these number not only when the scan starts, but
also just before it returns.

Bison has a %locations option by which such locations can be attached to
the grammar symbols, and I have also encountered such a use in my IDE
(integrated development system).

  Hans Aberg





reply via email to

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