From: Ulya Trofimovich Date: Fri, 1 Apr 2016 16:04:12 +0000 (+0100) Subject: Added directive '/*!contexts:re2c ... */'. X-Git-Tag: 1.0~39^2~340 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a90c1c4960ce73691d832e9f9f7185cdb2449965;p=re2c Added directive '/*!contexts:re2c ... */'. Directive is a new type of re2c block that consists of zero or more of the following configurations (example values are the defaults): line = "long @@;"; sep = ""; Renamed configuration: 're2c:ctxprefix' -> 're2c:contexts:prefix' Added configuration: 're2c:contexts:expr = "@@"' that allows to override the way context markers are accessed (but nottheir names). Removed configuration: 're2c:define:YYDISTTYPE' (use the new directive '/*!contexts:re2c ... */' instead). --- diff --git a/re2c/Makefile.am b/re2c/Makefile.am index e405a9ff..a5f472c5 100644 --- a/re2c/Makefile.am +++ b/re2c/Makefile.am @@ -63,6 +63,7 @@ SRC_HDR = \ src/util/s_to_n32_unsafe.h \ src/util/smart_ptr.h \ src/util/static_assert.h \ + src/util/strrreplace.h \ src/util/u32lim.h \ src/util/uniq_vector.h SRC = \ diff --git a/re2c/bootstrap/src/parse/lex.cc b/re2c/bootstrap/src/parse/lex.cc index e4a8f46b..2d1f84d5 100644 --- a/re2c/bootstrap/src/parse/lex.cc +++ b/re2c/bootstrap/src/parse/lex.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 0.16 on Tue Mar 29 22:37:03 2016 */ +/* Generated by re2c 0.16 on Fri Apr 1 16:33:55 2016 */ #line 1 "../src/parse/lex.re" #include "src/util/c99_stdint.h" #include @@ -115,7 +115,7 @@ echo: } } ++YYCURSOR; -#line 201 "../src/parse/lex.re" +#line 218 "../src/parse/lex.re" { if (!ignore_eoc && opts->target == opt_t::CODE) { @@ -131,7 +131,7 @@ echo: yy4: ++YYCURSOR; yy5: -#line 212 "../src/parse/lex.re" +#line 229 "../src/parse/lex.re" { goto echo; } @@ -144,7 +144,7 @@ yy6: } if (yych == '#') goto yy14; yy7: -#line 188 "../src/parse/lex.re" +#line 205 "../src/parse/lex.re" { if (ignore_eoc) { @@ -228,7 +228,7 @@ yy18: if (yych == '\n') goto yy22; if (yych == '\r') goto yy24; yy19: -#line 167 "../src/parse/lex.re" +#line 184 "../src/parse/lex.re" { if (ignore_eoc) { @@ -257,7 +257,7 @@ yy21: goto yy13; yy22: ++YYCURSOR; -#line 149 "../src/parse/lex.re" +#line 166 "../src/parse/lex.re" { cline++; if (ignore_eoc) @@ -284,291 +284,324 @@ yy24: yy25: yych = (YYCTYPE)*++YYCURSOR; switch (yych) { - case 'g': goto yy27; - case 'i': goto yy28; - case 'm': goto yy29; - case 'r': goto yy30; - case 't': goto yy31; - case 'u': goto yy32; + case 'c': goto yy27; + case 'g': goto yy28; + case 'i': goto yy29; + case 'm': goto yy30; + case 'r': goto yy31; + case 't': goto yy32; + case 'u': goto yy33; default: goto yy13; } yy26: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy33; + if (yych == 'n') goto yy34; goto yy13; yy27: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy34; + if (yych == 'o') goto yy35; goto yy13; yy28: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'g') goto yy35; + if (yych == 'e') goto yy36; goto yy13; yy29: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy36; + if (yych == 'g') goto yy37; goto yy13; yy30: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy37; - if (yych == 'u') goto yy38; + if (yych == 'a') goto yy38; goto yy13; yy31: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'y') goto yy39; + if (yych == 'e') goto yy39; + if (yych == 'u') goto yy40; goto yy13; yy32: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy40; + if (yych == 'y') goto yy41; goto yy13; yy33: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy41; + if (yych == 's') goto yy42; goto yy13; yy34: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy42; + if (yych == 'e') goto yy43; goto yy13; yy35: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy43; + if (yych == 'n') goto yy44; goto yy13; yy36: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'x') goto yy44; + if (yych == 't') goto yy45; goto yy13; yy37: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy45; + if (yych == 'n') goto yy46; goto yy13; yy38: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'l') goto yy46; + if (yych == 'x') goto yy47; goto yy13; yy39: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'p') goto yy47; + if (yych == '2') goto yy48; goto yy13; yy40: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy48; + if (yych == 'l') goto yy49; goto yy13; yy41: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '0') goto yy50; - if (yych <= '9') goto yy13; - goto yy50; + if (yych == 'p') goto yy50; + goto yy13; yy42: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy51; + if (yych == 'e') goto yy51; goto yy13; yy43: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy52; - goto yy13; + if (yych <= '0') goto yy53; + if (yych <= '9') goto yy13; + goto yy53; yy44: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy53; + if (yych == 't') goto yy54; goto yy13; yy45: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy16; + if (yych == 's') goto yy55; goto yy13; yy46: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy54; + if (yych == 'o') goto yy56; goto yy13; yy47: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy55; + if (yych == ':') goto yy57; goto yy13; yy48: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy56; + if (yych == 'c') goto yy16; goto yy13; yy49: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy58; + goto yy13; +yy50: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy59; + goto yy13; +yy51: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == ':') goto yy60; + goto yy13; +yy52: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; YYCTXMARKER = YYCURSOR; -yy50: +yy53: if (yych <= 0x1F) { - if (yych == '\t') goto yy49; + if (yych == '\t') goto yy52; goto yy13; } else { - if (yych <= ' ') goto yy49; + if (yych <= ' ') goto yy52; if (yych <= '0') goto yy13; - if (yych <= '9') goto yy57; + if (yych <= '9') goto yy61; goto yy13; } -yy51: +yy54: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy59; + if (yych == 'e') goto yy63; goto yy13; -yy52: +yy55: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy60; + if (yych == 't') goto yy64; goto yy13; -yy53: +yy56: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy61; + if (yych == 'r') goto yy65; goto yy13; -yy54: +yy57: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy62; + if (yych == 'r') goto yy66; goto yy13; -yy55: +yy58: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy63; + if (yych == 's') goto yy67; goto yy13; -yy56: +yy59: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy64; + if (yych == 's') goto yy68; goto yy13; -yy57: +yy60: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'r') goto yy69; + goto yy13; +yy61: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 64) { - goto yy57; + goto yy61; } if (yych <= '\f') { if (yych <= 0x08) goto yy13; - if (yych <= '\t') goto yy65; - if (yych <= '\n') goto yy67; + if (yych <= '\t') goto yy70; + if (yych <= '\n') goto yy72; goto yy13; } else { - if (yych <= '\r') goto yy69; - if (yych == ' ') goto yy65; + if (yych <= '\r') goto yy74; + if (yych == ' ') goto yy70; goto yy13; } -yy59: +yy63: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy70; + if (yych == 'x') goto yy75; goto yy13; -yy60: +yy64: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy71; + if (yych == 'a') goto yy76; goto yy13; -yy61: +yy65: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy72; + if (yych == 'e') goto yy77; goto yy13; -yy62: +yy66: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy73; + if (yych == 'e') goto yy78; goto yy13; -yy63: +yy67: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy74; + if (yych == ':') goto yy79; goto yy13; -yy64: +yy68: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy75; + if (yych == ':') goto yy80; goto yy13; -yy65: +yy69: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy81; + goto yy13; +yy70: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy65; + if (yych == '\t') goto yy70; goto yy13; } else { - if (yych <= ' ') goto yy65; - if (yych == '"') goto yy76; + if (yych <= ' ') goto yy70; + if (yych == '"') goto yy82; goto yy13; } -yy67: +yy72: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 184 "../src/parse/lex.re" +#line 201 "../src/parse/lex.re" { set_sourceline (); goto echo; } -#line 490 "src/parse/lex.cc" -yy69: +#line 511 "src/parse/lex.cc" +yy74: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy67; + if (yych == '\n') goto yy72; goto yy13; -yy70: +yy75: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy78; + if (yych == 't') goto yy84; goto yy13; -yy71: +yy76: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy79; + if (yych == 't') goto yy85; goto yy13; -yy72: +yy77: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy80; + if (yych == ':') goto yy86; goto yy13; -yy73: +yy78: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy81; + if (yych == '2') goto yy87; goto yy13; -yy74: +yy79: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy82; + if (yych == 'r') goto yy88; goto yy13; -yy75: +yy80: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy83; + if (yych == 'r') goto yy89; goto yy13; -yy76: +yy81: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == '2') goto yy90; + goto yy13; +yy82: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy76; + goto yy82; } if (yych <= '\n') goto yy13; - if (yych <= '"') goto yy84; - goto yy85; -yy78: + if (yych <= '"') goto yy91; + goto yy92; +yy84: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy86; + if (yych == 's') goto yy93; goto yy13; -yy79: +yy85: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy87; + if (yych == 'e') goto yy94; goto yy13; -yy80: +yy86: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy88; + if (yych == 'r') goto yy95; goto yy13; -yy81: +yy87: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy90; + if (yych == 'c') goto yy96; goto yy13; -yy82: +yy88: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy91; + if (yych == 'e') goto yy98; goto yy13; -yy83: +yy89: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy92; + if (yych == 'e') goto yy99; goto yy13; -yy84: +yy90: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy67; - if (yych == '\r') goto yy69; + if (yych == 'c') goto yy100; goto yy13; -yy85: +yy91: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == '\n') goto yy72; + if (yych == '\r') goto yy74; + goto yy13; +yy92: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych == '\n') goto yy13; - goto yy76; -yy86: + goto yy82; +yy93: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy94; + if (yych == ':') goto yy102; goto yy13; -yy87: +yy94: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy95; + if (yych == ':') goto yy103; goto yy13; -yy88: +yy95: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy104; + goto yy13; +yy96: ++YYCURSOR; #line 118 "../src/parse/lex.re" { @@ -580,16 +613,16 @@ yy88: ignore_eoc = true; goto echo; } -#line 584 "src/parse/lex.cc" -yy90: +#line 617 "src/parse/lex.cc" +yy98: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy96; + if (yych == '2') goto yy105; goto yy13; -yy91: +yy99: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy97; + if (yych == '2') goto yy106; goto yy13; -yy92: +yy100: ++YYCURSOR; #line 104 "../src/parse/lex.re" { @@ -606,32 +639,40 @@ yy92: tok = cur; return Reuse; } -#line 610 "src/parse/lex.cc" -yy94: +#line 643 "src/parse/lex.cc" +yy102: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy98; + if (yych == 'r') goto yy107; goto yy13; -yy95: +yy103: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy99; + if (yych == 'r') goto yy108; goto yy13; -yy96: +yy104: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy100; + if (yych == '2') goto yy109; goto yy13; -yy97: +yy105: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy102; + if (yych == 'c') goto yy110; goto yy13; -yy98: +yy106: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy104; + if (yych == 'c') goto yy112; goto yy13; -yy99: +yy107: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy105; + if (yych == 'e') goto yy114; goto yy13; -yy100: +yy108: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy115; + goto yy13; +yy109: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'c') goto yy116; + goto yy13; +yy110: ++YYCURSOR; #line 92 "../src/parse/lex.re" { @@ -646,8 +687,8 @@ yy100: tok = cur; return Rules; } -#line 650 "src/parse/lex.cc" -yy102: +#line 691 "src/parse/lex.cc" +yy112: ++YYCURSOR; #line 138 "../src/parse/lex.re" { @@ -661,12 +702,16 @@ yy102: } goto echo; } -#line 665 "src/parse/lex.cc" -yy104: +#line 706 "src/parse/lex.cc" +yy114: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy107; + if (yych == '2') goto yy118; goto yy13; -yy105: +yy115: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == '2') goto yy119; + goto yy13; +yy116: ++YYCURSOR; #line 133 "../src/parse/lex.re" { @@ -674,10 +719,35 @@ yy105: ignore_eoc = true; goto echo; } -#line 678 "src/parse/lex.cc" -yy107: +#line 723 "src/parse/lex.cc" +yy118: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'c') goto yy120; + goto yy13; +yy119: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'c') goto yy13; + if (yych == 'c') goto yy122; + goto yy13; +yy120: + ++YYCURSOR; +#line 150 "../src/parse/lex.re" + { + if (opts->target == opt_t::CODE) { + const size_t len = sizeof("/*!contexts:re2c") - 1; + out.wraw(tok, tok_len() - len); + } + + ConfContexts *conf = new ConfContexts; + lex_conf_contexts(*conf); + if (opts->target == opt_t::CODE) { + out.wdelay_contexts(opts->topIndent, conf); + } + + tok = pos = cur; + goto echo; + } +#line 750 "src/parse/lex.cc" +yy122: ++YYCURSOR; #line 127 "../src/parse/lex.re" { @@ -686,9 +756,9 @@ yy107: ignore_eoc = true; goto echo; } -#line 690 "src/parse/lex.cc" +#line 760 "src/parse/lex.cc" } -#line 215 "../src/parse/lex.re" +#line 232 "../src/parse/lex.re" } @@ -708,7 +778,7 @@ scan: start: -#line 712 "src/parse/lex.cc" +#line 782 "src/parse/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -749,293 +819,293 @@ start: if ((YYLIMIT - YYCURSOR) < 6) YYFILL(6); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 16) { - goto yy114; + goto yy128; } if (yych <= '9') { if (yych <= '&') { if (yych <= '\r') { - if (yych <= 0x08) goto yy112; - if (yych <= '\n') goto yy117; - if (yych >= '\r') goto yy119; + if (yych <= 0x08) goto yy126; + if (yych <= '\n') goto yy131; + if (yych >= '\r') goto yy133; } else { if (yych <= '"') { - if (yych >= '"') goto yy120; + if (yych >= '"') goto yy134; } else { - if (yych == '%') goto yy122; + if (yych == '%') goto yy136; } } } else { if (yych <= '+') { - if (yych <= '\'') goto yy123; - if (yych <= ')') goto yy125; - if (yych <= '*') goto yy127; - goto yy129; + if (yych <= '\'') goto yy137; + if (yych <= ')') goto yy139; + if (yych <= '*') goto yy141; + goto yy143; } else { if (yych <= '-') { - if (yych <= ',') goto yy125; + if (yych <= ',') goto yy139; } else { - if (yych <= '.') goto yy131; - if (yych <= '/') goto yy133; - goto yy134; + if (yych <= '.') goto yy145; + if (yych <= '/') goto yy147; + goto yy148; } } } } else { if (yych <= '\\') { if (yych <= '>') { - if (yych <= ':') goto yy135; - if (yych == '<') goto yy136; - goto yy125; + if (yych <= ':') goto yy149; + if (yych == '<') goto yy150; + goto yy139; } else { if (yych <= '@') { - if (yych <= '?') goto yy129; - goto yy137; + if (yych <= '?') goto yy143; + goto yy151; } else { - if (yych <= 'Z') goto yy134; - if (yych <= '[') goto yy138; - goto yy125; + if (yych <= 'Z') goto yy148; + if (yych <= '[') goto yy152; + goto yy139; } } } else { if (yych <= 'q') { - if (yych == '_') goto yy134; - if (yych >= 'a') goto yy134; + if (yych == '_') goto yy148; + if (yych >= 'a') goto yy148; } else { if (yych <= 'z') { - if (yych <= 'r') goto yy140; - goto yy134; + if (yych <= 'r') goto yy154; + goto yy148; } else { - if (yych <= '{') goto yy141; - if (yych <= '|') goto yy125; + if (yych <= '{') goto yy155; + if (yych <= '|') goto yy139; } } } } -yy112: +yy126: ++YYCURSOR; -yy113: -#line 393 "../src/parse/lex.re" +yy127: +#line 410 "../src/parse/lex.re" { fatalf("unexpected character: '%c'", *tok); goto scan; } -#line 823 "src/parse/lex.cc" -yy114: +#line 893 "src/parse/lex.cc" +yy128: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 16) { - goto yy114; + goto yy128; } -#line 377 "../src/parse/lex.re" +#line 394 "../src/parse/lex.re" { goto scan; } -#line 835 "src/parse/lex.cc" -yy117: +#line 905 "src/parse/lex.cc" +yy131: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy143; + if (yych == '\t') goto yy157; } else { - if (yych <= ' ') goto yy143; - if (yych == '#') goto yy146; + if (yych <= ' ') goto yy157; + if (yych == '#') goto yy160; } -yy118: -#line 386 "../src/parse/lex.re" +yy132: +#line 403 "../src/parse/lex.re" { if (cur == eof) return 0; pos = cur; cline++; goto scan; } -#line 853 "src/parse/lex.cc" -yy119: +#line 923 "src/parse/lex.cc" +yy133: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy117; - goto yy113; -yy120: + if (yych == '\n') goto yy131; + goto yy127; +yy134: ++YYCURSOR; -#line 264 "../src/parse/lex.re" +#line 281 "../src/parse/lex.re" { yylval.regexp = lex_str('"', opts->bCaseInsensitive || opts->bCaseInverted); return TOKEN_REGEXP; } -#line 862 "src/parse/lex.cc" -yy122: +#line 932 "src/parse/lex.cc" +yy136: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '}') goto yy148; - goto yy113; -yy123: + if (yych == '}') goto yy162; + goto yy127; +yy137: ++YYCURSOR; -#line 263 "../src/parse/lex.re" +#line 280 "../src/parse/lex.re" { yylval.regexp = lex_str('\'', opts->bCaseInsensitive || !opts->bCaseInverted); return TOKEN_REGEXP; } -#line 871 "src/parse/lex.cc" -yy125: +#line 941 "src/parse/lex.cc" +yy139: ++YYCURSOR; -yy126: -#line 280 "../src/parse/lex.re" +yy140: +#line 297 "../src/parse/lex.re" { return *tok; } -#line 879 "src/parse/lex.cc" -yy127: +#line 949 "src/parse/lex.cc" +yy141: ++YYCURSOR; - if ((yych = (YYCTYPE)*YYCURSOR) == '/') goto yy148; -#line 284 "../src/parse/lex.re" + if ((yych = (YYCTYPE)*YYCURSOR) == '/') goto yy162; +#line 301 "../src/parse/lex.re" { yylval.op = *tok; return TOKEN_STAR; } -#line 888 "src/parse/lex.cc" -yy129: +#line 958 "src/parse/lex.cc" +yy143: ++YYCURSOR; -#line 288 "../src/parse/lex.re" +#line 305 "../src/parse/lex.re" { yylval.op = *tok; return TOKEN_CLOSE; } -#line 896 "src/parse/lex.cc" -yy131: +#line 966 "src/parse/lex.cc" +yy145: ++YYCURSOR; -#line 372 "../src/parse/lex.re" +#line 389 "../src/parse/lex.re" { yylval.regexp = mkDot(); return TOKEN_REGEXP; } -#line 904 "src/parse/lex.cc" -yy133: +#line 974 "src/parse/lex.cc" +yy147: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '*') goto yy150; - if (yych == '/') goto yy152; - goto yy126; -yy134: + if (yych == '*') goto yy164; + if (yych == '/') goto yy166; + goto yy140; +yy148: yych = (YYCTYPE)*++YYCURSOR; YYCTXMARKER = YYCURSOR; - goto yy160; -yy135: + goto yy174; +yy149: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '=') goto yy161; - goto yy113; -yy136: + if (yych == '=') goto yy175; + goto yy127; +yy150: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == '!') goto yy163; - if (yych == '>') goto yy165; - goto yy126; -yy137: + if (yych == '!') goto yy177; + if (yych == '>') goto yy179; + goto yy140; +yy151: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 'Z') { - if (yych <= '/') goto yy113; - if (yych <= '9') goto yy166; - if (yych <= '@') goto yy113; - goto yy166; + if (yych <= '/') goto yy127; + if (yych <= '9') goto yy180; + if (yych <= '@') goto yy127; + goto yy180; } else { if (yych <= '_') { - if (yych <= '^') goto yy113; - goto yy166; + if (yych <= '^') goto yy127; + goto yy180; } else { - if (yych <= '`') goto yy113; - if (yych <= 'z') goto yy166; - goto yy113; + if (yych <= '`') goto yy127; + if (yych <= 'z') goto yy180; + goto yy127; } } -yy138: +yy152: ++YYCURSOR; - if ((yych = (YYCTYPE)*YYCURSOR) == '^') goto yy169; -#line 265 "../src/parse/lex.re" + if ((yych = (YYCTYPE)*YYCURSOR) == '^') goto yy183; +#line 282 "../src/parse/lex.re" { yylval.regexp = lex_cls(false); return TOKEN_REGEXP; } -#line 946 "src/parse/lex.cc" -yy140: +#line 1016 "src/parse/lex.cc" +yy154: yych = (YYCTYPE)*++YYCURSOR; YYCTXMARKER = YYCURSOR; - if (yych == 'e') goto yy171; - goto yy160; -yy141: + if (yych == 'e') goto yy185; + goto yy174; +yy155: yyaccept = 2; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 64) { - goto yy174; + goto yy188; } if (yych <= 'Z') { - if (yych == ',') goto yy172; - if (yych >= 'A') goto yy176; + if (yych == ',') goto yy186; + if (yych >= 'A') goto yy190; } else { if (yych <= '_') { - if (yych >= '_') goto yy176; + if (yych >= '_') goto yy190; } else { - if (yych <= '`') goto yy142; - if (yych <= 'z') goto yy176; + if (yych <= '`') goto yy156; + if (yych <= 'z') goto yy190; } } -yy142: -#line 234 "../src/parse/lex.re" +yy156: +#line 251 "../src/parse/lex.re" { depth = 1; goto code; } -#line 975 "src/parse/lex.cc" -yy143: +#line 1045 "src/parse/lex.cc" +yy157: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy143; + if (yych == '\t') goto yy157; } else { - if (yych <= ' ') goto yy143; - if (yych == '#') goto yy146; + if (yych <= ' ') goto yy157; + if (yych == '#') goto yy160; } -yy145: +yy159: YYCURSOR = YYMARKER; if (yyaccept <= 1) { if (yyaccept == 0) { - goto yy118; + goto yy132; } else { - goto yy126; + goto yy140; } } else { if (yyaccept == 2) { - goto yy142; + goto yy156; } else { - goto yy173; + goto yy187; } } -yy146: +yy160: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy146; - goto yy145; + if (yych == '\t') goto yy160; + goto yy159; } else { - if (yych <= ' ') goto yy146; - if (yych == 'l') goto yy178; - goto yy145; + if (yych <= ' ') goto yy160; + if (yych == 'l') goto yy192; + goto yy159; } -yy148: +yy162: ++YYCURSOR; -#line 258 "../src/parse/lex.re" +#line 275 "../src/parse/lex.re" { tok = cur; return 0; } -#line 1020 "src/parse/lex.cc" -yy150: +#line 1090 "src/parse/lex.cc" +yy164: ++YYCURSOR; -#line 252 "../src/parse/lex.re" +#line 269 "../src/parse/lex.re" { depth = 1; goto comment; } -#line 1028 "src/parse/lex.cc" -yy152: +#line 1098 "src/parse/lex.cc" +yy166: ++YYCURSOR; -#line 249 "../src/parse/lex.re" +#line 266 "../src/parse/lex.re" { goto nextLine; } -#line 1035 "src/parse/lex.cc" -yy154: +#line 1105 "src/parse/lex.cc" +yy168: ++YYCURSOR; YYCURSOR -= 1; -#line 356 "../src/parse/lex.re" +#line 373 "../src/parse/lex.re" { if (!opts->FFlag) { yylval.str = new std::string (tok, tok_len()); @@ -1051,157 +1121,157 @@ yy154: return TOKEN_REGEXP; } } -#line 1055 "src/parse/lex.cc" -yy156: +#line 1125 "src/parse/lex.cc" +yy170: yych = (YYCTYPE)*++YYCURSOR; - goto yy182; -yy157: + goto yy196; +yy171: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 351 "../src/parse/lex.re" +#line 368 "../src/parse/lex.re" { yylval.str = new std::string (tok, tok_len ()); return TOKEN_ID; } -#line 1067 "src/parse/lex.cc" -yy159: +#line 1137 "src/parse/lex.cc" +yy173: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; YYCTXMARKER = YYCURSOR; -yy160: +yy174: if (yybm[0+yych] & 32) { - goto yy159; + goto yy173; } if (yych <= ' ') { - if (yych == '\t') goto yy156; - if (yych <= 0x1F) goto yy154; - goto yy156; + if (yych == '\t') goto yy170; + if (yych <= 0x1F) goto yy168; + goto yy170; } else { if (yych <= ',') { - if (yych <= '+') goto yy154; - goto yy157; + if (yych <= '+') goto yy168; + goto yy171; } else { - if (yych <= '<') goto yy154; - if (yych <= '>') goto yy157; - goto yy154; + if (yych <= '<') goto yy168; + if (yych <= '>') goto yy171; + goto yy168; } } -yy161: +yy175: ++YYCURSOR; - if ((yych = (YYCTYPE)*YYCURSOR) == '>') goto yy183; -#line 243 "../src/parse/lex.re" + if ((yych = (YYCTYPE)*YYCURSOR) == '>') goto yy197; +#line 260 "../src/parse/lex.re" { tok += 2; /* skip ":=" */ depth = 0; goto code; } -#line 1100 "src/parse/lex.cc" -yy163: +#line 1170 "src/parse/lex.cc" +yy177: ++YYCURSOR; -#line 271 "../src/parse/lex.re" +#line 288 "../src/parse/lex.re" { return TOKEN_SETUP; } -#line 1107 "src/parse/lex.cc" -yy165: +#line 1177 "src/parse/lex.cc" +yy179: yych = (YYCTYPE)*++YYCURSOR; YYCTXMARKER = YYCURSOR; - goto yy186; -yy166: + goto yy200; +yy180: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 'Z') { - if (yych <= '/') goto yy168; - if (yych <= '9') goto yy166; - if (yych >= 'A') goto yy166; + if (yych <= '/') goto yy182; + if (yych <= '9') goto yy180; + if (yych >= 'A') goto yy180; } else { if (yych <= '_') { - if (yych >= '_') goto yy166; + if (yych >= '_') goto yy180; } else { - if (yych <= '`') goto yy168; - if (yych <= 'z') goto yy166; + if (yych <= '`') goto yy182; + if (yych <= 'z') goto yy180; } } -yy168: -#line 275 "../src/parse/lex.re" +yy182: +#line 292 "../src/parse/lex.re" { yylval.str = new std::string(tok + 1, tok_len() - 1); return TOKEN_CTX; } -#line 1134 "src/parse/lex.cc" -yy169: +#line 1204 "src/parse/lex.cc" +yy183: ++YYCURSOR; -#line 266 "../src/parse/lex.re" +#line 283 "../src/parse/lex.re" { yylval.regexp = lex_cls(true); return TOKEN_REGEXP; } -#line 1139 "src/parse/lex.cc" -yy171: +#line 1209 "src/parse/lex.cc" +yy185: yych = (YYCTYPE)*++YYCURSOR; YYCTXMARKER = YYCURSOR; - if (yych == '2') goto yy191; - goto yy160; -yy172: + if (yych == '2') goto yy205; + goto yy174; +yy186: ++YYCURSOR; -yy173: -#line 324 "../src/parse/lex.re" +yy187: +#line 341 "../src/parse/lex.re" { fatal("illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers"); } -#line 1152 "src/parse/lex.cc" -yy174: +#line 1222 "src/parse/lex.cc" +yy188: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 64) { - goto yy174; + goto yy188; } if (yych <= '^') { if (yych <= ',') { - if (yych <= '+') goto yy145; - goto yy192; + if (yych <= '+') goto yy159; + goto yy206; } else { - if (yych <= '@') goto yy145; - if (yych >= '[') goto yy145; + if (yych <= '@') goto yy159; + if (yych >= '[') goto yy159; } } else { if (yych <= 'z') { - if (yych == '`') goto yy145; + if (yych == '`') goto yy159; } else { - if (yych == '}') goto yy193; - goto yy145; + if (yych == '}') goto yy207; + goto yy159; } } -yy176: +yy190: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= '^') { if (yych <= '9') { - if (yych <= '/') goto yy145; - goto yy176; + if (yych <= '/') goto yy159; + goto yy190; } else { - if (yych <= '@') goto yy145; - if (yych <= 'Z') goto yy176; - goto yy145; + if (yych <= '@') goto yy159; + if (yych <= 'Z') goto yy190; + goto yy159; } } else { if (yych <= 'z') { - if (yych == '`') goto yy145; - goto yy176; + if (yych == '`') goto yy159; + goto yy190; } else { - if (yych == '}') goto yy195; - goto yy145; + if (yych == '}') goto yy209; + goto yy159; } } -yy178: +yy192: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy197; - goto yy145; -yy179: + if (yych == 'i') goto yy211; + goto yy159; +yy193: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 338 "../src/parse/lex.re" +#line 355 "../src/parse/lex.re" { yylval.str = new std::string (tok, tok_len ()); if (opts->FFlag) @@ -1214,87 +1284,87 @@ yy179: return TOKEN_ID; } } -#line 1218 "src/parse/lex.cc" -yy181: +#line 1288 "src/parse/lex.cc" +yy195: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy182: +yy196: if (yych <= ' ') { - if (yych == '\t') goto yy181; - if (yych <= 0x1F) goto yy179; - goto yy181; + if (yych == '\t') goto yy195; + if (yych <= 0x1F) goto yy193; + goto yy195; } else { if (yych <= ',') { - if (yych <= '+') goto yy179; - goto yy157; + if (yych <= '+') goto yy193; + goto yy171; } else { - if (yych <= '<') goto yy179; - if (yych <= '>') goto yy157; - goto yy179; + if (yych <= '<') goto yy193; + if (yych <= '>') goto yy171; + goto yy193; } } -yy183: +yy197: ++YYCURSOR; YYCURSOR -= 2; -#line 239 "../src/parse/lex.re" +#line 256 "../src/parse/lex.re" { return *tok; } -#line 1245 "src/parse/lex.cc" -yy185: +#line 1315 "src/parse/lex.cc" +yy199: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; -yy186: +yy200: if (yych <= '9') { if (yych <= '\t') { - if (yych <= 0x08) goto yy145; - goto yy185; + if (yych <= 0x08) goto yy159; + goto yy199; } else { - if (yych == ' ') goto yy185; - goto yy145; + if (yych == ' ') goto yy199; + goto yy159; } } else { if (yych <= '=') { - if (yych <= ':') goto yy187; - if (yych <= '<') goto yy145; - goto yy188; + if (yych <= ':') goto yy201; + if (yych <= '<') goto yy159; + goto yy202; } else { - if (yych == '{') goto yy189; - goto yy145; + if (yych == '{') goto yy203; + goto yy159; } } -yy187: +yy201: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '=') goto yy189; - goto yy145; -yy188: + if (yych == '=') goto yy203; + goto yy159; +yy202: yych = (YYCTYPE)*++YYCURSOR; - if (yych != '>') goto yy145; -yy189: + if (yych != '>') goto yy159; +yy203: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 268 "../src/parse/lex.re" +#line 285 "../src/parse/lex.re" { return TOKEN_NOCOND; } -#line 1283 "src/parse/lex.cc" -yy191: +#line 1353 "src/parse/lex.cc" +yy205: yych = (YYCTYPE)*++YYCURSOR; YYCTXMARKER = YYCURSOR; - if (yych == 'c') goto yy198; - goto yy160; -yy192: + if (yych == 'c') goto yy212; + goto yy174; +yy206: yyaccept = 3; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy173; - if (yych <= '9') goto yy199; - if (yych == '}') goto yy201; - goto yy173; -yy193: + if (yych <= '/') goto yy187; + if (yych <= '9') goto yy213; + if (yych == '}') goto yy215; + goto yy187; +yy207: ++YYCURSOR; -#line 293 "../src/parse/lex.re" +#line 310 "../src/parse/lex.re" { if (!s_to_u32_unsafe (tok + 1, cur - 1, yylval.extop.min)) { @@ -1303,10 +1373,10 @@ yy193: yylval.extop.max = yylval.extop.min; return TOKEN_CLOSESIZE; } -#line 1307 "src/parse/lex.cc" -yy195: +#line 1377 "src/parse/lex.cc" +yy209: ++YYCURSOR; -#line 328 "../src/parse/lex.re" +#line 345 "../src/parse/lex.re" { if (!opts->FFlag) { fatal("curly braces for names only allowed with -F switch"); @@ -1314,27 +1384,27 @@ yy195: yylval.str = new std::string (tok + 1, tok_len () - 2); // -2 to omit braces return TOKEN_ID; } -#line 1318 "src/parse/lex.cc" -yy197: +#line 1388 "src/parse/lex.cc" +yy211: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy203; - goto yy145; -yy198: + if (yych == 'n') goto yy217; + goto yy159; +yy212: yych = (YYCTYPE)*++YYCURSOR; YYCTXMARKER = YYCURSOR; - if (yych == ':') goto yy204; - goto yy160; -yy199: + if (yych == ':') goto yy218; + goto yy174; +yy213: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych <= '/') goto yy145; - if (yych <= '9') goto yy199; - if (yych == '}') goto yy206; - goto yy145; -yy201: + if (yych <= '/') goto yy159; + if (yych <= '9') goto yy213; + if (yych == '}') goto yy220; + goto yy159; +yy215: ++YYCURSOR; -#line 315 "../src/parse/lex.re" +#line 332 "../src/parse/lex.re" { if (!s_to_u32_unsafe (tok + 1, cur - 2, yylval.extop.min)) { @@ -1343,19 +1413,19 @@ yy201: yylval.extop.max = std::numeric_limits::max(); return TOKEN_CLOSESIZE; } -#line 1347 "src/parse/lex.cc" -yy203: +#line 1417 "src/parse/lex.cc" +yy217: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy208; - goto yy145; -yy204: + if (yych == 'e') goto yy222; + goto yy159; +yy218: ++YYCURSOR; -#line 336 "../src/parse/lex.re" +#line 353 "../src/parse/lex.re" { lex_conf (); return TOKEN_CONF; } -#line 1356 "src/parse/lex.cc" -yy206: +#line 1426 "src/parse/lex.cc" +yy220: ++YYCURSOR; -#line 302 "../src/parse/lex.re" +#line 319 "../src/parse/lex.re" { const char * p = strchr (tok, ','); if (!s_to_u32_unsafe (tok + 1, p, yylval.extop.min)) @@ -1368,132 +1438,132 @@ yy206: } return TOKEN_CLOSESIZE; } -#line 1372 "src/parse/lex.cc" -yy208: +#line 1442 "src/parse/lex.cc" +yy222: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '0') goto yy210; - if (yych <= '9') goto yy145; - goto yy210; -yy209: + if (yych <= '0') goto yy224; + if (yych <= '9') goto yy159; + goto yy224; +yy223: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; YYCTXMARKER = YYCURSOR; -yy210: +yy224: if (yych <= 0x1F) { - if (yych == '\t') goto yy209; - goto yy145; + if (yych == '\t') goto yy223; + goto yy159; } else { - if (yych <= ' ') goto yy209; - if (yych <= '0') goto yy145; - if (yych >= ':') goto yy145; + if (yych <= ' ') goto yy223; + if (yych <= '0') goto yy159; + if (yych >= ':') goto yy159; } -yy211: +yy225: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\r') { if (yych <= '\t') { - if (yych <= 0x08) goto yy145; + if (yych <= 0x08) goto yy159; } else { - if (yych <= '\n') goto yy215; - if (yych <= '\f') goto yy145; - goto yy217; + if (yych <= '\n') goto yy229; + if (yych <= '\f') goto yy159; + goto yy231; } } else { if (yych <= ' ') { - if (yych <= 0x1F) goto yy145; + if (yych <= 0x1F) goto yy159; } else { - if (yych <= '/') goto yy145; - if (yych <= '9') goto yy211; - goto yy145; + if (yych <= '/') goto yy159; + if (yych <= '9') goto yy225; + goto yy159; } } -yy213: +yy227: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy213; - goto yy145; + if (yych == '\t') goto yy227; + goto yy159; } else { - if (yych <= ' ') goto yy213; - if (yych == '"') goto yy218; - goto yy145; + if (yych <= ' ') goto yy227; + if (yych == '"') goto yy232; + goto yy159; } -yy215: +yy229: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 381 "../src/parse/lex.re" +#line 398 "../src/parse/lex.re" { set_sourceline (); goto scan; } -#line 1433 "src/parse/lex.cc" -yy217: +#line 1503 "src/parse/lex.cc" +yy231: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy215; - goto yy145; -yy218: + if (yych == '\n') goto yy229; + goto yy159; +yy232: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy218; + goto yy232; } - if (yych <= '\n') goto yy145; - if (yych >= '#') goto yy221; + if (yych <= '\n') goto yy159; + if (yych >= '#') goto yy235; yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy215; - if (yych == '\r') goto yy217; - goto yy145; -yy221: + if (yych == '\n') goto yy229; + if (yych == '\r') goto yy231; + goto yy159; +yy235: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy145; - goto yy218; + if (yych == '\n') goto yy159; + goto yy232; } -#line 397 "../src/parse/lex.re" +#line 414 "../src/parse/lex.re" flex_name: -#line 1463 "src/parse/lex.cc" +#line 1533 "src/parse/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy226; - if (yych == '\r') goto yy228; + if (yych == '\n') goto yy240; + if (yych == '\r') goto yy242; ++YYCURSOR; -yy225: -#line 408 "../src/parse/lex.re" +yy239: +#line 425 "../src/parse/lex.re" { YYCURSOR = tok; goto start; } -#line 1477 "src/parse/lex.cc" -yy226: +#line 1547 "src/parse/lex.cc" +yy240: ++YYCURSOR; -#line 402 "../src/parse/lex.re" +#line 419 "../src/parse/lex.re" { YYCURSOR = tok; lexer_state = LEX_NORMAL; return TOKEN_FID_END; } -#line 1486 "src/parse/lex.cc" -yy228: +#line 1556 "src/parse/lex.cc" +yy242: ++YYCURSOR; - if ((yych = (YYCTYPE)*YYCURSOR) == '\n') goto yy226; - goto yy225; + if ((yych = (YYCTYPE)*YYCURSOR) == '\n') goto yy240; + goto yy239; } -#line 412 "../src/parse/lex.re" +#line 429 "../src/parse/lex.re" code: -#line 1497 "src/parse/lex.cc" +#line 1567 "src/parse/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -1535,26 +1605,26 @@ code: yych = (YYCTYPE)*YYCURSOR; if (yych <= '&') { if (yych <= '\n') { - if (yych <= 0x00) goto yy231; - if (yych <= '\t') goto yy233; - goto yy235; + if (yych <= 0x00) goto yy245; + if (yych <= '\t') goto yy247; + goto yy249; } else { - if (yych == '"') goto yy237; - goto yy233; + if (yych == '"') goto yy251; + goto yy247; } } else { if (yych <= '{') { - if (yych <= '\'') goto yy238; - if (yych <= 'z') goto yy233; - goto yy239; + if (yych <= '\'') goto yy252; + if (yych <= 'z') goto yy247; + goto yy253; } else { - if (yych == '}') goto yy241; - goto yy233; + if (yych == '}') goto yy255; + goto yy247; } } -yy231: +yy245: ++YYCURSOR; -#line 475 "../src/parse/lex.re" +#line 492 "../src/parse/lex.re" { if (cur == eof) { @@ -1566,34 +1636,34 @@ yy231: } goto code; } -#line 1570 "src/parse/lex.cc" -yy233: +#line 1640 "src/parse/lex.cc" +yy247: ++YYCURSOR; -yy234: -#line 489 "../src/parse/lex.re" +yy248: +#line 506 "../src/parse/lex.re" { goto code; } -#line 1578 "src/parse/lex.cc" -yy235: +#line 1648 "src/parse/lex.cc" +yy249: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '\r') { if (yych <= '\t') { - if (yych >= '\t') goto yy243; + if (yych >= '\t') goto yy257; } else { - if (yych <= '\n') goto yy245; - if (yych >= '\r') goto yy245; + if (yych <= '\n') goto yy259; + if (yych >= '\r') goto yy259; } } else { if (yych <= ' ') { - if (yych >= ' ') goto yy243; + if (yych >= ' ') goto yy257; } else { - if (yych == '#') goto yy246; + if (yych == '#') goto yy260; } } -yy236: -#line 456 "../src/parse/lex.re" +yy250: +#line 473 "../src/parse/lex.re" { if (depth == 0) { @@ -1613,20 +1683,20 @@ yy236: cline++; goto code; } -#line 1617 "src/parse/lex.cc" -yy237: +#line 1687 "src/parse/lex.cc" +yy251: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == '\n') goto yy234; - goto yy250; -yy238: + if (yych == '\n') goto yy248; + goto yy264; +yy252: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == '\n') goto yy234; - goto yy255; -yy239: + if (yych == '\n') goto yy248; + goto yy269; +yy253: ++YYCURSOR; -#line 428 "../src/parse/lex.re" +#line 445 "../src/parse/lex.re" { if (depth == 0) { @@ -1638,10 +1708,10 @@ yy239: } goto code; } -#line 1642 "src/parse/lex.cc" -yy241: +#line 1712 "src/parse/lex.cc" +yy255: ++YYCURSOR; -#line 416 "../src/parse/lex.re" +#line 433 "../src/parse/lex.re" { if (depth == 0) { @@ -1654,19 +1724,19 @@ yy241: } goto code; } -#line 1658 "src/parse/lex.cc" -yy243: +#line 1728 "src/parse/lex.cc" +yy257: yyaccept = 2; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy257; + if (yych == '\t') goto yy271; } else { - if (yych <= ' ') goto yy257; - if (yych == '#') goto yy246; + if (yych <= ' ') goto yy271; + if (yych == '#') goto yy260; } -yy244: +yy258: YYCURSOR -= 1; -#line 443 "../src/parse/lex.re" +#line 460 "../src/parse/lex.re" { if (depth == 0) { @@ -1680,175 +1750,175 @@ yy244: cline++; goto code; } -#line 1684 "src/parse/lex.cc" -yy245: +#line 1754 "src/parse/lex.cc" +yy259: yych = (YYCTYPE)*++YYCURSOR; - goto yy244; -yy246: + goto yy258; +yy260: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 16) { - goto yy246; + goto yy260; } - if (yych == 'l') goto yy259; -yy248: + if (yych == 'l') goto yy273; +yy262: YYCURSOR = YYMARKER; if (yyaccept <= 1) { if (yyaccept == 0) { - goto yy236; + goto yy250; } else { - goto yy234; + goto yy248; } } else { - goto yy244; + goto yy258; } -yy249: +yy263: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy250: +yy264: if (yybm[0+yych] & 32) { - goto yy249; + goto yy263; } - if (yych <= '\n') goto yy248; - if (yych >= '#') goto yy253; -yy251: + if (yych <= '\n') goto yy262; + if (yych >= '#') goto yy267; +yy265: ++YYCURSOR; -#line 486 "../src/parse/lex.re" +#line 503 "../src/parse/lex.re" { goto code; } -#line 1723 "src/parse/lex.cc" -yy253: +#line 1793 "src/parse/lex.cc" +yy267: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy248; - goto yy249; -yy254: + if (yych == '\n') goto yy262; + goto yy263; +yy268: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy255: +yy269: if (yybm[0+yych] & 64) { - goto yy254; + goto yy268; } - if (yych <= '\n') goto yy248; - if (yych <= '\'') goto yy251; + if (yych <= '\n') goto yy262; + if (yych <= '\'') goto yy265; ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy248; - goto yy254; -yy257: + if (yych == '\n') goto yy262; + goto yy268; +yy271: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy257; - goto yy248; + if (yych == '\t') goto yy271; + goto yy262; } else { - if (yych <= ' ') goto yy257; - if (yych == '#') goto yy246; - goto yy248; + if (yych <= ' ') goto yy271; + if (yych == '#') goto yy260; + goto yy262; } -yy259: +yy273: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy248; + if (yych != 'i') goto yy262; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy248; + if (yych != 'n') goto yy262; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy248; + if (yych != 'e') goto yy262; yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '0') goto yy264; - if (yych <= '9') goto yy248; - goto yy264; -yy263: + if (yych <= '0') goto yy278; + if (yych <= '9') goto yy262; + goto yy278; +yy277: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; YYCTXMARKER = YYCURSOR; -yy264: +yy278: if (yych <= 0x1F) { - if (yych == '\t') goto yy263; - goto yy248; + if (yych == '\t') goto yy277; + goto yy262; } else { - if (yych <= ' ') goto yy263; - if (yych <= '0') goto yy248; - if (yych >= ':') goto yy248; + if (yych <= ' ') goto yy277; + if (yych <= '0') goto yy262; + if (yych >= ':') goto yy262; } -yy265: +yy279: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy265; + goto yy279; } if (yych <= '\f') { - if (yych <= 0x08) goto yy248; - if (yych <= '\t') goto yy267; - if (yych <= '\n') goto yy269; - goto yy248; + if (yych <= 0x08) goto yy262; + if (yych <= '\t') goto yy281; + if (yych <= '\n') goto yy283; + goto yy262; } else { - if (yych <= '\r') goto yy271; - if (yych != ' ') goto yy248; + if (yych <= '\r') goto yy285; + if (yych != ' ') goto yy262; } -yy267: +yy281: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy267; - goto yy248; + if (yych == '\t') goto yy281; + goto yy262; } else { - if (yych <= ' ') goto yy267; - if (yych == '"') goto yy272; - goto yy248; + if (yych <= ' ') goto yy281; + if (yych == '"') goto yy286; + goto yy262; } -yy269: +yy283: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 439 "../src/parse/lex.re" +#line 456 "../src/parse/lex.re" { set_sourceline (); goto code; } -#line 1818 "src/parse/lex.cc" -yy271: +#line 1888 "src/parse/lex.cc" +yy285: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy269; - goto yy248; -yy272: + if (yych == '\n') goto yy283; + goto yy262; +yy286: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = (YYCTYPE)*YYCURSOR; if (yych <= '!') { - if (yych == '\n') goto yy248; - goto yy272; + if (yych == '\n') goto yy262; + goto yy286; } else { - if (yych <= '"') goto yy274; - if (yych == '\\') goto yy275; - goto yy272; + if (yych <= '"') goto yy288; + if (yych == '\\') goto yy289; + goto yy286; } -yy274: +yy288: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy269; - if (yych == '\r') goto yy271; - goto yy248; -yy275: + if (yych == '\n') goto yy283; + if (yych == '\r') goto yy285; + goto yy262; +yy289: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy248; - goto yy272; + if (yych == '\n') goto yy262; + goto yy286; } -#line 492 "../src/parse/lex.re" +#line 509 "../src/parse/lex.re" comment: -#line 1852 "src/parse/lex.cc" +#line 1922 "src/parse/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -1888,14 +1958,14 @@ comment: if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= ')') { - if (yych == '\n') goto yy280; + if (yych == '\n') goto yy294; } else { - if (yych <= '*') goto yy282; - if (yych == '/') goto yy283; + if (yych <= '*') goto yy296; + if (yych == '/') goto yy297; } ++YYCURSOR; -yy279: -#line 524 "../src/parse/lex.re" +yy293: +#line 541 "../src/parse/lex.re" { if (cur == eof) { @@ -1903,15 +1973,15 @@ yy279: } goto comment; } -#line 1907 "src/parse/lex.cc" -yy280: +#line 1977 "src/parse/lex.cc" +yy294: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 32) { - goto yy284; + goto yy298; } - if (yych == '#') goto yy287; -yy281: -#line 515 "../src/parse/lex.re" + if (yych == '#') goto yy301; +yy295: +#line 532 "../src/parse/lex.re" { if (cur == eof) { @@ -1921,41 +1991,41 @@ yy281: cline++; goto comment; } -#line 1925 "src/parse/lex.cc" -yy282: +#line 1995 "src/parse/lex.cc" +yy296: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '/') goto yy289; - goto yy279; -yy283: + if (yych == '/') goto yy303; + goto yy293; +yy297: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '*') goto yy291; - goto yy279; -yy284: + if (yych == '*') goto yy305; + goto yy293; +yy298: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 32) { - goto yy284; + goto yy298; } - if (yych == '#') goto yy287; -yy286: + if (yych == '#') goto yy301; +yy300: YYCURSOR = YYMARKER; - goto yy281; -yy287: + goto yy295; +yy301: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy287; - goto yy286; + if (yych == '\t') goto yy301; + goto yy300; } else { - if (yych <= ' ') goto yy287; - if (yych == 'l') goto yy293; - goto yy286; + if (yych <= ' ') goto yy301; + if (yych == 'l') goto yy307; + goto yy300; } -yy289: +yy303: ++YYCURSOR; -#line 496 "../src/parse/lex.re" +#line 513 "../src/parse/lex.re" { if (--depth == 0) { @@ -1966,124 +2036,124 @@ yy289: goto comment; } } -#line 1970 "src/parse/lex.cc" -yy291: +#line 2040 "src/parse/lex.cc" +yy305: ++YYCURSOR; -#line 506 "../src/parse/lex.re" +#line 523 "../src/parse/lex.re" { ++depth; fatal("ambiguous /* found"); goto comment; } -#line 1979 "src/parse/lex.cc" -yy293: +#line 2049 "src/parse/lex.cc" +yy307: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy286; + if (yych != 'i') goto yy300; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy286; + if (yych != 'n') goto yy300; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy286; + if (yych != 'e') goto yy300; yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '0') goto yy298; - if (yych <= '9') goto yy286; - goto yy298; -yy297: + if (yych <= '0') goto yy312; + if (yych <= '9') goto yy300; + goto yy312; +yy311: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; YYCTXMARKER = YYCURSOR; -yy298: +yy312: if (yych <= 0x1F) { - if (yych == '\t') goto yy297; - goto yy286; + if (yych == '\t') goto yy311; + goto yy300; } else { - if (yych <= ' ') goto yy297; - if (yych <= '0') goto yy286; - if (yych >= ':') goto yy286; + if (yych <= ' ') goto yy311; + if (yych <= '0') goto yy300; + if (yych >= ':') goto yy300; } -yy299: +yy313: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 64) { - goto yy299; + goto yy313; } if (yych <= '\f') { - if (yych <= 0x08) goto yy286; - if (yych <= '\t') goto yy301; - if (yych <= '\n') goto yy303; - goto yy286; + if (yych <= 0x08) goto yy300; + if (yych <= '\t') goto yy315; + if (yych <= '\n') goto yy317; + goto yy300; } else { - if (yych <= '\r') goto yy305; - if (yych != ' ') goto yy286; + if (yych <= '\r') goto yy319; + if (yych != ' ') goto yy300; } -yy301: +yy315: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy301; - goto yy286; + if (yych == '\t') goto yy315; + goto yy300; } else { - if (yych <= ' ') goto yy301; - if (yych == '"') goto yy306; - goto yy286; + if (yych <= ' ') goto yy315; + if (yych == '"') goto yy320; + goto yy300; } -yy303: +yy317: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 511 "../src/parse/lex.re" +#line 528 "../src/parse/lex.re" { set_sourceline (); goto comment; } -#line 2041 "src/parse/lex.cc" -yy305: +#line 2111 "src/parse/lex.cc" +yy319: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy303; - goto yy286; -yy306: + if (yych == '\n') goto yy317; + goto yy300; +yy320: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy306; + goto yy320; } - if (yych <= '\n') goto yy286; - if (yych >= '#') goto yy309; + if (yych <= '\n') goto yy300; + if (yych >= '#') goto yy323; yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy303; - if (yych == '\r') goto yy305; - goto yy286; -yy309: + if (yych == '\n') goto yy317; + if (yych == '\r') goto yy319; + goto yy300; +yy323: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy286; - goto yy306; + if (yych == '\n') goto yy300; + goto yy320; } -#line 531 "../src/parse/lex.re" +#line 548 "../src/parse/lex.re" nextLine: -#line 2071 "src/parse/lex.cc" +#line 2141 "src/parse/lex.cc" { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy314; + if (yych == '\n') goto yy328; ++YYCURSOR; -#line 542 "../src/parse/lex.re" +#line 559 "../src/parse/lex.re" { if(cur == eof) { return 0; } goto nextLine; } -#line 2084 "src/parse/lex.cc" -yy314: +#line 2154 "src/parse/lex.cc" +yy328: ++YYCURSOR; -#line 535 "../src/parse/lex.re" +#line 552 "../src/parse/lex.re" { if(cur == eof) { return 0; } @@ -2091,9 +2161,9 @@ yy314: cline++; goto scan; } -#line 2095 "src/parse/lex.cc" +#line 2165 "src/parse/lex.cc" } -#line 547 "../src/parse/lex.re" +#line 564 "../src/parse/lex.re" } @@ -2117,44 +2187,44 @@ const RegExp *Scanner::lex_cls(bool neg) uint32_t u, l; fst: -#line 2121 "src/parse/lex.cc" +#line 2191 "src/parse/lex.cc" { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == ']') goto yy319; -#line 571 "../src/parse/lex.re" + if (yych == ']') goto yy333; +#line 588 "../src/parse/lex.re" { l = lex_cls_chr(); goto snd; } -#line 2129 "src/parse/lex.cc" -yy319: +#line 2199 "src/parse/lex.cc" +yy333: ++YYCURSOR; -#line 570 "../src/parse/lex.re" +#line 587 "../src/parse/lex.re" { goto end; } -#line 2134 "src/parse/lex.cc" +#line 2204 "src/parse/lex.cc" } -#line 572 "../src/parse/lex.re" +#line 589 "../src/parse/lex.re" snd: -#line 2140 "src/parse/lex.cc" +#line 2210 "src/parse/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*(YYMARKER = YYCURSOR); - if (yych == '-') goto yy324; -yy323: -#line 575 "../src/parse/lex.re" + if (yych == '-') goto yy338; +yy337: +#line 592 "../src/parse/lex.re" { u = l; goto add; } -#line 2149 "src/parse/lex.cc" -yy324: +#line 2219 "src/parse/lex.cc" +yy338: yych = (YYCTYPE)*++YYCURSOR; - if (yych != ']') goto yy326; + if (yych != ']') goto yy340; YYCURSOR = YYMARKER; - goto yy323; -yy326: + goto yy337; +yy340: ++YYCURSOR; YYCURSOR -= 1; -#line 576 "../src/parse/lex.re" +#line 593 "../src/parse/lex.re" { u = lex_cls_chr(); if (l > u) { @@ -2163,9 +2233,9 @@ yy326: } goto add; } -#line 2167 "src/parse/lex.cc" +#line 2237 "src/parse/lex.cc" } -#line 584 "../src/parse/lex.re" +#line 601 "../src/parse/lex.re" add: if (!(s = opts->encoding.encodeRange(l, u))) { @@ -2184,290 +2254,290 @@ uint32_t Scanner::lex_cls_chr() { tok = cur; -#line 2188 "src/parse/lex.cc" +#line 2258 "src/parse/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; if ((YYLIMIT - YYCURSOR) < 10) YYFILL(10); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy332; - if (yych == '\\') goto yy334; + if (yych == '\n') goto yy346; + if (yych == '\\') goto yy348; ++YYCURSOR; -#line 607 "../src/parse/lex.re" +#line 624 "../src/parse/lex.re" { return static_cast(tok[0]); } -#line 2199 "src/parse/lex.cc" -yy332: +#line 2269 "src/parse/lex.cc" +yy346: ++YYCURSOR; -#line 602 "../src/parse/lex.re" +#line 619 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error"); } -#line 2204 "src/parse/lex.cc" -yy334: +#line 2274 "src/parse/lex.cc" +yy348: ++YYCURSOR; if ((yych = (YYCTYPE)*YYCURSOR) <= '`') { if (yych <= '7') { if (yych <= ',') { - if (yych != '\n') goto yy336; + if (yych != '\n') goto yy350; } else { - if (yych <= '-') goto yy338; - if (yych <= '/') goto yy336; - if (yych <= '3') goto yy340; - goto yy342; + if (yych <= '-') goto yy352; + if (yych <= '/') goto yy350; + if (yych <= '3') goto yy354; + goto yy356; } } else { if (yych <= 'X') { - if (yych == 'U') goto yy343; - if (yych <= 'W') goto yy336; - goto yy345; + if (yych == 'U') goto yy357; + if (yych <= 'W') goto yy350; + goto yy359; } else { - if (yych <= '[') goto yy336; - if (yych <= '\\') goto yy346; - if (yych <= ']') goto yy348; - goto yy336; + if (yych <= '[') goto yy350; + if (yych <= '\\') goto yy360; + if (yych <= ']') goto yy362; + goto yy350; } } } else { if (yych <= 'q') { if (yych <= 'e') { - if (yych <= 'a') goto yy350; - if (yych <= 'b') goto yy352; - goto yy336; + if (yych <= 'a') goto yy364; + if (yych <= 'b') goto yy366; + goto yy350; } else { - if (yych <= 'f') goto yy354; - if (yych == 'n') goto yy356; - goto yy336; + if (yych <= 'f') goto yy368; + if (yych == 'n') goto yy370; + goto yy350; } } else { if (yych <= 'u') { - if (yych <= 'r') goto yy358; - if (yych <= 's') goto yy336; - if (yych <= 't') goto yy360; - goto yy345; + if (yych <= 'r') goto yy372; + if (yych <= 's') goto yy350; + if (yych <= 't') goto yy374; + goto yy359; } else { - if (yych <= 'v') goto yy362; - if (yych == 'x') goto yy364; - goto yy336; + if (yych <= 'v') goto yy376; + if (yych == 'x') goto yy378; + goto yy350; } } } -#line 605 "../src/parse/lex.re" +#line 622 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error in escape sequence"); } -#line 2255 "src/parse/lex.cc" -yy336: +#line 2325 "src/parse/lex.cc" +yy350: ++YYCURSOR; -#line 620 "../src/parse/lex.re" +#line 637 "../src/parse/lex.re" { warn.useless_escape(tline, tok - pos, tok[1]); return static_cast(tok[1]); } -#line 2263 "src/parse/lex.cc" -yy338: +#line 2333 "src/parse/lex.cc" +yy352: ++YYCURSOR; -#line 618 "../src/parse/lex.re" +#line 635 "../src/parse/lex.re" { return static_cast('-'); } -#line 2268 "src/parse/lex.cc" -yy340: +#line 2338 "src/parse/lex.cc" +yy354: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy341; - if (yych <= '7') goto yy365; -yy341: -#line 604 "../src/parse/lex.re" + if (yych <= '/') goto yy355; + if (yych <= '7') goto yy379; +yy355: +#line 621 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error in octal escape sequence"); } -#line 2277 "src/parse/lex.cc" -yy342: +#line 2347 "src/parse/lex.cc" +yy356: yych = (YYCTYPE)*++YYCURSOR; - goto yy341; -yy343: + goto yy355; +yy357: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy344; - if (yych <= '9') goto yy367; + if (yych <= '/') goto yy358; + if (yych <= '9') goto yy381; } else { - if (yych <= 'F') goto yy367; - if (yych <= '`') goto yy344; - if (yych <= 'f') goto yy367; + if (yych <= 'F') goto yy381; + if (yych <= '`') goto yy358; + if (yych <= 'f') goto yy381; } -yy344: -#line 603 "../src/parse/lex.re" +yy358: +#line 620 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error in hexadecimal escape sequence"); } -#line 2295 "src/parse/lex.cc" -yy345: +#line 2365 "src/parse/lex.cc" +yy359: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy344; - if (yych <= '9') goto yy368; - goto yy344; + if (yych <= '/') goto yy358; + if (yych <= '9') goto yy382; + goto yy358; } else { - if (yych <= 'F') goto yy368; - if (yych <= '`') goto yy344; - if (yych <= 'f') goto yy368; - goto yy344; + if (yych <= 'F') goto yy382; + if (yych <= '`') goto yy358; + if (yych <= 'f') goto yy382; + goto yy358; } -yy346: +yy360: ++YYCURSOR; -#line 617 "../src/parse/lex.re" +#line 634 "../src/parse/lex.re" { return static_cast('\\'); } -#line 2313 "src/parse/lex.cc" -yy348: +#line 2383 "src/parse/lex.cc" +yy362: ++YYCURSOR; -#line 619 "../src/parse/lex.re" +#line 636 "../src/parse/lex.re" { return static_cast(']'); } -#line 2318 "src/parse/lex.cc" -yy350: +#line 2388 "src/parse/lex.cc" +yy364: ++YYCURSOR; -#line 610 "../src/parse/lex.re" +#line 627 "../src/parse/lex.re" { return static_cast('\a'); } -#line 2323 "src/parse/lex.cc" -yy352: +#line 2393 "src/parse/lex.cc" +yy366: ++YYCURSOR; -#line 611 "../src/parse/lex.re" +#line 628 "../src/parse/lex.re" { return static_cast('\b'); } -#line 2328 "src/parse/lex.cc" -yy354: +#line 2398 "src/parse/lex.cc" +yy368: ++YYCURSOR; -#line 612 "../src/parse/lex.re" +#line 629 "../src/parse/lex.re" { return static_cast('\f'); } -#line 2333 "src/parse/lex.cc" -yy356: +#line 2403 "src/parse/lex.cc" +yy370: ++YYCURSOR; -#line 613 "../src/parse/lex.re" +#line 630 "../src/parse/lex.re" { return static_cast('\n'); } -#line 2338 "src/parse/lex.cc" -yy358: +#line 2408 "src/parse/lex.cc" +yy372: ++YYCURSOR; -#line 614 "../src/parse/lex.re" +#line 631 "../src/parse/lex.re" { return static_cast('\r'); } -#line 2343 "src/parse/lex.cc" -yy360: +#line 2413 "src/parse/lex.cc" +yy374: ++YYCURSOR; -#line 615 "../src/parse/lex.re" +#line 632 "../src/parse/lex.re" { return static_cast('\t'); } -#line 2348 "src/parse/lex.cc" -yy362: +#line 2418 "src/parse/lex.cc" +yy376: ++YYCURSOR; -#line 616 "../src/parse/lex.re" +#line 633 "../src/parse/lex.re" { return static_cast('\v'); } -#line 2353 "src/parse/lex.cc" -yy364: +#line 2423 "src/parse/lex.cc" +yy378: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy344; - if (yych <= '9') goto yy369; - goto yy344; + if (yych <= '/') goto yy358; + if (yych <= '9') goto yy383; + goto yy358; } else { - if (yych <= 'F') goto yy369; - if (yych <= '`') goto yy344; - if (yych <= 'f') goto yy369; - goto yy344; + if (yych <= 'F') goto yy383; + if (yych <= '`') goto yy358; + if (yych <= 'f') goto yy383; + goto yy358; } -yy365: +yy379: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '/') goto yy366; - if (yych <= '7') goto yy370; -yy366: + if (yych <= '/') goto yy380; + if (yych <= '7') goto yy384; +yy380: YYCURSOR = YYMARKER; if (yyaccept == 0) { - goto yy341; + goto yy355; } else { - goto yy344; + goto yy358; } -yy367: +yy381: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy366; - if (yych <= '9') goto yy372; - goto yy366; + if (yych <= '/') goto yy380; + if (yych <= '9') goto yy386; + goto yy380; } else { - if (yych <= 'F') goto yy372; - if (yych <= '`') goto yy366; - if (yych <= 'f') goto yy372; - goto yy366; + if (yych <= 'F') goto yy386; + if (yych <= '`') goto yy380; + if (yych <= 'f') goto yy386; + goto yy380; } -yy368: +yy382: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy366; - if (yych <= '9') goto yy373; - goto yy366; + if (yych <= '/') goto yy380; + if (yych <= '9') goto yy387; + goto yy380; } else { - if (yych <= 'F') goto yy373; - if (yych <= '`') goto yy366; - if (yych <= 'f') goto yy373; - goto yy366; + if (yych <= 'F') goto yy387; + if (yych <= '`') goto yy380; + if (yych <= 'f') goto yy387; + goto yy380; } -yy369: +yy383: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy366; - if (yych <= '9') goto yy374; - goto yy366; + if (yych <= '/') goto yy380; + if (yych <= '9') goto yy388; + goto yy380; } else { - if (yych <= 'F') goto yy374; - if (yych <= '`') goto yy366; - if (yych <= 'f') goto yy374; - goto yy366; + if (yych <= 'F') goto yy388; + if (yych <= '`') goto yy380; + if (yych <= 'f') goto yy388; + goto yy380; } -yy370: +yy384: ++YYCURSOR; -#line 609 "../src/parse/lex.re" +#line 626 "../src/parse/lex.re" { return unesc_oct(tok, cur); } -#line 2418 "src/parse/lex.cc" -yy372: +#line 2488 "src/parse/lex.cc" +yy386: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy366; - if (yych <= '9') goto yy376; - goto yy366; + if (yych <= '/') goto yy380; + if (yych <= '9') goto yy390; + goto yy380; } else { - if (yych <= 'F') goto yy376; - if (yych <= '`') goto yy366; - if (yych <= 'f') goto yy376; - goto yy366; + if (yych <= 'F') goto yy390; + if (yych <= '`') goto yy380; + if (yych <= 'f') goto yy390; + goto yy380; } -yy373: +yy387: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy366; - if (yych <= '9') goto yy369; - goto yy366; + if (yych <= '/') goto yy380; + if (yych <= '9') goto yy383; + goto yy380; } else { - if (yych <= 'F') goto yy369; - if (yych <= '`') goto yy366; - if (yych <= 'f') goto yy369; - goto yy366; + if (yych <= 'F') goto yy383; + if (yych <= '`') goto yy380; + if (yych <= 'f') goto yy383; + goto yy380; } -yy374: +yy388: ++YYCURSOR; -#line 608 "../src/parse/lex.re" +#line 625 "../src/parse/lex.re" { return unesc_hex(tok, cur); } -#line 2447 "src/parse/lex.cc" -yy376: +#line 2517 "src/parse/lex.cc" +yy390: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy366; - if (yych >= ':') goto yy366; + if (yych <= '/') goto yy380; + if (yych >= ':') goto yy380; } else { - if (yych <= 'F') goto yy377; - if (yych <= '`') goto yy366; - if (yych >= 'g') goto yy366; + if (yych <= 'F') goto yy391; + if (yych <= '`') goto yy380; + if (yych >= 'g') goto yy380; } -yy377: +yy391: ++YYCURSOR; if ((yych = (YYCTYPE)*YYCURSOR) <= '@') { - if (yych <= '/') goto yy366; - if (yych <= '9') goto yy368; - goto yy366; + if (yych <= '/') goto yy380; + if (yych <= '9') goto yy382; + goto yy380; } else { - if (yych <= 'F') goto yy368; - if (yych <= '`') goto yy366; - if (yych <= 'f') goto yy368; - goto yy366; + if (yych <= 'F') goto yy382; + if (yych <= '`') goto yy380; + if (yych <= 'f') goto yy382; + goto yy380; } } -#line 624 "../src/parse/lex.re" +#line 641 "../src/parse/lex.re" } @@ -2476,282 +2546,282 @@ uint32_t Scanner::lex_str_chr(char quote, bool &end) end = false; tok = cur; -#line 2480 "src/parse/lex.cc" +#line 2550 "src/parse/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; if ((YYLIMIT - YYCURSOR) < 10) YYFILL(10); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy382; - if (yych == '\\') goto yy384; + if (yych == '\n') goto yy396; + if (yych == '\\') goto yy398; ++YYCURSOR; -#line 637 "../src/parse/lex.re" +#line 654 "../src/parse/lex.re" { end = tok[0] == quote; return static_cast(tok[0]); } -#line 2494 "src/parse/lex.cc" -yy382: +#line 2564 "src/parse/lex.cc" +yy396: ++YYCURSOR; -#line 632 "../src/parse/lex.re" +#line 649 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error"); } -#line 2499 "src/parse/lex.cc" -yy384: +#line 2569 "src/parse/lex.cc" +yy398: ++YYCURSOR; if ((yych = (YYCTYPE)*YYCURSOR) <= 'a') { if (yych <= 'T') { if (yych <= '/') { - if (yych != '\n') goto yy386; + if (yych != '\n') goto yy400; } else { - if (yych <= '3') goto yy388; - if (yych <= '7') goto yy390; - goto yy386; + if (yych <= '3') goto yy402; + if (yych <= '7') goto yy404; + goto yy400; } } else { if (yych <= 'X') { - if (yych <= 'U') goto yy391; - if (yych <= 'W') goto yy386; - goto yy393; + if (yych <= 'U') goto yy405; + if (yych <= 'W') goto yy400; + goto yy407; } else { - if (yych == '\\') goto yy394; - if (yych <= '`') goto yy386; - goto yy396; + if (yych == '\\') goto yy408; + if (yych <= '`') goto yy400; + goto yy410; } } } else { if (yych <= 'r') { if (yych <= 'f') { - if (yych <= 'b') goto yy398; - if (yych <= 'e') goto yy386; - goto yy400; + if (yych <= 'b') goto yy412; + if (yych <= 'e') goto yy400; + goto yy414; } else { - if (yych == 'n') goto yy402; - if (yych <= 'q') goto yy386; - goto yy404; + if (yych == 'n') goto yy416; + if (yych <= 'q') goto yy400; + goto yy418; } } else { if (yych <= 'u') { - if (yych <= 's') goto yy386; - if (yych <= 't') goto yy406; - goto yy393; + if (yych <= 's') goto yy400; + if (yych <= 't') goto yy420; + goto yy407; } else { - if (yych <= 'v') goto yy408; - if (yych == 'x') goto yy410; - goto yy386; + if (yych <= 'v') goto yy422; + if (yych == 'x') goto yy424; + goto yy400; } } } -#line 635 "../src/parse/lex.re" +#line 652 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error in escape sequence"); } -#line 2547 "src/parse/lex.cc" -yy386: +#line 2617 "src/parse/lex.cc" +yy400: ++YYCURSOR; -#line 651 "../src/parse/lex.re" +#line 668 "../src/parse/lex.re" { if (tok[1] != quote) { warn.useless_escape(tline, tok - pos, tok[1]); } return static_cast(tok[1]); } -#line 2557 "src/parse/lex.cc" -yy388: +#line 2627 "src/parse/lex.cc" +yy402: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy389; - if (yych <= '7') goto yy411; -yy389: -#line 634 "../src/parse/lex.re" + if (yych <= '/') goto yy403; + if (yych <= '7') goto yy425; +yy403: +#line 651 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error in octal escape sequence"); } -#line 2566 "src/parse/lex.cc" -yy390: +#line 2636 "src/parse/lex.cc" +yy404: yych = (YYCTYPE)*++YYCURSOR; - goto yy389; -yy391: + goto yy403; +yy405: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy392; - if (yych <= '9') goto yy413; + if (yych <= '/') goto yy406; + if (yych <= '9') goto yy427; } else { - if (yych <= 'F') goto yy413; - if (yych <= '`') goto yy392; - if (yych <= 'f') goto yy413; + if (yych <= 'F') goto yy427; + if (yych <= '`') goto yy406; + if (yych <= 'f') goto yy427; } -yy392: -#line 633 "../src/parse/lex.re" +yy406: +#line 650 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error in hexadecimal escape sequence"); } -#line 2584 "src/parse/lex.cc" -yy393: +#line 2654 "src/parse/lex.cc" +yy407: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy392; - if (yych <= '9') goto yy414; - goto yy392; + if (yych <= '/') goto yy406; + if (yych <= '9') goto yy428; + goto yy406; } else { - if (yych <= 'F') goto yy414; - if (yych <= '`') goto yy392; - if (yych <= 'f') goto yy414; - goto yy392; + if (yych <= 'F') goto yy428; + if (yych <= '`') goto yy406; + if (yych <= 'f') goto yy428; + goto yy406; } -yy394: +yy408: ++YYCURSOR; -#line 650 "../src/parse/lex.re" +#line 667 "../src/parse/lex.re" { return static_cast('\\'); } -#line 2602 "src/parse/lex.cc" -yy396: +#line 2672 "src/parse/lex.cc" +yy410: ++YYCURSOR; -#line 643 "../src/parse/lex.re" +#line 660 "../src/parse/lex.re" { return static_cast('\a'); } -#line 2607 "src/parse/lex.cc" -yy398: +#line 2677 "src/parse/lex.cc" +yy412: ++YYCURSOR; -#line 644 "../src/parse/lex.re" +#line 661 "../src/parse/lex.re" { return static_cast('\b'); } -#line 2612 "src/parse/lex.cc" -yy400: +#line 2682 "src/parse/lex.cc" +yy414: ++YYCURSOR; -#line 645 "../src/parse/lex.re" +#line 662 "../src/parse/lex.re" { return static_cast('\f'); } -#line 2617 "src/parse/lex.cc" -yy402: +#line 2687 "src/parse/lex.cc" +yy416: ++YYCURSOR; -#line 646 "../src/parse/lex.re" +#line 663 "../src/parse/lex.re" { return static_cast('\n'); } -#line 2622 "src/parse/lex.cc" -yy404: +#line 2692 "src/parse/lex.cc" +yy418: ++YYCURSOR; -#line 647 "../src/parse/lex.re" +#line 664 "../src/parse/lex.re" { return static_cast('\r'); } -#line 2627 "src/parse/lex.cc" -yy406: +#line 2697 "src/parse/lex.cc" +yy420: ++YYCURSOR; -#line 648 "../src/parse/lex.re" +#line 665 "../src/parse/lex.re" { return static_cast('\t'); } -#line 2632 "src/parse/lex.cc" -yy408: +#line 2702 "src/parse/lex.cc" +yy422: ++YYCURSOR; -#line 649 "../src/parse/lex.re" +#line 666 "../src/parse/lex.re" { return static_cast('\v'); } -#line 2637 "src/parse/lex.cc" -yy410: +#line 2707 "src/parse/lex.cc" +yy424: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy392; - if (yych <= '9') goto yy415; - goto yy392; + if (yych <= '/') goto yy406; + if (yych <= '9') goto yy429; + goto yy406; } else { - if (yych <= 'F') goto yy415; - if (yych <= '`') goto yy392; - if (yych <= 'f') goto yy415; - goto yy392; + if (yych <= 'F') goto yy429; + if (yych <= '`') goto yy406; + if (yych <= 'f') goto yy429; + goto yy406; } -yy411: +yy425: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '/') goto yy412; - if (yych <= '7') goto yy416; -yy412: + if (yych <= '/') goto yy426; + if (yych <= '7') goto yy430; +yy426: YYCURSOR = YYMARKER; if (yyaccept == 0) { - goto yy389; + goto yy403; } else { - goto yy392; + goto yy406; } -yy413: +yy427: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy412; - if (yych <= '9') goto yy418; - goto yy412; + if (yych <= '/') goto yy426; + if (yych <= '9') goto yy432; + goto yy426; } else { - if (yych <= 'F') goto yy418; - if (yych <= '`') goto yy412; - if (yych <= 'f') goto yy418; - goto yy412; + if (yych <= 'F') goto yy432; + if (yych <= '`') goto yy426; + if (yych <= 'f') goto yy432; + goto yy426; } -yy414: +yy428: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy412; - if (yych <= '9') goto yy419; - goto yy412; + if (yych <= '/') goto yy426; + if (yych <= '9') goto yy433; + goto yy426; } else { - if (yych <= 'F') goto yy419; - if (yych <= '`') goto yy412; - if (yych <= 'f') goto yy419; - goto yy412; + if (yych <= 'F') goto yy433; + if (yych <= '`') goto yy426; + if (yych <= 'f') goto yy433; + goto yy426; } -yy415: +yy429: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy412; - if (yych <= '9') goto yy420; - goto yy412; + if (yych <= '/') goto yy426; + if (yych <= '9') goto yy434; + goto yy426; } else { - if (yych <= 'F') goto yy420; - if (yych <= '`') goto yy412; - if (yych <= 'f') goto yy420; - goto yy412; + if (yych <= 'F') goto yy434; + if (yych <= '`') goto yy426; + if (yych <= 'f') goto yy434; + goto yy426; } -yy416: +yy430: ++YYCURSOR; -#line 642 "../src/parse/lex.re" +#line 659 "../src/parse/lex.re" { return unesc_oct(tok, cur); } -#line 2702 "src/parse/lex.cc" -yy418: +#line 2772 "src/parse/lex.cc" +yy432: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy412; - if (yych <= '9') goto yy422; - goto yy412; + if (yych <= '/') goto yy426; + if (yych <= '9') goto yy436; + goto yy426; } else { - if (yych <= 'F') goto yy422; - if (yych <= '`') goto yy412; - if (yych <= 'f') goto yy422; - goto yy412; + if (yych <= 'F') goto yy436; + if (yych <= '`') goto yy426; + if (yych <= 'f') goto yy436; + goto yy426; } -yy419: +yy433: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy412; - if (yych <= '9') goto yy415; - goto yy412; + if (yych <= '/') goto yy426; + if (yych <= '9') goto yy429; + goto yy426; } else { - if (yych <= 'F') goto yy415; - if (yych <= '`') goto yy412; - if (yych <= 'f') goto yy415; - goto yy412; + if (yych <= 'F') goto yy429; + if (yych <= '`') goto yy426; + if (yych <= 'f') goto yy429; + goto yy426; } -yy420: +yy434: ++YYCURSOR; -#line 641 "../src/parse/lex.re" +#line 658 "../src/parse/lex.re" { return unesc_hex(tok, cur); } -#line 2731 "src/parse/lex.cc" -yy422: +#line 2801 "src/parse/lex.cc" +yy436: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy412; - if (yych >= ':') goto yy412; + if (yych <= '/') goto yy426; + if (yych >= ':') goto yy426; } else { - if (yych <= 'F') goto yy423; - if (yych <= '`') goto yy412; - if (yych >= 'g') goto yy412; + if (yych <= 'F') goto yy437; + if (yych <= '`') goto yy426; + if (yych >= 'g') goto yy426; } -yy423: +yy437: ++YYCURSOR; if ((yych = (YYCTYPE)*YYCURSOR) <= '@') { - if (yych <= '/') goto yy412; - if (yych <= '9') goto yy414; - goto yy412; + if (yych <= '/') goto yy426; + if (yych <= '9') goto yy428; + goto yy426; } else { - if (yych <= 'F') goto yy414; - if (yych <= '`') goto yy412; - if (yych <= 'f') goto yy414; - goto yy412; + if (yych <= 'F') goto yy428; + if (yych <= '`') goto yy426; + if (yych <= 'f') goto yy428; + goto yy426; } } -#line 657 "../src/parse/lex.re" +#line 674 "../src/parse/lex.re" } @@ -2772,7 +2842,7 @@ void Scanner::set_sourceline () sourceline: tok = cur; -#line 2776 "src/parse/lex.cc" +#line 2846 "src/parse/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2812,23 +2882,23 @@ sourceline: if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '!') { - if (yych == '\n') goto yy428; + if (yych == '\n') goto yy442; } else { - if (yych <= '"') goto yy430; - if (yych <= '0') goto yy426; - if (yych <= '9') goto yy431; + if (yych <= '"') goto yy444; + if (yych <= '0') goto yy440; + if (yych <= '9') goto yy445; } -yy426: +yy440: ++YYCURSOR; -yy427: -#line 700 "../src/parse/lex.re" +yy441: +#line 717 "../src/parse/lex.re" { goto sourceline; } -#line 2829 "src/parse/lex.cc" -yy428: +#line 2899 "src/parse/lex.cc" +yy442: ++YYCURSOR; -#line 688 "../src/parse/lex.re" +#line 705 "../src/parse/lex.re" { if (cur == eof) { @@ -2841,19 +2911,19 @@ yy428: tok = cur; return; } -#line 2845 "src/parse/lex.cc" -yy430: +#line 2915 "src/parse/lex.cc" +yy444: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == '\n') goto yy427; - goto yy435; -yy431: + if (yych == '\n') goto yy441; + goto yy449; +yy445: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 64) { - goto yy431; + goto yy445; } -#line 677 "../src/parse/lex.re" +#line 694 "../src/parse/lex.re" { if (!s_to_u32_unsafe (tok, cur, cline)) { @@ -2861,37 +2931,37 @@ yy431: } goto sourceline; } -#line 2865 "src/parse/lex.cc" -yy434: +#line 2935 "src/parse/lex.cc" +yy448: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy435: +yy449: if (yybm[0+yych] & 128) { - goto yy434; + goto yy448; } - if (yych <= '\n') goto yy436; - if (yych <= '"') goto yy437; - goto yy439; -yy436: + if (yych <= '\n') goto yy450; + if (yych <= '"') goto yy451; + goto yy453; +yy450: YYCURSOR = YYMARKER; - goto yy427; -yy437: + goto yy441; +yy451: ++YYCURSOR; -#line 684 "../src/parse/lex.re" +#line 701 "../src/parse/lex.re" { escape (in.file_name, std::string (tok + 1, tok_len () - 2)); // -2 to omit quotes goto sourceline; } -#line 2887 "src/parse/lex.cc" -yy439: +#line 2957 "src/parse/lex.cc" +yy453: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy436; - goto yy434; + if (yych == '\n') goto yy450; + goto yy448; } -#line 703 "../src/parse/lex.re" +#line 720 "../src/parse/lex.re" } diff --git a/re2c/bootstrap/src/parse/lex_conf.cc b/re2c/bootstrap/src/parse/lex_conf.cc index 40b6efc8..7ec1a7a4 100644 --- a/re2c/bootstrap/src/parse/lex_conf.cc +++ b/re2c/bootstrap/src/parse/lex_conf.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 0.16 on Tue Mar 29 12:09:00 2016 */ +/* Generated by re2c 0.16 on Fri Apr 1 16:43:33 2016 */ #line 1 "../src/parse/lex_conf.re" #include "src/util/c99_stdint.h" #include @@ -14,7 +14,7 @@ namespace re2c { // global re2c config (affects the whole file) -#line 36 "../src/parse/lex_conf.re" +#line 37 "../src/parse/lex_conf.re" void Scanner::lex_conf () @@ -75,217 +75,209 @@ void Scanner::lex_conf () yy2: ++cur; yy3: -#line 42 "../src/parse/lex_conf.re" +#line 43 "../src/parse/lex_conf.re" { fatal ((tok - pos) - tchar, "unrecognized configuration"); } #line 81 "src/parse/lex_conf.cc" yy4: yyaccept = 0; yych = (unsigned char)*(ptr = ++cur); - if (yych <= 'n') { - if (yych == 'g') goto yy12; - goto yy3; - } else { - if (yych <= 'o') goto yy14; - if (yych == 't') goto yy15; - goto yy3; - } + if (yych == 'g') goto yy12; + if (yych == 'o') goto yy14; + goto yy3; yy5: yyaccept = 0; yych = (unsigned char)*(ptr = ++cur); - if (yych == 'e') goto yy16; + if (yych == 'e') goto yy15; goto yy3; yy6: yyaccept = 0; yych = (unsigned char)*(ptr = ++cur); - if (yych == 'l') goto yy17; + if (yych == 'l') goto yy16; goto yy3; yy7: yyaccept = 0; yych = (unsigned char)*(ptr = ++cur); - if (yych == 'n') goto yy18; + if (yych == 'n') goto yy17; goto yy3; yy8: yyaccept = 0; yych = (unsigned char)*(ptr = ++cur); - if (yych == 'a') goto yy19; + if (yych == 'a') goto yy18; goto yy3; yy9: yyaccept = 0; yych = (unsigned char)*(ptr = ++cur); - if (yych == 't') goto yy20; + if (yych == 't') goto yy19; goto yy3; yy10: yyaccept = 0; yych = (unsigned char)*(ptr = ++cur); - if (yych == 'a') goto yy21; + if (yych == 'a') goto yy20; goto yy3; yy11: yyaccept = 0; yych = (unsigned char)*(ptr = ++cur); - if (yych == 'y') goto yy22; + if (yych == 'y') goto yy21; goto yy3; yy12: yych = (unsigned char)*++cur; - if (yych == 'o') goto yy23; + if (yych == 'o') goto yy22; yy13: cur = ptr; - if (yyaccept <= 6) { - if (yyaccept <= 3) { + if (yyaccept <= 5) { + if (yyaccept <= 2) { if (yyaccept <= 1) { if (yyaccept == 0) { goto yy3; } else { - goto yy126; + goto yy124; } } else { - if (yyaccept == 2) { - goto yy170; - } else { - goto yy216; - } + goto yy169; } } else { - if (yyaccept <= 5) { - if (yyaccept == 4) { - goto yy222; + if (yyaccept <= 4) { + if (yyaccept == 3) { + goto yy217; } else { - goto yy267; + goto yy225; } } else { - goto yy269; + goto yy275; } } } else { - if (yyaccept <= 9) { - if (yyaccept <= 8) { - if (yyaccept == 7) { - goto yy336; + if (yyaccept <= 8) { + if (yyaccept <= 7) { + if (yyaccept == 6) { + goto yy344; } else { - goto yy373; + goto yy379; } } else { - goto yy396; + goto yy400; } } else { - if (yyaccept <= 11) { - if (yyaccept == 10) { - goto yy402; + if (yyaccept <= 10) { + if (yyaccept == 9) { + goto yy406; } else { - goto yy439; + goto yy443; } } else { - goto yy442; + goto yy446; } } } yy14: yych = (unsigned char)*++cur; - if (yych == 'n') goto yy24; + if (yych == 'n') goto yy23; goto yy13; yy15: yych = (unsigned char)*++cur; - if (yych == 'x') goto yy25; + if (yych == 'f') goto yy24; goto yy13; yy16: yych = (unsigned char)*++cur; - if (yych == 'f') goto yy26; + if (yych == 'a') goto yy25; goto yy13; yy17: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy27; + if (yych == 'd') goto yy26; goto yy13; yy18: yych = (unsigned char)*++cur; - if (yych == 'd') goto yy28; + if (yych == 'b') goto yy27; goto yy13; yy19: yych = (unsigned char)*++cur; - if (yych == 'b') goto yy29; + if (yych == 'a') goto yy28; goto yy13; yy20: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy30; + if (yych == 'r') goto yy29; goto yy13; yy21: - yych = (unsigned char)*++cur; - if (yych == 'r') goto yy31; - goto yy13; -yy22: yych = (unsigned char)*++cur; if (yych <= 'c') { if (yych <= 'a') goto yy13; - if (yych <= 'b') goto yy32; - goto yy33; + if (yych <= 'b') goto yy30; + goto yy31; } else { - if (yych == 'f') goto yy34; + if (yych == 'f') goto yy32; goto yy13; } +yy22: + yych = (unsigned char)*++cur; + if (yych == 't') goto yy33; + goto yy13; yy23: yych = (unsigned char)*++cur; + if (yych == 'd') goto yy34; if (yych == 't') goto yy35; goto yy13; yy24: yych = (unsigned char)*++cur; - if (yych == 'd') goto yy36; + if (yych == 'i') goto yy36; goto yy13; yy25: yych = (unsigned char)*++cur; - if (yych == 'p') goto yy37; + if (yych == 'g') goto yy37; goto yy13; yy26: yych = (unsigned char)*++cur; - if (yych == 'i') goto yy38; + if (yych == 'e') goto yy38; goto yy13; yy27: yych = (unsigned char)*++cur; - if (yych == 'g') goto yy39; + if (yych == 'e') goto yy39; goto yy13; yy28: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy40; + if (yych == 'r') goto yy40; + if (yych == 't') goto yy41; goto yy13; yy29: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy41; + if (yych == 'i') goto yy42; goto yy13; yy30: yych = (unsigned char)*++cur; - if (yych == 'r') goto yy42; - if (yych == 't') goto yy43; + if (yych == 'm') goto yy43; goto yy13; yy31: yych = (unsigned char)*++cur; - if (yych == 'i') goto yy44; + if (yych == 'h') goto yy44; goto yy13; yy32: yych = (unsigned char)*++cur; - if (yych == 'm') goto yy45; + if (yych == 'i') goto yy45; goto yy13; yy33: yych = (unsigned char)*++cur; - if (yych == 'h') goto yy46; + if (yych == 'o') goto yy46; goto yy13; yy34: - yych = (unsigned char)*++cur; - if (yych == 'i') goto yy47; - goto yy13; -yy35: - yych = (unsigned char)*++cur; - if (yych == 'o') goto yy48; - goto yy13; -yy36: yych = (unsigned char)*++cur; if (yych <= 'd') { - if (yych == ':') goto yy49; + if (yych == ':') goto yy47; goto yy13; } else { - if (yych <= 'e') goto yy50; - if (yych == 'p') goto yy51; + if (yych <= 'e') goto yy48; + if (yych == 'p') goto yy49; goto yy13; } +yy35: + yych = (unsigned char)*++cur; + if (yych == 'e') goto yy50; + goto yy13; +yy36: + yych = (unsigned char)*++cur; + if (yych == 'n') goto yy51; + goto yy13; yy37: yych = (unsigned char)*++cur; - if (yych == 'r') goto yy52; + if (yych == 's') goto yy52; goto yy13; yy38: yych = (unsigned char)*++cur; @@ -293,31 +285,31 @@ yy38: goto yy13; yy39: yych = (unsigned char)*++cur; - if (yych == 's') goto yy54; + if (yych == 'l') goto yy54; goto yy13; yy40: yych = (unsigned char)*++cur; - if (yych == 'n') goto yy55; + if (yych == 't') goto yy55; goto yy13; yy41: yych = (unsigned char)*++cur; - if (yych == 'l') goto yy56; + if (yych == 'e') goto yy56; goto yy13; yy42: yych = (unsigned char)*++cur; - if (yych == 't') goto yy57; + if (yych == 'a') goto yy57; goto yy13; yy43: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy58; + if (yych == ':') goto yy58; goto yy13; yy44: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy59; + if (yych == ':') goto yy59; goto yy13; yy45: yych = (unsigned char)*++cur; - if (yych == ':') goto yy60; + if (yych == 'l') goto yy60; goto yy13; yy46: yych = (unsigned char)*++cur; @@ -325,187 +317,179 @@ yy46: goto yy13; yy47: yych = (unsigned char)*++cur; - if (yych == 'l') goto yy62; + if (yych == 'd') goto yy62; + if (yych == 'g') goto yy63; goto yy13; yy48: yych = (unsigned char)*++cur; - if (yych == ':') goto yy63; + if (yych == 'n') goto yy64; goto yy13; yy49: yych = (unsigned char)*++cur; - if (yych == 'd') goto yy64; - if (yych == 'g') goto yy65; + if (yych == 'r') goto yy65; goto yy13; yy50: yych = (unsigned char)*++cur; - if (yych == 'n') goto yy66; + if (yych == 'x') goto yy66; goto yy13; yy51: yych = (unsigned char)*++cur; - if (yych == 'r') goto yy67; + if (yych == 'e') goto yy67; goto yy13; yy52: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy68; + if (yych == ':') goto yy68; goto yy13; yy53: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy69; + if (yych == 't') goto yy69; goto yy13; yy54: yych = (unsigned char)*++cur; if (yych == ':') goto yy70; + if (yych == 'p') goto yy71; goto yy13; yy55: yych = (unsigned char)*++cur; - if (yych == 't') goto yy71; + if (yych == 'l') goto yy72; goto yy13; yy56: yych = (unsigned char)*++cur; - if (yych == ':') goto yy72; - if (yych == 'p') goto yy73; + if (yych == ':') goto yy73; goto yy13; yy57: yych = (unsigned char)*++cur; - if (yych == 'l') goto yy74; + if (yych == 'b') goto yy74; goto yy13; yy58: yych = (unsigned char)*++cur; - if (yych == ':') goto yy75; + if (yych == 'h') goto yy75; goto yy13; yy59: yych = (unsigned char)*++cur; - if (yych == 'b') goto yy76; + if (yych == 'c') goto yy76; + if (yych == 'e') goto yy77; goto yy13; yy60: yych = (unsigned char)*++cur; - if (yych == 'h') goto yy77; + if (yych == 'l') goto yy78; goto yy13; yy61: yych = (unsigned char)*++cur; - if (yych == 'c') goto yy78; - if (yych == 'e') goto yy79; + if (yych == 't') goto yy79; goto yy13; yy62: yych = (unsigned char)*++cur; - if (yych == 'l') goto yy80; + if (yych == 'i') goto yy80; goto yy13; yy63: yych = (unsigned char)*++cur; - if (yych == 't') goto yy81; + if (yych == 'o') goto yy81; goto yy13; yy64: yych = (unsigned char)*++cur; - if (yych == 'i') goto yy82; + if (yych == 'u') goto yy82; goto yy13; yy65: yych = (unsigned char)*++cur; - if (yych == 'o') goto yy83; + if (yych == 'e') goto yy83; goto yy13; yy66: yych = (unsigned char)*++cur; - if (yych == 'u') goto yy84; + if (yych == 't') goto yy84; goto yy13; yy67: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy85; + if (yych == ':') goto yy85; goto yy13; yy68: - yych = (unsigned char)*++cur; - if (yych == 'f') goto yy86; - goto yy13; -yy69: - yych = (unsigned char)*++cur; - if (yych == ':') goto yy87; - goto yy13; -yy70: yych = (unsigned char)*++cur; if (yych <= 'e') { - if (yych == '8') goto yy88; + if (yych == '8') goto yy86; if (yych <= 'd') goto yy13; - goto yy88; + goto yy86; } else { if (yych <= 'u') { if (yych <= 't') goto yy13; - goto yy88; + goto yy86; } else { if (yych <= 'v') goto yy13; - if (yych <= 'x') goto yy88; + if (yych <= 'x') goto yy86; goto yy13; } } +yy69: + yych = (unsigned char)*++cur; + if (yych == ':') goto yy88; + goto yy13; +yy70: + yych = (unsigned char)*++cur; + if (yych == 'y') goto yy89; + goto yy13; yy71: yych = (unsigned char)*++cur; - if (yych == ':') goto yy90; + if (yych == 'r') goto yy90; goto yy13; yy72: yych = (unsigned char)*++cur; - if (yych == 'y') goto yy91; + if (yych == 'a') goto yy91; goto yy13; yy73: yych = (unsigned char)*++cur; - if (yych == 'r') goto yy92; + if (yych == 'a') goto yy92; + if (yych == 'n') goto yy93; goto yy13; yy74: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy93; + if (yych == 'l') goto yy94; goto yy13; yy75: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy94; - if (yych == 'n') goto yy95; + if (yych == 'e') goto yy95; goto yy13; yy76: yych = (unsigned char)*++cur; - if (yych == 'l') goto yy96; + if (yych == 'o') goto yy96; goto yy13; yy77: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy97; + if (yych == 'm') goto yy97; goto yy13; yy78: yych = (unsigned char)*++cur; - if (yych == 'o') goto yy98; + if (yych == ':') goto yy98; goto yy13; yy79: yych = (unsigned char)*++cur; - if (yych == 'm') goto yy99; + if (yych == 'h') goto yy99; goto yy13; yy80: yych = (unsigned char)*++cur; - if (yych == ':') goto yy100; + if (yych == 'v') goto yy100; goto yy13; yy81: yych = (unsigned char)*++cur; - if (yych == 'h') goto yy101; + if (yych == 't') goto yy101; goto yy13; yy82: yych = (unsigned char)*++cur; - if (yych == 'v') goto yy102; + if (yych == 'm') goto yy102; goto yy13; yy83: yych = (unsigned char)*++cur; - if (yych == 't') goto yy103; + if (yych == 'f') goto yy103; goto yy13; yy84: yych = (unsigned char)*++cur; - if (yych == 'm') goto yy104; + if (yych == 's') goto yy104; goto yy13; yy85: yych = (unsigned char)*++cur; - if (yych == 'f') goto yy105; + if (yych == 'Y') goto yy105; goto yy13; yy86: - yych = (unsigned char)*++cur; - if (yych == 'i') goto yy106; - goto yy13; -yy87: - yych = (unsigned char)*++cur; - if (yych == 'Y') goto yy107; - goto yy13; -yy88: ++cur; -#line 45 "../src/parse/lex_conf.re" +#line 46 "../src/parse/lex_conf.re" { Enc::type_t enc = Enc::ASCII; switch (cur[-1]) @@ -529,323 +513,331 @@ yy88: } return; } -#line 533 "src/parse/lex_conf.cc" -yy90: +#line 517 "src/parse/lex_conf.cc" +yy88: yych = (unsigned char)*++cur; if (yych <= 'r') goto yy13; - if (yych <= 's') goto yy108; - if (yych <= 't') goto yy109; + if (yych <= 's') goto yy106; + if (yych <= 't') goto yy107; + goto yy13; +yy89: + yych = (unsigned char)*++cur; + if (yych == 'y') goto yy108; + goto yy13; +yy90: + yych = (unsigned char)*++cur; + if (yych == 'e') goto yy109; goto yy13; yy91: yych = (unsigned char)*++cur; - if (yych == 'y') goto yy110; + if (yych == 'b') goto yy110; goto yy13; yy92: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy111; + if (yych == 'b') goto yy111; goto yy13; yy93: yych = (unsigned char)*++cur; - if (yych == 'b') goto yy112; + if (yych == 'e') goto yy112; goto yy13; yy94: yych = (unsigned char)*++cur; - if (yych == 'b') goto yy113; + if (yych == 'e') goto yy113; goto yy13; yy95: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy114; + if (yych == 'x') goto yy114; goto yy13; yy96: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy115; + if (yych == 'n') goto yy116; goto yy13; yy97: yych = (unsigned char)*++cur; - if (yych == 'x') goto yy116; + if (yych == 'i') goto yy117; goto yy13; yy98: - yych = (unsigned char)*++cur; - if (yych == 'n') goto yy118; - goto yy13; -yy99: - yych = (unsigned char)*++cur; - if (yych == 'i') goto yy119; - goto yy13; -yy100: yych = (unsigned char)*++cur; if (yych <= 'd') { - if (yych == 'c') goto yy120; + if (yych == 'c') goto yy118; goto yy13; } else { - if (yych <= 'e') goto yy121; - if (yych == 'p') goto yy122; + if (yych <= 'e') goto yy119; + if (yych == 'p') goto yy120; goto yy13; } +yy99: + yych = (unsigned char)*++cur; + if (yych == 'r') goto yy121; + goto yy13; +yy100: + yych = (unsigned char)*++cur; + if (yych == 'i') goto yy122; + goto yy13; yy101: yych = (unsigned char)*++cur; - if (yych == 'r') goto yy123; + if (yych == 'o') goto yy123; goto yy13; yy102: yych = (unsigned char)*++cur; - if (yych == 'i') goto yy124; + if (yych == 'p') goto yy125; goto yy13; yy103: yych = (unsigned char)*++cur; - if (yych == 'o') goto yy125; + if (yych == 'i') goto yy126; goto yy13; yy104: yych = (unsigned char)*++cur; - if (yych == 'p') goto yy127; + if (yych == ':') goto yy127; goto yy13; yy105: yych = (unsigned char)*++cur; - if (yych == 'i') goto yy128; + if (yych == 'Y') goto yy128; goto yy13; yy106: yych = (unsigned char)*++cur; - if (yych == 'x') goto yy129; + if (yych == 't') goto yy129; goto yy13; yy107: yych = (unsigned char)*++cur; - if (yych == 'Y') goto yy131; + if (yych == 'o') goto yy130; goto yy13; yy108: yych = (unsigned char)*++cur; - if (yych == 't') goto yy132; + if (yych == 'F') goto yy131; + if (yych == 'N') goto yy132; goto yy13; yy109: yych = (unsigned char)*++cur; - if (yych == 'o') goto yy133; + if (yych == 'f') goto yy133; goto yy13; yy110: yych = (unsigned char)*++cur; - if (yych == 'F') goto yy134; - if (yych == 'N') goto yy135; + if (yych == 'e') goto yy134; goto yy13; yy111: yych = (unsigned char)*++cur; - if (yych == 'f') goto yy136; + if (yych == 'o') goto yy135; goto yy13; yy112: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy137; + if (yych == 'x') goto yy136; goto yy13; yy113: yych = (unsigned char)*++cur; - if (yych == 'o') goto yy138; + if (yych == ':') goto yy137; goto yy13; yy114: + ++cur; +#line 96 "../src/parse/lex_conf.re" + { opts.set_yybmHexTable (lex_conf_number () != 0); return; } +#line 635 "src/parse/lex_conf.cc" +yy116: yych = (unsigned char)*++cur; - if (yych == 'x') goto yy139; + if (yych == 'v') goto yy138; goto yy13; -yy115: +yy117: yych = (unsigned char)*++cur; - if (yych == ':') goto yy140; + if (yych == 't') goto yy139; goto yy13; -yy116: - ++cur; -#line 95 "../src/parse/lex_conf.re" - { opts.set_yybmHexTable (lex_conf_number () != 0); return; } -#line 651 "src/parse/lex_conf.cc" yy118: yych = (unsigned char)*++cur; - if (yych == 'v') goto yy141; + if (yych == 'h') goto yy141; goto yy13; yy119: yych = (unsigned char)*++cur; - if (yych == 't') goto yy142; + if (yych == 'n') goto yy142; goto yy13; yy120: yych = (unsigned char)*++cur; - if (yych == 'h') goto yy144; + if (yych == 'a') goto yy143; goto yy13; yy121: yych = (unsigned char)*++cur; - if (yych == 'n') goto yy145; + if (yych == 'e') goto yy144; goto yy13; yy122: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy146; + if (yych == 'd') goto yy145; goto yy13; yy123: - yych = (unsigned char)*++cur; - if (yych == 'e') goto yy147; - goto yy13; + yyaccept = 1; + yych = (unsigned char)*(ptr = ++cur); + if (yych == '@') goto yy146; yy124: +#line 80 "../src/parse/lex_conf.re" + { opts.set_condGoto (lex_conf_string ()); return; } +#line 671 "src/parse/lex_conf.cc" +yy125: yych = (unsigned char)*++cur; - if (yych == 'd') goto yy148; + if (yych == 'r') goto yy147; goto yy13; -yy125: - yyaccept = 1; - yych = (unsigned char)*(ptr = ++cur); - if (yych == '@') goto yy149; yy126: -#line 79 "../src/parse/lex_conf.re" - { opts.set_condGoto (lex_conf_string ()); return; } -#line 687 "src/parse/lex_conf.cc" -yy127: yych = (unsigned char)*++cur; - if (yych == 'r') goto yy150; + if (yych == 'x') goto yy148; goto yy13; -yy128: +yy127: yych = (unsigned char)*++cur; - if (yych == 'x') goto yy151; + if (yych == 'e') goto yy150; + if (yych == 'p') goto yy151; goto yy13; -yy129: - ++cur; -#line 124 "../src/parse/lex_conf.re" - { opts.set_ctxprefix (lex_conf_string ()); return; } -#line 700 "src/parse/lex_conf.cc" -yy131: +yy128: yych = (unsigned char)*++cur; switch (yych) { - case 'B': goto yy153; - case 'C': goto yy154; - case 'D': goto yy155; - case 'F': goto yy156; - case 'G': goto yy157; - case 'L': goto yy158; - case 'M': goto yy159; - case 'P': goto yy160; - case 'R': goto yy161; - case 'S': goto yy162; + case 'B': goto yy152; + case 'C': goto yy153; + case 'D': goto yy154; + case 'F': goto yy155; + case 'G': goto yy156; + case 'L': goto yy157; + case 'M': goto yy158; + case 'P': goto yy159; + case 'R': goto yy160; + case 'S': goto yy161; default: goto yy13; } +yy129: + yych = (unsigned char)*++cur; + if (yych == 'r') goto yy162; + goto yy13; +yy130: + yych = (unsigned char)*++cur; + if (yych == 'p') goto yy163; + goto yy13; +yy131: + yych = (unsigned char)*++cur; + if (yych == 'i') goto yy165; + goto yy13; yy132: yych = (unsigned char)*++cur; - if (yych == 'r') goto yy163; + if (yych == 'e') goto yy166; goto yy13; yy133: yych = (unsigned char)*++cur; - if (yych == 'p') goto yy164; + if (yych == 'i') goto yy167; goto yy13; yy134: yych = (unsigned char)*++cur; - if (yych == 'i') goto yy166; + if (yych == 'l') goto yy168; goto yy13; yy135: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy167; + if (yych == 'r') goto yy170; goto yy13; yy136: yych = (unsigned char)*++cur; - if (yych == 'i') goto yy168; + if (yych == 't') goto yy171; goto yy13; yy137: yych = (unsigned char)*++cur; - if (yych == 'l') goto yy169; + if (yych == 'y') goto yy172; goto yy13; yy138: yych = (unsigned char)*++cur; - if (yych == 'r') goto yy171; + if (yych == 'e') goto yy173; goto yy13; yy139: + ++cur; +#line 144 "../src/parse/lex_conf.re" + { opts.set_bEmitYYCh (lex_conf_number () != 0); return; } +#line 744 "src/parse/lex_conf.cc" +yy141: yych = (unsigned char)*++cur; - if (yych == 't') goto yy172; + if (yych == 'e') goto yy174; goto yy13; -yy140: +yy142: yych = (unsigned char)*++cur; - if (yych == 'y') goto yy173; + if (yych == 'a') goto yy175; goto yy13; -yy141: +yy143: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy174; + if (yych == 'r') goto yy176; goto yy13; -yy142: - ++cur; -#line 143 "../src/parse/lex_conf.re" - { opts.set_bEmitYYCh (lex_conf_number () != 0); return; } -#line 760 "src/parse/lex_conf.cc" yy144: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy175; + if (yych == 's') goto yy177; goto yy13; yy145: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy176; + if (yych == 'e') goto yy178; goto yy13; yy146: yych = (unsigned char)*++cur; - if (yych == 'r') goto yy177; + if (yych == 'c') goto yy179; goto yy13; yy147: yych = (unsigned char)*++cur; - if (yych == 's') goto yy178; + if (yych == 'e') goto yy180; goto yy13; yy148: + ++cur; +#line 76 "../src/parse/lex_conf.re" + { opts.set_condPrefix (lex_conf_string ()); return; } +#line 777 "src/parse/lex_conf.cc" +yy150: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy179; + if (yych == 'x') goto yy181; goto yy13; -yy149: +yy151: yych = (unsigned char)*++cur; - if (yych == 'c') goto yy180; + if (yych == 'r') goto yy182; goto yy13; -yy150: +yy152: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy181; + if (yych == 'A') goto yy183; goto yy13; -yy151: - ++cur; -#line 75 "../src/parse/lex_conf.re" - { opts.set_condPrefix (lex_conf_string ()); return; } -#line 793 "src/parse/lex_conf.cc" yy153: - yych = (unsigned char)*++cur; - if (yych == 'A') goto yy182; - goto yy13; -yy154: yych = (unsigned char)*++cur; if (yych <= 'S') { - if (yych == 'O') goto yy183; + if (yych == 'O') goto yy184; goto yy13; } else { - if (yych <= 'T') goto yy184; - if (yych <= 'U') goto yy185; + if (yych <= 'T') goto yy185; + if (yych <= 'U') goto yy186; goto yy13; } +yy154: + yych = (unsigned char)*++cur; + if (yych == 'E') goto yy187; + if (yych == 'I') goto yy188; + goto yy13; yy155: yych = (unsigned char)*++cur; - if (yych == 'E') goto yy186; - if (yych == 'I') goto yy187; + if (yych == 'I') goto yy189; goto yy13; yy156: yych = (unsigned char)*++cur; - if (yych == 'I') goto yy188; + if (yych == 'E') goto yy190; goto yy13; yy157: yych = (unsigned char)*++cur; - if (yych == 'E') goto yy189; + if (yych == 'E') goto yy191; + if (yych == 'I') goto yy192; goto yy13; yy158: yych = (unsigned char)*++cur; - if (yych == 'E') goto yy190; - if (yych == 'I') goto yy191; + if (yych == 'A') goto yy193; goto yy13; yy159: yych = (unsigned char)*++cur; - if (yych == 'A') goto yy192; + if (yych == 'E') goto yy194; goto yy13; yy160: yych = (unsigned char)*++cur; - if (yych == 'E') goto yy193; + if (yych == 'E') goto yy195; goto yy13; yy161: yych = (unsigned char)*++cur; - if (yych == 'E') goto yy194; + if (yych == 'E') goto yy196; + if (yych == 'K') goto yy197; goto yy13; yy162: yych = (unsigned char)*++cur; - if (yych == 'E') goto yy195; - if (yych == 'K') goto yy196; + if (yych == 'i') goto yy198; goto yy13; yy163: - yych = (unsigned char)*++cur; - if (yych == 'i') goto yy197; - goto yy13; -yy164: ++cur; -#line 128 "../src/parse/lex_conf.re" +#line 129 "../src/parse/lex_conf.re" { const int32_t n = lex_conf_number (); if (n < 0) @@ -855,1168 +847,1320 @@ yy164: opts.set_topIndent (static_cast (n)); return; } -#line 859 "src/parse/lex_conf.cc" +#line 851 "src/parse/lex_conf.cc" +yy165: + yych = (unsigned char)*++cur; + if (yych == 'l') goto yy199; + goto yy13; yy166: yych = (unsigned char)*++cur; - if (yych == 'l') goto yy198; + if (yych == 'x') goto yy200; goto yy13; yy167: yych = (unsigned char)*++cur; - if (yych == 'x') goto yy199; + if (yych == 'x') goto yy201; goto yy13; yy168: - yych = (unsigned char)*++cur; - if (yych == 'x') goto yy200; - goto yy13; -yy169: yyaccept = 2; yych = (unsigned char)*(ptr = ++cur); ctx = cur; if (yybm[0+yych] & 64) { - goto yy202; + goto yy203; } - if (yych == '=') goto yy204; -yy170: -#line 156 "../src/parse/lex_conf.re" + if (yych == '=') goto yy205; +yy169: +#line 157 "../src/parse/lex_conf.re" { out.set_user_start_label (lex_conf_string ()); return; } -#line 883 "src/parse/lex_conf.cc" +#line 875 "src/parse/lex_conf.cc" +yy170: + yych = (unsigned char)*++cur; + if (yych == 't') goto yy207; + goto yy13; yy171: yych = (unsigned char)*++cur; - if (yych == 't') goto yy206; + if (yych == 'l') goto yy209; goto yy13; yy172: yych = (unsigned char)*++cur; - if (yych == 'l') goto yy208; + if (yych == 'y') goto yy210; goto yy13; yy173: yych = (unsigned char)*++cur; - if (yych == 'y') goto yy209; + if (yych == 'r') goto yy211; goto yy13; yy174: yych = (unsigned char)*++cur; - if (yych == 'r') goto yy210; + if (yych == 'c') goto yy212; goto yy13; yy175: yych = (unsigned char)*++cur; - if (yych == 'c') goto yy211; + if (yych == 'b') goto yy213; goto yy13; yy176: yych = (unsigned char)*++cur; - if (yych == 'b') goto yy212; + if (yych == 'a') goto yy214; goto yy13; yy177: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy213; + if (yych == 'h') goto yy215; goto yy13; yy178: yych = (unsigned char)*++cur; - if (yych == 'h') goto yy214; + if (yych == 'r') goto yy216; goto yy13; yy179: yych = (unsigned char)*++cur; - if (yych == 'r') goto yy215; + if (yych == 'o') goto yy218; goto yy13; yy180: yych = (unsigned char)*++cur; - if (yych == 'o') goto yy217; + if (yych == 'f') goto yy219; goto yy13; yy181: yych = (unsigned char)*++cur; - if (yych == 'f') goto yy218; + if (yych == 'p') goto yy220; goto yy13; yy182: yych = (unsigned char)*++cur; - if (yych == 'C') goto yy219; + if (yych == 'e') goto yy221; goto yy13; yy183: yych = (unsigned char)*++cur; - if (yych == 'N') goto yy220; + if (yych == 'C') goto yy222; goto yy13; yy184: yych = (unsigned char)*++cur; - if (yych <= 'W') goto yy13; - if (yych <= 'X') goto yy221; - if (yych <= 'Y') goto yy223; + if (yych == 'N') goto yy223; goto yy13; yy185: yych = (unsigned char)*++cur; - if (yych == 'R') goto yy224; + if (yych <= 'W') goto yy13; + if (yych <= 'X') goto yy224; + if (yych <= 'Y') goto yy226; goto yy13; yy186: yych = (unsigned char)*++cur; - if (yych == 'B') goto yy225; + if (yych == 'R') goto yy227; goto yy13; yy187: yych = (unsigned char)*++cur; - if (yych == 'S') goto yy226; + if (yych == 'B') goto yy228; goto yy13; yy188: yych = (unsigned char)*++cur; - if (yych == 'L') goto yy227; + if (yych == 'S') goto yy229; goto yy13; yy189: yych = (unsigned char)*++cur; - if (yych == 'T') goto yy228; + if (yych == 'L') goto yy230; goto yy13; yy190: yych = (unsigned char)*++cur; - if (yych == 'S') goto yy229; + if (yych == 'T') goto yy231; goto yy13; yy191: yych = (unsigned char)*++cur; - if (yych == 'M') goto yy230; + if (yych == 'S') goto yy232; goto yy13; yy192: yych = (unsigned char)*++cur; - if (yych == 'R') goto yy231; + if (yych == 'M') goto yy233; goto yy13; yy193: yych = (unsigned char)*++cur; - if (yych == 'E') goto yy232; + if (yych == 'R') goto yy234; goto yy13; yy194: yych = (unsigned char)*++cur; - if (yych == 'S') goto yy233; + if (yych == 'E') goto yy235; goto yy13; yy195: yych = (unsigned char)*++cur; - if (yych == 'T') goto yy234; + if (yych == 'S') goto yy236; goto yy13; yy196: yych = (unsigned char)*++cur; - if (yych == 'I') goto yy235; + if (yych == 'T') goto yy237; goto yy13; yy197: yych = (unsigned char)*++cur; - if (yych == 'n') goto yy236; + if (yych == 'I') goto yy238; goto yy13; yy198: yych = (unsigned char)*++cur; - if (yych == 'l') goto yy237; + if (yych == 'n') goto yy239; goto yy13; yy199: yych = (unsigned char)*++cur; - if (yych == 't') goto yy238; + if (yych == 'l') goto yy240; goto yy13; yy200: + yych = (unsigned char)*++cur; + if (yych == 't') goto yy241; + goto yy13; +yy201: ++cur; -#line 152 "../src/parse/lex_conf.re" +#line 153 "../src/parse/lex_conf.re" { opts.set_labelPrefix (lex_conf_string ()); return; } #line 1006 "src/parse/lex_conf.cc" -yy202: +yy203: ++cur; if (lim <= cur) fill(1); yych = (unsigned char)*cur; if (yybm[0+yych] & 64) { - goto yy202; + goto yy203; } if (yych != '=') goto yy13; -yy204: +yy205: ++cur; if ((lim - cur) < 2) fill(2); yych = (unsigned char)*cur; if (yych <= ',') { if (yych <= '\t') { if (yych <= 0x08) goto yy13; - goto yy204; + goto yy205; } else { - if (yych == ' ') goto yy204; + if (yych == ' ') goto yy205; goto yy13; } } else { if (yych <= '/') { - if (yych <= '-') goto yy240; + if (yych <= '-') goto yy243; goto yy13; } else { - if (yych <= '0') goto yy241; - if (yych <= '9') goto yy243; + if (yych <= '0') goto yy244; + if (yych <= '9') goto yy246; goto yy13; } } -yy206: +yy207: ++cur; -#line 90 "../src/parse/lex_conf.re" +#line 91 "../src/parse/lex_conf.re" { opts.set_bUseStateAbort (lex_conf_number () != 0); return; } #line 1041 "src/parse/lex_conf.cc" -yy208: +yy209: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy245; + if (yych == 'a') goto yy248; goto yy13; -yy209: +yy210: yych = (unsigned char)*++cur; if (yych <= 'c') { if (yych <= '`') goto yy13; - if (yych <= 'a') goto yy246; - if (yych <= 'b') goto yy247; - goto yy248; + if (yych <= 'a') goto yy249; + if (yych <= 'b') goto yy250; + goto yy251; } else { if (yych <= 'r') goto yy13; - if (yych <= 's') goto yy249; - if (yych <= 't') goto yy250; + if (yych <= 's') goto yy252; + if (yych <= 't') goto yy253; goto yy13; } -yy210: - yych = (unsigned char)*++cur; - if (yych == 's') goto yy251; - goto yy13; yy211: yych = (unsigned char)*++cur; - if (yych == 'k') goto yy252; + if (yych == 's') goto yy254; goto yy13; yy212: yych = (unsigned char)*++cur; - if (yych == 'l') goto yy254; + if (yych == 'k') goto yy255; goto yy13; yy213: yych = (unsigned char)*++cur; - if (yych == 'm') goto yy255; + if (yych == 'l') goto yy257; goto yy13; yy214: yych = (unsigned char)*++cur; - if (yych == 'o') goto yy256; + if (yych == 'm') goto yy258; goto yy13; yy215: + yych = (unsigned char)*++cur; + if (yych == 'o') goto yy259; + goto yy13; +yy216: yyaccept = 3; yych = (unsigned char)*(ptr = ++cur); - if (yych == '@') goto yy257; -yy216: -#line 77 "../src/parse/lex_conf.re" + if (yych == '@') goto yy260; +yy217: +#line 78 "../src/parse/lex_conf.re" { opts.set_condDivider (lex_conf_string ()); return; } #line 1086 "src/parse/lex_conf.cc" -yy217: - yych = (unsigned char)*++cur; - if (yych == 'n') goto yy258; - goto yy13; yy218: yych = (unsigned char)*++cur; - if (yych == 'i') goto yy259; + if (yych == 'n') goto yy261; goto yy13; yy219: yych = (unsigned char)*++cur; - if (yych == 'K') goto yy260; + if (yych == 'i') goto yy262; goto yy13; yy220: yych = (unsigned char)*++cur; - if (yych == 'D') goto yy261; + if (yych == 'r') goto yy263; goto yy13; yy221: - yyaccept = 4; - yych = (unsigned char)*(ptr = ++cur); - if (yych == 'M') goto yy262; -yy222: -#line 121 "../src/parse/lex_conf.re" - { opts.set_yyctx (lex_conf_string ()); return; } -#line 1110 "src/parse/lex_conf.cc" -yy223: yych = (unsigned char)*++cur; - if (yych == 'P') goto yy263; + if (yych == 'f') goto yy265; goto yy13; -yy224: +yy222: yych = (unsigned char)*++cur; - if (yych == 'S') goto yy264; + if (yych == 'K') goto yy266; goto yy13; -yy225: +yy223: yych = (unsigned char)*++cur; - if (yych == 'U') goto yy265; + if (yych == 'D') goto yy267; goto yy13; +yy224: + yyaccept = 4; + yych = (unsigned char)*(ptr = ++cur); + if (yych == 'M') goto yy268; +yy225: +#line 121 "../src/parse/lex_conf.re" + { opts.set_yyctx (lex_conf_string ()); return; } +#line 1118 "src/parse/lex_conf.cc" yy226: yych = (unsigned char)*++cur; - if (yych == 'T') goto yy266; + if (yych == 'P') goto yy269; goto yy13; yy227: yych = (unsigned char)*++cur; - if (yych == 'L') goto yy268; + if (yych == 'S') goto yy270; goto yy13; yy228: yych = (unsigned char)*++cur; - if (yych == 'C') goto yy270; - if (yych == 'S') goto yy271; + if (yych == 'U') goto yy271; goto yy13; yy229: yych = (unsigned char)*++cur; - if (yych == 'S') goto yy272; + if (yych == 'T') goto yy272; goto yy13; yy230: yych = (unsigned char)*++cur; - if (yych == 'I') goto yy273; + if (yych == 'L') goto yy274; goto yy13; yy231: yych = (unsigned char)*++cur; - if (yych == 'K') goto yy274; + if (yych == 'C') goto yy276; + if (yych == 'S') goto yy277; goto yy13; yy232: yych = (unsigned char)*++cur; - if (yych == 'K') goto yy275; + if (yych == 'S') goto yy278; goto yy13; yy233: yych = (unsigned char)*++cur; - if (yych == 'T') goto yy277; + if (yych == 'I') goto yy279; goto yy13; yy234: yych = (unsigned char)*++cur; - if (yych == 'C') goto yy278; - if (yych == 'S') goto yy279; + if (yych == 'K') goto yy280; goto yy13; yy235: yych = (unsigned char)*++cur; - if (yych == 'P') goto yy280; + if (yych == 'K') goto yy281; goto yy13; yy236: yych = (unsigned char)*++cur; - if (yych == 'g') goto yy282; + if (yych == 'T') goto yy283; goto yy13; yy237: yych = (unsigned char)*++cur; - if (yych == 'L') goto yy284; + if (yych == 'C') goto yy284; + if (yych == 'S') goto yy285; goto yy13; yy238: + yych = (unsigned char)*++cur; + if (yych == 'P') goto yy286; + goto yy13; +yy239: + yych = (unsigned char)*++cur; + if (yych == 'g') goto yy288; + goto yy13; +yy240: + yych = (unsigned char)*++cur; + if (yych == 'L') goto yy290; + goto yy13; +yy241: ++cur; -#line 89 "../src/parse/lex_conf.re" +#line 90 "../src/parse/lex_conf.re" { opts.set_yynext (lex_conf_string ()); return; } -#line 1177 "src/parse/lex_conf.cc" -yy240: +#line 1185 "src/parse/lex_conf.cc" +yy243: yych = (unsigned char)*++cur; if (yych <= '0') goto yy13; - if (yych <= '9') goto yy243; + if (yych <= '9') goto yy246; goto yy13; -yy241: +yy244: ++cur; -yy242: +yy245: cur = ctx; -#line 155 "../src/parse/lex_conf.re" +#line 156 "../src/parse/lex_conf.re" { out.set_force_start_label (lex_conf_number () != 0); return; } -#line 1189 "src/parse/lex_conf.cc" -yy243: +#line 1197 "src/parse/lex_conf.cc" +yy246: ++cur; if (lim <= cur) fill(1); yych = (unsigned char)*cur; if (yybm[0+yych] & 128) { - goto yy243; + goto yy246; } - goto yy242; -yy245: - yych = (unsigned char)*++cur; - if (yych == 'b') goto yy285; - goto yy13; -yy246: - yych = (unsigned char)*++cur; - if (yych == 'c') goto yy286; - goto yy13; -yy247: - yych = (unsigned char)*++cur; - if (yych == 'm') goto yy287; - goto yy13; + goto yy245; yy248: yych = (unsigned char)*++cur; - if (yych == 'h') goto yy289; - if (yych == 't') goto yy291; + if (yych == 'b') goto yy291; goto yy13; yy249: yych = (unsigned char)*++cur; - if (yych == 't') goto yy292; + if (yych == 'c') goto yy292; goto yy13; yy250: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy293; + if (yych == 'm') goto yy293; goto yy13; yy251: yych = (unsigned char)*++cur; - if (yych == 'i') goto yy294; + if (yych == 'h') goto yy295; + if (yych == 't') goto yy297; goto yy13; yy252: - ++cur; -#line 150 "../src/parse/lex_conf.re" - { opts.set_fill_check (lex_conf_number () != 0); return; } -#line 1231 "src/parse/lex_conf.cc" -yy254: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy295; + if (yych == 't') goto yy298; goto yy13; -yy255: +yy253: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy297; + if (yych == 'a') goto yy299; goto yy13; -yy256: +yy254: yych = (unsigned char)*++cur; - if (yych == 'l') goto yy298; + if (yych == 'i') goto yy300; goto yy13; +yy255: + ++cur; +#line 151 "../src/parse/lex_conf.re" + { opts.set_fill_check (lex_conf_number () != 0); return; } +#line 1239 "src/parse/lex_conf.cc" yy257: yych = (unsigned char)*++cur; - if (yych == 'c') goto yy299; + if (yych == 'e') goto yy301; goto yy13; yy258: yych = (unsigned char)*++cur; - if (yych == 'd') goto yy300; + if (yych == 'e') goto yy303; goto yy13; yy259: yych = (unsigned char)*++cur; - if (yych == 'x') goto yy302; + if (yych == 'l') goto yy304; goto yy13; yy260: yych = (unsigned char)*++cur; - if (yych == 'U') goto yy304; + if (yych == 'c') goto yy305; goto yy13; yy261: yych = (unsigned char)*++cur; - if (yych == 'T') goto yy305; + if (yych == 'd') goto yy306; goto yy13; yy262: yych = (unsigned char)*++cur; - if (yych == 'A') goto yy306; + if (yych == 'x') goto yy308; goto yy13; yy263: + ++cur; +#line 125 "../src/parse/lex_conf.re" + { opts.set_contexts_expr (lex_conf_string ()); return; } +#line 1268 "src/parse/lex_conf.cc" +yy265: yych = (unsigned char)*++cur; - if (yych == 'E') goto yy307; + if (yych == 'i') goto yy310; goto yy13; -yy264: +yy266: yych = (unsigned char)*++cur; - if (yych == 'O') goto yy309; + if (yych == 'U') goto yy311; goto yy13; -yy265: +yy267: yych = (unsigned char)*++cur; - if (yych == 'G') goto yy310; - goto yy13; -yy266: - yyaccept = 5; - yych = (unsigned char)*(ptr = ++cur); if (yych == 'T') goto yy312; -yy267: -#line 122 "../src/parse/lex_conf.re" - { opts.set_yydist (lex_conf_string ()); return; } -#line 1287 "src/parse/lex_conf.cc" + goto yy13; yy268: - yyaccept = 6; - yych = (unsigned char)*(ptr = ++cur); - if (yych == ':') goto yy313; - if (yych == '@') goto yy314; -yy269: -#line 145 "../src/parse/lex_conf.re" - { opts.set_fill (lex_conf_string ()); return; } -#line 1296 "src/parse/lex_conf.cc" -yy270: yych = (unsigned char)*++cur; - if (yych == 'O') goto yy315; + if (yych == 'A') goto yy313; goto yy13; -yy271: +yy269: yych = (unsigned char)*++cur; - if (yych == 'T') goto yy316; + if (yych == 'E') goto yy314; goto yy13; -yy272: +yy270: yych = (unsigned char)*++cur; - if (yych == 'T') goto yy317; + if (yych == 'O') goto yy316; goto yy13; -yy273: +yy271: yych = (unsigned char)*++cur; - if (yych == 'T') goto yy318; + if (yych == 'G') goto yy317; goto yy13; +yy272: + ++cur; +#line 122 "../src/parse/lex_conf.re" + { opts.set_yydist (lex_conf_string ()); return; } +#line 1301 "src/parse/lex_conf.cc" yy274: + yyaccept = 5; + yych = (unsigned char)*(ptr = ++cur); + if (yych == ':') goto yy319; + if (yych == '@') goto yy320; +yy275: +#line 146 "../src/parse/lex_conf.re" + { opts.set_fill (lex_conf_string ()); return; } +#line 1310 "src/parse/lex_conf.cc" +yy276: yych = (unsigned char)*++cur; - if (yych == 'E') goto yy320; + if (yych == 'O') goto yy321; goto yy13; -yy275: - ++cur; -#line 113 "../src/parse/lex_conf.re" - { opts.set_yypeek (lex_conf_string ()); return; } -#line 1321 "src/parse/lex_conf.cc" yy277: yych = (unsigned char)*++cur; - if (yych == 'O') goto yy321; + if (yych == 'T') goto yy322; goto yy13; yy278: yych = (unsigned char)*++cur; - if (yych == 'O') goto yy322; + if (yych == 'T') goto yy323; goto yy13; yy279: yych = (unsigned char)*++cur; - if (yych == 'T') goto yy323; + if (yych == 'T') goto yy324; goto yy13; yy280: + yych = (unsigned char)*++cur; + if (yych == 'E') goto yy326; + goto yy13; +yy281: ++cur; #line 114 "../src/parse/lex_conf.re" - { opts.set_yyskip (lex_conf_string ()); return; } -#line 1338 "src/parse/lex_conf.cc" -yy282: - ++cur; -#line 126 "../src/parse/lex_conf.re" - { opts.set_indString (lex_conf_string ()); return; } -#line 1343 "src/parse/lex_conf.cc" + { opts.set_yypeek (lex_conf_string ()); return; } +#line 1335 "src/parse/lex_conf.cc" +yy283: + yych = (unsigned char)*++cur; + if (yych == 'O') goto yy327; + goto yy13; yy284: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy324; + if (yych == 'O') goto yy328; goto yy13; yy285: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy325; + if (yych == 'T') goto yy329; goto yy13; yy286: - yych = (unsigned char)*++cur; - if (yych == 'c') goto yy326; - goto yy13; -yy287: ++cur; -#line 94 "../src/parse/lex_conf.re" - { opts.set_yybm (lex_conf_string ()); return; } -#line 1360 "src/parse/lex_conf.cc" -yy289: +#line 115 "../src/parse/lex_conf.re" + { opts.set_yyskip (lex_conf_string ()); return; } +#line 1352 "src/parse/lex_conf.cc" +yy288: ++cur; -#line 141 "../src/parse/lex_conf.re" - { opts.set_yych (lex_conf_string ()); return; } -#line 1365 "src/parse/lex_conf.cc" +#line 127 "../src/parse/lex_conf.re" + { opts.set_indString (lex_conf_string ()); return; } +#line 1357 "src/parse/lex_conf.cc" +yy290: + yych = (unsigned char)*++cur; + if (yych == 'a') goto yy330; + goto yy13; yy291: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy327; + if (yych == 'e') goto yy331; goto yy13; yy292: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy328; + if (yych == 'c') goto yy332; goto yy13; yy293: - yych = (unsigned char)*++cur; - if (yych == 'r') goto yy329; - goto yy13; -yy294: - yych = (unsigned char)*++cur; - if (yych == 'o') goto yy330; - goto yy13; + ++cur; +#line 95 "../src/parse/lex_conf.re" + { opts.set_yybm (lex_conf_string ()); return; } +#line 1374 "src/parse/lex_conf.cc" yy295: ++cur; -#line 146 "../src/parse/lex_conf.re" - { opts.set_fill_use (lex_conf_number () != 0); return; } -#line 1386 "src/parse/lex_conf.cc" +#line 142 "../src/parse/lex_conf.re" + { opts.set_yych (lex_conf_string ()); return; } +#line 1379 "src/parse/lex_conf.cc" yy297: yych = (unsigned char)*++cur; - if (yych == 't') goto yy331; + if (yych == 'a') goto yy333; goto yy13; yy298: yych = (unsigned char)*++cur; - if (yych == 'd') goto yy332; + if (yych == 'a') goto yy334; goto yy13; yy299: yych = (unsigned char)*++cur; - if (yych == 'o') goto yy334; + if (yych == 'r') goto yy335; goto yy13; yy300: + yych = (unsigned char)*++cur; + if (yych == 'o') goto yy336; + goto yy13; +yy301: ++cur; -#line 80 "../src/parse/lex_conf.re" - { opts.set_condGotoParam (lex_conf_string ()); return; } -#line 1403 "src/parse/lex_conf.cc" -yy302: - ++cur; -#line 76 "../src/parse/lex_conf.re" - { opts.set_condEnumPrefix (lex_conf_string ()); return; } -#line 1408 "src/parse/lex_conf.cc" +#line 147 "../src/parse/lex_conf.re" + { opts.set_fill_use (lex_conf_number () != 0); return; } +#line 1400 "src/parse/lex_conf.cc" +yy303: + yych = (unsigned char)*++cur; + if (yych == 't') goto yy337; + goto yy13; yy304: yych = (unsigned char)*++cur; - if (yych == 'P') goto yy335; + if (yych == 'd') goto yy338; goto yy13; yy305: yych = (unsigned char)*++cur; - if (yych == 'Y') goto yy337; + if (yych == 'o') goto yy340; goto yy13; yy306: + ++cur; +#line 81 "../src/parse/lex_conf.re" + { opts.set_condGotoParam (lex_conf_string ()); return; } +#line 1417 "src/parse/lex_conf.cc" +yy308: + ++cur; +#line 77 "../src/parse/lex_conf.re" + { opts.set_condEnumPrefix (lex_conf_string ()); return; } +#line 1422 "src/parse/lex_conf.cc" +yy310: yych = (unsigned char)*++cur; - if (yych == 'R') goto yy338; + if (yych == 'x') goto yy341; goto yy13; -yy307: - ++cur; -#line 140 "../src/parse/lex_conf.re" - { opts.set_yyctype (lex_conf_string ()); return; } -#line 1425 "src/parse/lex_conf.cc" -yy309: +yy311: yych = (unsigned char)*++cur; - if (yych == 'R') goto yy339; + if (yych == 'P') goto yy343; goto yy13; -yy310: - ++cur; -#line 138 "../src/parse/lex_conf.re" - { opts.set_yydebug (lex_conf_string ()); return; } -#line 1434 "src/parse/lex_conf.cc" yy312: yych = (unsigned char)*++cur; - if (yych == 'Y') goto yy341; + if (yych == 'Y') goto yy345; goto yy13; yy313: yych = (unsigned char)*++cur; - if (yych == 'n') goto yy342; + if (yych == 'R') goto yy346; goto yy13; yy314: - yych = (unsigned char)*++cur; - if (yych == 'l') goto yy343; - goto yy13; -yy315: - yych = (unsigned char)*++cur; - if (yych == 'N') goto yy344; - goto yy13; + ++cur; +#line 141 "../src/parse/lex_conf.re" + { opts.set_yyctype (lex_conf_string ()); return; } +#line 1443 "src/parse/lex_conf.cc" yy316: yych = (unsigned char)*++cur; - if (yych == 'A') goto yy345; + if (yych == 'R') goto yy347; goto yy13; yy317: + ++cur; +#line 139 "../src/parse/lex_conf.re" + { opts.set_yydebug (lex_conf_string ()); return; } +#line 1452 "src/parse/lex_conf.cc" +yy319: yych = (unsigned char)*++cur; - if (yych == 'H') goto yy346; + if (yych == 'n') goto yy349; goto yy13; -yy318: - ++cur; -#line 111 "../src/parse/lex_conf.re" - { opts.set_yylimit (lex_conf_string ()); return; } -#line 1463 "src/parse/lex_conf.cc" yy320: yych = (unsigned char)*++cur; - if (yych == 'R') goto yy347; + if (yych == 'l') goto yy350; goto yy13; yy321: yych = (unsigned char)*++cur; - if (yych == 'R') goto yy349; + if (yych == 'N') goto yy351; goto yy13; yy322: yych = (unsigned char)*++cur; - if (yych == 'N') goto yy350; + if (yych == 'A') goto yy352; goto yy13; yy323: yych = (unsigned char)*++cur; - if (yych == 'A') goto yy351; + if (yych == 'H') goto yy353; goto yy13; yy324: - yych = (unsigned char)*++cur; - if (yych == 'b') goto yy352; - goto yy13; -yy325: - yych = (unsigned char)*++cur; - if (yych == 'l') goto yy353; - goto yy13; + ++cur; +#line 112 "../src/parse/lex_conf.re" + { opts.set_yylimit (lex_conf_string ()); return; } +#line 1477 "src/parse/lex_conf.cc" yy326: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy355; + if (yych == 'R') goto yy354; goto yy13; yy327: yych = (unsigned char)*++cur; - if (yych == 'b') goto yy356; + if (yych == 'R') goto yy356; goto yy13; yy328: yych = (unsigned char)*++cur; - if (yych == 'b') goto yy357; + if (yych == 'N') goto yy357; goto yy13; yy329: yych = (unsigned char)*++cur; - if (yych == 'g') goto yy358; + if (yych == 'A') goto yy358; goto yy13; yy330: yych = (unsigned char)*++cur; - if (yych == 'n') goto yy359; + if (yych == 'b') goto yy359; goto yy13; yy331: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy361; + if (yych == 'l') goto yy360; goto yy13; yy332: - ++cur; -#line 97 "../src/parse/lex_conf.re" - { - const int32_t n = lex_conf_number (); - if (n < 0) - { - fatal ("configuration 'cgoto:threshold' must be nonnegative"); - } - opts.set_cGotoThreshold (static_cast (n)); - return; - } -#line 1524 "src/parse/lex_conf.cc" -yy334: yych = (unsigned char)*++cur; - if (yych == 'n') goto yy362; + if (yych == 'e') goto yy362; goto yy13; -yy335: - yyaccept = 7; - yych = (unsigned char)*(ptr = ++cur); - if (yych == 'C') goto yy363; -yy336: -#line 115 "../src/parse/lex_conf.re" - { opts.set_yybackup (lex_conf_string ()); return; } -#line 1536 "src/parse/lex_conf.cc" -yy337: +yy333: yych = (unsigned char)*++cur; - if (yych == 'P') goto yy364; + if (yych == 'b') goto yy363; goto yy13; -yy338: +yy334: yych = (unsigned char)*++cur; - if (yych == 'K') goto yy365; + if (yych == 'b') goto yy364; goto yy13; -yy339: - ++cur; -#line 108 "../src/parse/lex_conf.re" - { opts.set_yycursor (lex_conf_string ()); return; } -#line 1549 "src/parse/lex_conf.cc" -yy341: +yy335: yych = (unsigned char)*++cur; - if (yych == 'P') goto yy366; + if (yych == 'g') goto yy365; goto yy13; -yy342: +yy336: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy367; + if (yych == 'n') goto yy366; goto yy13; -yy343: +yy337: yych = (unsigned char)*++cur; if (yych == 'e') goto yy368; goto yy13; -yy344: +yy338: + ++cur; +#line 98 "../src/parse/lex_conf.re" + { + const int32_t n = lex_conf_number (); + if (n < 0) + { + fatal ("configuration 'cgoto:threshold' must be nonnegative"); + } + opts.set_cGotoThreshold (static_cast (n)); + return; + } +#line 1538 "src/parse/lex_conf.cc" +yy340: yych = (unsigned char)*++cur; - if (yych == 'D') goto yy369; + if (yych == 'n') goto yy369; goto yy13; +yy341: + ++cur; +#line 124 "../src/parse/lex_conf.re" + { opts.set_contexts_prefix(lex_conf_string ()); return; } +#line 1547 "src/parse/lex_conf.cc" +yy343: + yyaccept = 6; + yych = (unsigned char)*(ptr = ++cur); + if (yych == 'C') goto yy370; +yy344: +#line 116 "../src/parse/lex_conf.re" + { opts.set_yybackup (lex_conf_string ()); return; } +#line 1555 "src/parse/lex_conf.cc" yy345: yych = (unsigned char)*++cur; - if (yych == 'T') goto yy370; + if (yych == 'P') goto yy371; goto yy13; yy346: yych = (unsigned char)*++cur; - if (yych == 'A') goto yy371; + if (yych == 'K') goto yy372; goto yy13; yy347: ++cur; #line 109 "../src/parse/lex_conf.re" - { opts.set_yymarker (lex_conf_string ()); return; } -#line 1578 "src/parse/lex_conf.cc" + { opts.set_yycursor (lex_conf_string ()); return; } +#line 1568 "src/parse/lex_conf.cc" yy349: yych = (unsigned char)*++cur; - if (yych == 'E') goto yy372; + if (yych == 'a') goto yy373; goto yy13; yy350: yych = (unsigned char)*++cur; - if (yych == 'D') goto yy374; + if (yych == 'e') goto yy374; goto yy13; yy351: yych = (unsigned char)*++cur; - if (yych == 'T') goto yy375; + if (yych == 'D') goto yy375; goto yy13; yy352: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy376; + if (yych == 'T') goto yy376; goto yy13; yy353: - ++cur; -#line 91 "../src/parse/lex_conf.re" - { opts.set_bUseStateNext (lex_conf_number () != 0); return; } -#line 1599 "src/parse/lex_conf.cc" -yy355: yych = (unsigned char)*++cur; - if (yych == 'p') goto yy377; + if (yych == 'A') goto yy377; goto yy13; +yy354: + ++cur; +#line 110 "../src/parse/lex_conf.re" + { opts.set_yymarker (lex_conf_string ()); return; } +#line 1593 "src/parse/lex_conf.cc" yy356: yych = (unsigned char)*++cur; - if (yych == 'l') goto yy378; + if (yych == 'E') goto yy378; goto yy13; yy357: yych = (unsigned char)*++cur; - if (yych == 'l') goto yy379; + if (yych == 'D') goto yy380; goto yy13; yy358: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy380; + if (yych == 'T') goto yy381; goto yy13; yy359: - ++cur; -#line 142 "../src/parse/lex_conf.re" - { opts.set_yychConversion (lex_conf_number () != 0); return; } -#line 1620 "src/parse/lex_conf.cc" -yy361: yych = (unsigned char)*++cur; - if (yych == 'r') goto yy381; + if (yych == 'e') goto yy382; goto yy13; +yy360: + ++cur; +#line 92 "../src/parse/lex_conf.re" + { opts.set_bUseStateNext (lex_conf_number () != 0); return; } +#line 1614 "src/parse/lex_conf.cc" yy362: yych = (unsigned char)*++cur; - if (yych == 'd') goto yy383; + if (yych == 'p') goto yy383; goto yy13; yy363: yych = (unsigned char)*++cur; - if (yych == 'T') goto yy385; + if (yych == 'l') goto yy384; goto yy13; yy364: yych = (unsigned char)*++cur; - if (yych == 'E') goto yy386; + if (yych == 'l') goto yy385; goto yy13; yy365: yych = (unsigned char)*++cur; - if (yych == 'E') goto yy388; + if (yych == 'e') goto yy386; goto yy13; yy366: - yych = (unsigned char)*++cur; - if (yych == 'E') goto yy389; - goto yy13; -yy367: - yych = (unsigned char)*++cur; - if (yych == 'k') goto yy391; - goto yy13; + ++cur; +#line 143 "../src/parse/lex_conf.re" + { opts.set_yychConversion (lex_conf_number () != 0); return; } +#line 1635 "src/parse/lex_conf.cc" yy368: yych = (unsigned char)*++cur; - if (yych == 'n') goto yy392; + if (yych == 'r') goto yy387; goto yy13; yy369: yych = (unsigned char)*++cur; - if (yych == 'I') goto yy394; + if (yych == 'd') goto yy389; goto yy13; yy370: yych = (unsigned char)*++cur; - if (yych == 'E') goto yy395; + if (yych == 'T') goto yy391; goto yy13; yy371: yych = (unsigned char)*++cur; - if (yych == 'N') goto yy397; + if (yych == 'E') goto yy392; goto yy13; yy372: - yyaccept = 8; - yych = (unsigned char)*(ptr = ++cur); - if (yych == 'C') goto yy399; + yych = (unsigned char)*++cur; + if (yych == 'E') goto yy394; + goto yy13; yy373: -#line 117 "../src/parse/lex_conf.re" - { opts.set_yyrestore (lex_conf_string ()); return; } -#line 1672 "src/parse/lex_conf.cc" + yych = (unsigned char)*++cur; + if (yych == 'k') goto yy395; + goto yy13; yy374: yych = (unsigned char)*++cur; - if (yych == 'I') goto yy400; + if (yych == 'n') goto yy396; goto yy13; yy375: yych = (unsigned char)*++cur; - if (yych == 'E') goto yy401; + if (yych == 'I') goto yy398; goto yy13; yy376: yych = (unsigned char)*++cur; - if (yych == 'l') goto yy403; + if (yych == 'E') goto yy399; goto yy13; yy377: yych = (unsigned char)*++cur; - if (yych == 't') goto yy405; + if (yych == 'N') goto yy401; goto yy13; yy378: + yyaccept = 7; + yych = (unsigned char)*(ptr = ++cur); + if (yych == 'C') goto yy403; +yy379: +#line 118 "../src/parse/lex_conf.re" + { opts.set_yyrestore (lex_conf_string ()); return; } +#line 1683 "src/parse/lex_conf.cc" +yy380: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy407; + if (yych == 'I') goto yy404; goto yy13; -yy379: +yy381: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy409; + if (yych == 'E') goto yy405; goto yy13; -yy380: +yy382: yych = (unsigned char)*++cur; - if (yych == 't') goto yy411; + if (yych == 'l') goto yy407; goto yy13; -yy381: - ++cur; -#line 148 "../src/parse/lex_conf.re" - { opts.set_fill_arg_use (lex_conf_number () != 0); return; } -#line 1705 "src/parse/lex_conf.cc" yy383: - ++cur; -#line 78 "../src/parse/lex_conf.re" - { opts.set_condDividerParam (lex_conf_string ()); return; } -#line 1710 "src/parse/lex_conf.cc" + yych = (unsigned char)*++cur; + if (yych == 't') goto yy409; + goto yy13; +yy384: + yych = (unsigned char)*++cur; + if (yych == 'e') goto yy411; + goto yy13; yy385: yych = (unsigned char)*++cur; - if (yych == 'X') goto yy413; + if (yych == 'e') goto yy413; goto yy13; yy386: - ++cur; -#line 69 "../src/parse/lex_conf.re" - { opts.set_yycondtype (lex_conf_string ()); return; } -#line 1719 "src/parse/lex_conf.cc" -yy388: yych = (unsigned char)*++cur; - if (yych == 'R') goto yy415; + if (yych == 't') goto yy415; goto yy13; +yy387: + ++cur; +#line 149 "../src/parse/lex_conf.re" + { opts.set_fill_arg_use (lex_conf_number () != 0); return; } +#line 1716 "src/parse/lex_conf.cc" yy389: ++cur; -#line 123 "../src/parse/lex_conf.re" - { opts.set_yydisttype (lex_conf_string ()); return; } -#line 1728 "src/parse/lex_conf.cc" +#line 79 "../src/parse/lex_conf.re" + { opts.set_condDividerParam (lex_conf_string ()); return; } +#line 1721 "src/parse/lex_conf.cc" yy391: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy417; + if (yych == 'X') goto yy417; goto yy13; yy392: ++cur; -#line 147 "../src/parse/lex_conf.re" - { opts.set_fill_arg (lex_conf_string ()); return; } -#line 1737 "src/parse/lex_conf.cc" +#line 70 "../src/parse/lex_conf.re" + { opts.set_yycondtype (lex_conf_string ()); return; } +#line 1730 "src/parse/lex_conf.cc" yy394: yych = (unsigned char)*++cur; - if (yych == 'T') goto yy418; + if (yych == 'R') goto yy419; goto yy13; yy395: - yyaccept = 9; - yych = (unsigned char)*(ptr = ++cur); - if (yych == ':') goto yy419; + yych = (unsigned char)*++cur; + if (yych == 'e') goto yy421; + goto yy13; yy396: -#line 83 "../src/parse/lex_conf.re" + ++cur; +#line 148 "../src/parse/lex_conf.re" + { opts.set_fill_arg (lex_conf_string ()); return; } +#line 1743 "src/parse/lex_conf.cc" +yy398: + yych = (unsigned char)*++cur; + if (yych == 'T') goto yy422; + goto yy13; +yy399: + yyaccept = 8; + yych = (unsigned char)*(ptr = ++cur); + if (yych == ':') goto yy423; +yy400: +#line 84 "../src/parse/lex_conf.re" { opts.set_state_get (lex_conf_string ()); return; } -#line 1749 "src/parse/lex_conf.cc" -yy397: +#line 1755 "src/parse/lex_conf.cc" +yy401: ++cur; -#line 119 "../src/parse/lex_conf.re" +#line 120 "../src/parse/lex_conf.re" { opts.set_yylessthan (lex_conf_string ()); return; } -#line 1754 "src/parse/lex_conf.cc" -yy399: +#line 1760 "src/parse/lex_conf.cc" +yy403: yych = (unsigned char)*++cur; - if (yych == 'T') goto yy420; + if (yych == 'T') goto yy424; goto yy13; -yy400: +yy404: yych = (unsigned char)*++cur; - if (yych == 'T') goto yy421; + if (yych == 'T') goto yy425; goto yy13; -yy401: - yyaccept = 10; +yy405: + yyaccept = 9; yych = (unsigned char)*(ptr = ++cur); - if (yych == ':') goto yy422; - if (yych == '@') goto yy423; -yy402: -#line 85 "../src/parse/lex_conf.re" + if (yych == ':') goto yy426; + if (yych == '@') goto yy427; +yy406: +#line 86 "../src/parse/lex_conf.re" { opts.set_state_set (lex_conf_string ()); return; } -#line 1771 "src/parse/lex_conf.cc" -yy403: +#line 1777 "src/parse/lex_conf.cc" +yy407: ++cur; -#line 88 "../src/parse/lex_conf.re" +#line 89 "../src/parse/lex_conf.re" { opts.set_yyfilllabel (lex_conf_string ()); return; } -#line 1776 "src/parse/lex_conf.cc" -yy405: +#line 1782 "src/parse/lex_conf.cc" +yy409: ++cur; -#line 92 "../src/parse/lex_conf.re" +#line 93 "../src/parse/lex_conf.re" { opts.set_yyaccept (lex_conf_string ()); return; } -#line 1781 "src/parse/lex_conf.cc" -yy407: +#line 1787 "src/parse/lex_conf.cc" +yy411: ++cur; -#line 81 "../src/parse/lex_conf.re" +#line 82 "../src/parse/lex_conf.re" { opts.set_yyctable (lex_conf_string ()); return; } -#line 1786 "src/parse/lex_conf.cc" -yy409: +#line 1792 "src/parse/lex_conf.cc" +yy413: ++cur; -#line 159 "../src/parse/lex_conf.re" +#line 160 "../src/parse/lex_conf.re" { lex_conf_string (); return; } -#line 1791 "src/parse/lex_conf.cc" -yy411: +#line 1797 "src/parse/lex_conf.cc" +yy415: ++cur; -#line 106 "../src/parse/lex_conf.re" +#line 107 "../src/parse/lex_conf.re" { opts.set_yytarget (lex_conf_string ()); return; } -#line 1796 "src/parse/lex_conf.cc" -yy413: +#line 1802 "src/parse/lex_conf.cc" +yy417: ++cur; -#line 116 "../src/parse/lex_conf.re" +#line 117 "../src/parse/lex_conf.re" { opts.set_yybackupctx (lex_conf_string ()); return; } -#line 1801 "src/parse/lex_conf.cc" -yy415: +#line 1807 "src/parse/lex_conf.cc" +yy419: ++cur; -#line 110 "../src/parse/lex_conf.re" +#line 111 "../src/parse/lex_conf.re" { opts.set_yyctxmarker (lex_conf_string ()); return; } -#line 1806 "src/parse/lex_conf.cc" -yy417: - yych = (unsigned char)*++cur; - if (yych == 'd') goto yy424; - goto yy13; -yy418: - yych = (unsigned char)*++cur; - if (yych == 'I') goto yy426; - goto yy13; -yy419: - yych = (unsigned char)*++cur; - if (yych == 'n') goto yy427; - goto yy13; -yy420: - yych = (unsigned char)*++cur; - if (yych == 'X') goto yy428; - goto yy13; +#line 1812 "src/parse/lex_conf.cc" yy421: yych = (unsigned char)*++cur; - if (yych == 'I') goto yy430; + if (yych == 'd') goto yy428; goto yy13; yy422: yych = (unsigned char)*++cur; - if (yych == 'n') goto yy431; + if (yych == 'I') goto yy430; goto yy13; yy423: yych = (unsigned char)*++cur; - if (yych == 's') goto yy432; + if (yych == 'n') goto yy431; goto yy13; yy424: - ++cur; -#line 149 "../src/parse/lex_conf.re" - { opts.set_fill_naked (lex_conf_number () != 0); return; } -#line 1839 "src/parse/lex_conf.cc" + yych = (unsigned char)*++cur; + if (yych == 'X') goto yy432; + goto yy13; +yy425: + yych = (unsigned char)*++cur; + if (yych == 'I') goto yy434; + goto yy13; yy426: yych = (unsigned char)*++cur; - if (yych == 'O') goto yy433; + if (yych == 'n') goto yy435; goto yy13; yy427: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy434; + if (yych == 's') goto yy436; goto yy13; yy428: ++cur; -#line 118 "../src/parse/lex_conf.re" - { opts.set_yyrestorectx (lex_conf_string ()); return; } -#line 1852 "src/parse/lex_conf.cc" +#line 150 "../src/parse/lex_conf.re" + { opts.set_fill_naked (lex_conf_number () != 0); return; } +#line 1845 "src/parse/lex_conf.cc" yy430: yych = (unsigned char)*++cur; - if (yych == 'O') goto yy435; + if (yych == 'O') goto yy437; goto yy13; yy431: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy436; + if (yych == 'a') goto yy438; goto yy13; yy432: - yych = (unsigned char)*++cur; - if (yych == 't') goto yy437; - goto yy13; -yy433: - yych = (unsigned char)*++cur; - if (yych == 'N') goto yy438; - goto yy13; + ++cur; +#line 119 "../src/parse/lex_conf.re" + { opts.set_yyrestorectx (lex_conf_string ()); return; } +#line 1858 "src/parse/lex_conf.cc" yy434: yych = (unsigned char)*++cur; - if (yych == 'k') goto yy440; + if (yych == 'O') goto yy439; goto yy13; yy435: yych = (unsigned char)*++cur; - if (yych == 'N') goto yy441; + if (yych == 'a') goto yy440; goto yy13; yy436: yych = (unsigned char)*++cur; - if (yych == 'k') goto yy443; + if (yych == 't') goto yy441; goto yy13; yy437: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy444; + if (yych == 'N') goto yy442; goto yy13; yy438: - yyaccept = 11; - yych = (unsigned char)*(ptr = ++cur); - if (yych == ':') goto yy445; + yych = (unsigned char)*++cur; + if (yych == 'k') goto yy444; + goto yy13; yy439: -#line 70 "../src/parse/lex_conf.re" - { opts.set_cond_get (lex_conf_string ()); return; } -#line 1892 "src/parse/lex_conf.cc" + yych = (unsigned char)*++cur; + if (yych == 'N') goto yy445; + goto yy13; yy440: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy446; + if (yych == 'k') goto yy447; goto yy13; yy441: - yyaccept = 12; - yych = (unsigned char)*(ptr = ++cur); - if (yych == ':') goto yy447; - if (yych == '@') goto yy448; -yy442: -#line 72 "../src/parse/lex_conf.re" - { opts.set_cond_set (lex_conf_string ()); return; } -#line 1905 "src/parse/lex_conf.cc" -yy443: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy449; + if (yych == 'a') goto yy448; goto yy13; +yy442: + yyaccept = 10; + yych = (unsigned char)*(ptr = ++cur); + if (yych == ':') goto yy449; +yy443: +#line 71 "../src/parse/lex_conf.re" + { opts.set_cond_get (lex_conf_string ()); return; } +#line 1898 "src/parse/lex_conf.cc" yy444: yych = (unsigned char)*++cur; - if (yych == 't') goto yy450; + if (yych == 'e') goto yy450; goto yy13; yy445: - yych = (unsigned char)*++cur; - if (yych == 'n') goto yy451; - goto yy13; + yyaccept = 11; + yych = (unsigned char)*(ptr = ++cur); + if (yych == ':') goto yy451; + if (yych == '@') goto yy452; yy446: - yych = (unsigned char)*++cur; - if (yych == 'd') goto yy452; - goto yy13; +#line 73 "../src/parse/lex_conf.re" + { opts.set_cond_set (lex_conf_string ()); return; } +#line 1911 "src/parse/lex_conf.cc" yy447: yych = (unsigned char)*++cur; - if (yych == 'n') goto yy454; + if (yych == 'e') goto yy453; goto yy13; yy448: yych = (unsigned char)*++cur; - if (yych == 'c') goto yy455; + if (yych == 't') goto yy454; goto yy13; yy449: yych = (unsigned char)*++cur; - if (yych == 'd') goto yy456; + if (yych == 'n') goto yy455; goto yy13; yy450: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy458; + if (yych == 'd') goto yy456; goto yy13; yy451: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy460; + if (yych == 'n') goto yy458; goto yy13; yy452: - ++cur; -#line 84 "../src/parse/lex_conf.re" - { opts.set_state_get_naked (lex_conf_number () != 0); return; } -#line 1946 "src/parse/lex_conf.cc" + yych = (unsigned char)*++cur; + if (yych == 'c') goto yy459; + goto yy13; +yy453: + yych = (unsigned char)*++cur; + if (yych == 'd') goto yy460; + goto yy13; yy454: yych = (unsigned char)*++cur; - if (yych == 'a') goto yy461; + if (yych == 'e') goto yy462; goto yy13; yy455: yych = (unsigned char)*++cur; - if (yych == 'o') goto yy462; + if (yych == 'a') goto yy464; goto yy13; yy456: ++cur; -#line 86 "../src/parse/lex_conf.re" - { opts.set_state_set_naked (lex_conf_number () != 0); return; } -#line 1959 "src/parse/lex_conf.cc" +#line 85 "../src/parse/lex_conf.re" + { opts.set_state_get_naked (lex_conf_number () != 0); return; } +#line 1952 "src/parse/lex_conf.cc" yy458: + yych = (unsigned char)*++cur; + if (yych == 'a') goto yy465; + goto yy13; +yy459: + yych = (unsigned char)*++cur; + if (yych == 'o') goto yy466; + goto yy13; +yy460: ++cur; #line 87 "../src/parse/lex_conf.re" + { opts.set_state_set_naked (lex_conf_number () != 0); return; } +#line 1965 "src/parse/lex_conf.cc" +yy462: + ++cur; +#line 88 "../src/parse/lex_conf.re" { opts.set_state_set_arg (lex_conf_string ()); return; } -#line 1964 "src/parse/lex_conf.cc" -yy460: +#line 1970 "src/parse/lex_conf.cc" +yy464: yych = (unsigned char)*++cur; - if (yych == 'k') goto yy463; + if (yych == 'k') goto yy467; goto yy13; -yy461: +yy465: yych = (unsigned char)*++cur; - if (yych == 'k') goto yy464; + if (yych == 'k') goto yy468; goto yy13; -yy462: +yy466: yych = (unsigned char)*++cur; - if (yych == 'n') goto yy465; + if (yych == 'n') goto yy469; goto yy13; -yy463: +yy467: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy466; + if (yych == 'e') goto yy470; goto yy13; -yy464: +yy468: yych = (unsigned char)*++cur; - if (yych == 'e') goto yy467; + if (yych == 'e') goto yy471; goto yy13; -yy465: +yy469: yych = (unsigned char)*++cur; - if (yych == 'd') goto yy468; + if (yych == 'd') goto yy472; goto yy13; -yy466: +yy470: yych = (unsigned char)*++cur; - if (yych == 'd') goto yy470; + if (yych == 'd') goto yy474; goto yy13; -yy467: +yy471: yych = (unsigned char)*++cur; - if (yych == 'd') goto yy472; + if (yych == 'd') goto yy476; goto yy13; -yy468: +yy472: ++cur; -#line 73 "../src/parse/lex_conf.re" +#line 74 "../src/parse/lex_conf.re" { opts.set_cond_set_arg (lex_conf_string ()); return; } -#line 2001 "src/parse/lex_conf.cc" -yy470: +#line 2007 "src/parse/lex_conf.cc" +yy474: ++cur; -#line 71 "../src/parse/lex_conf.re" +#line 72 "../src/parse/lex_conf.re" { opts.set_cond_get_naked (lex_conf_number () != 0); return; } -#line 2006 "src/parse/lex_conf.cc" -yy472: +#line 2012 "src/parse/lex_conf.cc" +yy476: ++cur; -#line 74 "../src/parse/lex_conf.re" +#line 75 "../src/parse/lex_conf.re" { opts.set_cond_set_naked (lex_conf_number () != 0); return; } -#line 2011 "src/parse/lex_conf.cc" +#line 2017 "src/parse/lex_conf.cc" } -#line 160 "../src/parse/lex_conf.re" +#line 161 "../src/parse/lex_conf.re" } +void Scanner::lex_conf_contexts(ConfContexts &conf) +{ + for (;;) { + +#line 2027 "src/parse/lex_conf.cc" +{ + unsigned char yych; + static const unsigned char yybm[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + if ((lim - cur) < 4) fill(4); + yych = (unsigned char)*cur; + if (yybm[0+yych] & 128) { + goto yy483; + } + if (yych <= ')') { + if (yych <= '\n') { + if (yych <= 0x08) goto yy481; + goto yy485; + } else { + if (yych == '\r') goto yy487; + goto yy481; + } + } else { + if (yych <= 'l') { + if (yych <= '*') goto yy488; + if (yych <= 'k') goto yy481; + goto yy489; + } else { + if (yych == 's') goto yy490; + goto yy481; + } + } +yy480: +#line 170 "../src/parse/lex_conf.re" + { continue; } +#line 2090 "src/parse/lex_conf.cc" +yy481: + ++cur; +yy482: +#line 168 "../src/parse/lex_conf.re" + { fatal("unrecognized configuration"); } +#line 2096 "src/parse/lex_conf.cc" +yy483: + ++cur; + if (lim <= cur) fill(1); + yych = (unsigned char)*cur; + if (yybm[0+yych] & 128) { + goto yy483; + } + goto yy480; +yy485: + ++cur; +#line 171 "../src/parse/lex_conf.re" + { ++cline; continue; } +#line 2109 "src/parse/lex_conf.cc" +yy487: + yych = (unsigned char)*++cur; + if (yych == '\n') goto yy485; + goto yy482; +yy488: + yych = (unsigned char)*++cur; + if (yych == '/') goto yy491; + goto yy482; +yy489: + yych = (unsigned char)*(ptr = ++cur); + if (yych == 'i') goto yy493; + goto yy482; +yy490: + yych = (unsigned char)*(ptr = ++cur); + if (yych == 'e') goto yy495; + goto yy482; +yy491: + ++cur; +#line 172 "../src/parse/lex_conf.re" + { return; } +#line 2130 "src/parse/lex_conf.cc" +yy493: + yych = (unsigned char)*++cur; + if (yych == 'n') goto yy496; +yy494: + cur = ptr; + goto yy482; +yy495: + yych = (unsigned char)*++cur; + if (yych == 'p') goto yy497; + goto yy494; +yy496: + yych = (unsigned char)*++cur; + if (yych == 'e') goto yy499; + goto yy494; +yy497: + ++cur; +#line 175 "../src/parse/lex_conf.re" + { conf.sep = lex_conf_string(); continue; } +#line 2149 "src/parse/lex_conf.cc" +yy499: + ++cur; +#line 174 "../src/parse/lex_conf.re" + { conf.line = lex_conf_string(); continue; } +#line 2154 "src/parse/lex_conf.cc" +} +#line 176 "../src/parse/lex_conf.re" + + } +} + void Scanner::lex_conf_assign () { -#line 2020 "src/parse/lex_conf.cc" +#line 2164 "src/parse/lex_conf.cc" { unsigned char yych; static const unsigned char yybm[] = { @@ -2056,56 +2200,56 @@ void Scanner::lex_conf_assign () if ((lim - cur) < 2) fill(2); yych = (unsigned char)*cur; if (yych <= 0x1F) { - if (yych == '\t') goto yy478; + if (yych == '\t') goto yy505; } else { - if (yych <= ' ') goto yy478; - if (yych == '=') goto yy479; + if (yych <= ' ') goto yy505; + if (yych == '=') goto yy506; } ++cur; -yy477: -#line 166 "../src/parse/lex_conf.re" +yy504: +#line 183 "../src/parse/lex_conf.re" { fatal ("missing '=' in configuration"); } -#line 2069 "src/parse/lex_conf.cc" -yy478: +#line 2213 "src/parse/lex_conf.cc" +yy505: yych = (unsigned char)*(ptr = ++cur); if (yych <= 0x1F) { - if (yych == '\t') goto yy482; - goto yy477; + if (yych == '\t') goto yy509; + goto yy504; } else { - if (yych <= ' ') goto yy482; - if (yych != '=') goto yy477; + if (yych <= ' ') goto yy509; + if (yych != '=') goto yy504; } -yy479: +yy506: ++cur; if (lim <= cur) fill(1); yych = (unsigned char)*cur; if (yybm[0+yych] & 128) { - goto yy479; + goto yy506; } -#line 167 "../src/parse/lex_conf.re" +#line 184 "../src/parse/lex_conf.re" { return; } -#line 2088 "src/parse/lex_conf.cc" -yy482: +#line 2232 "src/parse/lex_conf.cc" +yy509: ++cur; if (lim <= cur) fill(1); yych = (unsigned char)*cur; if (yych <= 0x1F) { - if (yych == '\t') goto yy482; + if (yych == '\t') goto yy509; } else { - if (yych <= ' ') goto yy482; - if (yych == '=') goto yy479; + if (yych <= ' ') goto yy509; + if (yych == '=') goto yy506; } cur = ptr; - goto yy477; + goto yy504; } -#line 168 "../src/parse/lex_conf.re" +#line 185 "../src/parse/lex_conf.re" } void Scanner::lex_conf_semicolon () { -#line 2109 "src/parse/lex_conf.cc" +#line 2253 "src/parse/lex_conf.cc" { unsigned char yych; static const unsigned char yybm[] = { @@ -2145,39 +2289,39 @@ void Scanner::lex_conf_semicolon () if ((lim - cur) < 2) fill(2); yych = (unsigned char)*cur; if (yych <= 0x1F) { - if (yych == '\t') goto yy489; + if (yych == '\t') goto yy516; } else { - if (yych <= ' ') goto yy489; - if (yych == ';') goto yy490; + if (yych <= ' ') goto yy516; + if (yych == ';') goto yy517; } ++cur; -yy488: -#line 174 "../src/parse/lex_conf.re" +yy515: +#line 191 "../src/parse/lex_conf.re" { fatal ("missing ending ';' in configuration"); } -#line 2158 "src/parse/lex_conf.cc" -yy489: +#line 2302 "src/parse/lex_conf.cc" +yy516: yych = (unsigned char)*(ptr = ++cur); if (yybm[0+yych] & 128) { - goto yy492; + goto yy519; } - if (yych != ';') goto yy488; -yy490: + if (yych != ';') goto yy515; +yy517: ++cur; -#line 175 "../src/parse/lex_conf.re" +#line 192 "../src/parse/lex_conf.re" { return; } -#line 2169 "src/parse/lex_conf.cc" -yy492: +#line 2313 "src/parse/lex_conf.cc" +yy519: ++cur; if (lim <= cur) fill(1); yych = (unsigned char)*cur; if (yybm[0+yych] & 128) { - goto yy492; + goto yy519; } - if (yych == ';') goto yy490; + if (yych == ';') goto yy517; cur = ptr; - goto yy488; + goto yy515; } -#line 176 "../src/parse/lex_conf.re" +#line 193 "../src/parse/lex_conf.re" } @@ -2186,7 +2330,7 @@ int32_t Scanner::lex_conf_number () lex_conf_assign (); tok = cur; -#line 2190 "src/parse/lex_conf.cc" +#line 2334 "src/parse/lex_conf.cc" { unsigned char yych; static const unsigned char yybm[] = { @@ -2226,21 +2370,21 @@ int32_t Scanner::lex_conf_number () if ((lim - cur) < 2) fill(2); yych = (unsigned char)*cur; if (yych <= '/') { - if (yych == '-') goto yy498; + if (yych == '-') goto yy525; } else { - if (yych <= '0') goto yy499; - if (yych <= '9') goto yy501; + if (yych <= '0') goto yy526; + if (yych <= '9') goto yy528; } -yy497: -yy498: +yy524: +yy525: yych = (unsigned char)*++cur; - if (yych <= '0') goto yy497; - if (yych <= '9') goto yy501; - goto yy497; -yy499: + if (yych <= '0') goto yy524; + if (yych <= '9') goto yy528; + goto yy524; +yy526: ++cur; -yy500: -#line 185 "../src/parse/lex_conf.re" +yy527: +#line 202 "../src/parse/lex_conf.re" { int32_t n = 0; if (!s_to_i32_unsafe (tok, cur, n)) @@ -2250,17 +2394,17 @@ yy500: lex_conf_semicolon (); return n; } -#line 2254 "src/parse/lex_conf.cc" -yy501: +#line 2398 "src/parse/lex_conf.cc" +yy528: ++cur; if (lim <= cur) fill(1); yych = (unsigned char)*cur; if (yybm[0+yych] & 128) { - goto yy501; + goto yy528; } - goto yy500; + goto yy527; } -#line 194 "../src/parse/lex_conf.re" +#line 211 "../src/parse/lex_conf.re" } @@ -2270,7 +2414,7 @@ std::string Scanner::lex_conf_string () std::string s; tok = cur; -#line 2274 "src/parse/lex_conf.cc" +#line 2418 "src/parse/lex_conf.cc" { unsigned char yych; static const unsigned char yybm[] = { @@ -2311,37 +2455,37 @@ std::string Scanner::lex_conf_string () yych = (unsigned char)*cur; if (yych <= '!') { if (yych <= '\n') { - if (yych <= 0x08) goto yy506; + if (yych <= 0x08) goto yy533; } else { - if (yych != ' ') goto yy506; + if (yych != ' ') goto yy533; } } else { if (yych <= '\'') { - if (yych <= '"') goto yy508; - if (yych <= '&') goto yy506; - goto yy508; + if (yych <= '"') goto yy535; + if (yych <= '&') goto yy533; + goto yy535; } else { - if (yych != ';') goto yy506; + if (yych != ';') goto yy533; } } -yy505: -#line 217 "../src/parse/lex_conf.re" +yy532: +#line 234 "../src/parse/lex_conf.re" { s = std::string(tok, tok_len()); goto end; } -#line 2334 "src/parse/lex_conf.cc" -yy506: +#line 2478 "src/parse/lex_conf.cc" +yy533: ++cur; if (lim <= cur) fill(1); yych = (unsigned char)*cur; if (yybm[0+yych] & 128) { - goto yy506; + goto yy533; } - goto yy505; -yy508: + goto yy532; +yy535: ++cur; -#line 203 "../src/parse/lex_conf.re" +#line 220 "../src/parse/lex_conf.re" { const char quote = tok[0]; for (bool end;;) { @@ -2356,9 +2500,9 @@ yy508: } } } -#line 2360 "src/parse/lex_conf.cc" +#line 2504 "src/parse/lex_conf.cc" } -#line 221 "../src/parse/lex_conf.re" +#line 238 "../src/parse/lex_conf.re" end: lex_conf_semicolon (); diff --git a/re2c/src/codegen/emit.h b/re2c/src/codegen/emit.h index c038f7d0..f6aae16e 100644 --- a/re2c/src/codegen/emit.h +++ b/re2c/src/codegen/emit.h @@ -24,21 +24,6 @@ void emit_action // helpers void genGoTo (OutputFile & o, uint32_t ind, const State * from, const State * to, bool & readCh); -template std::string replaceParam (std::string str, const std::string & param, const _Ty & value) -{ - if (!param.empty ()) - { - std::ostringstream strValue; - strValue << value; - std::string::size_type pos; - while((pos = str.find(param)) != std::string::npos) - { - str.replace(pos, param.length(), strValue.str()); - } - } - return str; -} - } // namespace re2c #endif // _RE2C_CODEGEN_EMIT_ diff --git a/re2c/src/codegen/emit_action.cc b/re2c/src/codegen/emit_action.cc index 1685c1a5..9d9ca623 100644 --- a/re2c/src/codegen/emit_action.cc +++ b/re2c/src/codegen/emit_action.cc @@ -14,6 +14,7 @@ #include "src/ir/skeleton/skeleton.h" #include "src/parse/code.h" #include "src/parse/loc.h" +#include "src/util/strrreplace.h" namespace re2c { @@ -251,17 +252,6 @@ void emit_accept (OutputFile & o, uint32_t ind, bool & readCh, const State * con } } -static void rreplace_substr(std::string &s, - const std::string &s1, const std::string &s2) -{ - if (!s1.empty()) { - std::string::size_type pos; - while ((pos = s.find(s1)) != std::string::npos) { - s.replace(pos, s1.length(), s2); - } - } -} - static void subst_contexts( std::string &action, const Rule &rule, @@ -269,13 +259,13 @@ static void subst_contexts( { for (size_t i = 0; i < rule.ctxvar.size(); ++i) { const CtxVar &ctx = contexts[rule.ctxvar[i]]; - rreplace_substr(action, "@" + *ctx.name, - opts->input_api.expr_ctx(ctx.fullname)); + strrreplace(action, "@" + *ctx.codename, + opts->input_api.expr_ctx(ctx.expr())); } for (size_t i = 0; i < rule.ctxfix.size(); ++i) { const CtxFix &ctx = rule.ctxfix[i]; - rreplace_substr(action, "@" + *ctx.name, + strrreplace(action, "@" + *ctx.codename, opts->input_api.expr_ctx_fix(ctx, contexts)); } } @@ -309,8 +299,8 @@ void emit_rule( break; case Trail::VAR: if (base_ctxmarker) { - const std::string name = skeleton->contexts[trail.pld.var].fullname; - o.wstring(opts->input_api.stmt_restorectx_var_base(ind, name)); + o.wstring(opts->input_api.stmt_restorectx_var_base(ind, + skeleton->contexts[trail.pld.var].expr())); } else { o.wstring(opts->input_api.stmt_restorectx_var(ind)); } @@ -338,8 +328,8 @@ void emit_rule( .wind(ind).wstring(action).ws("\n") .wdelay_line_info(); } else if (!newcond.empty()) { - const std::string action = replaceParam(opts->condGoto, - opts->condGotoParam, opts->condPrefix + newcond); + std::string action = opts->condGoto; + strrreplace(action, opts->condGotoParam, opts->condPrefix + newcond); o.wind(ind).wstring(action).ws("\n"); } } @@ -402,7 +392,9 @@ void need (OutputFile & o, uint32_t ind, bool & readCh, size_t n, bool bSetMarke void genYYFill (OutputFile & o, size_t need) { - o.wstring(replaceParam (opts->fill, opts->fill_arg, need)); + std::string fill = opts->fill; + strrreplace(fill, opts->fill_arg, need); + o.wstring(fill); if (!opts->fill_naked) { if (opts->fill_arg_use) @@ -416,7 +408,9 @@ void genYYFill (OutputFile & o, size_t need) void genSetCondition(OutputFile & o, uint32_t ind, const std::string& newcond) { - o.wind(ind).wstring(replaceParam (opts->cond_set, opts->cond_set_arg, opts->condEnumPrefix + newcond)); + std::string cond_set = opts->cond_set; + strrreplace(cond_set, opts->cond_set_arg, opts->condEnumPrefix + newcond); + o.wind(ind).wstring(cond_set); if (!opts->cond_set_naked) { o.ws("(").wstring(opts->condEnumPrefix).wstring(newcond).ws(");"); @@ -426,7 +420,9 @@ void genSetCondition(OutputFile & o, uint32_t ind, const std::string& newcond) void genSetState(OutputFile & o, uint32_t ind, uint32_t fillIndex) { - o.wind(ind).wstring(replaceParam (opts->state_set, opts->state_set_arg, fillIndex)); + std::string state_set = opts->state_set; + strrreplace(state_set, opts->state_set_arg, fillIndex); + o.wind(ind).wstring(state_set); if (!opts->state_set_naked) { o.ws("(").wu32(fillIndex).ws(");"); diff --git a/re2c/src/codegen/emit_dfa.cc b/re2c/src/codegen/emit_dfa.cc index f02c973f..dcc5256c 100644 --- a/re2c/src/codegen/emit_dfa.cc +++ b/re2c/src/codegen/emit_dfa.cc @@ -17,6 +17,7 @@ #include "src/ir/adfa/adfa.h" #include "src/ir/skeleton/skeleton.h" #include "src/util/counter.h" +#include "src/util/strrreplace.h" namespace re2c { @@ -121,7 +122,7 @@ void DFA::emit(Output & output, uint32_t& ind, bool isLastCond, bool& bPrologBra if (base_ctxmarker) { for (State *s = head; s; s = s->next) { for (std::set::const_iterator i = s->ctxs.begin(); i != s->ctxs.end(); ++i) { - ctxnames.insert(contexts[*i].fullname); + ctxnames.insert(contexts[*i].name()); } } output.contexts.insert(ctxnames.begin(), ctxnames.end()); @@ -195,7 +196,8 @@ void DFA::emit(Output & output, uint32_t& ind, bool isLastCond, bool& bPrologBra } o.wdelay_yyaccept_init (ind); if (base_ctxmarker) { - o.wdelay_contexts(ind); + o.wdelay_contexts(ind, NULL); + o.wstring(opts->input_api.stmt_backupctx(ind)); } } else @@ -231,7 +233,9 @@ void DFA::emit(Output & output, uint32_t& ind, bool isLastCond, bool& bPrologBra { if (opts->condDivider.length()) { - o.wstring(replaceParam(opts->condDivider, opts->condDividerParam, cond)).ws("\n"); + std::string divider = opts->condDivider; + strrreplace(divider, opts->condDividerParam, cond); + o.wstring(divider).ws("\n"); } if (opts->target == opt_t::DOT) { diff --git a/re2c/src/codegen/input_api.cc b/re2c/src/codegen/input_api.cc index 40024d34..4f0f010a 100644 --- a/re2c/src/codegen/input_api.cc +++ b/re2c/src/codegen/input_api.cc @@ -112,7 +112,7 @@ std::string InputAPI::stmt_dist (uint32_t ind, const std::set &ctxs, { std::string s = indent(ind); for (std::set::const_iterator i = ctxs.begin(); i != ctxs.end(); ++i) { - s += contexts[*i].fullname + " = "; + s += contexts[*i].expr() + " = "; } return s + expr_dist() + ";\n"; } @@ -142,7 +142,7 @@ std::string InputAPI::expr_ctx_fix(const CtxFix &ctx, const std::vector } return s.str(); } else { - s << "(" << ctxvars[ctx.base].fullname << " - " << ctx.dist << ")"; + s << "(" << ctxvars[ctx.base].expr() << " - " << ctx.dist << ")"; return expr_ctx(s.str()); } } diff --git a/re2c/src/codegen/output.cc b/re2c/src/codegen/output.cc index 847a2750..3599572f 100644 --- a/re2c/src/codegen/output.cc +++ b/re2c/src/codegen/output.cc @@ -7,6 +7,7 @@ #include "src/codegen/print.h" #include "src/conf/opt.h" #include "src/conf/warn.h" +#include "src/util/strrreplace.h" #include "src/globals.h" namespace re2c @@ -18,6 +19,13 @@ OutputFragment::OutputFragment (type_t t, uint32_t i) , indent (i) {} +OutputFragment::~OutputFragment() +{ + if (type == CONTEXTS) { + delete contexts; + } +} + uint32_t OutputFragment::count_lines () { uint32_t lines = 0; @@ -57,6 +65,7 @@ OutputFile::OutputFile (const char * fn) , blocks () , label_counter () , warn_condition_order (!opts->tFlag) // see note [condition order] + , default_contexts (true) { new_block (); } @@ -192,9 +201,14 @@ void OutputFile::insert_code () blocks.back ()->fragments.push_back (new OutputFragment (OutputFragment::CODE, 0)); } -OutputFile &OutputFile::wdelay_contexts(uint32_t ind) +OutputFile &OutputFile::wdelay_contexts(uint32_t ind, const ConfContexts *cf) { - blocks.back()->fragments.push_back(new OutputFragment(OutputFragment::CONTEXTS, ind)); + OutputFragment *frag = new OutputFragment(OutputFragment::CONTEXTS, ind); + frag->contexts = cf; + if (cf) { + default_contexts = false; + } + blocks.back()->fragments.push_back(frag); insert_code(); return *this; } @@ -306,7 +320,11 @@ void OutputFile::emit( case OutputFragment::CODE: break; case OutputFragment::CONTEXTS: - output_contexts(f.stream, f.indent, contexts); + if (f.contexts) { + output_contexts(f.stream, *f.contexts, contexts); + } else if (default_contexts) { + output_contexts_default(f.stream, f.indent, contexts); + } break; case OutputFragment::LINE_INFO: output_line_info (f.stream, line_count + 1, file_name); @@ -389,19 +407,36 @@ Output::~Output () } } -void output_contexts(std::ostream &o, uint32_t ind, const std::set &contexts) -{ - if (!contexts.empty()) { - std::set::const_iterator - ctx = contexts.begin(), - end = contexts.end(); - o << indent(ind) << opts->yydisttype << " " << *ctx; - for (++ctx; ctx != end; ++ctx) { - o << ", " << *ctx; +void output_contexts( + std::ostream &o, + const ConfContexts &conf, + const std::set &contexts) +{ + std::set::const_iterator + ctx = contexts.begin(), + end = contexts.end(); + for (;ctx != end;) { + std::string line = conf.line; + strrreplace(line, "@@", *ctx); + o << line; + if (++ctx == end) { + break; } - o << ";\n"; + o << conf.sep; + } +} + +void output_contexts_default( + std::ostream &o, + uint32_t ind, + const std::set &contexts) +{ + std::set::const_iterator + ctx = contexts.begin(), + end = contexts.end(); + for (;ctx != end; ++ctx) { + o << indent(ind) << "long " << *ctx << ";\n"; } - o << opts->input_api.stmt_backupctx(ind); } void output_state_goto (std::ostream & o, uint32_t ind, uint32_t start_label) diff --git a/re2c/src/codegen/output.h b/re2c/src/codegen/output.h index 894d896f..87bda7dd 100644 --- a/re2c/src/codegen/output.h +++ b/re2c/src/codegen/output.h @@ -17,6 +17,13 @@ namespace re2c { +struct ConfContexts +{ + std::string line; + std::string sep; + ConfContexts(): line("long @@;"), sep("") {} +}; + struct OutputFragment { enum type_t @@ -34,8 +41,13 @@ struct OutputFragment type_t type; std::ostringstream stream; uint32_t indent; + union + { + const ConfContexts* contexts; + }; OutputFragment (type_t t, uint32_t i); + ~OutputFragment (); uint32_t count_lines (); }; @@ -63,6 +75,7 @@ private: public: counter_t label_counter; bool warn_condition_order; + bool default_contexts; OutputFile (const char * fn); ~OutputFile (); @@ -90,7 +103,7 @@ public: OutputFile & wind (uint32_t ind); // delayed output - OutputFile & wdelay_contexts(uint32_t ind); + OutputFile & wdelay_contexts(uint32_t ind, const ConfContexts *cf); OutputFile & wdelay_line_info (); OutputFile & wdelay_state_goto (uint32_t ind); OutputFile & wdelay_types (); @@ -140,7 +153,10 @@ struct Output ~Output (); }; -void output_contexts(std::ostream &o, uint32_t ind, const std::set &contexts); +void output_contexts(std::ostream &o, const ConfContexts &conf, + const std::set &contexts); +void output_contexts_default(std::ostream &o, uint32_t ind, + const std::set &contexts); void output_line_info (std::ostream &, uint32_t, const char *); void output_state_goto (std::ostream &, uint32_t, uint32_t); void output_types (std::ostream &, uint32_t, const std::vector &); diff --git a/re2c/src/conf/opt.cc b/re2c/src/conf/opt.cc index 884496e1..0bcaf46c 100644 --- a/re2c/src/conf/opt.cc +++ b/re2c/src/conf/opt.cc @@ -78,8 +78,8 @@ void opt_t::fix () state_set_naked = Opt::baseopt.state_set_naked; yyctx = Opt::baseopt.yyctx; yydist = Opt::baseopt.yydist; - yydisttype = Opt::baseopt.yydisttype; - ctxprefix = Opt::baseopt.ctxprefix; + contexts_prefix = Opt::baseopt.contexts_prefix; + contexts_expr = Opt::baseopt.contexts_expr; yyfilllabel = Opt::baseopt.yyfilllabel; yynext = Opt::baseopt.yynext; yyaccept = Opt::baseopt.yyaccept; @@ -158,8 +158,8 @@ void opt_t::fix () { yyctx = Opt::baseopt.yyctx; yydist = Opt::baseopt.yydist; - yydisttype = Opt::baseopt.yydisttype; - ctxprefix = Opt::baseopt.ctxprefix; + contexts_prefix = Opt::baseopt.contexts_prefix; + contexts_expr = Opt::baseopt.contexts_expr; } if (!bFlag) { @@ -336,7 +336,6 @@ void Opt::reset_mapCodeName () useropt->yyskip = Opt::baseopt.yyskip; useropt->yyctx = Opt::baseopt.yyctx; useropt->yydist = Opt::baseopt.yydist; - useropt->yydisttype = Opt::baseopt.yydisttype; useropt->yyfilllabel = Opt::baseopt.yyfilllabel; useropt->yynext = Opt::baseopt.yynext; useropt->yyaccept = Opt::baseopt.yyaccept; diff --git a/re2c/src/conf/opt.h b/re2c/src/conf/opt.h index 6dc69f8f..4452c460 100644 --- a/re2c/src/conf/opt.h +++ b/re2c/src/conf/opt.h @@ -58,8 +58,8 @@ namespace re2c OPT (bool, contexts, false) \ OPT (std::string, yyctx, "YYCTX") \ OPT (std::string, yydist, "YYDIST") \ - OPT (std::string, yydisttype, "long") \ - OPT (std::string, ctxprefix, "yyctx") \ + OPT (std::string, contexts_prefix, "yyctx") \ + OPT (std::string, contexts_expr, "@@") \ /* reuse */ \ OPT (bool, rFlag, false) \ /* partial flex syntax support */ \ diff --git a/re2c/src/conf/warn.cc b/re2c/src/conf/warn.cc index a631d308..b9c9be43 100644 --- a/re2c/src/conf/warn.cc +++ b/re2c/src/conf/warn.cc @@ -129,12 +129,12 @@ void Warn::selfoverlapping_contexts( error_accuml |= e; const char *trail, *name; - if (ctx.name == NULL) { + if (ctx.codename == NULL) { trail = "trailing context"; name = ""; } else { trail = "context "; - name = ctx.name->c_str(); + name = ctx.codename->c_str(); } warning(names[SELFOVERLAPPING_CONTEXTS], line, e, "%s%s %sis self-overlapping", trail, name, diff --git a/re2c/src/ir/ctx.cc b/re2c/src/ir/ctx.cc index 181eb437..51382181 100644 --- a/re2c/src/ir/ctx.cc +++ b/re2c/src/ir/ctx.cc @@ -3,21 +3,34 @@ #include "src/conf/opt.h" #include "src/ir/ctx.h" +#include "src/util/strrreplace.h" #include "src/globals.h" namespace re2c { CtxVar::CtxVar(const std::string *n, size_t idx) - : name(n) - , fullname() + : codename(n) + , uniqname() { std::ostringstream s; - s << opts->ctxprefix << idx; - if (name != NULL) { - s << *name; + s << idx; + if (codename != NULL) { + s << *codename; } - fullname = s.str(); + uniqname = s.str(); +} + +std::string CtxVar::name() const +{ + return opts->contexts_prefix + uniqname; +} + +std::string CtxVar::expr() const +{ + std::string e = opts->contexts_expr; + strrreplace(e, "@@", opts->contexts_prefix + uniqname); + return e; } const size_t CtxFix::RIGHTMOST = std::numeric_limits::max(); diff --git a/re2c/src/ir/ctx.h b/re2c/src/ir/ctx.h index 74f1a555..7aba08db 100644 --- a/re2c/src/ir/ctx.h +++ b/re2c/src/ir/ctx.h @@ -8,32 +8,34 @@ namespace re2c struct CtxVar { - const std::string *name; - std::string fullname; + const std::string *codename; + std::string uniqname; CtxVar(const std::string *n, size_t idx); CtxVar(const CtxVar &ctx) - : name(ctx.name) - , fullname(ctx.fullname) + : codename(ctx.codename) + , uniqname(ctx.uniqname) {} CtxVar& operator=(const CtxVar &ctx) { - name = ctx.name; - fullname = ctx.fullname; + codename = ctx.codename; + uniqname = ctx.uniqname; return *this; } + std::string name() const; + std::string expr() const; }; struct CtxFix { static const size_t RIGHTMOST; - const std::string *name; + const std::string *codename; size_t base; size_t dist; CtxFix(const std::string *n, size_t b, size_t d) - : name(n) + : codename(n) , base(b) , dist(d) {} diff --git a/re2c/src/ir/dfa/context_deduplication.cc b/re2c/src/ir/dfa/context_deduplication.cc index ca118db3..db9f1a70 100644 --- a/re2c/src/ir/dfa/context_deduplication.cc +++ b/re2c/src/ir/dfa/context_deduplication.cc @@ -159,7 +159,7 @@ bool deduplicate_contexts( s->ctxs.swap(ctxs); } for (size_t i = 0; i < nctxs; ++i) { - dfa.contexts[i].fullname = dfa.contexts[part[i]].fullname; + dfa.contexts[i].uniqname = dfa.contexts[part[i]].uniqname; } return multiple_contexts; diff --git a/re2c/src/ir/skeleton/generate_code.cc b/re2c/src/ir/skeleton/generate_code.cc index 519ef547..fda57353 100644 --- a/re2c/src/ir/skeleton/generate_code.cc +++ b/re2c/src/ir/skeleton/generate_code.cc @@ -233,7 +233,8 @@ void emit_start(const Skeleton &skel, OutputFile &o, size_t maxfill, } if (!ctxnames.empty()) { o.ws("\n"); - output_contexts(o.stream(), 2, ctxnames); + output_contexts_default(o.stream(), 2, ctxnames); + o.ws("\n").wstring(opts->input_api.stmt_backupctx(2)); } o.ws("\n"); if (opts->bFlag && BitMap::first) { diff --git a/re2c/src/parse/lex.re b/re2c/src/parse/lex.re index a4904179..b9f2ed8c 100644 --- a/re2c/src/parse/lex.re +++ b/re2c/src/parse/lex.re @@ -146,6 +146,23 @@ echo: } goto echo; } + + "/*!contexts:re2c" { + if (opts->target == opt_t::CODE) { + const size_t len = sizeof("/*!contexts:re2c") - 1; + out.wraw(tok, tok_len() - len); + } + + ConfContexts *conf = new ConfContexts; + lex_conf_contexts(*conf); + if (opts->target == opt_t::CODE) { + out.wdelay_contexts(opts->topIndent, conf); + } + + tok = pos = cur; + goto echo; + } + "*" "/" "\r"? "\n" { cline++; if (ignore_eoc) diff --git a/re2c/src/parse/lex_conf.re b/re2c/src/parse/lex_conf.re index d647f68e..779ea5c4 100644 --- a/re2c/src/parse/lex_conf.re +++ b/re2c/src/parse/lex_conf.re @@ -26,6 +26,7 @@ namespace re2c re2c:yych:conversion = 1; space = [ \t]; + eol = "\r"? "\n"; conf_assign = space* "=" space*; @@ -117,11 +118,11 @@ void Scanner::lex_conf () "define:YYRESTORE" { opts.set_yyrestore (lex_conf_string ()); return; } "define:YYRESTORECTX" { opts.set_yyrestorectx (lex_conf_string ()); return; } "define:YYLESSTHAN" { opts.set_yylessthan (lex_conf_string ()); return; } - "define:YYCTX" { opts.set_yyctx (lex_conf_string ()); return; } "define:YYDIST" { opts.set_yydist (lex_conf_string ()); return; } - "define:YYDISTTYPE" { opts.set_yydisttype (lex_conf_string ()); return; } - "ctxprefix" { opts.set_ctxprefix (lex_conf_string ()); return; } + + "contexts:prefix" { opts.set_contexts_prefix(lex_conf_string ()); return; } + "contexts:expr" { opts.set_contexts_expr (lex_conf_string ()); return; } "indent:string" { opts.set_indString (lex_conf_string ()); return; } "indent:top" @@ -160,6 +161,22 @@ void Scanner::lex_conf () */ } +void Scanner::lex_conf_contexts(ConfContexts &conf) +{ + for (;;) { + /*!re2c + * { fatal("unrecognized configuration"); } + + space* { continue; } + eol { ++cline; continue; } + "*" "/" { return; } + + "line" { conf.line = lex_conf_string(); continue; } + "sep" { conf.sep = lex_conf_string(); continue; } + */ + } +} + void Scanner::lex_conf_assign () { /*!re2c diff --git a/re2c/src/parse/scanner.h b/re2c/src/parse/scanner.h index d17f01bb..9fdfceb2 100644 --- a/re2c/src/parse/scanner.h +++ b/re2c/src/parse/scanner.h @@ -15,6 +15,7 @@ namespace re2c class Range; class RegExp; struct OutputFile; +struct ConfContexts; struct ScannerState { @@ -69,6 +70,7 @@ private: const RegExp *cls(const Range *r) const; void lex_conf (); + void lex_conf_contexts(ConfContexts &conf); void lex_conf_assign (); void lex_conf_semicolon (); int32_t lex_conf_number (); diff --git a/re2c/src/util/strrreplace.h b/re2c/src/util/strrreplace.h new file mode 100644 index 00000000..8a18fe81 --- /dev/null +++ b/re2c/src/util/strrreplace.h @@ -0,0 +1,29 @@ +#ifndef _RE2C_UTIL_STRRREPLACE_ +#define _RE2C_UTIL_STRRREPLACE_ + +#include +#include + +namespace re2c +{ + +template void strrreplace( + std::string &s, + const std::string &s1, + const type_t &v) +{ + std::ostringstream sv; + sv << v; + const std::string &s2 = sv.str(); + const size_t l = s1.length(); + if (l != 0) { + std::string::size_type pos; + while ((pos = s.find(s1)) != std::string::npos) { + s.replace(pos, l, s2); + } + } +} + +} // namespace re2c + +#endif // _RE2C_UTIL_STRRREPLACE_ diff --git a/re2c/test/contexts/cond_star0.ci--input(custom).c b/re2c/test/contexts/cond_star0.ci--input(custom).c index 16f60269..782f45a4 100644 --- a/re2c/test/contexts/cond_star0.ci--input(custom).c +++ b/re2c/test/contexts/cond_star0.ci--input(custom).c @@ -2,7 +2,8 @@ { YYCTYPE yych; - long yyctx0, yyctx1; + long yyctx0; + long yyctx1; YYBACKUPCTX (); switch (YYGETCONDITION()) { case yycc1: goto yyc_c1; diff --git a/re2c/test/contexts/cond_star0.ci.c b/re2c/test/contexts/cond_star0.ci.c index 20969544..6b0c874f 100644 --- a/re2c/test/contexts/cond_star0.ci.c +++ b/re2c/test/contexts/cond_star0.ci.c @@ -2,7 +2,8 @@ { YYCTYPE yych; - long yyctx0, yyctx1; + long yyctx0; + long yyctx1; YYCTXMARKER = YYCURSOR; switch (YYGETCONDITION()) { case yycc1: goto yyc_c1; diff --git a/re2c/test/contexts/cond_star1.ci--input(custom).c b/re2c/test/contexts/cond_star1.ci--input(custom).c index 6451ef6e..6089be53 100644 --- a/re2c/test/contexts/cond_star1.ci--input(custom).c +++ b/re2c/test/contexts/cond_star1.ci--input(custom).c @@ -2,7 +2,8 @@ { YYCTYPE yych; - long yyctx0, yyctx1; + long yyctx0; + long yyctx1; YYBACKUPCTX (); switch (YYGETCONDITION()) { case yycc1: goto yyc_c1; diff --git a/re2c/test/contexts/cond_star1.ci.c b/re2c/test/contexts/cond_star1.ci.c index d33f25a6..11e69bfd 100644 --- a/re2c/test/contexts/cond_star1.ci.c +++ b/re2c/test/contexts/cond_star1.ci.c @@ -2,7 +2,8 @@ { YYCTYPE yych; - long yyctx0, yyctx1; + long yyctx0; + long yyctx1; YYCTXMARKER = YYCURSOR; switch (YYGETCONDITION()) { case yycc1: goto yyc_c1; diff --git a/re2c/test/contexts/cond_star2.ci.c b/re2c/test/contexts/cond_star2.ci.c index a05b56ff..b8f39e13 100644 --- a/re2c/test/contexts/cond_star2.ci.c +++ b/re2c/test/contexts/cond_star2.ci.c @@ -2,7 +2,9 @@ { YYCTYPE yych; - long yyctx0, yyctx1, yyctx3; + long yyctx0; + long yyctx1; + long yyctx3; YYCTXMARKER = YYCURSOR; switch (YYGETCONDITION()) { case yycc1: goto yyc_c1; diff --git a/re2c/test/contexts/conf1.i--contexts--input(custom).c b/re2c/test/contexts/conf1.i--contexts--input(custom).c new file mode 100644 index 00000000..047b3108 --- /dev/null +++ b/re2c/test/contexts/conf1.i--contexts--input(custom).c @@ -0,0 +1,289 @@ +/* Generated by re2c */ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +static void lex(const char *s) +{ +#define YYPEEK() *s +#define YYSKIP() ++s +#define YYBACKUP() marker = s +#define YYRESTORE() s = marker +#define YYBACKUPCTX() basectx = s +#define YYRESTORECTX(dist) s = basectx + dist +#define ZZ_CTX(dist) (basectx + dist) +#define ZZ_DIST() (s - basectx) + const char *marker; + const char *basectx; + +{ + char yych; + long zz_0p1; + long zz_0p2; + long zz_0p3; + YYBACKUPCTX (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy4; + default: goto yy2; + } +yy2: + YYSKIP (); +yy3: + { printf("error\n"); return; } +yy4: + YYSKIP (); + YYBACKUP (); + yych = YYPEEK (); + zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy7; + default: goto yy3; + } +yy5: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy8; + default: goto yy6; + } +yy6: + YYRESTORE (); + goto yy3; +yy7: + YYSKIP (); + yych = YYPEEK (); + zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy9; + default: goto yy6; + } +yy8: + YYSKIP (); + yych = YYPEEK (); + zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy11; + default: goto yy6; + } +yy9: + YYSKIP (); + yych = YYPEEK (); + zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + default: goto yy6; + } +yy10: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy12; + default: goto yy6; + } +yy11: + YYSKIP (); + yych = YYPEEK (); + zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy13; + default: goto yy6; + } +yy12: + YYSKIP (); + yych = YYPEEK (); + zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy15; + default: goto yy6; + } +yy13: + YYSKIP (); + yych = YYPEEK (); + zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + default: goto yy6; + } +yy14: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy16; + default: goto yy6; + } +yy15: + YYSKIP (); + yych = YYPEEK (); + zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy18; + default: goto yy6; + } +yy16: + YYSKIP (); + switch ((yych = YYPEEK ())) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy19; + default: goto yy17; + } +yy17: + { + printf("%u.%u.%u.%u\n", + parse_oct(basectx, ZZ_CTX(zz_0p1)), + parse_oct(ZZ_CTX(zz_0p1) + 1, ZZ_CTX(zz_0p2)), + parse_oct(ZZ_CTX(zz_0p2) + 1, ZZ_CTX(zz_0p3)), + parse_oct(ZZ_CTX(zz_0p3) + 1, s)); + return; + } +yy18: + YYSKIP (); + yych = YYPEEK (); + zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + default: goto yy6; + } +yy19: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy20; + default: goto yy17; + } +yy20: + YYSKIP (); + yych = YYPEEK (); + goto yy17; +} + +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf1.i--contexts--input(custom).re b/re2c/test/contexts/conf1.i--contexts--input(custom).re new file mode 100644 index 00000000..8acf5cce --- /dev/null +++ b/re2c/test/contexts/conf1.i--contexts--input(custom).re @@ -0,0 +1,58 @@ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +static void lex(const char *s) +{ +#define YYPEEK() *s +#define YYSKIP() ++s +#define YYBACKUP() marker = s +#define YYRESTORE() s = marker +#define YYBACKUPCTX() basectx = s +#define YYRESTORECTX(dist) s = basectx + dist +#define ZZ_CTX(dist) (basectx + dist) +#define ZZ_DIST() (s - basectx) + const char *marker; + const char *basectx; + /*!re2c + re2c:define:YYCTYPE = char; + re2c:yyfill:enable = 0; + + oct = [0-9]{1,3}; + d = "."; + + * { printf("error\n"); return; } + + oct @p1 + d oct @p2 + d oct @p3 + d oct { + printf("%u.%u.%u.%u\n", + parse_oct(basectx, @p1), + parse_oct(@p1 + 1, @p2), + parse_oct(@p2 + 1, @p3), + parse_oct(@p3 + 1, s)); + return; + } + + re2c:define:YYCTX = "ZZ_CTX"; + re2c:define:YYDIST = "ZZ_DIST"; + re2c:contexts:prefix = "zz_"; + */ +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf1.i--contexts.c b/re2c/test/contexts/conf1.i--contexts.c new file mode 100644 index 00000000..3b4b9b90 --- /dev/null +++ b/re2c/test/contexts/conf1.i--contexts.c @@ -0,0 +1,267 @@ +/* Generated by re2c */ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +static void lex(const char *YYCURSOR) +{ + const char *YYMARKER; + const char *YYCTXMARKER; + +{ + char yych; + long zz_0p1; + long zz_0p2; + long zz_0p3; + YYCTXMARKER = YYCURSOR; + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + { printf("error\n"); return; } +yy4: + yych = *(YYMARKER = ++YYCURSOR); + zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy7; + default: goto yy3; + } +yy5: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy8; + default: goto yy6; + } +yy6: + YYCURSOR = YYMARKER; + goto yy3; +yy7: + yych = *++YYCURSOR; + zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy9; + default: goto yy6; + } +yy8: + yych = *++YYCURSOR; + zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy11; + default: goto yy6; + } +yy9: + yych = *++YYCURSOR; + zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + default: goto yy6; + } +yy10: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy12; + default: goto yy6; + } +yy11: + yych = *++YYCURSOR; + zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy13; + default: goto yy6; + } +yy12: + yych = *++YYCURSOR; + zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy15; + default: goto yy6; + } +yy13: + yych = *++YYCURSOR; + zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + default: goto yy6; + } +yy14: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy16; + default: goto yy6; + } +yy15: + yych = *++YYCURSOR; + zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy18; + default: goto yy6; + } +yy16: + ++YYCURSOR; + switch ((yych = *YYCURSOR)) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy19; + default: goto yy17; + } +yy17: + { + printf("%u.%u.%u.%u\n", + parse_oct(YYCTXMARKER, (YYCTXMARKER + zz_0p1)), + parse_oct((YYCTXMARKER + zz_0p1) + 1, (YYCTXMARKER + zz_0p2)), + parse_oct((YYCTXMARKER + zz_0p2) + 1, (YYCTXMARKER + zz_0p3)), + parse_oct((YYCTXMARKER + zz_0p3) + 1, YYCURSOR)); + return; + } +yy18: + yych = *++YYCURSOR; + zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + default: goto yy6; + } +yy19: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy20; + default: goto yy17; + } +yy20: + ++YYCURSOR; + yych = *YYCURSOR; + goto yy17; +} + +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf1.i--contexts.re b/re2c/test/contexts/conf1.i--contexts.re new file mode 100644 index 00000000..a91756a0 --- /dev/null +++ b/re2c/test/contexts/conf1.i--contexts.re @@ -0,0 +1,48 @@ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +static void lex(const char *YYCURSOR) +{ + const char *YYMARKER; + const char *YYCTXMARKER; + /*!re2c + re2c:define:YYCTYPE = char; + re2c:yyfill:enable = 0; + + oct = [0-9]{1,3}; + d = "."; + + * { printf("error\n"); return; } + + oct @p1 + d oct @p2 + d oct @p3 + d oct { + printf("%u.%u.%u.%u\n", + parse_oct(YYCTXMARKER, @p1), + parse_oct(@p1 + 1, @p2), + parse_oct(@p2 + 1, @p3), + parse_oct(@p3 + 1, YYCURSOR)); + return; + } + + re2c:contexts:prefix = "zz_"; + */ +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf2.i--contexts--input(custom).c b/re2c/test/contexts/conf2.i--contexts--input(custom).c new file mode 100644 index 00000000..7af780cb --- /dev/null +++ b/re2c/test/contexts/conf2.i--contexts--input(custom).c @@ -0,0 +1,287 @@ +/* Generated by re2c */ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +static void lex(const char *s) +{ +#define YYPEEK() *s +#define YYSKIP() ++s +#define YYBACKUP() marker = s +#define YYRESTORE() s = marker +#define YYBACKUPCTX() basectx = s +#define YYRESTORECTX(dist) s = basectx + dist +#define ZZ_CTX(dist) (basectx + dist) +#define ZZ_DIST() (s - basectx) + const char *marker; + const char *basectx; + long zz_0p1;long zz_0p2;long zz_0p3; + +{ + char yych; + YYBACKUPCTX (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy4; + default: goto yy2; + } +yy2: + YYSKIP (); +yy3: + { printf("error\n"); return; } +yy4: + YYSKIP (); + YYBACKUP (); + yych = YYPEEK (); + zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy7; + default: goto yy3; + } +yy5: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy8; + default: goto yy6; + } +yy6: + YYRESTORE (); + goto yy3; +yy7: + YYSKIP (); + yych = YYPEEK (); + zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy9; + default: goto yy6; + } +yy8: + YYSKIP (); + yych = YYPEEK (); + zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy11; + default: goto yy6; + } +yy9: + YYSKIP (); + yych = YYPEEK (); + zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + default: goto yy6; + } +yy10: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy12; + default: goto yy6; + } +yy11: + YYSKIP (); + yych = YYPEEK (); + zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy13; + default: goto yy6; + } +yy12: + YYSKIP (); + yych = YYPEEK (); + zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy15; + default: goto yy6; + } +yy13: + YYSKIP (); + yych = YYPEEK (); + zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + default: goto yy6; + } +yy14: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy16; + default: goto yy6; + } +yy15: + YYSKIP (); + yych = YYPEEK (); + zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy18; + default: goto yy6; + } +yy16: + YYSKIP (); + switch ((yych = YYPEEK ())) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy19; + default: goto yy17; + } +yy17: + { + printf("%u.%u.%u.%u\n", + parse_oct(basectx, ZZ_CTX(zz_0p1)), + parse_oct(ZZ_CTX(zz_0p1) + 1, ZZ_CTX(zz_0p2)), + parse_oct(ZZ_CTX(zz_0p2) + 1, ZZ_CTX(zz_0p3)), + parse_oct(ZZ_CTX(zz_0p3) + 1, s)); + return; + } +yy18: + YYSKIP (); + yych = YYPEEK (); + zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + default: goto yy6; + } +yy19: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy20; + default: goto yy17; + } +yy20: + YYSKIP (); + yych = YYPEEK (); + goto yy17; +} + +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf2.i--contexts--input(custom).re b/re2c/test/contexts/conf2.i--contexts--input(custom).re new file mode 100644 index 00000000..033eb037 --- /dev/null +++ b/re2c/test/contexts/conf2.i--contexts--input(custom).re @@ -0,0 +1,58 @@ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +static void lex(const char *s) +{ +#define YYPEEK() *s +#define YYSKIP() ++s +#define YYBACKUP() marker = s +#define YYRESTORE() s = marker +#define YYBACKUPCTX() basectx = s +#define YYRESTORECTX(dist) s = basectx + dist +#define ZZ_CTX(dist) (basectx + dist) +#define ZZ_DIST() (s - basectx) + const char *marker; + const char *basectx; + /*!contexts:re2c*/ + /*!re2c + re2c:define:YYCTYPE = char; + re2c:yyfill:enable = 0; + re2c:define:YYCTX = "ZZ_CTX"; + re2c:define:YYDIST = "ZZ_DIST"; + re2c:contexts:prefix = "zz_"; + + oct = [0-9]{1,3}; + d = "."; + + * { printf("error\n"); return; } + + oct @p1 + d oct @p2 + d oct @p3 + d oct { + printf("%u.%u.%u.%u\n", + parse_oct(basectx, @p1), + parse_oct(@p1 + 1, @p2), + parse_oct(@p2 + 1, @p3), + parse_oct(@p3 + 1, s)); + return; + } + */ +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf2.i--contexts.c b/re2c/test/contexts/conf2.i--contexts.c new file mode 100644 index 00000000..48e7cc0b --- /dev/null +++ b/re2c/test/contexts/conf2.i--contexts.c @@ -0,0 +1,265 @@ +/* Generated by re2c */ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +static void lex(const char *YYCURSOR) +{ + const char *YYMARKER; + const char *YYCTXMARKER; + long zz_0p1;long zz_0p2;long zz_0p3; + +{ + char yych; + YYCTXMARKER = YYCURSOR; + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + { printf("error\n"); return; } +yy4: + yych = *(YYMARKER = ++YYCURSOR); + zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy7; + default: goto yy3; + } +yy5: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy8; + default: goto yy6; + } +yy6: + YYCURSOR = YYMARKER; + goto yy3; +yy7: + yych = *++YYCURSOR; + zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy9; + default: goto yy6; + } +yy8: + yych = *++YYCURSOR; + zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy11; + default: goto yy6; + } +yy9: + yych = *++YYCURSOR; + zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + default: goto yy6; + } +yy10: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy12; + default: goto yy6; + } +yy11: + yych = *++YYCURSOR; + zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy13; + default: goto yy6; + } +yy12: + yych = *++YYCURSOR; + zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy15; + default: goto yy6; + } +yy13: + yych = *++YYCURSOR; + zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + default: goto yy6; + } +yy14: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy16; + default: goto yy6; + } +yy15: + yych = *++YYCURSOR; + zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy18; + default: goto yy6; + } +yy16: + ++YYCURSOR; + switch ((yych = *YYCURSOR)) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy19; + default: goto yy17; + } +yy17: + { + printf("%u.%u.%u.%u\n", + parse_oct(YYCTXMARKER, (YYCTXMARKER + zz_0p1)), + parse_oct((YYCTXMARKER + zz_0p1) + 1, (YYCTXMARKER + zz_0p2)), + parse_oct((YYCTXMARKER + zz_0p2) + 1, (YYCTXMARKER + zz_0p3)), + parse_oct((YYCTXMARKER + zz_0p3) + 1, YYCURSOR)); + return; + } +yy18: + yych = *++YYCURSOR; + zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + default: goto yy6; + } +yy19: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy20; + default: goto yy17; + } +yy20: + ++YYCURSOR; + yych = *YYCURSOR; + goto yy17; +} + +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf2.i--contexts.re b/re2c/test/contexts/conf2.i--contexts.re new file mode 100644 index 00000000..219378b4 --- /dev/null +++ b/re2c/test/contexts/conf2.i--contexts.re @@ -0,0 +1,48 @@ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +static void lex(const char *YYCURSOR) +{ + const char *YYMARKER; + const char *YYCTXMARKER; + /*!contexts:re2c*/ + /*!re2c + re2c:define:YYCTYPE = char; + re2c:yyfill:enable = 0; + re2c:contexts:prefix = "zz_"; + + oct = [0-9]{1,3}; + d = "."; + + * { printf("error\n"); return; } + + oct @p1 + d oct @p2 + d oct @p3 + d oct { + printf("%u.%u.%u.%u\n", + parse_oct(YYCTXMARKER, @p1), + parse_oct(@p1 + 1, @p2), + parse_oct(@p2 + 1, @p3), + parse_oct(@p3 + 1, YYCURSOR)); + return; + } + */ +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf3.i--contexts--input(custom).c b/re2c/test/contexts/conf3.i--contexts--input(custom).c new file mode 100644 index 00000000..ff03eca9 --- /dev/null +++ b/re2c/test/contexts/conf3.i--contexts--input(custom).c @@ -0,0 +1,288 @@ +/* Generated by re2c */ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +static void lex(const char *s) +{ +#define YYPEEK() *s +#define YYSKIP() ++s +#define YYBACKUP() marker = s +#define YYRESTORE() s = marker +#define YYBACKUPCTX() basectx = s +#define YYRESTORECTX(dist) s = basectx + dist +#define ZZ_CTX(dist) (basectx + dist) +#define ZZ_DIST() (s - basectx) + const char *marker; + const char *basectx; + + ptrdiff_t zz_0p1 = 0, zz_0p2 = 0, zz_0p3 = 0; + +{ + char yych; + YYBACKUPCTX (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy4; + default: goto yy2; + } +yy2: + YYSKIP (); +yy3: + { printf("error\n"); return; } +yy4: + YYSKIP (); + YYBACKUP (); + yych = YYPEEK (); + zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy7; + default: goto yy3; + } +yy5: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy8; + default: goto yy6; + } +yy6: + YYRESTORE (); + goto yy3; +yy7: + YYSKIP (); + yych = YYPEEK (); + zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy9; + default: goto yy6; + } +yy8: + YYSKIP (); + yych = YYPEEK (); + zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy11; + default: goto yy6; + } +yy9: + YYSKIP (); + yych = YYPEEK (); + zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + default: goto yy6; + } +yy10: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy12; + default: goto yy6; + } +yy11: + YYSKIP (); + yych = YYPEEK (); + zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy13; + default: goto yy6; + } +yy12: + YYSKIP (); + yych = YYPEEK (); + zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy15; + default: goto yy6; + } +yy13: + YYSKIP (); + yych = YYPEEK (); + zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + default: goto yy6; + } +yy14: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy16; + default: goto yy6; + } +yy15: + YYSKIP (); + yych = YYPEEK (); + zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy18; + default: goto yy6; + } +yy16: + YYSKIP (); + switch ((yych = YYPEEK ())) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy19; + default: goto yy17; + } +yy17: + { + printf("%u.%u.%u.%u\n", + parse_oct(basectx, ZZ_CTX(zz_0p1)), + parse_oct(ZZ_CTX(zz_0p1) + 1, ZZ_CTX(zz_0p2)), + parse_oct(ZZ_CTX(zz_0p2) + 1, ZZ_CTX(zz_0p3)), + parse_oct(ZZ_CTX(zz_0p3) + 1, s)); + return; + } +yy18: + YYSKIP (); + yych = YYPEEK (); + zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + default: goto yy6; + } +yy19: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy20; + default: goto yy17; + } +yy20: + YYSKIP (); + yych = YYPEEK (); + goto yy17; +} + +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf3.i--contexts--input(custom).re b/re2c/test/contexts/conf3.i--contexts--input(custom).re new file mode 100644 index 00000000..59f181dc --- /dev/null +++ b/re2c/test/contexts/conf3.i--contexts--input(custom).re @@ -0,0 +1,59 @@ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +static void lex(const char *s) +{ +#define YYPEEK() *s +#define YYSKIP() ++s +#define YYBACKUP() marker = s +#define YYRESTORE() s = marker +#define YYBACKUPCTX() basectx = s +#define YYRESTORECTX(dist) s = basectx + dist +#define ZZ_CTX(dist) (basectx + dist) +#define ZZ_DIST() (s - basectx) + const char *marker; + const char *basectx; + /*!contexts:re2c sep="\n"; line="long @@ = 0;"; line=; sep=; */ + ptrdiff_t /*!contexts:re2c sep=", "; line="@@ = 0"; */; + /*!re2c + re2c:define:YYCTYPE = char; + re2c:yyfill:enable = 0; + re2c:define:YYCTX = "ZZ_CTX"; + re2c:define:YYDIST = "ZZ_DIST"; + re2c:contexts:prefix = "zz_"; + + oct = [0-9]{1,3}; + d = "."; + + * { printf("error\n"); return; } + + oct @p1 + d oct @p2 + d oct @p3 + d oct { + printf("%u.%u.%u.%u\n", + parse_oct(basectx, @p1), + parse_oct(@p1 + 1, @p2), + parse_oct(@p2 + 1, @p3), + parse_oct(@p3 + 1, s)); + return; + } + */ +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf3.i--contexts.c b/re2c/test/contexts/conf3.i--contexts.c new file mode 100644 index 00000000..7c2869f8 --- /dev/null +++ b/re2c/test/contexts/conf3.i--contexts.c @@ -0,0 +1,266 @@ +/* Generated by re2c */ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +static void lex(const char *YYCURSOR) +{ + const char *YYMARKER; + const char *YYCTXMARKER; + + ptrdiff_t zz_0p1 = 0, zz_0p2 = 0, zz_0p3 = 0; + +{ + char yych; + YYCTXMARKER = YYCURSOR; + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + { printf("error\n"); return; } +yy4: + yych = *(YYMARKER = ++YYCURSOR); + zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy7; + default: goto yy3; + } +yy5: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy8; + default: goto yy6; + } +yy6: + YYCURSOR = YYMARKER; + goto yy3; +yy7: + yych = *++YYCURSOR; + zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy9; + default: goto yy6; + } +yy8: + yych = *++YYCURSOR; + zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy11; + default: goto yy6; + } +yy9: + yych = *++YYCURSOR; + zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + default: goto yy6; + } +yy10: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy12; + default: goto yy6; + } +yy11: + yych = *++YYCURSOR; + zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy13; + default: goto yy6; + } +yy12: + yych = *++YYCURSOR; + zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy15; + default: goto yy6; + } +yy13: + yych = *++YYCURSOR; + zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + default: goto yy6; + } +yy14: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy16; + default: goto yy6; + } +yy15: + yych = *++YYCURSOR; + zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy18; + default: goto yy6; + } +yy16: + ++YYCURSOR; + switch ((yych = *YYCURSOR)) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy19; + default: goto yy17; + } +yy17: + { + printf("%u.%u.%u.%u\n", + parse_oct(YYCTXMARKER, (YYCTXMARKER + zz_0p1)), + parse_oct((YYCTXMARKER + zz_0p1) + 1, (YYCTXMARKER + zz_0p2)), + parse_oct((YYCTXMARKER + zz_0p2) + 1, (YYCTXMARKER + zz_0p3)), + parse_oct((YYCTXMARKER + zz_0p3) + 1, YYCURSOR)); + return; + } +yy18: + yych = *++YYCURSOR; + zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + default: goto yy6; + } +yy19: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy20; + default: goto yy17; + } +yy20: + ++YYCURSOR; + yych = *YYCURSOR; + goto yy17; +} + +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf3.i--contexts.re b/re2c/test/contexts/conf3.i--contexts.re new file mode 100644 index 00000000..8f762680 --- /dev/null +++ b/re2c/test/contexts/conf3.i--contexts.re @@ -0,0 +1,49 @@ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +static void lex(const char *YYCURSOR) +{ + const char *YYMARKER; + const char *YYCTXMARKER; + /*!contexts:re2c sep="\n"; line="long @@ = 0;"; line=; sep=; */ + ptrdiff_t /*!contexts:re2c sep=", "; line="@@ = 0"; */; + /*!re2c + re2c:define:YYCTYPE = char; + re2c:yyfill:enable = 0; + re2c:contexts:prefix = "zz_"; + + oct = [0-9]{1,3}; + d = "."; + + * { printf("error\n"); return; } + + oct @p1 + d oct @p2 + d oct @p3 + d oct { + printf("%u.%u.%u.%u\n", + parse_oct(YYCTXMARKER, @p1), + parse_oct(@p1 + 1, @p2), + parse_oct(@p2 + 1, @p3), + parse_oct(@p3 + 1, YYCURSOR)); + return; + } + */ +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf4.i--contexts--input(custom).c b/re2c/test/contexts/conf4.i--contexts--input(custom).c new file mode 100644 index 00000000..dc190bcf --- /dev/null +++ b/re2c/test/contexts/conf4.i--contexts--input(custom).c @@ -0,0 +1,302 @@ +/* Generated by re2c */ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +struct contexts_t +{ + long zz_0p1;long zz_0p2;long zz_0p3; + + contexts_t(): zz_0p1(0),zz_0p2(0),zz_0p3(0) {} + void push(long arg_zz_0p1,long arg_zz_0p2,long arg_zz_0p3) + { + zz_0p1 = arg_zz_0p1;zz_0p2 = arg_zz_0p2;zz_0p3 = arg_zz_0p3; + } + void pop(long &arg_zz_0p1,long &arg_zz_0p2,long &arg_zz_0p3) + { + arg_zz_0p1 = zz_0p1;arg_zz_0p2 = zz_0p2;arg_zz_0p3 = zz_0p3; + } +}; + +static void lex(const char *s) +{ +#define YYPEEK() *s +#define YYSKIP() ++s +#define YYBACKUP() marker = s +#define YYRESTORE() s = marker +#define YYBACKUPCTX() basectx = s +#define YYRESTORECTX(dist) s = basectx + dist +#define ZZ_CTX(dist) (basectx + dist) +#define ZZ_DIST() (s - basectx) + const char *marker; + const char *basectx; + contexts_t ctxs; + +{ + char yych; + YYBACKUPCTX (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy4; + default: goto yy2; + } +yy2: + YYSKIP (); +yy3: + { printf("error\n"); return; } +yy4: + YYSKIP (); + YYBACKUP (); + yych = YYPEEK (); + ctxs.zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy7; + default: goto yy3; + } +yy5: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy8; + default: goto yy6; + } +yy6: + YYRESTORE (); + goto yy3; +yy7: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy9; + default: goto yy6; + } +yy8: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy11; + default: goto yy6; + } +yy9: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + default: goto yy6; + } +yy10: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy12; + default: goto yy6; + } +yy11: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy13; + default: goto yy6; + } +yy12: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy15; + default: goto yy6; + } +yy13: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + default: goto yy6; + } +yy14: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy16; + default: goto yy6; + } +yy15: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy18; + default: goto yy6; + } +yy16: + YYSKIP (); + switch ((yych = YYPEEK ())) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy19; + default: goto yy17; + } +yy17: + { + printf("%u.%u.%u.%u\n", + parse_oct(basectx, ZZ_CTX(ctxs.zz_0p1)), + parse_oct(ZZ_CTX(ctxs.zz_0p1) + 1, ZZ_CTX(ctxs.zz_0p2)), + parse_oct(ZZ_CTX(ctxs.zz_0p2) + 1, ZZ_CTX(ctxs.zz_0p3)), + parse_oct(ZZ_CTX(ctxs.zz_0p3) + 1, s)); + return; + } +yy18: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + default: goto yy6; + } +yy19: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy20; + default: goto yy17; + } +yy20: + YYSKIP (); + yych = YYPEEK (); + goto yy17; +} + +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf4.i--contexts--input(custom).re b/re2c/test/contexts/conf4.i--contexts--input(custom).re new file mode 100644 index 00000000..b2a087c2 --- /dev/null +++ b/re2c/test/contexts/conf4.i--contexts--input(custom).re @@ -0,0 +1,75 @@ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +struct contexts_t +{ + /*!contexts:re2c line="long @@;"; */ + + contexts_t(): /*!contexts:re2c line="@@(0)"; sep=","; */ {} + void push(/*!contexts:re2c line="long arg_@@"; sep=","; */) + { + /*!contexts:re2c line="@@ = arg_@@;"; */ + } + void pop(/*!contexts:re2c line="long &arg_@@"; sep=","; */) + { + /*!contexts:re2c line="arg_@@ = @@;"; */ + } +}; + +static void lex(const char *s) +{ +#define YYPEEK() *s +#define YYSKIP() ++s +#define YYBACKUP() marker = s +#define YYRESTORE() s = marker +#define YYBACKUPCTX() basectx = s +#define YYRESTORECTX(dist) s = basectx + dist +#define ZZ_CTX(dist) (basectx + dist) +#define ZZ_DIST() (s - basectx) + const char *marker; + const char *basectx; + contexts_t ctxs; + /*!re2c + re2c:define:YYCTYPE = char; + re2c:yyfill:enable = 0; + + re2c:define:YYCTX = "ZZ_CTX"; + re2c:define:YYDIST = "ZZ_DIST"; + re2c:contexts:prefix = "zz_"; + re2c:contexts:expr = "ctxs.@@"; + + oct = [0-9]{1,3}; + d = "."; + + * { printf("error\n"); return; } + + oct @p1 + d oct @p2 + d oct @p3 + d oct { + printf("%u.%u.%u.%u\n", + parse_oct(basectx, @p1), + parse_oct(@p1 + 1, @p2), + parse_oct(@p2 + 1, @p3), + parse_oct(@p3 + 1, s)); + return; + } + */ +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf4.i--contexts.c b/re2c/test/contexts/conf4.i--contexts.c new file mode 100644 index 00000000..50ebd1c0 --- /dev/null +++ b/re2c/test/contexts/conf4.i--contexts.c @@ -0,0 +1,280 @@ +/* Generated by re2c */ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +struct contexts_t +{ + long zz_0p1;long zz_0p2;long zz_0p3; + + contexts_t(): zz_0p1(0),zz_0p2(0),zz_0p3(0) {} + void push(long arg_zz_0p1,long arg_zz_0p2,long arg_zz_0p3) + { + zz_0p1 = arg_zz_0p1;zz_0p2 = arg_zz_0p2;zz_0p3 = arg_zz_0p3; + } + void pop(long &arg_zz_0p1,long &arg_zz_0p2,long &arg_zz_0p3) + { + arg_zz_0p1 = zz_0p1;arg_zz_0p2 = zz_0p2;arg_zz_0p3 = zz_0p3; + } +}; + +static void lex(const char *YYCURSOR) +{ + const char *YYMARKER; + const char *YYCTXMARKER; + contexts_t ctxs; + +{ + char yych; + YYCTXMARKER = YYCURSOR; + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + { printf("error\n"); return; } +yy4: + yych = *(YYMARKER = ++YYCURSOR); + ctxs.zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy7; + default: goto yy3; + } +yy5: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy8; + default: goto yy6; + } +yy6: + YYCURSOR = YYMARKER; + goto yy3; +yy7: + yych = *++YYCURSOR; + ctxs.zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy9; + default: goto yy6; + } +yy8: + yych = *++YYCURSOR; + ctxs.zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy11; + default: goto yy6; + } +yy9: + yych = *++YYCURSOR; + ctxs.zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + default: goto yy6; + } +yy10: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy12; + default: goto yy6; + } +yy11: + yych = *++YYCURSOR; + ctxs.zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy13; + default: goto yy6; + } +yy12: + yych = *++YYCURSOR; + ctxs.zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy15; + default: goto yy6; + } +yy13: + yych = *++YYCURSOR; + ctxs.zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + default: goto yy6; + } +yy14: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy16; + default: goto yy6; + } +yy15: + yych = *++YYCURSOR; + ctxs.zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy18; + default: goto yy6; + } +yy16: + ++YYCURSOR; + switch ((yych = *YYCURSOR)) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy19; + default: goto yy17; + } +yy17: + { + printf("%u.%u.%u.%u\n", + parse_oct(YYCTXMARKER, (YYCTXMARKER + ctxs.zz_0p1)), + parse_oct((YYCTXMARKER + ctxs.zz_0p1) + 1, (YYCTXMARKER + ctxs.zz_0p2)), + parse_oct((YYCTXMARKER + ctxs.zz_0p2) + 1, (YYCTXMARKER + ctxs.zz_0p3)), + parse_oct((YYCTXMARKER + ctxs.zz_0p3) + 1, YYCURSOR)); + return; + } +yy18: + yych = *++YYCURSOR; + ctxs.zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + default: goto yy6; + } +yy19: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy20; + default: goto yy17; + } +yy20: + ++YYCURSOR; + yych = *YYCURSOR; + goto yy17; +} + +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf4.i--contexts.re b/re2c/test/contexts/conf4.i--contexts.re new file mode 100644 index 00000000..57051764 --- /dev/null +++ b/re2c/test/contexts/conf4.i--contexts.re @@ -0,0 +1,65 @@ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +struct contexts_t +{ + /*!contexts:re2c line="long @@;"; */ + + contexts_t(): /*!contexts:re2c line="@@(0)"; sep=","; */ {} + void push(/*!contexts:re2c line="long arg_@@"; sep=","; */) + { + /*!contexts:re2c line="@@ = arg_@@;"; */ + } + void pop(/*!contexts:re2c line="long &arg_@@"; sep=","; */) + { + /*!contexts:re2c line="arg_@@ = @@;"; */ + } +}; + +static void lex(const char *YYCURSOR) +{ + const char *YYMARKER; + const char *YYCTXMARKER; + contexts_t ctxs; + /*!re2c + re2c:define:YYCTYPE = char; + re2c:yyfill:enable = 0; + + re2c:contexts:prefix = "zz_"; + re2c:contexts:expr = "ctxs.@@"; + + oct = [0-9]{1,3}; + d = "."; + + * { printf("error\n"); return; } + + oct @p1 + d oct @p2 + d oct @p3 + d oct { + printf("%u.%u.%u.%u\n", + parse_oct(YYCTXMARKER, @p1), + parse_oct(@p1 + 1, @p2), + parse_oct(@p2 + 1, @p3), + parse_oct(@p3 + 1, YYCURSOR)); + return; + } + */ +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf5.i--contexts--input(custom).c b/re2c/test/contexts/conf5.i--contexts--input(custom).c new file mode 100644 index 00000000..784f3d7c --- /dev/null +++ b/re2c/test/contexts/conf5.i--contexts--input(custom).c @@ -0,0 +1,308 @@ +/* Generated by re2c */ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +struct contexts_t +{ + long zz_0p1;long zz_0p2;long zz_0p3; + + contexts_t(); + void push(long arg_zz_0p1,long arg_zz_0p2,long arg_zz_0p3); + void pop(long &arg_zz_0p1,long &arg_zz_0p2,long &arg_zz_0p3); +}; + +static void lex(const char *s) +{ +#define YYPEEK() *s +#define YYSKIP() ++s +#define YYBACKUP() marker = s +#define YYRESTORE() s = marker +#define YYBACKUPCTX() basectx = s +#define YYRESTORECTX(dist) s = basectx + dist +#define ZZ_CTX(dist) (basectx + dist) +#define ZZ_DIST() (s - basectx) + const char *marker; + const char *basectx; + contexts_t ctxs; + +{ + char yych; + YYBACKUPCTX (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy4; + default: goto yy2; + } +yy2: + YYSKIP (); +yy3: + { printf("error\n"); return; } +yy4: + YYSKIP (); + YYBACKUP (); + yych = YYPEEK (); + ctxs.zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy7; + default: goto yy3; + } +yy5: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy8; + default: goto yy6; + } +yy6: + YYRESTORE (); + goto yy3; +yy7: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy9; + default: goto yy6; + } +yy8: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy11; + default: goto yy6; + } +yy9: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + default: goto yy6; + } +yy10: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy12; + default: goto yy6; + } +yy11: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy13; + default: goto yy6; + } +yy12: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy15; + default: goto yy6; + } +yy13: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + default: goto yy6; + } +yy14: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy16; + default: goto yy6; + } +yy15: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy18; + default: goto yy6; + } +yy16: + YYSKIP (); + switch ((yych = YYPEEK ())) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy19; + default: goto yy17; + } +yy17: + { + printf("%u.%u.%u.%u\n", + parse_oct(basectx, ZZ_CTX(ctxs.zz_0p1)), + parse_oct(ZZ_CTX(ctxs.zz_0p1) + 1, ZZ_CTX(ctxs.zz_0p2)), + parse_oct(ZZ_CTX(ctxs.zz_0p2) + 1, ZZ_CTX(ctxs.zz_0p3)), + parse_oct(ZZ_CTX(ctxs.zz_0p3) + 1, s)); + return; + } +yy18: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + default: goto yy6; + } +yy19: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy20; + default: goto yy17; + } +yy20: + YYSKIP (); + yych = YYPEEK (); + goto yy17; +} + +} + +contexts_t::contexts_t(): zz_0p1(0),zz_0p2(0),zz_0p3(0) {} + +void contexts_t::push(long arg_zz_0p1,long arg_zz_0p2,long arg_zz_0p3) +{ + zz_0p1 = arg_zz_0p1;zz_0p2 = arg_zz_0p2;zz_0p3 = arg_zz_0p3; +} + +void contexts_t::pop(long &arg_zz_0p1,long &arg_zz_0p2,long &arg_zz_0p3) +{ + arg_zz_0p1 = zz_0p1;arg_zz_0p2 = zz_0p2;arg_zz_0p3 = zz_0p3; +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf5.i--contexts--input(custom).re b/re2c/test/contexts/conf5.i--contexts--input(custom).re new file mode 100644 index 00000000..3a48449d --- /dev/null +++ b/re2c/test/contexts/conf5.i--contexts--input(custom).re @@ -0,0 +1,81 @@ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +struct contexts_t +{ + /*!contexts:re2c line="long @@;"; */ + + contexts_t(); + void push(/*!contexts:re2c line="long arg_@@"; sep=","; */); + void pop(/*!contexts:re2c line="long &arg_@@"; sep=","; */); +}; + +static void lex(const char *s) +{ +#define YYPEEK() *s +#define YYSKIP() ++s +#define YYBACKUP() marker = s +#define YYRESTORE() s = marker +#define YYBACKUPCTX() basectx = s +#define YYRESTORECTX(dist) s = basectx + dist +#define ZZ_CTX(dist) (basectx + dist) +#define ZZ_DIST() (s - basectx) + const char *marker; + const char *basectx; + contexts_t ctxs; + /*!re2c + re2c:define:YYCTYPE = char; + re2c:yyfill:enable = 0; + + re2c:define:YYCTX = "ZZ_CTX"; + re2c:define:YYDIST = "ZZ_DIST"; + re2c:contexts:prefix = "zz_"; + re2c:contexts:expr = "ctxs.@@"; + + oct = [0-9]{1,3}; + d = "."; + + * { printf("error\n"); return; } + + oct @p1 + d oct @p2 + d oct @p3 + d oct { + printf("%u.%u.%u.%u\n", + parse_oct(basectx, @p1), + parse_oct(@p1 + 1, @p2), + parse_oct(@p2 + 1, @p3), + parse_oct(@p3 + 1, s)); + return; + } + */ +} + +contexts_t::contexts_t(): /*!contexts:re2c line="@@(0)"; sep=","; */ {} + +void contexts_t::push(/*!contexts:re2c line="long arg_@@"; sep=","; */) +{ + /*!contexts:re2c line="@@ = arg_@@;"; */ +} + +void contexts_t::pop(/*!contexts:re2c line="long &arg_@@"; sep=","; */) +{ + /*!contexts:re2c line="arg_@@ = @@;"; */ +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf5.i--contexts.c b/re2c/test/contexts/conf5.i--contexts.c new file mode 100644 index 00000000..8d1f265c --- /dev/null +++ b/re2c/test/contexts/conf5.i--contexts.c @@ -0,0 +1,286 @@ +/* Generated by re2c */ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +struct contexts_t +{ + long zz_0p1;long zz_0p2;long zz_0p3; + + contexts_t(); + void push(long arg_zz_0p1,long arg_zz_0p2,long arg_zz_0p3); + void pop(long &arg_zz_0p1,long &arg_zz_0p2,long &arg_zz_0p3); +}; + +static void lex(const char *YYCURSOR) +{ + const char *YYMARKER; + const char *YYCTXMARKER; + contexts_t ctxs; + +{ + char yych; + YYCTXMARKER = YYCURSOR; + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: + { printf("error\n"); return; } +yy4: + yych = *(YYMARKER = ++YYCURSOR); + ctxs.zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy7; + default: goto yy3; + } +yy5: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy8; + default: goto yy6; + } +yy6: + YYCURSOR = YYMARKER; + goto yy3; +yy7: + yych = *++YYCURSOR; + ctxs.zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy9; + default: goto yy6; + } +yy8: + yych = *++YYCURSOR; + ctxs.zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy11; + default: goto yy6; + } +yy9: + yych = *++YYCURSOR; + ctxs.zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + default: goto yy6; + } +yy10: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy12; + default: goto yy6; + } +yy11: + yych = *++YYCURSOR; + ctxs.zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy13; + default: goto yy6; + } +yy12: + yych = *++YYCURSOR; + ctxs.zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy15; + default: goto yy6; + } +yy13: + yych = *++YYCURSOR; + ctxs.zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + default: goto yy6; + } +yy14: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy16; + default: goto yy6; + } +yy15: + yych = *++YYCURSOR; + ctxs.zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy18; + default: goto yy6; + } +yy16: + ++YYCURSOR; + switch ((yych = *YYCURSOR)) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy19; + default: goto yy17; + } +yy17: + { + printf("%u.%u.%u.%u\n", + parse_oct(YYCTXMARKER, (YYCTXMARKER + ctxs.zz_0p1)), + parse_oct((YYCTXMARKER + ctxs.zz_0p1) + 1, (YYCTXMARKER + ctxs.zz_0p2)), + parse_oct((YYCTXMARKER + ctxs.zz_0p2) + 1, (YYCTXMARKER + ctxs.zz_0p3)), + parse_oct((YYCTXMARKER + ctxs.zz_0p3) + 1, YYCURSOR)); + return; + } +yy18: + yych = *++YYCURSOR; + ctxs.zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + default: goto yy6; + } +yy19: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy20; + default: goto yy17; + } +yy20: + ++YYCURSOR; + yych = *YYCURSOR; + goto yy17; +} + +} + +contexts_t::contexts_t(): zz_0p1(0),zz_0p2(0),zz_0p3(0) {} + +void contexts_t::push(long arg_zz_0p1,long arg_zz_0p2,long arg_zz_0p3) +{ + zz_0p1 = arg_zz_0p1;zz_0p2 = arg_zz_0p2;zz_0p3 = arg_zz_0p3; +} + +void contexts_t::pop(long &arg_zz_0p1,long &arg_zz_0p2,long &arg_zz_0p3) +{ + arg_zz_0p1 = zz_0p1;arg_zz_0p2 = zz_0p2;arg_zz_0p3 = zz_0p3; +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf5.i--contexts.re b/re2c/test/contexts/conf5.i--contexts.re new file mode 100644 index 00000000..936092e2 --- /dev/null +++ b/re2c/test/contexts/conf5.i--contexts.re @@ -0,0 +1,71 @@ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +struct contexts_t +{ + /*!contexts:re2c line="long @@;"; */ + + contexts_t(); + void push(/*!contexts:re2c line="long arg_@@"; sep=","; */); + void pop(/*!contexts:re2c line="long &arg_@@"; sep=","; */); +}; + +static void lex(const char *YYCURSOR) +{ + const char *YYMARKER; + const char *YYCTXMARKER; + contexts_t ctxs; + /*!re2c + re2c:define:YYCTYPE = char; + re2c:yyfill:enable = 0; + + re2c:contexts:prefix = "zz_"; + re2c:contexts:expr = "ctxs.@@"; + + oct = [0-9]{1,3}; + d = "."; + + * { printf("error\n"); return; } + + oct @p1 + d oct @p2 + d oct @p3 + d oct { + printf("%u.%u.%u.%u\n", + parse_oct(YYCTXMARKER, @p1), + parse_oct(@p1 + 1, @p2), + parse_oct(@p2 + 1, @p3), + parse_oct(@p3 + 1, YYCURSOR)); + return; + } + */ +} + +contexts_t::contexts_t(): /*!contexts:re2c line="@@(0)"; sep=","; */ {} + +void contexts_t::push(/*!contexts:re2c line="long arg_@@"; sep=","; */) +{ + /*!contexts:re2c line="@@ = arg_@@;"; */ +} + +void contexts_t::pop(/*!contexts:re2c line="long &arg_@@"; sep=","; */) +{ + /*!contexts:re2c line="arg_@@ = @@;"; */ +} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf6.--contexts--input(custom).c b/re2c/test/contexts/conf6.--contexts--input(custom).c new file mode 100644 index 00000000..f9cbd262 --- /dev/null +++ b/re2c/test/contexts/conf6.--contexts--input(custom).c @@ -0,0 +1,311 @@ +/* Generated by re2c */ +#line 1 "contexts/conf6.--contexts--input(custom).re" +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +struct contexts_t +{ + long zz_0p1;long zz_0p2;long zz_0p3; + + contexts_t(); + void push(long arg_zz_0p1,long arg_zz_0p2,long arg_zz_0p3); + void pop(long &arg_zz_0p1,long &arg_zz_0p2,long &arg_zz_0p3); +}; + +static void lex(const char *s) +{ +#define YYPEEK() *s +#define YYSKIP() ++s +#define YYBACKUP() marker = s +#define YYRESTORE() s = marker +#define YYBACKUPCTX() basectx = s +#define YYRESTORECTX(dist) s = basectx + dist +#define ZZ_CTX(dist) (basectx + dist) +#define ZZ_DIST() (s - basectx) + const char *marker; + const char *basectx; + contexts_t ctxs; + +#line 39 "contexts/conf6.--contexts--input(custom).c" +{ + char yych; + YYBACKUPCTX (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy4; + default: goto yy2; + } +yy2: + YYSKIP (); +yy3: +#line 55 "contexts/conf6.--contexts--input(custom).re" + { printf("error\n"); return; } +#line 62 "contexts/conf6.--contexts--input(custom).c" +yy4: + YYSKIP (); + YYBACKUP (); + yych = YYPEEK (); + ctxs.zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy7; + default: goto yy3; + } +yy5: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy8; + default: goto yy6; + } +yy6: + YYRESTORE (); + goto yy3; +yy7: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy9; + default: goto yy6; + } +yy8: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy11; + default: goto yy6; + } +yy9: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p1 = ZZ_DIST(); + switch (yych) { + case '.': goto yy5; + default: goto yy6; + } +yy10: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy12; + default: goto yy6; + } +yy11: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy13; + default: goto yy6; + } +yy12: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy15; + default: goto yy6; + } +yy13: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p2 = ZZ_DIST(); + switch (yych) { + case '.': goto yy10; + default: goto yy6; + } +yy14: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy16; + default: goto yy6; + } +yy15: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy18; + default: goto yy6; + } +yy16: + YYSKIP (); + switch ((yych = YYPEEK ())) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy19; + default: goto yy17; + } +yy17: +#line 60 "contexts/conf6.--contexts--input(custom).re" + { + printf("%u.%u.%u.%u\n", + parse_oct(basectx, ZZ_CTX(ctxs.zz_0p1)), + parse_oct(ZZ_CTX(ctxs.zz_0p1) + 1, ZZ_CTX(ctxs.zz_0p2)), + parse_oct(ZZ_CTX(ctxs.zz_0p2) + 1, ZZ_CTX(ctxs.zz_0p3)), + parse_oct(ZZ_CTX(ctxs.zz_0p3) + 1, s)); + return; + } +#line 264 "contexts/conf6.--contexts--input(custom).c" +yy18: + YYSKIP (); + yych = YYPEEK (); + ctxs.zz_0p3 = ZZ_DIST(); + switch (yych) { + case '.': goto yy14; + default: goto yy6; + } +yy19: + YYSKIP (); + yych = YYPEEK (); + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy20; + default: goto yy17; + } +yy20: + YYSKIP (); + yych = YYPEEK (); + goto yy17; +} +#line 68 "contexts/conf6.--contexts--input(custom).re" + +} + +contexts_t::contexts_t(): zz_0p1(0),zz_0p2(0),zz_0p3(0) {} + +void contexts_t::push(long arg_zz_0p1,long arg_zz_0p2,long arg_zz_0p3) +{zz_0p1 = arg_zz_0p1;zz_0p2 = arg_zz_0p2;zz_0p3 = arg_zz_0p3;} + +void contexts_t::pop(long &arg_zz_0p1,long &arg_zz_0p2,long &arg_zz_0p3) +{arg_zz_0p1 = zz_0p1;arg_zz_0p2 = zz_0p2;arg_zz_0p3 = zz_0p3;} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf6.--contexts--input(custom).re b/re2c/test/contexts/conf6.--contexts--input(custom).re new file mode 100644 index 00000000..a3cae62f --- /dev/null +++ b/re2c/test/contexts/conf6.--contexts--input(custom).re @@ -0,0 +1,98 @@ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +struct contexts_t +{ + /*!contexts:re2c + line = "long @@;"; + */ + + contexts_t(); + void push(/*!contexts:re2c + line = "long arg_@@"; + sep = ","; + */); + void pop(/*!contexts:re2c + line = "long &arg_@@"; + sep = ","; + */); +}; + +static void lex(const char *s) +{ +#define YYPEEK() *s +#define YYSKIP() ++s +#define YYBACKUP() marker = s +#define YYRESTORE() s = marker +#define YYBACKUPCTX() basectx = s +#define YYRESTORECTX(dist) s = basectx + dist +#define ZZ_CTX(dist) (basectx + dist) +#define ZZ_DIST() (s - basectx) + const char *marker; + const char *basectx; + contexts_t ctxs; + /*!re2c + re2c:define:YYCTYPE = char; + re2c:yyfill:enable = 0; + + re2c:define:YYCTX = "ZZ_CTX"; + re2c:define:YYDIST = "ZZ_DIST"; + re2c:contexts:prefix = "zz_"; + re2c:contexts:expr = "ctxs.@@"; + + oct = [0-9]{1,3}; + d = "."; + + * { printf("error\n"); return; } + + oct @p1 + d oct @p2 + d oct @p3 + d oct { + printf("%u.%u.%u.%u\n", + parse_oct(basectx, @p1), + parse_oct(@p1 + 1, @p2), + parse_oct(@p2 + 1, @p3), + parse_oct(@p3 + 1, s)); + return; + } + */ +} + +contexts_t::contexts_t(): /*!contexts:re2c + line = "@@(0)"; + sep = ","; +*/ {} + +void contexts_t::push(/*!contexts:re2c + line = "long arg_@@"; + sep = ","; +*/) +{/*!contexts:re2c + line = "@@ = arg_@@;"; +*/} + +void contexts_t::pop(/*!contexts:re2c + line = "long &arg_@@"; + sep = ","; +*/) +{/*!contexts:re2c + line = "arg_@@ = @@;"; +*/} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf6.--contexts.c b/re2c/test/contexts/conf6.--contexts.c new file mode 100644 index 00000000..aeb06f8b --- /dev/null +++ b/re2c/test/contexts/conf6.--contexts.c @@ -0,0 +1,289 @@ +/* Generated by re2c */ +#line 1 "contexts/conf6.--contexts.re" +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +struct contexts_t +{ + long zz_0p1;long zz_0p2;long zz_0p3; + + contexts_t(); + void push(long arg_zz_0p1,long arg_zz_0p2,long arg_zz_0p3); + void pop(long &arg_zz_0p1,long &arg_zz_0p2,long &arg_zz_0p3); +}; + +static void lex(const char *YYCURSOR) +{ + const char *YYMARKER; + const char *YYCTXMARKER; + contexts_t ctxs; + +#line 31 "contexts/conf6.--contexts.c" +{ + char yych; + YYCTXMARKER = YYCURSOR; + yych = *YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy4; + default: goto yy2; + } +yy2: + ++YYCURSOR; +yy3: +#line 45 "contexts/conf6.--contexts.re" + { printf("error\n"); return; } +#line 54 "contexts/conf6.--contexts.c" +yy4: + yych = *(YYMARKER = ++YYCURSOR); + ctxs.zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy7; + default: goto yy3; + } +yy5: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy8; + default: goto yy6; + } +yy6: + YYCURSOR = YYMARKER; + goto yy3; +yy7: + yych = *++YYCURSOR; + ctxs.zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy9; + default: goto yy6; + } +yy8: + yych = *++YYCURSOR; + ctxs.zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy11; + default: goto yy6; + } +yy9: + yych = *++YYCURSOR; + ctxs.zz_0p1 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy5; + default: goto yy6; + } +yy10: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy12; + default: goto yy6; + } +yy11: + yych = *++YYCURSOR; + ctxs.zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy13; + default: goto yy6; + } +yy12: + yych = *++YYCURSOR; + ctxs.zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy15; + default: goto yy6; + } +yy13: + yych = *++YYCURSOR; + ctxs.zz_0p2 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy10; + default: goto yy6; + } +yy14: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy16; + default: goto yy6; + } +yy15: + yych = *++YYCURSOR; + ctxs.zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy18; + default: goto yy6; + } +yy16: + ++YYCURSOR; + switch ((yych = *YYCURSOR)) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy19; + default: goto yy17; + } +yy17: +#line 50 "contexts/conf6.--contexts.re" + { + printf("%u.%u.%u.%u\n", + parse_oct(YYCTXMARKER, (YYCTXMARKER + ctxs.zz_0p1)), + parse_oct((YYCTXMARKER + ctxs.zz_0p1) + 1, (YYCTXMARKER + ctxs.zz_0p2)), + parse_oct((YYCTXMARKER + ctxs.zz_0p2) + 1, (YYCTXMARKER + ctxs.zz_0p3)), + parse_oct((YYCTXMARKER + ctxs.zz_0p3) + 1, YYCURSOR)); + return; + } +#line 244 "contexts/conf6.--contexts.c" +yy18: + yych = *++YYCURSOR; + ctxs.zz_0p3 = (YYCURSOR - YYCTXMARKER); + switch (yych) { + case '.': goto yy14; + default: goto yy6; + } +yy19: + yych = *++YYCURSOR; + switch (yych) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy20; + default: goto yy17; + } +yy20: + ++YYCURSOR; + yych = *YYCURSOR; + goto yy17; +} +#line 58 "contexts/conf6.--contexts.re" + +} + +contexts_t::contexts_t(): zz_0p1(0),zz_0p2(0),zz_0p3(0) {} + +void contexts_t::push(long arg_zz_0p1,long arg_zz_0p2,long arg_zz_0p3) +{zz_0p1 = arg_zz_0p1;zz_0p2 = arg_zz_0p2;zz_0p3 = arg_zz_0p3;} + +void contexts_t::pop(long &arg_zz_0p1,long &arg_zz_0p2,long &arg_zz_0p3) +{arg_zz_0p1 = zz_0p1;arg_zz_0p2 = zz_0p2;arg_zz_0p3 = zz_0p3;} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/conf6.--contexts.re b/re2c/test/contexts/conf6.--contexts.re new file mode 100644 index 00000000..9208a5a7 --- /dev/null +++ b/re2c/test/contexts/conf6.--contexts.re @@ -0,0 +1,88 @@ +#include +#include + +static inline unsigned parse_oct(const char *s, const char *e) +{ + unsigned oct = 0; + for (; s != e; ++s) { + oct = oct * 10 + *s - '0'; + } + return oct; +} + +struct contexts_t +{ + /*!contexts:re2c + line = "long @@;"; + */ + + contexts_t(); + void push(/*!contexts:re2c + line = "long arg_@@"; + sep = ","; + */); + void pop(/*!contexts:re2c + line = "long &arg_@@"; + sep = ","; + */); +}; + +static void lex(const char *YYCURSOR) +{ + const char *YYMARKER; + const char *YYCTXMARKER; + contexts_t ctxs; + /*!re2c + re2c:define:YYCTYPE = char; + re2c:yyfill:enable = 0; + + re2c:contexts:prefix = "zz_"; + re2c:contexts:expr = "ctxs.@@"; + + oct = [0-9]{1,3}; + d = "."; + + * { printf("error\n"); return; } + + oct @p1 + d oct @p2 + d oct @p3 + d oct { + printf("%u.%u.%u.%u\n", + parse_oct(YYCTXMARKER, @p1), + parse_oct(@p1 + 1, @p2), + parse_oct(@p2 + 1, @p3), + parse_oct(@p3 + 1, YYCURSOR)); + return; + } + */ +} + +contexts_t::contexts_t(): /*!contexts:re2c + line = "@@(0)"; + sep = ","; +*/ {} + +void contexts_t::push(/*!contexts:re2c + line = "long arg_@@"; + sep = ","; +*/) +{/*!contexts:re2c + line = "@@ = arg_@@;"; +*/} + +void contexts_t::pop(/*!contexts:re2c + line = "long &arg_@@"; + sep = ","; +*/) +{/*!contexts:re2c + line = "arg_@@ = @@;"; +*/} + +int main(int argc, char **argv) +{ + for (int i = 1; i < argc; ++i) { + lex(argv[i]); + } + return 0; +} diff --git a/re2c/test/contexts/dedup0.i--input(custom).c b/re2c/test/contexts/dedup0.i--input(custom).c index bb71067b..e599b115 100644 --- a/re2c/test/contexts/dedup0.i--input(custom).c +++ b/re2c/test/contexts/dedup0.i--input(custom).c @@ -2,7 +2,8 @@ { YYCTYPE yych; - long yyctx0, yyctx2; + long yyctx0; + long yyctx2; YYBACKUPCTX (); if (YYLESSTHAN (3)) YYFILL(3); yych = YYPEEK (); diff --git a/re2c/test/contexts/dedup0.i.c b/re2c/test/contexts/dedup0.i.c index b7832fbe..d6cdb5c2 100644 --- a/re2c/test/contexts/dedup0.i.c +++ b/re2c/test/contexts/dedup0.i.c @@ -2,7 +2,8 @@ { YYCTYPE yych; - long yyctx0, yyctx2; + long yyctx0; + long yyctx2; YYCTXMARKER = YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR; diff --git a/re2c/test/contexts/dedup1.i--input(custom).c b/re2c/test/contexts/dedup1.i--input(custom).c index e2824b59..40b88cf1 100644 --- a/re2c/test/contexts/dedup1.i--input(custom).c +++ b/re2c/test/contexts/dedup1.i--input(custom).c @@ -2,7 +2,8 @@ { YYCTYPE yych; - long yyctx0, yyctx2; + long yyctx0; + long yyctx2; YYBACKUPCTX (); if (YYLESSTHAN (3)) YYFILL(3); yych = YYPEEK (); diff --git a/re2c/test/contexts/dedup1.i.c b/re2c/test/contexts/dedup1.i.c index b11e1e6d..b0901611 100644 --- a/re2c/test/contexts/dedup1.i.c +++ b/re2c/test/contexts/dedup1.i.c @@ -2,7 +2,8 @@ { YYCTYPE yych; - long yyctx0, yyctx2; + long yyctx0; + long yyctx2; YYCTXMARKER = YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR; diff --git a/re2c/test/contexts/dedup2.i--input(custom).c b/re2c/test/contexts/dedup2.i--input(custom).c index b9197eec..6cdc0cb7 100644 --- a/re2c/test/contexts/dedup2.i--input(custom).c +++ b/re2c/test/contexts/dedup2.i--input(custom).c @@ -2,7 +2,8 @@ { YYCTYPE yych; - long yyctx0, yyctx2; + long yyctx0; + long yyctx2; YYBACKUPCTX (); if (YYLESSTHAN (3)) YYFILL(3); yych = YYPEEK (); diff --git a/re2c/test/contexts/dedup2.i.c b/re2c/test/contexts/dedup2.i.c index 3ecae321..09518e22 100644 --- a/re2c/test/contexts/dedup2.i.c +++ b/re2c/test/contexts/dedup2.i.c @@ -2,7 +2,8 @@ { YYCTYPE yych; - long yyctx0, yyctx2; + long yyctx0; + long yyctx2; YYCTXMARKER = YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR; diff --git a/re2c/test/contexts/dedup3.i--input(custom).c b/re2c/test/contexts/dedup3.i--input(custom).c index d35e3d0c..f00ad458 100644 --- a/re2c/test/contexts/dedup3.i--input(custom).c +++ b/re2c/test/contexts/dedup3.i--input(custom).c @@ -2,7 +2,8 @@ { YYCTYPE yych; - long yyctx0, yyctx2; + long yyctx0; + long yyctx2; YYBACKUPCTX (); if (YYLESSTHAN (3)) YYFILL(3); yych = YYPEEK (); diff --git a/re2c/test/contexts/dedup3.i.c b/re2c/test/contexts/dedup3.i.c index 321e3378..c0937ea5 100644 --- a/re2c/test/contexts/dedup3.i.c +++ b/re2c/test/contexts/dedup3.i.c @@ -2,7 +2,8 @@ { YYCTYPE yych; - long yyctx0, yyctx2; + long yyctx0; + long yyctx2; YYCTXMARKER = YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR; diff --git a/re2c/test/contexts/fix3.i--contexts.c b/re2c/test/contexts/fix3.i--contexts.c index a398074b..a1ca6956 100644 --- a/re2c/test/contexts/fix3.i--contexts.c +++ b/re2c/test/contexts/fix3.i--contexts.c @@ -9,7 +9,10 @@ static void lex(const char *YYCURSOR) { char yych; - long yyctx0p1, yyctx0p2, yyctx0p3, yyctx0p4; + long yyctx0p1; + long yyctx0p2; + long yyctx0p3; + long yyctx0p4; YYCTXMARKER = YYCURSOR; yych = *YYCURSOR; yyctx0p4 = yyctx0p3 = yyctx0p2 = yyctx0p1 = (YYCURSOR - YYCTXMARKER); diff --git a/re2c/test/contexts/fix3_trail.i--contexts--input(custom).c b/re2c/test/contexts/fix3_trail.i--contexts--input(custom).c index e0e15012..25b45577 100644 --- a/re2c/test/contexts/fix3_trail.i--contexts--input(custom).c +++ b/re2c/test/contexts/fix3_trail.i--contexts--input(custom).c @@ -9,7 +9,10 @@ static void lex(const char *YYCURSOR) { char yych; - long yyctx0, yyctx0p1, yyctx0p2, yyctx0p3; + long yyctx0; + long yyctx0p1; + long yyctx0p2; + long yyctx0p3; YYBACKUPCTX (); yych = YYPEEK (); yyctx0 = yyctx0p3 = yyctx0p2 = yyctx0p1 = YYDIST(); diff --git a/re2c/test/contexts/fix3_trail.i--contexts.c b/re2c/test/contexts/fix3_trail.i--contexts.c index 7a6ed560..2cc5c548 100644 --- a/re2c/test/contexts/fix3_trail.i--contexts.c +++ b/re2c/test/contexts/fix3_trail.i--contexts.c @@ -9,7 +9,10 @@ static void lex(const char *YYCURSOR) { char yych; - long yyctx0, yyctx0p1, yyctx0p2, yyctx0p3; + long yyctx0; + long yyctx0p1; + long yyctx0p2; + long yyctx0p3; YYCTXMARKER = YYCURSOR; yych = *YYCURSOR; yyctx0 = yyctx0p3 = yyctx0p2 = yyctx0p1 = (YYCURSOR - YYCTXMARKER); diff --git a/re2c/test/contexts/fix4.i--contexts.c b/re2c/test/contexts/fix4.i--contexts.c index 24e9d915..d6273511 100644 --- a/re2c/test/contexts/fix4.i--contexts.c +++ b/re2c/test/contexts/fix4.i--contexts.c @@ -9,7 +9,8 @@ static void lex(const char *YYCURSOR) { char yych; - long yyctx0p1, yyctx0p3; + long yyctx0p1; + long yyctx0p3; YYCTXMARKER = YYCURSOR; yych = *YYCURSOR; switch (yych) { diff --git a/re2c/test/contexts/fix4_trail.i--contexts--input(custom).c b/re2c/test/contexts/fix4_trail.i--contexts--input(custom).c index 64998191..1e649a20 100644 --- a/re2c/test/contexts/fix4_trail.i--contexts--input(custom).c +++ b/re2c/test/contexts/fix4_trail.i--contexts--input(custom).c @@ -9,7 +9,8 @@ static void lex(const char *YYCURSOR) { char yych; - long yyctx0p1, yyctx0p3; + long yyctx0p1; + long yyctx0p3; YYBACKUPCTX (); yych = YYPEEK (); switch (yych) { diff --git a/re2c/test/contexts/fix4_trail.i--contexts.c b/re2c/test/contexts/fix4_trail.i--contexts.c index dde3ed48..20ab25ac 100644 --- a/re2c/test/contexts/fix4_trail.i--contexts.c +++ b/re2c/test/contexts/fix4_trail.i--contexts.c @@ -9,7 +9,8 @@ static void lex(const char *YYCURSOR) { char yych; - long yyctx0p1, yyctx0p3; + long yyctx0p1; + long yyctx0p3; YYCTXMARKER = YYCURSOR; yych = *YYCURSOR; switch (yych) { diff --git a/re2c/test/contexts/fix5.i--contexts.c b/re2c/test/contexts/fix5.i--contexts.c index dd8d5b9c..d0315145 100644 --- a/re2c/test/contexts/fix5.i--contexts.c +++ b/re2c/test/contexts/fix5.i--contexts.c @@ -9,7 +9,8 @@ static void lex(const char *YYCURSOR) { char yych; - long yyctx0p2, yyctx0p4; + long yyctx0p2; + long yyctx0p4; YYCTXMARKER = YYCURSOR; yych = *YYCURSOR; switch (yych) { diff --git a/re2c/test/contexts/fix5_trail.i--contexts--input(custom).c b/re2c/test/contexts/fix5_trail.i--contexts--input(custom).c index 2b63b35c..d4880679 100644 --- a/re2c/test/contexts/fix5_trail.i--contexts--input(custom).c +++ b/re2c/test/contexts/fix5_trail.i--contexts--input(custom).c @@ -9,7 +9,8 @@ static void lex(const char *YYCURSOR) { char yych; - long yyctx0, yyctx0p2; + long yyctx0; + long yyctx0p2; YYBACKUPCTX (); yych = YYPEEK (); switch (yych) { diff --git a/re2c/test/contexts/fix5_trail.i--contexts.c b/re2c/test/contexts/fix5_trail.i--contexts.c index 31dd629e..eb372d70 100644 --- a/re2c/test/contexts/fix5_trail.i--contexts.c +++ b/re2c/test/contexts/fix5_trail.i--contexts.c @@ -9,7 +9,8 @@ static void lex(const char *YYCURSOR) { char yych; - long yyctx0, yyctx0p2; + long yyctx0; + long yyctx0p2; YYCTXMARKER = YYCURSOR; yych = *YYCURSOR; switch (yych) { diff --git a/re2c/test/contexts/fix5_trail_conf.i--contexts--input(custom).c b/re2c/test/contexts/fix5_trail_conf.i--contexts--input(custom).c deleted file mode 100644 index 313edf96..00000000 --- a/re2c/test/contexts/fix5_trail_conf.i--contexts--input(custom).c +++ /dev/null @@ -1,111 +0,0 @@ -/* Generated by re2c */ -#include -#include - -static void lex(const char *cursor) -{ -# define YYPEEK() *cursor -# define YYSKIP() ++cursor -# define YYBACKUP() marker = cursor -# define YYBACKUPCTX() ctxmarker = cursor -# define YYRESTORE() cursor = marker -# define YYRESTORECTX(dist) cursor = ctxmarker + dist -# define ZZZ_DIST() (cursor - ctxmarker) -# define ZZZ_CTX(dist) (ctxmarker + dist) - const char *marker; - const char *ctxmarker; - -{ - char yych; - ptrdiff_t zzz_0, zzz_0p2; - YYBACKUPCTX (); - yych = YYPEEK (); - switch (yych) { - case '0': goto yy4; - case '1': goto yy5; - default: goto yy2; - } -yy2: - YYSKIP (); -yy3: - { printf("error\n"); return; } -yy4: - YYSKIP (); - YYBACKUP (); - yych = YYPEEK (); - switch (yych) { - case '0': - case '1': goto yy7; - default: goto yy3; - } -yy5: - YYSKIP (); - YYBACKUP (); - yych = YYPEEK (); - zzz_0p2 = ZZZ_DIST(); - switch (yych) { - case '2': - case '3': goto yy11; - default: goto yy3; - } -yy6: - YYSKIP (); - yych = YYPEEK (); -yy7: - switch (yych) { - case '0': goto yy6; - case '1': goto yy9; - default: goto yy8; - } -yy8: - YYRESTORE (); - goto yy3; -yy9: - YYSKIP (); - yych = YYPEEK (); - zzz_0p2 = ZZZ_DIST(); - goto yy11; -yy10: - YYSKIP (); - yych = YYPEEK (); -yy11: - switch (yych) { - case '2': goto yy10; - case '3': goto yy12; - default: goto yy8; - } -yy12: - YYSKIP (); - zzz_0 = ZZZ_DIST(); - yych = YYPEEK (); - goto yy15; -yy13: - YYRESTORECTX (zzz_0); - { - printf("'%.*s', '%.*s', '%.*s', '%.*s', '%s'\n", - ZZZ_CTX((zzz_0p2 - 1)) - ctxmarker, ctxmarker, - ZZZ_CTX(zzz_0p2) - ZZZ_CTX((zzz_0p2 - 1)), ZZZ_CTX((zzz_0p2 - 1)), - ZZZ_CTX((zzz_0 - 1)) - ZZZ_CTX(zzz_0p2), ZZZ_CTX(zzz_0p2), - cursor - ZZZ_CTX((zzz_0 - 1)), ZZZ_CTX((zzz_0 - 1)), - cursor); - return; - } -yy14: - YYSKIP (); - yych = YYPEEK (); -yy15: - switch (yych) { - case '4': goto yy14; - default: goto yy13; - } -} - -} - -int main(int argc, char **argv) -{ - for (int i = 1; i < argc; ++i) { - lex(argv[i]); - } - return 0; -} diff --git a/re2c/test/contexts/fix5_trail_conf.i--contexts--input(custom).re b/re2c/test/contexts/fix5_trail_conf.i--contexts--input(custom).re deleted file mode 100644 index 6bd815df..00000000 --- a/re2c/test/contexts/fix5_trail_conf.i--contexts--input(custom).re +++ /dev/null @@ -1,47 +0,0 @@ -#include -#include - -static void lex(const char *cursor) -{ -# define YYPEEK() *cursor -# define YYSKIP() ++cursor -# define YYBACKUP() marker = cursor -# define YYBACKUPCTX() ctxmarker = cursor -# define YYRESTORE() cursor = marker -# define YYRESTORECTX(dist) cursor = ctxmarker + dist -# define ZZZ_DIST() (cursor - ctxmarker) -# define ZZZ_CTX(dist) (ctxmarker + dist) - const char *marker; - const char *ctxmarker; - /*!re2c - re2c:define:YYCTYPE = char; - re2c:yyfill:enable = 0; - re2c:define:YYCTX = "ZZZ_CTX"; - re2c:define:YYDIST = "ZZZ_DIST"; - re2c:define:YYDISTTYPE = ptrdiff_t; - re2c:ctxprefix = "zzz_"; - - * { printf("error\n"); return; } - "0"* - @p1 "1" - @p2 "2"* - @p3 "3" - / "4"* { - printf("'%.*s', '%.*s', '%.*s', '%.*s', '%s'\n", - @p1 - ctxmarker, ctxmarker, - @p2 - @p1, @p1, - @p3 - @p2, @p2, - cursor - @p3, @p3, - cursor); - return; - } - */ -} - -int main(int argc, char **argv) -{ - for (int i = 1; i < argc; ++i) { - lex(argv[i]); - } - return 0; -} diff --git a/re2c/test/contexts/fix5_trail_conf.i--contexts.c b/re2c/test/contexts/fix5_trail_conf.i--contexts.c deleted file mode 100644 index 82c63a32..00000000 --- a/re2c/test/contexts/fix5_trail_conf.i--contexts.c +++ /dev/null @@ -1,98 +0,0 @@ -/* Generated by re2c */ -#include -#include - -static void lex(const char *YYCURSOR) -{ - const char *YYMARKER; - const char *YYCTXMARKER; - -{ - char yych; - ptrdiff_t zzz_0, zzz_0p2; - YYCTXMARKER = YYCURSOR; - yych = *YYCURSOR; - switch (yych) { - case '0': goto yy4; - case '1': goto yy5; - default: goto yy2; - } -yy2: - ++YYCURSOR; -yy3: - { printf("error\n"); return; } -yy4: - yych = *(YYMARKER = ++YYCURSOR); - switch (yych) { - case '0': - case '1': goto yy7; - default: goto yy3; - } -yy5: - yych = *(YYMARKER = ++YYCURSOR); - zzz_0p2 = (YYCURSOR - YYCTXMARKER); - switch (yych) { - case '2': - case '3': goto yy11; - default: goto yy3; - } -yy6: - ++YYCURSOR; - yych = *YYCURSOR; -yy7: - switch (yych) { - case '0': goto yy6; - case '1': goto yy9; - default: goto yy8; - } -yy8: - YYCURSOR = YYMARKER; - goto yy3; -yy9: - yych = *++YYCURSOR; - zzz_0p2 = (YYCURSOR - YYCTXMARKER); - goto yy11; -yy10: - ++YYCURSOR; - yych = *YYCURSOR; -yy11: - switch (yych) { - case '2': goto yy10; - case '3': goto yy12; - default: goto yy8; - } -yy12: - ++YYCURSOR; - zzz_0 = (YYCURSOR - YYCTXMARKER); - yych = *YYCURSOR; - goto yy15; -yy13: - YYCURSOR = YYCTXMARKER + zzz_0; - { - printf("'%.*s', '%.*s', '%.*s', '%.*s', '%s'\n", - (YYCTXMARKER + (zzz_0p2 - 1)) - YYCTXMARKER, YYCTXMARKER, - (YYCTXMARKER + zzz_0p2) - (YYCTXMARKER + (zzz_0p2 - 1)), (YYCTXMARKER + (zzz_0p2 - 1)), - (YYCTXMARKER + (zzz_0 - 1)) - (YYCTXMARKER + zzz_0p2), (YYCTXMARKER + zzz_0p2), - YYCURSOR - (YYCTXMARKER + (zzz_0 - 1)), (YYCTXMARKER + (zzz_0 - 1)), - YYCURSOR); - return; - } -yy14: - ++YYCURSOR; - yych = *YYCURSOR; -yy15: - switch (yych) { - case '4': goto yy14; - default: goto yy13; - } -} - -} - -int main(int argc, char **argv) -{ - for (int i = 1; i < argc; ++i) { - lex(argv[i]); - } - return 0; -} diff --git a/re2c/test/contexts/fix5_trail_conf.i--contexts.re b/re2c/test/contexts/fix5_trail_conf.i--contexts.re deleted file mode 100644 index e0723095..00000000 --- a/re2c/test/contexts/fix5_trail_conf.i--contexts.re +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include - -static void lex(const char *YYCURSOR) -{ - const char *YYMARKER; - const char *YYCTXMARKER; - /*!re2c - re2c:define:YYCTYPE = char; - re2c:yyfill:enable = 0; - re2c:define:YYDISTTYPE = ptrdiff_t; - re2c:ctxprefix = "zzz_"; - - * { printf("error\n"); return; } - "0"* - @p1 "1" - @p2 "2"* - @p3 "3" - / "4"* { - printf("'%.*s', '%.*s', '%.*s', '%.*s', '%s'\n", - @p1 - YYCTXMARKER, YYCTXMARKER, - @p2 - @p1, @p1, - @p3 - @p2, @p2, - YYCURSOR - @p3, @p3, - YYCURSOR); - return; - } - */ -} - -int main(int argc, char **argv) -{ - for (int i = 1; i < argc; ++i) { - lex(argv[i]); - } - return 0; -} diff --git a/re2c/test/contexts/overlap.i--input(custom).c b/re2c/test/contexts/overlap.i--input(custom).c index ffcdaa38..4fb716a4 100644 --- a/re2c/test/contexts/overlap.i--input(custom).c +++ b/re2c/test/contexts/overlap.i--input(custom).c @@ -2,7 +2,8 @@ { YYCTYPE yych; - long yyctx0, yyctx1; + long yyctx0; + long yyctx1; YYBACKUPCTX (); if (YYLESSTHAN (3)) YYFILL(3); yych = YYPEEK (); diff --git a/re2c/test/contexts/overlap.i.c b/re2c/test/contexts/overlap.i.c index dd49a9cc..11440770 100644 --- a/re2c/test/contexts/overlap.i.c +++ b/re2c/test/contexts/overlap.i.c @@ -2,7 +2,8 @@ { YYCTYPE yych; - long yyctx0, yyctx1; + long yyctx0; + long yyctx1; YYCTXMARKER = YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = *YYCURSOR;