lalr: more debug traces

I need to be able to read includes and goto_follows.

* src/relation.h, src/relation.c (relation_print): Provide a means to
pretty-print the nodes of the relation.
* src/lalr.c (goto_print, follows_print): New.
(set_goto_map): Use goto_print.
(build_relations): Show INCLUDES.
(compute_FOLLOWS): Rename as...
(compute_follows): this.
Show FOLLOWS.
This commit is contained in:
Akim Demaille
2019-02-24 19:00:41 +01:00
parent 5230e610fc
commit 59bec5fade
5 changed files with 82 additions and 33 deletions

View File

@@ -198,7 +198,7 @@ ielr_compute_internal_follow_edges (bitset ritem_sees_lookahead_set,
if (trace_flag & trace_ielr)
{
fprintf (stderr, "internal_follow_edges:\n");
relation_print (*edgesp, ngotos, stderr);
relation_print (*edgesp, ngotos, NULL, stderr);
}
}
@@ -305,7 +305,7 @@ ielr_compute_always_follows (goto_number ***edgesp,
if (trace_flag & trace_ielr)
{
fprintf (stderr, "always follow edges:\n");
relation_print (*edgesp, ngotos, stderr);
relation_print (*edgesp, ngotos, NULL, stderr);
fprintf (stderr, "always_follows:\n");
debug_bitsetv (*always_followsp);
}