- for (j = 0; j < state->nlookaheads; ++j)
- if (bitset_test (LA[state->lookaheadsp + j], i))
- {
- if (count == 0)
- {
- if (state->lookaheadsp + j != default_LA)
- fprintf (out,
- _(" %-4s\treduce using rule %d (%s)\n"),
- escape (symbols[i]->tag),
- LArule[state->lookaheadsp + j]->number - 1,
- escape2 (LArule[state->lookaheadsp + j]->lhs->tag));
- else
- defaulted = 1;
-
- count++;
- }
- else
- {
- if (defaulted)
- fprintf (out,
- _(" %-4s\treduce using rule %d (%s)\n"),
- escape (symbols[i]->tag),
- LArule[default_LA]->number - 1,
- escape2 (LArule[default_LA]->lhs->tag));
- defaulted = 0;
- fprintf (out,
- _(" %-4s\t[reduce using rule %d (%s)]\n"),
- escape (symbols[i]->tag),
- LArule[state->lookaheadsp + j]->number - 1,
- escape2 (LArule[state->lookaheadsp + j]->lhs->tag));
- }
- }
- }
+ /* Report look-ahead tokens (or $default) and reductions. */
+ if (reds->look_ahead_tokens)
+ for (i = 0; i < ntokens; i++)
+ {
+ bool defaulted = false;
+ bool count = bitset_test (shift_set, i);