bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Main] FYI Copy user's action in output parser.


From: Pascal Bart
Subject: [Main] FYI Copy user's action in output parser.
Date: Tue, 25 Sep 2001 13:37:35 +0000 (GMT)

Hello,

        here a patch, which copies the user's actions in {..} in the
output parser.

Index: ChangeLog
===================================================================
RCS file: /cvsroot/bison/bison/ChangeLog,v
retrieving revision 1.221
diff -u -r1.221 ChangeLog
--- ChangeLog   2001/09/23 15:33:14     1.221
+++ ChangeLog   2001/09/25 11:34:40
@@ -1,3 +1,10 @@
+2001-09-25  Pascal Bart  <address@hidden>
+
+       * src/output.c (output_master_parser): Don't finish action_obstack.
+       (output_parser): Don't care about the muscle action, here.
+       (prepare): Copy the action_obstack in the action muscle.
+       (output): Free action_obstack.
+
 2001-09-23  Pascal Bart  <address@hidden>

        * src/reader.c (parse_union_decl): Add new obstack union_obstack.  Which
Index: src/bison.simple
===================================================================
RCS file: /cvsroot/bison/bison/src/bison.simple,v
retrieving revision 1.67
diff -u -r1.67 bison.simple
--- src/bison.simple    2001/09/23 15:33:14     1.67
+++ src/bison.simple    2001/09/25 11:34:40
@@ -761,7 +761,7 @@
 #endif
   switch (yyn)
     {
-      %%action /* The action file replaces this line.  */
+      %%action
     }
 #line %%line "%%skeleton"

Index: src/output.c
===================================================================
RCS file: /cvsroot/bison/bison/src/output.c,v
retrieving revision 1.60
diff -u -r1.60 output.c
--- src/output.c        2001/09/22 21:43:05     1.60
+++ src/output.c        2001/09/25 11:34:40
@@ -993,11 +993,6 @@
            obstack_fgrow1 (oout, "%d", line + 1);
          else if (!strcmp (muscle_key, "input_line"))
            obstack_fgrow1 (oout, "%d", lineno);
-         else if (!strcmp (muscle_key, "action"))
-           {
-             size_t size = obstack_object_size (&action_obstack);
-             obstack_grow (oout, obstack_base (&action_obstack), size);
-           }
          /* FIXME: Insert the code to recognize %%sub-skeleton for exemple.  */
          else
            {
@@ -1027,8 +1022,6 @@
       else
        skeleton = skeleton_find ("BISON_SIMPLE", BISON_SIMPLE);
     }
-
-  obstack_finish (&action_obstack);
   output_parser (skeleton, &table_obstack);
 }

@@ -1090,6 +1083,9 @@

   MUSCLE_INSERT_INT ("locations_flag", locations_flag);

+  /* We need to save the actions in the muscle %%action.  */
+  muscle_insert ("action", obstack_finish (&action_obstack));
+
   if (spec_name_prefix)
     MUSCLE_INSERT_STRING ("prefix", spec_name_prefix);
 }
@@ -1125,4 +1121,5 @@

   obstack_free (&muscle_obstack, 0);
   obstack_free (&output_obstack, 0);
+  obstack_free (&action_obstack, 0);
 }

Pascal Bart (address@hidden)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]