* src/reader.c (grammar_current_rule_check): Also check that $$

is used.
Take the rule to check as argument, hence rename as...
(grammar_rule_check): this.
* src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
Rename as...
(grammar_rule_begin, grammar_rule_end): these, for consistency.
(grammar_midrule_action, grammar_symbol_append): Now static.
* tests/torture.at (input): Don't rely on the default action
being always performed.
* tests/calc.at: "Set" $$ even when the action is "cut" with
YYERROR or other.
* tests/actions.at (Exotic Dollars): Instead of using unused
values, check that the warning is issued.
This commit is contained in:
Akim Demaille
2005-12-27 17:50:00 +00:00
parent f8e1c9e55b
commit 8f3596a633
11 changed files with 217 additions and 193 deletions

View File

@@ -61,14 +61,11 @@ char const *token_name (int);
/* From reader.c. */
void grammar_start_symbol_set (symbol *sym, location loc);
void prologue_augment (const char *prologue, location loc);
void grammar_symbol_append (symbol *sym, location loc);
void grammar_rule_begin (symbol *lhs, location loc);
void grammar_rule_end (location loc);
void grammar_midrule_action (void);
void grammar_current_rule_begin (symbol *lhs, location loc);
void grammar_current_rule_end (location loc);
void grammar_current_rule_prec_set (symbol *precsym, location loc);
void grammar_current_rule_dprec_set (int dprec, location loc);
void grammar_current_rule_merge_set (uniqstr name, location loc);
void grammar_current_rule_symbol_append (symbol *sym, location loc);
void grammar_current_rule_action_append (const char *action, location loc);
extern symbol_list *current_rule;