mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
As a result of the previous patch, it is no longer needed
to reorder ritem itself. * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2002-04-07 Akim Demaille <akim@epita.fr>
|
||||
|
||||
As a result of the previous patch, it is no longer needed
|
||||
to reorder ritem itself.
|
||||
|
||||
* src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
|
||||
|
||||
2002-04-07 Akim Demaille <akim@epita.fr>
|
||||
|
||||
Be sure never to walk through RITEMS, but use only data related to
|
||||
|
||||
24
src/reduce.c
24
src/reduce.c
@@ -248,22 +248,14 @@ reduce_grammar_tables (void)
|
||||
free (rules + 1);
|
||||
rules = rules_sorted;
|
||||
|
||||
/* Also reorder ritems. */
|
||||
{
|
||||
short *ritems_sorted = XCALLOC (short, nitems + 1);
|
||||
short *ritemsp = ritems_sorted;
|
||||
for (i = 1; i < nrules + 1; ++i)
|
||||
{
|
||||
short *rhsp = rules[i].rhs;
|
||||
rules[i].rhs = ritemsp;
|
||||
for (/* Nothing. */; *rhsp >= 0; ++rhsp)
|
||||
*ritemsp++ = *rhsp;
|
||||
*ritemsp++ = -i;
|
||||
}
|
||||
*ritemsp++ = 0;
|
||||
free (ritem);
|
||||
ritem = ritems_sorted;
|
||||
}
|
||||
/* Renumber the rules markers in RITEMS. */
|
||||
for (i = 1; i < nrules + 1; ++i)
|
||||
{
|
||||
short *rhsp = rules[i].rhs;
|
||||
for (/* Nothing. */; *rhsp >= 0; ++rhsp)
|
||||
/* Nothing. */;
|
||||
*rhsp = -i;
|
||||
}
|
||||
nrules -= nuseless_productions;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user