mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 17:53:02 +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>
|
2002-04-07 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
Be sure never to walk through RITEMS, but use only data related to
|
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);
|
free (rules + 1);
|
||||||
rules = rules_sorted;
|
rules = rules_sorted;
|
||||||
|
|
||||||
/* Also reorder ritems. */
|
/* Renumber the rules markers in RITEMS. */
|
||||||
{
|
for (i = 1; i < nrules + 1; ++i)
|
||||||
short *ritems_sorted = XCALLOC (short, nitems + 1);
|
{
|
||||||
short *ritemsp = ritems_sorted;
|
short *rhsp = rules[i].rhs;
|
||||||
for (i = 1; i < nrules + 1; ++i)
|
for (/* Nothing. */; *rhsp >= 0; ++rhsp)
|
||||||
{
|
/* Nothing. */;
|
||||||
short *rhsp = rules[i].rhs;
|
*rhsp = -i;
|
||||||
rules[i].rhs = ritemsp;
|
}
|
||||||
for (/* Nothing. */; *rhsp >= 0; ++rhsp)
|
|
||||||
*ritemsp++ = *rhsp;
|
|
||||||
*ritemsp++ = -i;
|
|
||||||
}
|
|
||||||
*ritemsp++ = 0;
|
|
||||||
free (ritem);
|
|
||||||
ritem = ritems_sorted;
|
|
||||||
}
|
|
||||||
nrules -= nuseless_productions;
|
nrules -= nuseless_productions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user