* src/gram.c (dummy): Remove, now there is actual code in gram.c.
(This useless function was defined only to work around VMS linkers
that can't handle compilation units with variables only).
* src/reduce.c (dump_grammar): Use it to trace the construction of
ritem.
+2001-12-05 Akim Demaille <akim@epita.fr>
+
+ * src/gram.c, src/gram.h (ritem_print): New.
+ * src/gram.c (dummy): Remove, now there is actual code in gram.c.
+ (This useless function was defined only to work around VMS linkers
+ that can't handle compilation units with variables only).
+ * src/reduce.c (dump_grammar): Use it to trace the construction of
+ ritem.
+
2001-12-04 Paul Eggert <eggert@twinsun.com>
* src/bison.simple (union yyalloc): Change member names
msgid ""
msgstr ""
"Project-Id-Version: bison 1.25\n"
-"POT-Creation-Date: 2001-11-30 12:41+0100\n"
+"POT-Creation-Date: 2001-11-30 16:11+0100\n"
"PO-Revision-Date: 1996-10-10 17:54 MET DST\n"
"Last-Translator: Ulrich Drepper <drepper@gnu.ai.mit.edu>\n"
"Language-Team: German <de@li.org>\n"
#. MARK). A British English Unicode locale should instead
#. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and
#. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
-#: lib/quotearg.c:268
+#: lib/quotearg.c:274
msgid "`"
msgstr ""
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
msgid "'"
msgstr ""
msgid ""
msgstr ""
"Project-Id-Version: GNU bison 1.25\n"
-"POT-Creation-Date: 2001-11-30 12:41+0100\n"
+"POT-Creation-Date: 2001-11-30 16:11+0100\n"
"PO-Revision-Date: 1998-09-21 10:19+0200\n"
"Last-Translator: Nicolás García-Pedrajas <ngarcia-pedrajas@acm.org>\n"
"Language-Team: Spanish <es@li.org>\n"
#. MARK). A British English Unicode locale should instead
#. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and
#. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
-#: lib/quotearg.c:268
+#: lib/quotearg.c:274
msgid "`"
msgstr ""
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
msgid "'"
msgstr ""
msgid ""
msgstr ""
"Project-Id-Version: bison 1.30d\n"
-"POT-Creation-Date: 2001-11-30 12:41+0100\n"
+"POT-Creation-Date: 2001-11-30 16:11+0100\n"
"PO-Revision-Date: 2001-11-21 17:33+0200\n"
"Last-Translator: Toomas Soome <tsoome@ut.ee>\n"
"Language-Team: Estonian <et@li.org>\n"
#. MARK). A British English Unicode locale should instead
#. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and
#. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
-#: lib/quotearg.c:268
+#: lib/quotearg.c:274
msgid "`"
msgstr "`"
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
msgid "'"
msgstr "'"
msgid ""
msgstr ""
"Project-Id-Version: GNU bison 1.30d\n"
-"POT-Creation-Date: 2001-11-30 12:41+0100\n"
+"POT-Creation-Date: 2001-11-30 16:11+0100\n"
"PO-Revision-Date: 2001-11-21 08:00-0500\n"
"Last-Translator: Michel Robitaille <robitail@IRO.UMontreal.CA>\n"
"Language-Team: French <traduc@traduc.org>\n"
#. MARK). A British English Unicode locale should instead
#. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and
#. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
-#: lib/quotearg.c:268
+#: lib/quotearg.c:274
msgid "`"
msgstr "`"
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
msgid "'"
msgstr "'"
msgid ""
msgstr ""
"Project-Id-Version: GNU bison 1.28\n"
-"POT-Creation-Date: 2001-11-30 12:41+0100\n"
+"POT-Creation-Date: 2001-11-30 16:11+0100\n"
"PO-Revision-Date: 1999-09-28 21:10+0900\n"
"Last-Translator: Daisuke Yamashita <yamad@mb.infoweb.ne.jp>\n"
"Language-Team: Japanese <ja@li.org>\n"
#. MARK). A British English Unicode locale should instead
#. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and
#. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
-#: lib/quotearg.c:268
+#: lib/quotearg.c:274
msgid "`"
msgstr ""
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
msgid "'"
msgstr ""
msgid ""
msgstr ""
"Project-Id-Version: bison 1.25\n"
-"POT-Creation-Date: 2001-11-30 12:41+0100\n"
+"POT-Creation-Date: 2001-11-30 16:11+0100\n"
"PO-Revision-Date: 1996-08-27 15:34 MET DST\n"
"Last-Translator: Erick Branderhorst <branderh@debian.org>\n"
"Language-Team: Dutch <nl@li.org>\n"
#. MARK). A British English Unicode locale should instead
#. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and
#. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
-#: lib/quotearg.c:268
+#: lib/quotearg.c:274
msgid "`"
msgstr ""
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
msgid "'"
msgstr ""
msgid ""
msgstr ""
"Project-Id-Version: bison 1.29\n"
-"POT-Creation-Date: 2001-11-30 12:41+0100\n"
+"POT-Creation-Date: 2001-11-30 16:11+0100\n"
"PO-Revision-Date: 2001-09-09 13:49+04:00\n"
"Last-Translator: Dmitry S. Sivachenko <dima@Chg.RU>\n"
"Language-Team: Russian <ru@li.org>\n"
#. MARK). A British English Unicode locale should instead
#. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and
#. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
-#: lib/quotearg.c:268
+#: lib/quotearg.c:274
msgid "`"
msgstr "`"
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
msgid "'"
msgstr "'"
msgid ""
msgstr ""
"Project-Id-Version: bison 1.30d\n"
-"POT-Creation-Date: 2001-11-30 12:41+0100\n"
+"POT-Creation-Date: 2001-11-30 16:11+0100\n"
"PO-Revision-Date: 2001-11-21 22:10+0100\n"
"Last-Translator: Göran Uddeborg <goeran@uddeborg.pp.se>\n"
"Language-Team: Swedish <sv@li.org>\n"
#. MARK). A British English Unicode locale should instead
#. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and
#. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
-#: lib/quotearg.c:268
+#: lib/quotearg.c:274
msgid "`"
msgstr "\""
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
msgid "'"
msgstr "\""
msgid ""
msgstr ""
"Project-Id-Version: bison 1.30\n"
-"POT-Creation-Date: 2001-11-30 12:41+0100\n"
+"POT-Creation-Date: 2001-11-30 16:11+0100\n"
"PO-Revision-Date: 2001-11-02 14:49GMT\n"
"Last-Translator: Altug Bayram <altugbayram_2000@yahoo.com>\n"
"Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\n"
#. MARK). A British English Unicode locale should instead
#. translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and
#. U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
-#: lib/quotearg.c:268
+#: lib/quotearg.c:274
msgid "`"
msgstr "`"
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
msgid "'"
msgstr "'"
#include "system.h"
#include "gram.h"
+#include "reader.h"
void dummy PARAMS((void));
int error_token_number;
-/* This is to avoid linker problems which occur on VMS when using GCC,
- when the file in question contains data definitions only. */
-
void
-dummy (void)
+ritem_print (FILE *out)
{
+ int i;
+ fputs ("RITEM\n", out);
+ for (i = 0; ritem[i]; ++i)
+ if (ritem[i] > 0)
+ fprintf (out, " %s", tags[ritem[i]]);
+ else
+ fprintf (out, " (rule %d)\n", -ritem[i]);
+ fputs ("\n\n", out);
}
/* ERROR_TOKEN_NUMBER is the token number of the error token. */
extern int error_token_number;
+
+
+/* Dump RITEM for traces. */
+void ritem_print (FILE *out);
#endif /* !GRAM_H_ */
}
ritem[itemno] = 0;
+
+ if (trace_flag)
+ ritem_print (stderr);
}
\f
/*-------------------------------------------------------------------.
fprintf (out, "%5d %5d %5d %s\n", i, sprec[i], sassoc[i], tags[i]);
fprintf (out, "\n\n");
fprintf (out, "Rules\n-----\n\n");
- fprintf (out, "Num (Prec, Assoc) Lhs : (@Rhs) Ritems [Num?]\n");
+ fprintf (out, "Num (Prec, Assoc, Useful, Ritem Range) Lhs -> Rhs (Ritem range) [Num]\n");
for (i = 1; i <= nrules; i++)
{
- fprintf (out, "%-5d(%5d%5d)%5d : (@%-5d)",
+ int rhs_count = 0;
+ /* Find the last RHS index in ritems. */
+ for (r = &ritem[rule_table[i].rhs]; *r > 0; ++r)
+ ++rhs_count;
+ fprintf (out, "%3d (%2d, %2d, %2d, %2d-%2d) %2d ->",
i,
- rule_table[i].prec,
- rule_table[i].assoc,
- rule_table[i].lhs,
- rule_table[i].rhs);
+ rule_table[i].prec, rule_table[i].assoc, rule_table[i].useful,
+ rule_table[i].rhs, rule_table[i].rhs + rhs_count - 1,
+ rule_table[i].lhs);
+ /* Dumped the RHS. */
for (r = &ritem[rule_table[i].rhs]; *r > 0; r++)
- fprintf (out, "%5d", *r);
- fprintf (out, " [%d]\n", -(*r));
+ fprintf (out, "%3d", *r);
+ fprintf (out, " [%d]\n", -(*r));
}
fprintf (out, "\n\n");
fprintf (out, "Rules interpreted\n-----------------\n\n");