]> git.saurik.com Git - bison.git/commitdiff
* src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
authorAkim Demaille <akim@epita.fr>
Fri, 26 Jul 2002 06:24:11 +0000 (06:24 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 26 Jul 2002 06:24:11 +0000 (06:24 +0000)
* doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
* tests/regression.at (Web2c Actions): Adjust.

ChangeLog
doc/bison.texinfo
src/output.c
tests/regression.at

index 2f34da0b4dcedc6083a4522bce009b59ee3ee709..f581e54095cd5bb995adf37bb56506b70ecb9b48 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        Stop storing rules from 1 to nrules + 1.
index 03d3cc907dcce223ce69a7ef2ad26e7cb2f71d8f..a4c1a4baada7b01a5ea95b676f124f76ca2d9244 100644 (file)
@@ -3552,10 +3552,10 @@ Request a pure (reentrant) parser program (@pxref{Pure Decl, ,A Pure
 @item %token-table
 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
-token whose internal Bison token code number is @var{i}.  The first three
-elements of @code{yytname} are always @code{"$"}, @code{"error"}, and
-@code{"$illegal"}; after these come the symbols defined in the grammar
-file.
+token whose internal Bison token code number is @var{i}.  The first
+three elements of @code{yytname} are always @code{"$"}, @code{"error"},
+and @code{"$undefined."}; after these come the symbols defined in the
+grammar file.
 
 For single-character literal tokens and literal string tokens, the name
 in the table includes the single-quote or double-quote characters: for
index 127950f2b527c062737120bfaf4b008a7b372a4e..5b8ca1084394df086da779c029476d5e645f4727 100644 (file)
@@ -344,11 +344,11 @@ prepare_tokens (void)
   /* Output YYTOKNUM. */
   {
     int i;
-    int *values = XCALLOC (int, ntokens + 1);
-    for (i = 0; i < ntokens + 1; ++i)
+    int *values = XCALLOC (int, ntokens);
+    for (i = 0; i < ntokens; ++i)
       values[i] = symbols[i]->user_token_number;
     muscle_insert_int_table ("toknum", values,
-                            0, 1, ntokens + 1);
+                            values[0], 1, ntokens);
     free (values);
   }
 }
index 468610e5aaee943d004036e15ead3f8506ffaa52..d9578a4214f0d01d393152465d3c512179e81a8e 100644 (file)
@@ -587,9 +587,9 @@ static const char *const yytname[] =
   "$", "error", "$undefined.", "\"if\"", "\"const\"", "\"then\"",
   "\"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[] =
 {