From: helly Date: Sat, 23 Apr 2005 08:45:10 +0000 (+0000) Subject: - Issue an error with -f option if multiple /*!re2c blocks are used X-Git-Tag: 0.13.6~645 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=554a99934f9a14812abb02f0633dd6c2c2162ff8;p=re2c - Issue an error with -f option if multiple /*!re2c blocks are used --- diff --git a/code.cc b/code.cc index 657c7b66..fb54b95d 100644 --- 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"; diff --git a/re2c.1.in b/re2c.1.in index f91bf7c9..8d158584 100644 --- 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"