From: Ulya Trofimovich Date: Thu, 3 Jan 2019 11:26:51 +0000 (+0000) Subject: Added some tests for GTOP closure algorithm. X-Git-Tag: 1.2~250 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44536a04a987a12a4ead533c0ee3108d686171cf;p=re2c Added some tests for GTOP closure algorithm. --- diff --git a/re2c/test/posix_captures/other/01.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/01.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..8de9b9e9 --- /dev/null +++ b/re2c/test/posix_captures/other/01.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,49 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + yyt1 = yyt2 = YYCURSOR; + goto yy3; + default: + yyt2 = yyt3 = NULL; + yyt1 = YYCURSOR; + goto yy2; + } +yy2: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy3: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: + yyt3 = YYCURSOR; + goto yy2; + } +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + yyt2 = YYCURSOR; + goto yy3; + default: + yyt3 = YYCURSOR; + goto yy2; + } +} + +re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules] diff --git a/re2c/test/posix_captures/other/01.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/01.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..6a801947 --- /dev/null +++ b/re2c/test/posix_captures/other/01.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (a|aa)* + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/02.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/02.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..8de9b9e9 --- /dev/null +++ b/re2c/test/posix_captures/other/02.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,49 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + yyt1 = yyt2 = YYCURSOR; + goto yy3; + default: + yyt2 = yyt3 = NULL; + yyt1 = YYCURSOR; + goto yy2; + } +yy2: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy3: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: + yyt3 = YYCURSOR; + goto yy2; + } +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + yyt2 = YYCURSOR; + goto yy3; + default: + yyt3 = YYCURSOR; + goto yy2; + } +} + +re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules] diff --git a/re2c/test/posix_captures/other/02.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/02.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..8188743e --- /dev/null +++ b/re2c/test/posix_captures/other/02.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (aa|a)* + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/03.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/03.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..4b31e353 --- /dev/null +++ b/re2c/test/posix_captures/other/03.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,27 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy3; + default: goto yy2; + } +yy2: + yynmatch = 1; + yypmatch[0] = YYCURSOR; + yypmatch[1] = YYCURSOR; + {} +yy3: + ++YYCURSOR; + yyt1 = NULL; + yynmatch = 2; + yypmatch[2] = yyt1; + yypmatch[3] = yyt1; + yypmatch[0] = YYCURSOR - 1; + yypmatch[1] = YYCURSOR; + {} +} + +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/posix_captures/other/03.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/03.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..04913f74 --- /dev/null +++ b/re2c/test/posix_captures/other/03.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + a|(a) + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/04.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/04.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..00dfd33d --- /dev/null +++ b/re2c/test/posix_captures/other/04.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,29 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + yyt1 = YYCURSOR; + goto yy3; + default: goto yy2; + } +yy2: + yynmatch = 1; + yypmatch[0] = YYCURSOR; + yypmatch[1] = YYCURSOR; + {} +yy3: + ++YYCURSOR; + yyt2 = YYCURSOR; + yynmatch = 2; + yypmatch[2] = yyt1; + yypmatch[3] = yyt2; + yypmatch[0] = YYCURSOR - 1; + yypmatch[1] = YYCURSOR; + {} +} + +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/posix_captures/other/04.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/04.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..2e6e4780 --- /dev/null +++ b/re2c/test/posix_captures/other/04.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (a)|a + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/05.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/05.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..8236d2cb --- /dev/null +++ b/re2c/test/posix_captures/other/05.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,42 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *(YYMARKER = YYCURSOR); + switch (yych) { + case 'b': + yyt1 = YYCURSOR; + goto yy3; + default: goto yy2; + } +yy2: + yynmatch = 1; + yypmatch[0] = YYCURSOR; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'a': + yyt2 = YYCURSOR; + goto yy5; + default: goto yy4; + } +yy4: + YYCURSOR = YYMARKER; + goto yy2; +yy5: + ++YYCURSOR; + yyt3 = NULL; + yynmatch = 3; + yypmatch[2] = yyt1; + yypmatch[3] = yyt2; + yypmatch[4] = yyt3; + yypmatch[5] = yyt3; + yypmatch[0] = YYCURSOR - 2; + yypmatch[1] = YYCURSOR; + {} +} + +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/posix_captures/other/05.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/05.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..4825bbc4 --- /dev/null +++ b/re2c/test/posix_captures/other/05.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (b)a|b(a) + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/06.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/06.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..8857af4a --- /dev/null +++ b/re2c/test/posix_captures/other/06.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,41 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *(YYMARKER = YYCURSOR); + switch (yych) { + case 'b': goto yy3; + default: goto yy2; + } +yy2: + yynmatch = 1; + yypmatch[0] = YYCURSOR; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'a': + yyt1 = YYCURSOR; + goto yy5; + default: goto yy4; + } +yy4: + YYCURSOR = YYMARKER; + goto yy2; +yy5: + ++YYCURSOR; + yyt3 = NULL; + yyt2 = YYCURSOR; + yynmatch = 3; + yypmatch[2] = yyt1; + yypmatch[3] = yyt2; + yypmatch[4] = yyt3; + yypmatch[5] = yyt3; + yypmatch[0] = YYCURSOR - 2; + yypmatch[1] = YYCURSOR; + {} +} + +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/posix_captures/other/06.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/06.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..daa8211d --- /dev/null +++ b/re2c/test/posix_captures/other/06.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + b(a)|(b)a + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/07.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/07.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..f6d6fba6 --- /dev/null +++ b/re2c/test/posix_captures/other/07.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,37 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + yyt1 = YYCURSOR; + goto yy3; + default: + yyt2 = NULL; + yyt1 = YYCURSOR; + goto yy2; + } +yy2: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt2; + yypmatch[1] = YYCURSOR; + {} +yy3: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy3; + default: + yyt2 = NULL; + goto yy2; + } +} + +re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules] diff --git a/re2c/test/posix_captures/other/07.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/07.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..c95394df --- /dev/null +++ b/re2c/test/posix_captures/other/07.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + a*|(a|aa)* + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/08.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/08.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..8de9b9e9 --- /dev/null +++ b/re2c/test/posix_captures/other/08.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,49 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + yyt1 = yyt2 = YYCURSOR; + goto yy3; + default: + yyt2 = yyt3 = NULL; + yyt1 = YYCURSOR; + goto yy2; + } +yy2: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy3: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy4; + default: + yyt3 = YYCURSOR; + goto yy2; + } +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + yyt2 = YYCURSOR; + goto yy3; + default: + yyt3 = YYCURSOR; + goto yy2; + } +} + +re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules] diff --git a/re2c/test/posix_captures/other/08.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/08.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..846ae97c --- /dev/null +++ b/re2c/test/posix_captures/other/08.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (a|aa)*|a* + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/09.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/09.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..e7f0902d --- /dev/null +++ b/re2c/test/posix_captures/other/09.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,99 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *(YYMARKER = YYCURSOR); + switch (yych) { + case 'a': + yyt1 = yyt2 = YYCURSOR; + goto yy3; + default: + yyt1 = yyt2 = yyt3 = YYCURSOR; + goto yy2; + } +yy2: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy4; + } +yy4: + YYCURSOR = YYMARKER; + yyt1 = yyt2 = yyt3 = YYCURSOR; + goto yy2; +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy6; + default: + yyt3 = YYCURSOR; + goto yy2; + } +yy6: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + yyt3 = YYCURSOR; + switch (yych) { + case 'a': goto yy7; + default: goto yy2; + } +yy7: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + yyt4 = YYCURSOR; + goto yy8; + default: + yyt3 = YYCURSOR; + goto yy2; + } +yy8: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy9; + default: + yyt2 = yyt3; + yyt3 = YYCURSOR; + goto yy2; + } +yy9: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy10; + default: + yyt3 = YYCURSOR; + goto yy2; + } +yy10: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: + yyt2 = yyt4; + yyt3 = YYCURSOR; + goto yy2; + } +} + +re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules] diff --git a/re2c/test/posix_captures/other/09.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/09.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..152512a6 --- /dev/null +++ b/re2c/test/posix_captures/other/09.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (aa*|aaa*)* + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/10.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/10.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..25e6925b --- /dev/null +++ b/re2c/test/posix_captures/other/10.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,97 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *(YYMARKER = YYCURSOR); + switch (yych) { + case 'a': + yyt1 = YYCURSOR; + goto yy3; + default: + yyt1 = yyt2 = YYCURSOR; + goto yy2; + } +yy2: + yynmatch = 3; + yypmatch[2] = yyt1; + yypmatch[4] = yyt2; + yypmatch[0] = yyt1; + yypmatch[1] = YYCURSOR; + yypmatch[3] = yyt2; + yypmatch[5] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy4; + } +yy4: + YYCURSOR = YYMARKER; + yyt1 = yyt2 = YYCURSOR; + goto yy2; +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy6; + default: + yyt2 = YYCURSOR; + goto yy2; + } +yy6: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + yyt2 = YYCURSOR; + switch (yych) { + case 'a': goto yy7; + default: goto yy2; + } +yy7: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + yyt3 = YYCURSOR; + goto yy8; + default: + yyt2 = YYCURSOR; + goto yy2; + } +yy8: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy9; + default: goto yy2; + } +yy9: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy10; + default: + yyt2 = YYCURSOR; + goto yy2; + } +yy10: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: + yyt2 = yyt3; + goto yy2; + } +} + +re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules] diff --git a/re2c/test/posix_captures/other/10.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/10.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..19275b61 --- /dev/null +++ b/re2c/test/posix_captures/other/10.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (aa*|aaa*)(aa*|aaa*) + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/11.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/11.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..676775c6 --- /dev/null +++ b/re2c/test/posix_captures/other/11.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,117 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + unsigned int yyaccept = 0; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *(YYMARKER = YYCURSOR); + switch (yych) { + case 'a': + yyt3 = yyt4 = NULL; + yyt1 = yyt2 = yyt5 = YYCURSOR; + goto yy3; + default: + yyt2 = yyt3 = yyt4 = yyt5 = NULL; + yyt1 = YYCURSOR; + goto yy2; + } +yy2: + yynmatch = 3; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[4] = yyt5; + yypmatch[5] = yyt4; + yypmatch[1] = YYCURSOR; + {} +yy3: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy4; + } +yy4: + YYCURSOR = YYMARKER; + switch (yyaccept) { + case 0: + yyt2 = yyt3 = yyt4 = yyt5 = NULL; + yyt1 = YYCURSOR; + goto yy2; + case 1: + yyt4 = yyt5 = NULL; + yyt3 = YYCURSOR; + goto yy2; + default: + yyt2 = yyt6; + yyt4 = yyt5 = NULL; + yyt3 = YYCURSOR; + goto yy2; + } +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + yyt2 = YYCURSOR; + goto yy6; + default: + yyt4 = yyt5 = NULL; + yyt3 = YYCURSOR; + goto yy2; + } +yy6: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy7; + default: + yyt2 = yyt4; + yyt4 = YYCURSOR; + goto yy2; + } +yy7: + yyaccept = 1; + YYMARKER = ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + yyt6 = YYCURSOR; + goto yy8; + default: + yyt4 = yyt5 = NULL; + yyt3 = YYCURSOR; + goto yy2; + } +yy8: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy9; + default: goto yy4; + } +yy9: + yyaccept = 2; + YYMARKER = ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + yyt2 = yyt5 = YYCURSOR; + goto yy3; + default: + yyt2 = yyt6; + yyt4 = yyt5 = NULL; + yyt3 = YYCURSOR; + goto yy2; + } +} + +re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules] diff --git a/re2c/test/posix_captures/other/11.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/11.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..009ec8b2 --- /dev/null +++ b/re2c/test/posix_captures/other/11.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (aa)*|(aaa)* + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/12.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/12.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..0d65e797 --- /dev/null +++ b/re2c/test/posix_captures/other/12.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,292 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + unsigned int yyaccept = 0; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *(YYMARKER = YYCURSOR); + switch (yych) { + case 'X': + yyt1 = yyt3 = YYCURSOR; + goto yy3; + case 'Y': + yyt1 = yyt3 = YYCURSOR; + goto yy5; + case 'a': + yyt1 = yyt3 = YYCURSOR; + goto yy7; + case 'b': + yyt1 = yyt3 = YYCURSOR; + goto yy9; + default: + yyt2 = yyt3 = NULL; + yyt1 = YYCURSOR; + goto yy2; + } +yy2: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy3: + yyaccept = 1; + YYMARKER = ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'X': + yyt3 = YYCURSOR; + goto yy3; + case 'Y': + yyt3 = YYCURSOR; + goto yy5; + case 'a': + yyt4 = YYCURSOR; + goto yy10; + case 'b': + yyt2 = yyt3; + yyt3 = YYCURSOR; + goto yy9; + default: + yyt2 = yyt3; + yyt3 = YYCURSOR; + goto yy2; + } +yy5: + yyaccept = 1; + YYMARKER = ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'X': + yyt3 = YYCURSOR; + goto yy3; + case 'Y': + yyt3 = YYCURSOR; + goto yy5; + case 'a': + yyt2 = yyt3; + yyt3 = YYCURSOR; + goto yy7; + case 'b': + yyt2 = yyt3; + yyt3 = YYCURSOR; + goto yy9; + default: + yyt2 = yyt3; + yyt3 = YYCURSOR; + goto yy2; + } +yy7: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'b': goto yy11; + default: goto yy8; + } +yy8: + YYCURSOR = YYMARKER; + switch (yyaccept) { + case 0: + yyt2 = yyt3 = NULL; + yyt1 = YYCURSOR; + goto yy2; + case 1: + yyt3 = YYCURSOR; + goto yy2; + case 2: + yyt2 = yyt4; + yyt3 = YYCURSOR; + goto yy2; + default: + yyt2 = yyt5; + yyt3 = YYCURSOR; + goto yy2; + } +yy9: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'Y': goto yy5; + case 'a': goto yy12; + default: goto yy8; + } +yy10: + yyaccept = 1; + YYMARKER = ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'X': + yyt3 = YYCURSOR; + goto yy3; + case 'Y': + yyt3 = YYCURSOR; + goto yy5; + case 'a': + yyt2 = yyt3; + yyt3 = YYCURSOR; + goto yy7; + case 'b': + yyt5 = YYCURSOR; + goto yy13; + default: + yyt2 = yyt3; + yyt3 = YYCURSOR; + goto yy2; + } +yy11: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy14; + default: goto yy8; + } +yy12: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'b': goto yy15; + default: goto yy8; + } +yy13: + yyaccept = 1; + YYMARKER = ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'X': + yyt3 = YYCURSOR; + goto yy3; + case 'Y': + yyt3 = YYCURSOR; + goto yy5; + case 'a': + yyt2 = YYCURSOR; + goto yy16; + case 'b': + yyt2 = yyt3; + yyt3 = YYCURSOR; + goto yy9; + default: + yyt2 = yyt3; + yyt3 = YYCURSOR; + goto yy2; + } +yy14: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'b': goto yy5; + default: goto yy8; + } +yy15: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy8; + } +yy16: + yyaccept = 1; + YYMARKER = ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'X': + yyt3 = YYCURSOR; + goto yy3; + case 'Y': + yyt3 = YYCURSOR; + goto yy5; + case 'a': + yyt2 = yyt3; + yyt3 = YYCURSOR; + goto yy7; + case 'b': + yyt3 = YYCURSOR; + goto yy17; + default: + yyt2 = yyt3; + yyt3 = YYCURSOR; + goto yy2; + } +yy17: + yyaccept = 2; + YYMARKER = ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'X': + yyt3 = YYCURSOR; + goto yy3; + case 'Y': goto yy5; + case 'a': + yyt4 = YYCURSOR; + goto yy18; + case 'b': + yyt3 = YYCURSOR; + goto yy9; + default: + yyt2 = yyt4; + yyt3 = YYCURSOR; + goto yy2; + } +yy18: + yyaccept = 3; + YYMARKER = ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'X': + yyt3 = YYCURSOR; + goto yy3; + case 'Y': + yyt3 = YYCURSOR; + goto yy5; + case 'a': + yyt3 = YYCURSOR; + goto yy7; + case 'b': + yyt5 = YYCURSOR; + goto yy19; + default: + yyt2 = yyt5; + yyt3 = YYCURSOR; + goto yy2; + } +yy19: + yyaccept = 1; + YYMARKER = ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'X': + yyt3 = YYCURSOR; + goto yy3; + case 'Y': + yyt3 = YYCURSOR; + goto yy5; + case 'a': + yyt2 = YYCURSOR; + goto yy16; + case 'b': + yyt3 = YYCURSOR; + goto yy9; + default: + yyt3 = YYCURSOR; + goto yy2; + } +} + +re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules] diff --git a/re2c/test/posix_captures/other/12.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/12.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..e27fe691 --- /dev/null +++ b/re2c/test/posix_captures/other/12.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (X|Xa|Xab|Xaba|abab|baba|bY|Y)* + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/13.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/13.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..b37036a1 --- /dev/null +++ b/re2c/test/posix_captures/other/13.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,40 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *(YYMARKER = YYCURSOR); + switch (yych) { + case 'y': + yyt1 = YYCURSOR; + goto yy3; + default: goto yy2; + } +yy2: + yynmatch = 1; + yypmatch[0] = YYCURSOR; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt2 = YYCURSOR; + goto yy5; + default: goto yy4; + } +yy4: + YYCURSOR = YYMARKER; + goto yy2; +yy5: + ++YYCURSOR; + yyt3 = YYCURSOR; + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +} + +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/posix_captures/other/13.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/13.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..bb541b2f --- /dev/null +++ b/re2c/test/posix_captures/other/13.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (y){2} + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/14.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/14.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..d9d28c11 --- /dev/null +++ b/re2c/test/posix_captures/other/14.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,41 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'y': + yyt1 = yyt2 = YYCURSOR; + goto yy3; + default: + yyt2 = yyt3 = NULL; + yyt1 = YYCURSOR; + goto yy2; + } +yy2: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt2 = YYCURSOR; + goto yy4; + default: + yyt3 = YYCURSOR; + goto yy2; + } +yy4: + ++YYCURSOR; + yyt3 = YYCURSOR; + goto yy2; +} + +re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules] diff --git a/re2c/test/posix_captures/other/14.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/14.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..f5be94a8 --- /dev/null +++ b/re2c/test/posix_captures/other/14.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (y){0,2} + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/15.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/15.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..b3d8b0b4 --- /dev/null +++ b/re2c/test/posix_captures/other/15.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,41 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'y': + yyt1 = yyt2 = YYCURSOR; + goto yy3; + default: goto yy2; + } +yy2: + yynmatch = 1; + yypmatch[0] = YYCURSOR; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt2 = YYCURSOR; + goto yy5; + default: + yyt3 = YYCURSOR; + goto yy4; + } +yy4: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy5: + ++YYCURSOR; + yyt3 = YYCURSOR; + goto yy4; +} + +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/posix_captures/other/15.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/15.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..7ddd667d --- /dev/null +++ b/re2c/test/posix_captures/other/15.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (y){1,2} + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/16.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/16.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..33dc9524 --- /dev/null +++ b/re2c/test/posix_captures/other/16.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,50 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *(YYMARKER = YYCURSOR); + switch (yych) { + case 'y': + yyt1 = yyt2 = YYCURSOR; + goto yy3; + default: goto yy2; + } +yy2: + yynmatch = 1; + yypmatch[0] = YYCURSOR; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt3 = yyt4 = YYCURSOR; + goto yy5; + default: goto yy4; + } +yy4: + YYCURSOR = YYMARKER; + goto yy2; +yy5: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt3 = YYCURSOR; + goto yy7; + default: goto yy6; + } +yy6: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy7: + ++YYCURSOR; + yyt2 = yyt4; + goto yy6; +} + +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/posix_captures/other/16.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/16.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..19258930 --- /dev/null +++ b/re2c/test/posix_captures/other/16.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (y){1,2}y + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/17.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/17.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..b1308767 --- /dev/null +++ b/re2c/test/posix_captures/other/17.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,47 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR; + switch (yych) { + case 'y': + yyt1 = yyt2 = YYCURSOR; + goto yy3; + default: goto yy2; + } +yy2: + yynmatch = 1; + yypmatch[0] = YYCURSOR; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt2 = YYCURSOR; + goto yy5; + default: + yyt3 = YYCURSOR; + goto yy4; + } +yy4: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy5: + yych = *++YYCURSOR; + yyt3 = YYCURSOR; + switch (yych) { + case 'y': goto yy6; + default: goto yy4; + } +yy6: + ++YYCURSOR; + goto yy4; +} + +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/posix_captures/other/17.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/17.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..593f4f52 --- /dev/null +++ b/re2c/test/posix_captures/other/17.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (y){1,2}y? + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/18.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/18.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..ab2c9325 --- /dev/null +++ b/re2c/test/posix_captures/other/18.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,50 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *(YYMARKER = YYCURSOR); + switch (yych) { + case 'y': + yyt1 = YYCURSOR; + goto yy3; + default: goto yy2; + } +yy2: + yynmatch = 1; + yypmatch[0] = YYCURSOR; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt2 = YYCURSOR; + goto yy5; + default: goto yy4; + } +yy4: + YYCURSOR = YYMARKER; + goto yy2; +yy5: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'y': + yyt2 = YYCURSOR; + goto yy5; + default: + yyt3 = YYCURSOR; + goto yy7; + } +yy7: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +} + +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/posix_captures/other/18.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/18.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..e4f059a6 --- /dev/null +++ b/re2c/test/posix_captures/other/18.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (y){2,} + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/19.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/19.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..e05ef808 --- /dev/null +++ b/re2c/test/posix_captures/other/19.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,40 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'y': + yyt1 = YYCURSOR; + goto yy3; + default: + yyt1 = yyt2 = yyt3 = YYCURSOR; + goto yy2; + } +yy2: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt2 = YYCURSOR; + goto yy4; + default: + yyt2 = yyt3 = YYCURSOR; + goto yy2; + } +yy4: + ++YYCURSOR; + yyt3 = YYCURSOR; + goto yy2; +} + +re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules] diff --git a/re2c/test/posix_captures/other/19.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/19.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..aa802ef8 --- /dev/null +++ b/re2c/test/posix_captures/other/19.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (y?){2} + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/20.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/20.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..c06320c3 --- /dev/null +++ b/re2c/test/posix_captures/other/20.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,40 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'y': + yyt1 = yyt2 = YYCURSOR; + goto yy3; + default: + yyt1 = yyt2 = yyt3 = YYCURSOR; + goto yy2; + } +yy2: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt2 = YYCURSOR; + goto yy4; + default: + yyt3 = YYCURSOR; + goto yy2; + } +yy4: + ++YYCURSOR; + yyt3 = YYCURSOR; + goto yy2; +} + +re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules] diff --git a/re2c/test/posix_captures/other/20.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/20.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..64dc237b --- /dev/null +++ b/re2c/test/posix_captures/other/20.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (y?){0,2} + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/21.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/21.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..c06320c3 --- /dev/null +++ b/re2c/test/posix_captures/other/21.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,40 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'y': + yyt1 = yyt2 = YYCURSOR; + goto yy3; + default: + yyt1 = yyt2 = yyt3 = YYCURSOR; + goto yy2; + } +yy2: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt2 = YYCURSOR; + goto yy4; + default: + yyt3 = YYCURSOR; + goto yy2; + } +yy4: + ++YYCURSOR; + yyt3 = YYCURSOR; + goto yy2; +} + +re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules] diff --git a/re2c/test/posix_captures/other/21.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/21.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..4269fa78 --- /dev/null +++ b/re2c/test/posix_captures/other/21.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (y?){1,2} + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/22.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/22.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..6651362f --- /dev/null +++ b/re2c/test/posix_captures/other/22.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,47 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR; + switch (yych) { + case 'y': + yyt1 = yyt2 = yyt3 = YYCURSOR; + goto yy3; + default: goto yy2; + } +yy2: + yynmatch = 1; + yypmatch[0] = YYCURSOR; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt3 = yyt4 = YYCURSOR; + goto yy5; + default: goto yy4; + } +yy4: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy5: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt3 = YYCURSOR; + goto yy6; + default: goto yy4; + } +yy6: + ++YYCURSOR; + yyt2 = yyt4; + goto yy4; +} + +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/posix_captures/other/22.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/22.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..ab899d3b --- /dev/null +++ b/re2c/test/posix_captures/other/22.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (y?){1,2}y + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/23.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/23.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..af72b8b4 --- /dev/null +++ b/re2c/test/posix_captures/other/23.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,46 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR; + switch (yych) { + case 'y': + yyt1 = yyt2 = YYCURSOR; + goto yy3; + default: + yyt1 = yyt2 = yyt3 = YYCURSOR; + goto yy2; + } +yy2: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt2 = YYCURSOR; + goto yy4; + default: + yyt3 = YYCURSOR; + goto yy2; + } +yy4: + yych = *++YYCURSOR; + yyt3 = YYCURSOR; + switch (yych) { + case 'y': goto yy5; + default: goto yy2; + } +yy5: + ++YYCURSOR; + goto yy2; +} + +re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules] diff --git a/re2c/test/posix_captures/other/23.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/23.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..b1946170 --- /dev/null +++ b/re2c/test/posix_captures/other/23.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (y?){1,2}y? + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/24.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/24.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..c7d9e281 --- /dev/null +++ b/re2c/test/posix_captures/other/24.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,48 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + switch (yych) { + case 'y': + yyt1 = YYCURSOR; + goto yy3; + default: + yyt1 = yyt2 = yyt3 = YYCURSOR; + goto yy2; + } +yy2: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt2 = YYCURSOR; + goto yy4; + default: + yyt2 = yyt3 = YYCURSOR; + goto yy2; + } +yy4: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'y': + yyt2 = YYCURSOR; + goto yy4; + default: + yyt3 = YYCURSOR; + goto yy2; + } +} + +re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules] diff --git a/re2c/test/posix_captures/other/24.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/24.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..820b29b3 --- /dev/null +++ b/re2c/test/posix_captures/other/24.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (y?){2,} + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/25.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/25.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..15c7f20d --- /dev/null +++ b/re2c/test/posix_captures/other/25.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,94 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR; + switch (yych) { + case 'x': + yyt1 = yyt2 = yyt4 = YYCURSOR; + goto yy3; + case 'y': + yyt1 = yyt2 = YYCURSOR; + goto yy4; + default: + yyt1 = yyt2 = yyt3 = yyt4 = yyt5 = YYCURSOR; + goto yy2; + } +yy2: + yynmatch = 3; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[4] = yyt4; + yypmatch[5] = yyt5; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'x': + yyt2 = yyt4 = YYCURSOR; + goto yy5; + case 'y': + yyt2 = YYCURSOR; + goto yy6; + default: + yyt3 = yyt5 = YYCURSOR; + goto yy2; + } +yy4: + yych = *++YYCURSOR; + switch (yych) { + case 'x': + yyt2 = yyt4 = YYCURSOR; + goto yy5; + case 'y': + yyt2 = YYCURSOR; + goto yy6; + default: + yyt4 = yyt5 = NULL; + yyt3 = YYCURSOR; + goto yy2; + } +yy5: + yych = *++YYCURSOR; + switch (yych) { + case 'x': + yyt2 = yyt4 = YYCURSOR; + goto yy7; + case 'y': + yyt2 = YYCURSOR; + goto yy8; + default: + yyt3 = yyt5 = YYCURSOR; + goto yy2; + } +yy6: + yych = *++YYCURSOR; + switch (yych) { + case 'x': + yyt2 = yyt4 = YYCURSOR; + goto yy7; + case 'y': + yyt2 = YYCURSOR; + goto yy8; + default: + yyt4 = yyt5 = NULL; + yyt3 = YYCURSOR; + goto yy2; + } +yy7: + ++YYCURSOR; + yyt3 = yyt5 = YYCURSOR; + goto yy2; +yy8: + ++YYCURSOR; + yyt4 = yyt5 = NULL; + yyt3 = YYCURSOR; + goto yy2; +} + +re2c: warning: line 5: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] +re2c: warning: line 6: unreachable rule (shadowed by rule at line 5) [-Wunreachable-rules] diff --git a/re2c/test/posix_captures/other/25.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/25.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..837952c5 --- /dev/null +++ b/re2c/test/posix_captures/other/25.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (y|(x?)){1,3} + {} + "" {} +*/ diff --git a/re2c/test/posix_captures/other/26.i--flex-syntax--posix-closure(gtop).c b/re2c/test/posix_captures/other/26.i--flex-syntax--posix-closure(gtop).c new file mode 100644 index 00000000..8659cbf3 --- /dev/null +++ b/re2c/test/posix_captures/other/26.i--flex-syntax--posix-closure(gtop).c @@ -0,0 +1,76 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 6) YYFILL(6); + yych = *(YYMARKER = YYCURSOR); + switch (yych) { + case 'y': + yyt1 = YYCURSOR; + goto yy3; + default: goto yy2; + } +yy2: + yynmatch = 1; + yypmatch[0] = YYCURSOR; + yypmatch[1] = YYCURSOR; + {} +yy3: + yych = *++YYCURSOR; + switch (yych) { + case 'y': goto yy5; + default: goto yy4; + } +yy4: + YYCURSOR = YYMARKER; + goto yy2; +yy5: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt2 = YYCURSOR; + goto yy6; + default: goto yy4; + } +yy6: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt2 = YYCURSOR; + goto yy8; + default: + yyt3 = YYCURSOR; + goto yy7; + } +yy7: + yynmatch = 2; + yypmatch[0] = yyt1; + yypmatch[2] = yyt2; + yypmatch[3] = yyt3; + yypmatch[1] = YYCURSOR; + {} +yy8: + yych = *++YYCURSOR; + switch (yych) { + case 'y': + yyt2 = YYCURSOR; + goto yy9; + default: + yyt3 = YYCURSOR; + goto yy7; + } +yy9: + yych = *++YYCURSOR; + switch (yych) { + case 'y': goto yy10; + default: + yyt3 = YYCURSOR; + goto yy7; + } +yy10: + ++YYCURSOR; + yyt3 = YYCURSOR; + goto yy7; +} + +re2c: warning: line 6: rule matches empty string [-Wmatch-empty-string] diff --git a/re2c/test/posix_captures/other/26.i--flex-syntax--posix-closure(gtop).re b/re2c/test/posix_captures/other/26.i--flex-syntax--posix-closure(gtop).re new file mode 100644 index 00000000..800b2422 --- /dev/null +++ b/re2c/test/posix_captures/other/26.i--flex-syntax--posix-closure(gtop).re @@ -0,0 +1,7 @@ +/*!re2c + re2c:flags:posix-captures = 1; + + (y[y]?){3} + {} + "" {} +*/