- "reduced %s defines %d terminal%s, %d nonterminal%s\
-, and %d production%s.\n", infile,
+ _("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"));
ntokens, (ntokens == 1 ? "" : "s"),
nvars, (nvars == 1 ? "" : "s"),
nrules, (nrules == 1 ? "" : "s"));
* set being computed remains unchanged. Any nonterminals not in the
* set at that point are useless in that they will never be used in
* deriving a sentence of the language.
* set being computed remains unchanged. Any nonterminals not in the
* set at that point are useless in that they will never be used in
* deriving a sentence of the language.
* This iteration doesn't use any special traversal over the
* productions. A set is kept of all productions for which all the
* nonterminals in the RHS are in useful. Only productions not in
* This iteration doesn't use any special traversal over the
* productions. A set is kept of all productions for which all the
* nonterminals in the RHS are in useful. Only productions not in
* reachable symbols, add the production to the set of reachable
* productions, and add all of the nonterminals in the RHS of the
* production to the set of reachable symbols.
* reachable symbols, add the production to the set of reachable
* productions, and add all of the nonterminals in the RHS of the
* production to the set of reachable symbols.
* Consider only the (partially) reduced grammar which has only
* nonterminals in N and productions in P.
* Consider only the (partially) reduced grammar which has only
* nonterminals in N and productions in P.
* The result is the set P of productions in the reduced grammar, and
* the set V of symbols in the reduced grammar.
* The result is the set P of productions in the reduced grammar, and
* the set V of symbols in the reduced grammar.
* Although this algorithm also computes the set of terminals which are
* reachable, no terminal will be deleted from the grammar. Some
* terminals might not be in the grammar but might be generated by
* Although this algorithm also computes the set of terminals which are
* reachable, no terminal will be deleted from the grammar. Some
* terminals might not be in the grammar but might be generated by
for (i = ntokens; i < nsyms; i++)
if (!BITISSET(V, i))
fprintf(foutput, " %s\n", tags[i]);
for (i = ntokens; i < nsyms; i++)
if (!BITISSET(V, i))
fprintf(foutput, " %s\n", tags[i]);
fprintf(foutput,
"ntokens = %d, nvars = %d, nsyms = %d, nrules = %d, nitems = %d\n\n",
ntokens, nvars, nsyms, nrules, nitems);
fprintf(foutput,
"ntokens = %d, nvars = %d, nsyms = %d, nrules = %d, nitems = %d\n\n",
ntokens, nvars, nsyms, nrules, nitems);
- fprintf(foutput, "Variables\n---------\n\n");
- fprintf(foutput, "Value Sprec Sassoc Tag\n");
+ fprintf(foutput, _("Variables\n---------\n\n"));
+ fprintf(foutput, _("Value Sprec Sassoc Tag\n"));
for (i = ntokens; i < nsyms; i++)
fprintf(foutput, "%5d %5d %5d %s\n",
i, sprec[i], sassoc[i], tags[i]);
fprintf(foutput, "\n\n");
for (i = ntokens; i < nsyms; i++)
fprintf(foutput, "%5d %5d %5d %s\n",
i, sprec[i], sassoc[i], tags[i]);
fprintf(foutput, "\n\n");
i, rprec[i], rassoc[i], rlhs[i], rrhs[i]);
for (r = &ritem[rrhs[i]]; *r > 0; r++)
fprintf(foutput, "%5d", *r);
fprintf(foutput, " [%d]\n", -(*r));
}
fprintf(foutput, "\n\n");
i, rprec[i], rassoc[i], rlhs[i], rrhs[i]);
for (r = &ritem[rrhs[i]]; *r > 0; r++)
fprintf(foutput, "%5d", *r);
fprintf(foutput, " [%d]\n", -(*r));
}
fprintf(foutput, "\n\n");
for (i = 1; i <= nrules; i++)
{
fprintf(foutput, "%-5d %s :", i, tags[rlhs[i]]);
for (i = 1; i <= nrules; i++)
{
fprintf(foutput, "%-5d %s :", i, tags[rlhs[i]]);