+ int i;
+ shifts_t *shiftp = state->shifts;
+ reductions_t *redp = state->reductions;
+ rule_t *default_rule = NULL;
+
+ if (redp->nreds == 0)
+ return;
+
+ default_rule = state_default_rule_compute (state);
+
+ bitset_zero (shiftset);
+ for (i = 0; i < shiftp->nshifts && SHIFT_IS_SHIFT (shiftp, i); i++)
+ if (!SHIFT_IS_DISABLED (shiftp, i))
+ bitset_set (shiftset, SHIFT_SYMBOL (shiftp, i));
+
+ for (i = 0; i < ntokens; i++)
+ {
+ int j;
+ int defaulted = 0;
+ int count = bitset_test (shiftset, i);
+
+ for (j = 0; j < state->nlookaheads; ++j)
+ if (bitset_test (state->lookaheads[j], i))
+ {
+ if (count == 0)
+ {
+ if (state->lookaheads_rule[j] != default_rule)
+ fprintf (out,
+ _(" %-4s\treduce using rule %d (%s)\n"),
+ symbol_tag_get (symbols[i]),
+ state->lookaheads_rule[j]->number - 1,
+ symbol_tag_get_n (state->lookaheads_rule[j]->lhs, 1));
+ else
+ defaulted = 1;
+ count++;
+ }
+ else
+ {
+ if (defaulted)
+ fprintf (out,
+ _(" %-4s\treduce using rule %d (%s)\n"),
+ symbol_tag_get (symbols[i]),
+ default_rule->number - 1,
+ symbol_tag_get_n (default_rule->lhs, 1));
+ defaulted = 0;
+ fprintf (out,
+ _(" %-4s\t[reduce using rule %d (%s)]\n"),
+ symbol_tag_get (symbols[i]),
+ state->lookaheads_rule[j]->number - 1,
+ symbol_tag_get_n (state->lookaheads_rule[j]->lhs, 1));
+ }
+ }
+ }
+
+ if (default_rule)
+ fprintf (out, _(" $default\treduce using rule %d (%s)\n"),
+ default_rule->number - 1,
+ symbol_tag_get (default_rule->lhs));
+ fputc ('\n', out);
+}
+
+
+/*--------------------------------------------------------------.
+| Report on OUT all the actions (shifts, gotos, reductions, and |
+| explicit erros from %nonassoc) of STATE. |
+`--------------------------------------------------------------*/
+
+static void
+print_actions (FILE *out, state_t *state)
+{
+ reductions_t *redp = state->reductions;
+ shifts_t *shiftp = state->shifts;
+
+ if (shiftp->nshifts == 0 && redp->nreds == 0)
+ {
+ if (state->number == final_state->number)
+ fprintf (out, _(" $default\taccept\n"));
+ else
+ fprintf (out, _(" NO ACTIONS\n"));
+ return;
+ }
+
+ print_shifts (out, state);
+ print_errs (out, state);
+ print_reductions (out, state);
+ print_gotos (out, state);
+}
+
+
+static void
+print_state (FILE *out, state_t *state)
+{
+ fprintf (out, _("state %d"), state->number);