+ 0, 1, nstates);
+}
+
+
+/*-------------------------------------------------------------------.
+| For GLR parsers, for each conflicted token in STATE, as indicated |
+| by non-zero entries in conflrow, create a list of possible |
+| reductions that are alternatives to the shift or reduction |
+| currently recorded for that token in STATE. Store the alternative |
+| reductions followed by a 0 in conflict_list, updating |
+| conflict_list_cnt, and storing an index to the start of the list |
+| back into conflrow. |
+`-------------------------------------------------------------------*/
+
+static void
+conflict_row (state_t *state)
+{
+ int i, j;
+
+ if (! glr_parser)
+ return;
+
+ for (j = 0; j < ntokens; j += 1)
+ if (conflrow[j])
+ {
+ conflrow[j] = conflict_list_cnt;
+
+ /* find all reductions for token j, and record all that do
+ * not match actrow[j] */
+ for (i = 0; i < state->nlookaheads; i += 1)
+ if (bitset_test (state->lookaheads[i], j)
+ && actrow[j] != -state->lookaheads_rule[i]->number)
+ {
+ assert (conflict_list_free > 0);
+ conflict_list[conflict_list_cnt]
+ = state->lookaheads_rule[i]->number;
+ conflict_list_cnt += 1;
+ conflict_list_free -= 1;
+ }
+
+ /* Leave a 0 at the end */
+ assert (conflict_list_free > 0);
+ conflict_list_cnt += 1;
+ conflict_list_free -= 1;
+ }