* 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

@@ -57,8 +57,9 @@ struct symbol_s
/* The key, name of the symbol. */
char *tag;
/* Its %type. */
/* Its %type and associated destructor. */
char *type_name;
char *destructor;
/* The location of its first occurence. */
location_t location;
@@ -110,6 +111,10 @@ void symbol_make_alias PARAMS ((symbol_t *symbol, symbol_t *symval));
void symbol_type_set PARAMS ((symbol_t *symbol, location_t location,
char *type_name));
/* Set the DESTRUCTOR associated to SYMBOL. */
void symbol_destructor_set PARAMS ((symbol_t *symbol, location_t location,
char *destructor));
/* Set the PRECEDENCE associated to SYMBOL. Ensures that SYMBOL is a
terminal. Does nothing if invoked with UNDEF_ASSOC as ASSOC. */
void symbol_precedence_set PARAMS ((symbol_t *symbol, location_t location,