diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2020-07-28 19:46:41 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2020-07-29 20:00:27 +0200 |
commit | ece343d2c29198a054ab81c56d09626caa9c5159 (patch) | |
tree | 5a77c715f9a20f5ec7d1f7f654b089449c5ac511 | |
parent | be95a4fe2951374676efc9454ffee8638faaf68d (diff) | |
download | bison-ece343d2c29198a054ab81c56d09626caa9c5159.tar.gz |
cex: style: prefer FOO_print to print_FOO
* src/state-item.h, src/state-item.c (print_state_item): Rename as...
(state_item_print): this.
* src/counterexample.c (print_counterexample): Rename as...
(counterexample_print): this.
-rw-r--r-- | src/counterexample.c | 14 | ||||
-rw-r--r-- | src/lssi.c | 2 | ||||
-rw-r--r-- | src/parse-simulation.c | 4 | ||||
-rw-r--r-- | src/state-item.c | 6 | ||||
-rw-r--r-- | src/state-item.h | 3 |
5 files changed, 15 insertions, 14 deletions
diff --git a/src/counterexample.c b/src/counterexample.c index 4dc5c708..cdf3f218 100644 --- a/src/counterexample.c +++ b/src/counterexample.c @@ -119,7 +119,7 @@ static int max (int a, int b) } static void -print_counterexample (const counterexample *cex, FILE *out, const char *prefix) +counterexample_print (const counterexample *cex, FILE *out, const char *prefix) { const bool flat = getenv ("YYFLAT"); const char *example1_label @@ -526,7 +526,7 @@ nonunifying_shift_path (state_item_list reduce_path, state_item *shift_conflict) for (gl_list_iterator_t it = gl_list_iterator (result); state_item_list_next (&it, &sip); ) - print_state_item (sip, stderr, ""); + state_item_print (sip, stderr, ""); } return result; } @@ -1267,7 +1267,7 @@ counterexample_report (state_item_number itm1, state_item_number itm2, : example_from_path (shift_reduce, itm2, shortest_path, next_sym); gl_list_free (shortest_path); - print_counterexample (cex, out, prefix); + counterexample_print (cex, out, prefix); free_counterexample (cex); } @@ -1290,8 +1290,8 @@ counterexample_report_shift_reduce (state_item_number itm1, state_item_number it // In the report, print the items. if (out != stderr || trace_flag & trace_cex) { - print_state_item (&state_items[itm1], out, prefix); - print_state_item (&state_items[itm2], out, prefix); + state_item_print (&state_items[itm1], out, prefix); + state_item_print (&state_items[itm2], out, prefix); } counterexample_report (itm1, itm2, next_sym, true, out, prefix); } @@ -1334,8 +1334,8 @@ counterexample_report_reduce_reduce (state_item_number itm1, state_item_number i // In the report, print the items. if (out != stderr || trace_flag & trace_cex) { - print_state_item (&state_items[itm1], out, prefix); - print_state_item (&state_items[itm2], out, prefix); + state_item_print (&state_items[itm1], out, prefix); + state_item_print (&state_items[itm2], out, prefix); } counterexample_report (itm1, itm2, bitset_first (conflict_syms), false, out, prefix); @@ -256,7 +256,7 @@ shortest_path_from_start (state_item_number target, symbol_number next_sym) gl_list_iterator_t it = gl_list_iterator (res); const void *sip; while (gl_list_iterator_next (&it, &sip, NULL)) - print_state_item ((state_item *) sip, stdout, ""); + state_item_print ((state_item *) sip, stdout, ""); } return res; } diff --git a/src/parse-simulation.c b/src/parse-simulation.c index bbf029b6..d3a2d1a7 100644 --- a/src/parse-simulation.c +++ b/src/parse-simulation.c @@ -594,8 +594,8 @@ print_parse_state (parse_state *ps) FILE *out = stderr; fprintf (out, "(size %zu depth %d rc %d)\n", ps->state_items.total_size, ps->depth, ps->reference_count); - print_state_item (ps->state_items.head_elt, out, ""); - print_state_item (ps->state_items.tail_elt, out, ""); + state_item_print (ps->state_items.head_elt, out, ""); + state_item_print (ps->state_items.tail_elt, out, ""); if (ps->derivs.total_size > 0) derivation_print (ps->derivs.head_elt, out, ""); putc ('\n', out); diff --git a/src/state-item.c b/src/state-item.c index d7d1ff8a..a0c5a31a 100644 --- a/src/state-item.c +++ b/src/state-item.c @@ -475,7 +475,7 @@ prune_disabled_paths (void) } void -print_state_item (const state_item *si, FILE *out, const char *prefix) +state_item_print (const state_item *si, FILE *out, const char *prefix) { fputs (prefix, out); item_print (si->item, NULL, out); @@ -506,7 +506,7 @@ state_items_report (void) if (si->trans >= 0) { fputs (" -> ", stdout); - print_state_item (&state_items[si->trans], stdout, ""); + state_item_print (&state_items[si->trans], stdout, ""); } bitset sets[2] = { si->prods, si->revs }; @@ -521,7 +521,7 @@ state_items_report (void) BITSET_FOR_EACH (biter, b, sin, 0) { fputs (txt[seti], stdout); - print_state_item (&state_items[sin], stdout, ""); + state_item_print (&state_items[sin], stdout, ""); } } } diff --git a/src/state-item.h b/src/state-item.h index dc2b36c8..a0a3d36f 100644 --- a/src/state-item.h +++ b/src/state-item.h @@ -90,9 +90,10 @@ state_item_index_lookup (state_number s, state_item_number off) } void state_items_init (void); -void print_state_item (const state_item *si, FILE *out, const char *prefix); void state_items_free (void); +void state_item_print (const state_item *si, FILE *out, const char *prefix); + bool production_allowed (const state_item *si, const state_item *next); // Iterating on a state_item_list. |