warnings: use the regular interface for s/r and r/r conflicts

The current routines used to display s/r and r/r conflicts are both
inconvenient from the programmer point of view (they do not use the
warning infrastructure) and for the user (the messages are rather
terse, not necessarily pleasant to read, and because they don't use
the same routines, they look different).

It was due to the belief (dating back to the initial checked-in
version of Bison) that, at some point, POSIX Yacc mandated the format
for these messages.  Today, the Open Group's manual page for Yacc,
<http://pubs.opengroup.org/onlinepubs/009695399/utilities/yacc.html>,
explicitly states that the format of these messages is unspecified.
See commit be7280480c and
<http://lists.gnu.org/archive/html/bison-patches/2002-12/msg00027.html>.

For a discussion on the chosen warning format, see
http://lists.gnu.org/archive/html/bison-patches/2012-09/msg00039.html

In an effort to factor the handling of errors and warnings, use the
Bison warning routines to report these messages.

* src/conflicts.c (conflicts_print): Rewrite with clearer sections
about S/R and then R/R conflicts.
(conflict_report): Remove, inlined in its sole
caller...
(conflicts_output): here.
* tests/conflicts.at, tests/existing.at, tests/glr-regression.at,
* tests/reduce.at, tests/regression.at: Adjust the expected results.
* NEWS: Update.
This commit is contained in:
Akim Demaille
2012-09-21 17:21:01 +02:00
parent 6c094ad0e3
commit d87ea54cf6
7 changed files with 205 additions and 159 deletions

View File

@@ -1191,7 +1191,7 @@ dnl INPUT
dnl BISON-STDERR
[AT_COND_CASE([[LALR]],
[[input.y: conflicts: 1 reduce/reduce
[[input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
]], [])],
dnl TABLES