mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 13:23:04 +00:00
* src/symtab.h, src/symtab.c: line' is a new member of bucket'.
* src/reader.c (record_rule_lines, rline, rline_allocated): Remove. * src/output.c: Adjust.
This commit is contained in:
23
src/reader.c
23
src/reader.c
@@ -1215,20 +1215,6 @@ copy_guard (symbol_list *rule, int stack_offset)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
record_rule_line (void)
|
||||
{
|
||||
/* Record each rule's source line number in rline table. */
|
||||
|
||||
if (nrules >= rline_allocated)
|
||||
{
|
||||
rline_allocated = nrules * 2;
|
||||
rline = XREALLOC (rline, short, rline_allocated);
|
||||
}
|
||||
rline[nrules] = lineno;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------.
|
||||
| Generate a dummy symbol, a nonterminal, whose name cannot conflict |
|
||||
| with the user's names. |
|
||||
@@ -1371,8 +1357,6 @@ readgram (void)
|
||||
nrules++;
|
||||
nitems++;
|
||||
|
||||
record_rule_line ();
|
||||
|
||||
p = XCALLOC (symbol_list, 1);
|
||||
p->sym = lhs;
|
||||
|
||||
@@ -1450,7 +1434,6 @@ readgram (void)
|
||||
just read can belong to it. */
|
||||
nrules++;
|
||||
nitems++;
|
||||
record_rule_line ();
|
||||
p = XCALLOC (symbol_list, 1);
|
||||
if (crule1)
|
||||
crule1->next = p;
|
||||
@@ -1458,9 +1441,10 @@ readgram (void)
|
||||
grammar = p;
|
||||
p->sym = sdummy;
|
||||
crule1 = XCALLOC (symbol_list, 1);
|
||||
p->next = crule1;
|
||||
crule1->next = crule;
|
||||
|
||||
p->next = crule1;
|
||||
|
||||
/* Insert the dummy generated by that rule into this
|
||||
rule. */
|
||||
nitems++;
|
||||
@@ -1884,6 +1868,7 @@ packgram (void)
|
||||
{
|
||||
rule_table[ruleno].lhs = p->sym->value;
|
||||
rule_table[ruleno].rhs = itemno;
|
||||
rule_table[ruleno].line = p->sym->line;
|
||||
ruleprec = p->ruleprec;
|
||||
|
||||
p = p->next;
|
||||
@@ -1938,8 +1923,6 @@ reader (void)
|
||||
nvars = 0;
|
||||
nrules = 0;
|
||||
nitems = 0;
|
||||
rline_allocated = 10;
|
||||
rline = XCALLOC (short, rline_allocated);
|
||||
|
||||
typed = 0;
|
||||
lastprec = 0;
|
||||
|
||||
Reference in New Issue
Block a user