`((cnt - 1) | 7) + 1`.
###### functions
- static void symset_add(struct symset *s, int key, int val)
+ static void symset_add(struct symset *s, unsigned short key, unsigned short val)
{
int i;
int current = ((s->cnt-1) | 7) + 1;
We return the index where the value was found (so data can be accessed),
or `-1` to indicate failure.
- static int symset_find(struct symset *ss, int key)
+ static int symset_find(struct symset *ss, unsigned short key)
{
int lo = 0;
int hi = ss->cnt;
int added = 0;
for (i = 0; i < b->cnt; i++)
if (symset_find(a, b->syms[i]) < 0) {
- int data = 0;
+ unsigned short data = 0;
if (b->data != NO_DATA)
data = b->data[i];
symset_add(a, b->syms[i], data);
int p2;
struct symbol *s;
struct symset LA = INIT_SYMSET;
- int sn = 0;
+ unsigned short sn = 0;
if (bs == pr->body_size)
continue;
// if they don't exist.
for (i = 0; i < done.cnt; i++) {
int j;
- int state;
+ unsigned short state;
struct symset newitemset = INIT_SYMSET;
if (type >= LALR)
newitemset = INIT_DATASET;
int p = item_prod(itm);
int bp = item_index(itm);
struct production *pr = g->productions[p];
- int la = 0;
+ unsigned short la = 0;
int pos;
if (bp == pr->body_size)
struct symset first = INIT_SYMSET;
struct itemset *is;
int again;
- int la = 0;
+ unsigned short la = 0;
if (type >= LALR) {
// LA set just has eof
struct symset eof = INIT_SYMSET;
continue;
/* First collect the shifts */
for (j = 0; j < is->items.cnt; j++) {
- int itm = is->items.syms[j];
+ unsigned short itm = is->items.syms[j];
int p = item_prod(itm);
int bp = item_index(itm);
struct production *pr = g->productions[p];
}
/* Now look for reduction and conflicts */
for (j = 0; j < is->items.cnt; j++) {
- int itm = is->items.syms[j];
+ unsigned short itm = is->items.syms[j];
int p = item_prod(itm);
int bp = item_index(itm);
struct production *pr = g->productions[p];