]> git.saurik.com Git - bison.git/commitdiff
* src/reduce.c (reduce_grammar): First reduce the nonterminals,
authorAkim Demaille <akim@epita.fr>
Mon, 8 Apr 2002 11:45:29 +0000 (11:45 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 8 Apr 2002 11:45:29 +0000 (11:45 +0000)
and then the grammar.

ChangeLog
src/reduce.c

index efb719536675ed36668ac2a6fd572da7b1fd5dce..3d45d5d8a5892f025c6016e0b0630bde6563cb99 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-04-08  Akim Demaille  <akim@epita.fr>
+
+       * src/reduce.c (reduce_grammar): First reduce the nonterminals,
+       and then the grammar.
+
+       
 2002-04-08  Akim Demaille  <akim@epita.fr>
 
        * src/system.h: No longer using strndup.
index 256817505722905f706b36c7ae396237443168bd..565cd57257bbea6e68f929fcf29aa3f458d23554 100644 (file)
@@ -487,10 +487,13 @@ reduce_grammar (void)
     fatal (_("Start symbol %s does not derive any sentence"),
           quotearg_style (escape_quoting_style, symbols[start_symbol]->tag));
 
-  if (nuseless_productions > 0)
-    reduce_grammar_tables ();
+  /* First reduce the nonterminals, as they renumber themselves in the
+     whole grammar.  If you change the order, nonterms would be
+     renumbered only in the reduced grammar.  */
   if (nuseless_nonterminals > 0)
     nonterminals_reduce ();
+  if (nuseless_productions > 0)
+    reduce_grammar_tables ();
 
   if (trace_flag)
     {