* data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of

arguments is really empty, not only equal to `[]'.
* src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
member.
(symbol_destructor_set): New.
* src/output.c (symbol_destructors_output): New.
* src/reader.h (brace_code_t, current_braced_code): New.
* src/scan-gram.l (BRACED_CODE): Use it to branch on...
(handle_dollar): Rename as...
(handle_action_dollar): this.
(handle_destructor_dollar): New.
* src/parse-gram.y (PERCENT_DESTRUCTOR): New.
(grammar_declaration): Use it.
* data/bison.simple (yystos): Is always defined.
(yydestructor): New.
* tests/actions.at (Destructors): New.
* tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
This commit is contained in:
Akim Demaille
2002-06-17 08:43:12 +00:00
parent dafdc66ff0
commit 9280d3ef89
15 changed files with 1222 additions and 848 deletions

View File

@@ -48,7 +48,16 @@ void gram_error (gram_control_t *control,
location_t *loc, const char *msg);
int gram_parse (void *control);
extern int typed;
/* The sort of braced code we are in. */
typedef enum braced_code_e
{
action_braced_code,
destructor_braced_code
} braced_code_t;
/* FIXME: This is really a dirty hack which demonstrates that we
should probably not try to parse the actions now. */
extern braced_code_t current_braced_code;
/* From reader.c. */
void grammar_start_symbol_set PARAMS ((symbol_t *s, location_t l));
@@ -65,5 +74,6 @@ void grammar_current_rule_action_append PARAMS ((const char *action,
location_t l));
extern symbol_list_t *current_rule;
void reader PARAMS ((void));
extern int typed;
#endif /* !READER_H_ */