-/*--------------------------------------------------------------.
-| output_headers -- Output constant strings to the beginning of |
-| certain files. |
-`--------------------------------------------------------------*/
-
-#define GUARDSTR \
-"\n\
-#include \"%s\"\n\
-extern int yyerror;\n\
-extern int yycost;\n\
-extern char * yymsg;\n\
-extern YYSTYPE yyval;\n\
-\n\
-yyguard(n, yyvsp, yylsp)\n\
-register int n;\n\
-register YYSTYPE *yyvsp;\n\
-register YYLTYPE *yylsp;\n\
-{\n\
- yyerror = 0;\n\
- yycost = 0;\n\
- yymsg = 0;\n\
- switch (n)\n\
- {"
-
-#define ACTSTR \
-"\n\
-#include \"%s\"\n\
-extern YYSTYPE yyval;\n\
-extern int yychar;\n\
-\n\
-yyaction(n, yyvsp, yylsp)\n\
-register int n;\n\
-register YYSTYPE *yyvsp;\n\
-register YYLTYPE *yylsp;\n\
-{\n\
- switch (n)\n\
- {"
-
-#define ACTSTR_PROLOGUE \
-"\n\
-#include \""
-
-#define ACTSTR_EPILOGUE \
-"\"\n\
-extern YYSTYPE yyval;\n\
-extern int yychar;\n\
-\n\
-yyaction(n, yyvsp, yylsp)\n\
-register int n;\n\
-register YYSTYPE *yyvsp;\n\
-register YYLTYPE *yylsp;\n\
-{\n\
- switch (n)\n\
- {"
-
-#define ACTSTR_SIMPLE "\n switch (yyn) {\n"
-
-void
-output_headers (void)
-{
- if (semantic_parser)
- fprintf (fguard, GUARDSTR, attrsfile);
-
- if (no_parser_flag)
- return;
-
- if (semantic_parser)
- {
- obstack_grow_literal_string (&action_obstack,
- ACTSTR_PROLOGUE);
- obstack_grow (&action_obstack,
- attrsfile, strlen (attrsfile));
- obstack_grow_literal_string (&action_obstack,
- ACTSTR_EPILOGUE);
- }
- else
- {
- obstack_grow_literal_string (&action_obstack, ACTSTR_SIMPLE);
- }
-
-/* if (semantic_parser) JF moved this below
- fprintf(ftable, "#include \"%s\"\n", attrsfile);
- fprintf(ftable, "#include <stdio.h>\n\n");
-*/
-
- /* Rename certain symbols if -p was specified. */
- if (spec_name_prefix)
- {
- obstack_fgrow1 (&table_obstack,
- "#define yyparse %sparse\n", spec_name_prefix);
- obstack_fgrow1 (&table_obstack,
- "#define yylex %slex\n", spec_name_prefix);
- obstack_fgrow1 (&table_obstack,
- "#define yyerror %serror\n", spec_name_prefix);
- obstack_fgrow1 (&table_obstack,
- "#define yylval %slval\n", spec_name_prefix);
- obstack_fgrow1 (&table_obstack,
- "#define yychar %schar\n", spec_name_prefix);
- obstack_fgrow1 (&table_obstack,
- "#define yydebug %sdebug\n", spec_name_prefix);
- obstack_fgrow1 (&table_obstack,
- "#define yynerrs %snerrs\n", spec_name_prefix);
- }
-}
-
-
-/*-------------------------------------------------------.
-| Output constant strings to the ends of certain files. |
-`-------------------------------------------------------*/
-
-void
-output_trailers (void)
-{
- if (semantic_parser)
- fprintf (fguard, "\n }\n}\n");
-
- obstack_1grow (&action_obstack, '\n');
-
- if (no_parser_flag)
- return;
-
- if (semantic_parser)
- {
- obstack_grow_literal_string (&action_obstack,
- " }\n");
- }
- obstack_grow_literal_string (&action_obstack,
- "}\n");
-}
-
-
-