mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
traces: improve logs
* src/lalr.c: Move logs to a better place to understand the chronology of events. * src/symlist.c (symbol_list_syms_print): Don't dump core on type elements.
This commit is contained in:
@@ -398,11 +398,8 @@ build_relations (void)
|
||||
|
||||
relation_transpose (&includes, ngotos);
|
||||
if (trace_flag & trace_automaton)
|
||||
{
|
||||
lookback_print (stderr);
|
||||
relation_print ("includes", includes, ngotos, goto_print, stderr);
|
||||
}
|
||||
}
|
||||
|
||||
/* Compute FOLLOWS from INCLUDES, and free INCLUDES. */
|
||||
static void
|
||||
@@ -420,6 +417,9 @@ compute_follows (void)
|
||||
static void
|
||||
compute_lookahead_tokens (void)
|
||||
{
|
||||
if (trace_flag & trace_automaton)
|
||||
lookback_print (stderr);
|
||||
|
||||
for (size_t i = 0; i < nLA; ++i)
|
||||
for (goto_list *sp = lookback[i]; sp; sp = sp->next)
|
||||
bitset_or (LA[i], LA[i], goto_follows[sp->value]);
|
||||
|
||||
@@ -97,6 +97,7 @@ symbol_list_type_set (symbol_list *syms, uniqstr type_name, location loc)
|
||||
void
|
||||
symbol_list_syms_print (const symbol_list *l, FILE *f)
|
||||
{
|
||||
fputc ('[', f);
|
||||
char const *sep = "";
|
||||
for (/* Nothing. */; l && l->content.sym; l = l->next)
|
||||
{
|
||||
@@ -105,10 +106,12 @@ symbol_list_syms_print (const symbol_list *l, FILE *f)
|
||||
: l->content_type == SYMLIST_TYPE ? "type: "
|
||||
: "invalid content_type: ",
|
||||
f);
|
||||
if (l->content_type == SYMLIST_SYMBOL)
|
||||
symbol_print (l->content.sym, f);
|
||||
fputs (l->action_props.is_value_used ? " used" : " unused", f);
|
||||
fputs (l->action_props.is_value_used ? " (used)" : " (unused)", f);
|
||||
sep = ", ";
|
||||
}
|
||||
fputc (']', f);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user