- fprintf(ftable, "#define yyparse %sparse\n", spec_name_prefix);
- fprintf(ftable, "#define yylex %slex\n", spec_name_prefix);
- fprintf(ftable, "#define yyerror %serror\n", spec_name_prefix);
- fprintf(ftable, "#define yylval %slval\n", spec_name_prefix);
- fprintf(ftable, "#define yychar %schar\n", spec_name_prefix);
- fprintf(ftable, "#define yydebug %sdebug\n", spec_name_prefix);
- fprintf(ftable, "#define yynerrs %snerrs\n", spec_name_prefix);
- }
-}
-
-
-void
-output_trailers()
-{
- if (semantic_parser)
- fprintf(fguard, "\n }\n}\n");
-
- fprintf(faction, "\n");
-
- if (noparserflag)
- return;
-
- if (semantic_parser)
- fprintf(faction, " }\n");
- fprintf(faction, "}\n");
-}
-
-
-void
-output()
-{
- int c;
-
- /* output_token_defines(ftable); / * JF put out token defines FIRST */
- if (!semantic_parser) /* JF Put out other stuff */
- {
- rewind(fattrs);
- while ((c=getc(fattrs))!=EOF)
- putc(c,ftable);
- }
- reader_output_yylsp(ftable);
- if (debugflag)
- fprintf(ftable, "#ifndef YYDEBUG\n#define YYDEBUG %d\n#endif\n\n",
- !!debugflag);
-
- if (semantic_parser)
- fprintf(ftable, "#include \"%s\"\n", attrsfile);
-
- if (! noparserflag)
- fprintf(ftable, "#include <stdio.h>\n\n");
-
- /* Make "const" do nothing if not in ANSI C. */
- fprintf (ftable, "#ifndef __cplusplus\n#ifndef __STDC__\n#define const\n#endif\n#endif\n\n");
-
- free_itemsets();
- output_defines();
- output_token_translations();
-/* if (semantic_parser) */
- /* This is now unconditional because debugging printouts can use it. */
- output_gram();
- FREE(ritem);
- if (semantic_parser)
- output_stos();
- output_rule_data();
- output_actions();
- if (! noparserflag)
- output_parser();
- output_program();
-}
-
-
-void
-output_token_translations()
-{
- register int i, j;
-/* register short *sp; JF unused */
-
- if (translations)
- {
- fprintf(ftable,
- "\n#define YYTRANSLATE(x) ((unsigned)(x) <= %d ? yytranslate[x] : %d)\n",
- max_user_token_number, nsyms);
-
- if (ntokens < 127) /* play it very safe; check maximum element value. */
- fprintf(ftable, "\nstatic const char yytranslate[] = { 0");
- else
- fprintf(ftable, "\nstatic const short yytranslate[] = { 0");
-
- j = 10;
- for (i = 1; i <= max_user_token_number; i++)