Fixed breakage of K&R support in rev.1.8 of output.c: don't generate

#elif.  Cleaned up rev.1.8 a bit more: generate the #include of
<stdio.h> closer to the code that needs it.
This commit is contained in:
Bruce Evans 2000-01-17 01:51:29 +00:00
parent 135adb1eda
commit dd079f6ca5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=56135
2 changed files with 5 additions and 2 deletions

View File

@ -953,8 +953,8 @@ output_debug()
++outline;
fprintf(code_file, "#define YYFINAL %d\n", final_state);
outline += 3;
fprintf(code_file, "#ifndef YYDEBUG\n#define YYDEBUG %d\n", tflag);
fprintf(code_file, "#elif YYDEBUG\n#include <stdio.h>\n#endif\n");
fprintf(code_file, "#ifndef YYDEBUG\n#define YYDEBUG %d\n#endif\n",
tflag);
if (rflag)
fprintf(output_file, "#ifndef YYDEBUG\n#define YYDEBUG %d\n#endif\n",
tflag);

View File

@ -93,6 +93,9 @@ char *tables[] =
char *header[] =
{
"#if YYDEBUG",
"#include <stdio.h>",
"#endif",
"#ifdef YYSTACKSIZE",
"#undef YYMAXDEPTH",
"#define YYMAXDEPTH YYSTACKSIZE",