summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJohn Millaway <john43@users.sourceforge.net>2002-08-17 20:04:51 +0000
committerJohn Millaway <john43@users.sourceforge.net>2002-08-17 20:04:51 +0000
commit67bfe789c2818f8709fd05f058f48ae436715575 (patch)
treee26dda5bf292496dc05882068e55aff8a1c0d6ea /main.c
parent063a57d1cd27021f230bca2ce9298377e635fe5d (diff)
Start conditions now optional in header.
undef's now optional in header. Start conditions are NOT prefixed.
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/main.c b/main.c
index 895b5ce..35ddc28 100644
--- a/main.c
+++ b/main.c
@@ -557,13 +557,18 @@ int exit_status;
fprintf(header_out,"#line %d \"%s\"\n", (++nlines)+1, headerfilename);
/* Print the prefixed start conditions. */
+ fprintf(header_out,"#ifdef YY_HEADER_EXPORT_START_CONDITIONS\n");
+ fprintf(header_out,"/* Beware! Start conditions are not prefixed. */\n");
+
for (i=1; i <= lastsc; i++)
- fprintf(header_out, "#define %s %d\n",
- fix_scname(linebuf,scname[i]), i-1);
+ fprintf(header_out, "#define %s %d\n",scname[i], i-1);
+ fprintf(header_out,"#endif /* YY_HEADER_EXPORT_START_CONDITIONS */\n\n");
/* Kill ALL flex-related macros. This is so the user
* can #include more than one generated header file. */
- fprintf(header_out,"\n");
+ fprintf(header_out,"#ifndef YY_HEADER_NO_UNDEFS\n");
+ fprintf(header_out,"/* Undefine all internal macros, etc., that do no belong in the header. */\n\n");
+
fprintf(header_out,"#undef BEGIN\n");
fprintf(header_out,"#undef ECHO\n");
fprintf(header_out,"#undef EOB_ACT_CONTINUE_SCAN\n");
@@ -715,6 +720,7 @@ int exit_status;
for(i=0; i < defs_buf.nelts; i++)
fprintf(header_out, "#undef %s\n", ((char**)defs_buf.elts)[i]);
+ fprintf(header_out,"#endif /* !YY_HEADER_NO_UNDEFS */\n");
fprintf(header_out, "\n");
fprintf(header_out, "#undef %sIN_HEADER\n", prefix);
fprintf(header_out, "#endif /* %sHEADER_H */\n", prefix);