- register int i;
- register int j;
- register int k;
- register unsigned *fp1;
- register unsigned *fp2;
- register unsigned *fp3;
- register unsigned *fp4;
- register int rule;
- register int symbol;
- register unsigned mask;
- register int m;
- register int n;
- register int default_LA;
- register int default_rule;
- register int cmax;
- register int count;
- register shifts *shiftp;
- register errs *errp;
+ int i;
+
+ src_total = 0;
+ rrc_total = 0;
+
+ /* Count the total number of conflicts, and if wanted, give a
+ detailed report in FOUTPUT. */
+ 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;
+
+ if (verbose_flag)
+ {
+ obstack_fgrow1 (&output_obstack, _("State %d contains"), i);
+ obstack_sgrow (&output_obstack,
+ conflict_report (src_count, rrc_count));
+ }
+ }
+ }
+
+ /* Report the total number of conflicts on STDERR. */
+ if (yacc_flag)
+ {
+ /* If invoked with `--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);
+ fputs (conflict_report (src_total, rrc_total), stderr);
+ }
+}
+
+
+void
+print_reductions (int state)
+{
+ int i;
+ int j;
+ int k;
+ unsigned *fp1;
+ unsigned *fp2;
+ unsigned *fp3;
+ unsigned *fp4;
+ int rule;
+ int symbol;
+ unsigned mask;
+ int m;
+ int n;
+ int default_LA;
+ int default_rule = 0;
+ int cmax;
+ int count;
+ shifts *shiftp;
+ errs *errp;