287 |
void |
void |
288 |
conflicts_solve (void) |
conflicts_solve (void) |
289 |
{ |
{ |
290 |
size_t i; |
state_number_t i; |
291 |
|
|
292 |
conflicts = XCALLOC (char, nstates); |
conflicts = XCALLOC (char, nstates); |
293 |
shiftset = bitset_create (ntokens, BITSET_FIXED); |
shiftset = bitset_create (ntokens, BITSET_FIXED); |
409 |
conflicts_output (FILE *out) |
conflicts_output (FILE *out) |
410 |
{ |
{ |
411 |
bool printed_sth = FALSE; |
bool printed_sth = FALSE; |
412 |
size_t i; |
state_number_t i; |
413 |
for (i = 0; i < nstates; i++) |
for (i = 0; i < nstates; i++) |
414 |
if (conflicts[i]) |
if (conflicts[i]) |
415 |
{ |
{ |
432 |
int |
int |
433 |
conflicts_total_count (void) |
conflicts_total_count (void) |
434 |
{ |
{ |
435 |
unsigned i; |
state_number_t i; |
436 |
int count; |
int count; |
437 |
|
|
438 |
/* Conflicts by state. */ |
/* Conflicts by state. */ |
454 |
void |
void |
455 |
conflicts_print (void) |
conflicts_print (void) |
456 |
{ |
{ |
|
size_t i; |
|
|
|
|
457 |
/* Is the number of SR conflicts OK? Either EXPECTED_CONFLICTS is |
/* Is the number of SR conflicts OK? Either EXPECTED_CONFLICTS is |
458 |
not set, and then we want 0 SR, or else it is specified, in which |
not set, and then we want 0 SR, or else it is specified, in which |
459 |
case we want equality. */ |
case we want equality. */ |
463 |
int rrc_total = 0; |
int rrc_total = 0; |
464 |
|
|
465 |
/* Conflicts by state. */ |
/* Conflicts by state. */ |
466 |
for (i = 0; i < nstates; i++) |
{ |
467 |
if (conflicts[i]) |
state_number_t i; |
468 |
{ |
|
469 |
src_total += count_sr_conflicts (states[i]); |
for (i = 0; i < nstates; i++) |
470 |
rrc_total += count_rr_conflicts (states[i], TRUE); |
if (conflicts[i]) |
471 |
} |
{ |
472 |
|
src_total += count_sr_conflicts (states[i]); |
473 |
|
rrc_total += count_rr_conflicts (states[i], TRUE); |
474 |
|
} |
475 |
|
} |
476 |
|
|
477 |
src_ok = src_total == (expected_conflicts == -1 ? 0 : expected_conflicts); |
src_ok = src_total == (expected_conflicts == -1 ? 0 : expected_conflicts); |
478 |
|
|