mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 22:33:03 +00:00
Instead of mapping the LHS of unused rules to -1, keep the LHS
valid, but flag the rules as invalid. * src/gram.h (rule_t): `useful' is a new member. * src/print.c (print_grammar): Adjust. * src/derives.c (set_derives): Likewise. * src/reader.c (packgram, reduce_output): Likewise. * src/reduce.c (reduce_grammar_tables): Likewise. * tests/reduce.at (Underivable Rules, Useless Rules): New.
This commit is contained in:
@@ -59,6 +59,8 @@
|
||||
|
||||
RULE_TABLE[R].line -- the line where R was defined.
|
||||
|
||||
RULE_TABLE[R].useful -- TRUE iff the rule is used.
|
||||
|
||||
The right hand side is stored as symbol numbers in a portion of
|
||||
RITEM.
|
||||
|
||||
@@ -119,6 +121,7 @@ typedef struct rule_s
|
||||
short precsym;
|
||||
short assoc;
|
||||
short line;
|
||||
bool useful;
|
||||
} rule_t;
|
||||
|
||||
extern struct rule_s *rule_table;
|
||||
|
||||
Reference in New Issue
Block a user