+
+/*-------------------------.
+| 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 (*symbols[i]->tag != '@')
+ fprintf (out, "# define NT%s\t%d\n", symbols[i]->tag, i);
+ }
+
+ fprintf (out, "\n#endif /* not %s */\n", macro_name);
+ free (macro_name);
+ xfclose (out);
+}
+
+