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 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>
return yyresult;
]}
-/* Release the memory associated to SYMBOL-NUMBER. */
+
+/*-------------------------------------------------.
+| Release the memory associated to SYMBOL-NUMBER. |
+`-------------------------------------------------*/
+
m4_divert_push([KILL])# M4 code.
# 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])])
{
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;
}
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;
_("destructor redeclaration for %s"),
symbol_tag_get (symbol));
symbol->destructor = destructor;
+ symbol->destructor_location = location;
}
}
{
/* 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;