diff options
author | Akim Demaille <akim@epita.fr> | 2002-08-02 08:05:01 +0000 |
---|---|---|
committer | Akim Demaille <akim@epita.fr> | 2002-08-02 08:05:01 +0000 |
commit | c8f002c7d3407d5c91a5882466916160a72aa8c4 (patch) | |
tree | 7cfa7de4dc3d8f65b8cb9732073501aa25f8bf75 /src/conflicts.c | |
parent | cd08e51edafa326fd8a6327f0b659fdbceb24dda (diff) | |
download | bison-c8f002c7d3407d5c91a5882466916160a72aa8c4.tar.gz |
* src/conflicts.c (conflicts_output): Don't output rules never
reduced here, since anyway that computation doesn't work.
* src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
(rule_useless_p, rule_never_reduced_p): New.
(grammar_rules_partial_print): Use a filter instead of a range.
Display the title only if needed.
(grammar_rules_print): Adjust.
(grammar_rules_never_reduced_report): New.
* src/tables.c (action_row): Move the computation of rules never
reduced to...
(token_actions): here.
* src/main.c (main): Make the parser before making the report, so
that rules never reduced are computed.
Call grammar_rules_never_reduced_report.
* src/print.c (print_results): Report rules never reduced.
* tests/conflicts.at, tests/reduce.at: Adjust.
Diffstat (limited to 'src/conflicts.c')
-rw-r--r-- | src/conflicts.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/conflicts.c b/src/conflicts.c index 1c24d7e2..24f27cc8 100644 --- a/src/conflicts.c +++ b/src/conflicts.c @@ -451,15 +451,10 @@ void conflicts_output (FILE *out) { bool printed_sth = FALSE; - bool *used_rules = XCALLOC (bool, nrules); state_number_t i; for (i = 0; i < nstates; 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; if (conflicts[i]) { fprintf (out, _("State %d contains "), i); @@ -471,23 +466,6 @@ conflicts_output (FILE *out) } if (printed_sth) 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); } /*--------------------------------------------------------. |