>>> "Frans" == Frans Englich <[EMAIL PROTECTED]> writes:
> On Friday 15 September 2006 08:43, Akim Demaille wrote: >> >>> "Frans" == Frans Englich <[EMAIL PROTECTED]> writes: >> > >> > I guess one would have to invent a different "print system" for >> > that. Perhaps those "error printers" would return a heap allocated >> > char string, which the caller(the bison generated parser) is >> > responsible for de-allocating. >> >> That's very hairy... Besides, I don't think that for error reporting >> pretty-printing the symbols is the right means to do it. I think one >> should rather use accurate locations, re-open the guilty file, and >> print the guilty input. > Consider the case of identifiers(variable/funcion names, > etc). Practically all programming languages has it, and it would > surely be nice to be able to print the actual > instances("myVariable"), instead of just "<identifier>" or similar. > Opening the source and printing it is surely a good idea and a very nice > complement to regular reporting, but I still think that improving regular > reporting is significant. I was not proposing to reopen the file for edition, but to get the full context and use caret-error-reporting: % icc foo.c foo.c(1): error: more than one storage class may not be specified register volatile const auto static extern int foo = 0; ^ foo.c(1): error: more than one storage class may not be specified register volatile const auto static extern int foo = 0; ^ foo.c(1): error: more than one storage class may not be specified register volatile const auto static extern int foo = 0; ^ foo.c(1): error: a global-scope declaration may not have this storage class register volatile const auto static extern int foo = 0; ^ compilation aborted for foo.c (code 2) _______________________________________________ help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison