From: Ulya Trofimovich Date: Sat, 22 Aug 2015 13:49:17 +0000 (+0100) Subject: Parse inplace configuration names in lexer. X-Git-Tag: 0.15~103 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8fdb9c7498d4d7cc9a671e07a3745da26baa05bf;p=re2c Parse inplace configuration names in lexer. Make re2c do all the dirty work instead of barely recognizing configuration-like lexeme and manually matching the lexeme against all allowed configuration names. This commit adds many new tokens, which means that re2c-generated lexer and bison-generated parser have both become larger. The difference is not as great as one might expect: ~60 Kb -> ~80 Kb in both cases. --- diff --git a/re2c/bootstrap/src/parse/scanner_lex.cc b/re2c/bootstrap/src/parse/scanner_lex.cc index 1bc0fd61..1a47d0ca 100644 --- a/re2c/bootstrap/src/parse/scanner_lex.cc +++ b/re2c/bootstrap/src/parse/scanner_lex.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 0.14.3 on Thu Aug 20 13:23:54 2015 */ +/* Generated by re2c 0.14.3 on Sat Aug 22 14:19:15 2015 */ #line 1 "../src/parse/scanner_lex.re" #include #include @@ -32,7 +32,7 @@ namespace re2c #line 32 "../src/parse/scanner_lex.re" -#line 56 "../src/parse/scanner_lex.re" +#line 53 "../src/parse/scanner_lex.re" Scanner::ParseMode Scanner::echo() @@ -107,7 +107,7 @@ echo: } } ++YYCURSOR; -#line 199 "../src/parse/scanner_lex.re" +#line 196 "../src/parse/scanner_lex.re" { if (!(ignore_eoc || DFlag || flag_skeleton)) { @@ -123,7 +123,7 @@ echo: yy4: ++YYCURSOR; yy5: -#line 210 "../src/parse/scanner_lex.re" +#line 207 "../src/parse/scanner_lex.re" { goto echo; } @@ -136,7 +136,7 @@ yy6: } if (yych == '#') goto yy91; yy7: -#line 186 "../src/parse/scanner_lex.re" +#line 183 "../src/parse/scanner_lex.re" { if (ignore_eoc) { @@ -234,7 +234,7 @@ yy21: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy12; ++YYCURSOR; -#line 87 "../src/parse/scanner_lex.re" +#line 84 "../src/parse/scanner_lex.re" { if (rFlag) { @@ -253,7 +253,7 @@ yy31: if (yych != 'c') goto yy12; yy32: ++YYCURSOR; -#line 72 "../src/parse/scanner_lex.re" +#line 69 "../src/parse/scanner_lex.re" { if (rFlag) { @@ -284,7 +284,7 @@ yy34: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy12; ++YYCURSOR; -#line 99 "../src/parse/scanner_lex.re" +#line 96 "../src/parse/scanner_lex.re" { if (!rFlag) { @@ -314,7 +314,7 @@ yy42: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy12; ++YYCURSOR; -#line 113 "../src/parse/scanner_lex.re" +#line 110 "../src/parse/scanner_lex.re" { if (!DFlag) { @@ -349,7 +349,7 @@ yy50: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy12; ++YYCURSOR; -#line 122 "../src/parse/scanner_lex.re" +#line 119 "../src/parse/scanner_lex.re" { tok = pos = cur; out.insert_state_goto (topIndent); @@ -377,7 +377,7 @@ yy63: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy12; ++YYCURSOR; -#line 128 "../src/parse/scanner_lex.re" +#line 125 "../src/parse/scanner_lex.re" { tok = pos = cur; ignore_eoc = true; @@ -402,7 +402,7 @@ yy74: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy12; ++YYCURSOR; -#line 133 "../src/parse/scanner_lex.re" +#line 130 "../src/parse/scanner_lex.re" { tok = pos = cur; ignore_eoc = true; @@ -423,7 +423,7 @@ yy84: if (yych == '\n') goto yy87; if (yych == '\r') goto yy86; yy85: -#line 164 "../src/parse/scanner_lex.re" +#line 161 "../src/parse/scanner_lex.re" { if (ignore_eoc) { @@ -448,7 +448,7 @@ yy86: if (yych != '\n') goto yy12; yy87: ++YYCURSOR; -#line 146 "../src/parse/scanner_lex.re" +#line 143 "../src/parse/scanner_lex.re" { cline++; if (ignore_eoc) @@ -542,7 +542,7 @@ yy101: yy103: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 182 "../src/parse/scanner_lex.re" +#line 179 "../src/parse/scanner_lex.re" { set_sourceline (); goto echo; @@ -572,7 +572,7 @@ yy109: if (yych == '\r') goto yy105; goto yy12; } -#line 213 "../src/parse/scanner_lex.re" +#line 210 "../src/parse/scanner_lex.re" } @@ -589,15 +589,14 @@ scan: tok = cur; switch (lexer_state) { - case LEX_NORMAL: goto start; - case LEX_CONFIG: goto config; - case LEX_CONFIG_VALUE: goto value; - case LEX_FLEX_NAME: goto flex_name; + case LEX_NORMAL: goto start; + case LEX_CONF: goto conf_eq; + case LEX_FLEX_NAME: goto flex_name; } start: -#line 601 "src/parse/scanner_lex.cc" +#line 600 "src/parse/scanner_lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -712,90 +711,90 @@ start: yy112: ++YYCURSOR; yy113: -#line 392 "../src/parse/scanner_lex.re" +#line 383 "../src/parse/scanner_lex.re" { fatalf("unexpected character: '%c'", *tok); goto scan; } -#line 721 "src/parse/scanner_lex.cc" +#line 720 "src/parse/scanner_lex.cc" yy114: ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; - goto yy224; + goto yy218; yy115: -#line 376 "../src/parse/scanner_lex.re" +#line 367 "../src/parse/scanner_lex.re" { goto scan; } -#line 731 "src/parse/scanner_lex.cc" +#line 730 "src/parse/scanner_lex.cc" yy116: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy202; + if (yych == '\t') goto yy196; } else { - if (yych <= ' ') goto yy202; - if (yych == '#') goto yy204; + if (yych <= ' ') goto yy196; + if (yych == '#') goto yy198; } yy117: -#line 385 "../src/parse/scanner_lex.re" +#line 376 "../src/parse/scanner_lex.re" { if (cur == eof) return 0; pos = cur; cline++; goto scan; } -#line 749 "src/parse/scanner_lex.cc" +#line 748 "src/parse/scanner_lex.cc" yy118: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy201; + if (yych == '\n') goto yy195; goto yy113; yy119: ++YYCURSOR; -#line 266 "../src/parse/scanner_lex.re" +#line 262 "../src/parse/scanner_lex.re" { quote = tok[0]; goto cpoints; } -#line 758 "src/parse/scanner_lex.cc" +#line 757 "src/parse/scanner_lex.cc" yy121: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '}') goto yy199; + if (yych == '}') goto yy193; goto yy113; yy122: ++YYCURSOR; yy123: -#line 276 "../src/parse/scanner_lex.re" +#line 272 "../src/parse/scanner_lex.re" { return *tok; } -#line 770 "src/parse/scanner_lex.cc" +#line 769 "src/parse/scanner_lex.cc" yy124: ++YYCURSOR; - if ((yych = (YYCTYPE)*YYCURSOR) == '/') goto yy199; -#line 280 "../src/parse/scanner_lex.re" + if ((yych = (YYCTYPE)*YYCURSOR) == '/') goto yy193; +#line 276 "../src/parse/scanner_lex.re" { yylval.op = *tok; return STAR; } -#line 779 "src/parse/scanner_lex.cc" +#line 778 "src/parse/scanner_lex.cc" yy126: ++YYCURSOR; -#line 284 "../src/parse/scanner_lex.re" +#line 280 "../src/parse/scanner_lex.re" { yylval.op = *tok; return CLOSE; } -#line 787 "src/parse/scanner_lex.cc" +#line 786 "src/parse/scanner_lex.cc" yy128: ++YYCURSOR; -#line 371 "../src/parse/scanner_lex.re" +#line 362 "../src/parse/scanner_lex.re" { yylval.regexp = mkDot(); return RANGE; } -#line 795 "src/parse/scanner_lex.cc" +#line 794 "src/parse/scanner_lex.cc" yy130: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '*') goto yy195; - if (yych == '/') goto yy197; + if (yych == '*') goto yy189; + if (yych == '/') goto yy191; goto yy123; yy131: YYCTXMARKER = YYCURSOR + 1; @@ -804,20 +803,20 @@ yy131: yy132: YYCTXMARKER = YYCURSOR + 1; yych = (YYCTYPE)*++YYCURSOR; - if (yych == '=') goto yy191; + if (yych == '=') goto yy185; goto yy113; yy133: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == '!') goto yy182; - if (yych == '>') goto yy184; + if (yych == '!') goto yy176; + if (yych == '>') goto yy178; goto yy123; yy134: ++YYCURSOR; - if ((yych = (YYCTYPE)*YYCURSOR) == '^') goto yy180; -#line 267 "../src/parse/scanner_lex.re" + if ((yych = (YYCTYPE)*YYCURSOR) == '^') goto yy174; +#line 263 "../src/parse/scanner_lex.re" { quote = ']'; goto cpoints; } -#line 821 "src/parse/scanner_lex.cc" +#line 820 "src/parse/scanner_lex.cc" yy136: YYCTXMARKER = YYCURSOR + 1; yych = (YYCTYPE)*++YYCURSOR; @@ -841,12 +840,12 @@ yy137: } } yy138: -#line 237 "../src/parse/scanner_lex.re" +#line 233 "../src/parse/scanner_lex.re" { depth = 1; goto code; } -#line 850 "src/parse/scanner_lex.cc" +#line 849 "src/parse/scanner_lex.cc" yy139: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -870,21 +869,17 @@ yy139: } yy141: YYCURSOR = YYMARKER; - if (yyaccept <= 2) { - if (yyaccept <= 1) { - if (yyaccept == 0) { - goto yy117; - } else { - goto yy123; - } + if (yyaccept <= 1) { + if (yyaccept == 0) { + goto yy117; } else { - goto yy138; + goto yy123; } } else { - if (yyaccept == 3) { - goto yy145; + if (yyaccept == 2) { + goto yy138; } else { - goto yy170; + goto yy145; } } yy142: @@ -899,14 +894,14 @@ yy142: yy144: ++YYCURSOR; yy145: -#line 320 "../src/parse/scanner_lex.re" +#line 316 "../src/parse/scanner_lex.re" { fatal("illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers"); } -#line 907 "src/parse/scanner_lex.cc" +#line 902 "src/parse/scanner_lex.cc" yy146: ++YYCURSOR; -#line 324 "../src/parse/scanner_lex.re" +#line 320 "../src/parse/scanner_lex.re" { if (!FFlag) { fatal("curly braces for names only allowed with -F switch"); @@ -914,10 +909,10 @@ yy146: yylval.str = new std::string (tok + 1, tok_len () - 2); // -2 to omit braces return ID; } -#line 918 "src/parse/scanner_lex.cc" +#line 913 "src/parse/scanner_lex.cc" yy148: ++YYCURSOR; -#line 289 "../src/parse/scanner_lex.re" +#line 285 "../src/parse/scanner_lex.re" { if (!s_to_u32_unsafe (tok + 1, cur - 1, yylval.extop.min)) { @@ -926,7 +921,7 @@ yy148: yylval.extop.max = yylval.extop.min; return CLOSESIZE; } -#line 930 "src/parse/scanner_lex.cc" +#line 925 "src/parse/scanner_lex.cc" yy150: yyaccept = 3; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -934,7 +929,7 @@ yy150: if (yych <= '9') goto yy153; if (yych != '}') goto yy145; ++YYCURSOR; -#line 311 "../src/parse/scanner_lex.re" +#line 307 "../src/parse/scanner_lex.re" { if (!s_to_u32_unsafe (tok + 1, cur - 2, yylval.extop.min)) { @@ -943,7 +938,7 @@ yy150: yylval.extop.max = UINT32_MAX; return CLOSESIZE; } -#line 947 "src/parse/scanner_lex.cc" +#line 942 "src/parse/scanner_lex.cc" yy153: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -952,7 +947,7 @@ yy153: if (yych <= '9') goto yy153; if (yych != '}') goto yy141; ++YYCURSOR; -#line 298 "../src/parse/scanner_lex.re" +#line 294 "../src/parse/scanner_lex.re" { const char * p = strchr (tok, ','); if (!s_to_u32_unsafe (tok + 1, p, yylval.extop.min)) @@ -965,12 +960,11 @@ yy153: } return CLOSESIZE; } -#line 969 "src/parse/scanner_lex.cc" +#line 964 "src/parse/scanner_lex.cc" yy157: ++YYCURSOR; -yy158: YYCURSOR = YYCTXMARKER; -#line 357 "../src/parse/scanner_lex.re" +#line 348 "../src/parse/scanner_lex.re" { if (!FFlag) { yylval.str = new std::string (tok, tok_len ()); @@ -984,20 +978,20 @@ yy158: return STRING; } } -#line 988 "src/parse/scanner_lex.cc" +#line 982 "src/parse/scanner_lex.cc" yy159: yych = (YYCTYPE)*++YYCURSOR; - goto yy178; + goto yy172; yy160: ++YYCURSOR; yy161: YYCURSOR = YYCTXMARKER; -#line 352 "../src/parse/scanner_lex.re" +#line 343 "../src/parse/scanner_lex.re" { yylval.str = new std::string (tok, tok_len ()); return ID; } -#line 1001 "src/parse/scanner_lex.cc" +#line 995 "src/parse/scanner_lex.cc" yy162: YYCTXMARKER = YYCURSOR + 1; ++YYCURSOR; @@ -1041,108 +1035,14 @@ yy164: YYCTXMARKER = YYCURSOR + 1; yych = (YYCTYPE)*++YYCURSOR; if (yych != ':') goto yy163; - yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 'Z') { - if (yych <= '/') goto yy158; - if (yych <= '9') goto yy168; - if (yych <= '@') goto yy158; - } else { - if (yych <= '_') { - if (yych <= '^') goto yy158; - } else { - if (yych <= '`') goto yy158; - if (yych >= '{') goto yy158; - } - } -yy168: - yyaccept = 4; - YYMARKER = ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = (YYCTYPE)*YYCURSOR; - if (yych <= '@') { - if (yych <= '9') { - if (yych >= '0') goto yy168; - } else { - if (yych <= ':') goto yy172; - if (yych >= '@') goto yy171; - } - } else { - if (yych <= '_') { - if (yych <= 'Z') goto yy168; - if (yych >= '_') goto yy168; - } else { - if (yych <= '`') goto yy170; - if (yych <= 'z') goto yy168; - } - } -yy170: -#line 332 "../src/parse/scanner_lex.re" - { - tok += 5; /* skip "re2c:" */ - lexer_state = LEX_CONFIG; - yylval.str = new std::string (tok, tok_len ()); - return CONFIG; - } -#line 1087 "src/parse/scanner_lex.cc" -yy171: - yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 'Z') { - if (yych <= '/') goto yy141; - if (yych <= '9') goto yy173; - if (yych <= '@') goto yy141; - goto yy173; - } else { - if (yych <= '_') { - if (yych <= '^') goto yy141; - goto yy173; - } else { - if (yych <= '`') goto yy141; - if (yych <= 'z') goto yy173; - goto yy141; - } - } -yy172: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = (YYCTYPE)*YYCURSOR; - if (yych <= 'Z') { - if (yych <= '/') goto yy141; - if (yych <= '9') goto yy168; - if (yych <= '@') goto yy141; - goto yy168; - } else { - if (yych <= '_') { - if (yych <= '^') goto yy141; - goto yy168; - } else { - if (yych <= '`') goto yy141; - if (yych <= 'z') goto yy168; - goto yy141; - } - } -yy173: ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = (YYCTYPE)*YYCURSOR; - if (yych <= 'Z') { - if (yych <= '/') goto yy170; - if (yych <= '9') goto yy173; - if (yych <= '@') goto yy170; - goto yy173; - } else { - if (yych <= '_') { - if (yych <= '^') goto yy170; - goto yy173; - } else { - if (yych <= '`') goto yy170; - if (yych <= 'z') goto yy173; - goto yy170; - } - } -yy175: +#line 328 "../src/parse/scanner_lex.re" + { goto conf; } +#line 1042 "src/parse/scanner_lex.cc" +yy169: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 339 "../src/parse/scanner_lex.re" +#line 330 "../src/parse/scanner_lex.re" { yylval.str = new std::string (tok, tok_len ()); if (FFlag) @@ -1155,146 +1055,146 @@ yy175: return ID; } } -#line 1159 "src/parse/scanner_lex.cc" -yy177: +#line 1059 "src/parse/scanner_lex.cc" +yy171: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy178: +yy172: if (yybm[0+yych] & 64) { - goto yy177; + goto yy171; } - if (yych == ',') goto yy179; - if (yych <= '<') goto yy175; - if (yych >= '?') goto yy175; -yy179: + if (yych == ',') goto yy173; + if (yych <= '<') goto yy169; + if (yych >= '?') goto yy169; +yy173: yych = (YYCTYPE)*++YYCURSOR; goto yy161; -yy180: +yy174: ++YYCURSOR; -#line 268 "../src/parse/scanner_lex.re" +#line 264 "../src/parse/scanner_lex.re" { quote = ']'; negated_class = true; goto cpoints; } -#line 1178 "src/parse/scanner_lex.cc" -yy182: +#line 1078 "src/parse/scanner_lex.cc" +yy176: ++YYCURSOR; -#line 273 "../src/parse/scanner_lex.re" +#line 269 "../src/parse/scanner_lex.re" { return SETUP; } -#line 1185 "src/parse/scanner_lex.cc" -yy184: +#line 1085 "src/parse/scanner_lex.cc" +yy178: YYCTXMARKER = YYCURSOR + 1; yych = (YYCTYPE)*++YYCURSOR; - goto yy186; -yy185: + goto yy180; +yy179: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; -yy186: +yy180: if (yych <= '9') { if (yych <= '\t') { if (yych <= 0x08) goto yy141; - goto yy185; + goto yy179; } else { - if (yych == ' ') goto yy185; + if (yych == ' ') goto yy179; goto yy141; } } else { if (yych <= '=') { - if (yych <= ':') goto yy190; + if (yych <= ':') goto yy184; if (yych <= '<') goto yy141; - goto yy189; + goto yy183; } else { if (yych != '{') goto yy141; } } -yy187: +yy181: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 270 "../src/parse/scanner_lex.re" +#line 266 "../src/parse/scanner_lex.re" { return NOCOND; } -#line 1219 "src/parse/scanner_lex.cc" -yy189: +#line 1119 "src/parse/scanner_lex.cc" +yy183: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '>') goto yy187; + if (yych == '>') goto yy181; goto yy141; -yy190: +yy184: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '=') goto yy187; + if (yych == '=') goto yy181; goto yy141; -yy191: +yy185: ++YYCURSOR; - if ((yych = (YYCTYPE)*YYCURSOR) == '>') goto yy193; -#line 246 "../src/parse/scanner_lex.re" + if ((yych = (YYCTYPE)*YYCURSOR) == '>') goto yy187; +#line 242 "../src/parse/scanner_lex.re" { tok += 2; /* skip ":=" */ depth = 0; goto code; } -#line 1237 "src/parse/scanner_lex.cc" -yy193: +#line 1137 "src/parse/scanner_lex.cc" +yy187: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 242 "../src/parse/scanner_lex.re" +#line 238 "../src/parse/scanner_lex.re" { return *tok; } -#line 1245 "src/parse/scanner_lex.cc" -yy195: +#line 1145 "src/parse/scanner_lex.cc" +yy189: ++YYCURSOR; -#line 255 "../src/parse/scanner_lex.re" +#line 251 "../src/parse/scanner_lex.re" { depth = 1; goto comment; } -#line 1253 "src/parse/scanner_lex.cc" -yy197: +#line 1153 "src/parse/scanner_lex.cc" +yy191: ++YYCURSOR; -#line 252 "../src/parse/scanner_lex.re" +#line 248 "../src/parse/scanner_lex.re" { goto nextLine; } -#line 1260 "src/parse/scanner_lex.cc" -yy199: +#line 1160 "src/parse/scanner_lex.cc" +yy193: ++YYCURSOR; -#line 261 "../src/parse/scanner_lex.re" +#line 257 "../src/parse/scanner_lex.re" { tok = cur; return 0; } -#line 1268 "src/parse/scanner_lex.cc" -yy201: +#line 1168 "src/parse/scanner_lex.cc" +yy195: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= 0x1F) { if (yych != '\t') goto yy117; } else { - if (yych <= ' ') goto yy202; - if (yych == '#') goto yy204; + if (yych <= ' ') goto yy196; + if (yych == '#') goto yy198; goto yy117; } -yy202: +yy196: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy202; + if (yych == '\t') goto yy196; goto yy141; } else { - if (yych <= ' ') goto yy202; + if (yych <= ' ') goto yy196; if (yych != '#') goto yy141; } -yy204: +yy198: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy204; + if (yych == '\t') goto yy198; goto yy141; } else { - if (yych <= ' ') goto yy204; + if (yych <= ' ') goto yy198; if (yych != 'l') goto yy141; } yych = (YYCTYPE)*++YYCURSOR; @@ -1304,24 +1204,24 @@ yy204: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'e') goto yy141; yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '0') goto yy211; + if (yych <= '0') goto yy205; if (yych <= '9') goto yy141; - goto yy211; -yy210: + goto yy205; +yy204: YYCTXMARKER = YYCURSOR + 1; ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy211: +yy205: if (yych <= 0x1F) { - if (yych == '\t') goto yy210; + if (yych == '\t') goto yy204; goto yy141; } else { - if (yych <= ' ') goto yy210; + if (yych <= ' ') goto yy204; if (yych <= '0') goto yy141; if (yych >= ':') goto yy141; } -yy212: +yy206: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; @@ -1329,125 +1229,125 @@ yy212: if (yych <= '\t') { if (yych <= 0x08) goto yy141; } else { - if (yych <= '\n') goto yy216; + if (yych <= '\n') goto yy210; if (yych <= '\f') goto yy141; - goto yy218; + goto yy212; } } else { if (yych <= ' ') { if (yych <= 0x1F) goto yy141; } else { if (yych <= '/') goto yy141; - if (yych <= '9') goto yy212; + if (yych <= '9') goto yy206; goto yy141; } } -yy214: +yy208: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy214; + if (yych == '\t') goto yy208; goto yy141; } else { - if (yych <= ' ') goto yy214; - if (yych == '"') goto yy219; + if (yych <= ' ') goto yy208; + if (yych == '"') goto yy213; goto yy141; } -yy216: +yy210: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 380 "../src/parse/scanner_lex.re" +#line 371 "../src/parse/scanner_lex.re" { set_sourceline (); goto scan; } -#line 1366 "src/parse/scanner_lex.cc" -yy218: +#line 1266 "src/parse/scanner_lex.cc" +yy212: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy216; + if (yych == '\n') goto yy210; goto yy141; -yy219: +yy213: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy219; + goto yy213; } if (yych <= '\n') goto yy141; - if (yych <= '"') goto yy222; + if (yych <= '"') goto yy216; ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych == '\n') goto yy141; - goto yy219; -yy222: + goto yy213; +yy216: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy216; - if (yych == '\r') goto yy218; + if (yych == '\n') goto yy210; + if (yych == '\r') goto yy212; goto yy141; -yy223: +yy217: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy224: - if (yych == '\t') goto yy223; - if (yych == ' ') goto yy223; +yy218: + if (yych == '\t') goto yy217; + if (yych == ' ') goto yy217; goto yy115; } -#line 396 "../src/parse/scanner_lex.re" +#line 387 "../src/parse/scanner_lex.re" flex_name: -#line 1404 "src/parse/scanner_lex.cc" +#line 1304 "src/parse/scanner_lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy229; - if (yych == '\r') goto yy231; + if (yych == '\n') goto yy223; + if (yych == '\r') goto yy225; ++YYCURSOR; -yy228: -#line 407 "../src/parse/scanner_lex.re" +yy222: +#line 398 "../src/parse/scanner_lex.re" { YYCURSOR = tok; goto start; } -#line 1418 "src/parse/scanner_lex.cc" -yy229: +#line 1318 "src/parse/scanner_lex.cc" +yy223: ++YYCURSOR; -yy230: -#line 401 "../src/parse/scanner_lex.re" +yy224: +#line 392 "../src/parse/scanner_lex.re" { YYCURSOR = tok; lexer_state = LEX_NORMAL; return FID_END; } -#line 1428 "src/parse/scanner_lex.cc" -yy231: +#line 1328 "src/parse/scanner_lex.cc" +yy225: yych = (YYCTYPE)*++YYCURSOR; - if (yych != '\n') goto yy228; + if (yych != '\n') goto yy222; ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; - goto yy230; + goto yy224; } -#line 411 "../src/parse/scanner_lex.re" +#line 402 "../src/parse/scanner_lex.re" cpoints: tok = cur; -#line 1442 "src/parse/scanner_lex.cc" +#line 1342 "src/parse/scanner_lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; if ((YYLIMIT - YYCURSOR) < 10) YYFILL(10); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy237; - if (yych == '\\') goto yy239; + if (yych == '\n') goto yy231; + if (yych == '\\') goto yy233; ++YYCURSOR; -#line 435 "../src/parse/scanner_lex.re" +#line 426 "../src/parse/scanner_lex.re" { const char c = tok[0]; if (c == quote) @@ -1471,62 +1371,62 @@ cpoints: goto cpoints; } } -#line 1475 "src/parse/scanner_lex.cc" -yy237: +#line 1375 "src/parse/scanner_lex.cc" +yy231: ++YYCURSOR; -#line 416 "../src/parse/scanner_lex.re" +#line 407 "../src/parse/scanner_lex.re" { fatal ((tok - pos) - tchar, "syntax error"); } -#line 1480 "src/parse/scanner_lex.cc" -yy239: +#line 1380 "src/parse/scanner_lex.cc" +yy233: ++YYCURSOR; if ((yych = (YYCTYPE)*YYCURSOR) <= 'b') { if (yych <= 'T') { if (yych <= '/') { - if (yych != '\n') goto yy241; + if (yych != '\n') goto yy235; } else { - if (yych <= '3') goto yy243; - if (yych <= '7') goto yy245; - goto yy241; + if (yych <= '3') goto yy237; + if (yych <= '7') goto yy239; + goto yy235; } } else { if (yych <= 'X') { - if (yych <= 'U') goto yy246; - if (yych <= 'W') goto yy241; - goto yy248; + if (yych <= 'U') goto yy240; + if (yych <= 'W') goto yy235; + goto yy242; } else { - if (yych == '\\') goto yy249; - if (yych <= '`') goto yy241; - goto yy249; + if (yych == '\\') goto yy243; + if (yych <= '`') goto yy235; + goto yy243; } } } else { if (yych <= 'r') { if (yych <= 'm') { - if (yych == 'f') goto yy249; - goto yy241; + if (yych == 'f') goto yy243; + goto yy235; } else { - if (yych <= 'n') goto yy249; - if (yych <= 'q') goto yy241; - goto yy249; + if (yych <= 'n') goto yy243; + if (yych <= 'q') goto yy235; + goto yy243; } } else { if (yych <= 'u') { - if (yych <= 's') goto yy241; - if (yych <= 't') goto yy249; - goto yy248; + if (yych <= 's') goto yy235; + if (yych <= 't') goto yy243; + goto yy242; } else { - if (yych <= 'v') goto yy249; - if (yych == 'x') goto yy251; - goto yy241; + if (yych <= 'v') goto yy243; + if (yych == 'x') goto yy245; + goto yy235; } } } -#line 419 "../src/parse/scanner_lex.re" +#line 410 "../src/parse/scanner_lex.re" { fatal ((tok - pos) - tchar, "syntax error in escape sequence"); } -#line 1527 "src/parse/scanner_lex.cc" -yy241: +#line 1427 "src/parse/scanner_lex.cc" +yy235: ++YYCURSOR; -#line 425 "../src/parse/scanner_lex.re" +#line 416 "../src/parse/scanner_lex.re" { const char c = tok[1]; if (c != quote) @@ -1536,204 +1436,204 @@ yy241: cpoints.push_back (static_cast (c)); goto cpoints; } -#line 1540 "src/parse/scanner_lex.cc" -yy243: +#line 1440 "src/parse/scanner_lex.cc" +yy237: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy244; - if (yych <= '7') goto yy266; -yy244: -#line 418 "../src/parse/scanner_lex.re" + if (yych <= '/') goto yy238; + if (yych <= '7') goto yy260; +yy238: +#line 409 "../src/parse/scanner_lex.re" { fatal ((tok - pos) - tchar, "syntax error in octal escape sequence"); } -#line 1549 "src/parse/scanner_lex.cc" -yy245: +#line 1449 "src/parse/scanner_lex.cc" +yy239: yych = (YYCTYPE)*++YYCURSOR; - goto yy244; -yy246: + goto yy238; +yy240: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy247; - if (yych <= '9') goto yy259; + if (yych <= '/') goto yy241; + if (yych <= '9') goto yy253; } else { - if (yych <= 'F') goto yy259; - if (yych <= '`') goto yy247; - if (yych <= 'f') goto yy259; + if (yych <= 'F') goto yy253; + if (yych <= '`') goto yy241; + if (yych <= 'f') goto yy253; } -yy247: -#line 417 "../src/parse/scanner_lex.re" +yy241: +#line 408 "../src/parse/scanner_lex.re" { fatal ((tok - pos) - tchar, "syntax error in hexadecimal escape sequence"); } -#line 1567 "src/parse/scanner_lex.cc" -yy248: +#line 1467 "src/parse/scanner_lex.cc" +yy242: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy247; - if (yych <= '9') goto yy256; - goto yy247; + if (yych <= '/') goto yy241; + if (yych <= '9') goto yy250; + goto yy241; } else { - if (yych <= 'F') goto yy256; - if (yych <= '`') goto yy247; - if (yych <= 'f') goto yy256; - goto yy247; + if (yych <= 'F') goto yy250; + if (yych <= '`') goto yy241; + if (yych <= 'f') goto yy250; + goto yy241; } -yy249: +yy243: ++YYCURSOR; -#line 423 "../src/parse/scanner_lex.re" +#line 414 "../src/parse/scanner_lex.re" { cpoints.push_back (unesc_simple (tok)); goto cpoints; } -#line 1585 "src/parse/scanner_lex.cc" -yy251: +#line 1485 "src/parse/scanner_lex.cc" +yy245: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy247; - if (yych >= ':') goto yy247; + if (yych <= '/') goto yy241; + if (yych >= ':') goto yy241; } else { - if (yych <= 'F') goto yy252; - if (yych <= '`') goto yy247; - if (yych >= 'g') goto yy247; + if (yych <= 'F') goto yy246; + if (yych <= '`') goto yy241; + if (yych >= 'g') goto yy241; } -yy252: +yy246: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy253; - if (yych <= '9') goto yy254; + if (yych <= '/') goto yy247; + if (yych <= '9') goto yy248; } else { - if (yych <= 'F') goto yy254; - if (yych <= '`') goto yy253; - if (yych <= 'f') goto yy254; + if (yych <= 'F') goto yy248; + if (yych <= '`') goto yy247; + if (yych <= 'f') goto yy248; } -yy253: +yy247: YYCURSOR = YYMARKER; if (yyaccept == 0) { - goto yy244; + goto yy238; } else { - goto yy247; + goto yy241; } -yy254: +yy248: ++YYCURSOR; -#line 421 "../src/parse/scanner_lex.re" +#line 412 "../src/parse/scanner_lex.re" { cpoints.push_back (unesc_hex (tok, cur)); goto cpoints; } -#line 1618 "src/parse/scanner_lex.cc" -yy256: +#line 1518 "src/parse/scanner_lex.cc" +yy250: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy253; - if (yych >= ':') goto yy253; + if (yych <= '/') goto yy247; + if (yych >= ':') goto yy247; } else { - if (yych <= 'F') goto yy257; - if (yych <= '`') goto yy253; - if (yych >= 'g') goto yy253; + if (yych <= 'F') goto yy251; + if (yych <= '`') goto yy247; + if (yych >= 'g') goto yy247; } -yy257: +yy251: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy253; - if (yych >= ':') goto yy253; + if (yych <= '/') goto yy247; + if (yych >= ':') goto yy247; } else { - if (yych <= 'F') goto yy258; - if (yych <= '`') goto yy253; - if (yych >= 'g') goto yy253; + if (yych <= 'F') goto yy252; + if (yych <= '`') goto yy247; + if (yych >= 'g') goto yy247; } -yy258: +yy252: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy253; - if (yych <= '9') goto yy254; - goto yy253; + if (yych <= '/') goto yy247; + if (yych <= '9') goto yy248; + goto yy247; } else { - if (yych <= 'F') goto yy254; - if (yych <= '`') goto yy253; - if (yych <= 'f') goto yy254; - goto yy253; + if (yych <= 'F') goto yy248; + if (yych <= '`') goto yy247; + if (yych <= 'f') goto yy248; + goto yy247; } -yy259: +yy253: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy253; - if (yych >= ':') goto yy253; + if (yych <= '/') goto yy247; + if (yych >= ':') goto yy247; } else { - if (yych <= 'F') goto yy260; - if (yych <= '`') goto yy253; - if (yych >= 'g') goto yy253; + if (yych <= 'F') goto yy254; + if (yych <= '`') goto yy247; + if (yych >= 'g') goto yy247; } -yy260: +yy254: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy253; - if (yych >= ':') goto yy253; + if (yych <= '/') goto yy247; + if (yych >= ':') goto yy247; } else { - if (yych <= 'F') goto yy261; - if (yych <= '`') goto yy253; - if (yych >= 'g') goto yy253; + if (yych <= 'F') goto yy255; + if (yych <= '`') goto yy247; + if (yych >= 'g') goto yy247; } -yy261: +yy255: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy253; - if (yych >= ':') goto yy253; + if (yych <= '/') goto yy247; + if (yych >= ':') goto yy247; } else { - if (yych <= 'F') goto yy262; - if (yych <= '`') goto yy253; - if (yych >= 'g') goto yy253; + if (yych <= 'F') goto yy256; + if (yych <= '`') goto yy247; + if (yych >= 'g') goto yy247; } -yy262: +yy256: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy253; - if (yych >= ':') goto yy253; + if (yych <= '/') goto yy247; + if (yych >= ':') goto yy247; } else { - if (yych <= 'F') goto yy263; - if (yych <= '`') goto yy253; - if (yych >= 'g') goto yy253; + if (yych <= 'F') goto yy257; + if (yych <= '`') goto yy247; + if (yych >= 'g') goto yy247; } -yy263: +yy257: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy253; - if (yych >= ':') goto yy253; + if (yych <= '/') goto yy247; + if (yych >= ':') goto yy247; } else { - if (yych <= 'F') goto yy264; - if (yych <= '`') goto yy253; - if (yych >= 'g') goto yy253; + if (yych <= 'F') goto yy258; + if (yych <= '`') goto yy247; + if (yych >= 'g') goto yy247; } -yy264: +yy258: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy253; - if (yych >= ':') goto yy253; + if (yych <= '/') goto yy247; + if (yych >= ':') goto yy247; } else { - if (yych <= 'F') goto yy265; - if (yych <= '`') goto yy253; - if (yych >= 'g') goto yy253; + if (yych <= 'F') goto yy259; + if (yych <= '`') goto yy247; + if (yych >= 'g') goto yy247; } -yy265: +yy259: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy253; - if (yych <= '9') goto yy254; - goto yy253; + if (yych <= '/') goto yy247; + if (yych <= '9') goto yy248; + goto yy247; } else { - if (yych <= 'F') goto yy254; - if (yych <= '`') goto yy253; - if (yych <= 'f') goto yy254; - goto yy253; + if (yych <= 'F') goto yy248; + if (yych <= '`') goto yy247; + if (yych <= 'f') goto yy248; + goto yy247; } -yy266: +yy260: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '/') goto yy253; - if (yych >= '8') goto yy253; + if (yych <= '/') goto yy247; + if (yych >= '8') goto yy247; ++YYCURSOR; -#line 422 "../src/parse/scanner_lex.re" +#line 413 "../src/parse/scanner_lex.re" { cpoints.push_back (unesc_oct (tok, cur)); goto cpoints; } -#line 1730 "src/parse/scanner_lex.cc" +#line 1630 "src/parse/scanner_lex.cc" } -#line 458 "../src/parse/scanner_lex.re" +#line 449 "../src/parse/scanner_lex.re" code: -#line 1737 "src/parse/scanner_lex.cc" +#line 1637 "src/parse/scanner_lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -1775,26 +1675,26 @@ code: yych = (YYCTYPE)*YYCURSOR; if (yych <= '&') { if (yych <= '\n') { - if (yych <= 0x00) goto yy271; - if (yych <= '\t') goto yy273; - goto yy275; + if (yych <= 0x00) goto yy265; + if (yych <= '\t') goto yy267; + goto yy269; } else { - if (yych == '"') goto yy277; - goto yy273; + if (yych == '"') goto yy271; + goto yy267; } } else { if (yych <= '{') { - if (yych <= '\'') goto yy278; - if (yych <= 'z') goto yy273; - goto yy279; - } else { - if (yych == '}') goto yy281; + if (yych <= '\'') goto yy272; + if (yych <= 'z') goto yy267; goto yy273; + } else { + if (yych == '}') goto yy275; + goto yy267; } } -yy271: +yy265: ++YYCURSOR; -#line 521 "../src/parse/scanner_lex.re" +#line 512 "../src/parse/scanner_lex.re" { if (cur == eof) { @@ -1806,35 +1706,35 @@ yy271: } goto code; } -#line 1810 "src/parse/scanner_lex.cc" -yy273: +#line 1710 "src/parse/scanner_lex.cc" +yy267: ++YYCURSOR; -yy274: -#line 535 "../src/parse/scanner_lex.re" +yy268: +#line 526 "../src/parse/scanner_lex.re" { goto code; } -#line 1818 "src/parse/scanner_lex.cc" -yy275: +#line 1718 "src/parse/scanner_lex.cc" +yy269: YYCTXMARKER = YYCURSOR + 1; yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '\r') { if (yych <= '\t') { - if (yych >= '\t') goto yy292; + if (yych >= '\t') goto yy286; } else { - if (yych <= '\n') goto yy294; - if (yych >= '\r') goto yy294; + if (yych <= '\n') goto yy288; + if (yych >= '\r') goto yy288; } } else { if (yych <= ' ') { - if (yych >= ' ') goto yy292; + if (yych >= ' ') goto yy286; } else { - if (yych == '#') goto yy295; + if (yych == '#') goto yy289; } } -yy276: -#line 502 "../src/parse/scanner_lex.re" +yy270: +#line 493 "../src/parse/scanner_lex.re" { if (depth == 0) { @@ -1854,20 +1754,20 @@ yy276: cline++; goto code; } -#line 1858 "src/parse/scanner_lex.cc" -yy277: +#line 1758 "src/parse/scanner_lex.cc" +yy271: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == '\n') goto yy274; - goto yy290; -yy278: + if (yych == '\n') goto yy268; + goto yy284; +yy272: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == '\n') goto yy274; - goto yy284; -yy279: + if (yych == '\n') goto yy268; + goto yy278; +yy273: ++YYCURSOR; -#line 474 "../src/parse/scanner_lex.re" +#line 465 "../src/parse/scanner_lex.re" { if (depth == 0) { @@ -1879,10 +1779,10 @@ yy279: } goto code; } -#line 1883 "src/parse/scanner_lex.cc" -yy281: +#line 1783 "src/parse/scanner_lex.cc" +yy275: ++YYCURSOR; -#line 462 "../src/parse/scanner_lex.re" +#line 453 "../src/parse/scanner_lex.re" { if (depth == 0) { @@ -1895,69 +1795,69 @@ yy281: } goto code; } -#line 1899 "src/parse/scanner_lex.cc" -yy283: +#line 1799 "src/parse/scanner_lex.cc" +yy277: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy284: +yy278: if (yybm[0+yych] & 16) { - goto yy283; + goto yy277; } - if (yych <= '\n') goto yy285; - if (yych <= '\'') goto yy287; - goto yy286; -yy285: + if (yych <= '\n') goto yy279; + if (yych <= '\'') goto yy281; + goto yy280; +yy279: YYCURSOR = YYMARKER; if (yyaccept <= 1) { if (yyaccept == 0) { - goto yy276; + goto yy270; } else { - goto yy274; + goto yy268; } } else { - goto yy293; + goto yy287; } -yy286: +yy280: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy285; - goto yy283; -yy287: + if (yych == '\n') goto yy279; + goto yy277; +yy281: ++YYCURSOR; -#line 532 "../src/parse/scanner_lex.re" +#line 523 "../src/parse/scanner_lex.re" { goto code; } -#line 1934 "src/parse/scanner_lex.cc" -yy289: +#line 1834 "src/parse/scanner_lex.cc" +yy283: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy290: +yy284: if (yybm[0+yych] & 32) { - goto yy289; + goto yy283; } - if (yych <= '\n') goto yy285; - if (yych <= '"') goto yy287; + if (yych <= '\n') goto yy279; + if (yych <= '"') goto yy281; ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy285; - goto yy289; -yy292: + if (yych == '\n') goto yy279; + goto yy283; +yy286: yyaccept = 2; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy314; + if (yych == '\t') goto yy308; } else { - if (yych <= ' ') goto yy314; - if (yych == '#') goto yy295; + if (yych <= ' ') goto yy308; + if (yych == '#') goto yy289; } -yy293: +yy287: YYCURSOR = YYCTXMARKER; -#line 489 "../src/parse/scanner_lex.re" +#line 480 "../src/parse/scanner_lex.re" { if (depth == 0) { @@ -1971,123 +1871,123 @@ yy293: cline++; goto code; } -#line 1975 "src/parse/scanner_lex.cc" -yy294: +#line 1875 "src/parse/scanner_lex.cc" +yy288: yych = (YYCTYPE)*++YYCURSOR; - goto yy293; -yy295: + goto yy287; +yy289: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 64) { - goto yy295; + goto yy289; } - if (yych != 'l') goto yy285; + if (yych != 'l') goto yy279; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy285; + if (yych != 'i') goto yy279; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy285; + if (yych != 'n') goto yy279; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy285; + if (yych != 'e') goto yy279; yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '0') goto yy302; - if (yych <= '9') goto yy285; - goto yy302; -yy301: + if (yych <= '0') goto yy296; + if (yych <= '9') goto yy279; + goto yy296; +yy295: YYCTXMARKER = YYCURSOR + 1; ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy302: +yy296: if (yych <= 0x1F) { - if (yych == '\t') goto yy301; - goto yy285; + if (yych == '\t') goto yy295; + goto yy279; } else { - if (yych <= ' ') goto yy301; - if (yych <= '0') goto yy285; - if (yych >= ':') goto yy285; + if (yych <= ' ') goto yy295; + if (yych <= '0') goto yy279; + if (yych >= ':') goto yy279; } -yy303: +yy297: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy303; + goto yy297; } if (yych <= '\f') { - if (yych <= 0x08) goto yy285; - if (yych <= '\t') goto yy305; - if (yych <= '\n') goto yy307; - goto yy285; + if (yych <= 0x08) goto yy279; + if (yych <= '\t') goto yy299; + if (yych <= '\n') goto yy301; + goto yy279; } else { - if (yych <= '\r') goto yy309; - if (yych != ' ') goto yy285; + if (yych <= '\r') goto yy303; + if (yych != ' ') goto yy279; } -yy305: +yy299: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy305; - goto yy285; + if (yych == '\t') goto yy299; + goto yy279; } else { - if (yych <= ' ') goto yy305; - if (yych == '"') goto yy310; - goto yy285; + if (yych <= ' ') goto yy299; + if (yych == '"') goto yy304; + goto yy279; } -yy307: +yy301: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 485 "../src/parse/scanner_lex.re" +#line 476 "../src/parse/scanner_lex.re" { set_sourceline (); goto code; } -#line 2047 "src/parse/scanner_lex.cc" -yy309: +#line 1947 "src/parse/scanner_lex.cc" +yy303: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy307; - goto yy285; -yy310: + if (yych == '\n') goto yy301; + goto yy279; +yy304: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = (YYCTYPE)*YYCURSOR; if (yych <= '!') { - if (yych == '\n') goto yy285; - goto yy310; + if (yych == '\n') goto yy279; + goto yy304; } else { - if (yych <= '"') goto yy313; - if (yych != '\\') goto yy310; + if (yych <= '"') goto yy307; + if (yych != '\\') goto yy304; } ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy285; - goto yy310; -yy313: + if (yych == '\n') goto yy279; + goto yy304; +yy307: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy307; - if (yych == '\r') goto yy309; - goto yy285; -yy314: + if (yych == '\n') goto yy301; + if (yych == '\r') goto yy303; + goto yy279; +yy308: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy314; - goto yy285; + if (yych == '\t') goto yy308; + goto yy279; } else { - if (yych <= ' ') goto yy314; - if (yych == '#') goto yy295; - goto yy285; + if (yych <= ' ') goto yy308; + if (yych == '#') goto yy289; + goto yy279; } } -#line 538 "../src/parse/scanner_lex.re" +#line 529 "../src/parse/scanner_lex.re" comment: -#line 2091 "src/parse/scanner_lex.cc" +#line 1991 "src/parse/scanner_lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2127,14 +2027,14 @@ comment: if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= ')') { - if (yych == '\n') goto yy320; + if (yych == '\n') goto yy314; } else { - if (yych <= '*') goto yy322; - if (yych == '/') goto yy323; + if (yych <= '*') goto yy316; + if (yych == '/') goto yy317; } ++YYCURSOR; -yy319: -#line 570 "../src/parse/scanner_lex.re" +yy313: +#line 561 "../src/parse/scanner_lex.re" { if (cur == eof) { @@ -2142,15 +2042,15 @@ yy319: } goto comment; } -#line 2146 "src/parse/scanner_lex.cc" -yy320: +#line 2046 "src/parse/scanner_lex.cc" +yy314: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 32) { - goto yy328; + goto yy322; } - if (yych == '#') goto yy331; -yy321: -#line 561 "../src/parse/scanner_lex.re" + if (yych == '#') goto yy325; +yy315: +#line 552 "../src/parse/scanner_lex.re" { if (cur == eof) { @@ -2160,180 +2060,1289 @@ yy321: cline++; goto comment; } -#line 2164 "src/parse/scanner_lex.cc" +#line 2064 "src/parse/scanner_lex.cc" +yy316: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == '/') goto yy320; + goto yy313; +yy317: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != '*') goto yy313; + ++YYCURSOR; +#line 543 "../src/parse/scanner_lex.re" + { + ++depth; + fatal("ambiguous /* found"); + goto comment; + } +#line 2079 "src/parse/scanner_lex.cc" +yy320: + ++YYCURSOR; +#line 533 "../src/parse/scanner_lex.re" + { + if (--depth == 0) + { + goto scan; + } + else + { + goto comment; + } + } +#line 2093 "src/parse/scanner_lex.cc" yy322: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 32) { + goto yy322; + } + if (yych == '#') goto yy325; +yy324: + YYCURSOR = YYMARKER; + goto yy315; +yy325: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= 0x1F) { + if (yych == '\t') goto yy325; + goto yy324; + } else { + if (yych <= ' ') goto yy325; + if (yych != 'l') goto yy324; + } + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'i') goto yy324; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy324; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy324; + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= '0') goto yy332; + if (yych <= '9') goto yy324; + goto yy332; +yy331: + YYCTXMARKER = YYCURSOR + 1; + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; +yy332: + if (yych <= 0x1F) { + if (yych == '\t') goto yy331; + goto yy324; + } else { + if (yych <= ' ') goto yy331; + if (yych <= '0') goto yy324; + if (yych >= ':') goto yy324; + } +yy333: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 64) { + goto yy333; + } + if (yych <= '\f') { + if (yych <= 0x08) goto yy324; + if (yych <= '\t') goto yy335; + if (yych <= '\n') goto yy337; + goto yy324; + } else { + if (yych <= '\r') goto yy339; + if (yych != ' ') goto yy324; + } +yy335: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= 0x1F) { + if (yych == '\t') goto yy335; + goto yy324; + } else { + if (yych <= ' ') goto yy335; + if (yych == '"') goto yy340; + goto yy324; + } +yy337: + ++YYCURSOR; + YYCURSOR = YYCTXMARKER; +#line 548 "../src/parse/scanner_lex.re" + { + set_sourceline (); + goto comment; + } +#line 2176 "src/parse/scanner_lex.cc" +yy339: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == '\n') goto yy337; + goto yy324; +yy340: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy340; + } + if (yych <= '\n') goto yy324; + if (yych <= '"') goto yy343; + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yych == '\n') goto yy324; + goto yy340; +yy343: + ++YYCURSOR; + if ((yych = (YYCTYPE)*YYCURSOR) == '\n') goto yy337; + if (yych == '\r') goto yy339; + goto yy324; +} +#line 568 "../src/parse/scanner_lex.re" + + +nextLine: + +#line 2206 "src/parse/scanner_lex.cc" +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yych == '\n') goto yy348; + ++YYCURSOR; +#line 579 "../src/parse/scanner_lex.re" + { if(cur == eof) { + return 0; + } + goto nextLine; + } +#line 2219 "src/parse/scanner_lex.cc" +yy348: + ++YYCURSOR; +#line 572 "../src/parse/scanner_lex.re" + { if(cur == eof) { + return 0; + } + tok = pos = cur; + cline++; + goto scan; + } +#line 2230 "src/parse/scanner_lex.cc" +} +#line 584 "../src/parse/scanner_lex.re" + + +conf: + tok = cur; + lexer_state = LEX_CONF; + +#line 2239 "src/parse/scanner_lex.cc" +{ + YYCTYPE yych; + unsigned int yyaccept = 0; + if ((YYLIMIT - YYCURSOR) < 27) YYFILL(27); + yych = (YYCTYPE)*YYCURSOR; + switch (yych) { + case 'c': goto yy354; + case 'd': goto yy355; + case 'f': goto yy356; + case 'i': goto yy357; + case 'l': goto yy358; + case 's': goto yy359; + case 'v': goto yy360; + case 'y': goto yy361; + default: goto yy352; + } +yy352: + ++YYCURSOR; +yy353: +#line 590 "../src/parse/scanner_lex.re" + { fatal ((tok - pos) - tchar, "unrecognized configuration"); } +#line 2261 "src/parse/scanner_lex.cc" +yy354: + yyaccept = 0; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'g') goto yy686; + if (yych == 'o') goto yy687; + goto yy353; +yy355: + yyaccept = 0; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'e') goto yy531; + goto yy353; +yy356: + yyaccept = 0; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'l') goto yy524; + goto yy353; +yy357: + yyaccept = 0; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'n') goto yy507; + goto yy353; +yy358: + yyaccept = 0; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'a') goto yy480; + goto yy353; +yy359: + yyaccept = 0; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 't') goto yy451; + goto yy353; +yy360: + yyaccept = 0; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'a') goto yy418; + goto yy353; +yy361: + yyaccept = 0; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych != 'y') goto yy353; + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 'c') { + if (yych <= 'a') goto yy363; + if (yych <= 'b') goto yy364; + goto yy365; + } else { + if (yych == 'f') goto yy366; + } +yy363: + YYCURSOR = YYMARKER; + if (yyaccept <= 1) { + if (yyaccept == 0) { + goto yy353; + } else { + goto yy555; + } + } else { + if (yyaccept == 2) { + goto yy701; + } else { + goto yy711; + } + } +yy364: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'm') goto yy412; + goto yy363; +yy365: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'h') goto yy394; + goto yy363; +yy366: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'i') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != ':') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 'd') { + if (yych == 'c') goto yy373; + goto yy363; + } else { + if (yych <= 'e') goto yy372; + if (yych != 'p') goto yy363; + } + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'a') goto yy385; + goto yy363; +yy372: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'n') goto yy379; + goto yy363; +yy373: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'h') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'c') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'k') goto yy363; + ++YYCURSOR; +#line 678 "../src/parse/scanner_lex.re" + { return CONF_YYFILL_CHECK; } +#line 2369 "src/parse/scanner_lex.cc" +yy379: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'b') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + ++YYCURSOR; +#line 679 "../src/parse/scanner_lex.re" + { return CONF_YYFILL_ENABLE; } +#line 2382 "src/parse/scanner_lex.cc" +yy385: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'r') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'm') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 't') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'r') goto yy363; + ++YYCURSOR; +#line 680 "../src/parse/scanner_lex.re" + { return CONF_YYFILL_PARAMETER; } +#line 2401 "src/parse/scanner_lex.cc" +yy394: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != ':') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'c') goto yy397; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'm') goto yy408; + goto yy363; +yy397: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'o') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'v') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'r') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 's') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'i') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'o') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy363; + ++YYCURSOR; +#line 676 "../src/parse/scanner_lex.re" + { return CONF_YYCH_CONVERSION; } +#line 2433 "src/parse/scanner_lex.cc" +yy408: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'i') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 't') goto yy363; + ++YYCURSOR; +#line 677 "../src/parse/scanner_lex.re" + { return CONF_YYCH_EMIT; } +#line 2442 "src/parse/scanner_lex.cc" +yy412: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != ':') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'h') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'x') goto yy363; + ++YYCURSOR; +#line 675 "../src/parse/scanner_lex.re" + { return CONF_YYBM_HEX; } +#line 2455 "src/parse/scanner_lex.cc" +yy418: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'r') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'i') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'b') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != ':') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'y') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'y') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 'c') { + if (yych <= '`') goto yy363; + if (yych <= 'a') goto yy428; + if (yych <= 'b') goto yy429; + goto yy430; + } else { + if (yych <= 'r') goto yy363; + if (yych <= 's') goto yy431; + if (yych <= 't') goto yy432; + goto yy363; + } +yy428: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'c') goto yy447; + goto yy363; +yy429: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'm') goto yy437; + goto yy363; +yy430: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'h') goto yy437; + if (yych == 't') goto yy443; + goto yy363; +yy431: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 't') goto yy439; + goto yy363; +yy432: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'r') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'g') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 't') goto yy363; +yy437: + ++YYCURSOR; +#line 637 "../src/parse/scanner_lex.re" + { + tok += sizeof "variable:" - 1; + yylval.str = new std::string (tok, tok_len ()); + return CONF; + } +#line 2523 "src/parse/scanner_lex.cc" +yy439: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'b') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy437; + goto yy363; +yy443: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'b') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy437; + goto yy363; +yy447: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'c') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'p') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 't') goto yy437; + goto yy363; +yy451: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'r') goto yy454; + if (yych != 't') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy462; + goto yy363; +yy454: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 't') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'b') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy363; + ++YYCURSOR; +#line 672 "../src/parse/scanner_lex.re" + { return CONF_STARTLABEL; } +#line 2579 "src/parse/scanner_lex.cc" +yy462: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != ':') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'a') goto yy464; + if (yych == 'n') goto yy465; + goto yy363; +yy464: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'b') goto yy475; + goto yy363; +yy465: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'x') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 't') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'b') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy363; + ++YYCURSOR; +#line 674 "../src/parse/scanner_lex.re" + { return CONF_STATE_NEXTLABEL; } +#line 2611 "src/parse/scanner_lex.cc" +yy475: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'o') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'r') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 't') goto yy363; + ++YYCURSOR; +#line 673 "../src/parse/scanner_lex.re" + { return CONF_STATE_ABORT; } +#line 2622 "src/parse/scanner_lex.cc" +yy480: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'b') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == ':') goto yy485; + if (yych != 'p') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'r') goto yy501; + goto yy363; +yy485: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'y') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'y') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'F') goto yy488; + if (yych == 'N') goto yy489; + goto yy363; +yy488: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'i') goto yy494; + goto yy363; +yy489: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'x') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 't') goto yy363; +yy492: + ++YYCURSOR; +#line 623 "../src/parse/scanner_lex.re" + { + tok += sizeof "label:" - 1; + yylval.str = new std::string (tok, tok_len ()); + return CONF; + } +#line 2664 "src/parse/scanner_lex.cc" +yy494: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'L') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'b') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'l') goto yy492; + goto yy363; +yy501: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'f') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'i') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'x') goto yy363; + ++YYCURSOR; +#line 671 "../src/parse/scanner_lex.re" + { return CONF_LABELPREFIX; } +#line 2693 "src/parse/scanner_lex.cc" +yy507: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'd') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 't') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != ':') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 'r') goto yy363; + if (yych <= 's') goto yy514; + if (yych >= 'u') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'o') goto yy521; + goto yy363; +yy514: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 't') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'r') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'i') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'g') goto yy363; + ++YYCURSOR; +#line 669 "../src/parse/scanner_lex.re" + { return CONF_INDENT_STRING; } +#line 2726 "src/parse/scanner_lex.cc" +yy521: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'p') goto yy363; + ++YYCURSOR; +#line 670 "../src/parse/scanner_lex.re" + { return CONF_INDENT_TOP; } +#line 2733 "src/parse/scanner_lex.cc" +yy524: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'g') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 's') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != ':') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 'e') { + if (yych == '8') goto yy529; + if (yych <= 'd') goto yy363; + } else { + if (yych <= 'u') { + if (yych <= 't') goto yy363; + } else { + if (yych <= 'v') goto yy363; + if (yych >= 'y') goto yy363; + } + } +yy529: + ++YYCURSOR; +#line 658 "../src/parse/scanner_lex.re" + { + switch (YYCURSOR[-1]) + { + case 'e': yylval.enc = Enc::EBCDIC; break; + case 'w': yylval.enc = Enc::UCS2; break; + case 'x': yylval.enc = Enc::UTF16; break; + case 'u': yylval.enc = Enc::UTF32; break; + case '8': yylval.enc = Enc::UTF8; break; + } + return CONF_FLAGS; + } +#line 2769 "src/parse/scanner_lex.cc" +yy531: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'f') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'i') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != ':') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'Y') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'Y') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + switch (yych) { + case 'B': goto yy542; + case 'C': goto yy543; + case 'D': goto yy544; + case 'F': goto yy541; + case 'G': goto yy540; + case 'L': goto yy545; + case 'M': goto yy546; + case 'P': goto yy547; + case 'R': goto yy548; + case 'S': goto yy539; + default: goto yy363; + } +yy539: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'E') goto yy649; + if (yych == 'K') goto yy648; + goto yy363; +yy540: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'E') goto yy618; + goto yy363; +yy541: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'I') goto yy603; + goto yy363; +yy542: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'A') goto yy596; + goto yy363; +yy543: + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 'S') { + if (yych == 'O') goto yy579; + goto yy363; + } else { + if (yych <= 'T') goto yy578; + if (yych <= 'U') goto yy577; + goto yy363; + } +yy544: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'E') goto yy574; + goto yy363; +yy545: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'E') goto yy566; + if (yych == 'I') goto yy565; + goto yy363; +yy546: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'A') goto yy561; + goto yy363; +yy547: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'E') goto yy559; + goto yy363; +yy548: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'E') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'S') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'T') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'O') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'R') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'E') goto yy363; + yyaccept = 1; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'C') goto yy556; +yy555: +#line 613 "../src/parse/scanner_lex.re" + { + tok += sizeof "define:" - 1; + yylval.str = new std::string (tok, tok_len ()); + return CONF; + } +#line 2866 "src/parse/scanner_lex.cc" +yy556: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'T') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'X') goto yy363; +yy558: + yych = (YYCTYPE)*++YYCURSOR; + goto yy555; +yy559: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'E') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'K') goto yy558; + goto yy363; +yy561: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'R') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'K') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'E') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'R') goto yy558; + goto yy363; +yy565: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'M') goto yy572; + goto yy363; +yy566: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'S') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'S') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'T') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'H') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'A') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'N') goto yy558; + goto yy363; +yy572: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'I') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'T') goto yy558; + goto yy363; +yy574: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'B') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'U') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'G') goto yy558; + goto yy363; +yy577: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'R') goto yy593; + goto yy363; +yy578: + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 'W') goto yy363; + if (yych <= 'X') goto yy585; + if (yych <= 'Y') goto yy586; + goto yy363; +yy579: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'N') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'D') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'T') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'Y') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'P') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'E') goto yy558; + goto yy363; +yy585: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'M') goto yy588; + goto yy363; +yy586: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'P') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'E') goto yy558; + goto yy363; +yy588: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'A') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'R') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'K') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'E') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'R') goto yy558; + goto yy363; +yy593: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'S') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'O') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'R') goto yy558; + goto yy363; +yy596: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'C') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'K') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'U') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'P') goto yy363; + yyaccept = 1; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych != 'C') goto yy555; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'T') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'X') goto yy558; + goto yy363; +yy603: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'L') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'L') goto yy363; + yyaccept = 1; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == ':') goto yy607; + if (yych != '@') goto yy555; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'l') goto yy614; + goto yy363; +yy607: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'k') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'd') goto yy363; + ++YYCURSOR; +#line 650 "../src/parse/scanner_lex.re" + { return CONF_DEFINE_YYFILL_NAKED; } +#line 3020 "src/parse/scanner_lex.cc" +yy614: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy363; + ++YYCURSOR; +#line 651 "../src/parse/scanner_lex.re" + { return CONF_DEFINE_YYFILL_LEN; } +#line 3029 "src/parse/scanner_lex.cc" +yy618: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'T') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'C') goto yy621; + if (yych != 'S') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'T') goto yy637; + goto yy363; +yy621: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'O') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'N') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'D') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'I') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'T') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'I') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'O') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'N') goto yy363; + yyaccept = 1; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych != ':') goto yy555; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'k') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'd') goto yy363; + ++YYCURSOR; +#line 652 "../src/parse/scanner_lex.re" + { return CONF_DEFINE_YYGETCONDITION_NAKED; } +#line 3072 "src/parse/scanner_lex.cc" +yy637: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'A') goto yy363; yych = (YYCTYPE)*++YYCURSOR; - if (yych == '/') goto yy326; - goto yy319; -yy323: + if (yych != 'T') goto yy363; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '*') goto yy319; - ++YYCURSOR; -#line 552 "../src/parse/scanner_lex.re" - { - ++depth; - fatal("ambiguous /* found"); - goto comment; - } -#line 2179 "src/parse/scanner_lex.cc" -yy326: - ++YYCURSOR; -#line 542 "../src/parse/scanner_lex.re" - { - if (--depth == 0) - { - goto scan; - } - else - { - goto comment; - } - } -#line 2193 "src/parse/scanner_lex.cc" -yy328: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = (YYCTYPE)*YYCURSOR; - if (yybm[0+yych] & 32) { - goto yy328; - } - if (yych == '#') goto yy331; -yy330: - YYCURSOR = YYMARKER; - goto yy321; -yy331: + if (yych != 'E') goto yy363; + yyaccept = 1; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych != ':') goto yy555; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'k') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'd') goto yy363; ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); - yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x1F) { - if (yych == '\t') goto yy331; - goto yy330; - } else { - if (yych <= ' ') goto yy331; - if (yych != 'l') goto yy330; - } +#line 653 "../src/parse/scanner_lex.re" + { return CONF_DEFINE_YYGETSTATE_NAKED; } +#line 3096 "src/parse/scanner_lex.cc" +yy648: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy330; + if (yych == 'I') goto yy685; + goto yy363; +yy649: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy330; + if (yych != 'T') goto yy363; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy330; + if (yych == 'C') goto yy652; + if (yych != 'S') goto yy363; yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '0') goto yy338; - if (yych <= '9') goto yy330; - goto yy338; -yy337: - YYCTXMARKER = YYCURSOR + 1; + if (yych == 'T') goto yy667; + goto yy363; +yy652: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'O') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'N') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'D') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'I') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'T') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'I') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'O') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'N') goto yy363; + yyaccept = 1; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych != '@') goto yy555; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'c') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'o') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'd') goto yy363; ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = (YYCTYPE)*YYCURSOR; -yy338: - if (yych <= 0x1F) { - if (yych == '\t') goto yy337; - goto yy330; - } else { - if (yych <= ' ') goto yy337; - if (yych <= '0') goto yy330; - if (yych >= ':') goto yy330; - } -yy339: +#line 654 "../src/parse/scanner_lex.re" + { return CONF_DEFINE_YYSETCONDITION_COND; } +#line 3141 "src/parse/scanner_lex.cc" +yy667: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'A') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'T') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'E') goto yy363; + yyaccept = 1; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == ':') goto yy672; + if (yych != '@') goto yy555; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 's') goto yy679; + goto yy363; +yy672: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'k') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'd') goto yy363; ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = (YYCTYPE)*YYCURSOR; - if (yybm[0+yych] & 64) { - goto yy339; - } - if (yych <= '\f') { - if (yych <= 0x08) goto yy330; - if (yych <= '\t') goto yy341; - if (yych <= '\n') goto yy343; - goto yy330; - } else { - if (yych <= '\r') goto yy345; - if (yych != ' ') goto yy330; - } -yy341: +#line 655 "../src/parse/scanner_lex.re" + { return CONF_DEFINE_YYSETSTATE_NAKED; } +#line 3170 "src/parse/scanner_lex.cc" +yy679: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 't') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 't') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x1F) { - if (yych == '\t') goto yy341; - goto yy330; +#line 656 "../src/parse/scanner_lex.re" + { return CONF_DEFINE_YYSETSTATE_STATE; } +#line 3183 "src/parse/scanner_lex.cc" +yy685: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'P') goto yy558; + goto yy363; +yy686: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'o') goto yy734; + goto yy363; +yy687: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'd') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 'd') { + if (yych == ':') goto yy692; + goto yy363; } else { - if (yych <= ' ') goto yy341; - if (yych == '"') goto yy346; - goto yy330; + if (yych <= 'e') goto yy691; + if (yych != 'p') goto yy363; } -yy343: - ++YYCURSOR; - YYCURSOR = YYCTXMARKER; -#line 557 "../src/parse/scanner_lex.re" - { - set_sourceline (); - goto comment; - } -#line 2276 "src/parse/scanner_lex.cc" -yy345: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy343; - goto yy330; -yy346: + if (yych == 'r') goto yy728; + goto yy363; +yy691: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'n') goto yy718; + goto yy363; +yy692: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'd') goto yy694; + if (yych != 'g') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'o') goto yy708; + goto yy363; +yy694: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'i') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'v') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'i') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'd') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'r') goto yy363; + yyaccept = 2; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == '@') goto yy702; +yy701: +#line 645 "../src/parse/scanner_lex.re" + { return CONF_COND_DIVIDER; } +#line 3238 "src/parse/scanner_lex.cc" +yy702: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'c') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'o') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'd') goto yy363; ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); - yych = (YYCTYPE)*YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy346; - } - if (yych <= '\n') goto yy330; - if (yych <= '"') goto yy349; +#line 646 "../src/parse/scanner_lex.re" + { return CONF_COND_DIVIDER_COND; } +#line 3251 "src/parse/scanner_lex.cc" +yy708: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 't') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'o') goto yy363; + yyaccept = 3; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == '@') goto yy712; +yy711: +#line 647 "../src/parse/scanner_lex.re" + { return CONF_COND_GOTO; } +#line 3263 "src/parse/scanner_lex.cc" +yy712: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'c') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'o') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'd') goto yy363; ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy330; - goto yy346; -yy349: +#line 648 "../src/parse/scanner_lex.re" + { return CONF_COND_GOTO_COND; } +#line 3276 "src/parse/scanner_lex.cc" +yy718: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'u') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'm') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'p') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'r') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'f') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'i') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'x') goto yy363; ++YYCURSOR; - if ((yych = (YYCTYPE)*YYCURSOR) == '\n') goto yy343; - if (yych == '\r') goto yy345; - goto yy330; -} -#line 577 "../src/parse/scanner_lex.re" - - -nextLine: - -#line 2306 "src/parse/scanner_lex.cc" -{ - YYCTYPE yych; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy354; +#line 644 "../src/parse/scanner_lex.re" + { return CONF_CONDENUMPREFIX; } +#line 3297 "src/parse/scanner_lex.cc" +yy728: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'f') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'i') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'x') goto yy363; ++YYCURSOR; -#line 588 "../src/parse/scanner_lex.re" - { if(cur == eof) { - return 0; - } - goto nextLine; - } -#line 2319 "src/parse/scanner_lex.cc" -yy354: +#line 643 "../src/parse/scanner_lex.re" + { return CONF_CONDPREFIX; } +#line 3310 "src/parse/scanner_lex.cc" +yy734: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 't') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'o') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != ':') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 't') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'h') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'r') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 's') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'h') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'o') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy363; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'd') goto yy363; ++YYCURSOR; -#line 581 "../src/parse/scanner_lex.re" - { if(cur == eof) { - return 0; - } - tok = pos = cur; - cline++; - goto scan; - } -#line 2330 "src/parse/scanner_lex.cc" +#line 649 "../src/parse/scanner_lex.re" + { return CONF_CGOTO_THRESHOLD; } +#line 3339 "src/parse/scanner_lex.cc" } -#line 593 "../src/parse/scanner_lex.re" +#line 681 "../src/parse/scanner_lex.re" -config: +conf_eq: -#line 2337 "src/parse/scanner_lex.cc" +#line 3346 "src/parse/scanner_lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2373,62 +3382,64 @@ config: if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy360; + if (yych == '\t') goto yy752; } else { - if (yych <= ' ') goto yy360; - if (yych == '=') goto yy362; + if (yych <= ' ') goto yy752; + if (yych == '=') goto yy753; } ++YYCURSOR; -#line 604 "../src/parse/scanner_lex.re" - { - fatal("missing '='"); - } -#line 2387 "src/parse/scanner_lex.cc" -yy360: - ++YYCURSOR; - yych = (YYCTYPE)*YYCURSOR; - goto yy367; -yy361: -#line 597 "../src/parse/scanner_lex.re" - { - goto config; - } -#line 2397 "src/parse/scanner_lex.cc" -yy362: +yy751: +#line 685 "../src/parse/scanner_lex.re" + { fatal ("missing '=' in configuration"); } +#line 3395 "src/parse/scanner_lex.cc" +yy752: + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych <= 0x1F) { + if (yych == '\t') goto yy757; + goto yy751; + } else { + if (yych <= ' ') goto yy757; + if (yych == '=') goto yy755; + goto yy751; + } +yy753: ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; - goto yy365; -yy363: -#line 600 "../src/parse/scanner_lex.re" - { - lexer_state = LEX_CONFIG_VALUE; - return '='; - } -#line 2408 "src/parse/scanner_lex.cc" -yy364: + goto yy756; +yy754: +#line 686 "../src/parse/scanner_lex.re" + { goto conf_val; } +#line 3413 "src/parse/scanner_lex.cc" +yy755: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy365: +yy756: if (yybm[0+yych] & 128) { - goto yy364; + goto yy755; } - goto yy363; -yy366: + goto yy754; +yy757: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy367: - if (yych == '\t') goto yy366; - if (yych == ' ') goto yy366; - goto yy361; + if (yych <= 0x1F) { + if (yych == '\t') goto yy757; + } else { + if (yych <= ' ') goto yy757; + if (yych == '=') goto yy755; + } + YYCURSOR = YYMARKER; + goto yy751; } -#line 607 "../src/parse/scanner_lex.re" +#line 687 "../src/parse/scanner_lex.re" -value: +conf_val: + tok = cur; + lexer_state = LEX_NORMAL; -#line 2432 "src/parse/scanner_lex.cc" +#line 3443 "src/parse/scanner_lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2436,14 +3447,14 @@ value: 248, 192, 0, 248, 248, 192, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, - 192, 248, 104, 248, 248, 248, 248, 152, + 192, 248, 112, 248, 248, 248, 248, 168, 248, 248, 248, 248, 248, 248, 248, 248, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 248, 192, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 8, 248, 248, 248, + 248, 248, 248, 248, 32, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, @@ -2469,198 +3480,205 @@ value: yych = (YYCTYPE)*YYCURSOR; if (yych <= '&') { if (yych <= '\r') { - if (yych <= 0x08) goto yy376; - if (yych <= '\n') goto yy370; - if (yych <= '\f') goto yy376; + if (yych <= 0x08) goto yy772; + if (yych <= '\n') goto yy762; + if (yych <= '\f') goto yy772; } else { if (yych <= ' ') { - if (yych <= 0x1F) goto yy376; + if (yych <= 0x1F) goto yy772; } else { - if (yych == '"') goto yy378; - goto yy376; + if (yych == '"') goto yy768; + goto yy772; } } } else { if (yych <= '/') { - if (yych <= '\'') goto yy380; - if (yych == '-') goto yy373; - goto yy376; + if (yych <= '\'') goto yy770; + if (yych == '-') goto yy765; + goto yy772; } else { if (yych <= '9') { - if (yych <= '0') goto yy371; - goto yy374; + if (yych <= '0') goto yy763; + goto yy766; } else { - if (yych != ';') goto yy376; + if (yych != ';') goto yy772; } } } -yy370: -#line 619 "../src/parse/scanner_lex.re" +yy762: +#line 709 "../src/parse/scanner_lex.re" { - yylval.str = new std::string (tok, tok_len ()); - lexer_state = LEX_NORMAL; - return VALUE; - } -#line 2505 "src/parse/scanner_lex.cc" -yy371: + yylval.str = new std::string (tok, tok_len ()); + return STR; + } +#line 3515 "src/parse/scanner_lex.cc" +yy763: ++YYCURSOR; - if (yybm[0+(yych = (YYCTYPE)*YYCURSOR)] & 8) { - goto yy376; + if (yybm[0+(yych = (YYCTYPE)*YYCURSOR)] & 32) { + goto yy772; } -yy372: -#line 611 "../src/parse/scanner_lex.re" +yy764: +#line 694 "../src/parse/scanner_lex.re" { - if (!s_to_i32_unsafe (tok, cur, yylval.number)) - { - fatal ("configuration value overflow"); - } - lexer_state = LEX_NORMAL; - return NUMBER; - } -#line 2521 "src/parse/scanner_lex.cc" -yy373: + if (!s_to_i32_unsafe (tok, cur, yylval.num)) + { + fatal ("configuration value overflow"); + } + return NUM; + } +#line 3530 "src/parse/scanner_lex.cc" +yy765: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '0') goto yy377; - if (yych >= ':') goto yy377; -yy374: + if (yych <= '0') goto yy773; + if (yych >= ':') goto yy773; +yy766: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 4) { - goto yy374; + goto yy766; } if (yych <= '\r') { - if (yych <= 0x08) goto yy376; - if (yych <= '\n') goto yy372; - if (yych >= '\r') goto yy372; + if (yych <= 0x08) goto yy772; + if (yych <= '\n') goto yy764; + if (yych <= '\f') goto yy772; + goto yy764; } else { if (yych <= ' ') { - if (yych >= ' ') goto yy372; + if (yych <= 0x1F) goto yy772; + goto yy764; } else { - if (yych == ';') goto yy372; + if (yych == ';') goto yy764; + goto yy772; } } -yy376: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = (YYCTYPE)*YYCURSOR; -yy377: - if (yybm[0+yych] & 8) { - goto yy376; - } - goto yy370; -yy378: +yy768: YYMARKER = ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; - if (yybm[0+yych] & 16) { - goto yy378; + if (yybm[0+yych] & 8) { + goto yy768; } if (yych <= ' ') { - if (yych == '\n') goto yy370; - goto yy388; + if (yych == '\n') goto yy762; + goto yy783; } else { - if (yych <= '"') goto yy376; - if (yych <= ';') goto yy388; - goto yy390; + if (yych <= '"') goto yy774; + if (yych <= ';') goto yy783; + goto yy782; } -yy380: +yy770: YYMARKER = ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; - if (yybm[0+yych] & 32) { - goto yy380; + if (yybm[0+yych] & 16) { + goto yy770; } if (yych <= ' ') { - if (yych == '\n') goto yy370; + if (yych == '\n') goto yy762; + goto yy777; } else { - if (yych <= '\'') goto yy376; - if (yych >= '<') goto yy385; + if (yych <= '\'') goto yy774; + if (yych <= ';') goto yy777; + goto yy776; } -yy382: +yy772: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yybm[0+yych] & 64) { - goto yy382; +yy773: + if (yybm[0+yych] & 32) { + goto yy772; } - if (yych <= '\n') goto yy384; - if (yych <= '\'') goto yy386; - goto yy387; -yy384: - YYCURSOR = YYMARKER; - goto yy370; -yy385: + goto yy762; +yy774: + ++YYCURSOR; + if (yybm[0+(yych = (YYCTYPE)*YYCURSOR)] & 32) { + goto yy772; + } +yy775: +#line 702 "../src/parse/scanner_lex.re" + { + yylval.str = new std::string (); + SubStr s (tok + 1, tok_len () - 2); // skip quotes + unescape (s, *(yylval.str)); + return STR; + } +#line 3608 "src/parse/scanner_lex.cc" +yy776: YYMARKER = ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\r') { if (yych <= '\t') { - if (yych <= 0x08) goto yy380; - goto yy382; + if (yych <= 0x08) goto yy770; } else { - if (yych <= '\n') goto yy370; - if (yych <= '\f') goto yy380; - goto yy382; + if (yych <= '\n') goto yy762; + if (yych <= '\f') goto yy770; } } else { if (yych <= ' ') { - if (yych <= 0x1F) goto yy380; - goto yy382; + if (yych <= 0x1F) goto yy770; } else { - if (yych == ';') goto yy382; - goto yy380; + if (yych != ';') goto yy770; } } -yy386: - yych = (YYCTYPE)*++YYCURSOR; - goto yy370; -yy387: +yy777: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy384; - goto yy382; -yy388: + if (yybm[0+yych] & 64) { + goto yy777; + } + if (yych <= '\n') goto yy779; + if (yych <= '\'') goto yy780; + goto yy781; +yy779: + YYCURSOR = YYMARKER; + goto yy762; +yy780: + yych = (YYCTYPE)*++YYCURSOR; + goto yy775; +yy781: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy388; - } - if (yych <= '\n') goto yy384; - if (yych <= '"') goto yy386; - goto yy391; -yy390: + if (yych == '\n') goto yy779; + goto yy777; +yy782: YYMARKER = ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\r') { if (yych <= '\t') { - if (yych <= 0x08) goto yy378; - goto yy388; + if (yych <= 0x08) goto yy768; } else { - if (yych <= '\n') goto yy370; - if (yych <= '\f') goto yy378; - goto yy388; + if (yych <= '\n') goto yy762; + if (yych <= '\f') goto yy768; } } else { if (yych <= ' ') { - if (yych <= 0x1F) goto yy378; - goto yy388; + if (yych <= 0x1F) goto yy768; } else { - if (yych == ';') goto yy388; - goto yy378; + if (yych != ';') goto yy768; } } -yy391: +yy783: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy783; + } + if (yych <= '\n') goto yy779; + if (yych <= '"') goto yy780; ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy384; - goto yy388; + if (yych == '\n') goto yy779; + goto yy783; } -#line 624 "../src/parse/scanner_lex.re" +#line 713 "../src/parse/scanner_lex.re" } @@ -2683,7 +3701,7 @@ void Scanner::set_sourceline () sourceline: tok = cur; -#line 2687 "src/parse/scanner_lex.cc" +#line 3705 "src/parse/scanner_lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2723,23 +3741,23 @@ sourceline: if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '!') { - if (yych == '\n') goto yy396; + if (yych == '\n') goto yy790; } else { - if (yych <= '"') goto yy398; - if (yych <= '0') goto yy394; - if (yych <= '9') goto yy399; + if (yych <= '"') goto yy792; + if (yych <= '0') goto yy788; + if (yych <= '9') goto yy793; } -yy394: +yy788: ++YYCURSOR; -yy395: -#line 669 "../src/parse/scanner_lex.re" +yy789: +#line 758 "../src/parse/scanner_lex.re" { goto sourceline; } -#line 2740 "src/parse/scanner_lex.cc" -yy396: +#line 3758 "src/parse/scanner_lex.cc" +yy790: ++YYCURSOR; -#line 657 "../src/parse/scanner_lex.re" +#line 746 "../src/parse/scanner_lex.re" { if (cur == eof) { @@ -2752,17 +3770,17 @@ yy396: tok = cur; return; } -#line 2756 "src/parse/scanner_lex.cc" -yy398: +#line 3774 "src/parse/scanner_lex.cc" +yy792: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == '\n') goto yy395; - goto yy404; -yy399: + if (yych == '\n') goto yy789; + goto yy798; +yy793: ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; - goto yy402; -yy400: -#line 646 "../src/parse/scanner_lex.re" + goto yy796; +yy794: +#line 735 "../src/parse/scanner_lex.re" { if (!s_to_u32_unsafe (tok, cur, cline)) { @@ -2770,46 +3788,46 @@ yy400: } goto sourceline; } -#line 2774 "src/parse/scanner_lex.cc" -yy401: +#line 3792 "src/parse/scanner_lex.cc" +yy795: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy402: +yy796: if (yybm[0+yych] & 64) { - goto yy401; + goto yy795; } - goto yy400; -yy403: + goto yy794; +yy797: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy404: +yy798: if (yybm[0+yych] & 128) { - goto yy403; + goto yy797; } - if (yych <= '\n') goto yy405; - if (yych <= '"') goto yy407; - goto yy406; -yy405: + if (yych <= '\n') goto yy799; + if (yych <= '"') goto yy801; + goto yy800; +yy799: YYCURSOR = YYMARKER; - goto yy395; -yy406: + goto yy789; +yy800: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy405; - goto yy403; -yy407: + if (yych == '\n') goto yy799; + goto yy797; +yy801: ++YYCURSOR; -#line 653 "../src/parse/scanner_lex.re" +#line 742 "../src/parse/scanner_lex.re" { escape (in.file_name, std::string (tok + 1, tok_len () - 2)); // -2 to omit quotes goto sourceline; } -#line 2811 "src/parse/scanner_lex.cc" +#line 3829 "src/parse/scanner_lex.cc" } -#line 672 "../src/parse/scanner_lex.re" +#line 761 "../src/parse/scanner_lex.re" } diff --git a/re2c/src/codegen/go_emit.cc b/re2c/src/codegen/go_emit.cc index 542108fd..08ea9009 100644 --- a/re2c/src/codegen/go_emit.cc +++ b/re2c/src/codegen/go_emit.cc @@ -68,7 +68,7 @@ void Case::emit (OutputFile & o, uint32_t ind) o << indent (ind) << "case "; o.write_char_hex (b); o << ":"; - if (dFlag && encoding.is (Enc::EBCDIC)) + if (dFlag && encoding.type () == Enc::EBCDIC) { const uint32_t c = encoding.decodeUnsafe (b); if (is_print (c)) diff --git a/re2c/src/codegen/print.cc b/re2c/src/codegen/print.cc index 58d06345..465451b8 100644 --- a/re2c/src/codegen/print.cc +++ b/re2c/src/codegen/print.cc @@ -35,7 +35,7 @@ char hexCh(uint32_t c) void prtChOrHex(std::ostream& o, uint32_t c) { - if (!encoding.is (Enc::EBCDIC) + if (encoding.type () != Enc::EBCDIC && (is_print (c) || is_space (c))) { o << '\''; @@ -120,7 +120,7 @@ void prtCh(std::ostream& o, uint32_t c) void prtChOrHexForSpan(std::ostream& o, uint32_t c) { - if (!encoding.is(Enc::EBCDIC) + if (encoding.type () != Enc::EBCDIC && is_print (c) && (c != ']')) { diff --git a/re2c/src/ir/regexp/encoding/enc.cc b/re2c/src/ir/regexp/encoding/enc.cc index 029d525c..10e0a2d2 100644 --- a/re2c/src/ir/regexp/encoding/enc.cc +++ b/re2c/src/ir/regexp/encoding/enc.cc @@ -65,7 +65,7 @@ bool Enc::encode(uint32_t & c) const return false; } - switch (type) + switch (type_) { case ASCII: return true; @@ -80,7 +80,7 @@ bool Enc::encode(uint32_t & c) const return true; else { - switch (policy) + switch (policy_) { case POLICY_FAIL: return false; @@ -101,7 +101,7 @@ bool Enc::encode(uint32_t & c) const */ uint32_t Enc::decodeUnsafe(uint32_t c) const { - switch (type) + switch (type_) { case EBCDIC: c = ebc2asc[c & 0xFF]; @@ -136,7 +136,7 @@ Range * Enc::encodeRange(uint32_t l, uint32_t h) const } Range * r = NULL; - switch (type) + switch (type_) { case ASCII: r = Range::ran (l, h + 1); @@ -159,7 +159,7 @@ Range * Enc::encodeRange(uint32_t l, uint32_t h) const r = Range::ran (l, h + 1); if (l <= SURR_MAX && h >= SURR_MIN) { - switch (policy) + switch (policy_) { case POLICY_FAIL: r = NULL; @@ -194,7 +194,7 @@ Range * Enc::encodeRange(uint32_t l, uint32_t h) const Range * Enc::fullRange() const { Range * r = Range::ran (0, nCodePoints()); - if (policy != POLICY_IGNORE) + if (policy_ != POLICY_IGNORE) { Range * surrs = Range::ran (SURR_MIN, SURR_MAX + 1); r = Range::sub (r, surrs); diff --git a/re2c/src/ir/regexp/encoding/enc.h b/re2c/src/ir/regexp/encoding/enc.h index daa76dbd..6ca21a41 100644 --- a/re2c/src/ir/regexp/encoding/enc.h +++ b/re2c/src/ir/regexp/encoding/enc.h @@ -61,16 +61,18 @@ private: static const uint32_t SURR_MAX; static const uint32_t UNICODE_ERROR; - type_t type; - policy_t policy; + type_t type_; + policy_t policy_; public: Enc() - : type (ASCII) - , policy (POLICY_IGNORE) + : type_ (ASCII) + , policy_ (POLICY_IGNORE) { } - bool operator != (const Enc & e) const { return type != e.type; } + static const char * name (type_t t); + + bool operator != (const Enc & e) const { return type_ != e.type_; } inline uint32_t nCodePoints() const; inline uint32_t nCodeUnits() const; @@ -79,7 +81,7 @@ public: inline bool set(type_t t); inline void unset(type_t); - inline bool is(type_t) const; + inline type_t type () const; inline void setPolicy(policy_t t); @@ -89,9 +91,23 @@ public: Range * fullRange() const; }; +inline const char * Enc::name (type_t t) +{ + switch (t) + { + case ASCII: return "ASCII"; + case EBCDIC: return "EBCDIC"; + case UTF8: return "UTF8"; + case UCS2: return "USC2"; + case UTF16: return "UTF16"; + case UTF32: return "UTF32"; + default: return ""; + } +} + inline uint32_t Enc::nCodePoints() const { - switch (type) + switch (type_) { case ASCII: case EBCDIC: return 0x100; @@ -105,7 +121,7 @@ inline uint32_t Enc::nCodePoints() const inline uint32_t Enc::nCodeUnits() const { - switch (type) + switch (type_) { case ASCII: case EBCDIC: @@ -120,7 +136,7 @@ inline uint32_t Enc::nCodeUnits() const // returns *maximal* code point size for encoding inline uint32_t Enc::szCodePoint() const { - switch (type) + switch (type_) { case ASCII: case EBCDIC: return 1; @@ -134,7 +150,7 @@ inline uint32_t Enc::szCodePoint() const inline uint32_t Enc::szCodeUnit() const { - switch (type) + switch (type_) { case ASCII: case EBCDIC: @@ -148,31 +164,31 @@ inline uint32_t Enc::szCodeUnit() const inline bool Enc::set(type_t t) { - if (type == t) + if (type_ == t) return true; - else if (type != ASCII) + else if (type_ != ASCII) return false; else { - type = t; + type_ = t; return true; } } inline void Enc::unset(type_t t) { - if (type == t) - type = ASCII; + if (type_ == t) + type_ = ASCII; } -inline bool Enc::is(type_t t) const +inline Enc::type_t Enc::type () const { - return type == t; + return type_; } inline void Enc::setPolicy(policy_t t) { - policy = t; + policy_ = t; } } // namespace re2c diff --git a/re2c/src/ir/regexp/regexp.cc b/re2c/src/ir/regexp/regexp.cc index fa2f46fd..2771441f 100644 --- a/re2c/src/ir/regexp/regexp.cc +++ b/re2c/src/ir/regexp/regexp.cc @@ -115,12 +115,12 @@ RegExp * Scanner::matchSymbol(uint32_t c) const if (!encoding.encode(c)) fatalf("Bad code point: '0x%X'", c); - if (encoding.is(Enc::UTF16)) - return UTF16Symbol(c); - else if (encoding.is(Enc::UTF8)) - return UTF8Symbol(c); - else - return new MatchOp (Range::sym (c)); + switch (encoding.type ()) + { + case Enc::UTF16: return UTF16Symbol(c); + case Enc::UTF8: return UTF8Symbol(c); + default: return new MatchOp (Range::sym (c)); + } } RegExp * Scanner::matchSymbolRange(Range * r) const @@ -141,12 +141,12 @@ RegExp * Scanner::matchSymbolRange(Range * r) const } } - if (encoding.is(Enc::UTF16)) - return UTF16Range(r); - else if (encoding.is(Enc::UTF8)) - return UTF8Range(r); - else - return new MatchOp(r); + switch (encoding.type ()) + { + case Enc::UTF16: return UTF16Range(r); + case Enc::UTF8: return UTF8Range(r); + default: return new MatchOp(r); + } } RegExp * Scanner::cpoint_string (const std::vector & cs, bool case_insensitive) const diff --git a/re2c/src/parse/parser.ypp b/re2c/src/parse/parser.ypp index fba9a9f5..1869a633 100644 --- a/re2c/src/parse/parser.ypp +++ b/re2c/src/parse/parser.ypp @@ -9,6 +9,7 @@ #include "config.h" #include "src/ir/bytecode/bytecode.h" +#include "src/ir/regexp/encoding/enc.h" #include "src/ir/regexp/encoding/range_suffix.h" #include "src/ir/regexp/regexp_cat.h" #include "src/ir/regexp/regexp_close.h" @@ -132,27 +133,94 @@ void default_rule(CondList *clist, const Code * code) %start spec %union { - re2c::RegExp *regexp; + re2c::RegExp * regexp; const re2c::Code * code; - char op; - int number; - re2c::ExtOp extop; - std::string *str; - re2c::CondList *clist; + char op; + int num; + re2c::ExtOp extop; + std::string * str; + re2c::CondList * clist; + re2c::Enc::type_t enc; }; -%token CLOSESIZE CLOSE STAR NOCOND ID CODE RANGE STRING -%token CONFIG VALUE NUMBER SETUP FID FID_END - -%type CLOSE STAR SETUP FID_END -%type close -%type CLOSESIZE -%type CODE -%type RANGE STRING -%type rule look expr diff term factor primary -%type CONFIG VALUE newcond ID FID -%type cond clist -%type NUMBER +%token CLOSE +%token CLOSESIZE +%token CODE +%token CONF +%token CONF_CONDPREFIX +%token CONF_CONDENUMPREFIX +%token CONF_COND_DIVIDER +%token CONF_COND_DIVIDER_COND +%token CONF_COND_GOTO +%token CONF_COND_GOTO_COND +%token CONF_CGOTO_THRESHOLD +%token CONF_DEFINE_YYBACKUP +%token CONF_DEFINE_YYBACKUPCTX +%token CONF_DEFINE_YYCONDTYPE +%token CONF_DEFINE_YYCTXMARKER +%token CONF_DEFINE_YYCTYPE +%token CONF_DEFINE_YYCURSOR +%token CONF_DEFINE_YYDEBUG +%token CONF_DEFINE_YYFILL +%token CONF_DEFINE_YYFILL_NAKED +%token CONF_DEFINE_YYFILL_LEN +%token CONF_DEFINE_YYGETCONDITION +%token CONF_DEFINE_YYGETCONDITION_NAKED +%token CONF_DEFINE_YYGETSTATE +%token CONF_DEFINE_YYGETSTATE_NAKED +%token CONF_DEFINE_YYLESSTHAN +%token CONF_DEFINE_YYLIMIT +%token CONF_DEFINE_YYMARKER +%token CONF_DEFINE_YYPEEK +%token CONF_DEFINE_YYRESTORE +%token CONF_DEFINE_YYRESTORECTX +%token CONF_DEFINE_YYSETCONDITION +%token CONF_DEFINE_YYSETCONDITION_COND +%token CONF_DEFINE_YYSETSTATE +%token CONF_DEFINE_YYSETSTATE_NAKED +%token CONF_DEFINE_YYSETSTATE_STATE +%token CONF_DEFINE_YYSKIP +%token CONF_FLAGS +%token CONF_INDENT_STRING +%token CONF_INDENT_TOP +%token CONF_LABEL_YYFILLLABEL +%token CONF_LABEL_YYNEXT +%token CONF_LABELPREFIX +%token CONF_STARTLABEL +%token CONF_STATE_ABORT +%token CONF_STATE_NEXTLABEL +%token CONF_VARIABLE_YYACCEPT +%token CONF_VARIABLE_YYBM +%token CONF_VARIABLE_YYCH +%token CONF_VARIABLE_YYCTABLE +%token CONF_VARIABLE_YYSTABLE +%token CONF_VARIABLE_YYTARGET +%token CONF_YYBM_HEX +%token CONF_YYCH_CONVERSION +%token CONF_YYCH_EMIT +%token CONF_YYFILL_CHECK +%token CONF_YYFILL_ENABLE +%token CONF_YYFILL_PARAMETER +%token ID +%token FID +%token FID_END +%token NOCOND +%token NUM +%token RANGE +%token SETUP +%token STAR +%token STR +%token STRING + +%type CLOSE STAR SETUP close +%type CLOSESIZE +%type CODE +%type RANGE STRING +%type rule look expr diff term factor primary +%type ID FID STR CONF newcond +%type cond clist +%type NUM +%type CONF_FLAGS %% @@ -194,17 +262,144 @@ decl: { in->fatal("trailing contexts are not allowed in named definitions"); } - | CONFIG '=' VALUE ';' + | CONF STR ';' + { + if (!mapCodeName.insert (std::make_pair (*$1, *$2)).second) { - in->config (* $1, * $3); - delete $1; - delete $3; + in->fatalf ("configuration '%s' is already set and cannot be changed", $1->c_str ()); + } + delete $1; + } + | CONF_CONDPREFIX STR ';' + { + condPrefix = *$2; + } + | CONF_CONDENUMPREFIX STR ';' + { + condEnumPrefix = *$2; + } + | CONF_COND_DIVIDER STR ';' + { + condDivider = *$2; + } + | CONF_COND_DIVIDER_COND STR ';' + { + condDividerParam = *$2; + } + | CONF_COND_GOTO STR ';' + { + condGoto = *$2; + } + | CONF_COND_GOTO_COND STR ';' + { + condGotoParam = *$2; + } + | CONF_CGOTO_THRESHOLD NUM ';' + { + cGotoThreshold = $2; + } + | CONF_DEFINE_YYFILL_NAKED NUM ';' + { + bUseYYFillNaked = $2 != 0; + } + | CONF_DEFINE_YYFILL_LEN STR ';' + { + yyFillLength = *$2; + bUseYYFillParam = false; + } + | CONF_DEFINE_YYGETCONDITION_NAKED NUM ';' + { + bUseYYGetConditionNaked = $2 != 0; + } + | CONF_DEFINE_YYGETSTATE_NAKED NUM ';' + { + bUseYYGetStateNaked = $2 != 0; + } + | CONF_DEFINE_YYSETCONDITION_COND STR ';' + { + yySetConditionParam = *$2; + bUseYYSetConditionParam = false; + } + | CONF_DEFINE_YYSETSTATE_NAKED NUM ';' + { + bUseYYSetStateNaked = $2 != 0; + } + | CONF_DEFINE_YYSETSTATE_STATE STR ';' + { + yySetStateParam = *$2; + bUseYYSetStateParam = false; + } + | CONF_FLAGS NUM ';' + { + if ($2 == 0) + { + encoding.unset ($1); } - | CONFIG '=' NUMBER ';' + else if (!encoding.set ($1)) { - in->config (* $1, $3); - delete $1; + in->fatalf ("Cannot set %s encoding: please reset %s encoding first" + , Enc::name ($1) + , Enc::name (encoding.type ())); } + } + | CONF_INDENT_STRING STR ';' + { + indString = *$2; + } + | CONF_INDENT_TOP NUM ';' + { + if ($2 < 0) + { + in->fatal ("configuration 'indent:top' must be a positive integer"); + } + topIndent = $2; + } + | CONF_LABELPREFIX STR ';' + { + labelPrefix = *$2; + } + | CONF_STARTLABEL NUM ';' + { + in->out.set_force_start_label ($2 != 0); + } + | CONF_STARTLABEL STR ';' + { + in->out.set_user_start_label (*$2); + } + | CONF_STATE_ABORT NUM ';' + { + bUseStateAbort = $2 != 0; + } + | CONF_STATE_NEXTLABEL NUM ';' + { + bUseStateNext = $2 != 0; + } + | CONF_YYBM_HEX NUM ';' + { + yybmHexTable = $2 != 0; + } + | CONF_YYCH_CONVERSION NUM ';' + { + yychConversion = $2 == 0 + ? "" + : "(" + mapCodeName["YYCTYPE"] + ")"; + } + | CONF_YYCH_EMIT NUM ';' + { + bEmitYYCh = $2 != 0; + } + | CONF_YYFILL_CHECK NUM ';' + { + bUseYYFillCheck = $2 != 0; + } + | CONF_YYFILL_ENABLE NUM ';' + { + bUseYYFill = $2 != 0; + } + | CONF_YYFILL_PARAMETER NUM ';' + { + bUseYYFillParam = $2 != 0; + } ; rule: diff --git a/re2c/src/parse/scanner.cc b/re2c/src/parse/scanner.cc index 2c50b30f..e037f9cb 100644 --- a/re2c/src/parse/scanner.cc +++ b/re2c/src/parse/scanner.cc @@ -14,269 +14,6 @@ namespace re2c { const uint32_t Scanner::BSIZE = 8192; -void Scanner::config(const std::string & cfg, int num) -{ - if (cfg == "indent:top") - { - if (num < 0) - { - fatal("configuration 'indent:top' must be a positive integer"); - } - topIndent = num; - } - else if (cfg == "yybm:hex") - { - yybmHexTable = num != 0; - } - else if (cfg == "startlabel") - { - out.set_force_start_label (num != 0); - } - else if (cfg == "state:abort") - { - bUseStateAbort = num != 0; - } - else if (cfg == "state:nextlabel") - { - bUseStateNext = num != 0; - } - else if (cfg == "yyfill:enable") - { - bUseYYFill = num != 0; - } - else if (cfg == "yyfill:parameter") - { - bUseYYFillParam = num != 0; - } - else if (cfg == "yyfill:check") - { - bUseYYFillCheck = num != 0; - } - else if (cfg == "cgoto:threshold") - { - cGotoThreshold = num; - } - else if (cfg == "yych:conversion") - { - if (num) - { - yychConversion = "("; - yychConversion += mapCodeName["YYCTYPE"]; - yychConversion += ")"; - } - else - { - yychConversion = ""; - } - } - else if (cfg == "yych:emit") - { - bEmitYYCh = num != 0; - } - else if (cfg == "define:YYFILL:naked") - { - bUseYYFillNaked = num != 0; - } - else if (cfg == "define:YYGETCONDITION:naked") - { - bUseYYGetConditionNaked = num != 0; - } - else if (cfg == "define:YYGETSTATE:naked") - { - bUseYYGetStateNaked = num != 0; - } - else if (cfg == "define:YYSETSTATE:naked") - { - bUseYYSetStateNaked = num != 0; - } - else if (cfg == "flags:e") - { - if (num != 0) - { - if (!encoding.set(Enc::EBCDIC)) - fatal("Cannot set '-e' switch: please reset '-w', '-x', '-u' and '-8' switches at first.\n"); - } - else - encoding.unset(Enc::EBCDIC); - } - else if (cfg == "flags:u") - { - if (num != 0) - { - if (!encoding.set(Enc::UTF32)) - fatal("Cannot set '-u' switch: please reset '-e', '-w', '-x' and '-8' switches at first.\n"); - } - else - encoding.unset(Enc::UTF32); - } - else if (cfg == "flags:w") - { - if (num != 0) - { - if (!encoding.set(Enc::UCS2)) - fatal("Cannot set '-w' switch: please reset '-e', '-x', '-u' and '-8' switches at first.\n"); - } - else - encoding.unset(Enc::UCS2); - } - else if (cfg == "flags:x") - { - if (num != 0) - { - if (!encoding.set(Enc::UTF16)) - fatal("Cannot set '-x' switch: please reset '-e', '-x', '-u' and '-8' switches at first.\n"); - } - else - encoding.unset(Enc::UTF16); - } - else if (cfg == "flags:8") - { - if (num != 0) - { - if (!encoding.set(Enc::UTF8)) - fatal("Cannot set '-8' switch: please reset '-e', '-w', '-x' and '-u' switches at first.\n"); - } - else - encoding.unset(Enc::UTF8); - } - else - { - fatalf("unrecognized configuration name '%s' or illegal integer value", cfg.c_str()); - } -} - -static std::set mapVariableKeys; -static std::set mapDefineKeys; -static std::set mapLabelKeys; - -void Scanner::config(const std::string & cfg, const std::string & val) -{ - if (mapDefineKeys.empty()) - { - mapVariableKeys.insert("variable:yyaccept"); - mapVariableKeys.insert("variable:yybm"); - mapVariableKeys.insert("variable:yych"); - mapVariableKeys.insert("variable:yyctable"); - mapVariableKeys.insert("variable:yystable"); - mapVariableKeys.insert("variable:yytarget"); - mapDefineKeys.insert("define:YYBACKUP"); - mapDefineKeys.insert("define:YYBACKUPCTX"); - mapDefineKeys.insert("define:YYCONDTYPE"); - mapDefineKeys.insert("define:YYCTXMARKER"); - mapDefineKeys.insert("define:YYCTYPE"); - mapDefineKeys.insert("define:YYCURSOR"); - mapDefineKeys.insert("define:YYDEBUG"); - mapDefineKeys.insert("define:YYFILL"); - mapDefineKeys.insert("define:YYGETCONDITION"); - mapDefineKeys.insert("define:YYGETSTATE"); - mapDefineKeys.insert("define:YYLESSTHAN"); - mapDefineKeys.insert("define:YYLIMIT"); - mapDefineKeys.insert("define:YYMARKER"); - mapDefineKeys.insert("define:YYPEEK"); - mapDefineKeys.insert("define:YYRESTORE"); - mapDefineKeys.insert("define:YYRESTORECTX"); - mapDefineKeys.insert("define:YYSETCONDITION"); - mapDefineKeys.insert("define:YYSETSTATE"); - mapDefineKeys.insert("define:YYSKIP"); - mapLabelKeys.insert("label:yyFillLabel"); - mapLabelKeys.insert("label:yyNext"); - } - - std::string strVal; - - const size_t val_len = val.size (); - if (val_len >= 2 && val[0] == val[val_len - 1] - && (val[0] == '"' || val[0] == '\'')) - { - SubStr tmp (val.c_str () + 1, val_len - 2); - unescape (tmp, strVal); - } - else - { - strVal = val; - } - - if (cfg == "indent:string") - { - indString = strVal; - } - else if (cfg == "startlabel") - { - out.set_user_start_label (strVal); - } - else if (cfg == "labelprefix") - { - labelPrefix = strVal; - } - else if (cfg == "condprefix") - { - condPrefix = strVal; - } - else if (cfg == "condenumprefix") - { - condEnumPrefix = strVal; - } - else if (cfg == "cond:divider") - { - condDivider = strVal; - } - else if (cfg == "cond:divider@cond") - { - condDividerParam = strVal; - } - else if (cfg == "cond:goto") - { - condGoto = strVal; - } - else if (cfg == "cond:goto@cond") - { - condGotoParam = strVal; - } - else if (cfg == "define:YYFILL@len") - { - yyFillLength = strVal; - bUseYYFillParam = false; - } - else if (cfg == "define:YYSETCONDITION@cond") - { - yySetConditionParam = strVal; - bUseYYSetConditionParam = false; - } - else if (cfg == "define:YYSETSTATE@state") - { - yySetStateParam = strVal; - bUseYYSetStateParam = false; - } - else if (mapVariableKeys.find(cfg) != mapVariableKeys.end()) - { - if (!mapCodeName.insert(std::make_pair(cfg.substr(sizeof("variable:") - 1), strVal)).second) - { - fatalf("variable '%s' already being used and cannot be changed", cfg.c_str()); - } - } - else if (mapDefineKeys.find(cfg) != mapDefineKeys.end()) - { - if (!mapCodeName.insert(std::make_pair(cfg.substr(sizeof("define:") - 1), strVal)).second) - { - fatalf("define '%s' already being used and cannot be changed", cfg.c_str()); - } - } - else if (mapLabelKeys.find(cfg) != mapLabelKeys.end()) - { - if (!mapCodeName.insert(std::make_pair(cfg.substr(sizeof("label:") - 1), strVal)).second) - { - fatalf("label '%s' already being used and cannot be changed", cfg.c_str()); - } - } - else - { - std::string msg = "unrecognized configuration name '"; - msg += cfg; - msg += "' or illegal string value"; - fatal(msg.c_str()); - } -} - ScannerState::ScannerState () : tok (NULL) , ptr (NULL) diff --git a/re2c/src/parse/scanner.h b/re2c/src/parse/scanner.h index d7d8ba50..79fe665a 100644 --- a/re2c/src/parse/scanner.h +++ b/re2c/src/parse/scanner.h @@ -20,8 +20,7 @@ struct ScannerState enum lexer_state_t { LEX_NORMAL, - LEX_CONFIG, - LEX_CONFIG_VALUE, + LEX_CONF, LEX_FLEX_NAME }; @@ -55,6 +54,7 @@ class Scanner: private ScannerState static const uint32_t BSIZE; Input & in; +public: OutputFile & out; private: @@ -90,9 +90,6 @@ public: void fatal(const char*) const; void fatal(ptrdiff_t, const char*) const; - void config(const std::string &, int); - void config(const std::string &, const std::string &); - uint32_t unescape(SubStr &s) const; std::string& unescape(SubStr& str_in, std::string& str_out) const; diff --git a/re2c/src/parse/scanner_lex.re b/re2c/src/parse/scanner_lex.re index f5e408db..976dcf58 100644 --- a/re2c/src/parse/scanner_lex.re +++ b/re2c/src/parse/scanner_lex.re @@ -40,12 +40,9 @@ digit = [0-9]; lineno = [1-9] digit*; number = "0" | ("-"? [1-9] digit*); name = (letter|digit|"_")+; -cname = ":" name; space = [ \t]; ws = (space | [\r\n]); eol = ("\r\n" | "\n"); -config = "re2c" cname+ ("@" name)?; -value = [^\r\n; \t]* | dstring | sstring; lineinf = lineno (space+ dstring)? eol; esc = "\\"; @@ -226,10 +223,9 @@ scan: tok = cur; switch (lexer_state) { - case LEX_NORMAL: goto start; - case LEX_CONFIG: goto config; - case LEX_CONFIG_VALUE: goto value; - case LEX_FLEX_NAME: goto flex_name; + case LEX_NORMAL: goto start; + case LEX_CONF: goto conf_eq; + case LEX_FLEX_NAME: goto flex_name; } start: @@ -329,12 +325,7 @@ start: return ID; } - config { - tok += 5; /* skip "re2c:" */ - lexer_state = LEX_CONFIG; - yylval.str = new std::string (tok, tok_len ()); - return CONFIG; - } + "re2c:" { goto conf; } name / (space+ [^=>,]) { yylval.str = new std::string (tok, tok_len ()); @@ -592,35 +583,133 @@ nextLine: } */ -config: +conf: + tok = cur; + lexer_state = LEX_CONF; /*!re2c - space+ { - goto config; - } - "=" space* { - lexer_state = LEX_CONFIG_VALUE; - return '='; - } - * { - fatal("missing '='"); - } + * { fatal ((tok - pos) - tchar, "unrecognized configuration"); } + + "define:" + ( "YYBACKUP" + | "YYBACKUPCTX" + | "YYCONDTYPE" + | "YYCTXMARKER" + | "YYCTYPE" + | "YYCURSOR" + | "YYDEBUG" + | "YYFILL" + | "YYGETCONDITION" + | "YYGETSTATE" + | "YYLESSTHAN" + | "YYLIMIT" + | "YYMARKER" + | "YYPEEK" + | "YYRESTORE" + | "YYRESTORECTX" + | "YYSETCONDITION" + | "YYSETSTATE" + | "YYSKIP" + ) + { + tok += sizeof "define:" - 1; + yylval.str = new std::string (tok, tok_len ()); + return CONF; + } + + "label:" + ( "yyFillLabel" + | "yyNext" + ) + { + tok += sizeof "label:" - 1; + yylval.str = new std::string (tok, tok_len ()); + return CONF; + } + + "variable:" + ( "yyaccept" + | "yybm" + | "yych" + | "yyctable" + | "yystable" + | "yytarget" + ) + { + tok += sizeof "variable:" - 1; + yylval.str = new std::string (tok, tok_len ()); + return CONF; + } + + "condprefix" { return CONF_CONDPREFIX; } + "condenumprefix" { return CONF_CONDENUMPREFIX; } + "cond:divider" { return CONF_COND_DIVIDER; } + "cond:divider@cond" { return CONF_COND_DIVIDER_COND; } + "cond:goto" { return CONF_COND_GOTO; } + "cond:goto@cond" { return CONF_COND_GOTO_COND; } + "cgoto:threshold" { return CONF_CGOTO_THRESHOLD; } + "define:YYFILL:naked" { return CONF_DEFINE_YYFILL_NAKED; } + "define:YYFILL@len" { return CONF_DEFINE_YYFILL_LEN; } + "define:YYGETCONDITION:naked" { return CONF_DEFINE_YYGETCONDITION_NAKED; } + "define:YYGETSTATE:naked" { return CONF_DEFINE_YYGETSTATE_NAKED; } + "define:YYSETCONDITION@cond" { return CONF_DEFINE_YYSETCONDITION_COND; } + "define:YYSETSTATE:naked" { return CONF_DEFINE_YYSETSTATE_NAKED; } + "define:YYSETSTATE@state" { return CONF_DEFINE_YYSETSTATE_STATE; } + "flags:" [ewxu8] + { + switch (YYCURSOR[-1]) + { + case 'e': yylval.enc = Enc::EBCDIC; break; + case 'w': yylval.enc = Enc::UCS2; break; + case 'x': yylval.enc = Enc::UTF16; break; + case 'u': yylval.enc = Enc::UTF32; break; + case '8': yylval.enc = Enc::UTF8; break; + } + return CONF_FLAGS; + } + "indent:string" { return CONF_INDENT_STRING; } + "indent:top" { return CONF_INDENT_TOP; } + "labelprefix" { return CONF_LABELPREFIX; } + "startlabel" { return CONF_STARTLABEL; } + "state:abort" { return CONF_STATE_ABORT; } + "state:nextlabel" { return CONF_STATE_NEXTLABEL; } + "yybm:hex" { return CONF_YYBM_HEX; } + "yych:conversion" { return CONF_YYCH_CONVERSION; } + "yych:emit" { return CONF_YYCH_EMIT; } + "yyfill:check" { return CONF_YYFILL_CHECK; } + "yyfill:enable" { return CONF_YYFILL_ENABLE; } + "yyfill:parameter" { return CONF_YYFILL_PARAMETER; } */ -value: +conf_eq: /*!re2c - number { - if (!s_to_i32_unsafe (tok, cur, yylval.number)) - { - fatal ("configuration value overflow"); - } - lexer_state = LEX_NORMAL; - return NUMBER; - } - value { - yylval.str = new std::string (tok, tok_len ()); - lexer_state = LEX_NORMAL; - return VALUE; - } + * { fatal ("missing '=' in configuration"); } + space* "=" space* { goto conf_val; } +*/ + +conf_val: + tok = cur; + lexer_state = LEX_NORMAL; +/*!re2c + number + { + if (!s_to_i32_unsafe (tok, cur, yylval.num)) + { + fatal ("configuration value overflow"); + } + return NUM; + } + dstring | sstring + { + yylval.str = new std::string (); + SubStr s (tok + 1, tok_len () - 2); // skip quotes + unescape (s, *(yylval.str)); + return STR; + } + [^\r\n; \t]* + { + yylval.str = new std::string (tok, tok_len ()); + return STR; + } */ } diff --git a/re2c/test/repeat-07_error.gir.c b/re2c/test/repeat-07_error.gir.c index 7bd0ba59..ad74b451 100644 --- a/re2c/test/repeat-07_error.gir.c +++ b/re2c/test/repeat-07_error.gir.c @@ -1,5 +1,4 @@ re2c: warning: line 14: naked default case (stray code units: [0x00-`][e-0xFF]), better add default rule * [-Wnaked-default] re2c: warning: line 27: naked default case (stray code units: [0x0A]), better add default rule * [-Wnaked-default] re2c: warning: line 45: naked default case (stray code units: [0x000A]), better add default rule * [-Wnaked-default] -re2c: error: line 52, column 17: Cannot set '-u' switch: please reset '-e', '-w', '-x' and '-8' switches at first. - +re2c: error: line 52, column 17: Cannot set UTF32 encoding: please reset USC2 encoding first