From df3949c6ee4864ccd84b9cc3c68effc437d3d0b4 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Tue, 25 Dec 2018 19:53:23 +0000 Subject: [PATCH] Added /*!include:re2c ... */ directive. --- re2c/bootstrap/src/ast/lex.cc | 2901 ++++++++++++++++++--------------- re2c/bootstrap/src/ast/lex.h | 8 +- re2c/src/ast/input.cc | 9 +- re2c/src/ast/input.h | 2 + re2c/src/ast/lex.re | 24 +- re2c/src/ast/scanner.cc | 102 +- re2c/src/ast/scanner.h | 48 +- 7 files changed, 1690 insertions(+), 1404 deletions(-) diff --git a/re2c/bootstrap/src/ast/lex.cc b/re2c/bootstrap/src/ast/lex.cc index c06bbee5..743be3d5 100644 --- a/re2c/bootstrap/src/ast/lex.cc +++ b/re2c/bootstrap/src/ast/lex.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 1.1.1 on Sun Dec 23 19:24:34 2018 */ +/* Generated by re2c 1.1.1 on Tue Dec 25 19:04:05 2018 */ #line 1 "../src/ast/lex.re" #include "src/util/c99_stdint.h" #include @@ -103,7 +103,7 @@ echo: } } ++YYCURSOR; -#line 203 "../src/ast/lex.re" +#line 209 "../src/ast/lex.re" { if (!is_eof()) goto echo; out.wraw(tok, ptr); @@ -113,7 +113,7 @@ echo: yy4: ++YYCURSOR; yy5: -#line 221 "../src/ast/lex.re" +#line 227 "../src/ast/lex.re" { goto echo; } #line 119 "src/ast/lex.cc" yy6: @@ -124,7 +124,7 @@ yy6: } if (yych == '#') goto yy14; yy7: -#line 215 "../src/ast/lex.re" +#line 221 "../src/ast/lex.re" { cline++; pos = cur; @@ -215,344 +215,345 @@ yy23: yy24: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'g') goto yy33; + if (yych == 'n') goto yy34; goto yy13; yy25: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy34; - if (yych == 't') goto yy35; + if (yych == 'a') goto yy35; + if (yych == 't') goto yy36; goto yy13; yy26: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy36; - if (yych == 'u') goto yy37; + if (yych == 'e') goto yy37; + if (yych == 'u') goto yy38; goto yy13; yy27: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy38; + if (yych == 't') goto yy39; goto yy13; yy28: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'y') goto yy39; + if (yych == 'y') goto yy40; goto yy13; yy29: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy40; + if (yych == 's') goto yy41; goto yy13; yy30: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy41; + if (yych == 'e') goto yy42; goto yy13; yy31: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy42; + if (yych == 't') goto yy43; goto yy13; yy32: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy43; + if (yych == 'a') goto yy44; goto yy13; yy33: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy44; + if (yych == 'n') goto yy45; goto yy13; yy34: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'x') goto yy45; + if (yych == 'c') goto yy46; goto yy13; yy35: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy46; + if (yych == 'x') goto yy47; goto yy13; yy36: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy47; + if (yych == 'a') goto yy48; goto yy13; yy37: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'l') goto yy48; + if (yych == '2') goto yy49; goto yy13; yy38: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy49; + if (yych == 'l') goto yy50; goto yy13; yy39: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'p') goto yy50; + if (yych == 'a') goto yy51; goto yy13; yy40: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy51; + if (yych == 'p') goto yy52; goto yy13; yy41: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '0') goto yy53; - if (yych <= '9') goto yy13; - goto yy53; + if (yych == 'e') goto yy53; + goto yy13; yy42: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy54; - goto yy13; + if (yych <= '0') goto yy55; + if (yych <= '9') goto yy13; + goto yy55; yy43: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'd') goto yy55; + if (yych == 's') goto yy56; goto yy13; yy44: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy56; + if (yych == 'd') goto yy57; goto yy13; yy45: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy57; - if (yych == 'n') goto yy58; + if (yych == 'o') goto yy58; goto yy13; yy46: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'g') goto yy59; + if (yych == 'l') goto yy59; goto yy13; yy47: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy16; + if (yych == ':') goto yy60; + if (yych == 'n') goto yy61; goto yy13; yy48: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy60; + if (yych == 'g') goto yy62; goto yy13; yy49: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'g') goto yy61; + if (yych == 'c') goto yy16; goto yy13; yy50: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy62; + if (yych == 'e') goto yy63; goto yy13; yy51: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy63; + if (yych == 'g') goto yy64; goto yy13; yy52: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy65; + goto yy13; +yy53: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == ':') goto yy66; + goto yy13; +yy54: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy53: +yy55: if (yych <= 0x1F) { - if (yych == '\t') goto yy52; + if (yych == '\t') goto yy54; goto yy13; } else { - if (yych <= ' ') goto yy52; + if (yych <= ' ') goto yy54; if (yych <= '0') goto yy13; if (yych <= '9') { yyt1 = YYCURSOR; - goto yy64; + goto yy67; } goto yy13; } -yy54: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy66; - goto yy13; -yy55: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy67; - goto yy13; yy56: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy68; + if (yych == 't') goto yy69; goto yy13; yy57: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy69; + if (yych == 'e') goto yy70; goto yy13; yy58: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'm') goto yy70; + if (yych == 'r') goto yy71; goto yy13; yy59: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy71; + if (yych == 'u') goto yy72; goto yy13; yy60: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy72; + if (yych == 'r') goto yy73; goto yy13; yy61: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy73; + if (yych == 'm') goto yy74; goto yy13; yy62: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy74; + if (yych == 's') goto yy75; goto yy13; yy63: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy75; + if (yych == 's') goto yy76; goto yy13; yy64: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 's') goto yy77; + goto yy13; +yy65: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 's') goto yy78; + goto yy13; +yy66: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'r') goto yy79; + goto yy13; +yy67: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 64) { - goto yy64; + goto yy67; } if (yych <= '\f') { if (yych <= 0x08) goto yy13; - if (yych <= '\t') goto yy76; - if (yych <= '\n') goto yy78; + if (yych <= '\t') goto yy80; + if (yych <= '\n') goto yy82; goto yy13; } else { - if (yych <= '\r') goto yy80; - if (yych == ' ') goto yy76; + if (yych <= '\r') goto yy84; + if (yych == ' ') goto yy80; goto yy13; } -yy66: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy81; - goto yy13; -yy67: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy82; - goto yy13; -yy68: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy83; - goto yy13; yy69: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy84; + if (yych == 'a') goto yy85; goto yy13; yy70: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy85; + if (yych == 'r') goto yy86; goto yy13; yy71: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy86; + if (yych == 'e') goto yy87; goto yy13; yy72: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy87; + if (yych == 'd') goto yy88; goto yy13; yy73: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy88; + if (yych == 'e') goto yy89; goto yy13; yy74: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy89; + if (yych == 'a') goto yy90; goto yy13; yy75: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy90; + if (yych == ':') goto yy91; goto yy13; yy76: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == ':') goto yy92; + goto yy13; +yy77: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == ':') goto yy93; + goto yy13; +yy78: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == ':') goto yy94; + goto yy13; +yy79: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy95; + goto yy13; +yy80: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy76; + if (yych == '\t') goto yy80; goto yy13; } else { - if (yych <= ' ') goto yy76; - if (yych == '"') goto yy91; + if (yych <= ' ') goto yy80; + if (yych == '"') goto yy96; goto yy13; } -yy78: +yy82: ++YYCURSOR; YYCURSOR = yyt1; -#line 209 "../src/ast/lex.re" +#line 215 "../src/ast/lex.re" { out.wraw(tok, ptr + 1); set_sourceline(); goto echo; } -#line 467 "src/ast/lex.cc" -yy80: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy78; - goto yy13; -yy81: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy93; - goto yy13; -yy82: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy94; - goto yy13; -yy83: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy95; - goto yy13; +#line 484 "src/ast/lex.cc" yy84: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy96; + if (yych == '\n') goto yy82; goto yy13; yy85: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy97; + if (yych == 't') goto yy98; goto yy13; yy86: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy98; + if (yych == ':') goto yy99; goto yy13; yy87: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy99; + if (yych == ':') goto yy100; goto yy13; yy88: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy100; + if (yych == 'e') goto yy101; goto yy13; yy89: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy101; + if (yych == '2') goto yy102; goto yy13; yy90: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy102; + if (yych == 't') goto yy103; goto yy13; yy91: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); - yych = (YYCTYPE)*YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy91; - } - if (yych <= '\n') goto yy13; - if (yych <= '"') goto yy103; - goto yy104; -yy93: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy105; + if (yych == 'r') goto yy104; goto yy13; -yy94: +yy92: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy106; + if (yych == 'r') goto yy105; goto yy13; -yy95: +yy93: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy107; + if (yych == 'r') goto yy106; goto yy13; -yy96: +yy94: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy108; + if (yych == 'r') goto yy107; goto yy13; -yy97: +yy95: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy110; + if (yych == '2') goto yy108; goto yy13; +yy96: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy96; + } + if (yych <= '\n') goto yy13; + if (yych <= '"') goto yy109; + goto yy110; yy98: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy111; goto yy13; yy99: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy112; + if (yych == 'r') goto yy112; goto yy13; yy100: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy113; + if (yych == 'r') goto yy113; goto yy13; yy101: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy114; + if (yych == ':') goto yy114; goto yy13; yy102: yych = (YYCTYPE)*++YYCURSOR; @@ -560,115 +561,151 @@ yy102: goto yy13; yy103: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy78; - if (yych == '\r') goto yy80; + if (yych == 'c') goto yy117; goto yy13; yy104: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x00) goto yy13; - if (yych == '\n') goto yy13; - goto yy91; + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy118; + goto yy13; yy105: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy117; + if (yych == 'e') goto yy119; goto yy13; yy106: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy118; + if (yych == 'e') goto yy120; goto yy13; yy107: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy119; + if (yych == 'e') goto yy121; goto yy13; yy108: - ++YYCURSOR; -#line 145 "../src/ast/lex.re" - { - out.wraw(tok, ptr); - out.wdelay_yymaxfill(); - lex_end_of_comment(out); - goto echo; - } -#line 595 "src/ast/lex.cc" -yy110: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'h') goto yy120; + if (yych == 'c') goto yy122; + goto yy13; +yy109: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == '\n') goto yy82; + if (yych == '\r') goto yy84; goto yy13; +yy110: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= 0x00) goto yy13; + if (yych == '\n') goto yy13; + goto yy96; yy111: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy121; + if (yych == ':') goto yy124; goto yy13; yy112: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy122; + if (yych == 'e') goto yy125; goto yy13; yy113: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy123; + if (yych == 'e') goto yy126; goto yy13; yy114: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy124; + if (yych == 'r') goto yy127; goto yy13; yy115: ++YYCURSOR; -#line 134 "../src/ast/lex.re" +#line 145 "../src/ast/lex.re" { out.wraw(tok, ptr); - return Reuse; + out.wdelay_yymaxfill(); + lex_end_of_comment(out); + goto echo; } -#line 623 "src/ast/lex.cc" +#line 624 "src/ast/lex.cc" yy117: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy125; + if (yych == 'h') goto yy128; goto yy13; yy118: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy126; + if (yych == '2') goto yy129; goto yy13; yy119: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy127; + if (yych == '2') goto yy130; goto yy13; yy120: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy128; + if (yych == '2') goto yy131; goto yy13; yy121: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy129; + if (yych == '2') goto yy132; goto yy13; yy122: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy131; - goto yy13; -yy123: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy133; - goto yy13; + ++YYCURSOR; +#line 134 "../src/ast/lex.re" + { + out.wraw(tok, ptr); + return Reuse; + } +#line 652 "src/ast/lex.cc" yy124: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy135; + if (yych == 'r') goto yy133; goto yy13; yy125: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy137; + if (yych == '2') goto yy134; goto yy13; yy126: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy138; + if (yych == '2') goto yy135; goto yy13; yy127: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy139; + if (yych == 'e') goto yy136; goto yy13; yy128: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy141; + if (yych == ':') goto yy137; goto yy13; yy129: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'c') goto yy138; + goto yy13; +yy130: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'c') goto yy140; + goto yy13; +yy131: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'c') goto yy142; + goto yy13; +yy132: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'c') goto yy144; + goto yy13; +yy133: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy146; + goto yy13; +yy134: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'c') goto yy147; + goto yy13; +yy135: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'c') goto yy148; + goto yy13; +yy136: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == '2') goto yy150; + goto yy13; +yy137: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'r') goto yy151; + goto yy13; +yy138: ++YYCURSOR; #line 181 "../src/ast/lex.re" { @@ -676,16 +713,16 @@ yy129: lex_tags(out, true); goto echo; } -#line 680 "src/ast/lex.cc" -yy131: +#line 717 "src/ast/lex.cc" +yy140: ++YYCURSOR; #line 129 "../src/ast/lex.re" { out.wraw(tok, ptr); return Rules; } -#line 688 "src/ast/lex.cc" -yy133: +#line 725 "src/ast/lex.cc" +yy142: ++YYCURSOR; #line 175 "../src/ast/lex.re" { @@ -693,8 +730,8 @@ yy133: lex_tags(out, false); goto echo; } -#line 697 "src/ast/lex.cc" -yy135: +#line 734 "src/ast/lex.cc" +yy144: ++YYCURSOR; #line 166 "../src/ast/lex.re" { @@ -705,16 +742,16 @@ yy135: lex_end_of_comment(out); goto echo; } -#line 709 "src/ast/lex.cc" -yy137: +#line 746 "src/ast/lex.cc" +yy146: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy142; + if (yych == '2') goto yy152; goto yy13; -yy138: +yy147: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy143; + if (yych == ':') goto yy153; goto yy13; -yy139: +yy148: ++YYCURSOR; #line 139 "../src/ast/lex.re" { @@ -722,24 +759,37 @@ yy139: lex_end_of_comment(out); goto echo; } -#line 726 "src/ast/lex.cc" -yy141: +#line 763 "src/ast/lex.cc" +yy150: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy144; + if (yych == 'c') goto yy154; goto yy13; -yy142: +yy151: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy145; + if (yych == 'e') goto yy156; goto yy13; -yy143: +yy152: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy147; + if (yych == 'c') goto yy157; goto yy13; -yy144: +yy153: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'o') goto yy159; + goto yy13; +yy154: + ++YYCURSOR; +#line 203 "../src/ast/lex.re" + { + out.wraw(tok, ptr); + lex_include(); + goto echo; + } +#line 788 "src/ast/lex.cc" +yy156: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy148; + if (yych == '2') goto yy160; goto yy13; -yy145: +yy157: ++YYCURSOR; #line 159 "../src/ast/lex.re" { @@ -748,21 +798,21 @@ yy145: lex_end_of_comment(out); goto echo; } -#line 752 "src/ast/lex.cc" -yy147: +#line 802 "src/ast/lex.cc" +yy159: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'f') goto yy149; - if (yych == 'n') goto yy150; + if (yych == 'f') goto yy161; + if (yych == 'n') goto yy162; goto yy13; -yy148: +yy160: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy152; + if (yych == 'c') goto yy164; goto yy13; -yy149: +yy161: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'f') goto yy154; + if (yych == 'f') goto yy166; goto yy13; -yy150: +yy162: ++YYCURSOR; #line 187 "../src/ast/lex.re" { @@ -772,8 +822,8 @@ yy150: lex_end_of_comment(out); goto echo; } -#line 776 "src/ast/lex.cc" -yy152: +#line 826 "src/ast/lex.cc" +yy164: ++YYCURSOR; #line 152 "../src/ast/lex.re" { @@ -782,8 +832,8 @@ yy152: lex_end_of_comment(out); goto echo; } -#line 786 "src/ast/lex.cc" -yy154: +#line 836 "src/ast/lex.cc" +yy166: ++YYCURSOR; #line 195 "../src/ast/lex.re" { @@ -793,9 +843,9 @@ yy154: lex_end_of_comment(out); goto echo; } -#line 797 "src/ast/lex.cc" +#line 847 "src/ast/lex.cc" } -#line 222 "../src/ast/lex.re" +#line 228 "../src/ast/lex.re" } @@ -803,45 +853,45 @@ void Scanner::lex_end_of_comment(Output &out) { uint32_t ignored = 0; for (;;) { -#line 807 "src/ast/lex.cc" +#line 857 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\f') { - if (yych <= 0x00) goto yy158; - if (yych == '\n') goto yy162; - goto yy160; + if (yych <= 0x00) goto yy170; + if (yych == '\n') goto yy174; + goto yy172; } else { - if (yych <= '\r') goto yy164; - if (yych == '*') goto yy165; - goto yy160; + if (yych <= '\r') goto yy176; + if (yych == '*') goto yy177; + goto yy172; } -yy158: +yy170: ++YYCURSOR; -#line 229 "../src/ast/lex.re" +#line 235 "../src/ast/lex.re" { fatal_lc(get_cline(), get_column(), "expected end of block"); } -#line 825 "src/ast/lex.cc" -yy160: +#line 875 "src/ast/lex.cc" +yy172: ++YYCURSOR; -yy161: -#line 231 "../src/ast/lex.re" +yy173: +#line 237 "../src/ast/lex.re" { continue; } -#line 831 "src/ast/lex.cc" -yy162: +#line 881 "src/ast/lex.cc" +yy174: ++YYCURSOR; -#line 232 "../src/ast/lex.re" +#line 238 "../src/ast/lex.re" { ++ignored; continue; } -#line 836 "src/ast/lex.cc" -yy164: +#line 886 "src/ast/lex.cc" +yy176: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy162; - goto yy161; -yy165: + if (yych == '\n') goto yy174; + goto yy173; +yy177: yych = (YYCTYPE)*++YYCURSOR; - if (yych != '/') goto yy161; + if (yych != '/') goto yy173; ++YYCURSOR; -#line 233 "../src/ast/lex.re" +#line 239 "../src/ast/lex.re" { if (ignored > 0) { cline += ignored; @@ -850,17 +900,156 @@ yy165: tok = pos = cur; return; } -#line 854 "src/ast/lex.cc" +#line 904 "src/ast/lex.cc" } -#line 241 "../src/ast/lex.re" +#line 247 "../src/ast/lex.re" } } +void Scanner::lex_include() +{ + const char *x, *y; + +#line 914 "src/ast/lex.cc" +{ + YYCTYPE yych; + static const unsigned char yybm[] = { + 0, 128, 128, 128, 128, 128, 128, 128, + 128, 192, 0, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 192, 128, 0, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 0, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + }; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = (YYCTYPE)*YYCURSOR; + if (yych == '\t') goto yy184; + if (yych == ' ') goto yy184; + ++YYCURSOR; +yy183: +#line 254 "../src/ast/lex.re" + { + fatal_lc(get_cline(), get_column() + , "syntax error in include directive"); + } +#line 962 "src/ast/lex.cc" +yy184: + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yybm[0+yych] & 64) { + goto yy185; + } + if (yych == '"') { + yyt1 = YYCURSOR; + goto yy188; + } + goto yy183; +yy185: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 64) { + goto yy185; + } + if (yych == '"') { + yyt1 = YYCURSOR; + goto yy188; + } +yy187: + YYCURSOR = YYMARKER; + goto yy183; +yy188: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy188; + } + if (yych <= '\n') goto yy187; + if (yych >= '#') goto yy191; + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 0x1F) { + if (yych == '\t') { + yyt2 = YYCURSOR; + goto yy192; + } + goto yy187; + } else { + if (yych <= ' ') { + yyt2 = YYCURSOR; + goto yy192; + } + if (yych == '*') { + yyt2 = YYCURSOR; + goto yy194; + } + goto yy187; + } +yy191: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= 0x00) goto yy187; + if (yych == '\n') goto yy187; + goto yy188; +yy192: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= 0x1F) { + if (yych == '\t') goto yy192; + goto yy187; + } else { + if (yych <= ' ') goto yy192; + if (yych != '*') goto yy187; + } +yy194: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != '/') goto yy187; + ++YYCURSOR; + x = yyt1; + y = yyt2; +#line 259 "../src/ast/lex.re" + { + push_file(std::string(x + 1, static_cast(y - x) - 2)); + return; + } +#line 1043 "src/ast/lex.cc" +} +#line 263 "../src/ast/lex.re" + +} + void Scanner::lex_tags(Output &out, bool mtags) { std::string fmt, sep; for (;;) { -#line 864 "src/ast/lex.cc" +#line 1053 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -900,119 +1089,119 @@ void Scanner::lex_tags(Output &out, bool mtags) if ((YYLIMIT - YYCURSOR) < 9) YYFILL(9); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy172; + goto yy201; } if (yych <= ')') { if (yych <= '\n') { - if (yych >= '\t') goto yy175; + if (yych >= '\t') goto yy204; } else { - if (yych == '\r') goto yy177; + if (yych == '\r') goto yy206; } } else { if (yych <= 'f') { - if (yych <= '*') goto yy178; - if (yych >= 'f') goto yy179; + if (yych <= '*') goto yy207; + if (yych >= 'f') goto yy208; } else { - if (yych == 's') goto yy180; + if (yych == 's') goto yy209; } } ++YYCURSOR; -yy171: -#line 248 "../src/ast/lex.re" +yy200: +#line 270 "../src/ast/lex.re" { fatal_lc(get_cline(), get_column(), "unrecognized configuration"); } -#line 924 "src/ast/lex.cc" -yy172: +#line 1113 "src/ast/lex.cc" +yy201: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy172; + goto yy201; } -#line 253 "../src/ast/lex.re" +#line 275 "../src/ast/lex.re" { continue; } -#line 934 "src/ast/lex.cc" -yy175: +#line 1123 "src/ast/lex.cc" +yy204: ++YYCURSOR; -#line 254 "../src/ast/lex.re" +#line 276 "../src/ast/lex.re" { ++cline; continue; } -#line 939 "src/ast/lex.cc" -yy177: +#line 1128 "src/ast/lex.cc" +yy206: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy175; - goto yy171; -yy178: + if (yych == '\n') goto yy204; + goto yy200; +yy207: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '/') goto yy181; - goto yy171; -yy179: + if (yych == '/') goto yy210; + goto yy200; +yy208: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'o') goto yy183; - goto yy171; -yy180: + if (yych == 'o') goto yy212; + goto yy200; +yy209: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'e') goto yy185; - goto yy171; -yy181: + if (yych == 'e') goto yy214; + goto yy200; +yy210: ++YYCURSOR; -#line 255 "../src/ast/lex.re" +#line 277 "../src/ast/lex.re" { out.wdelay_tags(new ConfTags(fmt, sep), mtags); tok = pos = cur; return; } -#line 964 "src/ast/lex.cc" -yy183: +#line 1153 "src/ast/lex.cc" +yy212: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy186; -yy184: + if (yych == 'r') goto yy215; +yy213: YYCURSOR = YYMARKER; - goto yy171; -yy185: + goto yy200; +yy214: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'p') goto yy187; - goto yy184; -yy186: + if (yych == 'p') goto yy216; + goto yy213; +yy215: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'm') goto yy188; - goto yy184; -yy187: + if (yych == 'm') goto yy217; + goto yy213; +yy216: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy189; - goto yy184; -yy188: + if (yych == 'a') goto yy218; + goto yy213; +yy217: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy190; - goto yy184; -yy189: + if (yych == 'a') goto yy219; + goto yy213; +yy218: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy191; - goto yy184; -yy190: + if (yych == 'r') goto yy220; + goto yy213; +yy219: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy192; - goto yy184; -yy191: + if (yych == 't') goto yy221; + goto yy213; +yy220: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy194; - goto yy184; -yy192: + if (yych == 'a') goto yy223; + goto yy213; +yy221: ++YYCURSOR; -#line 250 "../src/ast/lex.re" +#line 272 "../src/ast/lex.re" { fmt = lex_conf_string(); continue; } -#line 1003 "src/ast/lex.cc" -yy194: +#line 1192 "src/ast/lex.cc" +yy223: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy184; + if (yych != 't') goto yy213; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy184; + if (yych != 'o') goto yy213; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy184; + if (yych != 'r') goto yy213; ++YYCURSOR; -#line 251 "../src/ast/lex.re" +#line 273 "../src/ast/lex.re" { sep = lex_conf_string(); continue; } -#line 1014 "src/ast/lex.cc" +#line 1203 "src/ast/lex.cc" } -#line 260 "../src/ast/lex.re" +#line 282 "../src/ast/lex.re" } } @@ -1023,7 +1212,7 @@ scan: tchar = cur - pos; tok = cur; -#line 1027 "src/ast/lex.cc" +#line 1216 "src/ast/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -1064,102 +1253,102 @@ scan: if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 16) { - goto yy203; + goto yy232; } if (yych <= '9') { if (yych <= '%') { if (yych <= '\r') { - if (yych <= 0x08) goto yy201; - if (yych <= '\n') goto yy206; - if (yych >= '\r') goto yy208; + if (yych <= 0x08) goto yy230; + if (yych <= '\n') goto yy235; + if (yych >= '\r') goto yy237; } else { if (yych <= '"') { - if (yych >= '"') goto yy209; + if (yych >= '"') goto yy238; } else { - if (yych <= '#') goto yy211; - if (yych <= '$') goto yy212; - goto yy214; + if (yych <= '#') goto yy240; + if (yych <= '$') goto yy241; + goto yy243; } } } else { if (yych <= '*') { - if (yych <= '&') goto yy201; - if (yych <= '\'') goto yy215; - if (yych <= ')') goto yy212; - goto yy217; + if (yych <= '&') goto yy230; + if (yych <= '\'') goto yy244; + if (yych <= ')') goto yy241; + goto yy246; } else { if (yych <= '-') { - if (yych <= '+') goto yy212; + if (yych <= '+') goto yy241; } else { - if (yych <= '.') goto yy218; - if (yych <= '/') goto yy220; + if (yych <= '.') goto yy247; + if (yych <= '/') goto yy249; } } } } else { if (yych <= '[') { if (yych <= '=') { - if (yych <= ':') goto yy221; - if (yych <= ';') goto yy212; - if (yych <= '<') goto yy222; - goto yy224; + if (yych <= ':') goto yy250; + if (yych <= ';') goto yy241; + if (yych <= '<') goto yy251; + goto yy253; } else { if (yych <= '?') { - if (yych >= '?') goto yy212; + if (yych >= '?') goto yy241; } else { - if (yych <= '@') goto yy211; - if (yych <= 'Z') goto yy225; - goto yy228; + if (yych <= '@') goto yy240; + if (yych <= 'Z') goto yy254; + goto yy257; } } } else { if (yych <= 'q') { if (yych <= '^') { - if (yych <= '\\') goto yy212; + if (yych <= '\\') goto yy241; } else { - if (yych != '`') goto yy225; + if (yych != '`') goto yy254; } } else { if (yych <= 'z') { - if (yych <= 'r') goto yy230; - goto yy225; + if (yych <= 'r') goto yy259; + goto yy254; } else { - if (yych <= '{') goto yy231; - if (yych <= '|') goto yy212; + if (yych <= '{') goto yy260; + if (yych <= '|') goto yy241; } } } } -yy201: +yy230: ++YYCURSOR; -yy202: -#line 387 "../src/ast/lex.re" +yy231: +#line 409 "../src/ast/lex.re" { fatal_lc(get_cline(), get_column(), "unexpected character: '%c'", *tok); goto scan; } -#line 1142 "src/ast/lex.cc" -yy203: +#line 1331 "src/ast/lex.cc" +yy232: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 16) { - goto yy203; + goto yy232; } -#line 368 "../src/ast/lex.re" +#line 390 "../src/ast/lex.re" { goto scan; } -#line 1152 "src/ast/lex.cc" -yy206: +#line 1341 "src/ast/lex.cc" +yy235: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy233; + if (yych == '\t') goto yy262; } else { - if (yych <= ' ') goto yy233; - if (yych == '#') goto yy236; + if (yych <= ' ') goto yy262; + if (yych == '#') goto yy265; } -yy207: -#line 375 "../src/ast/lex.re" +yy236: +#line 397 "../src/ast/lex.re" { pos = cur; cline++; @@ -1171,82 +1360,82 @@ yy207: goto scan; } } -#line 1175 "src/ast/lex.cc" -yy208: +#line 1364 "src/ast/lex.cc" +yy237: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy206; - goto yy202; -yy209: + if (yych == '\n') goto yy235; + goto yy231; +yy238: ++YYCURSOR; -#line 286 "../src/ast/lex.re" +#line 308 "../src/ast/lex.re" { yylval.regexp = lex_str('"'); return TOKEN_REGEXP; } -#line 1184 "src/ast/lex.cc" -yy211: +#line 1373 "src/ast/lex.cc" +yy240: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '^') { - if (yych <= '@') goto yy202; - if (yych <= 'Z') goto yy238; - goto yy202; + if (yych <= '@') goto yy231; + if (yych <= 'Z') goto yy267; + goto yy231; } else { - if (yych == '`') goto yy202; - if (yych <= 'z') goto yy238; - goto yy202; + if (yych == '`') goto yy231; + if (yych <= 'z') goto yy267; + goto yy231; } -yy212: +yy241: ++YYCURSOR; -yy213: -#line 296 "../src/ast/lex.re" +yy242: +#line 318 "../src/ast/lex.re" { return *tok; } -#line 1201 "src/ast/lex.cc" -yy214: +#line 1390 "src/ast/lex.cc" +yy243: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '}') goto yy241; - goto yy202; -yy215: + if (yych == '}') goto yy270; + goto yy231; +yy244: ++YYCURSOR; -#line 285 "../src/ast/lex.re" +#line 307 "../src/ast/lex.re" { yylval.regexp = lex_str('\''); return TOKEN_REGEXP; } -#line 1210 "src/ast/lex.cc" -yy217: +#line 1399 "src/ast/lex.cc" +yy246: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '/') goto yy241; - goto yy213; -yy218: + if (yych == '/') goto yy270; + goto yy242; +yy247: ++YYCURSOR; -#line 363 "../src/ast/lex.re" +#line 385 "../src/ast/lex.re" { yylval.regexp = ast_dot(cline, get_column()); return TOKEN_REGEXP; } -#line 1222 "src/ast/lex.cc" -yy220: +#line 1411 "src/ast/lex.cc" +yy249: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '*') goto yy243; - if (yych == '/') goto yy245; - goto yy213; -yy221: + if (yych == '*') goto yy272; + if (yych == '/') goto yy274; + goto yy242; +yy250: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '=') goto yy247; - goto yy202; -yy222: + if (yych == '=') goto yy276; + goto yy231; +yy251: ++YYCURSOR; -#line 278 "../src/ast/lex.re" +#line 300 "../src/ast/lex.re" { return lex_clist(); } -#line 1236 "src/ast/lex.cc" -yy224: +#line 1425 "src/ast/lex.cc" +yy253: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == '>') goto yy249; - goto yy213; -yy225: + if (yych == '>') goto yy278; + goto yy242; +yy254: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy226: +yy255: if (yybm[0+yych] & 32) { - goto yy225; + goto yy254; } -#line 340 "../src/ast/lex.re" +#line 362 "../src/ast/lex.re" { if (!globopts->FFlag || lex_namedef_context_re2c()) { yylval.str = new std::string (tok, tok_len()); @@ -1269,251 +1458,251 @@ yy226: return TOKEN_REGEXP; } } -#line 1273 "src/ast/lex.cc" -yy228: +#line 1462 "src/ast/lex.cc" +yy257: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '^') goto yy251; -#line 287 "../src/ast/lex.re" + if (yych == '^') goto yy280; +#line 309 "../src/ast/lex.re" { yylval.regexp = lex_cls(false); return TOKEN_REGEXP; } -#line 1279 "src/ast/lex.cc" -yy230: +#line 1468 "src/ast/lex.cc" +yy259: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy253; - goto yy226; -yy231: + if (yych == 'e') goto yy282; + goto yy255; +yy260: yyaccept = 2; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 64) { - goto yy256; + goto yy285; } if (yych <= 'Z') { - if (yych == ',') goto yy254; - if (yych >= 'A') goto yy258; + if (yych == ',') goto yy283; + if (yych >= 'A') goto yy287; } else { if (yych <= '_') { - if (yych >= '_') goto yy258; + if (yych >= '_') goto yy287; } else { - if (yych <= '`') goto yy232; - if (yych <= 'z') goto yy258; + if (yych <= '`') goto yy261; + if (yych <= 'z') goto yy287; } } -yy232: -#line 270 "../src/ast/lex.re" +yy261: +#line 292 "../src/ast/lex.re" { lex_code_in_braces(); return TOKEN_CODE; } -#line 1304 "src/ast/lex.cc" -yy233: +#line 1493 "src/ast/lex.cc" +yy262: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy233; + if (yych == '\t') goto yy262; } else { - if (yych <= ' ') goto yy233; - if (yych == '#') goto yy236; + if (yych <= ' ') goto yy262; + if (yych == '#') goto yy265; } -yy235: +yy264: YYCURSOR = YYMARKER; if (yyaccept <= 2) { if (yyaccept <= 1) { if (yyaccept == 0) { - goto yy207; + goto yy236; } else { - goto yy213; + goto yy242; } } else { - goto yy232; + goto yy261; } } else { if (yyaccept == 3) { - goto yy248; + goto yy277; } else { - goto yy255; + goto yy284; } } -yy236: +yy265: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy236; - goto yy235; + if (yych == '\t') goto yy265; + goto yy264; } else { - if (yych <= ' ') goto yy236; - if (yych == 'l') goto yy260; - goto yy235; + if (yych <= ' ') goto yy265; + if (yych == 'l') goto yy289; + goto yy264; } -yy238: +yy267: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 'Z') { - if (yych <= '/') goto yy240; - if (yych <= '9') goto yy238; - if (yych >= 'A') goto yy238; + if (yych <= '/') goto yy269; + if (yych <= '9') goto yy267; + if (yych >= 'A') goto yy267; } else { if (yych <= '_') { - if (yych >= '_') goto yy238; + if (yych >= '_') goto yy267; } else { - if (yych <= '`') goto yy240; - if (yych <= 'z') goto yy238; + if (yych <= '`') goto yy269; + if (yych <= 'z') goto yy267; } } -yy240: -#line 290 "../src/ast/lex.re" +yy269: +#line 312 "../src/ast/lex.re" { const std::string *name = new std::string(tok + 1, tok_len() - 1); yylval.regexp = ast_tag(cline, get_column(), name, tok[0] == '#'); return TOKEN_REGEXP; } -#line 1369 "src/ast/lex.cc" -yy241: +#line 1558 "src/ast/lex.cc" +yy270: ++YYCURSOR; -#line 283 "../src/ast/lex.re" +#line 305 "../src/ast/lex.re" { tok = cur; return 0; } -#line 1374 "src/ast/lex.cc" -yy243: +#line 1563 "src/ast/lex.cc" +yy272: ++YYCURSOR; -#line 281 "../src/ast/lex.re" +#line 303 "../src/ast/lex.re" { lex_c_comment(); goto scan; } -#line 1379 "src/ast/lex.cc" -yy245: +#line 1568 "src/ast/lex.cc" +yy274: ++YYCURSOR; -#line 280 "../src/ast/lex.re" +#line 302 "../src/ast/lex.re" { lex_cpp_comment(); goto scan; } -#line 1384 "src/ast/lex.cc" -yy247: +#line 1573 "src/ast/lex.cc" +yy276: yyaccept = 3; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == '>') goto yy249; -yy248: -#line 271 "../src/ast/lex.re" + if (yych == '>') goto yy278; +yy277: +#line 293 "../src/ast/lex.re" { lex_code_indented(); return TOKEN_CODE; } -#line 1392 "src/ast/lex.cc" -yy249: +#line 1581 "src/ast/lex.cc" +yy278: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= '@') { if (yych <= '\t') { - if (yych <= 0x08) goto yy235; - goto yy249; + if (yych <= 0x08) goto yy264; + goto yy278; } else { - if (yych == ' ') goto yy249; - goto yy235; + if (yych == ' ') goto yy278; + goto yy264; } } else { if (yych <= '_') { if (yych <= 'Z') { yyt1 = YYCURSOR; - goto yy261; + goto yy290; } - if (yych <= '^') goto yy235; + if (yych <= '^') goto yy264; yyt1 = YYCURSOR; - goto yy261; + goto yy290; } else { - if (yych <= '`') goto yy235; + if (yych <= '`') goto yy264; if (yych <= 'z') { yyt1 = YYCURSOR; - goto yy261; + goto yy290; } - goto yy235; + goto yy264; } } -yy251: +yy280: ++YYCURSOR; -#line 288 "../src/ast/lex.re" +#line 310 "../src/ast/lex.re" { yylval.regexp = lex_cls(true); return TOKEN_REGEXP; } -#line 1427 "src/ast/lex.cc" -yy253: +#line 1616 "src/ast/lex.cc" +yy282: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '2') goto yy264; - goto yy226; -yy254: + if (yych == '2') goto yy293; + goto yy255; +yy283: ++YYCURSOR; -yy255: -#line 324 "../src/ast/lex.re" +yy284: +#line 346 "../src/ast/lex.re" { fatal_lc(get_cline(), get_column(), "illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers"); } -#line 1440 "src/ast/lex.cc" -yy256: +#line 1629 "src/ast/lex.cc" +yy285: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 64) { - goto yy256; + goto yy285; } if (yych == ',') { yyt1 = YYCURSOR; - goto yy265; + goto yy294; } - if (yych == '}') goto yy266; - goto yy235; -yy258: + if (yych == '}') goto yy295; + goto yy264; +yy287: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= '^') { if (yych <= '9') { - if (yych <= '/') goto yy235; - goto yy258; + if (yych <= '/') goto yy264; + goto yy287; } else { - if (yych <= '@') goto yy235; - if (yych <= 'Z') goto yy258; - goto yy235; + if (yych <= '@') goto yy264; + if (yych <= 'Z') goto yy287; + goto yy264; } } else { if (yych <= 'z') { - if (yych == '`') goto yy235; - goto yy258; + if (yych == '`') goto yy264; + goto yy287; } else { - if (yych == '}') goto yy268; - goto yy235; + if (yych == '}') goto yy297; + goto yy264; } } -yy260: +yy289: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy270; - goto yy235; -yy261: + if (yych == 'i') goto yy299; + goto yy264; +yy290: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 'Z') { - if (yych <= '/') goto yy263; - if (yych <= '9') goto yy261; - if (yych >= 'A') goto yy261; + if (yych <= '/') goto yy292; + if (yych <= '9') goto yy290; + if (yych >= 'A') goto yy290; } else { if (yych <= '_') { - if (yych >= '_') goto yy261; + if (yych >= '_') goto yy290; } else { - if (yych <= '`') goto yy263; - if (yych <= 'z') goto yy261; + if (yych <= '`') goto yy292; + if (yych <= 'z') goto yy290; } } -yy263: +yy292: p = yyt1; -#line 273 "../src/ast/lex.re" +#line 295 "../src/ast/lex.re" { yylval.str = new std::string(p, static_cast(cur - p)); return tok[0] == ':' ? TOKEN_CJUMP : TOKEN_CNEXT; } -#line 1503 "src/ast/lex.cc" -yy264: +#line 1692 "src/ast/lex.cc" +yy293: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy271; - goto yy226; -yy265: + if (yych == 'c') goto yy300; + goto yy255; +yy294: yyaccept = 4; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy255; - if (yych <= '9') goto yy272; - if (yych == '}') goto yy274; - goto yy255; -yy266: + if (yych <= '/') goto yy284; + if (yych <= '9') goto yy301; + if (yych == '}') goto yy303; + goto yy284; +yy295: ++YYCURSOR; -#line 298 "../src/ast/lex.re" +#line 320 "../src/ast/lex.re" { if (!s_to_u32_unsafe (tok + 1, cur - 1, yylval.bounds.min)) { fatal_lc(get_cline(), get_column(), "repetition count overflow"); @@ -1521,10 +1710,10 @@ yy266: yylval.bounds.max = yylval.bounds.min; return TOKEN_CLOSESIZE; } -#line 1525 "src/ast/lex.cc" -yy268: +#line 1714 "src/ast/lex.cc" +yy297: ++YYCURSOR; -#line 329 "../src/ast/lex.re" +#line 351 "../src/ast/lex.re" { if (!globopts->FFlag) { fatal_lc(get_cline(), get_column(), @@ -1533,26 +1722,26 @@ yy268: yylval.str = new std::string (tok + 1, tok_len () - 2); // -2 to omit braces return TOKEN_ID; } -#line 1537 "src/ast/lex.cc" -yy270: +#line 1726 "src/ast/lex.cc" +yy299: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy276; - goto yy235; -yy271: + if (yych == 'n') goto yy305; + goto yy264; +yy300: yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy277; - goto yy226; -yy272: + if (yych == ':') goto yy306; + goto yy255; +yy301: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych <= '/') goto yy235; - if (yych <= '9') goto yy272; - if (yych == '}') goto yy279; - goto yy235; -yy274: + if (yych <= '/') goto yy264; + if (yych <= '9') goto yy301; + if (yych == '}') goto yy308; + goto yy264; +yy303: ++YYCURSOR; -#line 316 "../src/ast/lex.re" +#line 338 "../src/ast/lex.re" { if (!s_to_u32_unsafe (tok + 1, cur - 2, yylval.bounds.min)) { fatal_lc(get_cline(), get_column(), "repetition lower bound overflow"); @@ -1560,20 +1749,20 @@ yy274: yylval.bounds.max = std::numeric_limits::max(); return TOKEN_CLOSESIZE; } -#line 1564 "src/ast/lex.cc" -yy276: +#line 1753 "src/ast/lex.cc" +yy305: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy281; - goto yy235; -yy277: + if (yych == 'e') goto yy310; + goto yy264; +yy306: ++YYCURSOR; -#line 338 "../src/ast/lex.re" +#line 360 "../src/ast/lex.re" { return TOKEN_CONF; } -#line 1573 "src/ast/lex.cc" -yy279: +#line 1762 "src/ast/lex.cc" +yy308: ++YYCURSOR; p = yyt1; -#line 306 "../src/ast/lex.re" +#line 328 "../src/ast/lex.re" { if (!s_to_u32_unsafe (tok + 1, p, yylval.bounds.min)) { fatal_lc(get_cline(), get_column(), "repetition lower bound overflow"); @@ -1583,101 +1772,101 @@ yy279: } return TOKEN_CLOSESIZE; } -#line 1587 "src/ast/lex.cc" -yy281: +#line 1776 "src/ast/lex.cc" +yy310: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '0') goto yy283; - if (yych <= '9') goto yy235; - goto yy283; -yy282: + if (yych <= '0') goto yy312; + if (yych <= '9') goto yy264; + goto yy312; +yy311: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy283: +yy312: if (yych <= 0x1F) { - if (yych == '\t') goto yy282; - goto yy235; + if (yych == '\t') goto yy311; + goto yy264; } else { - if (yych <= ' ') goto yy282; - if (yych <= '0') goto yy235; - if (yych >= ':') goto yy235; + if (yych <= ' ') goto yy311; + if (yych <= '0') goto yy264; + if (yych >= ':') goto yy264; yyt1 = YYCURSOR; } -yy284: +yy313: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\r') { if (yych <= '\t') { - if (yych <= 0x08) goto yy235; + if (yych <= 0x08) goto yy264; } else { - if (yych <= '\n') goto yy288; - if (yych <= '\f') goto yy235; - goto yy290; + if (yych <= '\n') goto yy317; + if (yych <= '\f') goto yy264; + goto yy319; } } else { if (yych <= ' ') { - if (yych <= 0x1F) goto yy235; + if (yych <= 0x1F) goto yy264; } else { - if (yych <= '/') goto yy235; - if (yych <= '9') goto yy284; - goto yy235; + if (yych <= '/') goto yy264; + if (yych <= '9') goto yy313; + goto yy264; } } -yy286: +yy315: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy286; - goto yy235; + if (yych == '\t') goto yy315; + goto yy264; } else { - if (yych <= ' ') goto yy286; - if (yych == '"') goto yy291; - goto yy235; + if (yych <= ' ') goto yy315; + if (yych == '"') goto yy320; + goto yy264; } -yy288: +yy317: ++YYCURSOR; YYCURSOR = yyt1; -#line 370 "../src/ast/lex.re" +#line 392 "../src/ast/lex.re" { set_sourceline (); return TOKEN_LINE_INFO; } -#line 1648 "src/ast/lex.cc" -yy290: +#line 1837 "src/ast/lex.cc" +yy319: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy288; - goto yy235; -yy291: + if (yych == '\n') goto yy317; + goto yy264; +yy320: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy291; + goto yy320; } - if (yych <= '\n') goto yy235; - if (yych >= '#') goto yy294; + if (yych <= '\n') goto yy264; + if (yych >= '#') goto yy323; yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy288; - if (yych == '\r') goto yy290; - goto yy235; -yy294: + if (yych == '\n') goto yy317; + if (yych == '\r') goto yy319; + goto yy264; +yy323: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x00) goto yy235; - if (yych == '\n') goto yy235; - goto yy291; + if (yych <= 0x00) goto yy264; + if (yych == '\n') goto yy264; + goto yy320; } -#line 391 "../src/ast/lex.re" +#line 413 "../src/ast/lex.re" } bool Scanner::lex_namedef_context_re2c() { -#line 1681 "src/ast/lex.cc" +#line 1870 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -1719,50 +1908,50 @@ bool Scanner::lex_namedef_context_re2c() if (yych <= 0x1F) { if (yych == '\t') { yyt1 = YYCURSOR; - goto yy298; + goto yy327; } } else { if (yych <= ' ') { yyt1 = YYCURSOR; - goto yy298; + goto yy327; } if (yych == '=') { yyt1 = YYCURSOR; - goto yy301; + goto yy330; } } -yy297: -#line 398 "../src/ast/lex.re" +yy326: +#line 420 "../src/ast/lex.re" { return false; } -#line 1738 "src/ast/lex.cc" -yy298: +#line 1927 "src/ast/lex.cc" +yy327: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy298; + goto yy327; } - if (yych == '=') goto yy301; -yy300: + if (yych == '=') goto yy330; +yy329: YYCURSOR = YYMARKER; - goto yy297; -yy301: + goto yy326; +yy330: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '>') goto yy300; + if (yych == '>') goto yy329; ++YYCURSOR; YYCURSOR = yyt1; -#line 397 "../src/ast/lex.re" +#line 419 "../src/ast/lex.re" { return true; } -#line 1757 "src/ast/lex.cc" +#line 1946 "src/ast/lex.cc" } -#line 399 "../src/ast/lex.re" +#line 421 "../src/ast/lex.re" } bool Scanner::lex_namedef_context_flex() { -#line 1766 "src/ast/lex.cc" +#line 1955 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -1803,40 +1992,40 @@ bool Scanner::lex_namedef_context_flex() yych = (YYCTYPE)*YYCURSOR; if (yych == '\t') { yyt1 = YYCURSOR; - goto yy307; + goto yy336; } if (yych == ' ') { yyt1 = YYCURSOR; - goto yy307; + goto yy336; } -#line 407 "../src/ast/lex.re" +#line 429 "../src/ast/lex.re" { return false; } -#line 1815 "src/ast/lex.cc" -yy307: +#line 2004 "src/ast/lex.cc" +yy336: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy307; + goto yy336; } if (yych <= '<') { - if (yych == ':') goto yy310; + if (yych == ':') goto yy339; } else { - if (yych <= '=') goto yy310; - if (yych == '{') goto yy310; + if (yych <= '=') goto yy339; + if (yych == '{') goto yy339; } YYCURSOR = yyt1; -#line 406 "../src/ast/lex.re" +#line 428 "../src/ast/lex.re" { return true; } -#line 1832 "src/ast/lex.cc" -yy310: +#line 2021 "src/ast/lex.cc" +yy339: ++YYCURSOR; YYCURSOR = yyt1; -#line 405 "../src/ast/lex.re" +#line 427 "../src/ast/lex.re" { return false; } -#line 1838 "src/ast/lex.cc" +#line 2027 "src/ast/lex.cc" } -#line 408 "../src/ast/lex.re" +#line 430 "../src/ast/lex.re" } @@ -1845,7 +2034,7 @@ int Scanner::lex_clist() int kind = TOKEN_CLIST; CondList *cl = new CondList; -#line 1849 "src/ast/lex.cc" +#line 2038 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -1882,43 +2071,43 @@ int Scanner::lex_clist() 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - goto yy312; -yy313: + goto yy341; +yy342: ++YYCURSOR; -yy312: +yy341: if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy313; + goto yy342; } - if (yych <= 0x1F) goto yy315; - if (yych <= '!') goto yy316; - if (yych == '>') goto yy319; -yy315: -#line 418 "../src/ast/lex.re" + if (yych <= 0x1F) goto yy344; + if (yych <= '!') goto yy345; + if (yych == '>') goto yy348; +yy344: +#line 440 "../src/ast/lex.re" { goto cond; } -#line 1901 "src/ast/lex.cc" -yy316: +#line 2090 "src/ast/lex.cc" +yy345: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\t') goto yy316; - if (yych == ' ') goto yy316; -#line 416 "../src/ast/lex.re" + if (yych == '\t') goto yy345; + if (yych == ' ') goto yy345; +#line 438 "../src/ast/lex.re" { kind = TOKEN_CSETUP; goto cond; } -#line 1910 "src/ast/lex.cc" -yy319: +#line 2099 "src/ast/lex.cc" +yy348: ++YYCURSOR; -#line 417 "../src/ast/lex.re" +#line 439 "../src/ast/lex.re" { kind = TOKEN_CZERO; goto end; } -#line 1915 "src/ast/lex.cc" +#line 2104 "src/ast/lex.cc" } -#line 419 "../src/ast/lex.re" +#line 441 "../src/ast/lex.re" cond: tok = cur; -#line 1922 "src/ast/lex.cc" +#line 2111 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -1958,42 +2147,42 @@ cond: if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 'Z') { - if (yych == '*') goto yy325; - if (yych >= 'A') goto yy327; + if (yych == '*') goto yy354; + if (yych >= 'A') goto yy356; } else { if (yych <= '_') { - if (yych >= '_') goto yy327; + if (yych >= '_') goto yy356; } else { - if (yych <= '`') goto yy323; - if (yych <= 'z') goto yy327; + if (yych <= '`') goto yy352; + if (yych <= 'z') goto yy356; } } -yy323: +yy352: ++YYCURSOR; -#line 425 "../src/ast/lex.re" +#line 447 "../src/ast/lex.re" { goto error; } -#line 1976 "src/ast/lex.cc" -yy325: +#line 2165 "src/ast/lex.cc" +yy354: ++YYCURSOR; -#line 424 "../src/ast/lex.re" +#line 446 "../src/ast/lex.re" { if (!cl->empty()) goto error; cl->insert("*"); goto next; } -#line 1981 "src/ast/lex.cc" -yy327: +#line 2170 "src/ast/lex.cc" +yy356: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy327; + goto yy356; } -#line 423 "../src/ast/lex.re" +#line 445 "../src/ast/lex.re" { cl->insert(std::string(tok, tok_len())); goto next; } -#line 1991 "src/ast/lex.cc" +#line 2180 "src/ast/lex.cc" } -#line 426 "../src/ast/lex.re" +#line 448 "../src/ast/lex.re" next: -#line 1997 "src/ast/lex.cc" +#line 2186 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2033,67 +2222,67 @@ next: if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= ' ') { - if (yych == '\t') goto yy334; - if (yych >= ' ') goto yy334; + if (yych == '\t') goto yy363; + if (yych >= ' ') goto yy363; } else { if (yych <= ',') { - if (yych >= ',') goto yy335; + if (yych >= ',') goto yy364; } else { - if (yych == '>') goto yy338; + if (yych == '>') goto yy367; } } ++YYCURSOR; -yy333: -#line 431 "../src/ast/lex.re" +yy362: +#line 453 "../src/ast/lex.re" { goto error; } -#line 2050 "src/ast/lex.cc" -yy334: +#line 2239 "src/ast/lex.cc" +yy363: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= ' ') { - if (yych == '\t') goto yy340; - if (yych <= 0x1F) goto yy333; - goto yy340; + if (yych == '\t') goto yy369; + if (yych <= 0x1F) goto yy362; + goto yy369; } else { if (yych <= ',') { - if (yych <= '+') goto yy333; + if (yych <= '+') goto yy362; } else { - if (yych == '>') goto yy338; - goto yy333; + if (yych == '>') goto yy367; + goto yy362; } } -yy335: +yy364: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy335; + goto yy364; } -#line 429 "../src/ast/lex.re" +#line 451 "../src/ast/lex.re" { goto cond; } -#line 2074 "src/ast/lex.cc" -yy338: +#line 2263 "src/ast/lex.cc" +yy367: ++YYCURSOR; -#line 430 "../src/ast/lex.re" +#line 452 "../src/ast/lex.re" { goto end; } -#line 2079 "src/ast/lex.cc" -yy340: +#line 2268 "src/ast/lex.cc" +yy369: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= ' ') { - if (yych == '\t') goto yy340; - if (yych >= ' ') goto yy340; + if (yych == '\t') goto yy369; + if (yych >= ' ') goto yy369; } else { if (yych <= ',') { - if (yych >= ',') goto yy335; + if (yych >= ',') goto yy364; } else { - if (yych == '>') goto yy338; + if (yych == '>') goto yy367; } } YYCURSOR = YYMARKER; - goto yy333; + goto yy362; } -#line 432 "../src/ast/lex.re" +#line 454 "../src/ast/lex.re" end: yylval.clist = cl; @@ -2109,98 +2298,98 @@ void Scanner::lex_code_indented() tok = cur; code: -#line 2113 "src/ast/lex.cc" +#line 2302 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = (YYCTYPE)*YYCURSOR; if (yych <= '&') { if (yych <= '\f') { - if (yych <= 0x00) goto yy345; - if (yych == '\n') goto yy349; - goto yy347; + if (yych <= 0x00) goto yy374; + if (yych == '\n') goto yy378; + goto yy376; } else { - if (yych <= '\r') goto yy351; - if (yych == '"') goto yy352; - goto yy347; + if (yych <= '\r') goto yy380; + if (yych == '"') goto yy381; + goto yy376; } } else { if (yych <= 'z') { - if (yych <= '\'') goto yy352; - if (yych == '/') goto yy354; - goto yy347; + if (yych <= '\'') goto yy381; + if (yych == '/') goto yy383; + goto yy376; } else { - if (yych == '|') goto yy347; - if (yych <= '}') goto yy355; - goto yy347; + if (yych == '|') goto yy376; + if (yych <= '}') goto yy384; + goto yy376; } } -yy345: +yy374: ++YYCURSOR; -#line 455 "../src/ast/lex.re" +#line 477 "../src/ast/lex.re" { fail_if_eof(); goto code; } -#line 2143 "src/ast/lex.cc" -yy347: +#line 2332 "src/ast/lex.cc" +yy376: ++YYCURSOR; -yy348: -#line 460 "../src/ast/lex.re" +yy377: +#line 482 "../src/ast/lex.re" { goto code; } -#line 2149 "src/ast/lex.cc" -yy349: +#line 2338 "src/ast/lex.cc" +yy378: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '\f') { - if (yych <= 0x08) goto yy350; - if (yych <= '\n') goto yy357; + if (yych <= 0x08) goto yy379; + if (yych <= '\n') goto yy386; } else { - if (yych <= '\r') goto yy357; - if (yych == ' ') goto yy357; + if (yych <= '\r') goto yy386; + if (yych == ' ') goto yy386; } -yy350: -#line 448 "../src/ast/lex.re" +yy379: +#line 470 "../src/ast/lex.re" { while (isspace(tok[0])) ++tok; while (cur > tok && isspace(cur[-1])) --cur; yylval.code = new Code(get_fname (), line, tok, tok_len ()); return; } -#line 2167 "src/ast/lex.cc" -yy351: +#line 2356 "src/ast/lex.cc" +yy380: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy349; - goto yy348; -yy352: + if (yych == '\n') goto yy378; + goto yy377; +yy381: ++YYCURSOR; -#line 459 "../src/ast/lex.re" +#line 481 "../src/ast/lex.re" { lex_string(cur[-1]); goto code; } -#line 2176 "src/ast/lex.cc" -yy354: +#line 2365 "src/ast/lex.cc" +yy383: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '*') goto yy359; - if (yych == '/') goto yy361; - goto yy348; -yy355: + if (yych == '*') goto yy388; + if (yych == '/') goto yy390; + goto yy377; +yy384: ++YYCURSOR; -#line 456 "../src/ast/lex.re" +#line 478 "../src/ast/lex.re" { fatal_l(get_cline(), "Curly braces are not allowed after ':='"); } -#line 2186 "src/ast/lex.cc" -yy357: +#line 2375 "src/ast/lex.cc" +yy386: ++YYCURSOR; YYCURSOR -= 1; -#line 447 "../src/ast/lex.re" +#line 469 "../src/ast/lex.re" { goto code; } -#line 2192 "src/ast/lex.cc" -yy359: +#line 2381 "src/ast/lex.cc" +yy388: ++YYCURSOR; -#line 457 "../src/ast/lex.re" +#line 479 "../src/ast/lex.re" { lex_c_comment(); goto code; } -#line 2197 "src/ast/lex.cc" -yy361: +#line 2386 "src/ast/lex.cc" +yy390: ++YYCURSOR; -#line 458 "../src/ast/lex.re" +#line 480 "../src/ast/lex.re" { lex_cpp_comment(); goto code; } -#line 2202 "src/ast/lex.cc" +#line 2391 "src/ast/lex.cc" } -#line 461 "../src/ast/lex.re" +#line 483 "../src/ast/lex.re" } @@ -2210,7 +2399,7 @@ void Scanner::lex_code_in_braces() uint32_t depth = 1; code: -#line 2214 "src/ast/lex.cc" +#line 2403 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2251,68 +2440,68 @@ code: yych = (YYCTYPE)*YYCURSOR; if (yych <= '&') { if (yych <= '\f') { - if (yych <= 0x00) goto yy365; - if (yych == '\n') goto yy369; - goto yy367; + if (yych <= 0x00) goto yy394; + if (yych == '\n') goto yy398; + goto yy396; } else { - if (yych <= '\r') goto yy371; - if (yych == '"') goto yy372; - goto yy367; + if (yych <= '\r') goto yy400; + if (yych == '"') goto yy401; + goto yy396; } } else { if (yych <= 'z') { - if (yych <= '\'') goto yy372; - if (yych == '/') goto yy374; - goto yy367; + if (yych <= '\'') goto yy401; + if (yych == '/') goto yy403; + goto yy396; } else { - if (yych <= '{') goto yy375; - if (yych == '}') goto yy377; - goto yy367; + if (yych <= '{') goto yy404; + if (yych == '}') goto yy406; + goto yy396; } } -yy365: +yy394: ++YYCURSOR; -#line 481 "../src/ast/lex.re" +#line 503 "../src/ast/lex.re" { fail_if_eof(); goto code; } -#line 2278 "src/ast/lex.cc" -yy367: +#line 2467 "src/ast/lex.cc" +yy396: ++YYCURSOR; -yy368: -#line 485 "../src/ast/lex.re" +yy397: +#line 507 "../src/ast/lex.re" { goto code; } -#line 2284 "src/ast/lex.cc" -yy369: +#line 2473 "src/ast/lex.cc" +yy398: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 32) { - goto yy379; + goto yy408; } - if (yych == '#') goto yy382; -yy370: -#line 480 "../src/ast/lex.re" + if (yych == '#') goto yy411; +yy399: +#line 502 "../src/ast/lex.re" { pos = cur; cline++; goto code; } -#line 2294 "src/ast/lex.cc" -yy371: +#line 2483 "src/ast/lex.cc" +yy400: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy369; - goto yy368; -yy372: + if (yych == '\n') goto yy398; + goto yy397; +yy401: ++YYCURSOR; -#line 484 "../src/ast/lex.re" +#line 506 "../src/ast/lex.re" { lex_string(cur[-1]); goto code; } -#line 2303 "src/ast/lex.cc" -yy374: +#line 2492 "src/ast/lex.cc" +yy403: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '*') goto yy384; - if (yych == '/') goto yy386; - goto yy368; -yy375: + if (yych == '*') goto yy413; + if (yych == '/') goto yy415; + goto yy397; +yy404: ++YYCURSOR; -#line 478 "../src/ast/lex.re" +#line 500 "../src/ast/lex.re" { ++depth; goto code; } -#line 2313 "src/ast/lex.cc" -yy377: +#line 2502 "src/ast/lex.cc" +yy406: ++YYCURSOR; -#line 470 "../src/ast/lex.re" +#line 492 "../src/ast/lex.re" { if (--depth == 0) { yylval.code = new Code(get_fname (), line, tok, tok_len ()); @@ -2320,125 +2509,125 @@ yy377: } goto code; } -#line 2324 "src/ast/lex.cc" -yy379: +#line 2513 "src/ast/lex.cc" +yy408: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 32) { - goto yy379; + goto yy408; } - if (yych == '#') goto yy382; -yy381: + if (yych == '#') goto yy411; +yy410: YYCURSOR = YYMARKER; - goto yy370; -yy382: + goto yy399; +yy411: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy382; - goto yy381; + if (yych == '\t') goto yy411; + goto yy410; } else { - if (yych <= ' ') goto yy382; - if (yych == 'l') goto yy388; - goto yy381; + if (yych <= ' ') goto yy411; + if (yych == 'l') goto yy417; + goto yy410; } -yy384: +yy413: ++YYCURSOR; -#line 482 "../src/ast/lex.re" +#line 504 "../src/ast/lex.re" { lex_c_comment(); goto code; } -#line 2352 "src/ast/lex.cc" -yy386: +#line 2541 "src/ast/lex.cc" +yy415: ++YYCURSOR; -#line 483 "../src/ast/lex.re" +#line 505 "../src/ast/lex.re" { lex_cpp_comment(); goto code; } -#line 2357 "src/ast/lex.cc" -yy388: +#line 2546 "src/ast/lex.cc" +yy417: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy381; + if (yych != 'i') goto yy410; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy381; + if (yych != 'n') goto yy410; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy381; + if (yych != 'e') goto yy410; yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '0') goto yy393; - if (yych <= '9') goto yy381; - goto yy393; -yy392: + if (yych <= '0') goto yy422; + if (yych <= '9') goto yy410; + goto yy422; +yy421: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy393: +yy422: if (yych <= 0x1F) { - if (yych == '\t') goto yy392; - goto yy381; + if (yych == '\t') goto yy421; + goto yy410; } else { - if (yych <= ' ') goto yy392; - if (yych <= '0') goto yy381; - if (yych >= ':') goto yy381; + if (yych <= ' ') goto yy421; + if (yych <= '0') goto yy410; + if (yych >= ':') goto yy410; yyt1 = YYCURSOR; } -yy394: +yy423: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 64) { - goto yy394; + goto yy423; } if (yych <= '\f') { - if (yych <= 0x08) goto yy381; - if (yych <= '\t') goto yy396; - if (yych <= '\n') goto yy398; - goto yy381; + if (yych <= 0x08) goto yy410; + if (yych <= '\t') goto yy425; + if (yych <= '\n') goto yy427; + goto yy410; } else { - if (yych <= '\r') goto yy400; - if (yych != ' ') goto yy381; + if (yych <= '\r') goto yy429; + if (yych != ' ') goto yy410; } -yy396: +yy425: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy396; - goto yy381; + if (yych == '\t') goto yy425; + goto yy410; } else { - if (yych <= ' ') goto yy396; - if (yych == '"') goto yy401; - goto yy381; + if (yych <= ' ') goto yy425; + if (yych == '"') goto yy430; + goto yy410; } -yy398: +yy427: ++YYCURSOR; YYCURSOR = yyt1; -#line 479 "../src/ast/lex.re" +#line 501 "../src/ast/lex.re" { set_sourceline (); goto code; } -#line 2416 "src/ast/lex.cc" -yy400: +#line 2605 "src/ast/lex.cc" +yy429: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy398; - goto yy381; -yy401: + if (yych == '\n') goto yy427; + goto yy410; +yy430: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy401; + goto yy430; } - if (yych <= '\n') goto yy381; - if (yych >= '#') goto yy404; + if (yych <= '\n') goto yy410; + if (yych >= '#') goto yy433; yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy398; - if (yych == '\r') goto yy400; - goto yy381; -yy404: + if (yych == '\n') goto yy427; + if (yych == '\r') goto yy429; + goto yy410; +yy433: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x00) goto yy381; - if (yych == '\n') goto yy381; - goto yy401; + if (yych <= 0x00) goto yy410; + if (yych == '\n') goto yy410; + goto yy430; } -#line 486 "../src/ast/lex.re" +#line 508 "../src/ast/lex.re" } @@ -2446,70 +2635,70 @@ void Scanner::lex_string(char delim) { loop: -#line 2450 "src/ast/lex.cc" +#line 2639 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '!') { if (yych <= '\n') { - if (yych <= 0x00) goto yy407; - if (yych <= '\t') goto yy409; - goto yy411; + if (yych <= 0x00) goto yy436; + if (yych <= '\t') goto yy438; + goto yy440; } else { - if (yych == '\r') goto yy413; - goto yy409; + if (yych == '\r') goto yy442; + goto yy438; } } else { if (yych <= '\'') { - if (yych <= '"') goto yy414; - if (yych <= '&') goto yy409; - goto yy414; + if (yych <= '"') goto yy443; + if (yych <= '&') goto yy438; + goto yy443; } else { - if (yych == '\\') goto yy416; - goto yy409; + if (yych == '\\') goto yy445; + goto yy438; } } -yy407: +yy436: ++YYCURSOR; -#line 496 "../src/ast/lex.re" +#line 518 "../src/ast/lex.re" { fail_if_eof(); goto loop; } -#line 2478 "src/ast/lex.cc" -yy409: +#line 2667 "src/ast/lex.cc" +yy438: ++YYCURSOR; -yy410: -#line 497 "../src/ast/lex.re" +yy439: +#line 519 "../src/ast/lex.re" { goto loop; } -#line 2484 "src/ast/lex.cc" -yy411: +#line 2673 "src/ast/lex.cc" +yy440: ++YYCURSOR; -#line 495 "../src/ast/lex.re" +#line 517 "../src/ast/lex.re" { pos = cur; ++cline; goto loop; } -#line 2489 "src/ast/lex.cc" -yy413: +#line 2678 "src/ast/lex.cc" +yy442: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy411; - goto yy410; -yy414: + if (yych == '\n') goto yy440; + goto yy439; +yy443: ++YYCURSOR; -#line 493 "../src/ast/lex.re" +#line 515 "../src/ast/lex.re" { if (cur[-1] == delim) return; else goto loop; } -#line 2498 "src/ast/lex.cc" -yy416: +#line 2687 "src/ast/lex.cc" +yy445: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '&') { - if (yych != '"') goto yy410; + if (yych != '"') goto yy439; } else { - if (yych <= '\'') goto yy417; - if (yych != '\\') goto yy410; + if (yych <= '\'') goto yy446; + if (yych != '\\') goto yy439; } -yy417: +yy446: ++YYCURSOR; -#line 494 "../src/ast/lex.re" +#line 516 "../src/ast/lex.re" { goto loop; } -#line 2511 "src/ast/lex.cc" +#line 2700 "src/ast/lex.cc" } -#line 498 "../src/ast/lex.re" +#line 520 "../src/ast/lex.re" } @@ -2517,49 +2706,49 @@ void Scanner::lex_c_comment() { loop: -#line 2521 "src/ast/lex.cc" +#line 2710 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\f') { - if (yych <= 0x00) goto yy421; - if (yych == '\n') goto yy425; - goto yy423; + if (yych <= 0x00) goto yy450; + if (yych == '\n') goto yy454; + goto yy452; } else { - if (yych <= '\r') goto yy427; - if (yych == '*') goto yy428; - goto yy423; + if (yych <= '\r') goto yy456; + if (yych == '*') goto yy457; + goto yy452; } -yy421: +yy450: ++YYCURSOR; -#line 507 "../src/ast/lex.re" +#line 529 "../src/ast/lex.re" { fail_if_eof(); goto loop; } -#line 2539 "src/ast/lex.cc" -yy423: +#line 2728 "src/ast/lex.cc" +yy452: ++YYCURSOR; -yy424: -#line 508 "../src/ast/lex.re" +yy453: +#line 530 "../src/ast/lex.re" { goto loop; } -#line 2545 "src/ast/lex.cc" -yy425: +#line 2734 "src/ast/lex.cc" +yy454: ++YYCURSOR; -#line 506 "../src/ast/lex.re" +#line 528 "../src/ast/lex.re" { pos = cur; ++cline; goto loop; } -#line 2550 "src/ast/lex.cc" -yy427: +#line 2739 "src/ast/lex.cc" +yy456: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy425; - goto yy424; -yy428: + if (yych == '\n') goto yy454; + goto yy453; +yy457: yych = (YYCTYPE)*++YYCURSOR; - if (yych != '/') goto yy424; + if (yych != '/') goto yy453; ++YYCURSOR; -#line 505 "../src/ast/lex.re" +#line 527 "../src/ast/lex.re" { return; } -#line 2561 "src/ast/lex.cc" +#line 2750 "src/ast/lex.cc" } -#line 509 "../src/ast/lex.re" +#line 531 "../src/ast/lex.re" } @@ -2567,41 +2756,41 @@ void Scanner::lex_cpp_comment() { loop: -#line 2571 "src/ast/lex.cc" +#line 2760 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\n') { - if (yych <= 0x00) goto yy433; - if (yych <= '\t') goto yy435; - goto yy437; + if (yych <= 0x00) goto yy462; + if (yych <= '\t') goto yy464; + goto yy466; } else { - if (yych == '\r') goto yy439; - goto yy435; + if (yych == '\r') goto yy468; + goto yy464; } -yy433: +yy462: ++YYCURSOR; -#line 517 "../src/ast/lex.re" +#line 539 "../src/ast/lex.re" { fail_if_eof(); goto loop; } -#line 2588 "src/ast/lex.cc" -yy435: +#line 2777 "src/ast/lex.cc" +yy464: ++YYCURSOR; -yy436: -#line 518 "../src/ast/lex.re" +yy465: +#line 540 "../src/ast/lex.re" { goto loop; } -#line 2594 "src/ast/lex.cc" -yy437: +#line 2783 "src/ast/lex.cc" +yy466: ++YYCURSOR; -#line 516 "../src/ast/lex.re" +#line 538 "../src/ast/lex.re" { pos = cur; ++cline; return; } -#line 2599 "src/ast/lex.cc" -yy439: +#line 2788 "src/ast/lex.cc" +yy468: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy437; - goto yy436; + if (yych == '\n') goto yy466; + goto yy465; } -#line 519 "../src/ast/lex.re" +#line 541 "../src/ast/lex.re" } @@ -2613,44 +2802,44 @@ fst: tok = cur; c = get_column(); -#line 2617 "src/ast/lex.cc" +#line 2806 "src/ast/lex.cc" { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == ']') goto yy443; -#line 531 "../src/ast/lex.re" + if (yych == ']') goto yy472; +#line 553 "../src/ast/lex.re" { l = lex_cls_chr(); goto snd; } -#line 2625 "src/ast/lex.cc" -yy443: +#line 2814 "src/ast/lex.cc" +yy472: ++YYCURSOR; -#line 530 "../src/ast/lex.re" +#line 552 "../src/ast/lex.re" { return ast_cls(cline, c0, cls, neg); } -#line 2630 "src/ast/lex.cc" +#line 2819 "src/ast/lex.cc" } -#line 532 "../src/ast/lex.re" +#line 554 "../src/ast/lex.re" snd: -#line 2636 "src/ast/lex.cc" +#line 2825 "src/ast/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*(YYMARKER = YYCURSOR); - if (yych == '-') goto yy448; -yy447: -#line 535 "../src/ast/lex.re" + if (yych == '-') goto yy477; +yy476: +#line 557 "../src/ast/lex.re" { u = l; goto add; } -#line 2645 "src/ast/lex.cc" -yy448: +#line 2834 "src/ast/lex.cc" +yy477: yych = (YYCTYPE)*++YYCURSOR; - if (yych != ']') goto yy450; + if (yych != ']') goto yy479; YYCURSOR = YYMARKER; - goto yy447; -yy450: + goto yy476; +yy479: ++YYCURSOR; YYCURSOR -= 1; -#line 536 "../src/ast/lex.re" +#line 558 "../src/ast/lex.re" { u = lex_cls_chr(); if (l > u) { @@ -2659,9 +2848,9 @@ yy450: } goto add; } -#line 2663 "src/ast/lex.cc" +#line 2852 "src/ast/lex.cc" } -#line 544 "../src/ast/lex.re" +#line 566 "../src/ast/lex.re" add: cls->push_back(ASTRange(l, u, c)); @@ -2673,319 +2862,319 @@ uint32_t Scanner::lex_cls_chr() tok = cur; const uint32_t l = get_cline(), c = get_column(); -#line 2677 "src/ast/lex.cc" +#line 2866 "src/ast/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; if ((YYLIMIT - YYCURSOR) < 10) YYFILL(10); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\f') { - if (yych <= 0x00) goto yy454; - if (yych == '\n') goto yy458; - goto yy456; + if (yych <= 0x00) goto yy483; + if (yych == '\n') goto yy487; + goto yy485; } else { - if (yych <= '\r') goto yy460; - if (yych == '\\') goto yy461; - goto yy456; + if (yych <= '\r') goto yy489; + if (yych == '\\') goto yy490; + goto yy485; } -yy454: +yy483: ++YYCURSOR; -#line 556 "../src/ast/lex.re" +#line 578 "../src/ast/lex.re" { fail_if_eof(); return 0; } -#line 2696 "src/ast/lex.cc" -yy456: +#line 2885 "src/ast/lex.cc" +yy485: ++YYCURSOR; -yy457: -#line 562 "../src/ast/lex.re" +yy486: +#line 584 "../src/ast/lex.re" { return static_cast(tok[0]); } -#line 2702 "src/ast/lex.cc" -yy458: +#line 2891 "src/ast/lex.cc" +yy487: ++YYCURSOR; -#line 557 "../src/ast/lex.re" +#line 579 "../src/ast/lex.re" { fatal_lc(l, c, "newline in character class"); } -#line 2707 "src/ast/lex.cc" -yy460: +#line 2896 "src/ast/lex.cc" +yy489: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy458; - goto yy457; -yy461: + if (yych == '\n') goto yy487; + goto yy486; +yy490: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '\\') { if (yych <= '/') { if (yych <= '\f') { - if (yych <= 0x00) goto yy462; - if (yych == '\n') goto yy458; - goto yy463; + if (yych <= 0x00) goto yy491; + if (yych == '\n') goto yy487; + goto yy492; } else { - if (yych <= '\r') goto yy465; - if (yych == '-') goto yy466; - goto yy463; + if (yych <= '\r') goto yy494; + if (yych == '-') goto yy495; + goto yy492; } } else { if (yych <= 'U') { - if (yych <= '3') goto yy468; - if (yych <= '7') goto yy470; - if (yych <= 'T') goto yy463; - goto yy471; + if (yych <= '3') goto yy497; + if (yych <= '7') goto yy499; + if (yych <= 'T') goto yy492; + goto yy500; } else { - if (yych == 'X') goto yy473; - if (yych <= '[') goto yy463; - goto yy474; + if (yych == 'X') goto yy502; + if (yych <= '[') goto yy492; + goto yy503; } } } else { if (yych <= 'n') { if (yych <= 'b') { - if (yych <= ']') goto yy476; - if (yych <= '`') goto yy463; - if (yych <= 'a') goto yy478; - goto yy480; + if (yych <= ']') goto yy505; + if (yych <= '`') goto yy492; + if (yych <= 'a') goto yy507; + goto yy509; } else { - if (yych == 'f') goto yy482; - if (yych <= 'm') goto yy463; - goto yy484; + if (yych == 'f') goto yy511; + if (yych <= 'm') goto yy492; + goto yy513; } } else { if (yych <= 't') { - if (yych == 'r') goto yy486; - if (yych <= 's') goto yy463; - goto yy488; + if (yych == 'r') goto yy515; + if (yych <= 's') goto yy492; + goto yy517; } else { if (yych <= 'v') { - if (yych <= 'u') goto yy473; - goto yy490; + if (yych <= 'u') goto yy502; + goto yy519; } else { - if (yych == 'x') goto yy492; - goto yy463; + if (yych == 'x') goto yy521; + goto yy492; } } } } -yy462: -#line 560 "../src/ast/lex.re" +yy491: +#line 582 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in escape sequence"); } -#line 2768 "src/ast/lex.cc" -yy463: +#line 2957 "src/ast/lex.cc" +yy492: ++YYCURSOR; -yy464: -#line 575 "../src/ast/lex.re" +yy493: +#line 597 "../src/ast/lex.re" { warn.useless_escape(cline, get_column(), tok[1]); return static_cast(tok[1]); } -#line 2777 "src/ast/lex.cc" -yy465: +#line 2966 "src/ast/lex.cc" +yy494: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy458; - goto yy464; -yy466: + if (yych == '\n') goto yy487; + goto yy493; +yy495: ++YYCURSOR; -#line 573 "../src/ast/lex.re" +#line 595 "../src/ast/lex.re" { return static_cast('-'); } -#line 2786 "src/ast/lex.cc" -yy468: +#line 2975 "src/ast/lex.cc" +yy497: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy469; - if (yych <= '7') goto yy493; -yy469: -#line 559 "../src/ast/lex.re" + if (yych <= '/') goto yy498; + if (yych <= '7') goto yy522; +yy498: +#line 581 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in octal escape sequence"); } -#line 2795 "src/ast/lex.cc" -yy470: +#line 2984 "src/ast/lex.cc" +yy499: ++YYCURSOR; - goto yy469; -yy471: + goto yy498; +yy500: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy472; - if (yych <= '9') goto yy495; + if (yych <= '/') goto yy501; + if (yych <= '9') goto yy524; } else { - if (yych <= 'F') goto yy495; - if (yych <= '`') goto yy472; - if (yych <= 'f') goto yy495; + if (yych <= 'F') goto yy524; + if (yych <= '`') goto yy501; + if (yych <= 'f') goto yy524; } -yy472: -#line 558 "../src/ast/lex.re" +yy501: +#line 580 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in hexadecimal escape sequence"); } -#line 2813 "src/ast/lex.cc" -yy473: +#line 3002 "src/ast/lex.cc" +yy502: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy472; - if (yych <= '9') goto yy496; - goto yy472; + if (yych <= '/') goto yy501; + if (yych <= '9') goto yy525; + goto yy501; } else { - if (yych <= 'F') goto yy496; - if (yych <= '`') goto yy472; - if (yych <= 'f') goto yy496; - goto yy472; + if (yych <= 'F') goto yy525; + if (yych <= '`') goto yy501; + if (yych <= 'f') goto yy525; + goto yy501; } -yy474: +yy503: ++YYCURSOR; -#line 572 "../src/ast/lex.re" +#line 594 "../src/ast/lex.re" { return static_cast('\\'); } -#line 2831 "src/ast/lex.cc" -yy476: +#line 3020 "src/ast/lex.cc" +yy505: ++YYCURSOR; -#line 574 "../src/ast/lex.re" +#line 596 "../src/ast/lex.re" { return static_cast(']'); } -#line 2836 "src/ast/lex.cc" -yy478: +#line 3025 "src/ast/lex.cc" +yy507: ++YYCURSOR; -#line 565 "../src/ast/lex.re" +#line 587 "../src/ast/lex.re" { return static_cast('\a'); } -#line 2841 "src/ast/lex.cc" -yy480: +#line 3030 "src/ast/lex.cc" +yy509: ++YYCURSOR; -#line 566 "../src/ast/lex.re" +#line 588 "../src/ast/lex.re" { return static_cast('\b'); } -#line 2846 "src/ast/lex.cc" -yy482: +#line 3035 "src/ast/lex.cc" +yy511: ++YYCURSOR; -#line 567 "../src/ast/lex.re" +#line 589 "../src/ast/lex.re" { return static_cast('\f'); } -#line 2851 "src/ast/lex.cc" -yy484: +#line 3040 "src/ast/lex.cc" +yy513: ++YYCURSOR; -#line 568 "../src/ast/lex.re" +#line 590 "../src/ast/lex.re" { return static_cast('\n'); } -#line 2856 "src/ast/lex.cc" -yy486: +#line 3045 "src/ast/lex.cc" +yy515: ++YYCURSOR; -#line 569 "../src/ast/lex.re" +#line 591 "../src/ast/lex.re" { return static_cast('\r'); } -#line 2861 "src/ast/lex.cc" -yy488: +#line 3050 "src/ast/lex.cc" +yy517: ++YYCURSOR; -#line 570 "../src/ast/lex.re" +#line 592 "../src/ast/lex.re" { return static_cast('\t'); } -#line 2866 "src/ast/lex.cc" -yy490: +#line 3055 "src/ast/lex.cc" +yy519: ++YYCURSOR; -#line 571 "../src/ast/lex.re" +#line 593 "../src/ast/lex.re" { return static_cast('\v'); } -#line 2871 "src/ast/lex.cc" -yy492: +#line 3060 "src/ast/lex.cc" +yy521: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy472; - if (yych <= '9') goto yy497; - goto yy472; + if (yych <= '/') goto yy501; + if (yych <= '9') goto yy526; + goto yy501; } else { - if (yych <= 'F') goto yy497; - if (yych <= '`') goto yy472; - if (yych <= 'f') goto yy497; - goto yy472; + if (yych <= 'F') goto yy526; + if (yych <= '`') goto yy501; + if (yych <= 'f') goto yy526; + goto yy501; } -yy493: +yy522: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '/') goto yy494; - if (yych <= '7') goto yy498; -yy494: + if (yych <= '/') goto yy523; + if (yych <= '7') goto yy527; +yy523: YYCURSOR = YYMARKER; if (yyaccept == 0) { - goto yy469; + goto yy498; } else { - goto yy472; + goto yy501; } -yy495: +yy524: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy494; - if (yych <= '9') goto yy500; - goto yy494; + if (yych <= '/') goto yy523; + if (yych <= '9') goto yy529; + goto yy523; } else { - if (yych <= 'F') goto yy500; - if (yych <= '`') goto yy494; - if (yych <= 'f') goto yy500; - goto yy494; + if (yych <= 'F') goto yy529; + if (yych <= '`') goto yy523; + if (yych <= 'f') goto yy529; + goto yy523; } -yy496: +yy525: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy494; - if (yych <= '9') goto yy501; - goto yy494; + if (yych <= '/') goto yy523; + if (yych <= '9') goto yy530; + goto yy523; } else { - if (yych <= 'F') goto yy501; - if (yych <= '`') goto yy494; - if (yych <= 'f') goto yy501; - goto yy494; + if (yych <= 'F') goto yy530; + if (yych <= '`') goto yy523; + if (yych <= 'f') goto yy530; + goto yy523; } -yy497: +yy526: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy494; - if (yych <= '9') goto yy502; - goto yy494; + if (yych <= '/') goto yy523; + if (yych <= '9') goto yy531; + goto yy523; } else { - if (yych <= 'F') goto yy502; - if (yych <= '`') goto yy494; - if (yych <= 'f') goto yy502; - goto yy494; + if (yych <= 'F') goto yy531; + if (yych <= '`') goto yy523; + if (yych <= 'f') goto yy531; + goto yy523; } -yy498: +yy527: ++YYCURSOR; -#line 564 "../src/ast/lex.re" +#line 586 "../src/ast/lex.re" { return unesc_oct(tok, cur); } -#line 2936 "src/ast/lex.cc" -yy500: +#line 3125 "src/ast/lex.cc" +yy529: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy494; - if (yych <= '9') goto yy504; - goto yy494; + if (yych <= '/') goto yy523; + if (yych <= '9') goto yy533; + goto yy523; } else { - if (yych <= 'F') goto yy504; - if (yych <= '`') goto yy494; - if (yych <= 'f') goto yy504; - goto yy494; + if (yych <= 'F') goto yy533; + if (yych <= '`') goto yy523; + if (yych <= 'f') goto yy533; + goto yy523; } -yy501: +yy530: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy494; - if (yych <= '9') goto yy497; - goto yy494; + if (yych <= '/') goto yy523; + if (yych <= '9') goto yy526; + goto yy523; } else { - if (yych <= 'F') goto yy497; - if (yych <= '`') goto yy494; - if (yych <= 'f') goto yy497; - goto yy494; + if (yych <= 'F') goto yy526; + if (yych <= '`') goto yy523; + if (yych <= 'f') goto yy526; + goto yy523; } -yy502: +yy531: ++YYCURSOR; -#line 563 "../src/ast/lex.re" +#line 585 "../src/ast/lex.re" { return unesc_hex(tok, cur); } -#line 2965 "src/ast/lex.cc" -yy504: +#line 3154 "src/ast/lex.cc" +yy533: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy494; - if (yych >= ':') goto yy494; + if (yych <= '/') goto yy523; + if (yych >= ':') goto yy523; } else { - if (yych <= 'F') goto yy505; - if (yych <= '`') goto yy494; - if (yych >= 'g') goto yy494; + if (yych <= 'F') goto yy534; + if (yych <= '`') goto yy523; + if (yych >= 'g') goto yy523; } -yy505: +yy534: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy494; - if (yych <= '9') goto yy496; - goto yy494; + if (yych <= '/') goto yy523; + if (yych <= '9') goto yy525; + goto yy523; } else { - if (yych <= 'F') goto yy496; - if (yych <= '`') goto yy494; - if (yych <= 'f') goto yy496; - goto yy494; + if (yych <= 'F') goto yy525; + if (yych <= '`') goto yy523; + if (yych <= 'f') goto yy525; + goto yy523; } } -#line 579 "../src/ast/lex.re" +#line 601 "../src/ast/lex.re" } @@ -2995,309 +3184,309 @@ uint32_t Scanner::lex_str_chr(char quote, bool &end) tok = cur; const uint32_t l = get_cline(), c = get_column(); -#line 2999 "src/ast/lex.cc" +#line 3188 "src/ast/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; if ((YYLIMIT - YYCURSOR) < 10) YYFILL(10); yych = (YYCTYPE)*YYCURSOR; if (yych <= '\f') { - if (yych <= 0x00) goto yy508; - if (yych == '\n') goto yy512; - goto yy510; + if (yych <= 0x00) goto yy537; + if (yych == '\n') goto yy541; + goto yy539; } else { - if (yych <= '\r') goto yy514; - if (yych == '\\') goto yy515; - goto yy510; + if (yych <= '\r') goto yy543; + if (yych == '\\') goto yy544; + goto yy539; } -yy508: +yy537: ++YYCURSOR; -#line 589 "../src/ast/lex.re" +#line 611 "../src/ast/lex.re" { fail_if_eof(); return 0; } -#line 3018 "src/ast/lex.cc" -yy510: +#line 3207 "src/ast/lex.cc" +yy539: ++YYCURSOR; -yy511: -#line 595 "../src/ast/lex.re" +yy540: +#line 617 "../src/ast/lex.re" { end = tok[0] == quote; return static_cast(tok[0]); } -#line 3027 "src/ast/lex.cc" -yy512: +#line 3216 "src/ast/lex.cc" +yy541: ++YYCURSOR; -#line 590 "../src/ast/lex.re" +#line 612 "../src/ast/lex.re" { fatal_lc(l, c, "newline in character string"); } -#line 3032 "src/ast/lex.cc" -yy514: +#line 3221 "src/ast/lex.cc" +yy543: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy512; - goto yy511; -yy515: + if (yych == '\n') goto yy541; + goto yy540; +yy544: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '`') { if (yych <= '3') { if (yych <= '\n') { - if (yych <= 0x00) goto yy516; - if (yych <= '\t') goto yy517; - goto yy512; + if (yych <= 0x00) goto yy545; + if (yych <= '\t') goto yy546; + goto yy541; } else { - if (yych == '\r') goto yy519; - if (yych <= '/') goto yy517; - goto yy520; + if (yych == '\r') goto yy548; + if (yych <= '/') goto yy546; + goto yy549; } } else { if (yych <= 'W') { - if (yych <= '7') goto yy522; - if (yych == 'U') goto yy523; - goto yy517; + if (yych <= '7') goto yy551; + if (yych == 'U') goto yy552; + goto yy546; } else { - if (yych <= 'X') goto yy525; - if (yych == '\\') goto yy526; - goto yy517; + if (yych <= 'X') goto yy554; + if (yych == '\\') goto yy555; + goto yy546; } } } else { if (yych <= 'q') { if (yych <= 'e') { - if (yych <= 'a') goto yy528; - if (yych <= 'b') goto yy530; - goto yy517; + if (yych <= 'a') goto yy557; + if (yych <= 'b') goto yy559; + goto yy546; } else { - if (yych <= 'f') goto yy532; - if (yych == 'n') goto yy534; - goto yy517; + if (yych <= 'f') goto yy561; + if (yych == 'n') goto yy563; + goto yy546; } } else { if (yych <= 'u') { - if (yych <= 'r') goto yy536; - if (yych <= 's') goto yy517; - if (yych <= 't') goto yy538; - goto yy525; + if (yych <= 'r') goto yy565; + if (yych <= 's') goto yy546; + if (yych <= 't') goto yy567; + goto yy554; } else { - if (yych <= 'v') goto yy540; - if (yych == 'x') goto yy542; - goto yy517; + if (yych <= 'v') goto yy569; + if (yych == 'x') goto yy571; + goto yy546; } } } -yy516: -#line 593 "../src/ast/lex.re" +yy545: +#line 615 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in escape sequence"); } -#line 3088 "src/ast/lex.cc" -yy517: +#line 3277 "src/ast/lex.cc" +yy546: ++YYCURSOR; -yy518: -#line 609 "../src/ast/lex.re" +yy547: +#line 631 "../src/ast/lex.re" { if (tok[1] != quote) { warn.useless_escape(cline, get_column(), tok[1]); } return static_cast(tok[1]); } -#line 3099 "src/ast/lex.cc" -yy519: +#line 3288 "src/ast/lex.cc" +yy548: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy512; - goto yy518; -yy520: + if (yych == '\n') goto yy541; + goto yy547; +yy549: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy521; - if (yych <= '7') goto yy543; -yy521: -#line 592 "../src/ast/lex.re" + if (yych <= '/') goto yy550; + if (yych <= '7') goto yy572; +yy550: +#line 614 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in octal escape sequence"); } -#line 3112 "src/ast/lex.cc" -yy522: +#line 3301 "src/ast/lex.cc" +yy551: ++YYCURSOR; - goto yy521; -yy523: + goto yy550; +yy552: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy524; - if (yych <= '9') goto yy545; + if (yych <= '/') goto yy553; + if (yych <= '9') goto yy574; } else { - if (yych <= 'F') goto yy545; - if (yych <= '`') goto yy524; - if (yych <= 'f') goto yy545; + if (yych <= 'F') goto yy574; + if (yych <= '`') goto yy553; + if (yych <= 'f') goto yy574; } -yy524: -#line 591 "../src/ast/lex.re" +yy553: +#line 613 "../src/ast/lex.re" { fatal_lc(l, c, "syntax error in hexadecimal escape sequence"); } -#line 3130 "src/ast/lex.cc" -yy525: +#line 3319 "src/ast/lex.cc" +yy554: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy524; - if (yych <= '9') goto yy546; - goto yy524; + if (yych <= '/') goto yy553; + if (yych <= '9') goto yy575; + goto yy553; } else { - if (yych <= 'F') goto yy546; - if (yych <= '`') goto yy524; - if (yych <= 'f') goto yy546; - goto yy524; + if (yych <= 'F') goto yy575; + if (yych <= '`') goto yy553; + if (yych <= 'f') goto yy575; + goto yy553; } -yy526: +yy555: ++YYCURSOR; -#line 608 "../src/ast/lex.re" +#line 630 "../src/ast/lex.re" { return static_cast('\\'); } -#line 3148 "src/ast/lex.cc" -yy528: +#line 3337 "src/ast/lex.cc" +yy557: ++YYCURSOR; -#line 601 "../src/ast/lex.re" +#line 623 "../src/ast/lex.re" { return static_cast('\a'); } -#line 3153 "src/ast/lex.cc" -yy530: +#line 3342 "src/ast/lex.cc" +yy559: ++YYCURSOR; -#line 602 "../src/ast/lex.re" +#line 624 "../src/ast/lex.re" { return static_cast('\b'); } -#line 3158 "src/ast/lex.cc" -yy532: +#line 3347 "src/ast/lex.cc" +yy561: ++YYCURSOR; -#line 603 "../src/ast/lex.re" +#line 625 "../src/ast/lex.re" { return static_cast('\f'); } -#line 3163 "src/ast/lex.cc" -yy534: +#line 3352 "src/ast/lex.cc" +yy563: ++YYCURSOR; -#line 604 "../src/ast/lex.re" +#line 626 "../src/ast/lex.re" { return static_cast('\n'); } -#line 3168 "src/ast/lex.cc" -yy536: +#line 3357 "src/ast/lex.cc" +yy565: ++YYCURSOR; -#line 605 "../src/ast/lex.re" +#line 627 "../src/ast/lex.re" { return static_cast('\r'); } -#line 3173 "src/ast/lex.cc" -yy538: +#line 3362 "src/ast/lex.cc" +yy567: ++YYCURSOR; -#line 606 "../src/ast/lex.re" +#line 628 "../src/ast/lex.re" { return static_cast('\t'); } -#line 3178 "src/ast/lex.cc" -yy540: +#line 3367 "src/ast/lex.cc" +yy569: ++YYCURSOR; -#line 607 "../src/ast/lex.re" +#line 629 "../src/ast/lex.re" { return static_cast('\v'); } -#line 3183 "src/ast/lex.cc" -yy542: +#line 3372 "src/ast/lex.cc" +yy571: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy524; - if (yych <= '9') goto yy547; - goto yy524; + if (yych <= '/') goto yy553; + if (yych <= '9') goto yy576; + goto yy553; } else { - if (yych <= 'F') goto yy547; - if (yych <= '`') goto yy524; - if (yych <= 'f') goto yy547; - goto yy524; + if (yych <= 'F') goto yy576; + if (yych <= '`') goto yy553; + if (yych <= 'f') goto yy576; + goto yy553; } -yy543: +yy572: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '/') goto yy544; - if (yych <= '7') goto yy548; -yy544: + if (yych <= '/') goto yy573; + if (yych <= '7') goto yy577; +yy573: YYCURSOR = YYMARKER; if (yyaccept == 0) { - goto yy521; + goto yy550; } else { - goto yy524; + goto yy553; } -yy545: +yy574: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy544; - if (yych <= '9') goto yy550; - goto yy544; + if (yych <= '/') goto yy573; + if (yych <= '9') goto yy579; + goto yy573; } else { - if (yych <= 'F') goto yy550; - if (yych <= '`') goto yy544; - if (yych <= 'f') goto yy550; - goto yy544; + if (yych <= 'F') goto yy579; + if (yych <= '`') goto yy573; + if (yych <= 'f') goto yy579; + goto yy573; } -yy546: +yy575: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy544; - if (yych <= '9') goto yy551; - goto yy544; + if (yych <= '/') goto yy573; + if (yych <= '9') goto yy580; + goto yy573; } else { - if (yych <= 'F') goto yy551; - if (yych <= '`') goto yy544; - if (yych <= 'f') goto yy551; - goto yy544; + if (yych <= 'F') goto yy580; + if (yych <= '`') goto yy573; + if (yych <= 'f') goto yy580; + goto yy573; } -yy547: +yy576: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy544; - if (yych <= '9') goto yy552; - goto yy544; + if (yych <= '/') goto yy573; + if (yych <= '9') goto yy581; + goto yy573; } else { - if (yych <= 'F') goto yy552; - if (yych <= '`') goto yy544; - if (yych <= 'f') goto yy552; - goto yy544; + if (yych <= 'F') goto yy581; + if (yych <= '`') goto yy573; + if (yych <= 'f') goto yy581; + goto yy573; } -yy548: +yy577: ++YYCURSOR; -#line 600 "../src/ast/lex.re" +#line 622 "../src/ast/lex.re" { return unesc_oct(tok, cur); } -#line 3248 "src/ast/lex.cc" -yy550: +#line 3437 "src/ast/lex.cc" +yy579: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy544; - if (yych <= '9') goto yy554; - goto yy544; + if (yych <= '/') goto yy573; + if (yych <= '9') goto yy583; + goto yy573; } else { - if (yych <= 'F') goto yy554; - if (yych <= '`') goto yy544; - if (yych <= 'f') goto yy554; - goto yy544; + if (yych <= 'F') goto yy583; + if (yych <= '`') goto yy573; + if (yych <= 'f') goto yy583; + goto yy573; } -yy551: +yy580: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy544; - if (yych <= '9') goto yy547; - goto yy544; + if (yych <= '/') goto yy573; + if (yych <= '9') goto yy576; + goto yy573; } else { - if (yych <= 'F') goto yy547; - if (yych <= '`') goto yy544; - if (yych <= 'f') goto yy547; - goto yy544; + if (yych <= 'F') goto yy576; + if (yych <= '`') goto yy573; + if (yych <= 'f') goto yy576; + goto yy573; } -yy552: +yy581: ++YYCURSOR; -#line 599 "../src/ast/lex.re" +#line 621 "../src/ast/lex.re" { return unesc_hex(tok, cur); } -#line 3277 "src/ast/lex.cc" -yy554: +#line 3466 "src/ast/lex.cc" +yy583: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy544; - if (yych >= ':') goto yy544; + if (yych <= '/') goto yy573; + if (yych >= ':') goto yy573; } else { - if (yych <= 'F') goto yy555; - if (yych <= '`') goto yy544; - if (yych >= 'g') goto yy544; + if (yych <= 'F') goto yy584; + if (yych <= '`') goto yy573; + if (yych >= 'g') goto yy573; } -yy555: +yy584: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy544; - if (yych <= '9') goto yy546; - goto yy544; + if (yych <= '/') goto yy573; + if (yych <= '9') goto yy575; + goto yy573; } else { - if (yych <= 'F') goto yy546; - if (yych <= '`') goto yy544; - if (yych <= 'f') goto yy546; - goto yy544; + if (yych <= 'F') goto yy575; + if (yych <= '`') goto yy573; + if (yych <= 'f') goto yy575; + goto yy573; } } -#line 615 "../src/ast/lex.re" +#line 637 "../src/ast/lex.re" } @@ -3317,7 +3506,7 @@ void Scanner::set_sourceline () sourceline: tok = cur; -#line 3321 "src/ast/lex.cc" +#line 3510 "src/ast/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -3358,94 +3547,94 @@ sourceline: yych = (YYCTYPE)*YYCURSOR; if (yych <= '\r') { if (yych <= '\t') { - if (yych >= 0x01) goto yy560; + if (yych >= 0x01) goto yy589; } else { - if (yych <= '\n') goto yy562; - if (yych <= '\f') goto yy560; - goto yy564; + if (yych <= '\n') goto yy591; + if (yych <= '\f') goto yy589; + goto yy593; } } else { if (yych <= '"') { - if (yych <= '!') goto yy560; - goto yy565; + if (yych <= '!') goto yy589; + goto yy594; } else { - if (yych <= '0') goto yy560; - if (yych <= '9') goto yy566; - goto yy560; + if (yych <= '0') goto yy589; + if (yych <= '9') goto yy595; + goto yy589; } } ++YYCURSOR; -#line 649 "../src/ast/lex.re" +#line 671 "../src/ast/lex.re" { --cur; return; } -#line 3381 "src/ast/lex.cc" -yy560: +#line 3570 "src/ast/lex.cc" +yy589: ++YYCURSOR; -yy561: -#line 650 "../src/ast/lex.re" +yy590: +#line 672 "../src/ast/lex.re" { goto sourceline; } -#line 3387 "src/ast/lex.cc" -yy562: +#line 3576 "src/ast/lex.cc" +yy591: ++YYCURSOR; -#line 648 "../src/ast/lex.re" +#line 670 "../src/ast/lex.re" { tok = cur; return; } -#line 3392 "src/ast/lex.cc" -yy564: +#line 3581 "src/ast/lex.cc" +yy593: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '\n') goto yy562; - goto yy561; -yy565: + if (yych == '\n') goto yy591; + goto yy590; +yy594: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych <= 0x00) goto yy561; - if (yych == '\n') goto yy561; - goto yy570; -yy566: + if (yych <= 0x00) goto yy590; + if (yych == '\n') goto yy590; + goto yy599; +yy595: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 64) { - goto yy566; + goto yy595; } -#line 634 "../src/ast/lex.re" +#line 656 "../src/ast/lex.re" { if (!s_to_u32_unsafe (tok, cur, cline)) { fatal_lc(get_cline(), get_column(), "line number overflow"); } goto sourceline; } -#line 3416 "src/ast/lex.cc" -yy569: +#line 3605 "src/ast/lex.cc" +yy598: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy570: +yy599: if (yybm[0+yych] & 128) { - goto yy569; + goto yy598; } - if (yych <= '\n') goto yy571; - if (yych <= '"') goto yy572; - goto yy574; -yy571: + if (yych <= '\n') goto yy600; + if (yych <= '"') goto yy601; + goto yy603; +yy600: YYCURSOR = YYMARKER; - goto yy561; -yy572: + goto yy590; +yy601: ++YYCURSOR; -#line 641 "../src/ast/lex.re" +#line 663 "../src/ast/lex.re" { - std::string &name = files.top()->escaped_name; + std::string &name = get_input().escaped_name; name = std::string(tok + 1, tok_len () - 2); // strip quotes strrreplace(name, "\\", "\\\\"); goto sourceline; } -#line 3440 "src/ast/lex.cc" -yy574: +#line 3629 "src/ast/lex.cc" +yy603: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x00) goto yy571; - if (yych == '\n') goto yy571; - goto yy569; + if (yych <= 0x00) goto yy600; + if (yych == '\n') goto yy600; + goto yy598; } -#line 651 "../src/ast/lex.re" +#line 673 "../src/ast/lex.re" } diff --git a/re2c/bootstrap/src/ast/lex.h b/re2c/bootstrap/src/ast/lex.h index 762da47f..af55122d 100644 --- a/re2c/bootstrap/src/ast/lex.h +++ b/re2c/bootstrap/src/ast/lex.h @@ -1,4 +1,4 @@ -/* Generated by re2c 1.1.1 on Sun Dec 23 19:24:34 2018 */ +/* Generated by re2c 1.1.1 on Tue Dec 25 19:04:05 2018 */ #include #include "src/util/forbid_copy.h" @@ -15,7 +15,7 @@ struct ScannerState size_t BSIZE; char *bot, *lim, *cur, *mar, *ctx, *tok, *ptr, *pos, *eof; - char *yyt1; + char *yyt1;char *yyt2; ptrdiff_t tchar; uint32_t cline; @@ -32,7 +32,7 @@ struct ScannerState , ptr(lim) , pos(lim) , eof(NULL) - , yyt1(lim) + , yyt1(lim), yyt2(lim) , tchar(0) , cline(1) { @@ -50,7 +50,7 @@ struct ScannerState tok += offs; ptr += offs; pos += offs; - yyt1 += offs; + yyt1 += offs;yyt2 += offs; } FORBID_COPY(ScannerState); diff --git a/re2c/src/ast/input.cc b/re2c/src/ast/input.cc index 64853b1e..59a1db29 100644 --- a/re2c/src/ast/input.cc +++ b/re2c/src/ast/input.cc @@ -1,10 +1,17 @@ #include "src/ast/input.h" +#include "src/ast/scanner.h" #include "src/conf/msg.h" #include "src/util/string_utils.h" namespace re2c { -Input::Input(): file(NULL), name(), escaped_name() {} +Input::Input() + : file(NULL) + , name() + , escaped_name() + , so(Scanner::ENDPOS) + , eo(Scanner::ENDPOS) +{} bool Input::open(const char *filename) { diff --git a/re2c/src/ast/input.h b/re2c/src/ast/input.h index 7c7131fc..7f51b89b 100644 --- a/re2c/src/ast/input.h +++ b/re2c/src/ast/input.h @@ -12,6 +12,8 @@ struct Input FILE *file; std::string name; std::string escaped_name; + const char *so; // start offset in buffer + const char *eo; // end offset in buffer Input(); ~Input(); diff --git a/re2c/src/ast/lex.re b/re2c/src/ast/lex.re index 5021783a..6431fe68 100644 --- a/re2c/src/ast/lex.re +++ b/re2c/src/ast/lex.re @@ -200,6 +200,12 @@ echo: goto echo; } + "/*!include:re2c" { + out.wraw(tok, ptr); + lex_include(); + goto echo; + } + eof { if (!is_eof()) goto echo; out.wraw(tok, ptr); @@ -241,6 +247,22 @@ void Scanner::lex_end_of_comment(Output &out) */} } +void Scanner::lex_include() +{ + const char *x, *y; +/*!re2c + * { + fatal_lc(get_cline(), get_column() + , "syntax error in include directive"); + } + + space+ @x dstring @y space* eoc { + push_file(std::string(x + 1, static_cast(y - x) - 2)); + return; + } +*/ +} + void Scanner::lex_tags(Output &out, bool mtags) { std::string fmt, sep; @@ -639,7 +661,7 @@ sourceline: } dstring { - std::string &name = files.top()->escaped_name; + std::string &name = get_input().escaped_name; name = std::string(tok + 1, tok_len () - 2); // strip quotes strrreplace(name, "\\", "\\\\"); goto sourceline; diff --git a/re2c/src/ast/scanner.cc b/re2c/src/ast/scanner.cc index b128880d..407a0825 100644 --- a/re2c/src/ast/scanner.cc +++ b/re2c/src/ast/scanner.cc @@ -9,67 +9,111 @@ namespace re2c { class Warn; -Scanner::Scanner(Warn &w) - : ScannerState() - , files() - , warn(w) -{} +const char *const Scanner::ENDPOS = (const char*) ~0LU; Scanner::~Scanner() { - for (; !files.empty(); ) { - delete files.top(); - files.pop(); + for (size_t i = files.size(); i --> 0; ) { + delete files[i]; } } -bool Scanner::push_file(const char *filename) +size_t Scanner::get_input_index() const { - // push buffer tail back to file - we'll return to it later - if (!files.empty()) { - int err = fseek(files.top()->file, lim - cur, SEEK_CUR); - if (err != 0) return false; + size_t i = files.size(); + assert(i > 0); + do --i; while (i > 0 && files[i]->so > cur); + return i; +} + +bool Scanner::push_file(const std::string &filename) +{ + // unread buffer tail: we'll return to it later + for (size_t i = files.size(); i --> 0; ) { + Input *in = files[i]; + if (in->so >= cur) { + // unread whole fragment + fseek(in->file, in->so - in->eo, SEEK_CUR); + in->so = in->eo = ENDPOS; + } + else if (in->eo >= cur) { + // fragment on the boundary, unread partially + fseek(in->file, cur - in->eo, SEEK_CUR); + in->eo = cur - 1; + } + else { + // the rest has been consumed already + break; + } } // open new file and place place at the top of stack - Input *f = new Input; - files.push(f); - if (!f->open(filename)) return false; + Input *in = new Input; + files.push_back(in); + if (!in->open(filename.c_str())) return false; - // refill buffer + // refill buffer (discard everything up to cursor, clear EOF) + lim = cur = mar = ctx = tok = ptr = pos = bot + BSIZE; + eof = NULL; return fill(BSIZE); } bool Scanner::read(size_t want) { - const char *stop = lim + want; assert(!files.empty()); - for (;;) { - Input *f = files.top(); - lim += fread(lim, 1, want, f->file); + for (size_t i = files.size(); i --> 0; ) { + Input *in = files[i]; + const size_t have = fread(lim, 1, want, in->file); + in->so = lim; + lim += have; + in->eo = lim; + want -= have; // buffer filled - if (lim == stop) return true; - - // the first file must remain at the bottom of the stack - if (files.size() == 1) break; - delete f; - files.pop(); + if (want == 0) return true; } return false; } +void Scanner::shift_ptrs_and_fpos(ptrdiff_t offs) +{ + // shift buffer pointers + shift_ptrs(offs); + + // shift file pointers + for (size_t i = files.size(); i --> 0; ) { + Input *in = files[i]; + if (in->so == ENDPOS && in->eo == ENDPOS) break; + assert(in->so != ENDPOS && in->eo != ENDPOS); + in->so += offs; + in->eo += offs; + } +} + +void Scanner::pop_finished_files() +{ + // Pop all files that have been fully processed (file upper bound + // in buffer points before the first character of current lexeme), + // except for the first (main) file which must always remain at the + // bottom of the stack. + size_t i = files.size(); + assert(i > 0); + do --i; while (i > 0 && files[i]->eo <= tok); +} + bool Scanner::fill(size_t need) { if (eof) return false; + pop_finished_files(); + assert(bot <= tok && tok <= lim); size_t free = static_cast(tok - bot); size_t copy = static_cast(lim - tok); if (free >= need) { memmove(bot, tok, copy); - shift_ptrs(-static_cast(free)); + shift_ptrs_and_fpos(-static_cast(free)); } else { BSIZE += std::max(BSIZE, need); @@ -77,7 +121,7 @@ bool Scanner::fill(size_t need) if (!buf) fatal("out of memory"); memmove(buf, tok, copy); - shift_ptrs(buf - bot); + shift_ptrs_and_fpos(buf - bot); delete [] bot; bot = buf; diff --git a/re2c/src/ast/scanner.h b/re2c/src/ast/scanner.h index bfe39c07..2618b7e0 100644 --- a/re2c/src/ast/scanner.h +++ b/re2c/src/ast/scanner.h @@ -4,8 +4,8 @@ #include #include "src/util/c99_stdint.h" #include -#include #include +#include #include "src/ast/input.h" #include "src/ast/lex.h" @@ -29,26 +29,35 @@ class Scanner: private ScannerState { public: enum ParseMode {Stop, Parse, Reuse, Rules}; + static const char *const ENDPOS; private: - std::stack files; + std::vector files; Warn &warn; public: explicit Scanner(Warn &w); ~Scanner(); - bool push_file(const char *filename); + bool push_file(const std::string &filename); + uint32_t get_cline() const; + uint32_t get_column() const; + const std::string & get_fname() const; ParseMode echo(Output &out); int scan(const conopt_t *globopts); void lex_conf(Opt &opts); - uint32_t get_cline() const; - uint32_t get_column() const; - const std::string & get_fname () const; private: bool read(size_t want); bool fill(size_t need); + void shift_ptrs_and_fpos(ptrdiff_t offs); + void pop_finished_files(); + size_t get_input_index() const; + Input& get_input(); + const Input& get_cinput() const; + size_t tok_len() const; + void set_sourceline (); void lex_end_of_comment(Output &out); + void lex_include(); void lex_code_indented(); void lex_code_in_braces(); void lex_c_comment(); @@ -58,7 +67,6 @@ private: int lex_clist(); void lex_string(char delim); void lex_tags(Output &out, bool mtags); - void set_sourceline (); uint32_t lex_cls_chr(); uint32_t lex_str_chr(char quote, bool &end); const AST *lex_cls(bool neg); @@ -73,22 +81,26 @@ private: int32_t lex_conf_number(); bool lex_conf_bool(); std::string lex_conf_string(); - size_t tok_len() const; bool is_eof() const; void fail_if_eof() const; FORBID_COPY (Scanner); }; -inline size_t Scanner::tok_len () const +inline Scanner::Scanner(Warn &w) + : ScannerState() + , files() + , warn(w) +{} + +inline size_t Scanner::tok_len() const { - // lexing and fill procedures must maintain: token pointer <= cursor pointer - return static_cast (cur - tok); + return static_cast(cur - tok); } -inline const std::string & Scanner::get_fname () const +inline const std::string & Scanner::get_fname() const { - return files.top()->escaped_name; + return get_cinput().escaped_name; } inline uint32_t Scanner::get_cline() const @@ -106,6 +118,16 @@ inline bool Scanner::is_eof() const return eof && cur > eof; } +inline Input& Scanner::get_input() +{ + return *files[get_input_index()]; +} + +inline const Input& Scanner::get_cinput() const +{ + return *files[get_input_index()]; +} + } // end namespace re2c #endif // _RE2C_AST_SCANNER_ -- 2.40.0