X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/9a636f47cee64ab6e1f7588c6261fc46ea134c39..bb88b0fc9e1f8ff9f2f5e672078a81d13288e0d5:/src/reduce.c diff --git a/src/reduce.c b/src/reduce.c index 25681750..565cd572 100644 --- a/src/reduce.c +++ b/src/reduce.c @@ -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) {