Attaching lineno to buckets is stupid, since only one copy of each

symbol is kept, only the line of the first occurrence is kept too.
* src/symtab.h, src/symtab.c (bucket): Remove the line member.
* src/reader.c (rline_allocated): Remove, unused.
(symbol_list): Have a `line' member.
(symbol_list_new): New.
(readgram): Use it.
* src/print.c (print_grammar): Output the rule line numbers.
* tests/regression.at (Solved SR Conflicts)
(Unresolved SR Conflicts): Adjust.
Reported by Hans Aberg.
This commit is contained in:
Akim Demaille
2001-11-23 14:13:02 +00:00
parent b497173564
commit b29b2ed560
6 changed files with 52 additions and 35 deletions

View File

@@ -49,9 +49,6 @@ 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];
@@ -64,7 +61,6 @@ bucket_new (const char *tag, int hashval)
res->user_token_number = SUNDEF;
res->alias = NULL;
res->class = unknown_sym;
res->line = lineno;
nsyms++;