- if (!semantic_parser && !no_parser_flag)
- obstack_sgrow (&table_obstack, "\n#endif\n");
-}
-
-
-static void
-output_stos (void)
-{
- output_short_table (&table_obstack, NULL, "yystos", accessing_symbol,
- 0, 1, nstates);
-}
-
-
-static void
-output_rule_data (void)
-{
- int i;
- int j;
- short *short_tab = NULL;
-
- obstack_sgrow (&table_obstack, "\n\
-#if YYDEBUG != 0\n");
-
- output_short_table (&table_obstack,
- "YYRLINE[YYN] -- source line where rule number YYN was defined",
- "yyrline", rline,
- 0, 1, nrules + 1);
-
- obstack_sgrow (&table_obstack, "#endif\n\n");
-
- if (token_table_flag || no_parser_flag)
- {
- obstack_fgrow1 (&table_obstack, "#define YYNTOKENS %d\n", ntokens);
- obstack_fgrow1 (&table_obstack, "#define YYNNTS %d\n", nvars);
- obstack_fgrow1 (&table_obstack, "#define YYNRULES %d\n", nrules);
- obstack_fgrow1 (&table_obstack, "#define YYNSTATES %d\n", nstates);
- obstack_fgrow1 (&table_obstack, "#define YYMAXUTOK %d\n\n",
- max_user_token_number);
- }
-
- /* Output the table of symbol names. */
- if (!token_table_flag && !no_parser_flag)
- obstack_sgrow (&table_obstack,
- "\n#if YYDEBUG != 0 || defined YYERROR_VERBOSE\n\n");
- obstack_sgrow (&table_obstack, "\
-/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */\n");
- obstack_sgrow (&table_obstack,
- "static const char *const yytname[] =\n{\n ");
-
- j = 0;
- for (i = 0; i < nsyms; i++)
- /* this used to be i<=nsyms, but that output a final "" symbol
- almost by accident */
- {
- /* Width of the next token, including the two quotes, the coma
- and the space. */
- int strsize = 4;
- char *p;
-
- for (p = tags[i]; p && *p; p++)
- if (*p == '"' || *p == '\\' || *p == '\n' || *p == '\t'
- || *p == '\b')
- strsize += 2;
- else if (*p < 040 || *p >= 0177)
- strsize += 4;
- else
- strsize++;
-
- if (j + strsize > 75)
- {
- obstack_sgrow (&table_obstack, "\n ");
- j = 2;
- }
-
- obstack_1grow (&table_obstack, '\"');
- for (p = tags[i]; p && *p; p++)
- {
- if (*p == '"' || *p == '\\')
- obstack_fgrow1 (&table_obstack, "\\%c", *p);
- else if (*p == '\n')
- obstack_sgrow (&table_obstack, "\\n");
- else if (*p == '\t')
- obstack_sgrow (&table_obstack, "\\t");
- else if (*p == '\b')
- obstack_sgrow (&table_obstack, "\\b");
- else if (*p < 040 || *p >= 0177)
- obstack_fgrow1 (&table_obstack, "\\%03o", *p);
- else
- obstack_1grow (&table_obstack, *p);
- }
-
- obstack_sgrow (&table_obstack, "\", ");
- j += strsize;
- }
- /* add a NULL entry to list of tokens */
- obstack_sgrow (&table_obstack, "NULL\n};\n");
-
- if (!token_table_flag && !no_parser_flag)
- obstack_sgrow (&table_obstack, "#endif\n\n");
-