* src/gram.h, src/gram.c (rules_rhs_length): New.

(ritem_longest_rhs): Use it.
* src/gram.h (rule_t): `number' is a new member.
* src/reader.c (packgram): Set it.
* src/reduce.c (reduce_grammar_tables): Move the useless rules at
the end of `rules', and count them out of `nrules'.
(reduce_output, dump_grammar): Adjust.
* src/print.c (print_grammar): It is no longer needed to check for
the usefulness of a rule, as useless rules are beyond `nrules + 1'.
* tests/reduce.at (Reduced Automaton): New test.
This commit is contained in:
Akim Demaille
2002-04-07 17:36:38 +00:00
parent c307773eec
commit c3b407f430
17 changed files with 211 additions and 109 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: bison 1.25\n"
"POT-Creation-Date: 2002-04-07 18:07+0200\n"
"POT-Creation-Date: 2002-04-07 19:13+0200\n"
"PO-Revision-Date: 1996-10-10 17:54 MET DST\n"
"Last-Translator: Ulrich Drepper <[email protected]>\n"
"Language-Team: German <[email protected]>\n"
+1 -1
View File
@@ -30,7 +30,7 @@
msgid ""
msgstr ""
"Project-Id-Version: GNU bison 1.25\n"
"POT-Creation-Date: 2002-04-07 18:07+0200\n"
"POT-Creation-Date: 2002-04-07 19:13+0200\n"
"PO-Revision-Date: 2002-03-14 19:34+0100\n"
"Last-Translator: Nicolás García-Pedrajas <[email protected]>\n"
"Language-Team: Spanish <[email protected]>\n"
+1 -1
View File
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: bison 1.28d\n"
"POT-Creation-Date: 2002-04-07 18:07+0200\n"
"POT-Creation-Date: 2002-04-07 19:13+0200\n"
"PO-Revision-Date: 2001-08-29 17:06+02:00\n"
"Last-Translator: Toomas Soome <[email protected]>\n"
"Language-Team: Estonian <[email protected]>\n"
+1 -1
View File
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: GNU bison 1.28d\n"
"POT-Creation-Date: 2002-04-07 18:07+0200\n"
"POT-Creation-Date: 2002-04-07 19:13+0200\n"
"PO-Revision-Date: 2001-08-29 20:00-0500\n"
"Last-Translator: Michel Robitaille <[email protected]>\n"
"Language-Team: French <[email protected]>\n"
+1 -1
View File
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: bison 1.31\n"
"POT-Creation-Date: 2002-04-07 18:07+0200\n"
"POT-Creation-Date: 2002-04-07 19:13+0200\n"
"PO-Revision-Date: 2002-01-18 12:40 CET\n"
"Last-Translator: Paolo Bonzini <[email protected]>\n"
"Language-Team: Italian <[email protected]>\n"
+1 -1
View File
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: GNU bison 1.28\n"
"POT-Creation-Date: 2002-04-07 18:07+0200\n"
"POT-Creation-Date: 2002-04-07 19:13+0200\n"
"PO-Revision-Date: 1999-09-28 21:10+0900\n"
"Last-Translator: Daisuke Yamashita <[email protected]>\n"
"Language-Team: Japanese <[email protected]>\n"
+1 -1
View File
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: bison 1.25\n"
"POT-Creation-Date: 2002-04-07 18:07+0200\n"
"POT-Creation-Date: 2002-04-07 19:13+0200\n"
"PO-Revision-Date: 1996-08-27 15:34 MET DST\n"
"Last-Translator: Erick Branderhorst <[email protected]>\n"
"Language-Team: Dutch <[email protected]>\n"
+1 -1
View File
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: bison 1.29\n"
"POT-Creation-Date: 2002-04-07 18:07+0200\n"
"POT-Creation-Date: 2002-04-07 19:13+0200\n"
"PO-Revision-Date: 2001-09-09 13:49+04:00\n"
"Last-Translator: Dmitry S. Sivachenko <[email protected]>\n"
"Language-Team: Russian <[email protected]>\n"
+1 -1
View File
@@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: bison 1.30c\n"
"POT-Creation-Date: 2002-04-07 18:07+0200\n"
"POT-Creation-Date: 2002-04-07 19:13+0200\n"
"PO-Revision-Date: 2001-11-18 15:17+0100\n"
"Last-Translator: Göran Uddeborg <[email protected]>\n"
"Language-Team: Swedish <[email protected]>\n"
+1 -1
View File
@@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: bison 1.28c\n"
"POT-Creation-Date: 2002-04-07 18:07+0200\n"
"POT-Creation-Date: 2002-04-07 19:13+0200\n"
"PO-Revision-Date: 2001-09-10 10:54GMT\n"
"Last-Translator: Altug Bayram <[email protected]>\n"
"Language-Team: Turkish <[email protected]>\n"