]> git.saurik.com Git - bison.git/blobdiff - src/symtab.c
* data/glr.c (yyFail): Drastically simplify; since the format argument
[bison.git] / src / symtab.c
index c0368f715493e8c6cf8b70646371fa4e17ef5a1a..aabf3343e5fb534b05badfb766e31637e8f687a2 100644 (file)
@@ -1,6 +1,6 @@
 /* Symbol table manager for Bison.
 
-   Copyright (C) 1984, 1989, 2000, 2001, 2002, 2004 Free Software
+   Copyright (C) 1984, 1989, 2000, 2001, 2002, 2004, 2005 Free Software
    Foundation, Inc.
 
    This file is part of Bison, the GNU Compiler Compiler.
@@ -17,8 +17,8 @@
 
    You should have received a copy of the GNU General Public License
    along with Bison; see the file COPYING.  If not, write to
-   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
 
 
 #include "system.h"
@@ -66,6 +66,9 @@ symbol_new (uniqstr tag, location loc)
   res->alias = NULL;
   res->class = unknown_sym;
 
+  if (nsyms == SYMBOL_NUMBER_MAXIMUM)
+    fatal (_("too many symbols in input grammar (limit is %d)"),
+          SYMBOL_NUMBER_MAXIMUM);
   nsyms++;
   return res;
 }
@@ -261,6 +264,7 @@ symbol_make_alias (symbol *sym, symbol *symval, location loc)
        abort ();
       sym->number = symval->number =
        (symval->number < sym->number) ? symval->number : sym->number;
+      symbol_type_set (symval, sym->type_name, loc);
     }
 }
 
@@ -280,7 +284,7 @@ symbol_check_alias_consistency (symbol *this)
   if (!(this->alias && this->user_token_number == USER_NUMBER_ALIAS))
     return;
 
-  if (orig->type_name || alias->type_name)
+  if (orig->type_name != alias->type_name)
     {
       if (orig->type_name)
        symbol_type_set (alias, orig->type_name, orig->type_location);
@@ -471,8 +475,7 @@ symbol_get (const char *key, location loc)
   symbol probe;
   symbol *entry;
 
-  /* Keep the symbol in a printable form.  */
-  key = uniqstr_new (quotearg_style (escape_quoting_style, key));
+  key = uniqstr_new (key);
   probe.tag = key;
   entry = hash_lookup (symbol_table, &probe);