* src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.

* doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
* tests/regression.at (Web2c Actions): Adjust.
This commit is contained in:
Akim Demaille
2002-07-26 06:24:11 +00:00
parent 4b3d3a8e46
commit 3650b4b8dd
4 changed files with 15 additions and 9 deletions

View File

@@ -1,3 +1,9 @@
2002-07-25 Akim Demaille <akim@epita.fr>
* src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
* doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
* tests/regression.at (Web2c Actions): Adjust.
2002-07-25 Akim Demaille <akim@epita.fr> 2002-07-25 Akim Demaille <akim@epita.fr>
Stop storing rules from 1 to nrules + 1. Stop storing rules from 1 to nrules + 1.

View File

@@ -3552,10 +3552,10 @@ Request a pure (reentrant) parser program (@pxref{Pure Decl, ,A Pure
@item %token-table @item %token-table
Generate an array of token names in the parser file. The name of the Generate an array of token names in the parser file. The name of the
array is @code{yytname}; @code{yytname[@var{i}]} is the name of the array is @code{yytname}; @code{yytname[@var{i}]} is the name of the
token whose internal Bison token code number is @var{i}. The first three token whose internal Bison token code number is @var{i}. The first
elements of @code{yytname} are always @code{"$"}, @code{"error"}, and three elements of @code{yytname} are always @code{"$"}, @code{"error"},
@code{"$illegal"}; after these come the symbols defined in the grammar and @code{"$undefined."}; after these come the symbols defined in the
file. grammar file.
For single-character literal tokens and literal string tokens, the name For single-character literal tokens and literal string tokens, the name
in the table includes the single-quote or double-quote characters: for in the table includes the single-quote or double-quote characters: for

View File

@@ -344,11 +344,11 @@ prepare_tokens (void)
/* Output YYTOKNUM. */ /* Output YYTOKNUM. */
{ {
int i; int i;
int *values = XCALLOC (int, ntokens + 1); int *values = XCALLOC (int, ntokens);
for (i = 0; i < ntokens + 1; ++i) for (i = 0; i < ntokens; ++i)
values[i] = symbols[i]->user_token_number; values[i] = symbols[i]->user_token_number;
muscle_insert_int_table ("toknum", values, muscle_insert_int_table ("toknum", values,
0, 1, ntokens + 1); values[0], 1, ntokens);
free (values); free (values);
} }
} }

View File

@@ -587,9 +587,9 @@ static const char *const yytname[] =
"$", "error", "$undefined.", "\"if\"", "\"const\"", "\"then\"", "$", "error", "$undefined.", "\"if\"", "\"const\"", "\"then\"",
"\"else\"", "$axiom", "statement", "struct_stat", "if", "else", 0 "\"else\"", "$axiom", "statement", "struct_stat", "if", "else", 0
}; };
static const short yytoknum[] = static const unsigned short yytoknum[] =
{ {
0, 256, 257, 258, 259, 260, 261, -1 0, 256, 257, 258, 259, 260, 261
}; };
static const unsigned char yyr1[] = static const unsigned char yyr1[] =
{ {