style: decouple different uses of item_number

item_number is used for elements of ritem as well as indices into
ritem which is fairly confusing.  Introduce item_index to represent
indices into ritem.

* src/gram.h (item_index): Introduce it for ritem indices.
* src/closure.h, src/closure.c, src/ielr.c, src/lr0.c,
* src/print-graph.c, src/state.h, src/state.h:
Replace uses of item_number with item_index where appropriate.
This commit is contained in:
Vincent Imbimbo
2020-05-24 11:09:49 -04:00
committed by Akim Demaille
parent dd878d1851
commit 6a1a681fd2
8 changed files with 26 additions and 23 deletions

View File

@@ -30,12 +30,12 @@
void closure_new (int n);
/* Given the kernel (aka core) of a state (a sorted vector of item numbers
/* Given the kernel (aka core) of a state (a sorted vector of item indices
ITEMS, of length N), set up RULESET and ITEMSET to indicate what
rules could be run and which items could be accepted when those
items are the active ones. */
void closure (item_number const *items, size_t n);
void closure (item_index const *items, size_t n);
/* Free ITEMSET, RULESET and internal data. */
@@ -43,12 +43,12 @@ void closure (item_number const *items, size_t n);
void closure_free (void);
/* ITEMSET is a sorted vector of item numbers; NITEMSET is its size
/* ITEMSET is a sorted vector of item indices; NITEMSET is its size
(actually, points to just beyond the end of the part of it that is
significant). CLOSURE places there the indices of all items which
represent units of input that could arrive next. */
extern item_number *itemset;
extern item_index *itemset;
extern size_t nitemset;
#endif /* !CLOSURE_H_ */