#include <stdio.h>
#include "system.h"
#include "machine.h"
-#include "new.h"
+#include "alloc.h"
#include "files.h"
#include "gram.h"
#include "state.h"
print_token(extnum, token)
int extnum, token;
{
- fprintf(foutput, " type %d is %s\n", extnum, tags[token]);
+ fprintf(foutput, _(" type %d is %s\n"), extnum, tags[token]);
}
print_state(state)
int state;
{
- fprintf(foutput, "\n\nstate %d\n\n", state);
+ fprintf(foutput, _("\n\nstate %d\n\n"), state);
print_core(state);
print_actions(state);
}
sp++;
}
- fprintf (foutput, " (rule %d)", rule);
+ fprintf (foutput, _(" (rule %d)"), rule);
putc('\n', foutput);
}
if (!shiftp && !redp)
{
if (final_state == state)
- fprintf(foutput, " $default\taccept\n");
+ fprintf(foutput, _(" $default\taccept\n"));
else
- fprintf(foutput, " NO ACTIONS\n");
+ fprintf(foutput, _(" NO ACTIONS\n"));
return;
}
/* The following line used to be turned off. */
if (ISVAR(symbol)) break;
if (symbol==0) /* I.e. strcmp(tags[symbol],"$")==0 */
- fprintf(foutput, " $ \tgo to state %d\n", state1);
+ fprintf(foutput, _(" $ \tgo to state %d\n"), state1);
else
- fprintf(foutput, " %-4s\tshift, and go to state %d\n",
+ fprintf(foutput, _(" %-4s\tshift, and go to state %d\n"),
tags[symbol], state1);
}
{
if (! errp->errs[j]) continue;
symbol = errp->errs[j];
- fprintf(foutput, " %-4s\terror (nonassociative)\n", tags[symbol]);
+ fprintf(foutput, _(" %-4s\terror (nonassociative)\n"), tags[symbol]);
}
if (j > 0)
{
rule = redp->rules[0];
symbol = rlhs[rule];
- fprintf(foutput, " $default\treduce using rule %d (%s)\n\n",
+ fprintf(foutput, _(" $default\treduce using rule %d (%s)\n\n"),
rule, tags[symbol]);
}
else if (redp)
if (! shiftp->shifts[i]) continue;
state1 = shiftp->shifts[i];
symbol = accessing_symbol[state1];
- fprintf(foutput, " %-4s\tgo to state %d\n", tags[symbol], state1);
+ fprintf(foutput, _(" %-4s\tgo to state %d\n"), tags[symbol], state1);
}
putc('\n', foutput);
int column = 0;
/* rule # : LHS -> RHS */
- fputs("\nGrammar\n", foutput);
+ fputs(_("\nGrammar\n"), foutput);
for (i = 1; i <= nrules; i++)
/* Don't print rules disabled in reduce_grammar_tables. */
if (rlhs[i] >= 0)
{
- fprintf(foutput, "rule %-4d %s ->", i, tags[rlhs[i]]);
+ fprintf(foutput, _("rule %-4d %s ->"), i, tags[rlhs[i]]);
rule = &ritem[rrhs[i]];
if (*rule > 0)
while (*rule > 0)
fprintf(foutput, " %s", tags[*rule++]);
else
- fputs (" /* empty */", foutput);
+ fputs (_(" /* empty */"), foutput);
putc('\n', foutput);
}
/* TERMINAL (type #) : rule #s terminal is on RHS */
- fputs("\nTerminals, with rules where they appear\n\n", foutput);
+ fputs(_("\nTerminals, with rules where they appear\n\n"), foutput);
fprintf(foutput, "%s (-1)\n", tags[0]);
if (translations)
{
fprintf (foutput, "%s\n", buffer);
}
- fputs("\nNonterminals, with rules where they appear\n\n", foutput);
+ fputs(_("\nNonterminals, with rules where they appear\n\n"), foutput);
for (i = ntokens; i <= nsyms - 1; i++)
{
int left_count = 0, right_count = 0;
if (left_count > 0)
{
END_TEST (50);
- sprintf (buffer + strlen(buffer), " on left:");
+ sprintf (buffer + strlen(buffer), _(" on left:"));
for (j = 1; j <= nrules; j++)
{
if (left_count > 0)
sprintf (buffer + strlen(buffer), ",");
END_TEST (50);
- sprintf (buffer + strlen(buffer), " on right:");
+ sprintf (buffer + strlen(buffer), _(" on right:"));
for (j = 1; j <= nrules; j++)
{
for (rule = &ritem[rrhs[j]]; *rule > 0; rule++)