* 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.
This commit is contained in:
Pascal Bart
2001-09-25 11:36:25 +00:00
parent 180d45ba81
commit 1c8c2190b1
3 changed files with 12 additions and 8 deletions

View File

@@ -1,3 +1,10 @@
2001-09-25 Pascal Bart <pascal.bart@epita.fr>
* 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 <pascal.bart@epita.fr>
* src/reader.c (parse_union_decl): Add new obstack union_obstack. Which

View File

@@ -761,7 +761,7 @@ yyreduce:
#endif
switch (yyn)
{
%%action /* The action file replaces this line. */
%%action
}
#line %%line "%%skeleton"

View File

@@ -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);
}