mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 15:23:02 +00:00
Fix untranslatable composition of sentences.
Reported by Goran Uddeborg at <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>. * THANKS (Goran Uddeborg): Add. * src/reduce.c (reduce_print): Report the number of nonterminals and rules useless in the grammar in separate sentences. * tests/reduce.at (Useless Rules): Update output. (Reduced Automaton): Likewise. (Underivable Rules): Likewise. (Empty Language): Likewise.
This commit is contained in:
13
ChangeLog
13
ChangeLog
@@ -1,3 +1,16 @@
|
|||||||
|
2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
|
||||||
|
|
||||||
|
Fix untranslatable composition of sentences. Reported by Goran
|
||||||
|
Uddeborg at
|
||||||
|
<http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
|
||||||
|
* THANKS (Goran Uddeborg): Add.
|
||||||
|
* src/reduce.c (reduce_print): Report the number of nonterminals and
|
||||||
|
rules useless in the grammar in separate sentences.
|
||||||
|
* tests/reduce.at (Useless Rules): Update output.
|
||||||
|
(Reduced Automaton): Likewise.
|
||||||
|
(Underivable Rules): Likewise.
|
||||||
|
(Empty Language): Likewise.
|
||||||
|
|
||||||
2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
|
2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
|
||||||
|
|
||||||
Fix some .gitignore and .cvsignore problems.
|
Fix some .gitignore and .cvsignore problems.
|
||||||
|
|||||||
1
THANKS
1
THANKS
@@ -33,6 +33,7 @@ Fabrice Bauzac noon@cote-dazur.com
|
|||||||
Florian Krohm florian@edamail.fishkill.ibm.com
|
Florian Krohm florian@edamail.fishkill.ibm.com
|
||||||
Frank Heckenbach frank@g-n-u.de
|
Frank Heckenbach frank@g-n-u.de
|
||||||
Frans Englich frans.englich@telia.com
|
Frans Englich frans.englich@telia.com
|
||||||
|
Goran Uddeborg goeran@uddeborg.se
|
||||||
Guido Trentalancia trentalg@aston.ac.uk
|
Guido Trentalancia trentalg@aston.ac.uk
|
||||||
H. Merijn Brand h.m.brand@hccnet.nl
|
H. Merijn Brand h.m.brand@hccnet.nl
|
||||||
Hans Aberg haberg@matematik.su.se
|
Hans Aberg haberg@matematik.su.se
|
||||||
|
|||||||
34
src/reduce.c
34
src/reduce.c
@@ -382,26 +382,24 @@ reduce_output (FILE *out)
|
|||||||
static void
|
static void
|
||||||
reduce_print (void)
|
reduce_print (void)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s: %s: ", grammar_file, _("warning"));
|
|
||||||
|
|
||||||
if (nuseless_nonterminals > 0)
|
if (nuseless_nonterminals > 0)
|
||||||
fprintf (stderr, ngettext ("%d nonterminal",
|
{
|
||||||
"%d nonterminals",
|
fprintf (stderr, "%s: %s: ", grammar_file, _("warning"));
|
||||||
nuseless_nonterminals),
|
fprintf (stderr, ngettext ("%d nonterminal useless in grammar",
|
||||||
nuseless_nonterminals);
|
"%d nonterminals useless in grammar",
|
||||||
|
nuseless_nonterminals),
|
||||||
if (nuseless_nonterminals > 0 && nuseless_productions > 0)
|
nuseless_nonterminals);
|
||||||
fprintf (stderr, _(" and "));
|
fprintf (stderr, "\n");
|
||||||
|
}
|
||||||
if (nuseless_productions > 0)
|
if (nuseless_productions > 0)
|
||||||
fprintf (stderr, ngettext ("%d rule",
|
{
|
||||||
"%d rules",
|
fprintf (stderr, "%s: %s: ", grammar_file, _("warning"));
|
||||||
nuseless_productions),
|
fprintf (stderr, ngettext ("%d rule useless in grammar",
|
||||||
nuseless_productions);
|
"%d rules useless in grammar",
|
||||||
|
nuseless_productions),
|
||||||
if (nuseless_nonterminals > 0 || nuseless_productions > 0)
|
nuseless_productions);
|
||||||
fprintf (stderr, _(" useless in grammar"));
|
fprintf (stderr, "\n");
|
||||||
fprintf (stderr, "\n");
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -142,7 +142,8 @@ useless9: '9';
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
AT_BISON_CHECK([[input.y]], 0, [],
|
AT_BISON_CHECK([[input.y]], 0, [],
|
||||||
[[input.y: warning: 9 nonterminals and 9 rules useless in grammar
|
[[input.y: warning: 9 nonterminals useless in grammar
|
||||||
|
input.y: warning: 9 rules useless in grammar
|
||||||
input.y:6.1-8: warning: nonterminal useless in grammar: useless1
|
input.y:6.1-8: warning: nonterminal useless in grammar: useless1
|
||||||
input.y:7.1-8: warning: nonterminal useless in grammar: useless2
|
input.y:7.1-8: warning: nonterminal useless in grammar: useless2
|
||||||
input.y:8.1-8: warning: nonterminal useless in grammar: useless3
|
input.y:8.1-8: warning: nonterminal useless in grammar: useless3
|
||||||
@@ -237,7 +238,8 @@ non_productive: non_productive useless_token
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
AT_BISON_CHECK([[not-reduced.y]], 0, [],
|
AT_BISON_CHECK([[not-reduced.y]], 0, [],
|
||||||
[[not-reduced.y: warning: 2 nonterminals and 3 rules useless in grammar
|
[[not-reduced.y: warning: 2 nonterminals useless in grammar
|
||||||
|
not-reduced.y: warning: 3 rules useless in grammar
|
||||||
not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable
|
not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable
|
||||||
not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive
|
not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive
|
||||||
not-reduced.y:11.6-57: warning: rule useless in grammar: exp: non_productive
|
not-reduced.y:11.6-57: warning: rule useless in grammar: exp: non_productive
|
||||||
@@ -311,7 +313,8 @@ indirection: underivable;
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
AT_BISON_CHECK([[input.y]], 0, [],
|
AT_BISON_CHECK([[input.y]], 0, [],
|
||||||
[[input.y: warning: 2 nonterminals and 3 rules useless in grammar
|
[[input.y: warning: 2 nonterminals useless in grammar
|
||||||
|
input.y: warning: 3 rules useless in grammar
|
||||||
input.y:5.15-25: warning: nonterminal useless in grammar: underivable
|
input.y:5.15-25: warning: nonterminal useless in grammar: underivable
|
||||||
input.y:6.14-24: warning: nonterminal useless in grammar: indirection
|
input.y:6.14-24: warning: nonterminal useless in grammar: indirection
|
||||||
input.y:5.15-25: warning: rule useless in grammar: exp: underivable
|
input.y:5.15-25: warning: rule useless in grammar: exp: underivable
|
||||||
@@ -346,7 +349,8 @@ exp: exp;
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
AT_BISON_CHECK([[input.y]], 1, [],
|
AT_BISON_CHECK([[input.y]], 1, [],
|
||||||
[[input.y: warning: 2 nonterminals and 2 rules useless in grammar
|
[[input.y: warning: 2 nonterminals useless in grammar
|
||||||
|
input.y: warning: 2 rules useless in grammar
|
||||||
input.y:3.1-3: fatal error: start symbol exp does not derive any sentence
|
input.y:3.1-3: fatal error: start symbol exp does not derive any sentence
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user