+ bool *used_rules = XCALLOC (bool, nrules);
+ state_number_t i;
+ for (i = 0; i < nstates; i++)
+ {
+ state_t *s = states[i];
+ int j;
+ for (j = 0; j < s->reductions->num; ++j)
+ used_rules[s->reductions->rules[j]->number] = TRUE;
+ if (conflicts[i])
+ {
+ fprintf (out, _("State %d contains "), i);
+ fprintf (out, "%s.\n",
+ conflict_report (count_sr_conflicts (s),
+ count_rr_conflicts (s, TRUE)));
+ printed_sth = TRUE;
+ }
+ }
+ if (printed_sth)
+ fputs ("\n\n", out);
+
+ for (i = 0; i < nstates; i++)
+ {
+ state_t *s = states[i];
+ reductions_t *r = s->reductions;
+ int j;
+ for (j = 0; j < r->num; ++j)
+ if (!used_rules[r->rules[j]->number])
+ {
+ LOCATION_PRINT (stderr, r->rules[j]->location);
+ fprintf (stderr, ": %s: %s: ",
+ _("warning"),
+ _("rule never reduced because of conflicts"));
+ rule_print (r->rules[j], stderr);
+ }
+ }
+ free (used_rules);
+}
+
+/*--------------------------------------------------------.
+| Total the number of S/R and R/R conflicts. Unlike the |
+| code in conflicts_output, however, count EACH pair of |
+| reductions for the same state and lookahead as one |
+| conflict. |
+`--------------------------------------------------------*/
+
+int
+conflicts_total_count (void)
+{
+ state_number_t i;
+ int count;
+
+ /* Conflicts by state. */
+ count = 0;