From: <he...@us...> - 2006-07-29 20:17:24
|
Revision: 600 Author: helly Date: 2006-07-29 13:16:45 -0700 (Sat, 29 Jul 2006) ViewCVS: http://svn.sourceforge.net/re2c/?rev=600&view=rev Log Message: ----------- - Fixed #1529351 Segv bug on unterminated code blocks Modified Paths: -------------- tags/RELEASE_0_10_6/CHANGELOG tags/RELEASE_0_10_6/bootstrap/parser.cc tags/RELEASE_0_10_6/bootstrap/scanner.cc tags/RELEASE_0_10_6/parser.y tags/RELEASE_0_10_6/scanner.re Modified: tags/RELEASE_0_10_6/CHANGELOG =================================================================== --- tags/RELEASE_0_10_6/CHANGELOG 2006-07-27 01:34:29 UTC (rev 599) +++ tags/RELEASE_0_10_6/CHANGELOG 2006-07-29 20:16:45 UTC (rev 600) @@ -1,5 +1,6 @@ Version 0.10.6 (2006-??-??) --------------------------- +- Fixed #1529351 Segv bug on unterminated code blocks - Fixed #1528269 Invalid code generation. Version 0.10.5 (2006-06-11) Modified: tags/RELEASE_0_10_6/bootstrap/parser.cc =================================================================== --- tags/RELEASE_0_10_6/bootstrap/parser.cc 2006-07-27 01:34:29 UTC (rev 599) +++ tags/RELEASE_0_10_6/bootstrap/parser.cc 2006-07-29 20:16:45 UTC (rev 600) @@ -113,7 +113,7 @@ static re2c::uint accept; static RegExp *spec; -static Scanner *in; +static Scanner *in = NULL; /* Bison version 1.875 emits a definition that is not working * with several g++ version. Hence we disable it here. @@ -1609,7 +1609,7 @@ } int yylex(){ - return in->scan(); + return in ? in->scan() : 0; } } // end extern "C" @@ -1635,6 +1635,7 @@ } o << sourceFileInfo; } + in = NULL; } } // end namespace re2c Modified: tags/RELEASE_0_10_6/bootstrap/scanner.cc =================================================================== --- tags/RELEASE_0_10_6/bootstrap/scanner.cc 2006-07-27 01:34:29 UTC (rev 599) +++ tags/RELEASE_0_10_6/bootstrap/scanner.cc 2006-07-29 20:16:45 UTC (rev 600) @@ -1,4 +1,4 @@ -/* Generated by re2c 0.10.6 on Thu Jul 27 04:06:32 2006 */ +/* Generated by re2c 0.10.6 on Sat Jul 29 22:27:21 2006 */ #line 1 "scanner.re" /* $Id$ */ #include <stdlib.h> @@ -94,7 +94,7 @@ echo: { -#line 98 "<stdout>" +#line 98 "scanner.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -117,7 +117,7 @@ { goto echo; } -#line 121 "<stdout>" +#line 121 "scanner.cc" yy4: yych = *++YYCURSOR; if(yych == '/') goto yy10; @@ -134,7 +134,7 @@ tok = pos = cursor; cline++; goto echo; } -#line 138 "<stdout>" +#line 138 "scanner.cc" yy7: ++YYCURSOR; #line 176 "scanner.re" @@ -146,7 +146,7 @@ RETURN(0); } } -#line 150 "<stdout>" +#line 150 "scanner.cc" yy9: yych = *++YYCURSOR; goto yy3; @@ -170,7 +170,7 @@ tok = pos = cursor; goto echo; } -#line 174 "<stdout>" +#line 174 "scanner.cc" yy12: yych = *++YYCURSOR; if(yych == 0x0A) goto yy14; @@ -198,7 +198,7 @@ tok = pos = cursor; goto echo; } -#line 202 "<stdout>" +#line 202 "scanner.cc" yy16: yych = *++YYCURSOR; if(yych != '!') goto yy13; @@ -239,7 +239,7 @@ tok = cursor; RETURN(1); } -#line 243 "<stdout>" +#line 243 "scanner.cc" yy26: yych = *++YYCURSOR; if(yych != 'x') goto yy13; @@ -265,7 +265,7 @@ bUsedYYMaxFill = true; goto echo; } -#line 269 "<stdout>" +#line 269 "scanner.cc" yy34: yych = *++YYCURSOR; if(yych != 't') goto yy13; @@ -297,7 +297,7 @@ ignore_eoc = true; goto echo; } -#line 301 "<stdout>" +#line 301 "scanner.cc" yy47: yych = *++YYCURSOR; if(yych != 'n') goto yy13; @@ -324,7 +324,7 @@ ignore_eoc = true; goto echo; } -#line 328 "<stdout>" +#line 328 "scanner.cc" } } #line 187 "scanner.re" @@ -385,7 +385,7 @@ 112, 112, 112, 112, 112, 112, 112, 112, }; -#line 389 "<stdout>" +#line 389 "scanner.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -463,14 +463,14 @@ { depth = 1; goto code; } -#line 467 "<stdout>" +#line 467 "scanner.cc" yy62: ++YYCURSOR; if((yych = *YYCURSOR) == '*') goto yy121; yy63: #line 239 "scanner.re" { RETURN(*tok); } -#line 474 "<stdout>" +#line 474 "scanner.cc" yy64: ++YYCURSOR; if((yych = *YYCURSOR) == '/') goto yy119; @@ -478,7 +478,7 @@ #line 241 "scanner.re" { yylval.op = *tok; RETURN(CLOSE); } -#line 482 "<stdout>" +#line 482 "scanner.cc" yy66: yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); @@ -486,7 +486,7 @@ yy67: #line 226 "scanner.re" { fatal("unterminated string constant (missing \")"); } -#line 490 "<stdout>" +#line 490 "scanner.cc" yy68: yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); @@ -494,7 +494,7 @@ yy69: #line 227 "scanner.re" { fatal("unterminated string constant (missing ')"); } -#line 498 "<stdout>" +#line 498 "scanner.cc" yy70: yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); @@ -504,7 +504,7 @@ yy71: #line 237 "scanner.re" { fatal("unterminated range (missing ])"); } -#line 508 "<stdout>" +#line 508 "scanner.cc" yy72: yych = *++YYCURSOR; goto yy63; @@ -520,7 +520,7 @@ { cur = cursor; yylval.symbol = Symbol::find(token()); return ID; } -#line 524 "<stdout>" +#line 524 "scanner.cc" yy76: yych = *++YYCURSOR; goto yy90; @@ -531,7 +531,7 @@ yylval.regexp = mkDot(); return RANGE; } -#line 535 "<stdout>" +#line 535 "scanner.cc" yy79: ++YYCURSOR; yych = *YYCURSOR; @@ -539,7 +539,7 @@ yy80: #line 277 "scanner.re" { goto scan; } -#line 543 "<stdout>" +#line 543 "scanner.cc" yy81: ++YYCURSOR; yy82: @@ -548,7 +548,7 @@ pos = cursor; cline++; goto scan; } -#line 552 "<stdout>" +#line 552 "scanner.cc" yy83: ++YYCURSOR; if((yych = *YYCURSOR) == 0x0A) goto yy86; @@ -560,7 +560,7 @@ fatal(msg.str().c_str()); goto scan; } -#line 564 "<stdout>" +#line 564 "scanner.cc" yy85: yych = *++YYCURSOR; goto yy84; @@ -645,7 +645,7 @@ yylval.str = new Str(token()); return CONFIG; } -#line 649 "<stdout>" +#line 649 "scanner.cc" yy99: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); @@ -681,7 +681,7 @@ { cur = cursor; yylval.regexp = ranToRE(token()); return RANGE; } -#line 685 "<stdout>" +#line 685 "scanner.cc" yy106: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); @@ -694,7 +694,7 @@ { cur = cursor; yylval.regexp = invToRE(token()); return RANGE; } -#line 698 "<stdout>" +#line 698 "scanner.cc" yy109: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); @@ -716,7 +716,7 @@ { cur = cursor; yylval.regexp = strToCaseInsensitiveRE(token()); return STRING; } -#line 720 "<stdout>" +#line 720 "scanner.cc" yy114: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); @@ -738,19 +738,19 @@ { cur = cursor; yylval.regexp = strToRE(token()); return STRING; } -#line 742 "<stdout>" +#line 742 "scanner.cc" yy119: ++YYCURSOR; #line 215 "scanner.re" { tok = cursor; RETURN(0); } -#line 748 "<stdout>" +#line 748 "scanner.cc" yy121: ++YYCURSOR; #line 212 "scanner.re" { depth = 1; goto comment; } -#line 754 "<stdout>" +#line 754 "scanner.cc" yy123: yych = *++YYCURSOR; if(yych == ',') goto yy137; @@ -771,14 +771,14 @@ yy127: #line 259 "scanner.re" { fatal("illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers"); } -#line 775 "<stdout>" +#line 775 "scanner.cc" yy128: ++YYCURSOR; #line 247 "scanner.re" { yylval.extop.minsize = atoi((char *)tok+1); yylval.extop.maxsize = atoi((char *)tok+1); RETURN(CLOSESIZE); } -#line 782 "<stdout>" +#line 782 "scanner.cc" yy130: yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); @@ -790,7 +790,7 @@ { yylval.extop.minsize = atoi((char *)tok+1); yylval.extop.maxsize = -1; RETURN(CLOSESIZE); } -#line 794 "<stdout>" +#line 794 "scanner.cc" yy133: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); @@ -803,7 +803,7 @@ { yylval.extop.minsize = atoi((char *)tok+1); yylval.extop.maxsize = MAX(yylval.extop.minsize,atoi(strchr((char *)tok, ',')+1)); RETURN(CLOSESIZE); } -#line 807 "<stdout>" +#line 807 "scanner.cc" yy137: yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); @@ -814,7 +814,7 @@ #line 244 "scanner.re" { yylval.op = '*'; RETURN(CLOSE); } -#line 818 "<stdout>" +#line 818 "scanner.cc" } } #line 290 "scanner.re" @@ -857,26 +857,27 @@ 192, 192, 192, 192, 192, 192, 192, 192, }; -#line 861 "<stdout>" +#line 861 "scanner.cc" { YYCTYPE yych; if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; if(yych <= '&') { if(yych <= 0x0A) { - if(yych <= 0x09) goto yy148; + if(yych <= 0x00) goto yy148; + if(yych <= 0x09) goto yy150; goto yy146; } else { - if(yych == '"') goto yy150; - goto yy148; + if(yych == '"') goto yy152; + goto yy150; } } else { if(yych <= '{') { - if(yych <= '\'') goto yy151; - if(yych <= 'z') goto yy148; + if(yych <= '\'') goto yy153; + if(yych <= 'z') goto yy150; goto yy144; } else { - if(yych != '}') goto yy148; + if(yych != '}') goto yy150; } } ++YYCURSOR; @@ -887,13 +888,13 @@ return CODE; } goto code; } -#line 891 "<stdout>" +#line 892 "scanner.cc" yy144: ++YYCURSOR; #line 300 "scanner.re" { ++depth; goto code; } -#line 897 "<stdout>" +#line 898 "scanner.cc" yy146: ++YYCURSOR; #line 302 "scanner.re" @@ -901,118 +902,128 @@ pos = cursor; cline++; goto code; } -#line 905 "<stdout>" +#line 906 "scanner.cc" yy148: ++YYCURSOR; -yy149: #line 306 "scanner.re" - { goto code; } -#line 911 "<stdout>" + { if(cursor == eof) { + if (depth) fatal("missing '}'"); + RETURN(0); + } + goto code; + } +#line 916 "scanner.cc" yy150: - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 0x0A) goto yy149; - goto yy157; + ++YYCURSOR; yy151: +#line 312 "scanner.re" + { goto code; } +#line 922 "scanner.cc" +yy152: yych = *(YYMARKER = ++YYCURSOR); - if(yych == 0x0A) goto yy149; - goto yy153; -yy152: + if(yych == 0x0A) goto yy151; + goto yy159; +yy153: + yych = *(YYMARKER = ++YYCURSOR); + if(yych == 0x0A) goto yy151; + goto yy155; +yy154: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy153: +yy155: if(yybm[0+yych] & 64) { - goto yy152; + goto yy154; } - if(yych <= '&') goto yy154; - if(yych <= '\'') goto yy148; - goto yy155; -yy154: + if(yych <= '&') goto yy156; + if(yych <= '\'') goto yy150; + goto yy157; +yy156: YYCURSOR = YYMARKER; - goto yy149; -yy155: + goto yy151; +yy157: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if(yych == 0x0A) goto yy154; - goto yy152; -yy156: + if(yych == 0x0A) goto yy156; + goto yy154; +yy158: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy157: +yy159: if(yybm[0+yych] & 128) { - goto yy156; + goto yy158; } - if(yych <= '!') goto yy154; - if(yych <= '"') goto yy148; + if(yych <= '!') goto yy156; + if(yych <= '"') goto yy150; ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if(yych == 0x0A) goto yy154; - goto yy156; + if(yych == 0x0A) goto yy156; + goto yy158; } } -#line 307 "scanner.re" +#line 313 "scanner.re" comment: { -#line 963 "<stdout>" +#line 974 "scanner.cc" { YYCTYPE yych; if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; if(yych <= ')') { - if(yych == 0x0A) goto yy164; - goto yy166; + if(yych == 0x0A) goto yy166; + goto yy168; } else { - if(yych <= '*') goto yy161; - if(yych == '/') goto yy163; - goto yy166; + if(yych <= '*') goto yy163; + if(yych == '/') goto yy165; + goto yy168; } -yy161: +yy163: ++YYCURSOR; - if((yych = *YYCURSOR) == '/') goto yy169; -yy162: -#line 322 "scanner.re" + if((yych = *YYCURSOR) == '/') goto yy171; +yy164: +#line 328 "scanner.re" { if(cursor == eof) RETURN(0); goto comment; } -#line 983 "<stdout>" -yy163: +#line 994 "scanner.cc" +yy165: yych = *++YYCURSOR; - if(yych == '*') goto yy167; - goto yy162; -yy164: + if(yych == '*') goto yy169; + goto yy164; +yy166: ++YYCURSOR; -#line 318 "scanner.re" +#line 324 "scanner.re" { if(cursor == eof) RETURN(0); tok = pos = cursor; cline++; goto comment; } -#line 995 "<stdout>" -yy166: +#line 1006 "scanner.cc" +yy168: yych = *++YYCURSOR; - goto yy162; -yy167: + goto yy164; +yy169: ++YYCURSOR; -#line 315 "scanner.re" +#line 321 "scanner.re" { ++depth; fatal("ambiguous /* found"); goto comment; } -#line 1005 "<stdout>" -yy169: +#line 1016 "scanner.cc" +yy171: ++YYCURSOR; -#line 311 "scanner.re" +#line 317 "scanner.re" { if(--depth == 0) goto scan; else goto comment; } -#line 1013 "<stdout>" +#line 1024 "scanner.cc" } } -#line 324 "scanner.re" +#line 330 "scanner.re" config: @@ -1052,62 +1063,62 @@ 0, 0, 0, 0, 0, 0, 0, 0, }; -#line 1056 "<stdout>" +#line 1067 "scanner.cc" { YYCTYPE yych; if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; if(yych <= 0x1F) { - if(yych != 0x09) goto yy177; + if(yych != 0x09) goto yy179; } else { - if(yych <= ' ') goto yy173; - if(yych == '=') goto yy175; - goto yy177; + if(yych <= ' ') goto yy175; + if(yych == '=') goto yy177; + goto yy179; } -yy173: +yy175: ++YYCURSOR; yych = *YYCURSOR; - goto yy182; -yy174: -#line 328 "scanner.re" + goto yy184; +yy176: +#line 334 "scanner.re" { goto config; } -#line 1075 "<stdout>" -yy175: +#line 1086 "scanner.cc" +yy177: ++YYCURSOR; yych = *YYCURSOR; - goto yy180; -yy176: -#line 329 "scanner.re" + goto yy182; +yy178: +#line 335 "scanner.re" { iscfg = 2; cur = cursor; RETURN('='); } -#line 1086 "<stdout>" -yy177: +#line 1097 "scanner.cc" +yy179: ++YYCURSOR; -#line 333 "scanner.re" +#line 339 "scanner.re" { fatal("missing '='"); } -#line 1091 "<stdout>" -yy179: +#line 1102 "scanner.cc" +yy181: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy180: +yy182: if(yybm[0+yych] & 128) { - goto yy179; + goto yy181; } - goto yy176; -yy181: + goto yy178; +yy183: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy182: - if(yych == 0x09) goto yy181; - if(yych == ' ') goto yy181; - goto yy174; +yy184: + if(yych == 0x09) goto yy183; + if(yych == ' ') goto yy183; + goto yy176; } } -#line 334 "scanner.re" +#line 340 "scanner.re" value: @@ -1147,203 +1158,203 @@ 248, 248, 248, 248, 248, 248, 248, 248, }; -#line 1151 "<stdout>" +#line 1162 "scanner.cc" { YYCTYPE yych; if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; if(yych <= '&') { if(yych <= 0x0D) { - if(yych <= 0x08) goto yy191; - if(yych <= 0x0A) goto yy185; - if(yych <= 0x0C) goto yy191; + if(yych <= 0x08) goto yy193; + if(yych <= 0x0A) goto yy187; + if(yych <= 0x0C) goto yy193; } else { if(yych <= ' ') { - if(yych <= 0x1F) goto yy191; + if(yych <= 0x1F) goto yy193; } else { - if(yych == '"') goto yy193; - goto yy191; + if(yych == '"') goto yy195; + goto yy193; } } } else { if(yych <= '/') { - if(yych <= '\'') goto yy195; - if(yych == '-') goto yy188; - goto yy191; + if(yych <= '\'') goto yy197; + if(yych == '-') goto yy190; + goto yy193; } else { if(yych <= '9') { - if(yych <= '0') goto yy186; - goto yy189; + if(yych <= '0') goto yy188; + goto yy191; } else { - if(yych != ';') goto yy191; + if(yych != ';') goto yy193; } } } -yy185: -#line 343 "scanner.re" +yy187: +#line 349 "scanner.re" { cur = cursor; yylval.str = new Str(token()); iscfg = 0; return VALUE; } -#line 1190 "<stdout>" -yy186: +#line 1201 "scanner.cc" +yy188: ++YYCURSOR; if(yybm[0+(yych = *YYCURSOR)] & 8) { - goto yy191; + goto yy193; } -yy187: -#line 338 "scanner.re" +yy189: +#line 344 "scanner.re" { cur = cursor; yylval.number = atoi(token().to_string().c_str()); iscfg = 0; return NUMBER; } -#line 1203 "<stdout>" -yy188: +#line 1214 "scanner.cc" +yy190: yych = *++YYCURSOR; - if(yych <= '0') goto yy192; - if(yych >= ':') goto yy192; -yy189: + if(yych <= '0') goto yy194; + if(yych >= ':') goto yy194; +yy191: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; if(yybm[0+yych] & 4) { - goto yy189; + goto yy191; } if(yych <= 0x0D) { - if(yych <= 0x08) goto yy191; - if(yych <= 0x0A) goto yy187; - if(yych >= 0x0D) goto yy187; + if(yych <= 0x08) goto yy193; + if(yych <= 0x0A) goto yy189; + if(yych >= 0x0D) goto yy189; } else { if(yych <= ' ') { - if(yych >= ' ') goto yy187; + if(yych >= ' ') goto yy189; } else { - if(yych == ';') goto yy187; + if(yych == ';') goto yy189; } } -yy191: +yy193: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; -yy192: +yy194: if(yybm[0+yych] & 8) { - goto yy191; + goto yy193; } - goto yy185; -yy193: + goto yy187; +yy195: YYMARKER = ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; if(yybm[0+yych] & 16) { - goto yy193; + goto yy195; } if(yych <= '!') { - if(yych == 0x0A) goto yy185; - goto yy203; + if(yych == 0x0A) goto yy187; + goto yy205; } else { - if(yych <= '"') goto yy191; - if(yych <= '[') goto yy203; - goto yy205; + if(yych <= '"') goto yy193; + if(yych <= '[') goto yy205; + goto yy207; } -yy195: +yy197: YYMARKER = ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; if(yybm[0+yych] & 32) { - goto yy195; + goto yy197; } if(yych <= '&') { - if(yych == 0x0A) goto yy185; + if(yych == 0x0A) goto yy187; } else { - if(yych <= '\'') goto yy191; - if(yych >= '\\') goto yy200; + if(yych <= '\'') goto yy193; + if(yych >= '\\') goto yy202; } -yy197: +yy199: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; if(yybm[0+yych] & 64) { - goto yy197; + goto yy199; } - if(yych <= '&') goto yy199; - if(yych <= '\'') goto yy201; - goto yy202; -yy199: + if(yych <= '&') goto yy201; + if(yych <= '\'') goto yy203; + goto yy204; +yy201: YYCURSOR = YYMARKER; - goto yy185; -yy200: + goto yy187; +yy202: YYMARKER = ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; if(yych <= 0x0D) { if(yych <= 0x09) { - if(yych <= 0x08) goto yy195; - goto yy197; + if(yych <= 0x08) goto yy197; + goto yy199; } else { - if(yych <= 0x0A) goto yy185; - if(yych <= 0x0C) goto yy195; - goto yy197; + if(yych <= 0x0A) goto yy187; + if(yych <= 0x0C) goto yy197; + goto yy199; } } else { if(yych <= ' ') { - if(yych <= 0x1F) goto yy195; + if(yych <= 0x1F) goto yy197; + goto yy199; + } else { + if(yych == ';') goto yy199; goto yy197; - } else { - if(yych == ';') goto yy197; - goto yy195; } } -yy201: +yy203: yych = *++YYCURSOR; - goto yy185; -yy202: + goto yy187; +yy204: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if(yych == 0x0A) goto yy199; - goto yy197; -yy203: + if(yych == 0x0A) goto yy201; + goto yy199; +yy205: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; if(yybm[0+yych] & 128) { - goto yy203; + goto yy205; } - if(yych <= '!') goto yy199; - if(yych <= '"') goto yy201; - goto yy206; -yy205: + if(yych <= '!') goto yy201; + if(yych <= '"') goto yy203; + goto yy208; +yy207: YYMARKER = ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; if(yych <= 0x0D) { if(yych <= 0x09) { - if(yych <= 0x08) goto yy193; - goto yy203; + if(yych <= 0x08) goto yy195; + goto yy205; } else { - if(yych <= 0x0A) goto yy185; - if(yych <= 0x0C) goto yy193; - goto yy203; + if(yych <= 0x0A) goto yy187; + if(yych <= 0x0C) goto yy195; + goto yy205; } } else { if(yych <= ' ') { - if(yych <= 0x1F) goto yy193; - goto yy203; + if(yych <= 0x1F) goto yy195; + goto yy205; } else { - if(yych == ';') goto yy203; - goto yy193; + if(yych == ';') goto yy205; + goto yy195; } } -yy206: +yy208: ++YYCURSOR; if(YYLIMIT == YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if(yych == 0x0A) goto yy199; - goto yy203; + if(yych == 0x0A) goto yy201; + goto yy205; } } -#line 348 "scanner.re" +#line 354 "scanner.re" } @@ -1357,4 +1368,3 @@ } } // end namespace re2c - Modified: tags/RELEASE_0_10_6/parser.y =================================================================== --- tags/RELEASE_0_10_6/parser.y 2006-07-27 01:34:29 UTC (rev 599) +++ tags/RELEASE_0_10_6/parser.y 2006-07-29 20:16:45 UTC (rev 600) @@ -28,7 +28,7 @@ static re2c::uint accept; static RegExp *spec; -static Scanner *in; +static Scanner *in = NULL; /* Bison version 1.875 emits a definition that is not working * with several g++ version. Hence we disable it here. @@ -182,7 +182,7 @@ } int yylex(){ - return in->scan(); + return in ? in->scan() : 0; } } // end extern "C" @@ -208,6 +208,7 @@ } o << sourceFileInfo; } + in = NULL; } } // end namespace re2c Modified: tags/RELEASE_0_10_6/scanner.re =================================================================== --- tags/RELEASE_0_10_6/scanner.re 2006-07-27 01:34:29 UTC (rev 599) +++ tags/RELEASE_0_10_6/scanner.re 2006-07-29 20:16:45 UTC (rev 600) @@ -299,10 +299,16 @@ goto code; } "{" { ++depth; goto code; } - "\n" { if(cursor == eof) fatal("missing '}'"); + "\n" { if(cursor == eof) fatal("missing '}'"); pos = cursor; cline++; goto code; } + zero { if(cursor == eof) { + if (depth) fatal("missing '}'"); + RETURN(0); + } + goto code; + } dstring | sstring | any { goto code; } */ @@ -358,4 +364,3 @@ } } // end namespace re2c - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |