- 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));
- }
- }
+ char *default_reductions =
+ muscle_percent_define_get ("lr.default-reductions");
+ print_reduction (out, width, _("$default"), default_reduction, true);
+ aver (0 == strcmp (default_reductions, "most")
+ || (0 == strcmp (default_reductions, "consistent")
+ && default_reduction_only)
+ || (reds->num == 1 && reds->rules[0]->number == 0));
+ free (default_reductions);