From: Ulya Trofimovich Date: Fri, 30 Dec 2016 17:15:16 +0000 (+0000) Subject: Fold output expressions in a separate pass over the output. X-Git-Tag: 1.0~39^2~154 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d73eb3c3ac9183354a94c1569829352dc99060d;p=re2c Fold output expressions in a separate pass over the output. re2c folds sequences of simple statements to complex tatements, e.g.: ++YYCURSOR; yych = *YYCURSOR; is folded to: yych = *++YYCURSOR; It is hard to fold expressions on the fly (at the time they are generated), because one needs to forsee all the cases in advance. Some cases cannot be anticipated (e.g. if substatements belong to different states, which is often the case), so many statements remain unfolded. This commit separates code generation and folding by delaying output of skip, peek and backup primitives. Folding now is done in a separate pass when all the substatements are already known. --- diff --git a/re2c/bootstrap/src/conf/parse_opts.cc b/re2c/bootstrap/src/conf/parse_opts.cc index 34725411..7c12075f 100644 --- a/re2c/bootstrap/src/conf/parse_opts.cc +++ b/re2c/bootstrap/src/conf/parse_opts.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 0.16 on Sun Dec 18 12:23:03 2016 */ +/* Generated by re2c 0.16 on Fri Dec 30 11:03:32 2016 */ #line 1 "../src/conf/parse_opts.re" #include "src/codegen/input_api.h" #include "src/conf/msg.h" @@ -82,8 +82,7 @@ yy2: } #line 84 "src/conf/parse_opts.cc" yy4: - ++YYCURSOR; - yych = (YYCTYPE)*YYCURSOR; + yych = (YYCTYPE)*++YYCURSOR; if (yybm[0+yych] & 128) { goto yy4; } @@ -98,23 +97,23 @@ yy6: } #line 61 "../src/conf/parse_opts.re" { goto opt_short; } -#line 102 "src/conf/parse_opts.cc" +#line 101 "src/conf/parse_opts.cc" yy8: ++YYCURSOR; #line 59 "../src/conf/parse_opts.re" { if (!opts.source (*argv)) return EXIT_FAIL; goto opt; } -#line 107 "src/conf/parse_opts.cc" +#line 106 "src/conf/parse_opts.cc" yy10: ++YYCURSOR; #line 58 "../src/conf/parse_opts.re" { if (!opts.source ("")) return EXIT_FAIL; goto opt; } -#line 112 "src/conf/parse_opts.cc" +#line 111 "src/conf/parse_opts.cc" yy12: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy16; #line 62 "../src/conf/parse_opts.re" { goto opt_long; } -#line 118 "src/conf/parse_opts.cc" +#line 117 "src/conf/parse_opts.cc" yy14: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -127,7 +126,7 @@ yy14: yy15: #line 66 "../src/conf/parse_opts.re" { option = Warn::W; goto opt_warn; } -#line 131 "src/conf/parse_opts.cc" +#line 130 "src/conf/parse_opts.cc" yy16: ++YYCURSOR; #line 44 "../src/conf/parse_opts.re" @@ -144,12 +143,12 @@ yy16: } goto end; } -#line 148 "src/conf/parse_opts.cc" +#line 147 "src/conf/parse_opts.cc" yy18: ++YYCURSOR; #line 64 "../src/conf/parse_opts.re" { warn.set_all (); goto opt; } -#line 153 "src/conf/parse_opts.cc" +#line 152 "src/conf/parse_opts.cc" yy20: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy23; @@ -183,7 +182,7 @@ yy26: yy27: #line 67 "../src/conf/parse_opts.re" { option = Warn::WNO; goto opt_warn; } -#line 187 "src/conf/parse_opts.cc" +#line 186 "src/conf/parse_opts.cc" yy28: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy30; @@ -205,12 +204,12 @@ yy32: ++YYCURSOR; #line 65 "../src/conf/parse_opts.re" { warn.set_all_error (); goto opt; } -#line 209 "src/conf/parse_opts.cc" +#line 208 "src/conf/parse_opts.cc" yy34: ++YYCURSOR; #line 68 "../src/conf/parse_opts.re" { option = Warn::WERROR; goto opt_warn; } -#line 214 "src/conf/parse_opts.cc" +#line 213 "src/conf/parse_opts.cc" yy36: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'o') goto yy21; @@ -221,14 +220,14 @@ yy36: ++YYCURSOR; #line 69 "../src/conf/parse_opts.re" { option = Warn::WNOERROR; goto opt_warn; } -#line 225 "src/conf/parse_opts.cc" +#line 224 "src/conf/parse_opts.cc" } #line 70 "../src/conf/parse_opts.re" opt_warn: -#line 232 "src/conf/parse_opts.cc" +#line 231 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -249,7 +248,7 @@ yy44: error ("bad warning: %s", *argv); return EXIT_FAIL; } -#line 253 "src/conf/parse_opts.cc" +#line 252 "src/conf/parse_opts.cc" yy45: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'o') goto yy51; @@ -678,7 +677,7 @@ yy151: ++YYCURSOR; #line 83 "../src/conf/parse_opts.re" { warn.set (Warn::SWAPPED_RANGE, option); goto opt; } -#line 682 "src/conf/parse_opts.cc" +#line 681 "src/conf/parse_opts.cc" yy153: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy160; @@ -719,12 +718,12 @@ yy162: ++YYCURSOR; #line 86 "../src/conf/parse_opts.re" { warn.set (Warn::USELESS_ESCAPE, option); goto opt; } -#line 723 "src/conf/parse_opts.cc" +#line 722 "src/conf/parse_opts.cc" yy164: ++YYCURSOR; #line 79 "../src/conf/parse_opts.re" { warn.set (Warn::CONDITION_ORDER, option); goto opt; } -#line 728 "src/conf/parse_opts.cc" +#line 727 "src/conf/parse_opts.cc" yy166: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'c') goto yy171; @@ -785,7 +784,7 @@ yy180: ++YYCURSOR; #line 85 "../src/conf/parse_opts.re" { warn.set (Warn::UNREACHABLE_RULES, option); goto opt; } -#line 789 "src/conf/parse_opts.cc" +#line 788 "src/conf/parse_opts.cc" yy182: yych = (YYCTYPE)*++YYCURSOR; if (yych == 's') goto yy187; @@ -794,7 +793,7 @@ yy183: ++YYCURSOR; #line 81 "../src/conf/parse_opts.re" { warn.set (Warn::MATCH_EMPTY_STRING, option); goto opt; } -#line 798 "src/conf/parse_opts.cc" +#line 797 "src/conf/parse_opts.cc" yy185: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'g') goto yy188; @@ -831,26 +830,26 @@ yy193: ++YYCURSOR; #line 80 "../src/conf/parse_opts.re" { warn.set (Warn::EMPTY_CHARACTER_CLASS, option); goto opt; } -#line 835 "src/conf/parse_opts.cc" +#line 834 "src/conf/parse_opts.cc" yy195: ++YYCURSOR; #line 82 "../src/conf/parse_opts.re" { warn.set (Warn::NONDETERMINISTIC_TAGS, option); goto opt; } -#line 840 "src/conf/parse_opts.cc" +#line 839 "src/conf/parse_opts.cc" yy197: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy52; ++YYCURSOR; #line 84 "../src/conf/parse_opts.re" { warn.set (Warn::UNDEFINED_CONTROL_FLOW, option); goto opt; } -#line 847 "src/conf/parse_opts.cc" +#line 846 "src/conf/parse_opts.cc" } #line 87 "../src/conf/parse_opts.re" opt_short: -#line 854 "src/conf/parse_opts.cc" +#line 853 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -925,7 +924,7 @@ yy202: ++YYCURSOR; #line 96 "../src/conf/parse_opts.re" { goto opt; } -#line 929 "src/conf/parse_opts.cc" +#line 928 "src/conf/parse_opts.cc" yy204: ++YYCURSOR; #line 92 "../src/conf/parse_opts.re" @@ -933,141 +932,141 @@ yy204: error ("bad short option: %s", *argv); return EXIT_FAIL; } -#line 937 "src/conf/parse_opts.cc" +#line 936 "src/conf/parse_opts.cc" yy206: ++YYCURSOR; #line 121 "../src/conf/parse_opts.re" { goto opt_short; } -#line 942 "src/conf/parse_opts.cc" +#line 941 "src/conf/parse_opts.cc" yy208: ++YYCURSOR; #line 116 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UTF8)) { error_encoding (); return EXIT_FAIL; } goto opt_short; } -#line 947 "src/conf/parse_opts.cc" +#line 946 "src/conf/parse_opts.cc" yy210: ++YYCURSOR; #line 97 "../src/conf/parse_opts.re" { usage (); return EXIT_OK; } -#line 952 "src/conf/parse_opts.cc" +#line 951 "src/conf/parse_opts.cc" yy212: ++YYCURSOR; #line 103 "../src/conf/parse_opts.re" { opts.set_target (opt_t::DOT); goto opt_short; } -#line 957 "src/conf/parse_opts.cc" +#line 956 "src/conf/parse_opts.cc" yy214: ++YYCURSOR; #line 105 "../src/conf/parse_opts.re" { opts.set_FFlag (true); goto opt_short; } -#line 962 "src/conf/parse_opts.cc" +#line 961 "src/conf/parse_opts.cc" yy216: ++YYCURSOR; #line 110 "../src/conf/parse_opts.re" { opts.set_target (opt_t::SKELETON); goto opt_short; } -#line 967 "src/conf/parse_opts.cc" +#line 966 "src/conf/parse_opts.cc" yy218: ++YYCURSOR; #line 111 "../src/conf/parse_opts.re" { opts.set_tags (true); goto opt_short; } -#line 972 "src/conf/parse_opts.cc" +#line 971 "src/conf/parse_opts.cc" yy220: ++YYCURSOR; #line 99 "../src/conf/parse_opts.re" { vernum (); return EXIT_OK; } -#line 977 "src/conf/parse_opts.cc" +#line 976 "src/conf/parse_opts.cc" yy222: ++YYCURSOR; #line 100 "../src/conf/parse_opts.re" { opts.set_bFlag (true); goto opt_short; } -#line 982 "src/conf/parse_opts.cc" +#line 981 "src/conf/parse_opts.cc" yy224: ++YYCURSOR; #line 101 "../src/conf/parse_opts.re" { opts.set_cFlag (true); goto opt_short; } -#line 987 "src/conf/parse_opts.cc" +#line 986 "src/conf/parse_opts.cc" yy226: ++YYCURSOR; #line 102 "../src/conf/parse_opts.re" { opts.set_dFlag (true); goto opt_short; } -#line 992 "src/conf/parse_opts.cc" +#line 991 "src/conf/parse_opts.cc" yy228: ++YYCURSOR; #line 112 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::EBCDIC)) { error_encoding (); return EXIT_FAIL; } goto opt_short; } -#line 997 "src/conf/parse_opts.cc" +#line 996 "src/conf/parse_opts.cc" yy230: ++YYCURSOR; #line 104 "../src/conf/parse_opts.re" { opts.set_fFlag (true); goto opt_short; } -#line 1002 "src/conf/parse_opts.cc" +#line 1001 "src/conf/parse_opts.cc" yy232: ++YYCURSOR; #line 106 "../src/conf/parse_opts.re" { opts.set_gFlag (true); goto opt_short; } -#line 1007 "src/conf/parse_opts.cc" +#line 1006 "src/conf/parse_opts.cc" yy234: ++YYCURSOR; #line 107 "../src/conf/parse_opts.re" { opts.set_iFlag (true); goto opt_short; } -#line 1012 "src/conf/parse_opts.cc" +#line 1011 "src/conf/parse_opts.cc" yy236: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy252; #line 118 "../src/conf/parse_opts.re" { *argv = YYCURSOR; goto opt_output; } -#line 1018 "src/conf/parse_opts.cc" +#line 1017 "src/conf/parse_opts.cc" yy238: ++YYCURSOR; #line 108 "../src/conf/parse_opts.re" { opts.set_rFlag (true); goto opt_short; } -#line 1023 "src/conf/parse_opts.cc" +#line 1022 "src/conf/parse_opts.cc" yy240: ++YYCURSOR; #line 109 "../src/conf/parse_opts.re" { opts.set_sFlag (true); goto opt_short; } -#line 1028 "src/conf/parse_opts.cc" +#line 1027 "src/conf/parse_opts.cc" yy242: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy254; #line 120 "../src/conf/parse_opts.re" { *argv = YYCURSOR; goto opt_header; } -#line 1034 "src/conf/parse_opts.cc" +#line 1033 "src/conf/parse_opts.cc" yy244: ++YYCURSOR; #line 113 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UTF32)) { error_encoding (); return EXIT_FAIL; } goto opt_short; } -#line 1039 "src/conf/parse_opts.cc" +#line 1038 "src/conf/parse_opts.cc" yy246: ++YYCURSOR; #line 98 "../src/conf/parse_opts.re" { version (); return EXIT_OK; } -#line 1044 "src/conf/parse_opts.cc" +#line 1043 "src/conf/parse_opts.cc" yy248: ++YYCURSOR; #line 114 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UCS2)) { error_encoding (); return EXIT_FAIL; } goto opt_short; } -#line 1049 "src/conf/parse_opts.cc" +#line 1048 "src/conf/parse_opts.cc" yy250: ++YYCURSOR; #line 115 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UTF16)) { error_encoding (); return EXIT_FAIL; } goto opt_short; } -#line 1054 "src/conf/parse_opts.cc" +#line 1053 "src/conf/parse_opts.cc" yy252: ++YYCURSOR; #line 117 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-o, --output"); return EXIT_FAIL; } goto opt_output; } -#line 1059 "src/conf/parse_opts.cc" +#line 1058 "src/conf/parse_opts.cc" yy254: ++YYCURSOR; #line 119 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-t, --type-header"); return EXIT_FAIL; } goto opt_header; } -#line 1064 "src/conf/parse_opts.cc" +#line 1063 "src/conf/parse_opts.cc" } #line 122 "../src/conf/parse_opts.re" opt_long: -#line 1071 "src/conf/parse_opts.cc" +#line 1070 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -1097,7 +1096,7 @@ yy259: error ("bad long option: %s", *argv); return EXIT_FAIL; } -#line 1101 "src/conf/parse_opts.cc" +#line 1100 "src/conf/parse_opts.cc" yy260: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'i') goto yy275; @@ -1432,7 +1431,7 @@ yy335: ++YYCURSOR; #line 151 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::EBCDIC)) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 1436 "src/conf/parse_opts.cc" +#line 1435 "src/conf/parse_opts.cc" yy337: yych = (YYCTYPE)*++YYCURSOR; if (yych == '-') goto yy367; @@ -1575,7 +1574,7 @@ yy371: ++YYCURSOR; #line 131 "../src/conf/parse_opts.re" { usage (); return EXIT_OK; } -#line 1579 "src/conf/parse_opts.cc" +#line 1578 "src/conf/parse_opts.cc" yy373: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy405; @@ -1628,7 +1627,7 @@ yy385: ++YYCURSOR; #line 149 "../src/conf/parse_opts.re" { opts.set_tags (true); goto opt; } -#line 1632 "src/conf/parse_opts.cc" +#line 1631 "src/conf/parse_opts.cc" yy387: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'h') goto yy418; @@ -1705,7 +1704,7 @@ yy405: ++YYCURSOR; #line 159 "../src/conf/parse_opts.re" { goto opt_input; } -#line 1709 "src/conf/parse_opts.cc" +#line 1708 "src/conf/parse_opts.cc" yy407: yych = (YYCTYPE)*++YYCURSOR; if (yych == '-') goto yy437; @@ -1766,7 +1765,7 @@ yy421: ++YYCURSOR; #line 155 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UTF8)) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 1770 "src/conf/parse_opts.cc" +#line 1769 "src/conf/parse_opts.cc" yy423: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy453; @@ -1848,7 +1847,7 @@ yy442: ++YYCURSOR; #line 156 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-o, --output"); return EXIT_FAIL; } goto opt_output; } -#line 1852 "src/conf/parse_opts.cc" +#line 1851 "src/conf/parse_opts.cc" yy444: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy474; @@ -1881,12 +1880,12 @@ yy451: ++YYCURSOR; #line 154 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UTF16)) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 1885 "src/conf/parse_opts.cc" +#line 1884 "src/conf/parse_opts.cc" yy453: ++YYCURSOR; #line 133 "../src/conf/parse_opts.re" { vernum (); return EXIT_OK; } -#line 1890 "src/conf/parse_opts.cc" +#line 1889 "src/conf/parse_opts.cc" yy455: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy482; @@ -1991,12 +1990,12 @@ yy480: ++YYCURSOR; #line 152 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UTF32)) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 1995 "src/conf/parse_opts.cc" +#line 1994 "src/conf/parse_opts.cc" yy482: ++YYCURSOR; #line 132 "../src/conf/parse_opts.re" { version (); return EXIT_OK; } -#line 2000 "src/conf/parse_opts.cc" +#line 1999 "src/conf/parse_opts.cc" yy484: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy511; @@ -2042,7 +2041,7 @@ yy493: ++YYCURSOR; #line 137 "../src/conf/parse_opts.re" { opts.set_target (opt_t::DOT); goto opt; } -#line 2046 "src/conf/parse_opts.cc" +#line 2045 "src/conf/parse_opts.cc" yy495: yych = (YYCTYPE)*++YYCURSOR; if (yych == 's') goto yy524; @@ -2079,7 +2078,7 @@ yy503: ++YYCURSOR; #line 142 "../src/conf/parse_opts.re" { opts.set_rFlag (true); goto opt; } -#line 2083 "src/conf/parse_opts.cc" +#line 2082 "src/conf/parse_opts.cc" yy505: yych = (YYCTYPE)*++YYCURSOR; if (yych == 's') goto yy532; @@ -2088,7 +2087,7 @@ yy506: ++YYCURSOR; #line 148 "../src/conf/parse_opts.re" { opts.set_target (opt_t::SKELETON); goto opt; } -#line 2092 "src/conf/parse_opts.cc" +#line 2091 "src/conf/parse_opts.cc" yy508: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'd') goto yy533; @@ -2133,7 +2132,7 @@ yy518: ++YYCURSOR; #line 168 "../src/conf/parse_opts.re" { opts.set_dump_adfa(true); goto opt; } -#line 2137 "src/conf/parse_opts.cc" +#line 2136 "src/conf/parse_opts.cc" yy520: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy543; @@ -2258,7 +2257,7 @@ yy550: ++YYCURSOR; #line 143 "../src/conf/parse_opts.re" { opts.set_sFlag (true); goto opt; } -#line 2262 "src/conf/parse_opts.cc" +#line 2261 "src/conf/parse_opts.cc" yy552: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'f') goto yy579; @@ -2271,7 +2270,7 @@ yy554: ++YYCURSOR; #line 145 "../src/conf/parse_opts.re" { opts.set_version (false); goto opt; } -#line 2275 "src/conf/parse_opts.cc" +#line 2274 "src/conf/parse_opts.cc" yy556: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'v') goto yy581; @@ -2296,12 +2295,12 @@ yy561: ++YYCURSOR; #line 153 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UCS2)) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 2300 "src/conf/parse_opts.cc" +#line 2299 "src/conf/parse_opts.cc" yy563: ++YYCURSOR; #line 134 "../src/conf/parse_opts.re" { opts.set_bFlag (true); goto opt; } -#line 2305 "src/conf/parse_opts.cc" +#line 2304 "src/conf/parse_opts.cc" yy565: yych = (YYCTYPE)*++YYCURSOR; if (yych == 't') goto yy588; @@ -2342,7 +2341,7 @@ yy574: ++YYCURSOR; #line 160 "../src/conf/parse_opts.re" { goto opt_empty_class; } -#line 2346 "src/conf/parse_opts.cc" +#line 2345 "src/conf/parse_opts.cc" yy576: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'i') goto yy601; @@ -2351,7 +2350,7 @@ yy577: ++YYCURSOR; #line 139 "../src/conf/parse_opts.re" { opts.set_FFlag (true); goto opt; } -#line 2355 "src/conf/parse_opts.cc" +#line 2354 "src/conf/parse_opts.cc" yy579: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'o') goto yy602; @@ -2368,7 +2367,7 @@ yy582: ++YYCURSOR; #line 162 "../src/conf/parse_opts.re" { goto opt; } -#line 2372 "src/conf/parse_opts.cc" +#line 2371 "src/conf/parse_opts.cc" yy584: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'i') goto yy605; @@ -2381,7 +2380,7 @@ yy586: ++YYCURSOR; #line 157 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-t, --type-header"); return EXIT_FAIL; } goto opt_header; } -#line 2385 "src/conf/parse_opts.cc" +#line 2384 "src/conf/parse_opts.cc" yy588: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'i') goto yy607; @@ -2398,7 +2397,7 @@ yy591: ++YYCURSOR; #line 136 "../src/conf/parse_opts.re" { opts.set_dFlag (true); goto opt; } -#line 2402 "src/conf/parse_opts.cc" +#line 2401 "src/conf/parse_opts.cc" yy593: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'i') goto yy611; @@ -2407,17 +2406,17 @@ yy594: ++YYCURSOR; #line 165 "../src/conf/parse_opts.re" { opts.set_dump_dfa_det(true); goto opt; } -#line 2411 "src/conf/parse_opts.cc" +#line 2410 "src/conf/parse_opts.cc" yy596: ++YYCURSOR; #line 167 "../src/conf/parse_opts.re" { opts.set_dump_dfa_min(true); goto opt; } -#line 2416 "src/conf/parse_opts.cc" +#line 2415 "src/conf/parse_opts.cc" yy598: ++YYCURSOR; #line 164 "../src/conf/parse_opts.re" { opts.set_dump_dfa_raw(true); goto opt; } -#line 2421 "src/conf/parse_opts.cc" +#line 2420 "src/conf/parse_opts.cc" yy600: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'p') goto yy612; @@ -2454,7 +2453,7 @@ yy608: ++YYCURSOR; #line 147 "../src/conf/parse_opts.re" { opts.set_bCaseInverted (true); goto opt; } -#line 2458 "src/conf/parse_opts.cc" +#line 2457 "src/conf/parse_opts.cc" yy610: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy621; @@ -2475,7 +2474,7 @@ yy614: ++YYCURSOR; #line 141 "../src/conf/parse_opts.re" { opts.set_iFlag (true); goto opt; } -#line 2479 "src/conf/parse_opts.cc" +#line 2478 "src/conf/parse_opts.cc" yy616: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'd') goto yy626; @@ -2500,7 +2499,7 @@ yy621: ++YYCURSOR; #line 140 "../src/conf/parse_opts.re" { opts.set_gFlag (true); goto opt; } -#line 2504 "src/conf/parse_opts.cc" +#line 2503 "src/conf/parse_opts.cc" yy623: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'n') goto yy632; @@ -2529,7 +2528,7 @@ yy629: ++YYCURSOR; #line 138 "../src/conf/parse_opts.re" { opts.set_fFlag (true); goto opt; } -#line 2533 "src/conf/parse_opts.cc" +#line 2532 "src/conf/parse_opts.cc" yy631: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy640; @@ -2542,12 +2541,12 @@ yy633: ++YYCURSOR; #line 166 "../src/conf/parse_opts.re" { opts.set_dump_dfa_tagopt(true); goto opt; } -#line 2546 "src/conf/parse_opts.cc" +#line 2545 "src/conf/parse_opts.cc" yy635: ++YYCURSOR; #line 158 "../src/conf/parse_opts.re" { goto opt_encoding_policy; } -#line 2551 "src/conf/parse_opts.cc" +#line 2550 "src/conf/parse_opts.cc" yy637: yych = (YYCTYPE)*++YYCURSOR; if (yych == 't') goto yy644; @@ -2564,12 +2563,12 @@ yy640: ++YYCURSOR; #line 146 "../src/conf/parse_opts.re" { opts.set_bCaseInsensitive (true); goto opt; } -#line 2568 "src/conf/parse_opts.cc" +#line 2567 "src/conf/parse_opts.cc" yy642: ++YYCURSOR; #line 161 "../src/conf/parse_opts.re" { goto opt_dfa_minimization; } -#line 2573 "src/conf/parse_opts.cc" +#line 2572 "src/conf/parse_opts.cc" yy644: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy648; @@ -2582,7 +2581,7 @@ yy646: ++YYCURSOR; #line 135 "../src/conf/parse_opts.re" { opts.set_cFlag (true); goto opt; } -#line 2586 "src/conf/parse_opts.cc" +#line 2585 "src/conf/parse_opts.cc" yy648: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy650; @@ -2595,7 +2594,7 @@ yy650: ++YYCURSOR; #line 144 "../src/conf/parse_opts.re" { opts.set_bNoGenerationDate (true); goto opt; } -#line 2599 "src/conf/parse_opts.cc" +#line 2598 "src/conf/parse_opts.cc" yy652: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'n') goto yy276; @@ -2606,14 +2605,14 @@ yy652: ++YYCURSOR; #line 150 "../src/conf/parse_opts.re" { opts.set_bijective_mapping(false); goto opt; } -#line 2610 "src/conf/parse_opts.cc" +#line 2609 "src/conf/parse_opts.cc" } #line 169 "../src/conf/parse_opts.re" opt_output: -#line 2617 "src/conf/parse_opts.cc" +#line 2616 "src/conf/parse_opts.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2660,24 +2659,23 @@ yy659: error ("bad argument to option -o, --output: %s", *argv); return EXIT_FAIL; } -#line 2664 "src/conf/parse_opts.cc" +#line 2663 "src/conf/parse_opts.cc" yy661: - ++YYCURSOR; - yych = (YYCTYPE)*YYCURSOR; + yych = (YYCTYPE)*++YYCURSOR; if (yybm[0+yych] & 128) { goto yy661; } ++YYCURSOR; #line 178 "../src/conf/parse_opts.re" { opts.set_output_file(*argv); goto opt; } -#line 2674 "src/conf/parse_opts.cc" +#line 2672 "src/conf/parse_opts.cc" } #line 179 "../src/conf/parse_opts.re" opt_header: -#line 2681 "src/conf/parse_opts.cc" +#line 2679 "src/conf/parse_opts.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2724,17 +2722,16 @@ yy667: error ("bad argument to option -t, --type-header: %s", *argv); return EXIT_FAIL; } -#line 2728 "src/conf/parse_opts.cc" +#line 2726 "src/conf/parse_opts.cc" yy669: - ++YYCURSOR; - yych = (YYCTYPE)*YYCURSOR; + yych = (YYCTYPE)*++YYCURSOR; if (yybm[0+yych] & 128) { goto yy669; } ++YYCURSOR; #line 188 "../src/conf/parse_opts.re" { opts.set_header_file (*argv); goto opt; } -#line 2738 "src/conf/parse_opts.cc" +#line 2735 "src/conf/parse_opts.cc" } #line 189 "../src/conf/parse_opts.re" @@ -2746,7 +2743,7 @@ opt_encoding_policy: return EXIT_FAIL; } -#line 2750 "src/conf/parse_opts.cc" +#line 2747 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -2763,7 +2760,7 @@ yy676: error ("bad argument to option --encoding-policy (expected: ignore | substitute | fail): %s", *argv); return EXIT_FAIL; } -#line 2767 "src/conf/parse_opts.cc" +#line 2764 "src/conf/parse_opts.cc" yy677: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'a') goto yy680; @@ -2818,7 +2815,7 @@ yy690: ++YYCURSOR; #line 205 "../src/conf/parse_opts.re" { opts.set_encoding_policy (Enc::POLICY_FAIL); goto opt; } -#line 2822 "src/conf/parse_opts.cc" +#line 2819 "src/conf/parse_opts.cc" yy692: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy694; @@ -2839,7 +2836,7 @@ yy696: ++YYCURSOR; #line 203 "../src/conf/parse_opts.re" { opts.set_encoding_policy (Enc::POLICY_IGNORE); goto opt; } -#line 2843 "src/conf/parse_opts.cc" +#line 2840 "src/conf/parse_opts.cc" yy698: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'u') goto yy681; @@ -2852,7 +2849,7 @@ yy698: ++YYCURSOR; #line 204 "../src/conf/parse_opts.re" { opts.set_encoding_policy (Enc::POLICY_SUBSTITUTE); goto opt; } -#line 2856 "src/conf/parse_opts.cc" +#line 2853 "src/conf/parse_opts.cc" } #line 206 "../src/conf/parse_opts.re" @@ -2864,7 +2861,7 @@ opt_input: return EXIT_FAIL; } -#line 2868 "src/conf/parse_opts.cc" +#line 2865 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -2879,7 +2876,7 @@ yy707: error ("bad argument to option --input (expected: default | custom): %s", *argv); return EXIT_FAIL; } -#line 2883 "src/conf/parse_opts.cc" +#line 2880 "src/conf/parse_opts.cc" yy708: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'u') goto yy710; @@ -2933,15 +2930,15 @@ yy720: yy721: ++YYCURSOR; #line 221 "../src/conf/parse_opts.re" - { opts.set_input_api (InputAPI::CUSTOM); goto opt; } -#line 2938 "src/conf/parse_opts.cc" + { opts.set_input_api(INPUT_CUSTOM); goto opt; } +#line 2935 "src/conf/parse_opts.cc" yy723: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy711; ++YYCURSOR; #line 220 "../src/conf/parse_opts.re" - { opts.set_input_api (InputAPI::DEFAULT); goto opt; } -#line 2945 "src/conf/parse_opts.cc" + { opts.set_input_api(INPUT_DEFAULT); goto opt; } +#line 2942 "src/conf/parse_opts.cc" } #line 222 "../src/conf/parse_opts.re" @@ -2953,7 +2950,7 @@ opt_empty_class: return EXIT_FAIL; } -#line 2957 "src/conf/parse_opts.cc" +#line 2954 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -2966,7 +2963,7 @@ yy729: error ("bad argument to option --empty-class (expected: match-empty | match-none | error): %s", *argv); return EXIT_FAIL; } -#line 2970 "src/conf/parse_opts.cc" +#line 2967 "src/conf/parse_opts.cc" yy730: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'r') goto yy732; @@ -3013,7 +3010,7 @@ yy741: ++YYCURSOR; #line 238 "../src/conf/parse_opts.re" { opts.set_empty_class_policy (EMPTY_CLASS_ERROR); goto opt; } -#line 3017 "src/conf/parse_opts.cc" +#line 3014 "src/conf/parse_opts.cc" yy743: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy744; @@ -3059,12 +3056,12 @@ yy753: ++YYCURSOR; #line 237 "../src/conf/parse_opts.re" { opts.set_empty_class_policy (EMPTY_CLASS_MATCH_NONE); goto opt; } -#line 3063 "src/conf/parse_opts.cc" +#line 3060 "src/conf/parse_opts.cc" yy755: ++YYCURSOR; #line 236 "../src/conf/parse_opts.re" { opts.set_empty_class_policy (EMPTY_CLASS_MATCH_EMPTY); goto opt; } -#line 3068 "src/conf/parse_opts.cc" +#line 3065 "src/conf/parse_opts.cc" } #line 239 "../src/conf/parse_opts.re" @@ -3076,7 +3073,7 @@ opt_dfa_minimization: return EXIT_FAIL; } -#line 3080 "src/conf/parse_opts.cc" +#line 3077 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -3089,7 +3086,7 @@ yy760: error ("bad argument to option --dfa-minimization (expected: table | moore): %s", *argv); return EXIT_FAIL; } -#line 3093 "src/conf/parse_opts.cc" +#line 3090 "src/conf/parse_opts.cc" yy761: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'o') goto yy763; @@ -3136,12 +3133,12 @@ yy772: ++YYCURSOR; #line 254 "../src/conf/parse_opts.re" { opts.set_dfa_minimization (DFA_MINIMIZATION_MOORE); goto opt; } -#line 3140 "src/conf/parse_opts.cc" +#line 3137 "src/conf/parse_opts.cc" yy774: ++YYCURSOR; #line 253 "../src/conf/parse_opts.re" { opts.set_dfa_minimization (DFA_MINIMIZATION_TABLE); goto opt; } -#line 3145 "src/conf/parse_opts.cc" +#line 3142 "src/conf/parse_opts.cc" } #line 255 "../src/conf/parse_opts.re" diff --git a/re2c/bootstrap/src/parse/lex_conf.cc b/re2c/bootstrap/src/parse/lex_conf.cc index f35deb2e..ead68c73 100644 --- a/re2c/bootstrap/src/parse/lex_conf.cc +++ b/re2c/bootstrap/src/parse/lex_conf.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 0.16 on Sun Dec 18 11:55:22 2016 */ +/* Generated by re2c 0.16 on Fri Dec 30 11:03:32 2016 */ #line 1 "../src/parse/lex_conf.re" #include "src/util/c99_stdint.h" #include @@ -3468,14 +3468,14 @@ yy839: yy840: ++cur; #line 192 "../src/parse/lex_conf.re" - { opts.set_input_api(InputAPI::CUSTOM); goto end; } + { opts.set_input_api(INPUT_CUSTOM); goto end; } #line 3473 "src/parse/lex_conf.cc" yy842: yych = (unsigned char)*++cur; if (yych != 't') goto yy832; ++cur; #line 191 "../src/parse/lex_conf.re" - { opts.set_input_api(InputAPI::DEFAULT); goto end; } + { opts.set_input_api(INPUT_DEFAULT); goto end; } #line 3480 "src/parse/lex_conf.cc" } #line 193 "../src/parse/lex_conf.re" diff --git a/re2c/src/codegen/emit_action.cc b/re2c/src/codegen/emit_action.cc index 70f000b1..d2b2b24d 100644 --- a/re2c/src/codegen/emit_action.cc +++ b/re2c/src/codegen/emit_action.cc @@ -17,141 +17,90 @@ namespace re2c class label_t; -static void need(OutputFile &o, uint32_t ind, size_t some); -static void emit_match(OutputFile &o, uint32_t ind, const State *s); -static void emit_initial(OutputFile &o, uint32_t ind, const State *s, const std::set &used_labels, bool save_yyaccept); -static void emit_save(OutputFile &o, uint32_t ind, const State *s, bool save_yyaccept); -static void emit_accept_binary(OutputFile &o, uint32_t ind, const DFA &dfa, const State *s, size_t l, size_t r); -static void emit_accept(OutputFile &o, uint32_t ind, const DFA &dfa, const State *s); -static void emit_rule(OutputFile &o, uint32_t ind, const DFA &dfa, size_t rule_idx); -static void gen_goto(code_lines_t &code, const State *to, const DFA &dfa, tcid_t tcid, Opt &opts); -static void gen_fintags(OutputFile &o, uint32_t ind, const DFA &dfa, const Rule &rule); -static bool endstate(const State *s); +static void need (OutputFile &o, uint32_t ind, size_t some); +static void emit_accept_binary (OutputFile &o, uint32_t ind, const DFA &dfa, const accept_t &acc, size_t l, size_t r); +static void emit_accept (OutputFile &o, uint32_t ind, const DFA &dfa, const accept_t &acc); +static void emit_rule (OutputFile &o, uint32_t ind, const DFA &dfa, size_t rule_idx); +static void gen_fintags (OutputFile &o, uint32_t ind, const DFA &dfa, const Rule &rule); +static void gen_goto (code_lines_t &code, const State *to, const DFA &dfa, tcid_t tcid, Opt &opts); +static bool endstate (const State *s); void emit_action(OutputFile &o, uint32_t ind, const DFA &dfa, const State *s, const std::set &used_labels) -{ - const bool save_yyaccept = dfa.accepts.size() > 1; - switch (s->action.type) { - case Action::MATCH: - emit_match(o, ind, s); - break; - case Action::INITIAL: - emit_initial(o, ind, s, used_labels, save_yyaccept); - break; - case Action::SAVE: - emit_save(o, ind, s, save_yyaccept); - break; - case Action::MOVE: - break; - case Action::ACCEPT: - emit_accept(o, ind, dfa, s); - break; - case Action::RULE: - emit_rule(o, ind, dfa, s->action.info.rule); - break; - } -} - -void emit_match(OutputFile &o, uint32_t ind, const State *s) { Opt &opts = o.opts; - if (s->fill != 0) { - o.wstring(opts->input_api.stmt_skip(ind, opts)); + switch (s->action.type) { + case Action::MATCH: + o.wdelay_skip(ind, true); need(o, ind, s->fill); - o.wstring(opts->input_api.stmt_peek(ind, opts)); - } else if (endstate(s)) { - o.wstring(opts->input_api.stmt_skip(ind, opts)); - } else { - o.wstring(opts->input_api.stmt_skip_peek(ind, opts)); - } -} - -void emit_initial(OutputFile &o, uint32_t ind, const State *s, - const std::set &used_labels, bool save_yyaccept) -{ - Opt &opts = o.opts; - const Initial &init = *s->action.info.initial; - const label_t label = init.label; - const size_t save = init.save; - const bool backup = save != Initial::NOSAVE; - - if (used_labels.count(s->label)) { - if (save_yyaccept && backup) { - o.wind(ind).wstring(opts->yyaccept).ws(" = ") - .wu64(save).ws(";\n"); + o.wdelay_peek(ind, !endstate(s)); + break; + case Action::INITIAL: { + const Initial &init = *s->action.info.initial; + const bool + backup = init.save != Initial::NOSAVE, + ul1 = used_labels.count(s->label); + if (ul1 && dfa.accepts.size() > 1 && backup) { + o.wind(ind).wstring(opts->yyaccept).ws(" = ").wu64(init.save).ws(";\n"); } - o.wstring(opts->input_api.stmt_skip(ind, opts)); - } - - if (used_labels.count(label)) { - o.wstring(opts->labelPrefix).wlabel(label).ws(":\n"); - } - - if (opts->dFlag) { - o.wind(ind).wstring(opts->yydebug).ws("(") - .wlabel(label).ws(", *") - .wstring(opts->yycursor).ws(");\n"); - } - - if (endstate(s)) return; - - need(o, ind, s->fill); - if (backup) { - o.wstring(opts->input_api.stmt_backup_peek(ind, opts)); - } else { - o.wstring(opts->input_api.stmt_peek(ind, opts)); - } -} - -void emit_save(OutputFile &o, uint32_t ind, const State *const s, - bool save_yyaccept) -{ - Opt &opts = o.opts; - - if (save_yyaccept) { - o.wind(ind).wstring(opts->yyaccept).ws(" = ") - .wu64(s->action.info.save).ws(";\n"); + o.wdelay_skip(ind, ul1); + if (used_labels.count(init.label)) { + o.wstring(opts->labelPrefix).wlabel(init.label).wstring(":\n"); + } + if (opts->dFlag) { + o.wind(ind).wstring(opts->yydebug).ws("(").wlabel(init.label) + .ws(", *").wstring(opts->yycursor).ws(");\n"); + } + need(o, ind, s->fill); + o.wdelay_backup(ind, backup); + o.wdelay_peek(ind, !endstate(s)); + break; } - - if (s->fill != 0) { - o.wstring(opts->input_api.stmt_skip_backup(ind, opts)); + case Action::SAVE: + if (dfa.accepts.size() > 1) { + o.wind(ind).wstring(opts->yyaccept).ws(" = ").wu64(s->action.info.save).ws(";\n"); + } + o.wdelay_skip(ind, true); + o.wdelay_backup(ind, true); need(o, ind, s->fill); - o.wstring(opts->input_api.stmt_peek(ind, opts)); - } else { - o.wstring(opts->input_api.stmt_skip_backup_peek(ind, opts)); + o.wdelay_peek(ind, true); + break; + case Action::MOVE: + break; + case Action::ACCEPT: + emit_accept(o, ind, dfa, *s->action.info.accepts); + break; + case Action::RULE: + emit_rule(o, ind, dfa, s->action.info.rule); + break; } } void emit_accept_binary(OutputFile &o, uint32_t ind, const DFA &dfa, - const State *s, size_t l, size_t r) + const accept_t &acc, size_t l, size_t r) { Opt &opts = o.opts; if (l < r) { const size_t m = (l + r) >> 1; o.wind(ind).ws("if (").wstring(opts->yyaccept) .ws(r == l+1 ? " == " : " <= ").wu64(m).ws(") {\n"); - emit_accept_binary (o, ++ind, dfa, s, l, m); + emit_accept_binary (o, ++ind, dfa, acc, l, m); o.wind(--ind).ws("} else {\n"); - emit_accept_binary (o, ++ind, dfa, s, m + 1, r); + emit_accept_binary (o, ++ind, dfa, acc, m + 1, r); o.wind(--ind).ws("}\n"); } else { - const accept_t &acc = *s->action.info.accepts; gen_goto_plain(o, ind, acc[l].first, dfa, acc[l].second); } } -void emit_accept(OutputFile &o, uint32_t ind, const DFA &dfa, const State *s) +void emit_accept(OutputFile &o, uint32_t ind, const DFA &dfa, const accept_t &acc) { Opt &opts = o.opts; - const accept_t &acc = *s->action.info.accepts; const size_t nacc = acc.size(); - if (nacc == 0) { - return; - } + if (nacc == 0) return; - o.wstring(opts->input_api.stmt_restore(ind, opts)); + o.wstring(output_restore(ind, opts)); // only one possible 'yyaccept' value: unconditional jump if (nacc == 1) { @@ -187,7 +136,7 @@ void emit_accept(OutputFile &o, uint32_t ind, const DFA &dfa, const State *s) // nested ifs if (opts->sFlag || nacc == 2) { - emit_accept_binary(o, ind, dfa, s, 0, nacc - 1); + emit_accept_binary(o, ind, dfa, acc, 0, nacc - 1); return; } @@ -241,7 +190,7 @@ void emit_rule(OutputFile &o, uint32_t ind, const DFA &dfa, size_t rule_idx) void need(OutputFile &o, uint32_t ind, size_t some) { - assert(some > 0); + if (some == 0) return; Opt &opts = o.opts; std::string s; @@ -258,7 +207,7 @@ void need(OutputFile &o, uint32_t ind, size_t some) if (opts->fill_use) { o.wind(ind); if (opts->fill_check) { - o.ws("if (").wstring(opts->input_api.expr_lessthan(some, opts)).ws(") "); + o.ws("if (").wstring(output_expr_lessthan(some, opts)).ws(") "); } strrreplace(s = opts->fill, opts->fill_arg, some); o.wstring(s); @@ -336,7 +285,7 @@ void gen_goto(code_lines_t &code, const State *to, const DFA &dfa, void gen_settags(code_lines_t &code, const DFA &dfa, tcid_t tcid, Opt &opts) { - const bool generic = opts->input_api.type() == InputAPI::CUSTOM; + const bool generic = opts->input_api == INPUT_CUSTOM; const std::string &prefix = opts->tags_prefix, &expression = opts->tags_expression; @@ -399,7 +348,7 @@ void gen_settags(code_lines_t &code, const DFA &dfa, tcid_t tcid, Opt &opts) void gen_fintags(OutputFile &o, uint32_t ind, const DFA &dfa, const Rule &rule) { Opt &opts = o.opts; - const bool generic = opts->input_api.type() == InputAPI::CUSTOM; + const bool generic = opts->input_api == INPUT_CUSTOM; const std::string &prefix = opts->tags_prefix, &expression = opts->tags_expression; diff --git a/re2c/src/codegen/emit_dfa.cc b/re2c/src/codegen/emit_dfa.cc index 11adcff9..2fecac96 100644 --- a/re2c/src/codegen/emit_dfa.cc +++ b/re2c/src/codegen/emit_dfa.cc @@ -31,7 +31,7 @@ void emit_state (OutputFile & o, uint32_t ind, const State * s, bool used_label) } if (opts->dFlag && (s->action.type != Action::INITIAL)) { - o.wind(ind).wstring(opts->yydebug).ws("(").wlabel(s->label).ws(", ").wstring(opts->input_api.expr_peek(opts)).ws(");\n"); + o.wind(ind).wstring(opts->yydebug).ws("(").wlabel(s->label).ws(", ").wstring(output_expr_peek(opts)).ws(");\n"); } } diff --git a/re2c/src/codegen/input_api.cc b/re2c/src/codegen/input_api.cc index beeffa97..1c952b4d 100644 --- a/re2c/src/codegen/input_api.cc +++ b/re2c/src/codegen/input_api.cc @@ -7,125 +7,124 @@ namespace re2c { -InputAPI::InputAPI () - : type_ (DEFAULT) -{} - -InputAPI::type_t InputAPI::type () const +std::string output_expr_peek(Opt &opts) { - return type_; + return opts->input_api == INPUT_DEFAULT + ? "*" + opts->yycursor + : opts->yypeek + " ()"; } -void InputAPI::set (type_t t) +std::string output_restore(uint32_t ind, Opt &opts) { - type_ = t; + std::string s = opts->input_api == INPUT_DEFAULT + ? opts->yycursor + " = " + opts->yymarker + : opts->yyrestore + " ()"; + return indent(ind, opts->indString) + s + ";\n"; } -std::string InputAPI::expr_peek(Opt &opts) const +std::string output_expr_lessthan(size_t n, Opt &opts) { - std::string s; - switch (type_) - { - case DEFAULT: - s = "*" + opts->yycursor; - break; - case CUSTOM: - s = opts->yypeek + " ()"; - break; + std::ostringstream s; + if (opts->input_api == INPUT_CUSTOM) { + s << opts->yylessthan << " (" << n << ")"; + } else if (n == 1) { + s << opts->yylimit << " <= " << opts->yycursor; + } else { + s << "(" << opts->yylimit << " - " << opts->yycursor << ") < " << n; } - return s; + return s.str (); } -std::string InputAPI::stmt_peek(uint32_t ind, Opt &opts) const +static std::string yych_conv(const opt_t *opts) { - return indent(ind, opts->indString) + opts->yych + " = " + opts.yychConversion() - + expr_peek(opts) + ";\n"; + return opts->yychConversion + ? "(" + opts->yyctype + ")" + : ""; } -std::string InputAPI::stmt_skip(uint32_t ind, Opt &opts) const +void output_peek(std::ostream &o, uint32_t ind, const opt_t *opts) { - std::string s; - switch (type_) - { - case DEFAULT: - s = "++" + opts->yycursor; - break; - case CUSTOM: - s = opts->yyskip + " ()"; - break; + o << indent(ind, opts->indString) << opts->yych << " = " << yych_conv(opts); + if (opts->input_api == INPUT_CUSTOM) { + o << opts->yypeek << " ()"; + } else { + o << "*" << opts->yycursor; } - return indent(ind, opts->indString) + s + ";\n"; + o << ";\n"; } -std::string InputAPI::stmt_backup(uint32_t ind, Opt &opts) const +void output_skip(std::ostream &o, uint32_t ind, const opt_t *opts) { - std::string s; - switch (type_) - { - case DEFAULT: - s = opts->yymarker + " = " + opts->yycursor; - break; - case CUSTOM: - s = opts->yybackup + " ()"; - break; + o << indent(ind, opts->indString); + if (opts->input_api == INPUT_CUSTOM) { + o << opts->yyskip << " ()"; + } else { + o << "++" << opts->yycursor; } - return indent(ind, opts->indString) + s + ";\n"; + o << ";\n"; } -std::string InputAPI::stmt_restore(uint32_t ind, Opt &opts) const +void output_backup(std::ostream &o, uint32_t ind, const opt_t *opts) { - std::string s; - switch (type_) - { - case DEFAULT: - s = opts->yycursor + " = " + opts->yymarker; - break; - case CUSTOM: - s = opts->yyrestore + " ()"; - break; + o << indent(ind, opts->indString); + if (opts->input_api == INPUT_CUSTOM) { + o << opts->yybackup << " ()"; + } else { + o << opts->yymarker << " = " << opts->yycursor; } - return indent(ind, opts->indString) + s + ";\n"; + o << ";\n"; } -std::string InputAPI::stmt_skip_peek(uint32_t ind, Opt &opts) const +void output_skip_peek(std::ostream &o, uint32_t ind, const opt_t *opts) { - return type_ == DEFAULT - ? indent(ind, opts->indString) + opts->yych + " = " + opts.yychConversion() + "*++" + opts->yycursor + ";\n" - : stmt_skip(ind, opts) + stmt_peek(ind, opts); + assert(opts->input_api == INPUT_DEFAULT); + o << indent(ind, opts->indString) << opts->yych << " = " + << yych_conv(opts) << "*++" << opts->yycursor << ";\n"; } -std::string InputAPI::stmt_skip_backup(uint32_t ind, Opt &opts) const +void output_peek_skip(std::ostream &o, uint32_t ind, const opt_t *opts) { - return type_ == DEFAULT - ? indent(ind, opts->indString) + opts->yymarker + " = ++" + opts->yycursor + ";\n" - : stmt_skip(ind, opts) + stmt_backup(ind, opts); + assert(opts->input_api == INPUT_DEFAULT); + o << indent(ind, opts->indString) << opts->yych << " = " + << yych_conv(opts) << "*" << opts->yycursor << "++;\n"; } -std::string InputAPI::stmt_backup_peek(uint32_t ind, Opt &opts) const +void output_skip_backup(std::ostream &o, uint32_t ind, const opt_t *opts) { - return type_ == DEFAULT - ? indent(ind, opts->indString) + opts->yych + " = " + opts.yychConversion() + "*(" + opts->yymarker + " = " + opts->yycursor + ");\n" - : stmt_backup(ind, opts) + stmt_peek(ind, opts); + assert(opts->input_api == INPUT_DEFAULT); + o << indent(ind, opts->indString) << opts->yymarker << " = ++" + << opts->yycursor << ";\n"; } -std::string InputAPI::stmt_skip_backup_peek(uint32_t ind, Opt &opts) const +void output_backup_skip(std::ostream &o, uint32_t ind, const opt_t *opts) { - return type_ == DEFAULT - ? indent(ind, opts->indString) + opts->yych + " = " + opts.yychConversion() + "*(" + opts->yymarker + " = ++" + opts->yycursor + ");\n" - : stmt_skip(ind, opts) + stmt_backup(ind, opts) + stmt_peek(ind, opts); + assert(opts->input_api == INPUT_DEFAULT); + o << indent(ind, opts->indString) << opts->yymarker << " = " + << opts->yycursor << "++;\n"; } -std::string InputAPI::expr_lessthan(size_t n, Opt &opts) const +void output_backup_peek(std::ostream &o, uint32_t ind, const opt_t *opts) { - std::ostringstream s; - if (type_ == CUSTOM) { - s << opts->yylessthan << " (" << n << ")"; - } else if (n == 1) { - s << opts->yylimit << " <= " << opts->yycursor; - } else { - s << "(" << opts->yylimit << " - " << opts->yycursor << ") < " << n; - } - return s.str (); + assert(opts->input_api == INPUT_DEFAULT); + o << indent(ind, opts->indString) << opts->yych << " = " + << yych_conv(opts) << "*(" << opts->yymarker << " = " + << opts->yycursor << ");\n"; +} + +void output_skip_backup_peek(std::ostream &o, uint32_t ind, const opt_t *opts) +{ + assert(opts->input_api == INPUT_DEFAULT); + o << indent(ind, opts->indString) << opts->yych << " = " + << yych_conv(opts) << "*(" << opts->yymarker << " = ++" + << opts->yycursor << ");\n"; +} + +void output_backup_peek_skip(std::ostream &o, uint32_t ind, const opt_t *opts) +{ + assert(opts->input_api == INPUT_DEFAULT); + o << indent(ind, opts->indString) << opts->yych << " = " + << yych_conv(opts) << "*(" << opts->yymarker << " = " + << opts->yycursor << "++);\n"; } } // end namespace re2c diff --git a/re2c/src/codegen/input_api.h b/re2c/src/codegen/input_api.h index 1a895504..e4643b18 100644 --- a/re2c/src/codegen/input_api.h +++ b/re2c/src/codegen/input_api.h @@ -8,34 +8,29 @@ namespace re2c { struct Opt; +struct opt_t; -class InputAPI +enum input_api_t { -public: - enum type_t - { DEFAULT - , CUSTOM - }; - -private: - type_t type_; - -public: - InputAPI (); - type_t type () const; - void set (type_t t); - std::string expr_peek (Opt &opts) const; - std::string stmt_peek (uint32_t ind, Opt &opts) const; - std::string stmt_skip (uint32_t ind, Opt &opts) const; - std::string stmt_backup (uint32_t ind, Opt &opts) const; - std::string stmt_restore (uint32_t ind, Opt &opts) const; - std::string stmt_skip_peek (uint32_t ind, Opt &opts) const; - std::string stmt_skip_backup (uint32_t ind, Opt &opts) const; - std::string stmt_backup_peek (uint32_t ind, Opt &opts) const; - std::string stmt_skip_backup_peek (uint32_t ind, Opt &opts) const; - std::string expr_lessthan (size_t n, Opt &opts) const; + INPUT_DEFAULT, + INPUT_CUSTOM }; +std::string output_expr_peek (Opt &opts); +std::string output_restore (uint32_t ind, Opt &opts); +std::string output_expr_lessthan (size_t n, Opt &opts); + +void output_peek (std::ostream &o, uint32_t ind, const opt_t *opts); +void output_skip (std::ostream &o, uint32_t ind, const opt_t *opts); +void output_backup (std::ostream &o, uint32_t ind, const opt_t *opts); +void output_skip_peek (std::ostream &o, uint32_t ind, const opt_t *opts); +void output_peek_skip (std::ostream &o, uint32_t ind, const opt_t *opts); +void output_skip_backup (std::ostream &o, uint32_t ind, const opt_t *opts); +void output_backup_skip (std::ostream &o, uint32_t ind, const opt_t *opts); +void output_backup_peek (std::ostream &o, uint32_t ind, const opt_t *opts); +void output_skip_backup_peek (std::ostream &o, uint32_t ind, const opt_t *opts); +void output_backup_peek_skip (std::ostream &o, uint32_t ind, const opt_t *opts); + } // end namespace re2c #endif // _RE2C_CODEGEN_INPUT_API_ diff --git a/re2c/src/codegen/output.cc b/re2c/src/codegen/output.cc index 224300ca..85b51e3d 100644 --- a/re2c/src/codegen/output.cc +++ b/re2c/src/codegen/output.cc @@ -91,18 +91,21 @@ std::ostream & OutputFile::stream () OutputFile &OutputFile::wraw(const char *s, const char *e) { + insert_code(); stream().write(s, static_cast(e - s)); return *this; } OutputFile & OutputFile::wu32_hex (uint32_t n) { + insert_code(); prtHex(stream(), n, opts->encoding.szCodeUnit()); return *this; } OutputFile & OutputFile::wc_hex (uint32_t n) { + insert_code(); const Enc &e = opts->encoding; prtChOrHex(stream(), n, e.szCodeUnit(), e.type() == Enc::EBCDIC, opts->target == opt_t::DOT); return *this; @@ -110,6 +113,7 @@ OutputFile & OutputFile::wc_hex (uint32_t n) OutputFile & OutputFile::wrange (uint32_t l, uint32_t u) { + insert_code(); const Enc &e = opts->encoding; printSpan(stream(), l, u, e.szCodeUnit(), e.type() == Enc::EBCDIC, opts->target == opt_t::DOT); return *this; @@ -117,6 +121,7 @@ OutputFile & OutputFile::wrange (uint32_t l, uint32_t u) OutputFile & OutputFile::wu32_width (uint32_t n, int w) { + insert_code(); stream () << std::setw (w); stream () << n; return *this; @@ -124,18 +129,21 @@ OutputFile & OutputFile::wu32_width (uint32_t n, int w) OutputFile & OutputFile::wline_info (uint32_t l, const char * fn) { + insert_code(); output_line_info (stream (), l, fn, opts->iFlag); return *this; } OutputFile & OutputFile::wversion_time () { + insert_code(); output_version_time (stream (), opts); return *this; } OutputFile & OutputFile::wuser_start_label () { + insert_code(); const std::string label = block().user_start_label; if (!label.empty ()) { @@ -146,49 +154,58 @@ OutputFile & OutputFile::wuser_start_label () OutputFile & OutputFile::wc (char c) { + insert_code(); stream () << c; return *this; } OutputFile & OutputFile::wu32 (uint32_t n) { + insert_code(); stream () << n; return *this; } OutputFile & OutputFile::wu64 (uint64_t n) { + insert_code(); stream () << n; return *this; } OutputFile & OutputFile::wstring (const std::string & s) { + insert_code(); stream () << s; return *this; } OutputFile & OutputFile::ws (const char * s) { + insert_code(); stream () << s; return *this; } OutputFile & OutputFile::wlabel (label_t l) { + insert_code(); stream () << l; return *this; } OutputFile & OutputFile::wind (uint32_t ind) { + insert_code(); stream () << indent(ind, opts->indString); return *this; } void OutputFile::insert_code () { - block().fragments.push_back (new OutputFragment (OutputFragment::CODE, 0)); + if (block().fragments.back()->type != OutputFragment::CODE) { + block().fragments.push_back(new OutputFragment(OutputFragment::CODE, 0)); + } } OutputFile &OutputFile::wdelay_tags(uint32_t ind, const ConfTags *cf) @@ -196,14 +213,12 @@ OutputFile &OutputFile::wdelay_tags(uint32_t ind, const ConfTags *cf) OutputFragment *frag = new OutputFragment(OutputFragment::TAGS, ind); frag->tags = cf; blocks.back()->fragments.push_back(frag); - insert_code(); return *this; } OutputFile & OutputFile::wdelay_line_info () { block().fragments.push_back (new OutputFragment (OutputFragment::LINE_INFO, 0)); - insert_code (); return *this; } @@ -211,7 +226,6 @@ OutputFile & OutputFile::wdelay_cond_goto(uint32_t ind) { if (opts->cFlag && !cond_goto) { block().fragments.push_back(new OutputFragment(OutputFragment::COND_GOTO, ind)); - insert_code (); cond_goto = true; } return *this; @@ -221,7 +235,6 @@ OutputFile & OutputFile::wdelay_cond_table(uint32_t ind) { if (opts->gFlag && opts->cFlag && !cond_goto) { block().fragments.push_back(new OutputFragment(OutputFragment::COND_TABLE, ind)); - insert_code (); } return *this; } @@ -230,7 +243,6 @@ OutputFile & OutputFile::wdelay_state_goto (uint32_t ind) { if (opts->fFlag && !state_goto) { block().fragments.push_back (new OutputFragment (OutputFragment::STATE_GOTO, ind)); - insert_code (); state_goto = true; } return *this; @@ -240,28 +252,51 @@ OutputFile & OutputFile::wdelay_types () { warn_condition_order = false; // see note [condition order] block().fragments.push_back (new OutputFragment (OutputFragment::TYPES, 0)); - insert_code (); return *this; } OutputFile & OutputFile::wdelay_yyaccept_init (uint32_t ind) { block().fragments.push_back (new OutputFragment (OutputFragment::YYACCEPT_INIT, ind)); - insert_code (); return *this; } OutputFile & OutputFile::wdelay_yymaxfill () { block().fragments.push_back (new OutputFragment (OutputFragment::YYMAXFILL, 0)); - insert_code (); + return *this; +} + +OutputFile& OutputFile::wdelay_skip(uint32_t ind, bool skip) +{ + if (skip) { + OutputFragment *f = new OutputFragment(OutputFragment::SKIP, ind); + block().fragments.push_back(f); + } + return *this; +} + +OutputFile& OutputFile::wdelay_peek(uint32_t ind, bool peek) +{ + if (peek) { + OutputFragment *f = new OutputFragment(OutputFragment::PEEK, ind); + block().fragments.push_back(f); + } + return *this; +} + +OutputFile& OutputFile::wdelay_backup(uint32_t ind, bool backup) +{ + if (backup) { + OutputFragment *f = new OutputFragment(OutputFragment::BACKUP, ind); + block().fragments.push_back(f); + } return *this; } void OutputFile::new_block () { blocks.push_back (new OutputBlock ()); - insert_code (); } void OutputFile::global_lists( @@ -280,6 +315,65 @@ void OutputFile::global_lists( } } +static void foldexpr(std::vector &frags) +{ + const size_t n = frags.size(); + for (size_t i = 0; i < n;) { + + if (i + 2 < n) { + OutputFragment::type_t + &x = frags[i]->type, + &y = frags[i + 1]->type, + &z = frags[i + 2]->type; + if (x == OutputFragment::BACKUP && y == OutputFragment::PEEK && z == OutputFragment::SKIP) { + x = OutputFragment::BACKUP_PEEK_SKIP; + y = z = OutputFragment::EMPTY; + i += 3; + continue; + } else if (x == OutputFragment::SKIP && y == OutputFragment::BACKUP && z == OutputFragment::PEEK) { + x = OutputFragment::SKIP_BACKUP_PEEK; + y = z = OutputFragment::EMPTY; + i += 3; + continue; + } + } + + if (i + 1 < n) { + OutputFragment::type_t + &x = frags[i]->type, + &y = frags[i + 1]->type; + if (x == OutputFragment::PEEK && y == OutputFragment::SKIP) { + x = OutputFragment::PEEK_SKIP; + y = OutputFragment::EMPTY; + i += 2; + continue; + } else if (x == OutputFragment::SKIP && y == OutputFragment::PEEK) { + x = OutputFragment::SKIP_PEEK; + y = OutputFragment::EMPTY; + i += 2; + continue; + } else if (x == OutputFragment::SKIP && y == OutputFragment::BACKUP) { + x = OutputFragment::SKIP_BACKUP; + y = OutputFragment::EMPTY; + i += 2; + continue; + } else if (x == OutputFragment::BACKUP && y == OutputFragment::PEEK) { + x = OutputFragment::BACKUP_PEEK; + y = OutputFragment::EMPTY; + i += 2; + continue; + } else if (x == OutputFragment::BACKUP && y == OutputFragment::SKIP) { + x = OutputFragment::BACKUP_SKIP; + y = OutputFragment::EMPTY; + i += 2; + continue; + } + } + + ++i; + } +} + bool OutputFile::emit(const uniq_vector_t &global_types, const std::set &global_tags, size_t max_fill) @@ -300,37 +394,79 @@ bool OutputFile::emit(const uniq_vector_t &global_types, unsigned int line_count = 1; for (unsigned int j = 0; j < blocks.size(); ++j) { OutputBlock & b = * blocks[j]; - for (unsigned int i = 0; i < b.fragments.size(); ++i) { + const opt_t *bopt = b.opts; + + if (bopt->input_api == INPUT_DEFAULT) { + foldexpr(b.fragments); + } + + const size_t n = b.fragments.size(); + for (size_t i = 0; i < n; ++i) { OutputFragment & f = * b.fragments[i]; + std::ostringstream &o = f.stream; + const uint32_t ind = f.indent; + switch (f.type) { - case OutputFragment::CODE: break; - case OutputFragment::LINE_INFO: - output_line_info(f.stream, line_count + 1, filename, b.opts->iFlag); - break; - case OutputFragment::COND_GOTO: - output_cond_goto(f.stream, f.indent, b.types, - b.opts, warn, warn_condition_order, b.line); - break; - case OutputFragment::COND_TABLE: - output_cond_table(f.stream, f.indent, b.types, b.opts); - break; - case OutputFragment::STATE_GOTO: - output_state_goto(f.stream, f.indent, 0, fill_index, b.opts); - break; - case OutputFragment::TAGS: - output_tags(f.stream, *f.tags, global_tags); - break; - case OutputFragment::TYPES: - output_types(f.stream, f.indent, global_types, opts); - break; - case OutputFragment::YYACCEPT_INIT: - output_yyaccept_init(f.stream, f.indent, b.used_yyaccept, b.opts); - break; - case OutputFragment::YYMAXFILL: - output_yymaxfill(f.stream, max_fill); - break; + case OutputFragment::EMPTY: + case OutputFragment::CODE: break; + case OutputFragment::LINE_INFO: + output_line_info(o, line_count + 1, filename, bopt->iFlag); + break; + case OutputFragment::COND_GOTO: + output_cond_goto(o, ind, b.types, + bopt, warn, warn_condition_order, b.line); + break; + case OutputFragment::COND_TABLE: + output_cond_table(o, ind, b.types, bopt); + break; + case OutputFragment::STATE_GOTO: + output_state_goto(o, ind, 0, fill_index, bopt); + break; + case OutputFragment::TAGS: + output_tags(o, *f.tags, global_tags); + break; + case OutputFragment::TYPES: + output_types(o, ind, global_types, opts); + break; + case OutputFragment::YYACCEPT_INIT: + output_yyaccept_init(o, ind, b.used_yyaccept, bopt); + break; + case OutputFragment::YYMAXFILL: + output_yymaxfill(o, max_fill); + break; + case OutputFragment::SKIP: + output_skip(o, ind, bopt); + break; + case OutputFragment::PEEK: + output_peek(o, ind, bopt); + break; + case OutputFragment::BACKUP: + output_backup(o, ind, bopt); + break; + case OutputFragment::PEEK_SKIP: + output_peek_skip(o, ind, bopt); + break; + case OutputFragment::SKIP_PEEK: + output_skip_peek(o, ind, bopt); + break; + case OutputFragment::SKIP_BACKUP: + output_skip_backup(o, ind, bopt); + break; + case OutputFragment::BACKUP_SKIP: + output_backup_skip(o, ind, bopt); + break; + case OutputFragment::BACKUP_PEEK: + output_backup_peek(o, ind, bopt); + break; + case OutputFragment::BACKUP_PEEK_SKIP: + output_backup_peek_skip(o, ind, bopt); + break; + case OutputFragment::SKIP_BACKUP_PEEK: + output_skip_backup_peek(o, ind, bopt); + break; } - std::string content = f.stream.str(); + + std::string content = o.str(); fwrite(content.c_str(), 1, content.size(), file); line_count += f.count_lines(); } diff --git a/re2c/src/codegen/output.h b/re2c/src/codegen/output.h index 5c2b7c8a..dce545f4 100644 --- a/re2c/src/codegen/output.h +++ b/re2c/src/codegen/output.h @@ -42,6 +42,17 @@ struct OutputFragment , TYPES , YYACCEPT_INIT , YYMAXFILL + , SKIP + , PEEK + , BACKUP + , PEEK_SKIP + , SKIP_PEEK + , SKIP_BACKUP + , BACKUP_SKIP + , BACKUP_PEEK + , BACKUP_PEEK_SKIP + , SKIP_BACKUP_PEEK + , EMPTY }; type_t type; @@ -121,6 +132,9 @@ public: OutputFile & wdelay_types (); OutputFile & wdelay_yyaccept_init (uint32_t ind); OutputFile & wdelay_yymaxfill (); + OutputFile& wdelay_skip(uint32_t ind, bool skip); + OutputFile& wdelay_peek(uint32_t ind, bool peek); + OutputFile& wdelay_backup(uint32_t ind, bool backup); void global_lists(uniq_vector_t &types, std::set &tags) const; diff --git a/re2c/src/conf/opt.cc b/re2c/src/conf/opt.cc index 7b62609e..b655ba39 100644 --- a/re2c/src/conf/opt.cc +++ b/re2c/src/conf/opt.cc @@ -174,14 +174,14 @@ void opt_t::fix () cGotoThreshold = Opt::baseopt.cGotoThreshold; yytarget = Opt::baseopt.yytarget; } - if (input_api.type () != InputAPI::DEFAULT) + if (input_api != INPUT_DEFAULT) { yycursor = Opt::baseopt.yycursor; yymarker = Opt::baseopt.yymarker; yyctxmarker = Opt::baseopt.yyctxmarker; yylimit = Opt::baseopt.yylimit; } - if (input_api.type () != InputAPI::CUSTOM) + if (input_api != INPUT_CUSTOM) { yypeek = Opt::baseopt.yypeek; yyskip = Opt::baseopt.yyskip; @@ -215,7 +215,7 @@ void opt_t::fix () break; case SKELETON: iFlag = true; - input_api.set (InputAPI::CUSTOM); + input_api = INPUT_CUSTOM; indString = " "; topIndent = 2; break; diff --git a/re2c/src/conf/opt.h b/re2c/src/conf/opt.h index 61ea95c6..6d237203 100644 --- a/re2c/src/conf/opt.h +++ b/re2c/src/conf/opt.h @@ -78,7 +78,7 @@ namespace re2c OPT (uint32_t, topIndent, 0) \ OPT (std::string, indString, "\t") \ /* input API */ \ - OPT (InputAPI, input_api, InputAPI ()) \ + OPT (input_api_t, input_api, INPUT_DEFAULT) \ OPT (std::string, yycursor, "YYCURSOR") \ OPT (std::string, yymarker, "YYMARKER") \ OPT (std::string, yyctxmarker, "YYCTXMARKER") \ @@ -200,21 +200,12 @@ public: bool set_encoding (Enc::type_t t) { return useropt->encoding.set (t); } void unset_encoding (Enc::type_t t) { useropt->encoding.unset (t); } void set_encoding_policy (Enc::policy_t p) { useropt->encoding.setPolicy (p); } - void set_input_api (InputAPI::type_t t) { useropt->input_api.set (t); } #define OPT1 OPT #define OPT(type, name, value) void set_##name (type arg) { useropt->name = arg; } RE2C_OPTS #undef OPT1 #undef OPT - // helpers - std::string yychConversion () - { - return realopt->yychConversion - ? "(" + realopt->yyctype + ")" - : ""; - } - // bad temporary hacks, should be fixed by proper scoping of config (parts). void reset_encoding (const Enc & enc); void reset_mapCodeName (); diff --git a/re2c/src/conf/parse_opts.re b/re2c/src/conf/parse_opts.re index 36117716..2e765465 100644 --- a/re2c/src/conf/parse_opts.re +++ b/re2c/src/conf/parse_opts.re @@ -217,8 +217,8 @@ opt_input: error ("bad argument to option --input (expected: default | custom): %s", *argv); return EXIT_FAIL; } - "default" end { opts.set_input_api (InputAPI::DEFAULT); goto opt; } - "custom" end { opts.set_input_api (InputAPI::CUSTOM); goto opt; } + "default" end { opts.set_input_api(INPUT_DEFAULT); goto opt; } + "custom" end { opts.set_input_api(INPUT_CUSTOM); goto opt; } */ opt_empty_class: diff --git a/re2c/src/ir/compile.cc b/re2c/src/ir/compile.cc index 9238f50d..89e06189 100644 --- a/re2c/src/ir/compile.cc +++ b/re2c/src/ir/compile.cc @@ -61,7 +61,7 @@ smart_ptr compile(const spec_t &spec, Output &output) cs.push_back(*i); } - nfa_t nfa(rules, opts->input_api.type()); + nfa_t nfa(rules, opts->input_api); dfa_t dfa(nfa, cs, cond, opts->bijective_mapping, opts->dump_dfa_raw, warn); if (opts->dump_dfa_det) dump_dfa(dfa); diff --git a/re2c/src/ir/nfa/nfa.cc b/re2c/src/ir/nfa/nfa.cc index 3924782c..c86e1e4a 100644 --- a/re2c/src/ir/nfa/nfa.cc +++ b/re2c/src/ir/nfa/nfa.cc @@ -2,7 +2,7 @@ namespace re2c { -nfa_t::nfa_t(const std::vector ®exps, InputAPI::type_t input) +nfa_t::nfa_t(const std::vector ®exps, input_api_t input) : max_size(0) , size(0) , states(NULL) diff --git a/re2c/src/ir/nfa/nfa.h b/re2c/src/ir/nfa/nfa.h index dba90f94..810b8b98 100644 --- a/re2c/src/ir/nfa/nfa.h +++ b/re2c/src/ir/nfa/nfa.h @@ -94,14 +94,14 @@ struct nfa_t std::vector &fixtags; nfa_state_t *root; - nfa_t(const std::vector &rs, InputAPI::type_t input); + nfa_t(const std::vector &rs, input_api_t input); ~nfa_t(); FORBID_COPY(nfa_t); }; size_t counters(const std::vector ®exps, size_t &ntags); -void regexps2nfa(const std::vector ®exps, nfa_t &nfa, InputAPI::type_t input); +void regexps2nfa(const std::vector ®exps, nfa_t &nfa, input_api_t input); bool nullable_rule(const RegExpRule &rule); void init_rules(const std::vector ®exps, std::valarray &rules, const std::vector &vartags, const std::vector &fixtags); diff --git a/re2c/src/ir/nfa/regexps2nfa.cc b/re2c/src/ir/nfa/regexps2nfa.cc index 62b0a7bb..62fd9b16 100644 --- a/re2c/src/ir/nfa/regexps2nfa.cc +++ b/re2c/src/ir/nfa/regexps2nfa.cc @@ -106,9 +106,9 @@ static nfa_state_t *regexp2nfa(nfa_t &nfa, size_t nrule, size_t &dist, } static nfa_state_t *regexp2nfa_rule(nfa_t &nfa, size_t nrule, - const RegExp *re, InputAPI::type_t input) + const RegExp *re, input_api_t input) { - const bool generic = input == InputAPI::CUSTOM; + const bool generic = input == INPUT_CUSTOM; size_t base = FixTag::RIGHTMOST, dist = 0; nfa_state_t *s = &nfa.states[nfa.size++]; @@ -118,7 +118,7 @@ static nfa_state_t *regexp2nfa_rule(nfa_t &nfa, size_t nrule, } void regexps2nfa(const std::vector ®exps, - nfa_t &nfa, InputAPI::type_t input) + nfa_t &nfa, input_api_t input) { const size_t nregexps = regexps.size(); diff --git a/re2c/src/parse/lex_conf.re b/re2c/src/parse/lex_conf.re index b926240c..8807c3bf 100644 --- a/re2c/src/parse/lex_conf.re +++ b/re2c/src/parse/lex_conf.re @@ -188,8 +188,8 @@ void Scanner::lex_conf_input() /*!re2c * { fatal("bad configuration value" " (expected: 'default', 'custom')"); } - "default" { opts.set_input_api(InputAPI::DEFAULT); goto end; } - "custom" { opts.set_input_api(InputAPI::CUSTOM); goto end; } + "default" { opts.set_input_api(INPUT_DEFAULT); goto end; } + "custom" { opts.set_input_api(INPUT_CUSTOM); goto end; } */ end: lex_conf_semicolon(); diff --git a/re2c/test/bug1682718.c b/re2c/test/bug1682718.c index 4ff1b749..85a3788c 100644 --- a/re2c/test/bug1682718.c +++ b/re2c/test/bug1682718.c @@ -26,8 +26,7 @@ yy2: {return (char*)0;} #line 28 "bug1682718.c" yy4: - ++p; - yych = (unsigned char)*p; + yych = (unsigned char)*++p; switch (yych) { case '0': case '1': @@ -44,7 +43,7 @@ yy4: yy6: #line 9 "bug1682718.re" {return p;} -#line 48 "bug1682718.c" +#line 47 "bug1682718.c" } #line 11 "bug1682718.re" diff --git a/re2c/test/bug1682718.is.c b/re2c/test/bug1682718.is.c index 1f566201..3b3bc66e 100644 --- a/re2c/test/bug1682718.is.c +++ b/re2c/test/bug1682718.is.c @@ -11,8 +11,7 @@ yy2: ++p; {return (char*)0;} yy4: - ++p; - yych = (unsigned char)*p; + yych = (unsigned char)*++p; if (yych <= '/') goto yy6; if (yych <= '9') goto yy4; yy6: diff --git a/re2c/test/bug57.c b/re2c/test/bug57.c index 5cc723e1..2927b16f 100644 --- a/re2c/test/bug57.c +++ b/re2c/test/bug57.c @@ -49,8 +49,7 @@ yy6: } yy7: yyaccept = 1; - YYMARKER = ++YYCURSOR; - yych = *YYCURSOR; + yych = *(YYMARKER = ++YYCURSOR); switch (yych) { case '\\': goto yy15; case 'a': goto yy7; @@ -60,10 +59,9 @@ yy9: ++YYCURSOR; #line 14 "bug57.re" { return YYCURSOR - p; } -#line 64 "bug57.c" +#line 63 "bug57.c" yy11: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case 'b': goto yy13; default: goto yy12; @@ -76,8 +74,7 @@ yy12: goto yy2; } yy13: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '>': goto yy9; case '\\': goto yy11; @@ -86,8 +83,7 @@ yy13: default: goto yy12; } yy15: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case 'b': goto yy7; default: goto yy12; diff --git a/re2c/test/bug57_original.bi--case-insensitive.c b/re2c/test/bug57_original.bi--case-insensitive.c index e5416c0f..fdaa7c65 100644 --- a/re2c/test/bug57_original.bi--case-insensitive.c +++ b/re2c/test/bug57_original.bi--case-insensitive.c @@ -1304,8 +1304,7 @@ yy124: if (yych == 'a') goto yy191; goto yy31; yy125: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 128) { goto yy125; } @@ -2554,8 +2553,7 @@ yy351: } } yy352: - ++p; - yych = *p; + yych = *++p; yy353: if (yybm[0+yych] & 128) { goto yy352; @@ -2566,8 +2564,7 @@ yy354: p = marker; goto yy349; yy355: - ++p; - yych = *p; + yych = *++p; if (yych <= '@') { if (yych <= '/') goto yy354; if (yych >= ':') goto yy354; @@ -2577,8 +2574,7 @@ yy355: if (yych >= '{') goto yy354; } yy356: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -2599,8 +2595,7 @@ yy356: goto yy354; } } - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy361; if (yych <= '/') goto yy354; @@ -2616,8 +2611,7 @@ yy356: } } yy358: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -2643,8 +2637,7 @@ yy359: ++p; { return (p - start); } yy361: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy363; if (yych <= '/') goto yy354; @@ -2660,8 +2653,7 @@ yy361: } } yy362: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -2683,8 +2675,7 @@ yy362: } } yy363: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy365; if (yych <= '/') goto yy354; @@ -2700,8 +2691,7 @@ yy363: } } yy364: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -2723,8 +2713,7 @@ yy364: } } yy365: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy367; if (yych <= '/') goto yy354; @@ -2740,8 +2729,7 @@ yy365: } } yy366: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -2763,8 +2751,7 @@ yy366: } } yy367: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy369; if (yych <= '/') goto yy354; @@ -2780,8 +2767,7 @@ yy367: } } yy368: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -2803,8 +2789,7 @@ yy368: } } yy369: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy371; if (yych <= '/') goto yy354; @@ -2820,8 +2805,7 @@ yy369: } } yy370: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -2843,8 +2827,7 @@ yy370: } } yy371: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy373; if (yych <= '/') goto yy354; @@ -2860,8 +2843,7 @@ yy371: } } yy372: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -2883,8 +2865,7 @@ yy372: } } yy373: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy375; if (yych <= '/') goto yy354; @@ -2900,8 +2881,7 @@ yy373: } } yy374: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -2923,8 +2903,7 @@ yy374: } } yy375: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy377; if (yych <= '/') goto yy354; @@ -2940,8 +2919,7 @@ yy375: } } yy376: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -2963,8 +2941,7 @@ yy376: } } yy377: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy379; if (yych <= '/') goto yy354; @@ -2980,8 +2957,7 @@ yy377: } } yy378: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3003,8 +2979,7 @@ yy378: } } yy379: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy381; if (yych <= '/') goto yy354; @@ -3020,8 +2995,7 @@ yy379: } } yy380: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3043,8 +3017,7 @@ yy380: } } yy381: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy383; if (yych <= '/') goto yy354; @@ -3060,8 +3033,7 @@ yy381: } } yy382: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3083,8 +3055,7 @@ yy382: } } yy383: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy385; if (yych <= '/') goto yy354; @@ -3100,8 +3071,7 @@ yy383: } } yy384: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3123,8 +3093,7 @@ yy384: } } yy385: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy387; if (yych <= '/') goto yy354; @@ -3140,8 +3109,7 @@ yy385: } } yy386: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3163,8 +3131,7 @@ yy386: } } yy387: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy389; if (yych <= '/') goto yy354; @@ -3180,8 +3147,7 @@ yy387: } } yy388: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3203,8 +3169,7 @@ yy388: } } yy389: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy391; if (yych <= '/') goto yy354; @@ -3220,8 +3185,7 @@ yy389: } } yy390: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3243,8 +3207,7 @@ yy390: } } yy391: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy393; if (yych <= '/') goto yy354; @@ -3260,8 +3223,7 @@ yy391: } } yy392: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3283,8 +3245,7 @@ yy392: } } yy393: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy395; if (yych <= '/') goto yy354; @@ -3300,8 +3261,7 @@ yy393: } } yy394: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3323,8 +3283,7 @@ yy394: } } yy395: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy397; if (yych <= '/') goto yy354; @@ -3340,8 +3299,7 @@ yy395: } } yy396: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3363,8 +3321,7 @@ yy396: } } yy397: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy399; if (yych <= '/') goto yy354; @@ -3380,8 +3337,7 @@ yy397: } } yy398: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3403,8 +3359,7 @@ yy398: } } yy399: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy401; if (yych <= '/') goto yy354; @@ -3420,8 +3375,7 @@ yy399: } } yy400: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3443,8 +3397,7 @@ yy400: } } yy401: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy403; if (yych <= '/') goto yy354; @@ -3460,8 +3413,7 @@ yy401: } } yy402: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3483,8 +3435,7 @@ yy402: } } yy403: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy405; if (yych <= '/') goto yy354; @@ -3500,8 +3451,7 @@ yy403: } } yy404: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3523,8 +3473,7 @@ yy404: } } yy405: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy407; if (yych <= '/') goto yy354; @@ -3540,8 +3489,7 @@ yy405: } } yy406: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3563,8 +3511,7 @@ yy406: } } yy407: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy409; if (yych <= '/') goto yy354; @@ -3580,8 +3527,7 @@ yy407: } } yy408: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3603,8 +3549,7 @@ yy408: } } yy409: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy411; if (yych <= '/') goto yy354; @@ -3620,8 +3565,7 @@ yy409: } } yy410: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3643,8 +3587,7 @@ yy410: } } yy411: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy413; if (yych <= '/') goto yy354; @@ -3660,8 +3603,7 @@ yy411: } } yy412: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3683,8 +3625,7 @@ yy412: } } yy413: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy415; if (yych <= '/') goto yy354; @@ -3700,8 +3641,7 @@ yy413: } } yy414: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3723,8 +3663,7 @@ yy414: } } yy415: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy417; if (yych <= '/') goto yy354; @@ -3740,8 +3679,7 @@ yy415: } } yy416: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3763,8 +3701,7 @@ yy416: } } yy417: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy419; if (yych <= '/') goto yy354; @@ -3780,8 +3717,7 @@ yy417: } } yy418: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3803,8 +3739,7 @@ yy418: } } yy419: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy421; if (yych <= '/') goto yy354; @@ -3820,8 +3755,7 @@ yy419: } } yy420: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3843,8 +3777,7 @@ yy420: } } yy421: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy423; if (yych <= '/') goto yy354; @@ -3860,8 +3793,7 @@ yy421: } } yy422: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3883,8 +3815,7 @@ yy422: } } yy423: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy425; if (yych <= '/') goto yy354; @@ -3900,8 +3831,7 @@ yy423: } } yy424: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3923,8 +3853,7 @@ yy424: } } yy425: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy427; if (yych <= '/') goto yy354; @@ -3940,8 +3869,7 @@ yy425: } } yy426: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -3963,8 +3891,7 @@ yy426: } } yy427: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy429; if (yych <= '/') goto yy354; @@ -3980,8 +3907,7 @@ yy427: } } yy428: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4003,8 +3929,7 @@ yy428: } } yy429: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy431; if (yych <= '/') goto yy354; @@ -4020,8 +3945,7 @@ yy429: } } yy430: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4043,8 +3967,7 @@ yy430: } } yy431: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy433; if (yych <= '/') goto yy354; @@ -4060,8 +3983,7 @@ yy431: } } yy432: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4083,8 +4005,7 @@ yy432: } } yy433: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy435; if (yych <= '/') goto yy354; @@ -4100,8 +4021,7 @@ yy433: } } yy434: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4123,8 +4043,7 @@ yy434: } } yy435: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy437; if (yych <= '/') goto yy354; @@ -4140,8 +4059,7 @@ yy435: } } yy436: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4163,8 +4081,7 @@ yy436: } } yy437: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy439; if (yych <= '/') goto yy354; @@ -4180,8 +4097,7 @@ yy437: } } yy438: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4203,8 +4119,7 @@ yy438: } } yy439: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy441; if (yych <= '/') goto yy354; @@ -4220,8 +4135,7 @@ yy439: } } yy440: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4243,8 +4157,7 @@ yy440: } } yy441: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy443; if (yych <= '/') goto yy354; @@ -4260,8 +4173,7 @@ yy441: } } yy442: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4283,8 +4195,7 @@ yy442: } } yy443: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy445; if (yych <= '/') goto yy354; @@ -4300,8 +4211,7 @@ yy443: } } yy444: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4323,8 +4233,7 @@ yy444: } } yy445: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy447; if (yych <= '/') goto yy354; @@ -4340,8 +4249,7 @@ yy445: } } yy446: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4363,8 +4271,7 @@ yy446: } } yy447: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy449; if (yych <= '/') goto yy354; @@ -4380,8 +4287,7 @@ yy447: } } yy448: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4403,8 +4309,7 @@ yy448: } } yy449: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy451; if (yych <= '/') goto yy354; @@ -4420,8 +4325,7 @@ yy449: } } yy450: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4443,8 +4347,7 @@ yy450: } } yy451: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy453; if (yych <= '/') goto yy354; @@ -4460,8 +4363,7 @@ yy451: } } yy452: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4483,8 +4385,7 @@ yy452: } } yy453: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy455; if (yych <= '/') goto yy354; @@ -4500,8 +4401,7 @@ yy453: } } yy454: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4523,8 +4423,7 @@ yy454: } } yy455: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy457; if (yych <= '/') goto yy354; @@ -4540,8 +4439,7 @@ yy455: } } yy456: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4563,8 +4461,7 @@ yy456: } } yy457: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy459; if (yych <= '/') goto yy354; @@ -4580,8 +4477,7 @@ yy457: } } yy458: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4603,8 +4499,7 @@ yy458: } } yy459: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy461; if (yych <= '/') goto yy354; @@ -4620,8 +4515,7 @@ yy459: } } yy460: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4643,8 +4537,7 @@ yy460: } } yy461: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy463; if (yych <= '/') goto yy354; @@ -4660,8 +4553,7 @@ yy461: } } yy462: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4683,8 +4575,7 @@ yy462: } } yy463: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy465; if (yych <= '/') goto yy354; @@ -4700,8 +4591,7 @@ yy463: } } yy464: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4723,8 +4613,7 @@ yy464: } } yy465: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy467; if (yych <= '/') goto yy354; @@ -4740,8 +4629,7 @@ yy465: } } yy466: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4763,8 +4651,7 @@ yy466: } } yy467: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy469; if (yych <= '/') goto yy354; @@ -4780,8 +4667,7 @@ yy467: } } yy468: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4802,9 +4688,8 @@ yy468: goto yy354; } } -yy469: - ++p; - yych = *p; +yy469: + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy471; if (yych <= '/') goto yy354; @@ -4820,8 +4705,7 @@ yy469: } } yy470: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4843,8 +4727,7 @@ yy470: } } yy471: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy473; if (yych <= '/') goto yy354; @@ -4860,8 +4743,7 @@ yy471: } } yy472: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4883,8 +4765,7 @@ yy472: } } yy473: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy475; if (yych <= '/') goto yy354; @@ -4900,8 +4781,7 @@ yy473: } } yy474: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4923,8 +4803,7 @@ yy474: } } yy475: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy477; if (yych <= '/') goto yy354; @@ -4940,8 +4819,7 @@ yy475: } } yy476: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -4963,8 +4841,7 @@ yy476: } } yy477: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych == '-') goto yy479; if (yych <= '/') goto yy354; @@ -4980,8 +4857,7 @@ yy477: } } yy478: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy354; @@ -5003,8 +4879,7 @@ yy478: } } yy479: - ++p; - yych = *p; + yych = *++p; if (yych <= '@') { if (yych <= '/') goto yy354; if (yych <= '9') goto yy481; @@ -5016,8 +4891,7 @@ yy479: goto yy354; } yy480: - ++p; - yych = *p; + yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= '-') goto yy354; @@ -5036,8 +4910,7 @@ yy480: } } yy481: - ++p; - yych = *p; + yych = *++p; if (yych == '.') goto yy355; if (yych == '>') goto yy359; goto yy354; @@ -5196,8 +5069,7 @@ yy491: p = marker; goto yy484; yy492: - ++p; - yych = *p; + yych = *++p; if (yybm[256+yych] & 32) { goto yy492; } @@ -5211,8 +5083,7 @@ yy494: if (yych == 'c') goto yy510; goto yy491; yy495: - ++p; - yych = *p; + yych = *++p; if (yybm[256+yych] & 64) { goto yy495; } @@ -5226,21 +5097,18 @@ yy495: goto yy491; } yy497: - ++p; - yych = *p; + yych = *++p; yy498: if (yybm[256+yych] & 128) { goto yy497; } if (yych <= 0x00) goto yy491; - ++p; - yych = *p; + yych = *++p; if (yych <= 0x00) goto yy491; if (yych == '>') goto yy505; goto yy497; yy500: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 1) { goto yy500; } @@ -5268,8 +5136,7 @@ yy502: if (yych == '>') goto yy505; goto yy491; yy503: - ++p; - yych = *p; + yych = *++p; yy504: if (yybm[0+yych] & 1) { goto yy500; @@ -5301,8 +5168,7 @@ yy507: if (yych == '>') goto yy491; goto yy516; yy508: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 2) { goto yy508; } @@ -5314,8 +5180,7 @@ yy510: if (yych == 'd') goto yy518; goto yy491; yy511: - ++p; - yych = *p; + yych = *++p; if (yych <= 0x1F) { if (yych <= 0x08) goto yy491; if (yych <= '\r') goto yy511; @@ -5326,8 +5191,7 @@ yy511: goto yy491; } yy513: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 4) { goto yy513; } @@ -5350,8 +5214,7 @@ yy513: } } yy515: - ++p; - yych = *p; + yych = *++p; yy516: if (yybm[0+yych] & 8) { goto yy515; @@ -5369,8 +5232,7 @@ yy518: if (yych == 'a') goto yy523; goto yy491; yy519: - ++p; - yych = *p; + yych = *++p; if (yych <= '<') { if (yych <= ' ') { if (yych <= 0x08) goto yy491; @@ -5404,8 +5266,7 @@ yy519: } } yy521: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 16) { goto yy524; } @@ -5415,8 +5276,7 @@ yy521: if (yych <= '\'') goto yy529; goto yy491; yy522: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 8) { goto yy515; } @@ -5428,8 +5288,7 @@ yy523: if (yych == 't') goto yy531; goto yy491; yy524: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 16) { goto yy524; } @@ -5438,8 +5297,7 @@ yy524: if (yych == '>') goto yy505; goto yy491; yy526: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 16) { goto yy524; } @@ -5452,16 +5310,14 @@ yy526: goto yy491; } yy527: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 32) { goto yy527; } if (yych <= 0x00) goto yy491; goto yy536; yy529: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 64) { goto yy529; } @@ -5473,8 +5329,7 @@ yy531: if (yych == 'a') goto yy537; goto yy491; yy532: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych <= ' ') { if (yych <= 0x08) { @@ -5517,8 +5372,7 @@ yy532: } } yy534: - ++p; - yych = *p; + yych = *++p; if (yych <= '9') { if (yych <= ' ') { if (yych <= 0x08) { @@ -5561,8 +5415,7 @@ yy534: } } yy536: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 1) { goto yy500; } @@ -5574,8 +5427,7 @@ yy537: if (yych == '[') goto yy540; goto yy491; yy538: - ++p; - yych = *p; + yych = *++p; if (yych <= '/') { if (yych <= '!') { if (yych <= '\r') { @@ -5621,16 +5473,14 @@ yy538: } } yy540: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 128) { goto yy540; } if (yych <= 0x00) goto yy491; goto yy544; yy542: - ++p; - yych = *p; + yych = *++p; if (yych <= ':') { if (yych <= ' ') { if (yych <= 0x08) { @@ -5674,14 +5524,12 @@ yy542: } } yy544: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 128) { goto yy540; } if (yych <= 0x00) goto yy491; - ++p; - yych = *p; + yych = *++p; if (yych <= 0x00) goto yy491; if (yych == '>') goto yy505; goto yy540; @@ -7380,8 +7228,7 @@ yy770: { return 0; } yy771: yyaccept = 0; - marker = ++p; - yych = *p; + yych = *(marker = ++p); if (yybm[0+yych] & 8) { goto yy771; } @@ -7402,8 +7249,7 @@ yy773: { return (p - start); } yy774: yyaccept = 0; - marker = ++p; - yych = *p; + yych = *(marker = ++p); yy775: if (yybm[0+yych] & 16) { goto yy774; @@ -7420,8 +7266,7 @@ yy776: goto yy781; yy777: yyaccept = 0; - marker = ++p; - yych = *p; + yych = *(marker = ++p); if (yybm[0+yych] & 32) { goto yy777; } @@ -7457,8 +7302,7 @@ yy779: } } yy780: - ++p; - yych = *p; + yych = *++p; yy781: if (yych <= '(') { if (yych <= ' ') goto yy782; @@ -7480,8 +7324,7 @@ yy782: goto yy790; } yy783: - ++p; - yych = *p; + yych = *++p; if (yych <= '@') { if (yych <= ' ') goto yy782; if (yych <= '/') goto yy774; @@ -7498,8 +7341,7 @@ yy783: } } yy784: - ++p; - yych = *p; + yych = *++p; if (yych <= '@') { if (yych <= ' ') goto yy782; if (yych <= '/') goto yy780; @@ -7516,8 +7358,7 @@ yy784: } } yy785: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 64) { goto yy785; } @@ -7525,8 +7366,7 @@ yy785: if (yych <= '>') goto yy792; goto yy793; yy787: - ++p; - yych = *p; + yych = *++p; if (yych <= ')') { if (yych <= '\n') { if (yych <= 0x00) goto yy782; @@ -7556,8 +7396,7 @@ yy789: yy790: { return (p - start); } yy791: - ++p; - yych = *p; + yych = *++p; if (yych <= '>') { if (yych <= ' ') { if (yych <= 0x00) goto yy782; @@ -7586,8 +7425,7 @@ yy792: ++p; goto yy790; yy793: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 128) { goto yy793; } @@ -7606,8 +7444,7 @@ yy795: if (yych == '(') goto yy790; goto yy781; yy796: - ++p; - yych = *p; + yych = *++p; if (yych <= '>') { if (yych <= ' ') { if (yych <= 0x00) goto yy782; @@ -7634,8 +7471,7 @@ yy796: } yy797: yyaccept = 2; - marker = ++p; - yych = *p; + yych = *(marker = ++p); if (yybm[0+yych] & 32) { goto yy777; } @@ -7655,8 +7491,7 @@ yy797: } yy798: yyaccept = 0; - marker = ++p; - yych = *p; + yych = *(marker = ++p); if (yych <= '(') { if (yych <= '\n') { if (yych <= 0x00) goto yy773; @@ -7679,8 +7514,7 @@ yy798: } yy799: yyaccept = 2; - marker = ++p; - yych = *p; + yych = *(marker = ++p); if (yybm[0+yych] & 64) { goto yy785; } @@ -7689,8 +7523,7 @@ yy799: goto yy793; yy800: yyaccept = 2; - marker = ++p; - yych = *p; + yych = *(marker = ++p); if (yych <= ')') { if (yych <= '\n') { if (yych <= 0x00) goto yy790; @@ -7713,8 +7546,7 @@ yy800: } } yy801: - ++p; - yych = *p; + yych = *++p; if (yych <= '(') { if (yych <= '\n') { if (yych <= 0x00) goto yy782; @@ -7816,8 +7648,7 @@ yy808: if (yych <= 0x00) goto yy804; goto yy823; yy809: - ++p; - yych = *p; + yych = *++p; yy810: if (yybm[0+yych] & 16) { goto yy809; @@ -7845,8 +7676,7 @@ yy812: yy813: { return (p - start); } yy814: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 16) { goto yy809; } @@ -7854,8 +7684,7 @@ yy814: if (yych <= '"') goto yy828; goto yy814; yy816: - ++p; - yych = *p; + yych = *++p; yy817: if (yybm[0+yych] & 64) { goto yy816; @@ -7867,8 +7696,7 @@ yy818: yy819: { return (p - start); } yy820: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 64) { goto yy816; } @@ -7876,8 +7704,7 @@ yy820: if (yych <= '\'') goto yy829; goto yy820; yy822: - ++p; - yych = *p; + yych = *++p; yy823: if (yybm[0+yych] & 128) { goto yy822; @@ -7889,8 +7716,7 @@ yy824: yy825: { return (p - start); } yy826: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 128) { goto yy822; } @@ -7899,8 +7725,7 @@ yy826: goto yy826; yy828: yyaccept = 1; - marker = ++p; - yych = *p; + yych = *(marker = ++p); if (yybm[0+yych] & 16) { goto yy809; } @@ -7909,8 +7734,7 @@ yy828: goto yy814; yy829: yyaccept = 2; - marker = ++p; - yych = *p; + yych = *(marker = ++p); if (yybm[0+yych] & 64) { goto yy816; } @@ -7919,8 +7743,7 @@ yy829: goto yy820; yy830: yyaccept = 3; - marker = ++p; - yych = *p; + yych = *(marker = ++p); if (yybm[0+yych] & 128) { goto yy822; } @@ -7979,8 +7802,7 @@ int _scan_spacechars(const unsigned char *p) ++p; { return 0; } yy835: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 128) { goto yy835; } @@ -8053,8 +7875,7 @@ yy843: yy844: { return (p - start); } yy845: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 128) { goto yy845; } @@ -8173,8 +7994,7 @@ yy859: ++p; { return 2; } yy861: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 32) { goto yy861; } @@ -8183,8 +8003,7 @@ yy863: p = marker; goto yy855; yy864: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 32) { goto yy861; } @@ -8195,14 +8014,12 @@ yy866: ++p; { return 1; } yy868: - ++p; - yych = *p; + yych = *++p; if (yych == '\n') goto yy866; if (yych == ' ') goto yy868; goto yy863; yy870: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 128) { goto yy870; } @@ -8294,8 +8111,7 @@ yy878: if (yych == '_') goto yy890; goto yy874; yy879: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 8) { goto yy879; } @@ -8304,36 +8120,30 @@ yy881: p = marker; goto yy874; yy882: - ++p; - yych = *p; + yych = *++p; if (yych == ' ') goto yy882; if (yych == '*') goto yy892; goto yy881; yy884: - ++p; - yych = *p; + yych = *++p; if (yych == ' ') goto yy884; if (yych != '-') goto yy881; yy886: - ++p; - yych = *p; + yych = *++p; if (yych == ' ') goto yy886; if (yych == '-') goto yy894; goto yy881; yy888: - ++p; - yych = *p; + yych = *++p; if (yych == ' ') goto yy888; if (yych != '_') goto yy881; yy890: - ++p; - yych = *p; + yych = *++p; if (yych == ' ') goto yy890; if (yych == '_') goto yy896; goto yy881; yy892: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 16) { goto yy892; } @@ -8342,8 +8152,7 @@ yy892: if (yych <= '\n') goto yy900; goto yy881; yy894: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 32) { goto yy894; } @@ -8352,8 +8161,7 @@ yy894: if (yych <= '\n') goto yy904; goto yy881; yy896: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 64) { goto yy896; } @@ -8362,8 +8170,7 @@ yy896: if (yych <= '\n') goto yy908; goto yy881; yy898: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 128) { goto yy898; } @@ -8373,8 +8180,7 @@ yy900: ++p; { return (p - start); } yy902: - ++p; - yych = *p; + yych = *++p; if (yych <= '\n') { if (yych <= 0x08) goto yy881; if (yych <= '\t') goto yy902; @@ -8386,8 +8192,7 @@ yy904: ++p; { return (p - start); } yy906: - ++p; - yych = *p; + yych = *++p; if (yych <= '\n') { if (yych <= 0x08) goto yy881; if (yych <= '\t') goto yy906; @@ -8480,8 +8285,7 @@ yy918: } goto yy917; yy919: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 16) { goto yy919; } @@ -8493,8 +8297,7 @@ yy919: marker = p; goto yy923; yy921: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 32) { goto yy921; } @@ -8506,8 +8309,7 @@ yy921: marker = p; goto yy927; yy923: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 64) { goto yy923; } @@ -8518,8 +8320,7 @@ yy925: p = marker; { return (p - start); } yy927: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 128) { goto yy927; } @@ -8611,8 +8412,7 @@ yy939: } goto yy938; yy940: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 32) { goto yy940; } @@ -8632,8 +8432,7 @@ yy940: goto yy938; } yy942: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 64) { goto yy942; } @@ -8653,8 +8452,7 @@ yy942: goto yy938; } yy944: - ++p; - yych = *p; + yych = *++p; if (yybm[0+yych] & 128) { goto yy944; } @@ -8665,8 +8463,7 @@ yy946: p = marker; { return (p - start); } yy948: - ++p; - yych = *p; + yych = *++p; if (yych <= '\n') { if (yych <= 0x08) goto yy938; if (yych <= '\t') goto yy948; diff --git a/re2c/test/calc_006.s.c b/re2c/test/calc_006.s.c index 202aa559..3485c40a 100644 --- a/re2c/test/calc_006.s.c +++ b/re2c/test/calc_006.s.c @@ -103,23 +103,22 @@ yy4: { res = 1; continue; } #line 105 "calc_006.s.c" yy6: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; if (yych == '\t') goto yy6; if (yych == ' ') goto yy6; #line 107 "calc_006.s.re" { continue; } -#line 113 "calc_006.s.c" +#line 112 "calc_006.s.c" yy9: ++YYCURSOR; #line 110 "calc_006.s.re" { res = stack_add(); continue; } -#line 118 "calc_006.s.c" +#line 117 "calc_006.s.c" yy11: ++YYCURSOR; #line 111 "calc_006.s.re" { res = stack_sub(); continue; } -#line 123 "calc_006.s.c" +#line 122 "calc_006.s.c" yy13: yych = *++YYCURSOR; if (yych <= '/') goto yy14; @@ -127,22 +126,20 @@ yy13: yy14: #line 109 "calc_006.s.re" { res = push_num(t, p, 10); continue; } -#line 131 "calc_006.s.c" +#line 130 "calc_006.s.c" yy15: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; if (yych <= '/') goto yy14; if (yych <= '9') goto yy15; goto yy14; yy17: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; if (yych <= '/') goto yy19; if (yych <= '9') goto yy17; yy19: #line 108 "calc_006.s.re" { res = push_num(t, p, 8); continue; } -#line 146 "calc_006.s.c" +#line 143 "calc_006.s.c" } #line 114 "calc_006.s.re" diff --git a/re2c/test/calc_007.b.c b/re2c/test/calc_007.b.c index 7d972ed6..153a46a5 100644 --- a/re2c/test/calc_007.b.c +++ b/re2c/test/calc_007.b.c @@ -133,24 +133,23 @@ yy4: { res = 1; continue; } #line 135 "calc_007.b.c" yy6: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; if (yybm[0+yych] & 64) { goto yy6; } #line 80 "calc_007.b.re" { continue; } -#line 144 "calc_007.b.c" +#line 143 "calc_007.b.c" yy9: ++YYCURSOR; #line 83 "calc_007.b.re" { res = stack_add(); continue; } -#line 149 "calc_007.b.c" +#line 148 "calc_007.b.c" yy11: ++YYCURSOR; #line 84 "calc_007.b.re" { res = stack_sub(); continue; } -#line 154 "calc_007.b.c" +#line 153 "calc_007.b.c" yy13: yych = *++YYCURSOR; if (yych <= '/') goto yy14; @@ -158,23 +157,21 @@ yy13: yy14: #line 82 "calc_007.b.re" { res = push_num(t, p, 10); continue; } -#line 162 "calc_007.b.c" +#line 161 "calc_007.b.c" yy15: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; if (yybm[0+yych] & 128) { goto yy15; } goto yy14; yy17: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; if (yych <= '/') goto yy19; if (yych <= '9') goto yy17; yy19: #line 81 "calc_007.b.re" { res = push_num(t, p, 8); continue; } -#line 178 "calc_007.b.c" +#line 175 "calc_007.b.c" } #line 87 "calc_007.b.re" diff --git a/re2c/test/calc_008.b.c b/re2c/test/calc_008.b.c index 06eb75c9..356e1bd3 100644 --- a/re2c/test/calc_008.b.c +++ b/re2c/test/calc_008.b.c @@ -129,24 +129,23 @@ scan4: { res = 1; continue; } #line 131 "calc_008.b.c" scan6: - ++p; - curr = (unsigned char)*p; + curr = (unsigned char)*++p; if (yybm[0+curr] & 64) { goto scan6; } #line 103 "calc_008.b.re" { continue; } -#line 140 "calc_008.b.c" +#line 139 "calc_008.b.c" scan9: ++p; #line 106 "calc_008.b.re" { res = stack_add(); continue; } -#line 145 "calc_008.b.c" +#line 144 "calc_008.b.c" scan11: ++p; #line 107 "calc_008.b.re" { res = stack_sub(); continue; } -#line 150 "calc_008.b.c" +#line 149 "calc_008.b.c" scan13: curr = (unsigned char)*++p; if (curr <= '/') goto scan14; @@ -154,23 +153,21 @@ scan13: scan14: #line 105 "calc_008.b.re" { res = push_num(t, p, 10); continue; } -#line 158 "calc_008.b.c" +#line 157 "calc_008.b.c" scan15: - ++p; - curr = (unsigned char)*p; + curr = (unsigned char)*++p; if (yybm[0+curr] & 128) { goto scan15; } goto scan14; scan17: - ++p; - curr = (unsigned char)*p; + curr = (unsigned char)*++p; if (curr <= '/') goto scan19; if (curr <= '9') goto scan17; scan19: #line 104 "calc_008.b.re" { res = push_num(t, p, 8); continue; } -#line 174 "calc_008.b.c" +#line 171 "calc_008.b.c" } #line 110 "calc_008.b.re" diff --git a/re2c/test/condtype_yysetcondition.cg.c b/re2c/test/condtype_yysetcondition.cg.c index 62909f4d..6c80dfac 100644 --- a/re2c/test/condtype_yysetcondition.cg.c +++ b/re2c/test/condtype_yysetcondition.cg.c @@ -30,11 +30,10 @@ int main () goto *yyctable[YYGETCONDITION()]; /* *********************************** */ yyc_b: - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 24 "condtype_yysetcondition.cg.re" { printf ("b\n"); break; } -#line 38 "condtype_yysetcondition.cg.c" +#line 37 "condtype_yysetcondition.cg.c" /* *********************************** */ yyc_a: yych = *YYCURSOR; @@ -43,12 +42,12 @@ yyc_a: YYSETCONDITION(yycb); #line 27 "condtype_yysetcondition.cg.re" { printf ("a => b\n"); continue; } -#line 47 "condtype_yysetcondition.cg.c" +#line 46 "condtype_yysetcondition.cg.c" yy9: ++YYCURSOR; #line 26 "condtype_yysetcondition.cg.re" { printf ("a\n"); continue; } -#line 52 "condtype_yysetcondition.cg.c" +#line 51 "condtype_yysetcondition.cg.c" } #line 28 "condtype_yysetcondition.cg.re" diff --git a/re2c/test/condtype_yysetcondition.cs.c b/re2c/test/condtype_yysetcondition.cs.c index 3c6a3518..2ead9992 100644 --- a/re2c/test/condtype_yysetcondition.cs.c +++ b/re2c/test/condtype_yysetcondition.cs.c @@ -30,11 +30,10 @@ int main () } /* *********************************** */ yyc_b: - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 24 "condtype_yysetcondition.cs.re" { printf ("b\n"); break; } -#line 38 "condtype_yysetcondition.cs.c" +#line 37 "condtype_yysetcondition.cs.c" /* *********************************** */ yyc_a: yych = *YYCURSOR; @@ -43,12 +42,12 @@ yyc_a: YYSETCONDITION(yycb); #line 27 "condtype_yysetcondition.cs.re" { printf ("a => b\n"); continue; } -#line 47 "condtype_yysetcondition.cs.c" +#line 46 "condtype_yysetcondition.cs.c" yy9: ++YYCURSOR; #line 26 "condtype_yysetcondition.cs.re" { printf ("a\n"); continue; } -#line 52 "condtype_yysetcondition.cs.c" +#line 51 "condtype_yysetcondition.cs.c" } #line 28 "condtype_yysetcondition.cs.re" diff --git a/re2c/test/config6.c b/re2c/test/config6.c index 446c577b..a956ed8f 100644 --- a/re2c/test/config6.c +++ b/re2c/test/config6.c @@ -74,8 +74,7 @@ yy11: { printf("Num\n"); continue; } #line 76 "config6.c" yy12: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '0': case '1': @@ -92,10 +91,9 @@ yy12: yy14: #line 19 "config6.re" { printf("Num\n"); continue; } -#line 96 "config6.c" +#line 95 "config6.c" yy15: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '0': case '1': @@ -112,7 +110,7 @@ yy15: yy17: #line 18 "config6.re" { printf("Oct\n"); continue; } -#line 116 "config6.c" +#line 114 "config6.c" } #line 25 "config6.re" diff --git a/re2c/test/control_flow_fail.c b/re2c/test/control_flow_fail.c index af3f68e8..9ba59acf 100644 --- a/re2c/test/control_flow_fail.c +++ b/re2c/test/control_flow_fail.c @@ -5,8 +5,8 @@ { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR++; yych = *YYCURSOR; - yych = *++YYCURSOR; switch (yych) { case 'a': goto yy5; default: goto yy3; diff --git a/re2c/test/control_flow_ok.c b/re2c/test/control_flow_ok.c index 035aaf43..f2c0a57d 100644 --- a/re2c/test/control_flow_ok.c +++ b/re2c/test/control_flow_ok.c @@ -5,9 +5,9 @@ { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR++; + yych = *YYCURSOR++; yych = *YYCURSOR; - yych = *++YYCURSOR; - yych = *++YYCURSOR; switch (yych) { case 'a': goto yy5; default: goto yy4; diff --git a/re2c/test/control_flow_yymarker_fail.c b/re2c/test/control_flow_yymarker_fail.c index 07681218..e031e641 100644 --- a/re2c/test/control_flow_yymarker_fail.c +++ b/re2c/test/control_flow_yymarker_fail.c @@ -5,8 +5,8 @@ { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); + yych = *YYCURSOR++; yych = *YYCURSOR; - yych = *++YYCURSOR; switch (yych) { case 'a': goto yy5; default: goto yy3; diff --git a/re2c/test/control_flow_yymarker_ok.c b/re2c/test/control_flow_yymarker_ok.c index 02eced95..1af86ae7 100644 --- a/re2c/test/control_flow_yymarker_ok.c +++ b/re2c/test/control_flow_yymarker_ok.c @@ -5,9 +5,9 @@ { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - yych = *++YYCURSOR; - yych = *(YYMARKER = ++YYCURSOR); + yych = *YYCURSOR++; + yych = *YYCURSOR++; + yych = *(YYMARKER = YYCURSOR); goto yy5; yy4: #line 4 "control_flow_yymarker_ok.re" diff --git a/re2c/test/control_flow_yymarker_yyaccept_fail.c b/re2c/test/control_flow_yymarker_yyaccept_fail.c index 76895e8a..943dd28b 100644 --- a/re2c/test/control_flow_yymarker_yyaccept_fail.c +++ b/re2c/test/control_flow_yymarker_yyaccept_fail.c @@ -6,8 +6,8 @@ YYCTYPE yych; unsigned int yyaccept = 0; if ((YYLIMIT - YYCURSOR) < 6) YYFILL(6); + yych = *YYCURSOR++; yych = *YYCURSOR; - yych = *++YYCURSOR; switch (yych) { case 'a': goto yy5; default: goto yy3; diff --git a/re2c/test/control_flow_yymarker_yyaccept_ok.c b/re2c/test/control_flow_yymarker_yyaccept_ok.c index 485cf328..d4efefac 100644 --- a/re2c/test/control_flow_yymarker_yyaccept_ok.c +++ b/re2c/test/control_flow_yymarker_yyaccept_ok.c @@ -6,8 +6,8 @@ YYCTYPE yych; unsigned int yyaccept = 0; if ((YYLIMIT - YYCURSOR) < 6) YYFILL(6); + yych = *YYCURSOR++; yych = *YYCURSOR; - yych = *++YYCURSOR; yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); goto yy5; diff --git a/re2c/test/default.8.c b/re2c/test/default.8.c index 4e63832a..03e8f00a 100644 --- a/re2c/test/default.8.c +++ b/re2c/test/default.8.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 2 "default.8.re" { return DEFAULT; } -#line 13 "default.8.c" +#line 12 "default.8.c" } #line 3 "default.8.re" diff --git a/re2c/test/default.c b/re2c/test/default.c index 57b4a3eb..43f4df4e 100644 --- a/re2c/test/default.c +++ b/re2c/test/default.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 2 "default.re" { return DEFAULT; } -#line 13 "default.c" +#line 12 "default.c" } #line 3 "default.re" diff --git a/re2c/test/default.e.c b/re2c/test/default.e.c index 4bcfbf3c..4d4b15da 100644 --- a/re2c/test/default.e.c +++ b/re2c/test/default.e.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 2 "default.e.re" { return DEFAULT; } -#line 13 "default.e.c" +#line 12 "default.e.c" } #line 3 "default.e.re" diff --git a/re2c/test/default.u.c b/re2c/test/default.u.c index 177685cd..02728a76 100644 --- a/re2c/test/default.u.c +++ b/re2c/test/default.u.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 2 "default.u.re" { return DEFAULT; } -#line 13 "default.u.c" +#line 12 "default.u.c" } #line 3 "default.u.re" diff --git a/re2c/test/default.w.c b/re2c/test/default.w.c index 62e1b339..95778832 100644 --- a/re2c/test/default.w.c +++ b/re2c/test/default.w.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 2 "default.w.re" { return DEFAULT; } -#line 13 "default.w.c" +#line 12 "default.w.c" } #line 3 "default.w.re" diff --git a/re2c/test/default.x.c b/re2c/test/default.x.c index 75acf6db..22e19083 100644 --- a/re2c/test/default.x.c +++ b/re2c/test/default.x.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 2 "default.x.re" { return DEFAULT; } -#line 13 "default.x.c" +#line 12 "default.x.c" } #line 3 "default.x.re" diff --git a/re2c/test/default_dup_star_1.ic.c b/re2c/test/default_dup_star_1.ic.c index 29b3418b..52830569 100644 --- a/re2c/test/default_dup_star_1.ic.c +++ b/re2c/test/default_dup_star_1.ic.c @@ -10,20 +10,17 @@ /* *********************************** */ yyc_c1: if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; { return DEFAULT-1; } /* *********************************** */ yyc_c2: if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; { return DEFAULT-2; } /* *********************************** */ yyc_c3: if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; { return DEFAULT-*; } } diff --git a/re2c/test/default_full.c b/re2c/test/default_full.c index 2104f656..05a7618b 100644 --- a/re2c/test/default_full.c +++ b/re2c/test/default_full.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 3 "default_full.re" { return FULL; } -#line 13 "default_full.c" +#line 12 "default_full.c" } #line 4 "default_full.re" diff --git a/re2c/test/default_full.e.c b/re2c/test/default_full.e.c index de5a4fe6..93bc3853 100644 --- a/re2c/test/default_full.e.c +++ b/re2c/test/default_full.e.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 3 "default_full.e.re" { return FULL; } -#line 13 "default_full.e.c" +#line 12 "default_full.e.c" } #line 4 "default_full.e.re" diff --git a/re2c/test/default_full.u.c b/re2c/test/default_full.u.c index c5f9679a..7ef2460d 100644 --- a/re2c/test/default_full.u.c +++ b/re2c/test/default_full.u.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 3 "default_full.u.re" { return FULL; } -#line 13 "default_full.u.c" +#line 12 "default_full.u.c" } #line 4 "default_full.u.re" diff --git a/re2c/test/default_full.w.c b/re2c/test/default_full.w.c index 3f81f8b3..c976f0ad 100644 --- a/re2c/test/default_full.w.c +++ b/re2c/test/default_full.w.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 3 "default_full.w.re" { return FULL; } -#line 13 "default_full.w.c" +#line 12 "default_full.w.c" } #line 4 "default_full.w.re" diff --git a/re2c/test/input4.--empty-class(match-empty).c b/re2c/test/input4.--empty-class(match-empty).c index c63138f8..a38637ef 100644 --- a/re2c/test/input4.--empty-class(match-empty).c +++ b/re2c/test/input4.--empty-class(match-empty).c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 4 "input4.--empty-class(match-empty).re" { return 1; } -#line 13 "input4.--empty-class(match-empty).c" +#line 12 "input4.--empty-class(match-empty).c" } #line 7 "input4.--empty-class(match-empty).re" diff --git a/re2c/test/input4.--empty-class(match-none).c b/re2c/test/input4.--empty-class(match-none).c index 932b85de..19e4ec4a 100644 --- a/re2c/test/input4.--empty-class(match-none).c +++ b/re2c/test/input4.--empty-class(match-none).c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 4 "input4.--empty-class(match-none).re" { return 1; } -#line 13 "input4.--empty-class(match-none).c" +#line 12 "input4.--empty-class(match-none).c" } #line 7 "input4.--empty-class(match-none).re" diff --git a/re2c/test/input4.c b/re2c/test/input4.c index 22d1a98f..0812d88b 100644 --- a/re2c/test/input4.c +++ b/re2c/test/input4.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 4 "input4.re" { return 1; } -#line 13 "input4.c" +#line 12 "input4.c" } #line 7 "input4.re" diff --git a/re2c/test/input6.--empty-class(match-empty).c b/re2c/test/input6.--empty-class(match-empty).c index f83996bf..2fd51a02 100644 --- a/re2c/test/input6.--empty-class(match-empty).c +++ b/re2c/test/input6.--empty-class(match-empty).c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 4 "input6.--empty-class(match-empty).re" { return 1; } -#line 13 "input6.--empty-class(match-empty).c" +#line 12 "input6.--empty-class(match-empty).c" } #line 6 "input6.--empty-class(match-empty).re" diff --git a/re2c/test/input6.--empty-class(match-none).c b/re2c/test/input6.--empty-class(match-none).c index 5bee0a6d..deba9606 100644 --- a/re2c/test/input6.--empty-class(match-none).c +++ b/re2c/test/input6.--empty-class(match-none).c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 4 "input6.--empty-class(match-none).re" { return 1; } -#line 13 "input6.--empty-class(match-none).c" +#line 12 "input6.--empty-class(match-none).c" } #line 6 "input6.--empty-class(match-none).re" diff --git a/re2c/test/input6.c b/re2c/test/input6.c index 117ab012..0ce16dfd 100644 --- a/re2c/test/input6.c +++ b/re2c/test/input6.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 4 "input6.re" { return 1; } -#line 13 "input6.c" +#line 12 "input6.c" } #line 6 "input6.re" diff --git a/re2c/test/php20150211_json_scanner.igc.c b/re2c/test/php20150211_json_scanner.igc.c index 8f15b145..f9dbed61 100644 --- a/re2c/test/php20150211_json_scanner.igc.c +++ b/re2c/test/php20150211_json_scanner.igc.c @@ -200,8 +200,7 @@ yy6: return PHP_JSON_T_ERROR; } yy7: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; yy8: if (yybm[0+yych] & 64) { goto yy7; @@ -268,8 +267,7 @@ yy18: } yy19: yyaccept = 0; - YYMARKER = ++YYCURSOR; - yych = *YYCURSOR; + yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 128) { goto yy19; } @@ -351,8 +349,7 @@ yy39: goto yy35; yy40: yyaccept = 2; - YYMARKER = ++YYCURSOR; - yych = *YYCURSOR; + yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { if (yych <= '/') goto yy42; if (yych <= '9') goto yy40; @@ -370,8 +367,7 @@ yy43: if (yych <= '/') goto yy35; if (yych >= ':') goto yy35; yy44: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; if (yych <= '/') goto yy42; if (yych <= '9') goto yy44; goto yy42; diff --git a/re2c/test/range_full.c b/re2c/test/range_full.c index 7e6a79a8..6aa48f61 100644 --- a/re2c/test/range_full.c +++ b/re2c/test/range_full.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 2 "range_full.re" {return 0;} -#line 13 "range_full.c" +#line 12 "range_full.c" } #line 3 "range_full.re" diff --git a/re2c/test/range_full.e.c b/re2c/test/range_full.e.c index a2a45ff4..e3d170c2 100644 --- a/re2c/test/range_full.e.c +++ b/re2c/test/range_full.e.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 2 "range_full.e.re" {return 0;} -#line 13 "range_full.e.c" +#line 12 "range_full.e.c" } #line 3 "range_full.e.re" diff --git a/re2c/test/range_full.u.c b/re2c/test/range_full.u.c index cba0d033..813cdc00 100644 --- a/re2c/test/range_full.u.c +++ b/re2c/test/range_full.u.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 2 "range_full.u.re" {return 0;} -#line 13 "range_full.u.c" +#line 12 "range_full.u.c" } #line 3 "range_full.u.re" diff --git a/re2c/test/range_full.w.c b/re2c/test/range_full.w.c index 102768dc..918f2fb5 100644 --- a/re2c/test/range_full.w.c +++ b/re2c/test/range_full.w.c @@ -5,11 +5,10 @@ { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - ++YYCURSOR; + yych = *YYCURSOR++; #line 2 "range_full.w.re" {return 0;} -#line 13 "range_full.w.c" +#line 12 "range_full.w.c" } #line 3 "range_full.w.re" diff --git a/re2c/test/tags/fix3.i--tags.c b/re2c/test/tags/fix3.i--tags.c index b88c2ee7..73745821 100644 --- a/re2c/test/tags/fix3.i--tags.c +++ b/re2c/test/tags/fix3.i--tags.c @@ -32,8 +32,7 @@ yy2: ++YYCURSOR; { printf("error\n"); return; } yy4: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '0': goto yy4; case '1': @@ -68,8 +67,7 @@ yy6: return; } yy7: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '1': goto yy7; case '2': @@ -86,8 +84,7 @@ yy7: goto yy6; } yy9: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '2': goto yy9; case '3': @@ -101,8 +98,7 @@ yy9: goto yy6; } yy11: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '3': goto yy11; case '4': @@ -113,8 +109,7 @@ yy11: goto yy6; } yy13: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '4': goto yy13; default: goto yy6; diff --git a/re2c/test/tags/fix3_trail.i--tags.c b/re2c/test/tags/fix3_trail.i--tags.c index e0646a3d..f53c2aab 100644 --- a/re2c/test/tags/fix3_trail.i--tags.c +++ b/re2c/test/tags/fix3_trail.i--tags.c @@ -32,8 +32,7 @@ yy2: ++YYCURSOR; { printf("error\n"); return; } yy4: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '0': goto yy4; case '1': @@ -68,8 +67,7 @@ yy6: return; } yy7: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '1': goto yy7; case '2': @@ -86,8 +84,7 @@ yy7: goto yy6; } yy9: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '2': goto yy9; case '3': @@ -101,8 +98,7 @@ yy9: goto yy6; } yy11: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '3': goto yy11; case '4': @@ -113,8 +109,7 @@ yy11: goto yy6; } yy13: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '4': goto yy13; default: goto yy6; diff --git a/re2c/test/tags/fix4.i--tags.c b/re2c/test/tags/fix4.i--tags.c index e4b57572..d389e807 100644 --- a/re2c/test/tags/fix4.i--tags.c +++ b/re2c/test/tags/fix4.i--tags.c @@ -30,8 +30,7 @@ yy4: default: goto yy3; } yy5: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '1': goto yy5; case '2': goto yy8; @@ -52,8 +51,7 @@ yy8: default: goto yy7; } yy9: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '3': goto yy9; case '4': goto yy11; diff --git a/re2c/test/tags/fix4_trail.i--tags.c b/re2c/test/tags/fix4_trail.i--tags.c index 26eb979d..3c1100e4 100644 --- a/re2c/test/tags/fix4_trail.i--tags.c +++ b/re2c/test/tags/fix4_trail.i--tags.c @@ -30,8 +30,7 @@ yy4: default: goto yy3; } yy5: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '1': goto yy5; case '2': goto yy8; @@ -52,8 +51,7 @@ yy8: default: goto yy7; } yy9: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '3': goto yy9; case '4': goto yy11; diff --git a/re2c/test/tags/fix5.i--tags.c b/re2c/test/tags/fix5.i--tags.c index 5a65aec1..cc728109 100644 --- a/re2c/test/tags/fix5.i--tags.c +++ b/re2c/test/tags/fix5.i--tags.c @@ -42,8 +42,7 @@ yy5: default: goto yy3; } yy6: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; yy7: switch (yych) { case '0': goto yy6; @@ -65,8 +64,7 @@ yy9: default: goto yy8; } yy10: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '2': goto yy10; case '3': goto yy12; @@ -92,8 +90,7 @@ yy13: return; } yy14: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; yy15: switch (yych) { case '4': goto yy14; diff --git a/re2c/test/tags/fix5_trail.i--tags.c b/re2c/test/tags/fix5_trail.i--tags.c index 3a8651e0..f3f83c36 100644 --- a/re2c/test/tags/fix5_trail.i--tags.c +++ b/re2c/test/tags/fix5_trail.i--tags.c @@ -42,8 +42,7 @@ yy5: default: goto yy3; } yy6: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; yy7: switch (yych) { case '0': goto yy6; @@ -65,8 +64,7 @@ yy9: default: goto yy8; } yy10: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; switch (yych) { case '2': goto yy10; case '3': goto yy12; @@ -92,8 +90,7 @@ yy13: return; } yy14: - ++YYCURSOR; - yych = *YYCURSOR; + yych = *++YYCURSOR; yy15: switch (yych) { case '4': goto yy14;