summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJohn Millaway <john43@users.sourceforge.net>2002-03-31 17:17:13 +0000
committerJohn Millaway <john43@users.sourceforge.net>2002-03-31 17:17:13 +0000
commit1f3013d17f4710867a4aea4631b3084ba50b0c8c (patch)
treeef91b7037a95727aeffcd405e7fee82784e61aa2 /main.c
parentdd7984845c99ef0fbde51540a754db3846185108 (diff)
Documented the header file kludge, (in anticipation of buffering Section 1.)
Diffstat (limited to 'main.c')
-rw-r--r--main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/main.c b/main.c
index 28c91b7..16a2f88 100644
--- a/main.c
+++ b/main.c
@@ -199,6 +199,7 @@ void check_options()
use_read = false;
}
+ /* See comments in flexend() for an explanation of this error condition. */
if ( use_stdout && headerfilename )
flexerror( _( "Can't specify header option if writing to stdout.") );
@@ -477,6 +478,16 @@ int exit_status;
skelname );
}
+ /* flex generates the header file by rewinding the output FILE
+ * pointer. However, since we can't rewind stdout, we must disallow
+ * %option header if we are writing to stdout. This is a kludge.
+ * This kludge can be rewritten when we get around to buffering
+ * Section 1 of the input file, because then we'll have seen all the
+ * %options BEFORE we begin generating the scanner. The lack of
+ * buffering causes other problems, too. For example, it is the
+ * reason we currently can't provide a mechanism to allow the user
+ * to inject arbtrary class members into the generated C++ scanner. - JM
+ */
if ( headerfilename && exit_status == 0 && outfile_created && !ferror(stdout))
{
/* Copy the file we just wrote to a header file. */