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

@@ -65,8 +65,9 @@ AT_CHECK([cat input.output], [],
Grammar
rule 1 exp -> exp OP exp
rule 2 exp -> NUM
Number, Line, Rule
1 3 exp -> exp OP exp
2 3 exp -> NUM
Terminals, with rules where they appear
@@ -163,8 +164,9 @@ AT_CHECK([cat input.output], [],
Grammar
rule 1 exp -> exp OP exp
rule 2 exp -> NUM
Number, Line, Rule
1 4 exp -> exp OP exp
2 4 exp -> NUM
Terminals, with rules where they appear