- output_parser (skeleton, parser);
- xfclose (parser);
-}
-
-
-/* FIXME. */
-
-#define MUSCLE_INSERT_INT(Key, Value) \
-{ \
- obstack_fgrow1 (&muscle_obstack, "%d", Value); \
- obstack_1grow (&muscle_obstack, 0); \
- muscle_insert (Key, obstack_finish (&muscle_obstack)); \
-}
-
-#define MUSCLE_INSERT_STRING(Key, Value) \
-{ \
- obstack_sgrow (&muscle_obstack, Value); \
- obstack_1grow (&muscle_obstack, 0); \
- muscle_insert (Key, obstack_finish (&muscle_obstack)); \
-}
-
-#define MUSCLE_INSERT_PREFIX(Key, Value) \
-{ \
- obstack_fgrow2 (&muscle_obstack, "%s%s", spec_name_prefix, Value); \
- obstack_1grow (&muscle_obstack, 0); \
- muscle_insert (Key, obstack_finish (&muscle_obstack)); \
-}
-
-static void
-prepare (void)
-{
- MUSCLE_INSERT_INT ("last", high);
- MUSCLE_INSERT_INT ("flag", MINSHORT);
- MUSCLE_INSERT_INT ("pure", pure_parser);
- MUSCLE_INSERT_INT ("nsym", nsyms);
- MUSCLE_INSERT_INT ("debug", debug_flag);
- MUSCLE_INSERT_INT ("final", final_state);
- MUSCLE_INSERT_INT ("maxtok", max_user_token_number);
- MUSCLE_INSERT_INT ("ntbase", ntokens);
- MUSCLE_INSERT_INT ("error-verbose", error_verbose);
- MUSCLE_INSERT_STRING ("prefix", spec_name_prefix);
-
- MUSCLE_INSERT_INT ("nnts", nvars);
- MUSCLE_INSERT_INT ("nrules", nrules);
- MUSCLE_INSERT_INT ("nstates", nstates);
- MUSCLE_INSERT_INT ("ntokens", ntokens);
-
- MUSCLE_INSERT_INT ("locations-flag", locations_flag);
-}
-
-
-/*-------------------------.
-| Output the header file. |
-`-------------------------*/
-
-static void
-header_output (void)
-{
- FILE *out = xfopen (spec_defines_file, "w");
- char *macro_name = compute_header_macro ();
-
- fprintf (out, "#ifndef %s\n", macro_name);
- fprintf (out, "# define %s\n\n", macro_name);
-
- fputs (muscle_find ("tokendef"), out);
- fprintf (out, "\
-#ifndef YYSTYPE\n\
-typedef %s
-yystype;\n\
-# define YYSTYPE yystype\n\
-#endif\n",
- muscle_find ("stype"));
-
- if (!pure_parser)
- fprintf (out, "\nextern YYSTYPE %slval;\n",
- spec_name_prefix);
- if (semantic_parser)
- {
- int i;
-
- for (i = ntokens; i < nsyms; i++)
- /* don't make these for dummy nonterminals made by gensym. */
- if (*tags[i] != '@')
- fprintf (out, "# define\tNT%s\t%d\n", tags[i], i);
- }
-
- fprintf (out, "\n#endif /* not %s */\n", macro_name);
- free (macro_name);
- xfclose (out);