]> granicus.if.org Git - re2c/commitdiff
- Generic fix for oline generation (by providing specialized ostream whose
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sat, 21 Jan 2006 15:51:02 +0000 (15:51 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Sat, 21 Jan 2006 15:51:02 +0000 (15:51 +0000)
  stream_buffer count '\n's)
- Change re2c:startlabel to 0 (makes more sense and results in clean code)

59 files changed:
Makefile.am
bootstrap/parser.cc
bootstrap/scanner.cc
code.cc
code.h
dfa.cc
globals.h
main.cc
parser.h
parser.y
re.h
re2c-2005.vcproj
re2c.1.in
re2c.vcproj
scanner.h
scanner.re
substr.cc
test/bug1054496.c
test/bug1163046.c
test/bug1187785.c
test/bug1297658.c
test/bug1390174.c
test/c.c
test/cmmap.c
test/cnokw.c
test/config1.c
test/config2.s.c
test/config3.c
test/ctx.b.c
test/ctx.c
test/ctx.s.c
test/cunroll.c
test/cvsignore.b.c
test/cvsignore.c
test/cvsignore.s.c
test/cvsignore.w.c
test/cvsignore.wb.c
test/error3.c
test/input1.c
test/input10.b.c
test/input10.c
test/input10.s.c
test/input11.b.c
test/input11.c
test/input11.s.c
test/input2.c
test/input3.c
test/input4.c
test/input5.c
test/input6.c
test/input7.c
test/input8.c
test/input9.c
test/modula.c
test/push.re
test/repeater.c
test/sample.c
test/scanner.c
test/simple.c

index 726b537c0f0c261496179ee663bc24df8ab4a7de..0c96da5f5acc129c1b5217e2ce917cbbf29ac19c 100755 (executable)
@@ -4,7 +4,7 @@ bin_PROGRAMS = re2c
 re2c_SOURCES = code.cc dfa.cc main.cc parser.cc actions.cc scanner.re substr.cc\
        translate.cc scanner.cc mbo_getopt.cc \
        basics.h dfa.h globals.h ins.h parser.h re.h scanner.h \
-       substr.h token.h mbo_getopt.h code.h
+       substr.h token.h mbo_getopt.h code.h stream_lc.h
 BUILT_SOURCES = parser.cc scanner.cc
 
 man_MANS     = re2c.1
index e5257a2454ba8c12deafa44b49cecc39efc14060..b1c4e0041814c9c09d9baaed2ecfe1f63a63afab 100644 (file)
@@ -1611,53 +1611,24 @@ int yylex(){
 namespace re2c
 {
 
-void line_source(unsigned int line, std::ostream& o)
+void parse(Scanner& i, std::ostream& o)
 {
-       if (iFlag)
-       {
-               return;
-       }
-
-       o << "#line " << line << " \"";
-       
-       if (fileName == NULL)
-       {
-               o << "<stdin>";
-       }
-
-       std::string fname(fileName);
-       
-       for (size_t p = 0; p < fname.length(); ++p)
-       {
-               if (fname[p] == '\\')
-               {
-                       fname.insert(++p, "\\");
-               }
-       }
-       o << fname << "\"\n";
-       ++oline;
-}
-
-void parse(std::istream& i, std::ostream &o){
+       in = &i;
 
        o << "/* Generated by re2c " PACKAGE_VERSION " on ";
        time_t now = time(&now);
        o.write(ctime(&now), 24);
        o << " */\n";
-       oline += 2;
-       
-       in = new Scanner(i);
-       
-       line_source(in->line(), o);
+       o << sourceFileInfo;
        
-       while(in->echo(o))
+       while(i.echo(o))
        {
                yyparse();
                if(spec)
                {
                        genCode(o, topIndent, spec);
                }
-               line_source(in->line(), o);
+               o << sourceFileInfo;
        }
 }
 
index 515e38e9b0c06919a62053b4a703fb9abb716f68..1e4916db8cbfc9b90e2a8b5992a9823f0c7d5571 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.10.0.dev on Fri Jan 20 21:46:02 2006 */
+/* Generated by re2c 0.10.0.dev on Sat Jan 21 16:15:00 2006 */
 #line 1 "scanner.re"
 /* $Id$ */
 #include <stdlib.h>
@@ -92,7 +92,6 @@ echo:
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
        if((YYLIMIT - YYCURSOR) < 11) YYFILL(11);
        yych = *YYCURSOR;
        if(yych <= ')') {
@@ -111,7 +110,7 @@ yy3:
        {
                                        goto echo;
                                }
-#line 115 "scanner.cc"
+#line 114 "scanner.cc"
 yy4:
        yych = *++YYCURSOR;
        if(yych == '/') goto yy10;
@@ -121,10 +120,10 @@ yy5:
 #line 126 "scanner.re"
        {
                                        out.write((const char*)(tok), (const char*)(cursor) - (const char*)(tok));
-                                       tok = pos = cursor; cline++; oline++;
+                                       tok = pos = cursor; cline++;
                                        goto echo;
                                }
-#line 128 "scanner.cc"
+#line 127 "scanner.cc"
 yy7:
        ++YYCURSOR;
 #line 131 "scanner.re"
@@ -134,7 +133,7 @@ yy7:
                                                RETURN(0);
                                        }
                                }
-#line 138 "scanner.cc"
+#line 137 "scanner.cc"
 yy9:
        yych = *++YYCURSOR;
        goto yy3;
@@ -150,7 +149,7 @@ yy10:
                                        tok = pos = cursor;
                                        goto echo;
                                }
-#line 154 "scanner.cc"
+#line 153 "scanner.cc"
 yy12:
        yych = *++YYCURSOR;
        if(yych == '!') goto yy14;
@@ -182,7 +181,7 @@ yy16:
                                        tok = cursor;
                                        RETURN(1);
                                }
-#line 186 "scanner.cc"
+#line 185 "scanner.cc"
 yy21:
        yych = *++YYCURSOR;
        if(yych != 'x') goto yy13;
@@ -204,7 +203,7 @@ yy21:
                                        ignore_eoc = true;
                                        goto echo;
                                }
-#line 208 "scanner.cc"
+#line 207 "scanner.cc"
 }
 #line 140 "scanner.re"
 
@@ -229,7 +228,7 @@ scan:
                goto value;
     }
 
-#line 233 "scanner.cc"
+#line 232 "scanner.cc"
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
@@ -307,14 +306,14 @@ yy32:
        { depth = 1;
                                  goto code;
                                }
-#line 311 "scanner.cc"
+#line 310 "scanner.cc"
 yy33:
        ++YYCURSOR;
        if((yych = *YYCURSOR) == '*') goto yy92;
 yy34:
 #line 192 "scanner.re"
        { RETURN(*tok); }
-#line 318 "scanner.cc"
+#line 317 "scanner.cc"
 yy35:
        ++YYCURSOR;
        if((yych = *YYCURSOR) == '/') goto yy90;
@@ -322,7 +321,7 @@ yy36:
 #line 194 "scanner.re"
        { yylval.op = *tok;
                                  RETURN(CLOSE); }
-#line 326 "scanner.cc"
+#line 325 "scanner.cc"
 yy37:
        yyaccept = 1;
        yych = *(YYMARKER = ++YYCURSOR);
@@ -330,7 +329,7 @@ yy37:
 yy38:
 #line 179 "scanner.re"
        { fatal("unterminated string constant (missing \")"); }
-#line 334 "scanner.cc"
+#line 333 "scanner.cc"
 yy39:
        yyaccept = 2;
        yych = *(YYMARKER = ++YYCURSOR);
@@ -338,7 +337,7 @@ yy39:
 yy40:
 #line 180 "scanner.re"
        { fatal("unterminated string constant (missing ')"); }
-#line 342 "scanner.cc"
+#line 341 "scanner.cc"
 yy41:
        yyaccept = 3;
        yych = *(YYMARKER = ++YYCURSOR);
@@ -348,7 +347,7 @@ yy41:
 yy42:
 #line 190 "scanner.re"
        { fatal("unterminated range (missing ])"); }
-#line 352 "scanner.cc"
+#line 351 "scanner.cc"
 yy43:
        yych = *++YYCURSOR;
        goto yy34;
@@ -364,7 +363,7 @@ yy46:
        { cur = cursor;
                                  yylval.symbol = Symbol::find(token());
                                  return ID; }
-#line 368 "scanner.cc"
+#line 367 "scanner.cc"
 yy47:
        yych = *++YYCURSOR;
        goto yy61;
@@ -375,7 +374,7 @@ yy48:
                                  yylval.regexp = mkDot();
                                  return RANGE;
                                }
-#line 379 "scanner.cc"
+#line 378 "scanner.cc"
 yy50:
        ++YYCURSOR;
        yych = *YYCURSOR;
@@ -383,7 +382,7 @@ yy50:
 yy51:
 #line 230 "scanner.re"
        { goto scan; }
-#line 387 "scanner.cc"
+#line 386 "scanner.cc"
 yy52:
        ++YYCURSOR;
 yy53:
@@ -392,7 +391,7 @@ yy53:
                                  pos = cursor; cline++;
                                  goto scan;
                                }
-#line 396 "scanner.cc"
+#line 395 "scanner.cc"
 yy54:
        ++YYCURSOR;
        if((yych = *YYCURSOR) == 0x0A) goto yy57;
@@ -410,7 +409,7 @@ yy55:
                                  }
                                  goto scan;
                                }
-#line 414 "scanner.cc"
+#line 413 "scanner.cc"
 yy56:
        yych = *++YYCURSOR;
        goto yy55;
@@ -495,7 +494,7 @@ yy69:
                                  yylval.str = new Str(token());
                                  return CONFIG;
                                }
-#line 499 "scanner.cc"
+#line 498 "scanner.cc"
 yy70:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -533,7 +532,7 @@ yy75:
        { cur = cursor;
                                  yylval.regexp = ranToRE(token());
                                  return RANGE; }
-#line 537 "scanner.cc"
+#line 536 "scanner.cc"
 yy77:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -546,7 +545,7 @@ yy78:
        { cur = cursor;
                                  yylval.regexp = invToRE(token());
                                  return RANGE; }
-#line 550 "scanner.cc"
+#line 549 "scanner.cc"
 yy80:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -570,7 +569,7 @@ yy83:
        { cur = cursor;
                                  yylval.regexp = strToCaseInsensitiveRE(token());
                                  return STRING; }
-#line 574 "scanner.cc"
+#line 573 "scanner.cc"
 yy85:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -594,19 +593,19 @@ yy88:
        { cur = cursor;
                                  yylval.regexp = strToRE(token());
                                  return STRING; }
-#line 598 "scanner.cc"
+#line 597 "scanner.cc"
 yy90:
        ++YYCURSOR;
 #line 168 "scanner.re"
        { tok = cursor;
                                  RETURN(0); }
-#line 604 "scanner.cc"
+#line 603 "scanner.cc"
 yy92:
        ++YYCURSOR;
 #line 165 "scanner.re"
        { depth = 1;
                                  goto comment; }
-#line 610 "scanner.cc"
+#line 609 "scanner.cc"
 yy94:
        yych = *++YYCURSOR;
        if(yych == ',') goto yy108;
@@ -629,14 +628,14 @@ yy97:
 yy98:
 #line 212 "scanner.re"
        { fatal("illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers"); }
-#line 633 "scanner.cc"
+#line 632 "scanner.cc"
 yy99:
        ++YYCURSOR;
 #line 200 "scanner.re"
        { yylval.extop.minsize = atoi((char *)tok+1);
                                  yylval.extop.maxsize = atoi((char *)tok+1);
                                  RETURN(CLOSESIZE); }
-#line 640 "scanner.cc"
+#line 639 "scanner.cc"
 yy101:
        yyaccept = 6;
        yych = *(YYMARKER = ++YYCURSOR);
@@ -648,7 +647,7 @@ yy101:
        { yylval.extop.minsize = atoi((char *)tok+1);
                                  yylval.extop.maxsize = -1;
                                  RETURN(CLOSESIZE); }
-#line 652 "scanner.cc"
+#line 651 "scanner.cc"
 yy104:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -661,7 +660,7 @@ yy104:
        { yylval.extop.minsize = atoi((char *)tok+1);
                                  yylval.extop.maxsize = MAX(yylval.extop.minsize,atoi(strchr((char *)tok, ',')+1));
                                  RETURN(CLOSESIZE); }
-#line 665 "scanner.cc"
+#line 664 "scanner.cc"
 yy108:
        yyaccept = 6;
        yych = *(YYMARKER = ++YYCURSOR);
@@ -672,14 +671,14 @@ yy108:
 #line 197 "scanner.re"
        { yylval.op = '*';
                                  RETURN(CLOSE); }
-#line 676 "scanner.cc"
+#line 675 "scanner.cc"
 }
 #line 249 "scanner.re"
 
 
 code:
 
-#line 683 "scanner.cc"
+#line 682 "scanner.cc"
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
@@ -710,13 +709,13 @@ code:
                                        return CODE;
                                  }
                                  goto code; }
-#line 714 "scanner.cc"
+#line 713 "scanner.cc"
 yy115:
        ++YYCURSOR;
 #line 259 "scanner.re"
        { ++depth;
                                  goto code; }
-#line 720 "scanner.cc"
+#line 719 "scanner.cc"
 yy117:
        ++YYCURSOR;
 #line 261 "scanner.re"
@@ -724,13 +723,13 @@ yy117:
                                  pos = cursor; cline++;
                                  goto code;
                                }
-#line 728 "scanner.cc"
+#line 727 "scanner.cc"
 yy119:
        ++YYCURSOR;
 yy120:
 #line 265 "scanner.re"
        { goto code; }
-#line 734 "scanner.cc"
+#line 733 "scanner.cc"
 yy121:
        yyaccept = 0;
        yych = *(YYMARKER = ++YYCURSOR);
@@ -787,7 +786,7 @@ yy128:
 
 comment:
 
-#line 791 "scanner.cc"
+#line 790 "scanner.cc"
 {
        YYCTYPE yych;
        if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
@@ -807,7 +806,7 @@ yy133:
 #line 281 "scanner.re"
        { if(cursor == eof) RETURN(0);
                                  goto comment; }
-#line 811 "scanner.cc"
+#line 810 "scanner.cc"
 yy134:
        yych = *++YYCURSOR;
        if(yych == '*') goto yy138;
@@ -819,7 +818,7 @@ yy135:
                                  tok = pos = cursor; cline++;
                                  goto comment;
                                }
-#line 823 "scanner.cc"
+#line 822 "scanner.cc"
 yy137:
        yych = *++YYCURSOR;
        goto yy133;
@@ -829,7 +828,7 @@ yy138:
        { ++depth;
                                  fatal("ambiguous /* found");
                                  goto comment; }
-#line 833 "scanner.cc"
+#line 832 "scanner.cc"
 yy140:
        ++YYCURSOR;
 #line 270 "scanner.re"
@@ -837,14 +836,14 @@ yy140:
                                        goto scan;
                                    else
                                        goto comment; }
-#line 841 "scanner.cc"
+#line 840 "scanner.cc"
 }
 #line 283 "scanner.re"
 
 
 config:
 
-#line 848 "scanner.cc"
+#line 847 "scanner.cc"
 {
        YYCTYPE yych;
        if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
@@ -863,7 +862,7 @@ yy144:
 yy145:
 #line 287 "scanner.re"
        { goto config; }
-#line 867 "scanner.cc"
+#line 866 "scanner.cc"
 yy146:
        ++YYCURSOR;
        yych = *YYCURSOR;
@@ -874,12 +873,12 @@ yy147:
                                  cur = cursor;
                                  RETURN('='); 
                                }
-#line 878 "scanner.cc"
+#line 877 "scanner.cc"
 yy148:
        ++YYCURSOR;
 #line 292 "scanner.re"
        { fatal("missing '='"); }
-#line 883 "scanner.cc"
+#line 882 "scanner.cc"
 yy150:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -902,7 +901,7 @@ yy153:
 
 value:
 
-#line 906 "scanner.cc"
+#line 905 "scanner.cc"
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
@@ -942,7 +941,7 @@ yy156:
                                  iscfg = 0;
                                  return VALUE;
                                }
-#line 946 "scanner.cc"
+#line 945 "scanner.cc"
 yy157:
        ++YYCURSOR;
        if((yych = *YYCURSOR) <= 0x0D) {
@@ -963,7 +962,7 @@ yy158:
                                  iscfg = 0;
                                  return NUMBER;
                                }
-#line 967 "scanner.cc"
+#line 966 "scanner.cc"
 yy159:
        yych = *++YYCURSOR;
        if(yych <= '0') goto yy163;
diff --git a/code.cc b/code.cc
index 24b5e1c64aa0f076dc85ac2cee0d39450a3f2a3e..d913fa6ab6816383c6bf43088c827cc18eabd955 100644 (file)
--- a/code.cc
+++ b/code.cc
@@ -229,7 +229,6 @@ void BitMap::gen(std::ostream &o, uint ind, uint lb, uint ub)
                                if (j % 8 == 0)
                                {
                                        o << "\n" << indent(ind+1);
-                                       ++oline;
                                }
 
                                if (yybmHexTable)
@@ -245,7 +244,6 @@ void BitMap::gen(std::ostream &o, uint ind, uint lb, uint ub)
                }
 
                o << "\n" << indent(ind) << "};\n";
-               oline += 2;
        }
 }
 
@@ -269,12 +267,10 @@ void genGoTo(std::ostream &o, uint ind, const State *from, const State *to, bool
        if (readCh && from->label + 1 != to->label)
        {
                o << indent(ind) << "yych = *YYCURSOR;\n";
-               ++oline;
                readCh = false;
        }
 
        o << indent(ind) << "goto yy" << to->label << ";\n";
-       ++oline;
        vUsedLabels.insert(to->label);
 }
 
@@ -304,7 +300,6 @@ static void need(std::ostream &o, uint ind, uint n, bool & readCh)
        {
                fillIndex = vFillIndexes++;
                o << indent(ind) << "YYSETSTATE(" << fillIndex << ");\n";
-               ++oline;
        }
        else
        {
@@ -314,23 +309,19 @@ static void need(std::ostream &o, uint ind, uint n, bool & readCh)
        if (n == 1)
        {
                o << indent(ind) << "if(YYLIMIT == YYCURSOR) YYFILL(1);\n";
-               ++oline;
        }
        else
        {
                o << indent(ind) << "if((YYLIMIT - YYCURSOR) < " << n << ") YYFILL(" << n << ");\n";
-               ++oline;
        }
 
        if ( hasFillIndex == true )
        {
                o << "yyFillLabel" << fillIndex << ":\n";
-               ++oline;
        }
 
        o << indent(ind) << "yych = *YYCURSOR;\n";
        readCh = false;
-       ++oline;
 }
 
 void Match::emit(std::ostream &o, uint ind, bool &readCh) const
@@ -351,8 +342,6 @@ void Match::emit(std::ostream &o, uint ind, bool &readCh) const
                readCh = false;
        }
 
-       ++oline;
-
        if (state->link)
        {
                need(o, ind, state->depth, readCh);
@@ -364,11 +353,9 @@ void Enter::emit(std::ostream &o, uint ind, bool &readCh) const
        if (state->link)
        {
                o << indent(ind) << "++YYCURSOR;\n";
-               oline++;
                if (vUsedLabels.count(label))
                {
                        o << "yy" << label << ":\n";
-                       oline++;
                }
                need(o, ind, state->depth, readCh);
        }
@@ -376,11 +363,9 @@ void Enter::emit(std::ostream &o, uint ind, bool &readCh) const
        {
                /* we shouldn't need 'rule-following' protection here */
                o << indent(ind) << "yych = *++YYCURSOR;\n";
-               oline++;
                if (vUsedLabels.count(label))
                {
                        o << "yy" << label << ":\n";
-                       oline++;
                }
                readCh = false;
        }
@@ -391,12 +376,14 @@ void Initial::emit(std::ostream &o, uint ind, bool &readCh) const
        if (!startLabelName.empty())
        {
                o << startLabelName << ":\n";
-               oline++;
        }
        if (vUsedLabels.count(label))
        {
                o << "yy" << label << ":\n";
-               oline++;
+       }
+       else if (!label)
+       {
+               o << "\n";
        }
        if (state->link)
        {
@@ -413,19 +400,16 @@ void Save::emit(std::ostream &o, uint ind, bool &readCh) const
        if (bUsedYYAccept)
        {
                o << indent(ind) << "yyaccept = " << selector << ";\n";
-               ++oline;
        }
 
        if (state->link)
        {
                o << indent(ind) << "YYMARKER = ++YYCURSOR;\n";
-               ++oline;
                need(o, ind, state->depth, readCh);
        }
        else
        {
                o << indent(ind) << "yych = *(YYMARKER = ++YYCURSOR);\n";
-               ++oline;
                readCh = false;
        }
 }
@@ -459,7 +443,6 @@ void Accept::emit(std::ostream &o, uint ind, bool &readCh) const
                                bUsedYYAccept = true;
                                o << indent(ind) << "YYCURSOR = YYMARKER;\n";
                                o << indent(ind) << "switch(yyaccept){\n";
-                               oline += 2;
                        }
 
                        o << indent(ind) << "case " << saves[i] << ":";
@@ -469,7 +452,6 @@ void Accept::emit(std::ostream &o, uint ind, bool &readCh) const
        if (!first)
        {
                o << indent(ind) << "}\n";
-               ++oline;
        }
 }
 
@@ -485,21 +467,15 @@ void Rule::emit(std::ostream &o, uint ind, bool &) const
        if (back != 0u)
        {
                o << indent(ind) << "YYCURSOR = yyctxmarker;\n";
-               oline++;
        }
 
-       line_source(rule->code->line, o);
+       RuleLine rl(*rule);
+
+       o << file_info(sourceFileInfo, &rl);
        o << indent(ind);
        o << rule->code->text;
-       // Counting the oline's is done by SubStr::out()
        o << "\n";
-       ++oline;
-       if (!iFlag)
-       {
-               o << "#line " << oline++ << " \"" << outputFileName << "\"\n";
-               //    o << "\n#line " << rule->code->line
-               //      << "\n\t" << rule->code->text << "\n";
-       }
+       o << outputFileInfo;
 }
 
 void doLinear(std::ostream &o, uint ind, Span *s, uint n, const State *from, const State *next, bool &readCh, uint mask)
@@ -589,7 +565,6 @@ bool genCases(std::ostream &o, uint ind, uint lb, Span *s, bool &newLine, uint m
        if (!newLine)
        {
                o << "\n";
-               ++oline;
        }
        newLine = true;
        if (lb < s->ub)
@@ -611,7 +586,6 @@ bool genCases(std::ostream &o, uint ind, uint lb, Span *s, bool &newLine, uint m
                        }
 
                        o << "\n";
-                       ++oline;
                        newLine = true;
                }
        }
@@ -644,7 +618,6 @@ void Go::genSwitch(std::ostream &o, uint ind, const State *from, const State *ne
                if (dFlag)
                {
                        o << indent(ind) << "YYDEBUG(-1, yych);\n";
-                       ++oline;
                }
 
                if (readCh)
@@ -657,8 +630,6 @@ void Go::genSwitch(std::ostream &o, uint ind, const State *from, const State *ne
                        o << indent(ind) << "switch(yych){\n";
                }
 
-               ++oline;
-
                while (t != &sP[0])
                {
                        bool used = false;
@@ -699,7 +670,6 @@ void Go::genSwitch(std::ostream &o, uint ind, const State *from, const State *ne
                o << indent(ind) << "default:";
                genGoTo(o, 1, from, def, readCh);
                o << indent(ind) << "}\n";
-               ++oline;
 
                delete [] sP;
        }
@@ -717,13 +687,10 @@ void doBinary(std::ostream &o, uint ind, Span *s, uint n, const State *from, con
 
                genIf(o, ind, "<=", s[h - 1].ub - 1, readCh);
                o << "{\n";
-               ++oline;
                doBinary(o, ind+1, &s[0], h, from, next, readCh, mask);
                o << indent(ind) << "} else {\n";
-               ++oline;
                doBinary(o, ind+1, &s[h], n - h, from, next, readCh, mask);
                o << indent(ind) << "}\n";
-               ++oline;
        }
 }
 
@@ -837,13 +804,10 @@ void Go::genGoto(std::ostream &o, uint ind, const State *from, const State *next
                                                if (readCh)
                                                {
                                                        o << indent(ind) << "yych = *YYCURSOR;\n";
-                                                       oline++;
                                                        readCh = false;
                                                }
                                                sYych = "yych";
                                                o << indent(ind) << "if(yyh & 0xFF00) {\n";
-                                               oline++;
-                                               /* here we need to reduce to those having high byte set */
                                                genBase(o, ind+1, from, next, readCh, 1);
                                                o << indent(ind) << "} else ";
                                        }
@@ -868,10 +832,8 @@ void Go::genGoto(std::ostream &o, uint ind, const State *from, const State *next
                                                o << (uint) b->m;
                                        }
                                        o << ") {\n";
-                                       oline++;
                                        genGoTo(o, ind+1, from, to, readCh);
                                        o << indent(ind) << "}\n";
-                                       oline++;
                                        go.genBase(o, ind, from, next, readCh, 0);
                                        delete [] go.span;
                                        return ;
@@ -888,17 +850,14 @@ void State::emit(std::ostream &o, uint ind, bool &readCh) const
        if (vUsedLabels.count(label))
        {
                o << "yy" << label << ":\n";
-               oline++;
        }
        if (dFlag)
        {
                o << indent(ind) << "YYDEBUG(" << label << ", *YYCURSOR);\n";
-               oline++;
        }
        if (isPreCtxt)
        {
                o << indent(ind) << "yyctxmarker = YYCURSOR + 1;\n";
-               oline++;
                bUsedCtxMarker = true;
        }
        action->emit(o, ind, readCh);
@@ -1357,7 +1316,6 @@ void DFA::emit(std::ostream &o, uint ind)
        if (bFlag)
        {
                o << indent(ind++) << "{\n";
-               ++oline;
                bitmap_brace = 1;
                BitMap::gen(o, ind, lbChar, ubChar <= 256 ? ubChar : 256);
        }
@@ -1381,49 +1339,38 @@ void DFA::emit(std::ostream &o, uint ind)
                s->label = label++;
        }
 
-       null_stream noWhere;
-       unsigned int nOrgOline = oline;
        uint maxFillIndexes = vFillIndexes;
        uint orgVFillIndexes = vFillIndexes;
+       null_stream  null_dev;
 
        for (s = head; s; s = s->next)
        {
                bool readCh = false;
-               s->emit(noWhere, ind, readCh);
-               s->go.genGoto(noWhere, ind, s, s->next, readCh);
+               s->emit(null_dev, ind, readCh);
+               s->go.genGoto(null_dev, ind, s, s->next, readCh);
        }
        maxFillIndexes = vFillIndexes;
        vFillIndexes = orgVFillIndexes;
-       oline = nOrgOline;
 
-       o << "\n";
-       ++oline;
-       if (!iFlag)
-       {
-               o << "#line " << oline++ << " \"" << outputFileName << "\"\n";
-       }
+       o << "\n" << outputFileInfo;
 
        if (hasFillLabels == false)
        {
                o << indent(ind++) << "{\n";
                o << indent(ind) << "YYCTYPE yych;\n";
-               oline += 2;
                if (bUsedYYAccept)
                {
                        o << indent(ind) << "unsigned int yyaccept = 0;\n";
-                       oline++;
                }
        }
        else
        {
                o << indent(ind++) << "{\n\n";
-               oline += 2;
        }
 
        if (bUsedCtxMarker)
        {
                o << indent(ind) << "YYCTYPE *yyctxmarker = YYCURSOR;\n";
-               ++oline;
        }
 
        if (hasFillLabels == true)
@@ -1441,9 +1388,6 @@ void DFA::emit(std::ostream &o, uint ind)
                o << indent(ind) << "default: /* abort() */;\n";
                o << indent(ind) << "}\n";
                o << "yyNext:\n";
-
-               oline += maxFillIndexes;
-               oline += 6;
        }
 
        for (s = head; s; s = s->next)
@@ -1454,11 +1398,9 @@ void DFA::emit(std::ostream &o, uint ind)
        }
 
        o << indent(--ind) << "}\n";
-       ++oline;
        if (bitmap_brace)
        {
                o << indent(--ind) << "}\n";
-               ++oline;
        }
 
        if (BitMap::first)
@@ -1473,6 +1415,20 @@ void DFA::emit(std::ostream &o, uint ind)
        bUseStartLabel = false;
 }
 
+std::ostream& operator << (std::ostream& o, const file_info& li)
+{
+       if (li.ln)
+       {
+               o << "#line " << li.ln->get_line() << " \"" << li.fname << "\"\n";
+       }
+       return o;
+}
+
+uint Scanner::get_line() const
+{
+       return cline;
+}
+
 void Scanner::config(const Str& cfg, int num)
 {
        if (cfg.to_string() == "indent:top")
diff --git a/code.h b/code.h
index b764315747b638fde830c9eb7087805ac8cb941a..12b735e50c2783475f005174ff75a2c31a9221f7 100755 (executable)
--- a/code.h
+++ b/code.h
@@ -44,52 +44,10 @@ public:
 #endif
 };
 
-template<class char_t>
-class basic_null_streambuf
-       : public std::basic_streambuf<char_t>
-{
-public:
-       basic_null_streambuf()
-               : std::basic_streambuf<char_t>()
-       {
-       }       
-};
-
 #ifdef _MSC_VER
 # pragma warning(disable: 4355) /* 'this' : used in base member initializer list */
 #endif
 
-template<class char_t>
-class basic_null_stream
-       : protected basic_null_streambuf<char_t>
-       , public std::basic_ostream<char_t>
-{
-public:
-       basic_null_stream()
-               : basic_null_streambuf<char_t>()
-               , std::basic_ostream<char_t>(static_cast<basic_null_streambuf<char_t>*>(this))
-       {
-       }
-
-       basic_null_stream& put(char_t)
-       {
-               // nothing to do
-               return *this;
-       }
-       
-       basic_null_stream& write(const char_t *, std::streamsize)
-       {
-               // nothing to do
-               return *this;
-       }
-};
-
-#ifdef _MSC_VER
-# pragma warning(default: 4355)
-#endif
-
-typedef basic_null_stream<char> null_stream;
-
 } // end namespace re2c
 
 #endif
diff --git a/dfa.cc b/dfa.cc
index 68ab6b79991f0d559068a50dff94b7ba1a3ed902..2d3779f48a1ef3d049bc9e757a1d63a33449a3f3 100644 (file)
--- a/dfa.cc
+++ b/dfa.cc
@@ -44,7 +44,7 @@ void prtHex(std::ostream& o, uint c, bool useTalx)
        }
 }
 
-void prtCh(std::ostream &o, uint c, bool useTalx)
+void prtCh(std::ostreamo, uint c, bool useTalx)
 {
        int oc = (int)(re2c::wFlag || !useTalx ? c : re2c::talx[c]);
 
@@ -107,7 +107,7 @@ void prtCh(std::ostream &o, uint c, bool useTalx)
        }
 }
 
-void printSpan(std::ostream &o, uint lb, uint ub)
+void printSpan(std::ostreamo, uint lb, uint ub)
 {
        if (lb > ub)
        {
@@ -152,8 +152,6 @@ std::ostream& operator<<(std::ostream &o, const State &s)
 
        o << "\n";
 
-       ++oline;
-
        uint lb = 0;
 
        for (uint i = 0; i < s.go.nSpans; ++i)
@@ -169,7 +167,6 @@ std::ostream& operator<<(std::ostream &o, const DFA &dfa)
        for (State *s = dfa.head; s; s = s->next)
        {
                o << s << "\n\n";
-               ++oline;
        }
 
        return o;
index 18b590b79e47b9485b8e8cd81f73293f53604acd..d9e2b5116abbd38b03342c37b3d15ad2448f6b9f 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -6,12 +6,14 @@
 #include <set>
 #include <algorithm>
 #include <string>
+#include "stream_lc.h"
 
 namespace re2c
 {
 
-extern const char *fileName;
-extern const char *outputFileName;
+extern file_info sourceFileInfo;
+extern file_info outputFileInfo;
+
 extern bool bFlag;
 extern bool dFlag;
 extern bool eFlag;
@@ -23,7 +25,6 @@ extern bool bUsedYYAccept;
 extern bool bUsedCtxMarker;
 extern bool bUseStartLabel;
 extern std::string startLabelName;
-extern unsigned int oline;
 extern uint maxFill;
 
 /* configurations */
diff --git a/main.cc b/main.cc
index 5e1a6e8669bdf694d16f2c2692adfddac92cd199..0f53af34a67f6eb04534addd389e2b94d15041ab 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -19,18 +19,22 @@ namespace re2c
 {
 
 const char *fileName = 0;
+file_info sourceFileInfo;
 const char *outputFileName = 0;
+file_info outputFileInfo;
+std::ostream *output;
+
 bool bFlag = false;
 bool dFlag = false;
 bool eFlag = false;
 bool iFlag = false;
 bool sFlag = false;
 bool wFlag = false;
+
 bool bUsedYYAccept = false;
 bool bUsedCtxMarker= false;
-bool bUseStartLabel= true;
+bool bUseStartLabel= false;
 std::string startLabelName;
-unsigned int oline = 1;
 uint maxFill = 1;
 
 uint topIndent = 0;
@@ -231,46 +235,39 @@ int main(int argc, char *argv[])
        }
 
        // set up the output stream
-       ostream* output = 0;
-
-       ofstream outputFile;
+       ofstream_lc outputFile;
 
        if (outputFileName == 0 || (fileName[0] == '-' && fileName[1] == '\0'))
        {
                outputFileName = "<stdout>";
-               output = &cout;
+               outputFile.open(stdout);
+               output = &outputFile;
        }
        else
        {
                outputFile.open(outputFileName);
+               output = &outputFile;
 
                if (!outputFile)
                {
                        cerr << "can't open " << outputFileName << "\n";
                        return 1;
                }
+       }
 
-               output = &outputFile;
-               
-               int len = strlen(outputFileName);
-               char *tmp = (char*)malloc((len+1)*2);
-               char *dst = tmp;
+       if (fileName == NULL)
+       {
+               fileName = "<stdin>";
+       }
 
-               for (const char *src = outputFileName; *src; ++src)
-               {
-                       if (*src == '\\')
-                       {
-                               *dst++ = *src;
-                       }
-                       *dst++ = *src;
-               }
-               *dst = '\0';
-               
-               outputFileName = tmp;
+       Scanner in(*input);
+       
+       if (!iFlag)
+       {
+               sourceFileInfo = file_info(fileName, &in);
+               outputFileInfo = file_info(outputFileName, &outputFile);
        }
 
-       parse(*input, *output);
+       parse(in, *output);
        return 0;
-
 }
-
index 7abc0d371cf24913030a6c7f887814b1fc9992d5..53214182b207e94e457d030abcf4c224f7489ec9 100644 (file)
--- a/parser.h
+++ b/parser.h
@@ -54,8 +54,7 @@ private:
 #endif
 };
 
-void line_source(unsigned int, std::ostream&);
-void parse(std::istream&, std::ostream&);
+void parse(Scanner&, std::ostream&);
 
 } // end namespace re2c
 
index a93d1c153dd616fadbec067519ef85e343f6a3cc..c9d3109b022abaced040accba25cd7e38df53fb1 100644 (file)
--- a/parser.y
+++ b/parser.y
@@ -185,53 +185,24 @@ int yylex(){
 namespace re2c
 {
 
-void line_source(unsigned int line, std::ostream& o)
+void parse(Scanner& i, std::ostream& o)
 {
-       if (iFlag)
-       {
-               return;
-       }
-
-       o << "#line " << line << " \"";
-       
-       if (fileName == NULL)
-       {
-               o << "<stdin>";
-       }
-
-       std::string fname(fileName);
-       
-       for (size_t p = 0; p < fname.length(); ++p)
-       {
-               if (fname[p] == '\\')
-               {
-                       fname.insert(++p, "\\");
-               }
-       }
-       o << fname << "\"\n";
-       ++oline;
-}
-
-void parse(std::istream& i, std::ostream &o){
+       in = &i;
 
        o << "/* Generated by re2c " PACKAGE_VERSION " on ";
        time_t now = time(&now);
        o.write(ctime(&now), 24);
        o << " */\n";
-       oline += 2;
-       
-       in = new Scanner(i);
-       
-       line_source(in->line(), o);
+       o << sourceFileInfo;
        
-       while(in->echo(o))
+       while(i.echo(o))
        {
                yyparse();
                if(spec)
                {
                        genCode(o, topIndent, spec);
                }
-               line_source(in->line(), o);
+               o << sourceFileInfo;
        }
 }
 
diff --git a/re.h b/re.h
index 4742e7576bebc01482637f4b093ee81d869c9f0f..d0367f4d6a705eeedfe7b80e9ec06d06474603ee 100644 (file)
--- a/re.h
+++ b/re.h
@@ -211,6 +211,23 @@ private:
 #endif
 };
 
+class RuleLine: public line_number
+{
+public:
+
+       RuleLine(const RuleOp& _op)
+               : op(_op)
+       {
+       }
+
+       uint get_line() const
+       {
+               return op.code->line;
+       }
+
+       const RuleOp& op;
+};
+
 class AltOp: public RegExp
 {
 
index 3a86eb404317b098eeb556433ef97cdfa5f5e195..25cc57a299ff16fe833682394d4a44a712d18e31 100755 (executable)
                                RelativePath="basics.h"
                                >
                        </File>
+                       <File
+                               RelativePath="code.h"
+                               >
+                       </File>
                        <File
                                RelativePath="config_w32.h"
                                >
                                RelativePath="scanner.h"
                                >
                        </File>
+                       <File
+                               RelativePath="stream_lc.h"
+                               >
+                       </File>
                        <File
                                RelativePath="substr.h"
                                >
index 0627029088bfd8bc2c0bd4e363d6052a40c67f38..2a39acdc59c1143f93e97a52f6028bf2282b8499 100644 (file)
--- a/re2c.1.in
+++ b/re2c.1.in
@@ -7,6 +7,11 @@
 .ds rx regular expression
 .ds lx \fIl\fP-expression
 \"$Log$
+\"Revision 1.39  2006/01/21 15:51:02  helly
+\"- Generic fix for oline generation (by providing specialized ostream whose
+\"  stream_buffer count '\n's)
+\"- Change re2c:startlabel to 0 (makes more sense and results in clean code)
+\"
 \"Revision 1.38  2006/01/20 20:53:59  helly
 \"- Update docu
 \"
@@ -512,7 +517,7 @@ not want any indendation at all you can simply set this to \fB""\fP.
 If set to zero then a decimal table is being used else a hexadecimal table 
 will be generated.
 .TP
-\fIre2c:startlabel\fP \fB=\fP 1 \fB;\fP
+\fIre2c:startlabel\fP \fB=\fP 0 \fB;\fP
 If set to a non zero integer then the start label of the next scanner blocks 
 will be generated even if not used by the scanner itself. Otherwise the normal 
 \fByy0\fP like start label is only being generated if needed. If set to a text 
index a8edba6c77aef016f31077de1bc2f6156c653305..03bced3e313e0f1ffc0b1a3b15d9a8d43798d4ac 100755 (executable)
                        <File
                                RelativePath="basics.h">
                        </File>
+                       <File
+                               RelativePath="code.h">
+                       </File>
                        <File
                                RelativePath="config_w32.h">
                        </File>
                        <File
                                RelativePath="scanner.h">
                        </File>
+                       <File
+                               RelativePath="stream_lc.h">
+                       </File>
                        <File
                                RelativePath="substr.h">
                        </File>
index 4bcb87a2d6b7c4533b7862d380c4597ee0109c9e..e863cb620669a7e3ae9b03b932589f9a303fdd75 100644 (file)
--- a/scanner.h
+++ b/scanner.h
@@ -11,9 +11,9 @@
 namespace re2c
 {
 
-class Scanner
+class Scanner:
+       public line_number
 {
-
 private:
        std::istream&   in;
        char    *bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof;
@@ -36,7 +36,7 @@ public:
        void config(const Str&, const Str&);
 
        SubStr token() const;
-       uint line() const;      
+       virtual uint get_line() const;  
        uint xlat(uint c) const;
 
        uint unescape(SubStr &s) const;
@@ -57,11 +57,6 @@ inline SubStr Scanner::token() const
        return SubStr(tok, cur - tok);
 }
 
-inline uint Scanner::line() const
-{
-       return cline;
-}
-
 inline uint Scanner::xlat(uint c) const
 {
        return re2c::wFlag ? c : re2c::xlat[c];
index 16e957b5ab08fc218bbbb6b565d7b818f7792ed9..583cb8aa36272e304a2326c586794a5ecde613d7 100644 (file)
@@ -125,7 +125,7 @@ echo:
                                }
        "\n"            {
                                        out.write((const char*)(tok), (const char*)(cursor) - (const char*)(tok));
-                                       tok = pos = cursor; cline++; oline++;
+                                       tok = pos = cursor; cline++;
                                        goto echo;
                                }
        zero            {
index 67c5cacec685dcd30448952ec967e1fdf39701ea..0a5d87f36ed325a9014cfac34abe985f35143da4 100644 (file)
--- a/substr.cc
+++ b/substr.cc
@@ -22,9 +22,6 @@ namespace re2c
 void SubStr::out(std::ostream& o) const
 {
        o.write(str, len);
-       oline += std::count(str, str + len, '\n');
-       // This is only to be used in Rule::emit(), if this is going to change then
-       // oline counting must be done there and probably in other emit()'s, too.
 }
 
 bool operator==(const SubStr &s1, const SubStr &s2)
index 7a4c8711122473ab1f80eb7b318306a1ee4b82d8..78a636b6ccdaaf5764d1b26e82bb2615019fa60e 100755 (executable)
@@ -23,7 +23,7 @@ cont:
 #line 24 "<stdout>"
 {
        YYCTYPE yych;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
        yych = *YYCURSOR;
        switch(yych){
index 8800c0b33bba34e7f922dfa123407759306dfcf3..5eb541b642424c6b718d421de0de0e9654395f07 100755 (executable)
@@ -20,7 +20,7 @@ next:
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 45) YYFILL(45);
        yych = *YYCURSOR;
        switch(yych){
index de99df19ecfd3c7f33de0ef129af60611ab0404b..bc1639c0d7124e9d1004d20d08143a19e5e77dab 100755 (executable)
@@ -24,7 +24,7 @@ cont:
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
        yych = *YYCURSOR;
        switch(yych){
index 9281abf868e2d2ac7c1455bd87fd29daf18e5510..7fda0fed58a9ca88a830647e2e029a8d9b28e03e 100644 (file)
@@ -61,7 +61,7 @@ std:
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
        yych = *YYCURSOR;
        switch(yych){
index e55603be5a6616900ad16072869a773365312484..07810627eb0cf191c2c2b8638dac269f7b24f6e2 100755 (executable)
@@ -19,7 +19,7 @@ const char *q;
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
        yych = *YYCURSOR;
        switch(yych){
index fe3246e947fb6dd8adaba999d69ea6391e7bec94..8f5587e3016344c77ba92b0dd94ebdbb11599127 100644 (file)
--- a/test/c.c
+++ b/test/c.c
@@ -130,7 +130,7 @@ std:
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 9) YYFILL(9);
        yych = *YYCURSOR;
        switch(yych){
index 377401c75c0ba5d69fa9bb92225abdc3b9b52a9b..097d93ab0884f79533c48c6ee1cfa862e03469b1 100644 (file)
@@ -113,7 +113,7 @@ std:
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 9) YYFILL(9);
        yych = *YYCURSOR;
        switch(yych){
index fe9d1b29ee3e16b8f4e02991884d2d37aac09b27..a81520b2b85b5fc403ec6883e9474ef88a7c5ce5 100644 (file)
@@ -130,7 +130,7 @@ std:
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
        yych = *YYCURSOR;
        switch(yych){
index 3a0c0a140c86869bd8fbd6253326748f31e5fb91..61fce81e0dc0fe794f8e8a701f85a11496439fa2 100755 (executable)
@@ -14,7 +14,7 @@ char *scan0(char *p)
 #line 15 "<stdout>"
 {
        YYCTYPE yych;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
        yych = *YYCURSOR;
        switch(yych){
index 22893c0813853a47f025d41455ce5be3de7ad3ce..57feb23a8349193bd71a37022a694e8b9be2a246 100755 (executable)
@@ -14,7 +14,7 @@ char *scan0(char *p)
 #line 15 "<stdout>"
 {
    YYCTYPE yych;
-yy0:
+
    if(YYLIMIT == YYCURSOR) YYFILL(1);
    yych = *YYCURSOR;
    if(yych <= 'b') {
index a5cc784c83efdb93d0926a0b63c8960da624713d..10c0c6880318ec1aec7d994c087fb9398732a0f6 100755 (executable)
@@ -14,6 +14,7 @@ char *scan0(char *p)
 #line 15 "<stdout>"
 {
        YYCTYPE yych;
+
        if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
        yych = *YYCURSOR;
        switch(yych){
@@ -36,12 +37,12 @@ yy2:
 yy3:
 #line 13 "config3.re"
        { return YYCURSOR; }
-#line 40 "<stdout>"
+#line 41 "<stdout>"
 yy4:
        ++YYCURSOR;
 #line 14 "config3.re"
        { return NULL; }
-#line 45 "<stdout>"
+#line 46 "<stdout>"
 yy6:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -69,7 +70,7 @@ char *scan1(char *p)
 {
        char *q;
 
-#line 73 "<stdout>"
+#line 74 "<stdout>"
 {
        YYCTYPE yych;
 yy8:
@@ -95,12 +96,12 @@ yy10:
 yy11:
 #line 23 "config3.re"
        { return YYCURSOR; }
-#line 99 "<stdout>"
+#line 100 "<stdout>"
 yy12:
        ++YYCURSOR;
 #line 24 "config3.re"
        { return NULL; }
-#line 104 "<stdout>"
+#line 105 "<stdout>"
 yy14:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -128,7 +129,7 @@ char *scan2(char *p)
 {
        char *q;
 
-#line 132 "<stdout>"
+#line 133 "<stdout>"
 {
        YYCTYPE yych;
 startLabel:
@@ -154,12 +155,12 @@ yy18:
 yy19:
 #line 33 "config3.re"
        { return YYCURSOR; }
-#line 158 "<stdout>"
+#line 159 "<stdout>"
 yy20:
        ++YYCURSOR;
 #line 34 "config3.re"
        { return NULL; }
-#line 163 "<stdout>"
+#line 164 "<stdout>"
 yy22:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
@@ -187,7 +188,7 @@ char *scan(char *p)
 {
        char *q;
 
-#line 191 "<stdout>"
+#line 192 "<stdout>"
 {
        YYCTYPE yych;
        if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
@@ -212,12 +213,12 @@ yy26:
 yy27:
 #line 43 "config3.re"
        { return YYCURSOR; }
-#line 216 "<stdout>"
+#line 217 "<stdout>"
 yy28:
        ++YYCURSOR;
 #line 44 "config3.re"
        { return NULL; }
-#line 221 "<stdout>"
+#line 222 "<stdout>"
 yy30:
        ++YYCURSOR;
        if(YYLIMIT == YYCURSOR) YYFILL(1);
index 9da2f5d7358060932e1e7f4692a32365678c19f7..1606dc4d905f6f879bc298a25b2e9c514a13667e 100755 (executable)
@@ -83,7 +83,7 @@ std:
        {
                YYCTYPE yych;
                YYCTYPE *yyctxmarker = YYCURSOR;
-yy0:
+
                if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
                yych = *YYCURSOR;
                if(yych <= ' ') {
index b2a52f276d16079326d22405ada1ee3e44f6b57c..0ea67f1505bc10397eb5cb85f52faf8a5b362d52 100755 (executable)
@@ -48,7 +48,7 @@ std:
 {
        YYCTYPE yych;
        YYCTYPE *yyctxmarker = YYCURSOR;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
        yych = *YYCURSOR;
        switch(yych){
index 754c4c64e876e80835be61e7cc0a95bc9f14f09c..58b07c8bf6649b294176e1f348337f890ca83dae 100755 (executable)
@@ -48,7 +48,7 @@ std:
 {
        YYCTYPE yych;
        YYCTYPE *yyctxmarker = YYCURSOR;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
        yych = *YYCURSOR;
        if(yych <= ' ') {
index a677acff47c6bbe7989784f07d9c984599b14e35..7baa107b364cfaf130437249318ad3b9760f0db9 100644 (file)
@@ -130,7 +130,7 @@ std:
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 9) YYFILL(9);
        yych = *YYCURSOR;
        switch(yych){
index b4c2f40b4e4c381d8d23aebf1ad63da4fa0c15d0..fe0d91c357430f0d425f522e6be040c10052b255 100755 (executable)
@@ -78,7 +78,7 @@ loop:
        {
                YYCTYPE yych;
                unsigned int yyaccept = 0;
-yy0:
+
                if((YYLIMIT - YYCURSOR) < 11) YYFILL(11);
                yych = *YYCURSOR;
                if(yych != '$') goto yy4;
index 36aab03d382b88fa188adf7b18fbcf4f457131f8..76a41d58be609e6c3cecdedcd212d01563b716ee 100755 (executable)
@@ -43,7 +43,7 @@ loop:
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 11) YYFILL(11);
        yych = *YYCURSOR;
        switch(yych){
index e354eb2d8e36b08e5ae7376dcc35a456ff69b99e..dcb168e4762f62a5956436ee7588432911295cc9 100755 (executable)
@@ -43,7 +43,7 @@ loop:
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 11) YYFILL(11);
        yych = *YYCURSOR;
        if(yych != '$') goto yy4;
index 658bccf1a616fc805209f37e5dd9429f5c6a715e..56d8b060d5d3d669fefbf00d0ea92edf15466cb6 100755 (executable)
@@ -43,7 +43,7 @@ loop:
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 11) YYFILL(11);
        yych = *YYCURSOR;
        if(yych != '$') goto yy4;
index 4995ad79e9e8f5814bd6e7bee8aeb9474c1abb5f..eb352d89c401c217b1d2952221c1f3452307a58a 100755 (executable)
@@ -78,7 +78,7 @@ loop:
        {
                YYCTYPE yych;
                unsigned int yyaccept = 0;
-yy0:
+
                if((YYLIMIT - YYCURSOR) < 11) YYFILL(11);
                yych = *YYCURSOR;
                if(yych != '$') goto yy4;
index 86d0c72d0e41d548d36b9523a8354f69f6da3602..2369521d38cd7767524dcc63cbf7e08c837b8aa6 100755 (executable)
@@ -19,7 +19,7 @@ const char *q;
 #line 19 "<stdout>"
 {
        YYCTYPE yych;
-yy0:
+
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
        switch(yych){
index ad323496c36269303c8b632e9a3f06ab3f0e0dd7..e0dac0dc43194cf97524e2f4a7b75b46c5167821 100644 (file)
@@ -5,7 +5,7 @@
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
        yych = *YYCURSOR;
        switch(yych){
index 27ec28bdc68ae700569eeac705ccfea029a25e8c..a1c206f2486d279e0e56b955c00800f33d4836d7 100755 (executable)
@@ -5,7 +5,7 @@
 #line 6 "<stdout>"
        {
                YYCTYPE yych;
-yy0:
+
                if(YYLIMIT == YYCURSOR) YYFILL(1);
                yych = *YYCURSOR;
                if(yych <= 'E') {
index 9afb190f9c7f863b82a1cef70b6b29b23f898053..f8f13f6d3a3eb44aa48692882c760ffbfd433b55 100755 (executable)
@@ -4,7 +4,7 @@
 #line 5 "<stdout>"
 {
        YYCTYPE yych;
-yy0:
+
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
        switch(yych){
index ca2035732c40d55e94796cf0428cffca01d23f1c..0d00db9fb932e4ba38c88ded29f36e02e8440576 100755 (executable)
@@ -4,7 +4,7 @@
 #line 5 "<stdout>"
 {
        YYCTYPE yych;
-yy0:
+
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
        if(yych <= 'E') {
index 1da8ed77ed6b95f4100accfa36b43c29a99c8509..63af3e41a7211b85a6043ad05092fb7a7d1a4271 100755 (executable)
@@ -40,7 +40,7 @@
        {
                YYCTYPE yych;
                unsigned int yyaccept = 0;
-yy0:
+
                if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
                yych = *YYCURSOR;
                if(yych <= '@') {
index ab43e83065ee877febbc44a3bd935f94033476ff..b183e8838971bc8fdd3b2ef322ac92cb5281d4a4 100755 (executable)
@@ -5,7 +5,7 @@
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
        yych = *YYCURSOR;
        switch(yych){
index be679284a47fc775605554456045c7aea5125d36..64c80d1bbc2bda80a940eed7b86e4b79d69115d3 100755 (executable)
@@ -5,7 +5,7 @@
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
        yych = *YYCURSOR;
        if(yych <= '@') {
index 36a9f694ea57311561287dbfd9d9d5fe04bcd2d9..e577ba1c3173832cb9a700f4510b334c980e845e 100644 (file)
@@ -4,7 +4,7 @@
 #line 5 "<stdout>"
 {
        YYCTYPE yych;
-yy0:
+
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
        switch(yych){
index e0529da860ed801e9a571642fea7ae4814465d07..415c5cffb25bc8cbae492954c9e82f6a9b915e1e 100644 (file)
@@ -4,7 +4,7 @@
 #line 5 "<stdout>"
 {
        YYCTYPE yych;
-yy0:
+
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
        switch(yych){
index f6fdb858582dde0cec4f408ad8872b0a5e484988..07e5a2f115db5290030f0ab8739af97ed5efb108 100755 (executable)
@@ -4,7 +4,7 @@
 #line 5 "<stdout>"
 {
        YYCTYPE yych;
-yy0:
+
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
        goto yy3;
index 2163d60318e764656ac43e7c5a5b49a52d50f4c7..2388bd10ca369aa950daf94fee5a84273c951c38 100755 (executable)
@@ -4,7 +4,7 @@
 #line 5 "<stdout>"
 {
        YYCTYPE yych;
-yy0:
+
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
        switch(yych){
index d994acb2adc8a54892ce3be0a7f89e41ff60750e..485d8167ff5946c8ca62c06e932b435982fcefc1 100755 (executable)
@@ -4,7 +4,7 @@
 #line 5 "<stdout>"
 {
        YYCTYPE yych;
-yy0:
+
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
        goto yy3;
index eb74ab7707a69452d90a2cc979d7b04fba818b02..2f72532b64a67c30f15e01961a430a35440d3cf2 100755 (executable)
@@ -4,7 +4,7 @@
 #line 5 "<stdout>"
 {
        YYCTYPE yych;
-yy0:
+
        if(YYLIMIT == YYCURSOR) YYFILL(1);
        yych = *YYCURSOR;
        switch(yych){
index 5cb60f54affa6d3374e305ecf8b9f664e8b8e1a5..6c8275cc84151fcdad7c3ec732a8a1582b5edbb5 100755 (executable)
@@ -5,7 +5,7 @@
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
        yych = *YYCURSOR;
        switch(yych){
index 326193cd93931418b61f5e7bd4f68fd58d1dfbf8..dd4f51af93fd91e3d09146ad7c3a630af8dc0a04 100755 (executable)
@@ -4,7 +4,7 @@
 #line 5 "<stdout>"
 {
        YYCTYPE yych;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
        yych = *YYCURSOR;
        switch(yych){
index 5d39ac81cca54e1bffc5fd28406be528dea7c46f..f1f7888a642ec10f67c5a3068aa7d64d799f7c82 100644 (file)
@@ -68,7 +68,7 @@ std:
        YYCTYPE yych;
        unsigned int yyaccept = 0;
        YYCTYPE *yyctxmarker = YYCURSOR;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 15) YYFILL(15);
        yych = *YYCURSOR;
        switch(yych){
index 38ca5abef1a25e9752c604f48f0ebfcd910f4d89..5ad6e7ac894e3e70cc0bf084b055fab76278640c 100755 (executable)
@@ -226,8 +226,8 @@ public:
 
     start:
 
-        /*!re2c
-
+        /*!re2c      
+               re2c:startlabel = 1;
             eol = "\n";
             eof = "\000";
             digit = [0-9];
index e18e8dd52ad566bef0c6b25c4a4c5cce1c6547ef..b3c451e93db2ccddb3b958b412f48373a7643439 100644 (file)
@@ -19,7 +19,7 @@ const char *q;
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
        yych = *YYCURSOR;
        switch(yych){
index 8062e754d710cc2a6f7fb2cbed56f176742cc408..e06f8c56f12b813bd6b15cece3b28e06ac930891 100644 (file)
@@ -5,7 +5,7 @@
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
        yych = *YYCURSOR;
        switch(yych){
index cc0deaaa0c4811aa986af7910f26601943a04b55..24c80abb954b2e12ac30265ae206dd414f74c5cb 100644 (file)
@@ -79,7 +79,7 @@ echo:
 {
        YYCTYPE yych;
        unsigned int yyaccept = 0;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
        yych = *YYCURSOR;
        switch(yych){
index 000d2b9035e719231de3a86f6c180d7395c102bf..c9ec05f0bafc5c95d5d35a35fd86eb4034fa105c 100644 (file)
@@ -12,7 +12,7 @@ char *q;
 #line 13 "<stdout>"
 {
        YYCTYPE yych;
-yy0:
+
        if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
        yych = *YYCURSOR;
        switch(yych){