-static void
-output_rule_data (void)
-{
- int i;
- int j;
-
- fputs ("\n\
-#if YYDEBUG != 0\n\
-/* YYRLINE[yyn]: source line where rule number YYN was defined. */\n\
-static const short yyrline[] = { 0", ftable);
-
- j = 10;
- for (i = 1; i <= nrules; i++)
- {
- putc (',', ftable);
-
- if (j >= 10)
- {
- putc ('\n', ftable);
- j = 1;
- }
- else
- {
- j++;
- }
-
- fprintf (ftable, "%6d", rline[i]);
- }
- fprintf (ftable, "\n};\n#endif\n\n");
-
- if (toknumflag || noparserflag)
- {
- fprintf (ftable, "#define YYNTOKENS %d\n", ntokens);
- fprintf (ftable, "#define YYNNTS %d\n", nvars);
- fprintf (ftable, "#define YYNRULES %d\n", nrules);
- fprintf (ftable, "#define YYNSTATES %d\n", nstates);
- fprintf (ftable, "#define YYMAXUTOK %d\n\n", max_user_token_number);
- }
-
- if (!toknumflag && !noparserflag)
- fprintf (ftable, "\n#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)\n\n");
-
- /* Output the table of symbol names. */
-
- fprintf (ftable,
- "static const char * const yytname[] = { \"%s\"", tags[0]);
-
- j = strlen (tags[0]) + 44;
- for (i = 1; i < nsyms; i++)
- /* this used to be i<=nsyms, but that output a final "" symbol
- almost by accident */
- {
- char *p;
- putc (',', ftable);
- j++;
-
- if (j > 75)
- {
- putc ('\n', ftable);
- j = 0;
- }
-
- putc ('\"', ftable);
- j++;
-
- for (p = tags[i]; p && *p; p++)
- {
- if (*p == '"' || *p == '\\')
- {
- fprintf (ftable, "\\%c", *p);
- j += 2;
- }
- else if (*p == '\n')
- {
- fprintf (ftable, "\\n");
- j += 2;
- }
- else if (*p == '\t')
- {
- fprintf (ftable, "\\t");
- j += 2;
- }
- else if (*p == '\b')
- {
- fprintf (ftable, "\\b");
- j += 2;
- }
- else if (*p < 040 || *p >= 0177)
- {
- fprintf (ftable, "\\%03o", *p);
- j += 4;
- }
- else
- {
- putc (*p, ftable);
- j++;
- }
- }
-
- putc ('\"', ftable);
- j++;
- }
- /* add a NULL entry to list of tokens */
- fprintf (ftable, ", NULL\n};\n");
-
- if (!toknumflag && !noparserflag)
- fprintf (ftable, "#endif\n\n");
-
- /* Output YYTOKNUM. */
- if (toknumflag)
- {
- fprintf (ftable, "static const short yytoknum[] = { 0");
- j = 10;
- for (i = 1; i <= ntokens; i++)
- {
- putc (',', ftable);
- if (j >= 10)
- {
- putc ('\n', ftable);
- j = 1;
- }
- else
- j++;
- fprintf (ftable, "%6d", user_toknums[i]);
- }
- fprintf (ftable, "\n};\n\n");
- }
-
- /* Output YYR1. */
- fputs ("\
-/* YYR1[YYN]: Symbol number of symbol that rule YYN derives. */\n\
-static const short yyr1[] = { 0", ftable);
-
- j = 10;
- for (i = 1; i <= nrules; i++)
- {
- putc (',', ftable);
-
- if (j >= 10)
- {
- putc ('\n', ftable);
- j = 1;
- }
- else
- {
- j++;
- }
-
- fprintf (ftable, "%6d", rlhs[i]);
- }
- FREE (rlhs + 1);
- fputs ("\n\
-};\n\
-\n", ftable);
-
- /* Output YYR2. */
- fputs ("\
-/* YYR2[YYN]: Number of symbols composing right hand side of rule YYN. */\n\
-static const short yyr2[] = { 0", ftable);
- j = 10;
- for (i = 1; i < nrules; i++)
- {
- putc (',', ftable);
-
- if (j >= 10)
- {
- putc ('\n', ftable);
- j = 1;
- }
- else
- {
- j++;
- }
-
- fprintf (ftable, "%6d", rrhs[i + 1] - rrhs[i] - 1);
- }
-
- putc (',', ftable);
- if (j >= 10)
- putc ('\n', ftable);
-
- fprintf (ftable, "%6d\n};\n", nitems - rrhs[nrules] - 1);
- FREE (rrhs + 1);
-}