X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/133c20e252422fd2f844ef2ea136d6a59281ed7b..1f41899519dcf9dd525b68035baf5bc5ed74efc6:/src/output.c diff --git a/src/output.c b/src/output.c index f8cb5350..676328fb 100644 --- a/src/output.c +++ b/src/output.c @@ -568,30 +568,6 @@ actions_output (FILE *out) } -/*----------------------------. -| Output the guards to OOUT. | -`----------------------------*/ - -void -guards_output (FILE *out) -{ - int rule; - for (rule = 1; rule < nrules + 1; ++rule) - if (rules[rule].guard) - { - fprintf (out, " case %d:\n", rule); - - if (!no_lines_flag) - fprintf (out, muscle_find ("linef"), - rules[rule].guard_line, - quotearg_style (c_quoting_style, - muscle_find ("filename"))); - fprintf (out, "{ %s; }\n break;\n\n", - rules[rule].guard); - } -} - - /*---------------------------------------. | Output the tokens definition to OOUT. | `---------------------------------------*/ @@ -629,10 +605,6 @@ token_definitions_output (FILE *out) fprintf (out, "%s [[[%s]], [%d]]", first ? "" : ",\n", symbol->tag, number); - if (semantic_parser) - /* FIXME: This is probably wrong, and should be just as - above. --akim. */ - fprintf (out, "# define T%s\t%d\n", symbol->tag, symbol->number); first = 0; } } @@ -1020,10 +992,6 @@ output_skeleton (void) actions_output (out); fputs ("]])\n\n", out); - fputs ("m4_define([b4_guards], \n[[", out); - guards_output (out); - fputs ("]])\n\n", out); - fputs ("m4_define([b4_tokens], \n[", out); token_definitions_output (out); fputs ("])\n\n", out); @@ -1092,17 +1060,14 @@ prepare (void) MUSCLE_INSERT_INT ("defines_flag", defines_flag); /* Copy definitions in directive. */ - obstack_1grow (&attrs_obstack, 0); - muscle_insert ("prologue", obstack_finish (&attrs_obstack)); + obstack_1grow (&pre_prologue_obstack, 0); + obstack_1grow (&post_prologue_obstack, 0); + muscle_insert ("pre_prologue", obstack_finish (&pre_prologue_obstack)); + muscle_insert ("post_prologue", obstack_finish (&post_prologue_obstack)); /* Find the right skeleton file. */ if (!skeleton) - { - if (semantic_parser) - skeleton = "bison.hairy"; - else - skeleton = "bison.simple"; - } + skeleton = "bison.simple"; /* Parse the skeleton file and output the needed parsers. */ muscle_insert ("skeleton", skeleton); @@ -1131,5 +1096,6 @@ output (void) obstack_free (&muscle_obstack, NULL); obstack_free (&format_obstack, NULL); obstack_free (&action_obstack, NULL); - obstack_free (&attrs_obstack, NULL); + obstack_free (&pre_prologue_obstack, NULL); + obstack_free (&post_prologue_obstack, NULL); }