+/*------------------------------------.
+| Give a report about the conflicts. |
+`------------------------------------*/
+
+static void
+total_conflicts (void)
+{
+ if (src_total == expected_conflicts && rrc_total == 0)
+ return;
+
+ if (fixed_outfiles)
+ {
+ /* If invoked under the name `yacc', use the output format
+ specified by POSIX. */
+ fprintf (stderr, _("conflicts: "));
+ if (src_total > 0)
+ fprintf (stderr, _(" %d shift/reduce"), src_total);
+ if (src_total > 0 && rrc_total > 0)
+ fprintf (stderr, ",");
+ if (rrc_total > 0)
+ fprintf (stderr, _(" %d reduce/reduce"), rrc_total);
+ putc ('\n', stderr);
+ }
+ else
+ {
+ fprintf (stderr, _("%s contains"), infile);
+
+ if (src_total == 1)
+ fprintf (stderr, _(" 1 shift/reduce conflict"));
+ else if (src_total > 1)
+ fprintf (stderr, _(" %d shift/reduce conflicts"), src_total);
+
+ if (src_total > 0 && rrc_total > 0)
+ fprintf (stderr, _(" and"));
+
+ if (rrc_total == 1)
+ fprintf (stderr, _(" 1 reduce/reduce conflict"));
+ else if (rrc_total > 1)
+ fprintf (stderr, _(" %d reduce/reduce conflicts"), rrc_total);
+
+ putc ('.', stderr);
+ putc ('\n', stderr);
+ }
+}
+
+
+/*---------------------------------------------.
+| Compute and give a report on the conflicts. |
+`---------------------------------------------*/
+
+void
+conflict_log (void)
+{
+ int i;
+
+ src_total = 0;
+ rrc_total = 0;
+
+ for (i = 0; i < nstates; i++)
+ {
+ if (conflicts[i])
+ {
+ count_sr_conflicts (i);
+ count_rr_conflicts (i);
+ src_total += src_count;
+ rrc_total += rrc_count;
+ }
+ }
+
+ total_conflicts ();
+}
+
+
+void
+verbose_conflict_log (void)
+{
+ int i;
+
+ src_total = 0;
+ rrc_total = 0;
+
+ for (i = 0; i < nstates; i++)
+ {
+ if (conflicts[i])
+ {
+ count_sr_conflicts (i);
+ count_rr_conflicts (i);
+ src_total += src_count;
+ rrc_total += rrc_count;
+
+ fprintf (foutput, _("State %d contains"), i);
+
+ if (src_count == 1)
+ fprintf (foutput, _(" 1 shift/reduce conflict"));
+ else if (src_count > 1)
+ fprintf (foutput, _(" %d shift/reduce conflicts"), src_count);
+
+ if (src_count > 0 && rrc_count > 0)
+ fprintf (foutput, _(" and"));
+
+ if (rrc_count == 1)
+ fprintf (foutput, _(" 1 reduce/reduce conflict"));
+ else if (rrc_count > 1)
+ fprintf (foutput, _(" %d reduce/reduce conflicts"), rrc_count);
+
+ putc ('.', foutput);
+ putc ('\n', foutput);
+ }
+ }
+
+ total_conflicts ();
+}
+
+
+
+
+