mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 05:13:04 +00:00
* src/derives.c (print_derives): Be sure to use >= 0', not > 0',
when walking through ritem, even via rule->rhs. * src/reduce.c (dump_grammar, useful_production, reduce_output) (useful_production, useless_nonterminals): Likewise. (reduce_grammar_tables): Likewise, plus update nritems. * src/nullable.c (set_nullable): Likewise. * src/lalr.c (build_relations): Likewise. * tests/sets.at (Nullable): Adjust. Fortunately, now, the $axiom is no longer nullable.
This commit is contained in:
@@ -71,19 +71,19 @@ set_nullable (void)
|
||||
for (ruleno = 1; ruleno < nrules + 1; ++ruleno)
|
||||
if (rule_table[ruleno].useful)
|
||||
{
|
||||
if (ritem[rule_table[ruleno].rhs] > 0)
|
||||
if (ritem[rule_table[ruleno].rhs] >= 0)
|
||||
{
|
||||
/* This rule has a non empty RHS. */
|
||||
short *r;
|
||||
int any_tokens = 0;
|
||||
for (r = ritem + rule_table[ruleno].rhs; *r > 0; ++r)
|
||||
for (r = &ritem[rule_table[ruleno].rhs]; *r >= 0; ++r)
|
||||
if (ISTOKEN (*r))
|
||||
any_tokens = 1;
|
||||
|
||||
/* This rule has only nonterminals: schedule it for the second
|
||||
pass. */
|
||||
if (!any_tokens)
|
||||
for (r = ritem + rule_table[ruleno].rhs; *r > 0; ++r)
|
||||
for (r = &ritem[rule_table[ruleno].rhs]; *r >= 0; ++r)
|
||||
{
|
||||
rcount[ruleno]++;
|
||||
p->next = rsets[*r];
|
||||
|
||||
Reference in New Issue
Block a user