]> git.saurik.com Git - bison.git/commitdiff
* src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
authorAkim Demaille <akim@epita.fr>
Tue, 18 Jun 2002 09:55:35 +0000 (09:55 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 18 Jun 2002 09:55:35 +0000 (09:55 +0000)
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.

ChangeLog
data/bison.simple
src/output.c
src/symtab.c
src/symtab.h

index 96774cbcc21fcd9f97647e31ae31288924366de9..6e1e722c74a75aa2e9a493bf957e17660790f10a 100644 (file)
--- a/ChangeLog
+++ b/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>
 
index 7b48459aab64eab76052e90820f5f4a1019dda04..12710369997aa40016c93a1d2b6d4346b45dd3dd 100644 (file)
@@ -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])])
 
index 78113fd121c426b4e8350c32db9e82c5ae6d9a0e..a2049ce41bbf79f3f18ac679daed5bbb2b24de2d 100644 (file)
@@ -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;
       }
index 0d8e1f494ed9b9c110a393e48b85ecd155fe6c85..655b8fa9cac017b460a0a95dfe4cd09802da9a9a 100644 (file)
@@ -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;
     }
 }
 
index 54ff80fa5db8f07f978338a36d59827be28c9f42..b7cf6be22231e92baaf2ddf0aefb2cf6f671f870 100644 (file)
@@ -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;