/* Display the lookaheads? */
if (report_flag & report_lookaheads)
- {
- int j, k;
- int nlookaheads = 0;
- /* Look for lookaheads corresponding to this rule. */
- for (j = 0; j < state->nlookaheads; ++j)
- for (k = 0; k < ntokens; ++k)
- if (bitset_test (state->lookaheads[j], k)
- && state->lookaheads_rule[j]->number == rule)
- nlookaheads++;
- if (nlookaheads)
- {
- fprintf (out, " [");
- for (j = 0; j < state->nlookaheads; ++j)
- for (k = 0; k < ntokens; ++k)
- if (bitset_test (state->lookaheads[j], k)
- && state->lookaheads_rule[j]->number == rule)
- fprintf (out, "%s%s",
- symbol_tag_get (symbols[k]),
- --nlookaheads ? ", " : "");
- fprintf (out, "]");
- }
- }
+ state_rule_lookaheads_print (state, &rules[rule], out);
fprintf (out, _(" (rule %d)"), rule - 1);
fputc ('\n', out);
for (i = 0; i < shiftp->nshifts && SHIFT_IS_SHIFT (shiftp, i); i++)
if (!SHIFT_IS_DISABLED (shiftp, i))
{
- int state1 = shiftp->shifts[i];
+ state_number_t state1 = shiftp->shifts[i];
symbol_number_t symbol = states[state1]->accessing_symbol;
fprintf (out,
_(" %-4s\tshift, and go to state %d\n"),
for (; i < shiftp->nshifts; i++)
if (!SHIFT_IS_DISABLED (shiftp, i))
{
- int state1 = shiftp->shifts[i];
+ state_number_t state1 = shiftp->shifts[i];
symbol_number_t symbol = states[state1]->accessing_symbol;
fprintf (out, _(" %-4s\tgo to state %d\n"),
symbol_tag_get (symbols[symbol]), state1);
if (shiftp->nshifts == 0 && redp->nreds == 0)
{
- if (final_state == state->number)
+ if (state->number == final_state->number)
fprintf (out, _(" $default\taccept\n"));
else
fprintf (out, _(" NO ACTIONS\n"));
void
print_results (void)
{
- size_t i;
+ state_number_t i;
/* We used to use just .out if SPEC_NAME_PREFIX (-p) was used, but
that conflicts with Posix. */