mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
* 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:
@@ -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
|
||||
|
||||
@@ -761,7 +761,7 @@ yyreduce:
|
||||
#endif
|
||||
switch (yyn)
|
||||
{
|
||||
%%action /* The action file replaces this line. */
|
||||
%%action
|
||||
}
|
||||
#line %%line "%%skeleton"
|
||||
|
||||
|
||||
11
src/output.c
11
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user