From 4c49568635af260c25f49a7bc4ba91ec70fdb7f6 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Wed, 17 Feb 2016 16:12:59 +0000 Subject: [PATCH] Simplified tracking of fixed-length trailing contexts. Static (that is, of fixed length) trailing contexts don't need recording context position with YYCTXMARKER and restoring it back on successful match. They can be tracked simply by decreasing input position by context length. --- re2c/src/codegen/emit_action.cc | 12 +- re2c/src/codegen/input_api.cc | 11 +- re2c/src/codegen/input_api.h | 3 +- re2c/src/ir/nfa/nfa.cc | 8 +- re2c/src/ir/regexp/regexp_rule.h | 16 ++- re2c/src/ir/skeleton/skeleton.cc | 2 +- re2c/test/bug116.c | 5 +- re2c/test/config10.c | 2 +- re2c/test/config8.c | 2 +- re2c/test/config9.b.c | 2 +- re2c/test/ctx.b.c | 2 +- re2c/test/ctx.c | 2 +- re2c/test/ctx.s.c | 2 +- re2c/test/modula.c | 146 ++++++++++---------- re2c/test/rexx.--empty-class(match-empty).c | 143 ++++++++++--------- re2c/test/rexx.--empty-class(match-none).c | 138 +++++++++--------- re2c/test/rexx.c | 143 ++++++++++--------- re2c/test/scanner_re2c.bi.c | 8 +- re2c/test/scanner_re2c_default.bi.c | 8 +- re2c/test/strip_003.b.c | 32 ++--- 20 files changed, 353 insertions(+), 334 deletions(-) diff --git a/re2c/src/codegen/emit_action.cc b/re2c/src/codegen/emit_action.cc index d3146dae..6957fea0 100644 --- a/re2c/src/codegen/emit_action.cc +++ b/re2c/src/codegen/emit_action.cc @@ -262,10 +262,16 @@ void emit_rule (OutputFile & o, uint32_t ind, const State * const s, const RuleO return; } - uint32_t back = rule->ctx->fixedLength(); - if (back != 0u && opts->target != opt_t::DOT) + if (opts->target != opt_t::DOT) { - o.wstring(opts->input_api.stmt_restorectx (ind)); + if (rule->ctx_len == ~0u) + { + o.wstring(opts->input_api.stmt_restorectx_dynamic(ind)); + } + else if (rule->ctx_len > 0) + { + o.wstring(opts->input_api.stmt_restorectx_static(ind, rule->ctx_len)); + } } if (opts->target == opt_t::SKELETON) diff --git a/re2c/src/codegen/input_api.cc b/re2c/src/codegen/input_api.cc index f2e32c38..63016647 100644 --- a/re2c/src/codegen/input_api.cc +++ b/re2c/src/codegen/input_api.cc @@ -1,3 +1,4 @@ +#include #include #include "src/codegen/input_api.h" @@ -107,7 +108,15 @@ std::string InputAPI::stmt_restore (uint32_t ind) const return indent (ind) + s + ";\n"; } -std::string InputAPI::stmt_restorectx (uint32_t ind) const +std::string InputAPI::stmt_restorectx_static (uint32_t ind, uint32_t off) const +{ + assert(type_ == DEFAULT); + std::ostringstream s; + s << indent (ind) << opts->yycursor << " -= " << off << ";\n"; + return s.str (); +} + +std::string InputAPI::stmt_restorectx_dynamic (uint32_t ind) const { std::string s; switch (type_) diff --git a/re2c/src/codegen/input_api.h b/re2c/src/codegen/input_api.h index 423475e6..3514019d 100644 --- a/re2c/src/codegen/input_api.h +++ b/re2c/src/codegen/input_api.h @@ -29,7 +29,8 @@ public: std::string stmt_backup (uint32_t ind) const; std::string stmt_backupctx (uint32_t ind) const; std::string stmt_restore (uint32_t ind) const; - std::string stmt_restorectx (uint32_t ind) const; + std::string stmt_restorectx_static (uint32_t ind, uint32_t off) const; + std::string stmt_restorectx_dynamic (uint32_t ind) const; std::string stmt_skip_peek (uint32_t ind) const; std::string stmt_skip_backup (uint32_t ind) const; std::string stmt_backup_peek (uint32_t ind) const; diff --git a/re2c/src/ir/nfa/nfa.cc b/re2c/src/ir/nfa/nfa.cc index 64f4641c..532962a4 100644 --- a/re2c/src/ir/nfa/nfa.cc +++ b/re2c/src/ir/nfa/nfa.cc @@ -59,12 +59,18 @@ nfa_state_t *RuleOp::compile(nfa_t &nfa, nfa_state_t *) { nfa_state_t *s3 = &nfa.states[nfa.size++]; s3->fin(this); - if (ctx->calc_size() > 0) + + if (ctx_len == ~0u) { nfa_state_t *s2 = &nfa.states[nfa.size++]; s2->ctx(ctx->compile(nfa, s3)); s3 = s2; } + else if (ctx_len > 0) + { + s3 = ctx->compile(nfa, s3); + } + nfa_state_t *s1 = exp->compile(nfa, s3); return s1; } diff --git a/re2c/src/ir/regexp/regexp_rule.h b/re2c/src/ir/regexp/regexp_rule.h index d3456e1c..6651fcd0 100644 --- a/re2c/src/ir/regexp/regexp_rule.h +++ b/re2c/src/ir/regexp/regexp_rule.h @@ -5,6 +5,7 @@ #include "src/ir/regexp/regexp.h" #include "src/parse/code.h" +#include "src/globals.h" namespace re2c { @@ -19,6 +20,11 @@ private: public: RegExp * ctx; + // ~0u - dynamic length + // (0; ~0u) - static length + // 0 - no context + uint32_t ctx_len; + rule_rank_t rank; const Code * code; const std::string newcond; @@ -34,10 +40,18 @@ public: : loc (l) , exp (r1) , ctx (r2) + , ctx_len (ctx->fixedLength()) , rank (r) , code (c) , newcond (cond ? *cond : "") - {} + { + // cannot emulate 'YYCURSOR -= N' operation with generic API + if (ctx_len != 0 + && opts->input_api.type() == InputAPI::CUSTOM) + { + ctx_len = ~0u; + } + } bool nullable() const; void nullable_rules(std::set&) const; void display (std::ostream & o) const; diff --git a/re2c/src/ir/skeleton/skeleton.cc b/re2c/src/ir/skeleton/skeleton.cc index 9e4e52eb..81c2f0e7 100644 --- a/re2c/src/ir/skeleton/skeleton.cc +++ b/re2c/src/ir/skeleton/skeleton.cc @@ -28,7 +28,7 @@ void Node::init(bool c, RuleOp *r, const std::vector if (r) { rule.rank = r->rank; - rule.restorectx = r->ctx->fixedLength () != 0; + rule.restorectx = r->ctx_len > 0; } ctx = c; diff --git a/re2c/test/bug116.c b/re2c/test/bug116.c index 2c534685..f89a356a 100644 --- a/re2c/test/bug116.c +++ b/re2c/test/bug116.c @@ -6,7 +6,6 @@ YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - YYCTXMARKER = YYCURSOR; switch (yych) { case 'a': goto yy3; default: goto yy2; @@ -14,10 +13,10 @@ yy2: yy3: ++YYCURSOR; - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; #line 2 "bug116.re" {} -#line 21 "bug116.c" +#line 20 "bug116.c" } #line 3 "bug116.re" diff --git a/re2c/test/config10.c b/re2c/test/config10.c index aab2d815..b2d2d258 100644 --- a/re2c/test/config10.c +++ b/re2c/test/config10.c @@ -158,7 +158,7 @@ xx13: default: goto xx14; } xx14: - s.cur = s.ctx; + s.cur -= 1; #line 55 "config10.re" { return KEYWORD; } #line 165 "config10.c" diff --git a/re2c/test/config8.c b/re2c/test/config8.c index aa47f4c9..5ff78cb1 100644 --- a/re2c/test/config8.c +++ b/re2c/test/config8.c @@ -158,7 +158,7 @@ xx13: default: goto xx14; } xx14: - s.cur = s.ctx; + s.cur -= 1; #line 54 "config8.re" { return KEYWORD; } #line 165 "config8.c" diff --git a/re2c/test/config9.b.c b/re2c/test/config9.b.c index b11ea356..e93b7b6f 100644 --- a/re2c/test/config9.b.c +++ b/re2c/test/config9.b.c @@ -142,7 +142,7 @@ xx13: if ((curr = (unsigned char)*s.cur) <= '/') goto xx14; if (curr <= '9') goto xx10; xx14: - s.cur = s.ctx; + s.cur -= 1; #line 56 "config9.b.re" { return KEYWORD; } #line 149 "config9.b.c" diff --git a/re2c/test/ctx.b.c b/re2c/test/ctx.b.c index b670fb47..9d8f73bc 100644 --- a/re2c/test/ctx.b.c +++ b/re2c/test/ctx.b.c @@ -146,7 +146,7 @@ yy13: if ((yych = *YYCURSOR) <= '/') goto yy14; if (yych <= '9') goto yy10; yy14: - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; #line 48 "ctx.b.re" { return KEYWORD; } #line 153 "ctx.b.c" diff --git a/re2c/test/ctx.c b/re2c/test/ctx.c index 46007e3e..20b11e59 100644 --- a/re2c/test/ctx.c +++ b/re2c/test/ctx.c @@ -162,7 +162,7 @@ yy13: default: goto yy14; } yy14: - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; #line 48 "ctx.re" { return KEYWORD; } #line 169 "ctx.c" diff --git a/re2c/test/ctx.s.c b/re2c/test/ctx.s.c index 7f6dcea8..87d7feaa 100644 --- a/re2c/test/ctx.s.c +++ b/re2c/test/ctx.s.c @@ -113,7 +113,7 @@ yy13: if ((yych = *YYCURSOR) <= '/') goto yy14; if (yych <= '9') goto yy10; yy14: - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; #line 48 "ctx.s.re" { return KEYWORD; } #line 120 "ctx.s.c" diff --git a/re2c/test/modula.c b/re2c/test/modula.c index 89b6780c..ec20ce32 100644 --- a/re2c/test/modula.c +++ b/re2c/test/modula.c @@ -272,7 +272,6 @@ yy31: YYMARKER = ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); yych = *YYCURSOR; - YYCTXMARKER = YYCURSOR; switch (yych) { case '.': goto yy93; case '0': @@ -297,13 +296,12 @@ yy31: yy33: #line 70 "modula.re" {RETURN(1);} -#line 301 "modula.c" +#line 300 "modula.c" yy34: yyaccept = 1; YYMARKER = ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); yych = *YYCURSOR; - YYCTXMARKER = YYCURSOR; switch (yych) { case '.': goto yy93; case '0': @@ -334,12 +332,12 @@ yy36: yy37: #line 89 "modula.re" {RETURN(18);} -#line 338 "modula.c" +#line 336 "modula.c" yy38: ++YYCURSOR; #line 91 "modula.re" {RETURN(20);} -#line 343 "modula.c" +#line 341 "modula.c" yy40: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -350,12 +348,12 @@ yy40: yy41: #line 92 "modula.re" {RETURN(21);} -#line 354 "modula.c" +#line 352 "modula.c" yy42: ++YYCURSOR; #line 95 "modula.re" {RETURN(24);} -#line 359 "modula.c" +#line 357 "modula.c" yy44: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -365,7 +363,7 @@ yy44: yy45: #line 96 "modula.re" {RETURN(25);} -#line 369 "modula.c" +#line 367 "modula.c" yy46: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -376,7 +374,7 @@ yy46: yy47: #line 147 "modula.re" {RETURN(74);} -#line 380 "modula.c" +#line 378 "modula.c" yy48: yych = *++YYCURSOR; switch (yych) { @@ -573,37 +571,37 @@ yy68: ++YYCURSOR; #line 98 "modula.re" {RETURN(27);} -#line 577 "modula.c" +#line 575 "modula.c" yy70: ++YYCURSOR; #line 99 "modula.re" {RETURN(28);} -#line 582 "modula.c" +#line 580 "modula.c" yy72: ++YYCURSOR; #line 100 "modula.re" {RETURN(29);} -#line 587 "modula.c" +#line 585 "modula.c" yy74: ++YYCURSOR; #line 101 "modula.re" {RETURN(30);} -#line 592 "modula.c" +#line 590 "modula.c" yy76: ++YYCURSOR; #line 102 "modula.re" {RETURN(31);} -#line 597 "modula.c" +#line 595 "modula.c" yy78: ++YYCURSOR; #line 103 "modula.re" {RETURN(32);} -#line 602 "modula.c" +#line 600 "modula.c" yy80: ++YYCURSOR; #line 104 "modula.re" {RETURN(33);} -#line 607 "modula.c" +#line 605 "modula.c" yy82: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -627,7 +625,7 @@ yy85: ++YYCURSOR; #line 76 "modula.re" {RETURN(6);} -#line 631 "modula.c" +#line 629 "modula.c" yy87: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -642,12 +640,12 @@ yy89: ++YYCURSOR; #line 68 "modula.re" { depth = 1; goto comment; } -#line 646 "modula.c" +#line 644 "modula.c" yy91: ++YYCURSOR; #line 87 "modula.re" {RETURN(16);} -#line 651 "modula.c" +#line 649 "modula.c" yy93: yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); @@ -658,7 +656,7 @@ yy93: yy94: #line 75 "modula.re" {RETURN(5);} -#line 662 "modula.c" +#line 660 "modula.c" yy95: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -709,7 +707,7 @@ yy97: yy98: #line 72 "modula.re" {RETURN(2);} -#line 713 "modula.c" +#line 711 "modula.c" yy99: yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); @@ -736,32 +734,32 @@ yy99: yy100: #line 73 "modula.re" {RETURN(3);} -#line 740 "modula.c" +#line 738 "modula.c" yy101: ++YYCURSOR; #line 74 "modula.re" {RETURN(4);} -#line 745 "modula.c" +#line 743 "modula.c" yy103: ++YYCURSOR; #line 90 "modula.re" {RETURN(19);} -#line 750 "modula.c" +#line 748 "modula.c" yy105: ++YYCURSOR; #line 93 "modula.re" {RETURN(22);} -#line 755 "modula.c" +#line 753 "modula.c" yy107: ++YYCURSOR; #line 94 "modula.re" {RETURN(23);} -#line 760 "modula.c" +#line 758 "modula.c" yy109: ++YYCURSOR; #line 97 "modula.re" {RETURN(26);} -#line 765 "modula.c" +#line 763 "modula.c" yy111: yych = *++YYCURSOR; switch (yych) { @@ -850,7 +848,7 @@ yy114: yy115: #line 109 "modula.re" {RETURN(37);} -#line 854 "modula.c" +#line 852 "modula.c" yy116: yych = *++YYCURSOR; switch (yych) { @@ -945,7 +943,7 @@ yy120: yy121: #line 114 "modula.re" {RETURN(42);} -#line 949 "modula.c" +#line 947 "modula.c" yy122: yych = *++YYCURSOR; switch (yych) { @@ -1047,7 +1045,7 @@ yy127: yy128: #line 122 "modula.re" {RETURN(50);} -#line 1051 "modula.c" +#line 1049 "modula.c" yy129: yych = *++YYCURSOR; switch (yych) { @@ -1124,7 +1122,7 @@ yy130: yy131: #line 125 "modula.re" {RETURN(53);} -#line 1128 "modula.c" +#line 1126 "modula.c" yy132: yych = *++YYCURSOR; switch (yych) { @@ -1213,7 +1211,7 @@ yy135: yy136: #line 130 "modula.re" {RETURN(58);} -#line 1217 "modula.c" +#line 1215 "modula.c" yy137: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -1284,7 +1282,7 @@ yy137: yy138: #line 131 "modula.re" {RETURN(59);} -#line 1288 "modula.c" +#line 1286 "modula.c" yy139: yych = *++YYCURSOR; switch (yych) { @@ -1393,7 +1391,7 @@ yy145: yy146: #line 140 "modula.re" {RETURN(68);} -#line 1397 "modula.c" +#line 1395 "modula.c" yy147: yych = *++YYCURSOR; switch (yych) { @@ -1426,10 +1424,10 @@ yy151: } yy152: ++YYCURSOR; - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 2; #line 71 "modula.re" {RETURN(1);} -#line 1433 "modula.c" +#line 1431 "modula.c" yy154: yyaccept = 2; YYMARKER = ++YYCURSOR; @@ -1537,7 +1535,7 @@ yy157: yy158: #line 106 "modula.re" {RETURN(34);} -#line 1541 "modula.c" +#line 1539 "modula.c" yy159: yych = *++YYCURSOR; switch (yych) { @@ -1638,7 +1636,7 @@ yy164: yy165: #line 113 "modula.re" {RETURN(41);} -#line 1642 "modula.c" +#line 1640 "modula.c" yy166: yych = *++YYCURSOR; switch (yych) { @@ -1716,7 +1714,7 @@ yy167: yy168: #line 117 "modula.re" {RETURN(45);} -#line 1720 "modula.c" +#line 1718 "modula.c" yy169: yych = *++YYCURSOR; switch (yych) { @@ -1799,7 +1797,7 @@ yy171: yy172: #line 120 "modula.re" {RETURN(48);} -#line 1803 "modula.c" +#line 1801 "modula.c" yy173: yych = *++YYCURSOR; switch (yych) { @@ -1889,7 +1887,7 @@ yy176: yy177: #line 127 "modula.re" {RETURN(55);} -#line 1893 "modula.c" +#line 1891 "modula.c" yy178: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -1960,7 +1958,7 @@ yy178: yy179: #line 129 "modula.re" {RETURN(57);} -#line 1964 "modula.c" +#line 1962 "modula.c" yy180: yych = *++YYCURSOR; switch (yych) { @@ -2067,7 +2065,7 @@ yy186: yy187: #line 138 "modula.re" {RETURN(66);} -#line 2071 "modula.c" +#line 2069 "modula.c" yy188: yych = *++YYCURSOR; switch (yych) { @@ -2156,7 +2154,7 @@ yy191: yy192: #line 143 "modula.re" {RETURN(71);} -#line 2160 "modula.c" +#line 2158 "modula.c" yy193: yych = *++YYCURSOR; switch (yych) { @@ -2283,7 +2281,7 @@ yy200: yy201: #line 110 "modula.re" {RETURN(38);} -#line 2287 "modula.c" +#line 2285 "modula.c" yy202: yych = *++YYCURSOR; switch (yych) { @@ -2366,7 +2364,7 @@ yy204: yy205: #line 115 "modula.re" {RETURN(43);} -#line 2370 "modula.c" +#line 2368 "modula.c" yy206: yych = *++YYCURSOR; switch (yych) { @@ -2443,7 +2441,7 @@ yy207: yy208: #line 118 "modula.re" {RETURN(46);} -#line 2447 "modula.c" +#line 2445 "modula.c" yy209: yych = *++YYCURSOR; switch (yych) { @@ -2520,7 +2518,7 @@ yy210: yy211: #line 121 "modula.re" {RETURN(49);} -#line 2524 "modula.c" +#line 2522 "modula.c" yy212: yych = *++YYCURSOR; switch (yych) { @@ -2603,7 +2601,7 @@ yy214: yy215: #line 126 "modula.re" {RETURN(54);} -#line 2607 "modula.c" +#line 2605 "modula.c" yy216: yych = *++YYCURSOR; switch (yych) { @@ -2716,7 +2714,7 @@ yy223: yy224: #line 139 "modula.re" {RETURN(67);} -#line 2720 "modula.c" +#line 2718 "modula.c" yy225: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -2787,7 +2785,7 @@ yy225: yy226: #line 141 "modula.re" {RETURN(69);} -#line 2791 "modula.c" +#line 2789 "modula.c" yy227: yych = *++YYCURSOR; switch (yych) { @@ -2870,7 +2868,7 @@ yy229: yy230: #line 145 "modula.re" {RETURN(73);} -#line 2874 "modula.c" +#line 2872 "modula.c" yy231: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -2941,7 +2939,7 @@ yy231: yy232: #line 107 "modula.re" {RETURN(35);} -#line 2945 "modula.c" +#line 2943 "modula.c" yy233: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3012,7 +3010,7 @@ yy233: yy234: #line 108 "modula.re" {RETURN(36);} -#line 3016 "modula.c" +#line 3014 "modula.c" yy235: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3083,7 +3081,7 @@ yy235: yy236: #line 111 "modula.re" {RETURN(39);} -#line 3087 "modula.c" +#line 3085 "modula.c" yy237: yych = *++YYCURSOR; switch (yych) { @@ -3160,7 +3158,7 @@ yy238: yy239: #line 116 "modula.re" {RETURN(44);} -#line 3164 "modula.c" +#line 3162 "modula.c" yy240: yych = *++YYCURSOR; switch (yych) { @@ -3291,7 +3289,7 @@ yy250: yy251: #line 142 "modula.re" {RETURN(70);} -#line 3295 "modula.c" +#line 3293 "modula.c" yy252: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3362,7 +3360,7 @@ yy252: yy253: #line 144 "modula.re" {RETURN(72);} -#line 3366 "modula.c" +#line 3364 "modula.c" yy254: yych = *++YYCURSOR; switch (yych) { @@ -3439,7 +3437,7 @@ yy255: yy256: #line 119 "modula.re" {RETURN(47);} -#line 3443 "modula.c" +#line 3441 "modula.c" yy257: yych = *++YYCURSOR; switch (yych) { @@ -3516,7 +3514,7 @@ yy258: yy259: #line 124 "modula.re" {RETURN(52);} -#line 3520 "modula.c" +#line 3518 "modula.c" yy260: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3587,7 +3585,7 @@ yy260: yy261: #line 128 "modula.re" {RETURN(56);} -#line 3591 "modula.c" +#line 3589 "modula.c" yy262: yych = *++YYCURSOR; switch (yych) { @@ -3676,7 +3674,7 @@ yy265: yy266: #line 135 "modula.re" {RETURN(63);} -#line 3680 "modula.c" +#line 3678 "modula.c" yy267: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3747,7 +3745,7 @@ yy267: yy268: #line 136 "modula.re" {RETURN(64);} -#line 3751 "modula.c" +#line 3749 "modula.c" yy269: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3818,7 +3816,7 @@ yy269: yy270: #line 137 "modula.re" {RETURN(65);} -#line 3822 "modula.c" +#line 3820 "modula.c" yy271: yych = *++YYCURSOR; switch (yych) { @@ -3901,7 +3899,7 @@ yy273: yy274: #line 132 "modula.re" {RETURN(60);} -#line 3905 "modula.c" +#line 3903 "modula.c" yy275: yych = *++YYCURSOR; switch (yych) { @@ -4020,7 +4018,7 @@ yy283: yy284: #line 133 "modula.re" {RETURN(61);} -#line 4024 "modula.c" +#line 4022 "modula.c" yy285: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -4091,7 +4089,7 @@ yy285: yy286: #line 134 "modula.re" {RETURN(62);} -#line 4095 "modula.c" +#line 4093 "modula.c" yy287: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -4162,7 +4160,7 @@ yy287: yy288: #line 112 "modula.re" {RETURN(40);} -#line 4166 "modula.c" +#line 4164 "modula.c" yy289: yych = *++YYCURSOR; switch (yych) { @@ -4257,13 +4255,13 @@ yy293: yy294: #line 123 "modula.re" {RETURN(51);} -#line 4261 "modula.c" +#line 4259 "modula.c" } #line 163 "modula.re" comment: -#line 4267 "modula.c" +#line 4265 "modula.c" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -4279,7 +4277,7 @@ yy297: yy298: #line 180 "modula.re" { goto comment; } -#line 4283 "modula.c" +#line 4281 "modula.c" yy299: ++YYCURSOR; #line 175 "modula.re" @@ -4288,7 +4286,7 @@ yy299: s->tok = s->pos = cursor; s->line++; goto comment; } -#line 4292 "modula.c" +#line 4290 "modula.c" yy301: yych = *++YYCURSOR; switch (yych) { @@ -4305,7 +4303,7 @@ yy303: ++YYCURSOR; #line 173 "modula.re" { ++depth; goto comment; } -#line 4309 "modula.c" +#line 4307 "modula.c" yy305: ++YYCURSOR; #line 167 "modula.re" @@ -4315,7 +4313,7 @@ yy305: else goto comment; } -#line 4319 "modula.c" +#line 4317 "modula.c" } #line 181 "modula.re" diff --git a/re2c/test/rexx.--empty-class(match-empty).c b/re2c/test/rexx.--empty-class(match-empty).c index fbf48dd6..c97aa6ee 100644 --- a/re2c/test/rexx.--empty-class(match-empty).c +++ b/re2c/test/rexx.--empty-class(match-empty).c @@ -1821,7 +1821,6 @@ yy171: } yy173: yych = *++YYCURSOR; - YYCTXMARKER = YYCURSOR; switch (yych) { case '!': case '.': @@ -1893,7 +1892,6 @@ yy173: } yy174: yych = *++YYCURSOR; - YYCTXMARKER = YYCURSOR; switch (yych) { case '!': case '.': @@ -1992,7 +1990,7 @@ yy178: ++YYCURSOR; #line 112 "rexx.--empty-class(match-empty).re" { RETURN(OP_LE_STRICT); } -#line 1996 "rexx.--empty-class(match-empty).c" +#line 1994 "rexx.--empty-class(match-empty).c" yy180: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -2007,7 +2005,7 @@ yy182: ++YYCURSOR; #line 110 "rexx.--empty-class(match-empty).re" { RETURN(OP_GE_STRICT); } -#line 2011 "rexx.--empty-class(match-empty).c" +#line 2009 "rexx.--empty-class(match-empty).c" yy184: yych = *++YYCURSOR; switch (yych) { @@ -2089,7 +2087,7 @@ yy185: yy186: #line 136 "rexx.--empty-class(match-empty).re" { RETURN(RX_ARG); } -#line 2093 "rexx.--empty-class(match-empty).c" +#line 2091 "rexx.--empty-class(match-empty).c" yy187: yych = *++YYCURSOR; switch (yych) { @@ -2192,7 +2190,7 @@ yy191: yy192: #line 146 "rexx.--empty-class(match-empty).re" { RETURN(RX_END); } -#line 2196 "rexx.--empty-class(match-empty).c" +#line 2194 "rexx.--empty-class(match-empty).c" yy193: yych = *++YYCURSOR; switch (yych) { @@ -2302,7 +2300,7 @@ yy198: yy199: #line 206 "rexx.--empty-class(match-empty).re" { RETURN(RXS_FOR); } -#line 2306 "rexx.--empty-class(match-empty).c" +#line 2304 "rexx.--empty-class(match-empty).c" yy200: yych = *++YYCURSOR; switch (yych) { @@ -2426,7 +2424,7 @@ yy207: yy208: #line 158 "rexx.--empty-class(match-empty).re" { RETURN(RX_NOP); } -#line 2430 "rexx.--empty-class(match-empty).c" +#line 2428 "rexx.--empty-class(match-empty).c" yy209: yych = *++YYCURSOR; switch (yych) { @@ -2522,7 +2520,7 @@ yy212: yy213: #line 190 "rexx.--empty-class(match-empty).re" { RETURN(RXS_OFF); } -#line 2526 "rexx.--empty-class(match-empty).c" +#line 2524 "rexx.--empty-class(match-empty).c" yy214: yych = *++YYCURSOR; switch (yych) { @@ -2653,7 +2651,7 @@ yy222: yy223: #line 178 "rexx.--empty-class(match-empty).re" { RETURN(RX_SAY); } -#line 2657 "rexx.--empty-class(match-empty).c" +#line 2655 "rexx.--empty-class(match-empty).c" yy224: yych = *++YYCURSOR; switch (yych) { @@ -2798,7 +2796,7 @@ yy234: yy235: #line 238 "rexx.--empty-class(match-empty).re" { RETURN(RXS_VAR); } -#line 2802 "rexx.--empty-class(match-empty).c" +#line 2800 "rexx.--empty-class(match-empty).c" yy236: yych = *++YYCURSOR; switch (yych) { @@ -2851,7 +2849,7 @@ yy244: ++YYCURSOR; #line 104 "rexx.--empty-class(match-empty).re" { RETURN(OP_EQUAL_EQ_N); } -#line 2855 "rexx.--empty-class(match-empty).c" +#line 2853 "rexx.--empty-class(match-empty).c" yy246: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -2864,16 +2862,16 @@ yy246: } yy248: ++YYCURSOR; - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; #line 257 "rexx.--empty-class(match-empty).re" { RETURN(SU_LITERAL_BIN); } -#line 2871 "rexx.--empty-class(match-empty).c" +#line 2869 "rexx.--empty-class(match-empty).c" yy250: ++YYCURSOR; - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; #line 259 "rexx.--empty-class(match-empty).re" { RETURN(SU_LITERAL_HEX); } -#line 2877 "rexx.--empty-class(match-empty).c" +#line 2875 "rexx.--empty-class(match-empty).c" yy252: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -2972,7 +2970,7 @@ yy255: yy256: #line 138 "rexx.--empty-class(match-empty).re" { RETURN(RX_CALL); } -#line 2976 "rexx.--empty-class(match-empty).c" +#line 2974 "rexx.--empty-class(match-empty).c" yy257: yych = *++YYCURSOR; switch (yych) { @@ -3054,7 +3052,7 @@ yy258: yy259: #line 142 "rexx.--empty-class(match-empty).re" { RETURN(RX_DROP); } -#line 3058 "rexx.--empty-class(match-empty).c" +#line 3056 "rexx.--empty-class(match-empty).c" yy260: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3129,7 +3127,7 @@ yy260: yy261: #line 144 "rexx.--empty-class(match-empty).re" { RETURN(RX_ELSE); } -#line 3133 "rexx.--empty-class(match-empty).c" +#line 3131 "rexx.--empty-class(match-empty).c" yy262: yych = *++YYCURSOR; switch (yych) { @@ -3218,7 +3216,7 @@ yy264: yy265: #line 148 "rexx.--empty-class(match-empty).re" { RETURN(RX_EXIT); } -#line 3222 "rexx.--empty-class(match-empty).c" +#line 3220 "rexx.--empty-class(match-empty).c" yy266: yych = *++YYCURSOR; switch (yych) { @@ -3314,7 +3312,7 @@ yy269: yy270: #line 210 "rexx.--empty-class(match-empty).re" { RETURN(RXS_FORM); } -#line 3318 "rexx.--empty-class(match-empty).c" +#line 3316 "rexx.--empty-class(match-empty).c" yy271: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3389,7 +3387,7 @@ yy271: yy272: #line 212 "rexx.--empty-class(match-empty).re" { RETURN(RXS_FUZZ); } -#line 3393 "rexx.--empty-class(match-empty).c" +#line 3391 "rexx.--empty-class(match-empty).c" yy273: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3464,7 +3462,7 @@ yy273: yy274: #line 214 "rexx.--empty-class(match-empty).re" { RETURN(RXS_HALT); } -#line 3468 "rexx.--empty-class(match-empty).c" +#line 3466 "rexx.--empty-class(match-empty).c" yy275: yych = *++YYCURSOR; switch (yych) { @@ -3567,7 +3565,7 @@ yy279: yy280: #line 218 "rexx.--empty-class(match-empty).re" { RETURN(RXS_NAME); } -#line 3571 "rexx.--empty-class(match-empty).c" +#line 3569 "rexx.--empty-class(match-empty).c" yy281: yych = *++YYCURSOR; switch (yych) { @@ -3691,7 +3689,7 @@ yy288: yy289: #line 170 "rexx.--empty-class(match-empty).re" { RETURN(RX_PULL); } -#line 3695 "rexx.--empty-class(match-empty).c" +#line 3693 "rexx.--empty-class(match-empty).c" yy290: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3766,7 +3764,7 @@ yy290: yy291: #line 172 "rexx.--empty-class(match-empty).re" { RETURN(RX_PUSH); } -#line 3770 "rexx.--empty-class(match-empty).c" +#line 3768 "rexx.--empty-class(match-empty).c" yy292: yych = *++YYCURSOR; switch (yych) { @@ -3890,7 +3888,7 @@ yy299: yy300: #line 184 "rexx.--empty-class(match-empty).re" { RETURN(RX_THEN); } -#line 3894 "rexx.--empty-class(match-empty).c" +#line 3892 "rexx.--empty-class(match-empty).c" yy301: yych = *++YYCURSOR; switch (yych) { @@ -4000,7 +3998,7 @@ yy306: yy307: #line 188 "rexx.--empty-class(match-empty).re" { RETURN(RX_WHEN); } -#line 4004 "rexx.--empty-class(match-empty).c" +#line 4002 "rexx.--empty-class(match-empty).c" yy308: yych = *++YYCURSOR; switch (yych) { @@ -4082,7 +4080,7 @@ yy309: yy310: #line 244 "rexx.--empty-class(match-empty).re" { RETURN(RXS_WITH); } -#line 4086 "rexx.--empty-class(match-empty).c" +#line 4084 "rexx.--empty-class(match-empty).c" yy311: yych = *++YYCURSOR; switch (yych) { @@ -4178,7 +4176,7 @@ yy314: yy315: #line 200 "rexx.--empty-class(match-empty).re" { RETURN(RXS_ERROR); } -#line 4182 "rexx.--empty-class(match-empty).c" +#line 4180 "rexx.--empty-class(match-empty).c" yy316: yych = *++YYCURSOR; switch (yych) { @@ -4288,7 +4286,7 @@ yy321: yy322: #line 156 "rexx.--empty-class(match-empty).re" { RETURN(RX_LEAVE); } -#line 4292 "rexx.--empty-class(match-empty).c" +#line 4290 "rexx.--empty-class(match-empty).c" yy323: yych = *++YYCURSOR; switch (yych) { @@ -4405,7 +4403,7 @@ yy329: yy330: #line 166 "rexx.--empty-class(match-empty).re" { RETURN(RX_PARSE); } -#line 4409 "rexx.--empty-class(match-empty).c" +#line 4407 "rexx.--empty-class(match-empty).c" yy331: yych = *++YYCURSOR; switch (yych) { @@ -4487,7 +4485,7 @@ yy332: yy333: #line 174 "rexx.--empty-class(match-empty).re" { RETURN(RX_QUEUE); } -#line 4491 "rexx.--empty-class(match-empty).c" +#line 4489 "rexx.--empty-class(match-empty).c" yy334: yych = *++YYCURSOR; switch (yych) { @@ -4604,7 +4602,7 @@ yy340: yy341: #line 186 "rexx.--empty-class(match-empty).re" { RETURN(RX_TRACE); } -#line 4608 "rexx.--empty-class(match-empty).c" +#line 4606 "rexx.--empty-class(match-empty).c" yy342: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -4679,7 +4677,7 @@ yy342: yy343: #line 232 "rexx.--empty-class(match-empty).re" { RETURN(RXS_UNTIL); } -#line 4683 "rexx.--empty-class(match-empty).c" +#line 4681 "rexx.--empty-class(match-empty).c" yy344: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -4754,7 +4752,7 @@ yy344: yy345: #line 234 "rexx.--empty-class(match-empty).re" { RETURN(RXS_UPPER); } -#line 4758 "rexx.--empty-class(match-empty).c" +#line 4756 "rexx.--empty-class(match-empty).c" yy346: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -4829,7 +4827,7 @@ yy346: yy347: #line 236 "rexx.--empty-class(match-empty).re" { RETURN(RXS_VALUE); } -#line 4833 "rexx.--empty-class(match-empty).c" +#line 4831 "rexx.--empty-class(match-empty).c" yy348: yych = *++YYCURSOR; switch (yych) { @@ -4911,7 +4909,7 @@ yy349: yy350: #line 242 "rexx.--empty-class(match-empty).re" { RETURN(RXS_WHILE); } -#line 4915 "rexx.--empty-class(match-empty).c" +#line 4913 "rexx.--empty-class(match-empty).c" yy351: yych = *++YYCURSOR; switch (yych) { @@ -4993,7 +4991,7 @@ yy352: yy353: #line 196 "rexx.--empty-class(match-empty).re" { RETURN(RXS_DIGITS); } -#line 4997 "rexx.--empty-class(match-empty).c" +#line 4995 "rexx.--empty-class(match-empty).c" yy354: yych = *++YYCURSOR; switch (yych) { @@ -5075,7 +5073,7 @@ yy355: yy356: #line 202 "rexx.--empty-class(match-empty).re" { RETURN(RXS_EXPOSE); } -#line 5079 "rexx.--empty-class(match-empty).c" +#line 5077 "rexx.--empty-class(match-empty).c" yy357: yych = *++YYCURSOR; switch (yych) { @@ -5178,7 +5176,7 @@ yy361: yy362: #line 216 "rexx.--empty-class(match-empty).re" { RETURN(RXS_LINEIN); } -#line 5182 "rexx.--empty-class(match-empty).c" +#line 5180 "rexx.--empty-class(match-empty).c" yy363: yych = *++YYCURSOR; switch (yych) { @@ -5295,7 +5293,7 @@ yy369: yy370: #line 176 "rexx.--empty-class(match-empty).re" { RETURN(RX_RETURN); } -#line 5299 "rexx.--empty-class(match-empty).c" +#line 5297 "rexx.--empty-class(match-empty).c" yy371: yych = *++YYCURSOR; switch (yych) { @@ -5377,7 +5375,7 @@ yy372: yy373: #line 180 "rexx.--empty-class(match-empty).re" { RETURN(RX_SELECT); } -#line 5381 "rexx.--empty-class(match-empty).c" +#line 5379 "rexx.--empty-class(match-empty).c" yy374: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -5452,7 +5450,7 @@ yy374: yy375: #line 182 "rexx.--empty-class(match-empty).re" { RETURN(RX_SIGNAL); } -#line 5456 "rexx.--empty-class(match-empty).c" +#line 5454 "rexx.--empty-class(match-empty).c" yy376: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -5527,7 +5525,7 @@ yy376: yy377: #line 226 "rexx.--empty-class(match-empty).re" { RETURN(RXS_SOURCE); } -#line 5531 "rexx.--empty-class(match-empty).c" +#line 5529 "rexx.--empty-class(match-empty).c" yy378: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -5602,7 +5600,7 @@ yy378: yy379: #line 228 "rexx.--empty-class(match-empty).re" { RETURN(RXS_SYNTAX); } -#line 5606 "rexx.--empty-class(match-empty).c" +#line 5604 "rexx.--empty-class(match-empty).c" yy380: yych = *++YYCURSOR; switch (yych) { @@ -5684,7 +5682,7 @@ yy381: yy382: #line 134 "rexx.--empty-class(match-empty).re" { RETURN(RX_ADDRESS); } -#line 5688 "rexx.--empty-class(match-empty).c" +#line 5686 "rexx.--empty-class(match-empty).c" yy383: yych = *++YYCURSOR; switch (yych) { @@ -5766,7 +5764,7 @@ yy384: yy385: #line 204 "rexx.--empty-class(match-empty).re" { RETURN(RXS_FAILURE); } -#line 5770 "rexx.--empty-class(match-empty).c" +#line 5768 "rexx.--empty-class(match-empty).c" yy386: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -5841,7 +5839,7 @@ yy386: yy387: #line 208 "rexx.--empty-class(match-empty).re" { RETURN(RXS_FOREVER); } -#line 5845 "rexx.--empty-class(match-empty).c" +#line 5843 "rexx.--empty-class(match-empty).c" yy388: yych = *++YYCURSOR; switch (yych) { @@ -5923,7 +5921,7 @@ yy389: yy390: #line 154 "rexx.--empty-class(match-empty).re" { RETURN(RX_ITERATE); } -#line 5927 "rexx.--empty-class(match-empty).c" +#line 5925 "rexx.--empty-class(match-empty).c" yy391: yych = *++YYCURSOR; switch (yych) { @@ -6005,7 +6003,7 @@ yy392: yy393: #line 222 "rexx.--empty-class(match-empty).re" { RETURN(RXS_NOVALUE); } -#line 6009 "rexx.--empty-class(match-empty).c" +#line 6007 "rexx.--empty-class(match-empty).c" yy394: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -6080,7 +6078,7 @@ yy394: yy395: #line 160 "rexx.--empty-class(match-empty).re" { RETURN(RX_NUMERIC); } -#line 6084 "rexx.--empty-class(match-empty).c" +#line 6082 "rexx.--empty-class(match-empty).c" yy396: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -6155,7 +6153,7 @@ yy396: yy397: #line 162 "rexx.--empty-class(match-empty).re" { RETURN(RX_OPTIONS); } -#line 6159 "rexx.--empty-class(match-empty).c" +#line 6157 "rexx.--empty-class(match-empty).c" yy398: yych = *++YYCURSOR; switch (yych) { @@ -6251,7 +6249,7 @@ yy401: yy402: #line 240 "rexx.--empty-class(match-empty).re" { RETURN(RXS_VERSION); } -#line 6255 "rexx.--empty-class(match-empty).c" +#line 6253 "rexx.--empty-class(match-empty).c" yy403: yych = *++YYCURSOR; switch (yych) { @@ -6340,7 +6338,7 @@ yy405: yy406: #line 220 "rexx.--empty-class(match-empty).re" { RETURN(RXS_NOTREADY); } -#line 6344 "rexx.--empty-class(match-empty).c" +#line 6342 "rexx.--empty-class(match-empty).c" yy407: yych = *++YYCURSOR; switch (yych) { @@ -6443,7 +6441,7 @@ yy411: yy412: #line 152 "rexx.--empty-class(match-empty).re" { RETURN(RX_INTERPRET); } -#line 6447 "rexx.--empty-class(match-empty).c" +#line 6445 "rexx.--empty-class(match-empty).c" yy413: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -6518,7 +6516,7 @@ yy413: yy414: #line 164 "rexx.--empty-class(match-empty).re" { RETURN(RX_OTHERWISE); } -#line 6522 "rexx.--empty-class(match-empty).c" +#line 6520 "rexx.--empty-class(match-empty).c" yy415: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -6593,7 +6591,7 @@ yy415: yy416: #line 168 "rexx.--empty-class(match-empty).re" { RETURN(RX_PROCEDURE); } -#line 6597 "rexx.--empty-class(match-empty).c" +#line 6595 "rexx.--empty-class(match-empty).c" yy417: yych = *++YYCURSOR; switch (yych) { @@ -6682,7 +6680,7 @@ yy419: yy420: #line 224 "rexx.--empty-class(match-empty).re" { RETURN(RXS_SCIENTIFIC); } -#line 6686 "rexx.--empty-class(match-empty).c" +#line 6684 "rexx.--empty-class(match-empty).c" yy421: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -6757,7 +6755,7 @@ yy421: yy422: #line 198 "rexx.--empty-class(match-empty).re" { RETURN(RXS_ENGINEERING); } -#line 6761 "rexx.--empty-class(match-empty).c" +#line 6759 "rexx.--empty-class(match-empty).c" } #line 265 "rexx.--empty-class(match-empty).re" @@ -6771,12 +6769,11 @@ bool StripToken(){ ScanCB.eot = cursor; strip: -#line 6775 "rexx.--empty-class(match-empty).c" +#line 6773 "rexx.--empty-class(match-empty).c" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - YYCTXMARKER = YYCURSOR; switch (yych) { case '\t': case ' ': goto yy427; @@ -6787,10 +6784,10 @@ strip: yy425: ++YYCURSOR; yy426: - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; #line 289 "rexx.--empty-class(match-empty).re" { RETURN(blanks); } -#line 6794 "rexx.--empty-class(match-empty).c" +#line 6791 "rexx.--empty-class(match-empty).c" yy427: ++YYCURSOR; #line 284 "rexx.--empty-class(match-empty).re" @@ -6798,12 +6795,12 @@ yy427: blanks = TRUE; goto strip; } -#line 6802 "rexx.--empty-class(match-empty).c" +#line 6799 "rexx.--empty-class(match-empty).c" yy429: ++YYCURSOR; #line 282 "rexx.--empty-class(match-empty).re" { goto strip; } -#line 6807 "rexx.--empty-class(match-empty).c" +#line 6804 "rexx.--empty-class(match-empty).c" yy431: yych = *++YYCURSOR; switch (yych) { @@ -6817,14 +6814,14 @@ yy432: depth = 1; goto comment; } -#line 6821 "rexx.--empty-class(match-empty).c" +#line 6818 "rexx.--empty-class(match-empty).c" } #line 290 "rexx.--empty-class(match-empty).re" comment: -#line 6828 "rexx.--empty-class(match-empty).c" +#line 6825 "rexx.--empty-class(match-empty).c" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -6840,7 +6837,7 @@ yy436: ++YYCURSOR; #line 313 "rexx.--empty-class(match-empty).re" { RETURN(blanks); } -#line 6844 "rexx.--empty-class(match-empty).c" +#line 6841 "rexx.--empty-class(match-empty).c" yy438: ++YYCURSOR; yy439: @@ -6848,7 +6845,7 @@ yy439: { goto comment; } -#line 6852 "rexx.--empty-class(match-empty).c" +#line 6849 "rexx.--empty-class(match-empty).c" yy440: ++YYCURSOR; #line 302 "rexx.--empty-class(match-empty).re" @@ -6857,7 +6854,7 @@ yy440: ScanCB.linePos = ScanCB.pos + (cursor - ScanCB.mrk); goto comment; } -#line 6861 "rexx.--empty-class(match-empty).c" +#line 6858 "rexx.--empty-class(match-empty).c" yy442: yych = *++YYCURSOR; switch (yych) { @@ -6879,7 +6876,7 @@ yy444: else goto comment; } -#line 6883 "rexx.--empty-class(match-empty).c" +#line 6880 "rexx.--empty-class(match-empty).c" yy446: ++YYCURSOR; #line 308 "rexx.--empty-class(match-empty).re" @@ -6887,7 +6884,7 @@ yy446: ++depth; goto comment; } -#line 6891 "rexx.--empty-class(match-empty).c" +#line 6888 "rexx.--empty-class(match-empty).c" } #line 318 "rexx.--empty-class(match-empty).re" diff --git a/re2c/test/rexx.--empty-class(match-none).c b/re2c/test/rexx.--empty-class(match-none).c index 1a99be8f..b7bbd8a3 100644 --- a/re2c/test/rexx.--empty-class(match-none).c +++ b/re2c/test/rexx.--empty-class(match-none).c @@ -1821,7 +1821,6 @@ yy171: } yy173: yych = *++YYCURSOR; - YYCTXMARKER = YYCURSOR; switch (yych) { case '!': case '.': @@ -1893,7 +1892,6 @@ yy173: } yy174: yych = *++YYCURSOR; - YYCTXMARKER = YYCURSOR; switch (yych) { case '!': case '.': @@ -1992,7 +1990,7 @@ yy178: ++YYCURSOR; #line 112 "rexx.--empty-class(match-none).re" { RETURN(OP_LE_STRICT); } -#line 1996 "rexx.--empty-class(match-none).c" +#line 1994 "rexx.--empty-class(match-none).c" yy180: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -2007,7 +2005,7 @@ yy182: ++YYCURSOR; #line 110 "rexx.--empty-class(match-none).re" { RETURN(OP_GE_STRICT); } -#line 2011 "rexx.--empty-class(match-none).c" +#line 2009 "rexx.--empty-class(match-none).c" yy184: yych = *++YYCURSOR; switch (yych) { @@ -2089,7 +2087,7 @@ yy185: yy186: #line 136 "rexx.--empty-class(match-none).re" { RETURN(RX_ARG); } -#line 2093 "rexx.--empty-class(match-none).c" +#line 2091 "rexx.--empty-class(match-none).c" yy187: yych = *++YYCURSOR; switch (yych) { @@ -2192,7 +2190,7 @@ yy191: yy192: #line 146 "rexx.--empty-class(match-none).re" { RETURN(RX_END); } -#line 2196 "rexx.--empty-class(match-none).c" +#line 2194 "rexx.--empty-class(match-none).c" yy193: yych = *++YYCURSOR; switch (yych) { @@ -2302,7 +2300,7 @@ yy198: yy199: #line 206 "rexx.--empty-class(match-none).re" { RETURN(RXS_FOR); } -#line 2306 "rexx.--empty-class(match-none).c" +#line 2304 "rexx.--empty-class(match-none).c" yy200: yych = *++YYCURSOR; switch (yych) { @@ -2426,7 +2424,7 @@ yy207: yy208: #line 158 "rexx.--empty-class(match-none).re" { RETURN(RX_NOP); } -#line 2430 "rexx.--empty-class(match-none).c" +#line 2428 "rexx.--empty-class(match-none).c" yy209: yych = *++YYCURSOR; switch (yych) { @@ -2522,7 +2520,7 @@ yy212: yy213: #line 190 "rexx.--empty-class(match-none).re" { RETURN(RXS_OFF); } -#line 2526 "rexx.--empty-class(match-none).c" +#line 2524 "rexx.--empty-class(match-none).c" yy214: yych = *++YYCURSOR; switch (yych) { @@ -2653,7 +2651,7 @@ yy222: yy223: #line 178 "rexx.--empty-class(match-none).re" { RETURN(RX_SAY); } -#line 2657 "rexx.--empty-class(match-none).c" +#line 2655 "rexx.--empty-class(match-none).c" yy224: yych = *++YYCURSOR; switch (yych) { @@ -2798,7 +2796,7 @@ yy234: yy235: #line 238 "rexx.--empty-class(match-none).re" { RETURN(RXS_VAR); } -#line 2802 "rexx.--empty-class(match-none).c" +#line 2800 "rexx.--empty-class(match-none).c" yy236: yych = *++YYCURSOR; switch (yych) { @@ -2851,7 +2849,7 @@ yy244: ++YYCURSOR; #line 104 "rexx.--empty-class(match-none).re" { RETURN(OP_EQUAL_EQ_N); } -#line 2855 "rexx.--empty-class(match-none).c" +#line 2853 "rexx.--empty-class(match-none).c" yy246: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -2864,16 +2862,16 @@ yy246: } yy248: ++YYCURSOR; - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; #line 257 "rexx.--empty-class(match-none).re" { RETURN(SU_LITERAL_BIN); } -#line 2871 "rexx.--empty-class(match-none).c" +#line 2869 "rexx.--empty-class(match-none).c" yy250: ++YYCURSOR; - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; #line 259 "rexx.--empty-class(match-none).re" { RETURN(SU_LITERAL_HEX); } -#line 2877 "rexx.--empty-class(match-none).c" +#line 2875 "rexx.--empty-class(match-none).c" yy252: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -2972,7 +2970,7 @@ yy255: yy256: #line 138 "rexx.--empty-class(match-none).re" { RETURN(RX_CALL); } -#line 2976 "rexx.--empty-class(match-none).c" +#line 2974 "rexx.--empty-class(match-none).c" yy257: yych = *++YYCURSOR; switch (yych) { @@ -3054,7 +3052,7 @@ yy258: yy259: #line 142 "rexx.--empty-class(match-none).re" { RETURN(RX_DROP); } -#line 3058 "rexx.--empty-class(match-none).c" +#line 3056 "rexx.--empty-class(match-none).c" yy260: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3129,7 +3127,7 @@ yy260: yy261: #line 144 "rexx.--empty-class(match-none).re" { RETURN(RX_ELSE); } -#line 3133 "rexx.--empty-class(match-none).c" +#line 3131 "rexx.--empty-class(match-none).c" yy262: yych = *++YYCURSOR; switch (yych) { @@ -3218,7 +3216,7 @@ yy264: yy265: #line 148 "rexx.--empty-class(match-none).re" { RETURN(RX_EXIT); } -#line 3222 "rexx.--empty-class(match-none).c" +#line 3220 "rexx.--empty-class(match-none).c" yy266: yych = *++YYCURSOR; switch (yych) { @@ -3314,7 +3312,7 @@ yy269: yy270: #line 210 "rexx.--empty-class(match-none).re" { RETURN(RXS_FORM); } -#line 3318 "rexx.--empty-class(match-none).c" +#line 3316 "rexx.--empty-class(match-none).c" yy271: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3389,7 +3387,7 @@ yy271: yy272: #line 212 "rexx.--empty-class(match-none).re" { RETURN(RXS_FUZZ); } -#line 3393 "rexx.--empty-class(match-none).c" +#line 3391 "rexx.--empty-class(match-none).c" yy273: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3464,7 +3462,7 @@ yy273: yy274: #line 214 "rexx.--empty-class(match-none).re" { RETURN(RXS_HALT); } -#line 3468 "rexx.--empty-class(match-none).c" +#line 3466 "rexx.--empty-class(match-none).c" yy275: yych = *++YYCURSOR; switch (yych) { @@ -3567,7 +3565,7 @@ yy279: yy280: #line 218 "rexx.--empty-class(match-none).re" { RETURN(RXS_NAME); } -#line 3571 "rexx.--empty-class(match-none).c" +#line 3569 "rexx.--empty-class(match-none).c" yy281: yych = *++YYCURSOR; switch (yych) { @@ -3691,7 +3689,7 @@ yy288: yy289: #line 170 "rexx.--empty-class(match-none).re" { RETURN(RX_PULL); } -#line 3695 "rexx.--empty-class(match-none).c" +#line 3693 "rexx.--empty-class(match-none).c" yy290: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3766,7 +3764,7 @@ yy290: yy291: #line 172 "rexx.--empty-class(match-none).re" { RETURN(RX_PUSH); } -#line 3770 "rexx.--empty-class(match-none).c" +#line 3768 "rexx.--empty-class(match-none).c" yy292: yych = *++YYCURSOR; switch (yych) { @@ -3890,7 +3888,7 @@ yy299: yy300: #line 184 "rexx.--empty-class(match-none).re" { RETURN(RX_THEN); } -#line 3894 "rexx.--empty-class(match-none).c" +#line 3892 "rexx.--empty-class(match-none).c" yy301: yych = *++YYCURSOR; switch (yych) { @@ -4000,7 +3998,7 @@ yy306: yy307: #line 188 "rexx.--empty-class(match-none).re" { RETURN(RX_WHEN); } -#line 4004 "rexx.--empty-class(match-none).c" +#line 4002 "rexx.--empty-class(match-none).c" yy308: yych = *++YYCURSOR; switch (yych) { @@ -4082,7 +4080,7 @@ yy309: yy310: #line 244 "rexx.--empty-class(match-none).re" { RETURN(RXS_WITH); } -#line 4086 "rexx.--empty-class(match-none).c" +#line 4084 "rexx.--empty-class(match-none).c" yy311: yych = *++YYCURSOR; switch (yych) { @@ -4178,7 +4176,7 @@ yy314: yy315: #line 200 "rexx.--empty-class(match-none).re" { RETURN(RXS_ERROR); } -#line 4182 "rexx.--empty-class(match-none).c" +#line 4180 "rexx.--empty-class(match-none).c" yy316: yych = *++YYCURSOR; switch (yych) { @@ -4288,7 +4286,7 @@ yy321: yy322: #line 156 "rexx.--empty-class(match-none).re" { RETURN(RX_LEAVE); } -#line 4292 "rexx.--empty-class(match-none).c" +#line 4290 "rexx.--empty-class(match-none).c" yy323: yych = *++YYCURSOR; switch (yych) { @@ -4405,7 +4403,7 @@ yy329: yy330: #line 166 "rexx.--empty-class(match-none).re" { RETURN(RX_PARSE); } -#line 4409 "rexx.--empty-class(match-none).c" +#line 4407 "rexx.--empty-class(match-none).c" yy331: yych = *++YYCURSOR; switch (yych) { @@ -4487,7 +4485,7 @@ yy332: yy333: #line 174 "rexx.--empty-class(match-none).re" { RETURN(RX_QUEUE); } -#line 4491 "rexx.--empty-class(match-none).c" +#line 4489 "rexx.--empty-class(match-none).c" yy334: yych = *++YYCURSOR; switch (yych) { @@ -4604,7 +4602,7 @@ yy340: yy341: #line 186 "rexx.--empty-class(match-none).re" { RETURN(RX_TRACE); } -#line 4608 "rexx.--empty-class(match-none).c" +#line 4606 "rexx.--empty-class(match-none).c" yy342: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -4679,7 +4677,7 @@ yy342: yy343: #line 232 "rexx.--empty-class(match-none).re" { RETURN(RXS_UNTIL); } -#line 4683 "rexx.--empty-class(match-none).c" +#line 4681 "rexx.--empty-class(match-none).c" yy344: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -4754,7 +4752,7 @@ yy344: yy345: #line 234 "rexx.--empty-class(match-none).re" { RETURN(RXS_UPPER); } -#line 4758 "rexx.--empty-class(match-none).c" +#line 4756 "rexx.--empty-class(match-none).c" yy346: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -4829,7 +4827,7 @@ yy346: yy347: #line 236 "rexx.--empty-class(match-none).re" { RETURN(RXS_VALUE); } -#line 4833 "rexx.--empty-class(match-none).c" +#line 4831 "rexx.--empty-class(match-none).c" yy348: yych = *++YYCURSOR; switch (yych) { @@ -4911,7 +4909,7 @@ yy349: yy350: #line 242 "rexx.--empty-class(match-none).re" { RETURN(RXS_WHILE); } -#line 4915 "rexx.--empty-class(match-none).c" +#line 4913 "rexx.--empty-class(match-none).c" yy351: yych = *++YYCURSOR; switch (yych) { @@ -4993,7 +4991,7 @@ yy352: yy353: #line 196 "rexx.--empty-class(match-none).re" { RETURN(RXS_DIGITS); } -#line 4997 "rexx.--empty-class(match-none).c" +#line 4995 "rexx.--empty-class(match-none).c" yy354: yych = *++YYCURSOR; switch (yych) { @@ -5075,7 +5073,7 @@ yy355: yy356: #line 202 "rexx.--empty-class(match-none).re" { RETURN(RXS_EXPOSE); } -#line 5079 "rexx.--empty-class(match-none).c" +#line 5077 "rexx.--empty-class(match-none).c" yy357: yych = *++YYCURSOR; switch (yych) { @@ -5178,7 +5176,7 @@ yy361: yy362: #line 216 "rexx.--empty-class(match-none).re" { RETURN(RXS_LINEIN); } -#line 5182 "rexx.--empty-class(match-none).c" +#line 5180 "rexx.--empty-class(match-none).c" yy363: yych = *++YYCURSOR; switch (yych) { @@ -5295,7 +5293,7 @@ yy369: yy370: #line 176 "rexx.--empty-class(match-none).re" { RETURN(RX_RETURN); } -#line 5299 "rexx.--empty-class(match-none).c" +#line 5297 "rexx.--empty-class(match-none).c" yy371: yych = *++YYCURSOR; switch (yych) { @@ -5377,7 +5375,7 @@ yy372: yy373: #line 180 "rexx.--empty-class(match-none).re" { RETURN(RX_SELECT); } -#line 5381 "rexx.--empty-class(match-none).c" +#line 5379 "rexx.--empty-class(match-none).c" yy374: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -5452,7 +5450,7 @@ yy374: yy375: #line 182 "rexx.--empty-class(match-none).re" { RETURN(RX_SIGNAL); } -#line 5456 "rexx.--empty-class(match-none).c" +#line 5454 "rexx.--empty-class(match-none).c" yy376: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -5527,7 +5525,7 @@ yy376: yy377: #line 226 "rexx.--empty-class(match-none).re" { RETURN(RXS_SOURCE); } -#line 5531 "rexx.--empty-class(match-none).c" +#line 5529 "rexx.--empty-class(match-none).c" yy378: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -5602,7 +5600,7 @@ yy378: yy379: #line 228 "rexx.--empty-class(match-none).re" { RETURN(RXS_SYNTAX); } -#line 5606 "rexx.--empty-class(match-none).c" +#line 5604 "rexx.--empty-class(match-none).c" yy380: yych = *++YYCURSOR; switch (yych) { @@ -5684,7 +5682,7 @@ yy381: yy382: #line 134 "rexx.--empty-class(match-none).re" { RETURN(RX_ADDRESS); } -#line 5688 "rexx.--empty-class(match-none).c" +#line 5686 "rexx.--empty-class(match-none).c" yy383: yych = *++YYCURSOR; switch (yych) { @@ -5766,7 +5764,7 @@ yy384: yy385: #line 204 "rexx.--empty-class(match-none).re" { RETURN(RXS_FAILURE); } -#line 5770 "rexx.--empty-class(match-none).c" +#line 5768 "rexx.--empty-class(match-none).c" yy386: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -5841,7 +5839,7 @@ yy386: yy387: #line 208 "rexx.--empty-class(match-none).re" { RETURN(RXS_FOREVER); } -#line 5845 "rexx.--empty-class(match-none).c" +#line 5843 "rexx.--empty-class(match-none).c" yy388: yych = *++YYCURSOR; switch (yych) { @@ -5923,7 +5921,7 @@ yy389: yy390: #line 154 "rexx.--empty-class(match-none).re" { RETURN(RX_ITERATE); } -#line 5927 "rexx.--empty-class(match-none).c" +#line 5925 "rexx.--empty-class(match-none).c" yy391: yych = *++YYCURSOR; switch (yych) { @@ -6005,7 +6003,7 @@ yy392: yy393: #line 222 "rexx.--empty-class(match-none).re" { RETURN(RXS_NOVALUE); } -#line 6009 "rexx.--empty-class(match-none).c" +#line 6007 "rexx.--empty-class(match-none).c" yy394: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -6080,7 +6078,7 @@ yy394: yy395: #line 160 "rexx.--empty-class(match-none).re" { RETURN(RX_NUMERIC); } -#line 6084 "rexx.--empty-class(match-none).c" +#line 6082 "rexx.--empty-class(match-none).c" yy396: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -6155,7 +6153,7 @@ yy396: yy397: #line 162 "rexx.--empty-class(match-none).re" { RETURN(RX_OPTIONS); } -#line 6159 "rexx.--empty-class(match-none).c" +#line 6157 "rexx.--empty-class(match-none).c" yy398: yych = *++YYCURSOR; switch (yych) { @@ -6251,7 +6249,7 @@ yy401: yy402: #line 240 "rexx.--empty-class(match-none).re" { RETURN(RXS_VERSION); } -#line 6255 "rexx.--empty-class(match-none).c" +#line 6253 "rexx.--empty-class(match-none).c" yy403: yych = *++YYCURSOR; switch (yych) { @@ -6340,7 +6338,7 @@ yy405: yy406: #line 220 "rexx.--empty-class(match-none).re" { RETURN(RXS_NOTREADY); } -#line 6344 "rexx.--empty-class(match-none).c" +#line 6342 "rexx.--empty-class(match-none).c" yy407: yych = *++YYCURSOR; switch (yych) { @@ -6443,7 +6441,7 @@ yy411: yy412: #line 152 "rexx.--empty-class(match-none).re" { RETURN(RX_INTERPRET); } -#line 6447 "rexx.--empty-class(match-none).c" +#line 6445 "rexx.--empty-class(match-none).c" yy413: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -6518,7 +6516,7 @@ yy413: yy414: #line 164 "rexx.--empty-class(match-none).re" { RETURN(RX_OTHERWISE); } -#line 6522 "rexx.--empty-class(match-none).c" +#line 6520 "rexx.--empty-class(match-none).c" yy415: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -6593,7 +6591,7 @@ yy415: yy416: #line 168 "rexx.--empty-class(match-none).re" { RETURN(RX_PROCEDURE); } -#line 6597 "rexx.--empty-class(match-none).c" +#line 6595 "rexx.--empty-class(match-none).c" yy417: yych = *++YYCURSOR; switch (yych) { @@ -6682,7 +6680,7 @@ yy419: yy420: #line 224 "rexx.--empty-class(match-none).re" { RETURN(RXS_SCIENTIFIC); } -#line 6686 "rexx.--empty-class(match-none).c" +#line 6684 "rexx.--empty-class(match-none).c" yy421: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -6757,7 +6755,7 @@ yy421: yy422: #line 198 "rexx.--empty-class(match-none).re" { RETURN(RXS_ENGINEERING); } -#line 6761 "rexx.--empty-class(match-none).c" +#line 6759 "rexx.--empty-class(match-none).c" } #line 265 "rexx.--empty-class(match-none).re" @@ -6771,7 +6769,7 @@ bool StripToken(){ ScanCB.eot = cursor; strip: -#line 6775 "rexx.--empty-class(match-none).c" +#line 6773 "rexx.--empty-class(match-none).c" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -6791,12 +6789,12 @@ yy426: blanks = TRUE; goto strip; } -#line 6795 "rexx.--empty-class(match-none).c" +#line 6793 "rexx.--empty-class(match-none).c" yy428: ++YYCURSOR; #line 282 "rexx.--empty-class(match-none).re" { goto strip; } -#line 6800 "rexx.--empty-class(match-none).c" +#line 6798 "rexx.--empty-class(match-none).c" yy430: yych = *++YYCURSOR; switch (yych) { @@ -6810,14 +6808,14 @@ yy431: depth = 1; goto comment; } -#line 6814 "rexx.--empty-class(match-none).c" +#line 6812 "rexx.--empty-class(match-none).c" } #line 290 "rexx.--empty-class(match-none).re" comment: -#line 6821 "rexx.--empty-class(match-none).c" +#line 6819 "rexx.--empty-class(match-none).c" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -6833,7 +6831,7 @@ yy435: ++YYCURSOR; #line 313 "rexx.--empty-class(match-none).re" { RETURN(blanks); } -#line 6837 "rexx.--empty-class(match-none).c" +#line 6835 "rexx.--empty-class(match-none).c" yy437: ++YYCURSOR; yy438: @@ -6841,7 +6839,7 @@ yy438: { goto comment; } -#line 6845 "rexx.--empty-class(match-none).c" +#line 6843 "rexx.--empty-class(match-none).c" yy439: ++YYCURSOR; #line 302 "rexx.--empty-class(match-none).re" @@ -6850,7 +6848,7 @@ yy439: ScanCB.linePos = ScanCB.pos + (cursor - ScanCB.mrk); goto comment; } -#line 6854 "rexx.--empty-class(match-none).c" +#line 6852 "rexx.--empty-class(match-none).c" yy441: yych = *++YYCURSOR; switch (yych) { @@ -6872,7 +6870,7 @@ yy443: else goto comment; } -#line 6876 "rexx.--empty-class(match-none).c" +#line 6874 "rexx.--empty-class(match-none).c" yy445: ++YYCURSOR; #line 308 "rexx.--empty-class(match-none).re" @@ -6880,7 +6878,7 @@ yy445: ++depth; goto comment; } -#line 6884 "rexx.--empty-class(match-none).c" +#line 6882 "rexx.--empty-class(match-none).c" } #line 318 "rexx.--empty-class(match-none).re" diff --git a/re2c/test/rexx.c b/re2c/test/rexx.c index c5a2cf5b..b4fccaff 100644 --- a/re2c/test/rexx.c +++ b/re2c/test/rexx.c @@ -1821,7 +1821,6 @@ yy171: } yy173: yych = *++YYCURSOR; - YYCTXMARKER = YYCURSOR; switch (yych) { case '!': case '.': @@ -1893,7 +1892,6 @@ yy173: } yy174: yych = *++YYCURSOR; - YYCTXMARKER = YYCURSOR; switch (yych) { case '!': case '.': @@ -1992,7 +1990,7 @@ yy178: ++YYCURSOR; #line 112 "rexx.re" { RETURN(OP_LE_STRICT); } -#line 1996 "rexx.c" +#line 1994 "rexx.c" yy180: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -2007,7 +2005,7 @@ yy182: ++YYCURSOR; #line 110 "rexx.re" { RETURN(OP_GE_STRICT); } -#line 2011 "rexx.c" +#line 2009 "rexx.c" yy184: yych = *++YYCURSOR; switch (yych) { @@ -2089,7 +2087,7 @@ yy185: yy186: #line 136 "rexx.re" { RETURN(RX_ARG); } -#line 2093 "rexx.c" +#line 2091 "rexx.c" yy187: yych = *++YYCURSOR; switch (yych) { @@ -2192,7 +2190,7 @@ yy191: yy192: #line 146 "rexx.re" { RETURN(RX_END); } -#line 2196 "rexx.c" +#line 2194 "rexx.c" yy193: yych = *++YYCURSOR; switch (yych) { @@ -2302,7 +2300,7 @@ yy198: yy199: #line 206 "rexx.re" { RETURN(RXS_FOR); } -#line 2306 "rexx.c" +#line 2304 "rexx.c" yy200: yych = *++YYCURSOR; switch (yych) { @@ -2426,7 +2424,7 @@ yy207: yy208: #line 158 "rexx.re" { RETURN(RX_NOP); } -#line 2430 "rexx.c" +#line 2428 "rexx.c" yy209: yych = *++YYCURSOR; switch (yych) { @@ -2522,7 +2520,7 @@ yy212: yy213: #line 190 "rexx.re" { RETURN(RXS_OFF); } -#line 2526 "rexx.c" +#line 2524 "rexx.c" yy214: yych = *++YYCURSOR; switch (yych) { @@ -2653,7 +2651,7 @@ yy222: yy223: #line 178 "rexx.re" { RETURN(RX_SAY); } -#line 2657 "rexx.c" +#line 2655 "rexx.c" yy224: yych = *++YYCURSOR; switch (yych) { @@ -2798,7 +2796,7 @@ yy234: yy235: #line 238 "rexx.re" { RETURN(RXS_VAR); } -#line 2802 "rexx.c" +#line 2800 "rexx.c" yy236: yych = *++YYCURSOR; switch (yych) { @@ -2851,7 +2849,7 @@ yy244: ++YYCURSOR; #line 104 "rexx.re" { RETURN(OP_EQUAL_EQ_N); } -#line 2855 "rexx.c" +#line 2853 "rexx.c" yy246: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -2864,16 +2862,16 @@ yy246: } yy248: ++YYCURSOR; - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; #line 257 "rexx.re" { RETURN(SU_LITERAL_BIN); } -#line 2871 "rexx.c" +#line 2869 "rexx.c" yy250: ++YYCURSOR; - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; #line 259 "rexx.re" { RETURN(SU_LITERAL_HEX); } -#line 2877 "rexx.c" +#line 2875 "rexx.c" yy252: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -2972,7 +2970,7 @@ yy255: yy256: #line 138 "rexx.re" { RETURN(RX_CALL); } -#line 2976 "rexx.c" +#line 2974 "rexx.c" yy257: yych = *++YYCURSOR; switch (yych) { @@ -3054,7 +3052,7 @@ yy258: yy259: #line 142 "rexx.re" { RETURN(RX_DROP); } -#line 3058 "rexx.c" +#line 3056 "rexx.c" yy260: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3129,7 +3127,7 @@ yy260: yy261: #line 144 "rexx.re" { RETURN(RX_ELSE); } -#line 3133 "rexx.c" +#line 3131 "rexx.c" yy262: yych = *++YYCURSOR; switch (yych) { @@ -3218,7 +3216,7 @@ yy264: yy265: #line 148 "rexx.re" { RETURN(RX_EXIT); } -#line 3222 "rexx.c" +#line 3220 "rexx.c" yy266: yych = *++YYCURSOR; switch (yych) { @@ -3314,7 +3312,7 @@ yy269: yy270: #line 210 "rexx.re" { RETURN(RXS_FORM); } -#line 3318 "rexx.c" +#line 3316 "rexx.c" yy271: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3389,7 +3387,7 @@ yy271: yy272: #line 212 "rexx.re" { RETURN(RXS_FUZZ); } -#line 3393 "rexx.c" +#line 3391 "rexx.c" yy273: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3464,7 +3462,7 @@ yy273: yy274: #line 214 "rexx.re" { RETURN(RXS_HALT); } -#line 3468 "rexx.c" +#line 3466 "rexx.c" yy275: yych = *++YYCURSOR; switch (yych) { @@ -3567,7 +3565,7 @@ yy279: yy280: #line 218 "rexx.re" { RETURN(RXS_NAME); } -#line 3571 "rexx.c" +#line 3569 "rexx.c" yy281: yych = *++YYCURSOR; switch (yych) { @@ -3691,7 +3689,7 @@ yy288: yy289: #line 170 "rexx.re" { RETURN(RX_PULL); } -#line 3695 "rexx.c" +#line 3693 "rexx.c" yy290: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -3766,7 +3764,7 @@ yy290: yy291: #line 172 "rexx.re" { RETURN(RX_PUSH); } -#line 3770 "rexx.c" +#line 3768 "rexx.c" yy292: yych = *++YYCURSOR; switch (yych) { @@ -3890,7 +3888,7 @@ yy299: yy300: #line 184 "rexx.re" { RETURN(RX_THEN); } -#line 3894 "rexx.c" +#line 3892 "rexx.c" yy301: yych = *++YYCURSOR; switch (yych) { @@ -4000,7 +3998,7 @@ yy306: yy307: #line 188 "rexx.re" { RETURN(RX_WHEN); } -#line 4004 "rexx.c" +#line 4002 "rexx.c" yy308: yych = *++YYCURSOR; switch (yych) { @@ -4082,7 +4080,7 @@ yy309: yy310: #line 244 "rexx.re" { RETURN(RXS_WITH); } -#line 4086 "rexx.c" +#line 4084 "rexx.c" yy311: yych = *++YYCURSOR; switch (yych) { @@ -4178,7 +4176,7 @@ yy314: yy315: #line 200 "rexx.re" { RETURN(RXS_ERROR); } -#line 4182 "rexx.c" +#line 4180 "rexx.c" yy316: yych = *++YYCURSOR; switch (yych) { @@ -4288,7 +4286,7 @@ yy321: yy322: #line 156 "rexx.re" { RETURN(RX_LEAVE); } -#line 4292 "rexx.c" +#line 4290 "rexx.c" yy323: yych = *++YYCURSOR; switch (yych) { @@ -4405,7 +4403,7 @@ yy329: yy330: #line 166 "rexx.re" { RETURN(RX_PARSE); } -#line 4409 "rexx.c" +#line 4407 "rexx.c" yy331: yych = *++YYCURSOR; switch (yych) { @@ -4487,7 +4485,7 @@ yy332: yy333: #line 174 "rexx.re" { RETURN(RX_QUEUE); } -#line 4491 "rexx.c" +#line 4489 "rexx.c" yy334: yych = *++YYCURSOR; switch (yych) { @@ -4604,7 +4602,7 @@ yy340: yy341: #line 186 "rexx.re" { RETURN(RX_TRACE); } -#line 4608 "rexx.c" +#line 4606 "rexx.c" yy342: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -4679,7 +4677,7 @@ yy342: yy343: #line 232 "rexx.re" { RETURN(RXS_UNTIL); } -#line 4683 "rexx.c" +#line 4681 "rexx.c" yy344: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -4754,7 +4752,7 @@ yy344: yy345: #line 234 "rexx.re" { RETURN(RXS_UPPER); } -#line 4758 "rexx.c" +#line 4756 "rexx.c" yy346: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -4829,7 +4827,7 @@ yy346: yy347: #line 236 "rexx.re" { RETURN(RXS_VALUE); } -#line 4833 "rexx.c" +#line 4831 "rexx.c" yy348: yych = *++YYCURSOR; switch (yych) { @@ -4911,7 +4909,7 @@ yy349: yy350: #line 242 "rexx.re" { RETURN(RXS_WHILE); } -#line 4915 "rexx.c" +#line 4913 "rexx.c" yy351: yych = *++YYCURSOR; switch (yych) { @@ -4993,7 +4991,7 @@ yy352: yy353: #line 196 "rexx.re" { RETURN(RXS_DIGITS); } -#line 4997 "rexx.c" +#line 4995 "rexx.c" yy354: yych = *++YYCURSOR; switch (yych) { @@ -5075,7 +5073,7 @@ yy355: yy356: #line 202 "rexx.re" { RETURN(RXS_EXPOSE); } -#line 5079 "rexx.c" +#line 5077 "rexx.c" yy357: yych = *++YYCURSOR; switch (yych) { @@ -5178,7 +5176,7 @@ yy361: yy362: #line 216 "rexx.re" { RETURN(RXS_LINEIN); } -#line 5182 "rexx.c" +#line 5180 "rexx.c" yy363: yych = *++YYCURSOR; switch (yych) { @@ -5295,7 +5293,7 @@ yy369: yy370: #line 176 "rexx.re" { RETURN(RX_RETURN); } -#line 5299 "rexx.c" +#line 5297 "rexx.c" yy371: yych = *++YYCURSOR; switch (yych) { @@ -5377,7 +5375,7 @@ yy372: yy373: #line 180 "rexx.re" { RETURN(RX_SELECT); } -#line 5381 "rexx.c" +#line 5379 "rexx.c" yy374: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -5452,7 +5450,7 @@ yy374: yy375: #line 182 "rexx.re" { RETURN(RX_SIGNAL); } -#line 5456 "rexx.c" +#line 5454 "rexx.c" yy376: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -5527,7 +5525,7 @@ yy376: yy377: #line 226 "rexx.re" { RETURN(RXS_SOURCE); } -#line 5531 "rexx.c" +#line 5529 "rexx.c" yy378: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -5602,7 +5600,7 @@ yy378: yy379: #line 228 "rexx.re" { RETURN(RXS_SYNTAX); } -#line 5606 "rexx.c" +#line 5604 "rexx.c" yy380: yych = *++YYCURSOR; switch (yych) { @@ -5684,7 +5682,7 @@ yy381: yy382: #line 134 "rexx.re" { RETURN(RX_ADDRESS); } -#line 5688 "rexx.c" +#line 5686 "rexx.c" yy383: yych = *++YYCURSOR; switch (yych) { @@ -5766,7 +5764,7 @@ yy384: yy385: #line 204 "rexx.re" { RETURN(RXS_FAILURE); } -#line 5770 "rexx.c" +#line 5768 "rexx.c" yy386: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -5841,7 +5839,7 @@ yy386: yy387: #line 208 "rexx.re" { RETURN(RXS_FOREVER); } -#line 5845 "rexx.c" +#line 5843 "rexx.c" yy388: yych = *++YYCURSOR; switch (yych) { @@ -5923,7 +5921,7 @@ yy389: yy390: #line 154 "rexx.re" { RETURN(RX_ITERATE); } -#line 5927 "rexx.c" +#line 5925 "rexx.c" yy391: yych = *++YYCURSOR; switch (yych) { @@ -6005,7 +6003,7 @@ yy392: yy393: #line 222 "rexx.re" { RETURN(RXS_NOVALUE); } -#line 6009 "rexx.c" +#line 6007 "rexx.c" yy394: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -6080,7 +6078,7 @@ yy394: yy395: #line 160 "rexx.re" { RETURN(RX_NUMERIC); } -#line 6084 "rexx.c" +#line 6082 "rexx.c" yy396: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -6155,7 +6153,7 @@ yy396: yy397: #line 162 "rexx.re" { RETURN(RX_OPTIONS); } -#line 6159 "rexx.c" +#line 6157 "rexx.c" yy398: yych = *++YYCURSOR; switch (yych) { @@ -6251,7 +6249,7 @@ yy401: yy402: #line 240 "rexx.re" { RETURN(RXS_VERSION); } -#line 6255 "rexx.c" +#line 6253 "rexx.c" yy403: yych = *++YYCURSOR; switch (yych) { @@ -6340,7 +6338,7 @@ yy405: yy406: #line 220 "rexx.re" { RETURN(RXS_NOTREADY); } -#line 6344 "rexx.c" +#line 6342 "rexx.c" yy407: yych = *++YYCURSOR; switch (yych) { @@ -6443,7 +6441,7 @@ yy411: yy412: #line 152 "rexx.re" { RETURN(RX_INTERPRET); } -#line 6447 "rexx.c" +#line 6445 "rexx.c" yy413: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -6518,7 +6516,7 @@ yy413: yy414: #line 164 "rexx.re" { RETURN(RX_OTHERWISE); } -#line 6522 "rexx.c" +#line 6520 "rexx.c" yy415: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -6593,7 +6591,7 @@ yy415: yy416: #line 168 "rexx.re" { RETURN(RX_PROCEDURE); } -#line 6597 "rexx.c" +#line 6595 "rexx.c" yy417: yych = *++YYCURSOR; switch (yych) { @@ -6682,7 +6680,7 @@ yy419: yy420: #line 224 "rexx.re" { RETURN(RXS_SCIENTIFIC); } -#line 6686 "rexx.c" +#line 6684 "rexx.c" yy421: ++YYCURSOR; switch ((yych = *YYCURSOR)) { @@ -6757,7 +6755,7 @@ yy421: yy422: #line 198 "rexx.re" { RETURN(RXS_ENGINEERING); } -#line 6761 "rexx.c" +#line 6759 "rexx.c" } #line 265 "rexx.re" @@ -6771,12 +6769,11 @@ bool StripToken(){ ScanCB.eot = cursor; strip: -#line 6775 "rexx.c" +#line 6773 "rexx.c" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - YYCTXMARKER = YYCURSOR; switch (yych) { case '\t': case ' ': goto yy427; @@ -6787,10 +6784,10 @@ strip: yy425: ++YYCURSOR; yy426: - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; #line 289 "rexx.re" { RETURN(blanks); } -#line 6794 "rexx.c" +#line 6791 "rexx.c" yy427: ++YYCURSOR; #line 284 "rexx.re" @@ -6798,12 +6795,12 @@ yy427: blanks = TRUE; goto strip; } -#line 6802 "rexx.c" +#line 6799 "rexx.c" yy429: ++YYCURSOR; #line 282 "rexx.re" { goto strip; } -#line 6807 "rexx.c" +#line 6804 "rexx.c" yy431: yych = *++YYCURSOR; switch (yych) { @@ -6817,14 +6814,14 @@ yy432: depth = 1; goto comment; } -#line 6821 "rexx.c" +#line 6818 "rexx.c" } #line 290 "rexx.re" comment: -#line 6828 "rexx.c" +#line 6825 "rexx.c" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -6840,7 +6837,7 @@ yy436: ++YYCURSOR; #line 313 "rexx.re" { RETURN(blanks); } -#line 6844 "rexx.c" +#line 6841 "rexx.c" yy438: ++YYCURSOR; yy439: @@ -6848,7 +6845,7 @@ yy439: { goto comment; } -#line 6852 "rexx.c" +#line 6849 "rexx.c" yy440: ++YYCURSOR; #line 302 "rexx.re" @@ -6857,7 +6854,7 @@ yy440: ScanCB.linePos = ScanCB.pos + (cursor - ScanCB.mrk); goto comment; } -#line 6861 "rexx.c" +#line 6858 "rexx.c" yy442: yych = *++YYCURSOR; switch (yych) { @@ -6879,7 +6876,7 @@ yy444: else goto comment; } -#line 6883 "rexx.c" +#line 6880 "rexx.c" yy446: ++YYCURSOR; #line 308 "rexx.re" @@ -6887,7 +6884,7 @@ yy446: ++depth; goto comment; } -#line 6891 "rexx.c" +#line 6888 "rexx.c" } #line 318 "rexx.re" diff --git a/re2c/test/scanner_re2c.bi.c b/re2c/test/scanner_re2c.bi.c index 595d01ea..d960fd31 100644 --- a/re2c/test/scanner_re2c.bi.c +++ b/re2c/test/scanner_re2c.bi.c @@ -881,7 +881,6 @@ yy133: goto yy126; yy134: yych = *++YYCURSOR; - YYCTXMARKER = YYCURSOR; if (yych == '=') goto yy163; goto yy113; yy135: @@ -1082,7 +1081,7 @@ yy167: yy168: ++YYCURSOR; yy169: - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; { if (!FFlag) { cur = cursor; @@ -1224,7 +1223,7 @@ yy190: goto yy144; yy191: ++YYCURSOR; - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 2; { RETURN(*tok); } @@ -1638,7 +1637,6 @@ yy251: yy252: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - YYCTXMARKER = YYCURSOR; if (yych <= '\r') { if (yych <= '\t') { if (yych >= '\t') goto yy260; @@ -1722,7 +1720,7 @@ yy260: if (yych == '#') goto yy263; } yy261: - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; { if (depth == 0) { diff --git a/re2c/test/scanner_re2c_default.bi.c b/re2c/test/scanner_re2c_default.bi.c index 1bb53c5e..38f22a0c 100644 --- a/re2c/test/scanner_re2c_default.bi.c +++ b/re2c/test/scanner_re2c_default.bi.c @@ -881,7 +881,6 @@ yy133: goto yy126; yy134: yych = *++YYCURSOR; - YYCTXMARKER = YYCURSOR; if (yych == '=') goto yy163; goto yy113; yy135: @@ -1082,7 +1081,7 @@ yy167: yy168: ++YYCURSOR; yy169: - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; { if (!FFlag) { cur = cursor; @@ -1224,7 +1223,7 @@ yy190: goto yy144; yy191: ++YYCURSOR; - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 2; { RETURN(*tok); } @@ -1638,7 +1637,6 @@ yy251: yy252: yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - YYCTXMARKER = YYCURSOR; if (yych <= '\r') { if (yych <= '\t') { if (yych >= '\t') goto yy260; @@ -1722,7 +1720,7 @@ yy260: if (yych == '#') goto yy263; } yy261: - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 1; { if (depth == 0) { diff --git a/re2c/test/strip_003.b.c b/re2c/test/strip_003.b.c index e20fbe62..68aaf5ef 100644 --- a/re2c/test/strip_003.b.c +++ b/re2c/test/strip_003.b.c @@ -104,7 +104,6 @@ yy3: #line 105 "strip_003.b.c" yy4: yych = *(YYMARKER = ++YYCURSOR); - YYCTXMARKER = YYCURSOR; if (yych == '/') goto yy7; goto yy3; yy5: @@ -124,32 +123,31 @@ yy8: goto yy3; yy9: yych = *++YYCURSOR; - YYCTXMARKER = YYCURSOR; if (yych == '/') goto yy7; goto yy8; yy10: ++YYCURSOR; #line 129 "strip_003.b.re" { goto comment; } -#line 135 "strip_003.b.c" +#line 133 "strip_003.b.c" yy12: ++YYCURSOR; #line 127 "strip_003.b.re" { goto cppcomment; } -#line 140 "strip_003.b.c" +#line 138 "strip_003.b.c" yy14: ++YYCURSOR; - YYCURSOR = YYCTXMARKER; + YYCURSOR -= 2; #line 128 "strip_003.b.re" { echo(&s); nlcomment = 1; continue; } -#line 146 "strip_003.b.c" +#line 144 "strip_003.b.c" } #line 131 "strip_003.b.re" comment: s.tok = s.cur; -#line 153 "strip_003.b.c" +#line 151 "strip_003.b.c" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -159,21 +157,21 @@ comment: yy19: #line 136 "strip_003.b.re" { goto comment; } -#line 163 "strip_003.b.c" +#line 161 "strip_003.b.c" yy20: yych = *++YYCURSOR; if (yych != '/') goto yy19; ++YYCURSOR; #line 135 "strip_003.b.re" { goto commentws; } -#line 170 "strip_003.b.c" +#line 168 "strip_003.b.c" } #line 137 "strip_003.b.re" commentws: s.tok = s.cur; -#line 177 "strip_003.b.c" +#line 175 "strip_003.b.c" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); @@ -196,13 +194,13 @@ commentws: yy26: #line 151 "strip_003.b.re" { echo(&s); nlcomment = 0; continue; } -#line 200 "strip_003.b.c" +#line 198 "strip_003.b.c" yy27: ++YYCURSOR; yy28: #line 150 "strip_003.b.re" { goto commentws; } -#line 206 "strip_003.b.c" +#line 204 "strip_003.b.c" yy29: yych = *(YYMARKER = ++YYCURSOR); if (yych == '/') goto yy33; @@ -216,7 +214,7 @@ yy30: nlcomment = 0; continue; } -#line 220 "strip_003.b.c" +#line 218 "strip_003.b.c" yy31: yych = *++YYCURSOR; if (yych == '\n') goto yy29; @@ -234,14 +232,14 @@ yy35: ++YYCURSOR; #line 141 "strip_003.b.re" { goto comment; } -#line 238 "strip_003.b.c" +#line 236 "strip_003.b.c" } #line 152 "strip_003.b.re" cppcomment: s.tok = s.cur; -#line 245 "strip_003.b.c" +#line 243 "strip_003.b.c" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -252,12 +250,12 @@ cppcomment: yy40: #line 157 "strip_003.b.re" { goto cppcomment; } -#line 256 "strip_003.b.c" +#line 254 "strip_003.b.c" yy41: ++YYCURSOR; #line 156 "strip_003.b.re" { echo(&s); continue; } -#line 261 "strip_003.b.c" +#line 259 "strip_003.b.c" yy43: ++YYCURSOR; if ((yych = *YYCURSOR) == '\n') goto yy41; -- 2.40.0