mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 00:03:03 +00:00
* src/nullable.c (set_nullable): Use a for loop to de-obfuscate
the handling of squeue. `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2001-12-05 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/nullable.c (set_nullable): Use a for loop to de-obfuscate
|
||||||
|
the handling of squeue.
|
||||||
|
`symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
|
||||||
|
|
||||||
|
|
||||||
2001-12-05 Akim Demaille <akim@epita.fr>
|
2001-12-05 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
Because useless nonterminals are now kept alive (instead of being
|
Because useless nonterminals are now kept alive (instead of being
|
||||||
|
|||||||
@@ -107,23 +107,16 @@ set_nullable (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (s1 < s2)
|
while (s1 < s2)
|
||||||
{
|
for (p = rsets[*s1++]; p; p = p->next)
|
||||||
p = rsets[*s1++];
|
{
|
||||||
while (p)
|
int ruleno = p->value;
|
||||||
{
|
if (--rcount[ruleno] == 0)
|
||||||
int ruleno = p->value;
|
if (rule_table[ruleno].useful && !nullable[rule_table[ruleno].lhs])
|
||||||
p = p->next;
|
|
||||||
if (--rcount[ruleno] == 0)
|
|
||||||
{
|
{
|
||||||
int symbol = rule_table[ruleno].lhs;
|
nullable[rule_table[ruleno].lhs] = 1;
|
||||||
if (symbol >= 0 && !nullable[symbol])
|
*s2++ = rule_table[ruleno].lhs;
|
||||||
{
|
|
||||||
nullable[symbol] = 1;
|
|
||||||
*s2++ = symbol;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
XFREE (squeue);
|
XFREE (squeue);
|
||||||
XFREE (rcount);
|
XFREE (rcount);
|
||||||
|
|||||||
Reference in New Issue
Block a user