From 1c8c2190b103a19937e531752eaffec4f6b6ac8c Mon Sep 17 00:00:00 2001 From: Pascal Bart Date: Tue, 25 Sep 2001 11:36:25 +0000 Subject: [PATCH] * 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. --- ChangeLog | 7 +++++++ src/bison.simple | 2 +- src/output.c | 11 ++++------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index b2db6979..58e969f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-09-25 Pascal Bart + + * 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 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which diff --git a/src/bison.simple b/src/bison.simple index 9c1a8c12..9e094384 100644 --- a/src/bison.simple +++ b/src/bison.simple @@ -761,7 +761,7 @@ yyreduce: #endif switch (yyn) { - %%action /* The action file replaces this line. */ + %%action } #line %%line "%%skeleton" diff --git a/src/output.c b/src/output.c index 37e94f32..2e797250 100644 --- a/src/output.c +++ b/src/output.c @@ -993,11 +993,6 @@ output_parser (const char *skel_filename, struct obstack *oout) 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 @@ output_master_parser (void) else skeleton = skeleton_find ("BISON_SIMPLE", BISON_SIMPLE); } - - obstack_finish (&action_obstack); output_parser (skeleton, &table_obstack); } @@ -1090,6 +1083,9 @@ prepare (void) 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 @@ output (void) obstack_free (&muscle_obstack, 0); obstack_free (&output_obstack, 0); + obstack_free (&action_obstack, 0); } -- 2.45.2