186 |
for conflicts not resolved above. */ |
for conflicts not resolved above. */ |
187 |
for (i = 0; i < state->nlookaheads; ++i) |
for (i = 0; i < state->nlookaheads; ++i) |
188 |
{ |
{ |
189 |
|
/* FIXME: Here, I need something like `bitset_disjoint_p'. */ |
190 |
for (j = 0; j < ntokens; ++j) |
for (j = 0; j < ntokens; ++j) |
191 |
if (bitset_test (LA[state->lookaheadsp + i], j) |
if (bitset_test (LA[state->lookaheadsp + i], j) |
192 |
&& bitset_test (lookaheadset, j)) |
&& bitset_test (lookaheadset, j)) |
193 |
conflicts[state->number] = 1; |
conflicts[state->number] = 1; |
194 |
|
|
195 |
for (j = 0; j < ntokens; ++j) |
bitset_or (lookaheadset, lookaheadset, LA[state->lookaheadsp + i]); |
|
if (bitset_test (LA[state->lookaheadsp + i], j)) |
|
|
bitset_set (lookaheadset, j); |
|
196 |
} |
} |
197 |
} |
} |
198 |
|
|
219 |
static int |
static int |
220 |
count_sr_conflicts (state_t *state) |
count_sr_conflicts (state_t *state) |
221 |
{ |
{ |
222 |
int i, k; |
int i; |
223 |
int src_count = 0; |
int src_count = 0; |
224 |
shifts *shiftp = state->shifts; |
shifts *shiftp = state->shifts; |
225 |
|
|
234 |
bitset_set (shiftset, SHIFT_SYMBOL (shiftp, i)); |
bitset_set (shiftset, SHIFT_SYMBOL (shiftp, i)); |
235 |
|
|
236 |
for (i = 0; i < state->nlookaheads; ++i) |
for (i = 0; i < state->nlookaheads; ++i) |
237 |
for (k = 0; k < ntokens; ++k) |
bitset_or (lookaheadset, lookaheadset, LA[state->lookaheadsp + i]); |
|
if (bitset_test (LA[state->lookaheadsp + i], k)) |
|
|
bitset_set (lookaheadset, k); |
|
238 |
|
|
239 |
bitset_and (lookaheadset, lookaheadset, shiftset); |
bitset_and (lookaheadset, lookaheadset, shiftset); |
240 |
|
|