+
+/*---------------------------------------.
+| Output the lookaheads for each state. |
+`---------------------------------------*/
+
+static void
+lookaheads_print (FILE *out)
+{
+ size_t i;
+ int j, k;
+ fprintf (out, "Lookaheads: BEGIN\n");
+ for (i = 0; i < nstates; ++i)
+ {
+ fprintf (out, "State %d: %d lookaheads\n",
+ i, states[i]->nlookaheads);
+
+ for (j = 0; j < states[i]->nlookaheads; ++j)
+ for (k = 0; k < ntokens; ++k)
+ if (bitset_test (LA[states[i]->lookaheadsp + j], k))
+ fprintf (out, " on %d (%s) -> rule %d\n",
+ k, quotearg_style (escape_quoting_style, symbols[k]->tag),
+ LArule[states[i]->lookaheadsp + j]->number - 1);
+ }
+ fprintf (out, "Lookaheads: END\n");
+}
+