mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 10:13:03 +00:00
* NEWS: %expect-violations are now just warnings, reverting
to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2 bootstrapping problem reported by Matthias Klose; see <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>. * src/conflicts.c (conflicts_print): Likewise. * tests/conflicts.at (%expect not enough, %expect too much, %expect with reduce conflicts): Likewise. * doc/bison.texinfo (Expect Decl): Document this. Also mention that the warning is enabled if the number of conflicts changes (not necessarily increases).
This commit is contained in:
5
NEWS
5
NEWS
@@ -3,6 +3,11 @@ Bison News
|
|||||||
|
|
||||||
Changes in version 1.875a:
|
Changes in version 1.875a:
|
||||||
|
|
||||||
|
* %expect-count violations are now just warnings, not errors, for
|
||||||
|
compatibility with Bison 1.75 and earlier (when there are
|
||||||
|
reduce/reduce conflicts) and with Bison 1.30 and earlier (when there
|
||||||
|
are too many or too few shift/reduce conflicts).
|
||||||
|
|
||||||
* New configure option --disable-yacc, to disable installation of the
|
* New configure option --disable-yacc, to disable installation of the
|
||||||
yacc command and -ly library introduced in 1.875 for POSIX conformance.
|
yacc command and -ly library introduced in 1.875 for POSIX conformance.
|
||||||
|
|
||||||
|
|||||||
@@ -3558,7 +3558,7 @@ The declaration looks like this:
|
|||||||
|
|
||||||
Here @var{n} is a decimal integer. The declaration says there should be
|
Here @var{n} is a decimal integer. The declaration says there should be
|
||||||
no warning if there are @var{n} shift/reduce conflicts and no
|
no warning if there are @var{n} shift/reduce conflicts and no
|
||||||
reduce/reduce conflicts. An error, instead of the usual warning, is
|
reduce/reduce conflicts. The usual warning is
|
||||||
given if there are either more or fewer conflicts, or if there are any
|
given if there are either more or fewer conflicts, or if there are any
|
||||||
reduce/reduce conflicts.
|
reduce/reduce conflicts.
|
||||||
|
|
||||||
@@ -3580,9 +3580,9 @@ Add an @code{%expect} declaration, copying the number @var{n} from the
|
|||||||
number which Bison printed.
|
number which Bison printed.
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
Now Bison will stop annoying you about the conflicts you have checked, but
|
Now Bison will stop annoying you if you do not change the number of
|
||||||
it will warn you again if changes in the grammar result in additional
|
conflicts, but it will warn you again if changes in the grammar result
|
||||||
conflicts.
|
in more or fewer conflicts.
|
||||||
|
|
||||||
@node Start Decl
|
@node Start Decl
|
||||||
@subsection The Start-Symbol
|
@subsection The Start-Symbol
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* Find and resolve or report look-ahead conflicts for bison,
|
/* Find and resolve or report look-ahead conflicts for bison,
|
||||||
|
|
||||||
Copyright (C) 1984, 1989, 1992, 2000, 2001, 2002
|
Copyright (C) 1984, 1989, 1992, 2000, 2001, 2002, 2003
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Bison, the GNU Compiler Compiler.
|
This file is part of Bison, the GNU Compiler Compiler.
|
||||||
@@ -495,12 +495,12 @@ conflicts_print (void)
|
|||||||
if (expected_conflicts != -1)
|
if (expected_conflicts != -1)
|
||||||
{
|
{
|
||||||
if (! src_ok)
|
if (! src_ok)
|
||||||
complain (ngettext ("expected %d shift/reduce conflict",
|
warn (ngettext ("expected %d shift/reduce conflict",
|
||||||
"expected %d shift/reduce conflicts",
|
"expected %d shift/reduce conflicts",
|
||||||
expected_conflicts),
|
expected_conflicts),
|
||||||
expected_conflicts);
|
expected_conflicts);
|
||||||
if (rrc_total)
|
if (rrc_total)
|
||||||
complain (_("expected 0 reduce/reduce conflicts"));
|
warn (_("expected 0 reduce/reduce conflicts"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# Exercising Bison on conflicts. -*- Autotest -*-
|
# Exercising Bison on conflicts. -*- Autotest -*-
|
||||||
# Copyright (C) 2002 Free Software Foundation, Inc.
|
|
||||||
|
# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -485,9 +486,9 @@ AT_DATA([input.y],
|
|||||||
exp: exp OP exp | NUM;
|
exp: exp OP exp | NUM;
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_CHECK([bison -o input.c input.y], 1, [],
|
AT_CHECK([bison -o input.c input.y], 0, [],
|
||||||
[input.y: conflicts: 1 shift/reduce
|
[input.y: conflicts: 1 shift/reduce
|
||||||
input.y: expected 0 shift/reduce conflicts
|
input.y: warning: expected 0 shift/reduce conflicts
|
||||||
])
|
])
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
@@ -522,9 +523,9 @@ AT_DATA([input.y],
|
|||||||
exp: exp OP exp | NUM;
|
exp: exp OP exp | NUM;
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_CHECK([bison -o input.c input.y], 1, [],
|
AT_CHECK([bison -o input.c input.y], 0, [],
|
||||||
[input.y: conflicts: 1 shift/reduce
|
[input.y: conflicts: 1 shift/reduce
|
||||||
input.y: expected 2 shift/reduce conflicts
|
input.y: warning: expected 2 shift/reduce conflicts
|
||||||
])
|
])
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
@@ -542,8 +543,8 @@ program: a 'a' | a a;
|
|||||||
a: 'a';
|
a: 'a';
|
||||||
]])
|
]])
|
||||||
|
|
||||||
AT_CHECK([bison -o input.c input.y], 1, [],
|
AT_CHECK([bison -o input.c input.y], 0, [],
|
||||||
[input.y: conflicts: 1 reduce/reduce
|
[input.y: conflicts: 1 reduce/reduce
|
||||||
input.y: expected 0 reduce/reduce conflicts
|
input.y: warning: expected 0 reduce/reduce conflicts
|
||||||
])
|
])
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|||||||
Reference in New Issue
Block a user