mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 23:03:04 +00:00
* 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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user