+merger_output (FILE *out)
+{
+ int n;
+ merger_list* p;
+
+ fputs ("m4_define([b4_mergers], \n[[", out);
+ for (n = 1, p = merge_functions; p != NULL; n += 1, p = p->next)
+ {
+ if (p->type[0] == '\0')
+ fprintf (out, " case %d: yyval = %s (*yy0, *yy1); break;\n",
+ n, p->name);
+ else
+ fprintf (out, " case %d: yyval.%s = %s (*yy0, *yy1); break;\n",
+ n, p->type, p->name);
+ }
+ fputs ("]])\n\n", out);
+}
+
+/*---------------------------------------.
+| Output the tokens definition to OOUT. |
+`---------------------------------------*/
+
+void
+token_definitions_output (FILE *out)
+{
+ int i;
+ int first = 1;
+
+ fputs ("m4_define([b4_tokens], \n[", out);
+ for (i = 0; i < ntokens; ++i)
+ {
+ symbol_t *symbol = symbols[i];
+ int number = symbol->user_token_number;
+
+ /* At this stage, if there are literal aliases, they are part of
+ SYMBOLS, so we should not find symbols which are the aliases
+ here. */
+ assert (number != USER_NUMBER_ALIAS);
+
+ /* Skip error token. */
+ if (symbol == errtoken)
+ continue;
+
+ /* If this string has an alias, then it is necessarily the alias
+ which is to be output. */
+ if (symbol->alias)
+ symbol = symbol->alias;
+
+ /* Don't output literal chars or strings (when defined only as a
+ string). Note that must be done after the alias resolution:
+ think about `%token 'f' "f"'. */
+ if (symbol->tag[0] == '\'' || symbol->tag[0] == '\"')
+ continue;
+
+ /* Don't #define nonliteral tokens whose names contain periods
+ or '$' (as does the default value of the EOF token). */
+ if (strchr (symbol->tag, '.') || strchr (symbol->tag, '$'))
+ continue;
+
+ fprintf (out, "%s[[[%s]], [%d]]",
+ first ? "" : ",\n", symbol->tag, number);
+
+ first = 0;
+ }
+ fputs ("])\n\n", out);
+}
+
+
+/*----------------------------------------.
+| Output the symbol destructors to OOUT. |
+`----------------------------------------*/
+
+static void
+symbol_destructors_output (FILE *out)
+{
+ int i;
+ int first = 1;
+
+ fputs ("m4_define([b4_symbol_destructors], \n[", out);
+ for (i = 0; i < nsyms; ++i)
+ if (symbols[i]->destructor)
+ {
+ symbol_t *symbol = symbols[i];
+
+ /* Filename, lineno,
+ Symbol-name, Symbol-number,
+ destructor, typename. */
+ fprintf (out, "%s[[[%s]], [[%d]], [[%s]], [[%d]], [[%s]], [[%s]]]",
+ first ? "" : ",\n",
+ infile, symbol->destructor_location.first_line,
+ symbol->tag,
+ symbol->number,
+ symbol->destructor,
+ symbol->type_name);
+
+ first = 0;
+ }
+ fputs ("])\n\n", out);
+}
+
+
+/*-------------------------------------.
+| Output the symbol printers to OOUT. |
+`-------------------------------------*/
+
+static void
+symbol_printers_output (FILE *out)
+{
+ int i;
+ int first = 1;
+
+ fputs ("m4_define([b4_symbol_printers], \n[", out);
+ for (i = 0; i < nsyms; ++i)
+ if (symbols[i]->destructor)
+ {
+ symbol_t *symbol = symbols[i];
+
+ /* Filename, lineno,
+ Symbol-name, Symbol-number,
+ destructor, typename. */
+ fprintf (out, "%s[[[%s]], [[%d]], [[%s]], [[%d]], [[%s]], [[%s]]]",
+ first ? "" : ",\n",
+ infile, symbol->printer_location.first_line,
+ symbol->tag,
+ symbol->number,
+ symbol->printer,
+ symbol->type_name);
+
+ first = 0;
+ }
+ fputs ("])\n\n", out);
+}
+
+
+static void
+save_column (symbol_number_t symbol, state_number_t default_state)