mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 06:13:02 +00:00
* src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
new member. (symbol_destructor_set): Adjust. * src/output.c (symbol_destructors_output): Output the destructor locations. Output the symbol name. * data/bison.simple (b4_symbol_destructor): Adjust.
This commit is contained in:
12
src/output.c
12
src/output.c
@@ -622,10 +622,16 @@ symbol_destructors_output (FILE *out)
|
||||
{
|
||||
symbol_t *symbol = symbols[i];
|
||||
|
||||
/* Symbol-number, destructor. */
|
||||
fprintf (out, "%s[[[%d]], [[%s]], [[%s]]]",
|
||||
/* Filename, lineno,
|
||||
Symbol-name, Symbol-number,
|
||||
destructor, typename. */
|
||||
fprintf (out, "%s[[[%s]], [[%d]], [[%s]], [[%d]], [[%s]], [[%s]]]",
|
||||
first ? "" : ",\n",
|
||||
symbol->number, symbol->destructor, symbol->type_name);
|
||||
infile, symbol->destructor_location.first_line,
|
||||
symbol_tag_get (symbol),
|
||||
symbol->number,
|
||||
symbol->destructor,
|
||||
symbol->type_name);
|
||||
|
||||
first = 0;
|
||||
}
|
||||
|
||||
@@ -47,9 +47,11 @@ symbol_new (const char *tag, location_t location)
|
||||
symbol_t *res = XMALLOC (symbol_t, 1);
|
||||
|
||||
res->tag = xstrdup (tag);
|
||||
res->location = location;
|
||||
|
||||
res->type_name = NULL;
|
||||
res->destructor = NULL;
|
||||
res->location = location;
|
||||
|
||||
res->number = NUMBER_UNDEFINED;
|
||||
res->prec = 0;
|
||||
res->assoc = right_assoc;
|
||||
@@ -130,6 +132,7 @@ symbol_destructor_set (symbol_t *symbol, location_t location, char *destructor)
|
||||
_("destructor redeclaration for %s"),
|
||||
symbol_tag_get (symbol));
|
||||
symbol->destructor = destructor;
|
||||
symbol->destructor_location = location;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,13 +56,14 @@ struct symbol_s
|
||||
{
|
||||
/* The key, name of the symbol. */
|
||||
char *tag;
|
||||
/* The location of its first occurence. */
|
||||
location_t location;
|
||||
|
||||
/* Its %type and associated destructor. */
|
||||
char *type_name;
|
||||
char *destructor;
|
||||
location_t destructor_location;
|
||||
|
||||
/* The location of its first occurence. */
|
||||
location_t location;
|
||||
|
||||
symbol_number_t number;
|
||||
short prec;
|
||||
|
||||
Reference in New Issue
Block a user