mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +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:
10
ChangeLog
10
ChangeLog
@@ -1,3 +1,13 @@
|
||||
2002-06-18 Akim Demaille <akim@epita.fr>
|
||||
|
||||
* 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.
|
||||
|
||||
2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
|
||||
and Akim Demaille <akim@epita.fr>
|
||||
|
||||
|
||||
@@ -1267,7 +1267,11 @@ yyreturn:
|
||||
return yyresult;
|
||||
]}
|
||||
|
||||
/* Release the memory associated to SYMBOL-NUMBER. */
|
||||
|
||||
/*-------------------------------------------------.
|
||||
| Release the memory associated to SYMBOL-NUMBER. |
|
||||
`-------------------------------------------------*/
|
||||
|
||||
m4_divert_push([KILL])# M4 code.
|
||||
# b4_eval
|
||||
# -------
|
||||
@@ -1280,9 +1284,11 @@ m4_define([b4_eval],
|
||||
# b4_symbol_destructor(SYMBOL-NUMBER, DESTRUCTOR, TYPE-NAME)
|
||||
# ----------------------------------------------------------
|
||||
m4_define([b4_symbol_destructor],
|
||||
[m4_pushdef([b4_dollar_dollar], [symbol_value.$3])dnl
|
||||
case $1:
|
||||
b4_eval($2);
|
||||
[m4_pushdef([b4_dollar_dollar], [symbol_value.$6])dnl
|
||||
case $4: /* $3 */
|
||||
#line $2 "$1"
|
||||
b4_eval($5);
|
||||
#line __oline__ "__ofile__"
|
||||
break;
|
||||
m4_popdef([b4_dollar_dollar])])
|
||||
|
||||
|
||||
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