mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-10 21:03:04 +00:00
* data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
* data/bison.simple, data/bison.c++: Handle the `#define' part, so that we can move to enums for instance. * src/output.c (token_definitions_output): Output a list of `token-name, token-number' instead of the #define. (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
This commit is contained in:
10
src/output.c
10
src/output.c
@@ -568,6 +568,7 @@ void
|
||||
token_definitions_output (FILE *out)
|
||||
{
|
||||
int i;
|
||||
int first = 1;
|
||||
for (i = 0; i < ntokens; ++i)
|
||||
{
|
||||
bucket *symbol = symbols[i];
|
||||
@@ -594,12 +595,13 @@ token_definitions_output (FILE *out)
|
||||
if (strchr (symbol->tag, '.') || strchr (symbol->tag, '$'))
|
||||
continue;
|
||||
|
||||
fprintf (out, "# define %s\t%d\n",
|
||||
symbol->tag, number);
|
||||
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->value);
|
||||
first = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -988,9 +990,9 @@ output_skeleton (void)
|
||||
guards_output (out);
|
||||
fputs ("]])\n\n", out);
|
||||
|
||||
fputs ("m4_define([b4_tokendef], \n[[", out);
|
||||
fputs ("m4_define([b4_tokens], \n[", out);
|
||||
token_definitions_output (out);
|
||||
fputs ("]])\n\n", out);
|
||||
fputs ("])\n\n", out);
|
||||
|
||||
muscles_m4_output (out);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user