]> granicus.if.org Git - flex/commitdiff
Include start condition symbols in header.
authorJohn Millaway <john43@users.sourceforge.net>
Tue, 13 Aug 2002 21:19:39 +0000 (21:19 +0000)
committerJohn Millaway <john43@users.sourceforge.net>
Tue, 13 Aug 2002 21:19:39 +0000 (21:19 +0000)
main.c

diff --git a/main.c b/main.c
index 6a70aca643b985bce075e6ec418b2f1b22f1ddc4..4e47485918ec106a382e44df76391e50d73c94d4 100644 (file)
--- a/main.c
+++ b/main.c
@@ -564,9 +564,16 @@ int exit_status;
                 nlines++;
             }
 
+            fprintf(header_out,"#line %d \"%s\"\n", (++nlines)+1, headerfilename);
+
+            /* Print the prefixed start conditions. */
+            for (i=1; i <= lastsc; i++)
+                fprintf(header_out, "#define %sSC_%s %d\n",
+                        strcmp(prefix,"yy") ? prefix : "YY",
+                        scname[i], i-1);
+
             /* Kill ALL flex-related macros. This is so the user
              * can #include more than one generated header file. */
-            fprintf(header_out,"#line %d \"%s\"", (++nlines)+1, headerfilename);
             fprintf(header_out,"\n");
             fprintf(header_out,"#undef BEGIN\n");
             fprintf(header_out,"#undef ECHO\n");