]> git.saurik.com Git - bison.git/commitdiff
* src/gram.c, src/gram.h (ritem_print): New.
authorAkim Demaille <akim@epita.fr>
Wed, 5 Dec 2001 09:16:07 +0000 (09:16 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 5 Dec 2001 09:16:07 +0000 (09:16 +0000)
* 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.

14 files changed:
ChangeLog
po/de.po
po/es.po
po/et.po
po/fr.po
po/ja.po
po/nl.po
po/ru.po
po/sv.po
po/tr.po
src/gram.c
src/gram.h
src/reader.c
src/reduce.c

index 1a7be67b6ac41d9ca6dea943adbf6a8efbd986c4..821bf525608f0869d0d80b3e94eef33f4552d394 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+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
 2001-12-04  Paul Eggert  <eggert@twinsun.com>
 
        * src/bison.simple (union yyalloc): Change member names
index 5e58b928c9982330dfb4dd18c834d2360b6f7277..1722653f1eeeb005cee3f2f2afbe3ffbd7faa63c 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.25\n"
 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"
 "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"
@@ -761,11 +761,11 @@ msgstr "%s: Hauptspeicher ersch
 #. 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.
 #. 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 ""
 
 msgid "`"
 msgstr ""
 
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
 msgid "'"
 msgstr ""
 
 msgid "'"
 msgstr ""
 
index 6d0d02d0edcec3c6d8608c6589587ed4398ad80b..9dfd85f025075bd4526858db6686e3c4e6aadfb4 100644 (file)
--- a/po/es.po
+++ b/po/es.po
@@ -30,7 +30,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: GNU bison 1.25\n"
 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"
 "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"
@@ -874,11 +874,11 @@ msgstr "%s: memoria agotada\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.
 #. 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 ""
 
 msgid "`"
 msgstr ""
 
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
 msgid "'"
 msgstr ""
 
 msgid "'"
 msgstr ""
 
index 3bc224d2651fd0d1e64d98ff4a5fae014651e7ca..97e37d374358e9ea1e0a544dd4cc98b77458500d 100644 (file)
--- a/po/et.po
+++ b/po/et.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.30d\n"
 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"
 "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"
@@ -752,11 +752,11 @@ msgstr "m
 #. 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.
 #. 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 "`"
 
 msgid "`"
 msgstr "`"
 
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
 msgid "'"
 msgstr "'"
 
 msgid "'"
 msgstr "'"
 
index d35ae29121008462480353638d8446ac5cf7faf6..0ca72a6067f66918f11b85eb82642fa0ba73888d 100644 (file)
--- a/po/fr.po
+++ b/po/fr.po
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: GNU bison 1.30d\n"
 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"
 "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"
@@ -756,11 +756,11 @@ msgstr "m
 #. 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.
 #. 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 "`"
 
 msgid "`"
 msgstr "`"
 
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
 msgid "'"
 msgstr "'"
 
 msgid "'"
 msgstr "'"
 
index 47ccc7b879ececb43c607b0679d17ad2c123925a..eaf9c1f501217aa94cc0aa1054d9d201dba3ab91 100644 (file)
--- a/po/ja.po
+++ b/po/ja.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: GNU bison 1.28\n"
 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"
 "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"
@@ -757,11 +757,11 @@ msgstr "%s: 
 #. 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.
 #. 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 ""
 
 msgid "`"
 msgstr ""
 
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
 msgid "'"
 msgstr ""
 
 msgid "'"
 msgstr ""
 
index c75494adff9e245747f7951587cbe5ffdbbcfc16..07224bda958cfa1f64ce0daea646bc7f18aff7f6 100644 (file)
--- a/po/nl.po
+++ b/po/nl.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.25\n"
 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"
 "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"
@@ -760,11 +760,11 @@ msgstr "%s: geen geheugen meer beschikbaar\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.
 #. 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 ""
 
 msgid "`"
 msgstr ""
 
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
 msgid "'"
 msgstr ""
 
 msgid "'"
 msgstr ""
 
index 3ad7aa0e9c8440752bd44772925f8b6e887c121b..5b51e6dd7fa81c936e197eebcc85d73435144af7 100644 (file)
--- a/po/ru.po
+++ b/po/ru.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.29\n"
 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"
 "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"
@@ -755,11 +755,11 @@ msgstr "
 #. 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.
 #. 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 "`"
 
 msgid "`"
 msgstr "`"
 
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
 msgid "'"
 msgstr "'"
 
 msgid "'"
 msgstr "'"
 
index ba1798a97c9333d543983f275fa9481ddcc76e7f..e7a932eaccdc6b3efba79667ad568111ddcabb00 100644 (file)
--- a/po/sv.po
+++ b/po/sv.po
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.30d\n"
 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"
 "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"
@@ -764,11 +764,11 @@ msgstr "minnet slut"
 #. 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.
 #. 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 "\""
 
 msgid "`"
 msgstr "\""
 
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
 msgid "'"
 msgstr "\""
 
 msgid "'"
 msgstr "\""
 
index 11f8ad6fb7534557adbd58d3794195e248b4ed82..49bce1affd65fcb3870cf2ce95b11433ffc12201 100644 (file)
--- a/po/tr.po
+++ b/po/tr.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: bison 1.30\n"
 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"
 "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"
@@ -757,11 +757,11 @@ msgstr "bellek t
 #. 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.
 #. 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 "`"
 
 msgid "`"
 msgstr "`"
 
-#: lib/quotearg.c:269
+#: lib/quotearg.c:275
 msgid "'"
 msgstr "'"
 
 msgid "'"
 msgstr "'"
 
index 1df89a0276d3fa8a5a07d6fbd4e7522b4688bf96..35302616ace92a925b46d4bc0cd2c4c44409e31f 100644 (file)
@@ -21,6 +21,7 @@ Boston, MA 02111-1307, USA.  */
 
 #include "system.h"
 #include "gram.h"
 
 #include "system.h"
 #include "gram.h"
+#include "reader.h"
 
 void dummy PARAMS((void));
 
 
 void dummy PARAMS((void));
 
@@ -52,10 +53,15 @@ int pure_parser;
 
 int error_token_number;
 
 
 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
 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);
 }
 }
index ca55d007b55ed79062969415f4b054469c0c673c..516907c225878e2daee5f008c786e5184bbf0cfb 100644 (file)
@@ -147,4 +147,8 @@ extern int pure_parser;
 /* ERROR_TOKEN_NUMBER is the token number of the error token.  */
 
 extern int error_token_number;
 /* 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_ */
 #endif /* !GRAM_H_ */
index 6b64766892527a4964940d5accb8666969d6d05f..028ffc0bfe8e7fa1fc37bb99334cbd319c036d3f 100644 (file)
@@ -1911,6 +1911,9 @@ packgram (void)
     }
 
   ritem[itemno] = 0;
     }
 
   ritem[itemno] = 0;
+
+  if (trace_flag)
+    ritem_print (stderr);
 }
 \f
 /*-------------------------------------------------------------------.
 }
 \f
 /*-------------------------------------------------------------------.
index 190f357746a43f9165e380302ab82efb89ae395c..048f5a632236524fd78fd15f95c6b2b84bb77f04 100644 (file)
@@ -455,18 +455,22 @@ dump_grammar (FILE *out)
     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, "%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++)
     {
   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,
               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++)
       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");
     }
   fprintf (out, "\n\n");
   fprintf (out, "Rules interpreted\n-----------------\n\n");