mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-22 18:53:04 +00:00
multistart: pass the list of start symbols to the backend
* src/output.c (start_symbols_output): New. (muscles_output): Use it.
This commit is contained in:
22
src/output.c
22
src/output.c
@@ -461,6 +461,27 @@ type_names_output (FILE *out)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Define the list of start symbols *if* there are several. Define
|
||||||
|
them by pairs: [START-SYMBOL-NUM, SWITCHING-TOKEN-SYMBOL-NUM]. */
|
||||||
|
static void
|
||||||
|
start_symbols_output (FILE *out)
|
||||||
|
{
|
||||||
|
if (start_symbols && start_symbols->next)
|
||||||
|
{
|
||||||
|
fputs ("m4_define([b4_start_symbols],\n[", out);
|
||||||
|
for (symbol_list *list = start_symbols; list; list = list->next)
|
||||||
|
{
|
||||||
|
const symbol *start = list->content.sym;
|
||||||
|
const symbol *swtok = switching_token (start);
|
||||||
|
fprintf (out, "%s[%d, %d]",
|
||||||
|
list == start_symbols ? "" : ", ",
|
||||||
|
start->content->number, swtok->content->number);
|
||||||
|
}
|
||||||
|
fputs ("])\n\n", out);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*-------------------------------------.
|
/*-------------------------------------.
|
||||||
| The list of all the symbol numbers. |
|
| The list of all the symbol numbers. |
|
||||||
`-------------------------------------*/
|
`-------------------------------------*/
|
||||||
@@ -691,6 +712,7 @@ muscles_output (FILE *out)
|
|||||||
merger_output (out);
|
merger_output (out);
|
||||||
symbol_numbers_output (out);
|
symbol_numbers_output (out);
|
||||||
type_names_output (out);
|
type_names_output (out);
|
||||||
|
start_symbols_output (out);
|
||||||
user_actions_output (out);
|
user_actions_output (out);
|
||||||
/* Must be last. */
|
/* Must be last. */
|
||||||
muscles_m4_output (out);
|
muscles_m4_output (out);
|
||||||
|
|||||||
Reference in New Issue
Block a user