- bool reduced;
-
- /* Allocate the global sets used to compute the reduced grammar */
-
- N = NEW2(WORDSIZE(nvars), unsigned);
- P = NEW2(WORDSIZE(nrules + 1), unsigned);
- V = NEW2(WORDSIZE(nsyms), unsigned);
- V1 = NEW2(WORDSIZE(nsyms), unsigned);
-
- useless_nonterminals();
- inaccessable_symbols();
-
- reduced = (bool) (nuseless_nonterminals + nuseless_productions > 0);
-
- if (verboseflag)
- print_results();
-
- if (reduced == FALSE)
- goto done_reducing;
-
- print_notices();
-
- if (!BITISSET(N, start_symbol - ntokens))
- fatal (_("Start symbol %s does not derive any sentence"),
- tags[start_symbol]);
-
- reduce_grammar_tables();
-#if 0
- if (verboseflag)
- {
- fprintf(foutput, "REDUCED GRAMMAR\n\n");
- dump_grammar();
- }
-#endif
- /**/ 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.
- */