* 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:
Akim Demaille
2001-12-29 14:15:33 +00:00
parent 9e7f6bbd59
commit 3d4daee374
6 changed files with 32 additions and 17 deletions

View File

@@ -43,9 +43,9 @@ print_derives (void)
{
short *rhsp;
fprintf (stderr, "\t\t%d:", *sp);
for (rhsp = ritem + rule_table[*sp].rhs; *rhsp > 0; ++rhsp)
for (rhsp = ritem + rule_table[*sp].rhs; *rhsp >= 0; ++rhsp)
fprintf (stderr, " %s", tags[*rhsp]);
fprintf (stderr, " (rule %d)\n", -*rhsp);
fprintf (stderr, " (rule %d)\n", -*rhsp - 1);
}
}