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

@@ -126,7 +126,7 @@ state *final_state = NULL;
state *
state_new (symbol_number accessing_symbol,
size_t nitems, item_number *core)
size_t nitems, item_index *core)
{
aver (nstates < STATE_NUMBER_MAXIMUM);
@@ -395,7 +395,7 @@ state_hash_insert (state *s)
`------------------------------------------------------------------*/
state *
state_hash_lookup (size_t nitems, item_number *core)
state_hash_lookup (size_t nitems, item_index *core)
{
size_t items_size = nitems * sizeof *core;
state *probe = xmalloc (offsetof (state, items) + items_size);