451 |
conflicts_output (FILE *out) |
conflicts_output (FILE *out) |
452 |
{ |
{ |
453 |
bool printed_sth = FALSE; |
bool printed_sth = FALSE; |
|
bool *used_rules = XCALLOC (bool, nrules); |
|
454 |
state_number_t i; |
state_number_t i; |
455 |
for (i = 0; i < nstates; i++) |
for (i = 0; i < nstates; i++) |
456 |
{ |
{ |
457 |
state_t *s = states[i]; |
state_t *s = states[i]; |
|
reductions_t *reds = s->reductions; |
|
|
int j; |
|
|
for (j = 0; j < reds->num; ++j) |
|
|
used_rules[reds->rules[j]->number] = TRUE; |
|
458 |
if (conflicts[i]) |
if (conflicts[i]) |
459 |
{ |
{ |
460 |
fprintf (out, _("State %d contains "), i); |
fprintf (out, _("State %d contains "), i); |
466 |
} |
} |
467 |
if (printed_sth) |
if (printed_sth) |
468 |
fputs ("\n\n", out); |
fputs ("\n\n", out); |
|
|
|
|
for (i = 0; i < nstates; i++) |
|
|
{ |
|
|
state_t *s = states[i]; |
|
|
reductions_t *r = s->reductions; |
|
|
int j; |
|
|
for (j = 0; j < r->num; ++j) |
|
|
if (!used_rules[r->rules[j]->number]) |
|
|
{ |
|
|
LOCATION_PRINT (stderr, r->rules[j]->location); |
|
|
fprintf (stderr, ": %s: %s: ", |
|
|
_("warning"), |
|
|
_("rule never reduced because of conflicts")); |
|
|
rule_print (r->rules[j], stderr); |
|
|
} |
|
|
} |
|
|
free (used_rules); |
|
469 |
} |
} |
470 |
|
|
471 |
/*--------------------------------------------------------. |
/*--------------------------------------------------------. |