X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/1e9798d5699ca67718fd3b0d6baa9abcf27e6cd3..d9ec2d0749d86ef1ac10f9145abef98bec8339ef:/src/symtab.c diff --git a/src/symtab.c b/src/symtab.c index 5ba5ca25..c701ccd6 100644 --- a/src/symtab.c +++ b/src/symtab.c @@ -1,5 +1,5 @@ /* Symbol table manager for Bison, - Copyright (C) 1984, 1989, 2000 Free Software Foundation, Inc. + Copyright 1984, 1989, 2000, 2001 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -20,7 +20,6 @@ #include "system.h" -#include "xalloc.h" #include "symtab.h" #include "gram.h" @@ -50,6 +49,9 @@ hash (const char *key) static bucket * bucket_new (const char *tag, int hashval) { + /* Hack, until we have a Bison parser. */ + extern int lineno; + bucket *res = XMALLOC (bucket, 1); res->link = symtab[hashval]; @@ -59,9 +61,10 @@ bucket_new (const char *tag, int hashval) res->value = 0; res->prec = 0; res->assoc = right_assoc; - res->user_token_number = 0; + res->user_token_number = SUNDEF; res->alias = NULL; res->class = unknown_sym; + res->line = lineno; nsyms++; @@ -143,6 +146,7 @@ free_symtab (void) if (bp->type_name) XFREE (bp->type_name); #endif + XFREE (bp->tag); XFREE (bp); bp = bptmp; }