bug-bison
[Top][All Lists]
Advanced

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

Flex/Bison standardized diagnostics


From: Hans Aberg
Subject: Flex/Bison standardized diagnostics
Date: Fri, 4 Jan 2002 16:11:47 +0100

If one should provide the Flex/Bison generated with standardized
diagnostics, a look into the requirements of my IDE (integrated development
environment) (which is Metrowerks CodeWarrior) suggests that the following
information should be made available:

- A reference to the stream.
- The name of the stream.
- Type of the diagnostics: Info, Warning, Error.
- A description in text (that may cover several lines) of the nature of the
message (that is, the user supplies a char* or std::string with the text).
- Begin and end (line number, column number) pairs.
- Begin and end stream position number.
- A pointer to the context of the diagnostics, for example the lines
containing the location, or as much of it as is buffered. One option might
be to strip initial whitespace, also giving the initial location of its
beginning.
- An error number (probably just a count used as an identifier).

For the begin/end structures, I would suggest the usual C/C++ half-open
interval [x, y) paradigm. Then x = y means an empty token.

It is also a good question of how much of this stuff that Flex/Bison should
help to provide. But diagnostics are very important for the usefulness of
parsers, so it would help the less time any programmer needs to spend on
this.

Also, this is just an input from an inspection of my IDE; it would be good
to get input from other development systems as well.

  Hans Aberg





reply via email to

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