* src/output.c (output_rule_data): Output the documentation of

some of the tables.
(Copyright notice): Update.
Formatting changes.
This commit is contained in:
Akim Demaille
2000-03-17 10:48:28 +00:00
parent 0de741ca66
commit 9ee3c97bce
2 changed files with 61 additions and 43 deletions

View File

@@ -1,3 +1,10 @@
2000-03-16 Akim Demaille <akim@epita.fr>
* src/output.c (output_rule_data): Output the documentation of
some of the tables.
(Copyright notice): Update.
Formatting changes.
2000-03-16 Akim Demaille <akim@epita.fr> 2000-03-16 Akim Demaille <akim@epita.fr>
* src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to

View File

@@ -1,22 +1,22 @@
/* Output the generated parsing program for bison, /* Output the generated parsing program for bison,
Copyright (C) 1984, 1986, 1989, 1992 Free Software Foundation, Inc. Copyright (C) 1984, 1986, 1989, 1992, 2000 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
Bison is free software; you can redistribute it and/or modify Bison is free software; you can redistribute it and/or modify it
it under the terms of the GNU General Public License as published by under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2, or (at your option)
any later version. any later version.
Bison is distributed in the hope that it will be useful, Bison is distributed in the hope that it will be useful, but
but WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
GNU General Public License for more details. General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with Bison; see the file COPYING. If not, write to along with Bison; see the file COPYING. If not, write to the Free
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
Boston, MA 02111-1307, USA. */ 02111-1307, USA. */
/* functions to output parsing data to various files. Entries are: /* functions to output parsing data to various files. Entries are:
@@ -434,8 +434,10 @@ output_rule_data (void)
register int i; register int i;
register int j; register int j;
fprintf(ftable, "\n#if YYDEBUG != 0\n"); fputs ("\n\
fprintf(ftable, "static const short yyrline[] = { 0"); #if YYDEBUG != 0\n\
/* YYRLINE[yyn]: source line where rule number YYN was defined. */\n\
static const short yyrline[] = { 0", ftable);
j = 10; j = 10;
for (i = 1; i <= nrules; i++) for (i = 1; i <= nrules; i++)
@@ -529,11 +531,13 @@ output_rule_data (void)
putc ('\"', ftable); putc ('\"', ftable);
j++; j++;
} }
fprintf(ftable, ", NULL\n};\n"); /* add a NULL entry to list of tokens */ /* add a NULL entry to list of tokens */
fprintf (ftable, ", NULL\n};\n");
if (! toknumflag && ! noparserflag) if (! toknumflag && ! noparserflag)
fprintf(ftable, "#endif\n\n"); fprintf (ftable, "#endif\n\n");
/* Output YYTOKNUM. */
if (toknumflag) if (toknumflag)
{ {
fprintf(ftable, "static const short yytoknum[] = { 0"); fprintf(ftable, "static const short yytoknum[] = { 0");
@@ -552,7 +556,10 @@ output_rule_data (void)
fprintf(ftable, "\n};\n\n"); fprintf(ftable, "\n};\n\n");
} }
fprintf(ftable, "static const short yyr1[] = { 0"); /* Output YYR1. */
fputs ("\
/* YYR1[YYN]: Symbol number of symbol that rule YYN derives. */\n\
static const short yyr1[] = { 0", ftable);
j = 10; j = 10;
for (i = 1; i <= nrules; i++) for (i = 1; i <= nrules; i++)
@@ -571,11 +578,15 @@ output_rule_data (void)
fprintf(ftable, "%6d", rlhs[i]); fprintf(ftable, "%6d", rlhs[i]);
} }
FREE(rlhs + 1); FREE(rlhs + 1);
fputs ("\n\
};\n\
\n", ftable);
fprintf(ftable, "\n};\n\nstatic const short yyr2[] = { 0"); /* Output YYR2. */
fputs ("\
/* YYR2[YYN]: Number of symbols composing right hand side of rule YYN. */\n\
static const short yyr2[] = { 0", ftable);
j = 10; j = 10;
for (i = 1; i < nrules; i++) for (i = 1; i < nrules; i++)
{ {
@@ -1030,8 +1041,8 @@ save_column (int symbol, int default_state)
/* the next few functions decide how to pack /* The next few functions decide how to pack the actions and gotos
the actions and gotos information into yytable. */ information into yytable. */
void void
sort_actions (void) sort_actions (void)