- if (n == 0)
- {
- for (ruleno = 0; ruleno < nrules + 1; ++ruleno)
- if (bitset_test (FDERIVES (start_symbol), ruleno))
- SETBIT (ruleset, ruleno);
- else
- RESETBIT (ruleset, ruleno);
- }
- else
- {
- for (r = 0; r < rulesetsize; ++r)
- ruleset[r] = 0;
-
- for (c = 0; c < n; ++c)
- if (ISVAR (ritem[core[c]]))
- for (ruleno = 0; ruleno < nrules + 1; ++ruleno)
- if (bitset_test (FDERIVES (ritem[core[c]]), ruleno))
- SETBIT (ruleset, ruleno);
- }
+ bitset_zero (ruleset);
+
+ for (c = 0; c < n; ++c)
+ if (ISVAR (ritem[core[c]]))
+ bitset_or (ruleset, ruleset, FDERIVES (ritem[core[c]]));