]> granicus.if.org Git - re2c/commitdiff
- Issue an error with -f option if multiple /*!re2c blocks are used
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sat, 23 Apr 2005 08:45:10 +0000 (08:45 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sat, 23 Apr 2005 08:45:10 +0000 (08:45 +0000)
code.cc
re2c.1.in

diff --git a/code.cc b/code.cc
index 657c7b6657203b6dd2bf8146c82f85a28deace2b..fb54b95da254d23fecc789a632c4c9598a9b9063 100644 (file)
--- a/code.cc
+++ b/code.cc
@@ -1023,6 +1023,14 @@ void DFA::emit(std::ostream &o)
        State *s;
        uint i;
 
+       bool hasFillLabels = (0<=vFillIndexes);
+       if (hasFillLabels==true && label!=0)
+       {
+               std::cerr << "re2c : error : multiple /*!re2c blocks aren't supported when -f is specified\n";
+               exit(1);
+       }
+
+
        findSCCs();
        head->link = head;
 
@@ -1208,8 +1216,6 @@ void DFA::emit(std::ostream &o)
        vFillIndexes = orgVFillIndexes;
        oline = nOrgOline;
 
-       bool hasFillLabels = (0<=vFillIndexes);
-
        oline++;
        o << "\n#line " << ++oline << " \"" << outputFileName << "\"\n";
 
index f91bf7c9ea7a515aea067971e37c4bfc81f63c95..8d158584b365e64c5adc44b249bf1986471c49d2 100644 (file)
--- a/re2c.1.in
+++ b/re2c.1.in
@@ -7,6 +7,9 @@
 .ds rx regular expression
 .ds lx \fIl\fP-expression
 \"$Log$
+\"Revision 1.16  2005/04/23 08:45:10  helly
+\"- Issue an error with -f option if multiple /*!re2c blocks are used
+\"
 \"Revision 1.15  2005/04/22 22:15:52  helly
 \"- Change original fprintf base -d patch by Derick to use YYDEBUG() lines
 \"
@@ -254,6 +257,10 @@ chunk by chunk. When the scanner runs out of data to consume, it just stores
 its state, and return to the caller. When more input data is fed to the scanner,
 it resumes operations exactly where it left off.
 
+At this point, the -f option only works with "mono-block" re2c scanners:
+if the scanner is described with more than one /*!re2c ... */ block, re2c -f
+fails with an error.
+
 Please see examples/push.re for push-model scanner.
 
 .SH "SCANNER SPECIFICATIONS"