Also warn about non-used mid-rule values.

* src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
member.
(symbol_list_new): Adjust.
* src/reader.c (symbol_typed_p): New.
(grammar_rule_check): Use it.
(grammar_midrule_action): Bind a mid-rule LHS to its rule.
Check its rule.
* tests/input.at (AT_CHECK_UNUSED_VALUES): New.
Use it.
* tests/actions.at (Exotic Dollars): Adjust.
This commit is contained in:
Akim Demaille
2006-01-04 09:18:37 +00:00
parent 378f4bd846
commit 8486615972
7 changed files with 115 additions and 42 deletions

View File

@@ -32,6 +32,10 @@ typedef struct symbol_list
symbol *sym;
location location;
/* If this symbol is the generated lhs for a mid-rule, a pointer to
that mid-rule. */
struct symbol_list *mid_rule;
/* The action is attached to the LHS of a rule. */
const char *action;
location action_location;