- register int i;
- register int j;
-
- fprintf(ftable, "\n#if YYDEBUG != 0\n");
- fprintf(ftable, "static const short yyrline[] = { 0");
-
- 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 */
- {
- register 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++;
- }
- fprintf(ftable, ", NULL\n};\n"); /* add a NULL entry to list of tokens */
-
- if (! toknumflag && ! noparserflag)
- fprintf(ftable, "#endif\n\n");
-
- 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");
- }
-
- fprintf(ftable, "static const short yyr1[] = { 0");
-
- j = 10;
- for (i = 1; i <= nrules; i++)
- {
- putc(',', ftable);
-
- if (j >= 10)
- {
- putc('\n', ftable);
- j = 1;
- }
- else
- {
- j++;
- }