- if (!BITISSET(N, start_symbol - ntokens))
- fatal (_("Start symbol %s does not derive any sentence"),
- tags[start_symbol]);
-
- reduce_grammar_tables();
- /* if (verboseflag) {
- fprintf(foutput, "REDUCED GRAMMAR\n\n");
- dump_grammar();
- }
- */
-
- /**/ statisticsflag = FALSE; /* someday getopts should handle this */
- if (statisticsflag == TRUE)
- fprintf(stderr,
- _("reduced %s defines %d terminal%s, %d nonterminal%s\
-, and %d production%s.\n"), infile,
- ntokens, (ntokens == 1 ? "" : "s"),
- nvars, (nvars == 1 ? "" : "s"),
- nrules, (nrules == 1 ? "" : "s"));
-
- done_reducing:
-
- /* Free the global sets used to compute the reduced grammar */
-
- FREE(N);
- FREE(V);
- FREE(P);
-
-}
-\f
-/*
- * Another way to do this would be with a set for each production and then do
- * subset tests against N0, but even for the C grammar the whole reducing
- * process takes only 2 seconds on my 8Mhz AT.
- */
-
-static bool
-useful_production (int i, BSet N0)
-{
- rule r;
- short n;
-
- /*
- * A production is useful if all of the nonterminals in its RHS
- * appear in the set of useful nonterminals.
- */
-
- for (r = &ritem[rrhs[i]]; *r > 0; r++)
- if (ISVAR(n = *r))
- if (!BITISSET(N0, n - ntokens))
- return FALSE;
- return TRUE;
-}