- for (r = ritem; *r; ++r)
- {
- /* Walk RITEM to find (i), if there are any tokens in the
- RHS, and (ii), to find RULENO. */
- int ruleno;
- int any_tokens = 0;
- short *r1;
- for (r1 = r; *r1 > 0; ++r1)
- if (ISTOKEN (*r1))
- any_tokens = 1;
- ruleno = -*r1;
-
- /* Examine the RHS of the rule. */
- if (!any_tokens)
- for (/* Nothing. */; *r > 0; ++r)
+ for (ruleno = 0; ruleno < nrules; ++ruleno)
+ if (rules[ruleno].useful)
+ {
+ rule_t *rule = &rules[ruleno];
+ if (rule->rhs[0] >= 0)