- register int i;
- register int lhs;
- register shorts *p;
- register short *q;
- register shorts **dset;
- register shorts *delts;
-
- dset = NEW2 (nvars, shorts *) - ntokens;
- delts = NEW2 (nrules + 1, shorts);
-
- p = delts;
- for (i = nrules; i > 0; i--)
+ symbol_number i;
+ rule_number r;
+ rule **q;
+
+ /* DSET[NTERM - NTOKENS] -- A linked list of the numbers of the rules
+ whose LHS is NTERM. */
+ rule_list **dset = xcalloc (nvars, sizeof *dset);
+
+ /* DELTS[RULE] -- There are NRULES rule number to attach to nterms.
+ Instead of performing NRULES allocations for each, have an array
+ indexed by rule numbers. */
+ rule_list *delts = xnmalloc (nrules, sizeof *delts);
+
+ for (r = nrules - 1; r >= 0; --r)