* src/state.h (state_t): `solved_conflicts' is a new member.

* src/LR0.c (new_state): Set it to 0.
* src/conflicts.h, src/conflicts.c (print_conflicts)
(free_conflicts, solve_conflicts): Rename as...
(conflicts_print, conflicts_free, conflicts_solve): these.
Adjust callers.
* src/conflicts.c (enum conflict_resolution_e)
(solved_conflicts_obstack): New, used by...
(log_resolution): this.
Adjust to attach the conflict resolution to each state.
Complete the description with the precedence/associativity
information.
(resolve_sr_conflict): Adjust.
* src/print.c (print_state): Output its solved_conflicts.
* tests/conflicts.at (Unresolved SR Conflicts)
(Solved SR Conflicts): Exercise --report=all.
This commit is contained in:
Akim Demaille
2002-05-26 20:25:52 +00:00
parent a49aecd528
commit b408954b40
12 changed files with 159 additions and 53 deletions

16
TODO
View File

@@ -40,22 +40,6 @@ When implementing multiple-%union support, bare the following in mind:
Provide better assistance for understanding the conflicts by providing
a sample text exhibiting the (LALR) ambiguity.
* report
Solved conflicts should not be reported in the beginning of the file.
Rather they should be reported within each state description. Also,
now that the symbol providing the precedence of a rule is kept, it is
possible to explain why a conflict was solved this way. E.g., instead
of
Conflict in state 8 between rule 2 and token '+' resolved as reduce.
we can (in state 8) report something like
Conflict between rule 2 and token '+' resolved as reduce
because '*' < '+'.
or something like that.
* Coding system independence
Paul notes: