- 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;
+
+ int src_total = 0;
+ int rrc_total = 0;
+
+ /* Conflicts by state. */
+ for (i = 0; i < nstates; i++)
+ if (conflicts[i])
+ {
+ src_total += count_sr_conflicts (i);
+ rrc_total += count_rr_conflicts (i);
+ }
+
+ /* Report the total number of conflicts on STDERR. */
+ if (src_total || rrc_total)
+ 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;