[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
style: rename closure_* functions as closure_*
From: |
Akim Demaille |
Subject: |
style: rename closure_* functions as closure_* |
Date: |
Mon, 28 Jan 2019 06:52:59 +0100 |
commit 7355a35e4b639d09a5424287288b55acce971a6d
Author: Akim Demaille <address@hidden>
Date: Sun Jan 27 20:14:11 2019 +0100
style: rename closure_* functions as closure_*
This is more consistent with the other files.
* closure.h, closure.c (new_closure, free_closure): Rename as...
(closure_new, closure_free): this.
Adjust dependencies.
diff --git a/src/closure.c b/src/closure.c
index 16be6452..4ff44157 100644
--- a/src/closure.c
+++ b/src/closure.c
@@ -51,7 +51,7 @@ static bitsetv firsts = NULL;
`-----------------*/
static void
-print_closure (char const *title, item_number const *array, size_t size)
+closure_print (char const *title, item_number const *array, size_t size)
{
fprintf (stderr, "Closure: %s\n", title);
for (size_t i = 0; i < size; ++i)
@@ -167,7 +167,7 @@ set_fderives (void)
void
-new_closure (unsigned n)
+closure_new (unsigned n)
{
itemset = xnmalloc (n, sizeof *itemset);
@@ -182,7 +182,7 @@ void
closure (item_number const *core, size_t n)
{
if (trace_flag & trace_sets)
- print_closure ("input", core, n);
+ closure_print ("input", core, n);
bitset_zero (ruleset);
@@ -219,12 +219,12 @@ closure (item_number const *core, size_t n)
}
if (trace_flag & trace_sets)
- print_closure ("output", itemset, nitemset);
+ closure_print ("output", itemset, nitemset);
}
void
-free_closure (void)
+closure_free (void)
{
free (itemset);
bitset_free (ruleset);
diff --git a/src/closure.h b/src/closure.h
index c75b8497..5d5b15c7 100644
--- a/src/closure.h
+++ b/src/closure.h
@@ -27,7 +27,7 @@
data so that closure can be called. n is the number of elements to
allocate for itemset. */
-void new_closure (unsigned n);
+void closure_new (unsigned n);
/* Given the kernel (aka core) of a state (a sorted vector of item numbers
@@ -49,7 +49,7 @@ void closure (item_number const *items, size_t n);
/* Frees ITEMSET, RULESET and internal data. */
-void free_closure (void);
+void closure_free (void);
extern item_number *itemset;
extern size_t nitemset;
diff --git a/src/lr0.c b/src/lr0.c
index 2a94bc29..48ec30c5 100644
--- a/src/lr0.c
+++ b/src/lr0.c
@@ -314,7 +314,7 @@ void
generate_states (void)
{
allocate_storage ();
- new_closure (nritems);
+ closure_new (nritems);
/* Create the initial state. The 0 at the lhs is the index of the
item of this initial rule. */
@@ -345,7 +345,7 @@ generate_states (void)
}
/* discard various storage */
- free_closure ();
+ closure_free ();
free_storage ();
/* Set up STATES. */
diff --git a/src/print-graph.c b/src/print-graph.c
index 302c7f72..a007ab7a 100644
--- a/src/print-graph.c
+++ b/src/print-graph.c
@@ -184,10 +184,10 @@ print_graph (void)
start_graph (fgraph);
/* Output nodes and edges. */
- new_closure (nritems);
+ closure_new (nritems);
for (int i = 0; i < nstates; i++)
print_state (states[i], fgraph);
- free_closure ();
+ closure_free ();
finish_graph (fgraph);
xfclose (fgraph);
diff --git a/src/print-xml.c b/src/print-xml.c
index b3c46a33..cbaec8c7 100644
--- a/src/print-xml.c
+++ b/src/print-xml.c
@@ -517,7 +517,7 @@ print_xml (void)
/* print grammar */
print_grammar (out, level + 1);
- new_closure (nritems);
+ closure_new (nritems);
no_reduce_set = bitset_create (ntokens, BITSET_FIXED);
/* print automaton */
@@ -531,7 +531,7 @@ print_xml (void)
xml_puts (out, level + 1, "</automaton>");
bitset_free (no_reduce_set);
- free_closure ();
+ closure_free ();
xml_puts (out, 0, "</bison-xml-report>");
diff --git a/src/print.c b/src/print.c
index 365830ff..356fd62a 100644
--- a/src/print.c
+++ b/src/print.c
@@ -510,14 +510,14 @@ print_results (void)
/* If the whole state item sets, not only the kernels, are wanted,
'closure' will be run, which needs memory allocation/deallocation. */
if (report_flag & report_itemsets)
- new_closure (nritems);
+ closure_new (nritems);
/* Storage for print_reductions. */
no_reduce_set = bitset_create (ntokens, BITSET_FIXED);
for (state_number i = 0; i < nstates; i++)
print_state (out, states[i]);
bitset_free (no_reduce_set);
if (report_flag & report_itemsets)
- free_closure ();
+ closure_free ();
xfclose (out);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- style: rename closure_* functions as closure_*,
Akim Demaille <=