From: Ulya Trofimovich Date: Thu, 3 Jan 2019 22:37:54 +0000 (+0000) Subject: Added tests for debug options. X-Git-Tag: 1.2~245 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a323015b1c781611107b615e36f2f43b7af04f80;p=re2c Added tests for debug options. --- diff --git a/re2c/src/debug/dump_adfa.cc b/re2c/src/debug/dump_adfa.cc index fb3d1e24..1ceab69a 100644 --- a/re2c/src/debug/dump_adfa.cc +++ b/re2c/src/debug/dump_adfa.cc @@ -1,6 +1,7 @@ #ifdef RE2C_DEBUG #include "src/util/c99_stdint.h" +#include #include #include #include @@ -28,6 +29,12 @@ static void dump_adfa_range(uint32_t lower, uint32_t upper) void dump_adfa(const DFA &dfa) { + std::map st2idx; + uint32_t idx = 0; + for (const State *s = dfa.head; s; s = s->next) { + st2idx[s] = idx++; + } + fprintf(stderr, "digraph DFA {\n" " rankdir=LR\n" @@ -36,7 +43,7 @@ void dump_adfa(const DFA &dfa) fprintf(stderr, " n [shape=point]" - " n -> n%p [style=dotted label=\"", (void*)dfa.head); + " n -> n%u [style=dotted label=\"", st2idx[dfa.head]); dump_tcmd(dfa.tcpool[dfa.tags0]); fprintf(stderr, "\"]\n"); @@ -51,7 +58,7 @@ void dump_adfa(const DFA &dfa) } else { attr = ""; } - fprintf(stderr, " n%p [height=0.2 width=0.2 label=\"", (void*)s); + fprintf(stderr, " n%u [height=0.2 width=0.2 label=\"", st2idx[s]); if (s->fill && action != Action::MOVE) { fprintf(stderr, "F(%u) ", (uint32_t)s->fill); } @@ -70,8 +77,8 @@ void dump_adfa(const DFA &dfa) if (action == Action::ACCEPT) { const accept_t &accept = *s->action.info.accepts; for (uint32_t i = 0; i < accept.size(); ++i) { - fprintf(stderr, " n%p -> n%p [label=\"", - (void*)s, (void*)accept[i].first); + fprintf(stderr, " n%u -> n%u [label=\"", st2idx[s], + st2idx[accept[i].first]); dump_tcmd(dfa.tcpool[accept[i].second]); fprintf(stderr, "\" style=dotted]\n"); } @@ -89,7 +96,7 @@ void dump_adfa(const DFA &dfa) } else { attr = ""; } - fprintf(stderr, " n%p -> n%p [label=\"", (void*)s, (void*)x->to); + fprintf(stderr, " n%u -> n%u [label=\"", st2idx[s], st2idx[x->to]); if (eat) dump_adfa_range(lb, x->ub); dump_tcmd(dfa.tcpool[x->tags]); fprintf(stderr, "\" %s]\n", attr); diff --git a/re2c/test/debug/adfa.i--posix-captures--dump-adfa.c b/re2c/test/debug/adfa.i--posix-captures--dump-adfa.c new file mode 100644 index 00000000..1b0107bc --- /dev/null +++ b/re2c/test/debug/adfa.i--posix-captures--dump-adfa.c @@ -0,0 +1,55 @@ +/* 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': + yyt2 = YYCURSOR; + goto yy3; + default: + yyt3 = YYCURSOR; + goto yy2; + } +} + +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] +digraph DFA { + rankdir=LR + node[shape=Mrecord fontname=fixed] + edge[arrowhead=vee fontname=fixed] + + n [shape=point] n -> n0 [style=dotted label=""] + n0 [height=0.2 width=0.2 label="F(1) " ] + n0 -> n1 [label="/1↑ 2↓ 3↓ " style=dotted] + n0 -> n2 [label="97/1↑ 2↑ " ] + n0 -> n1 [label="/1↑ 2↓ 3↓ " style=dotted] + n1 [height=0.2 width=0.2 label="/(1) /(0) /(2) /(3)" style=filled fillcolor=lightgray] + n2 [height=0.2 width=0.2 label="F(1) " ] + n2 -> n3 [label="" style=dotted] + n3 [height=0.2 width=0.2 label="" ] + n3 -> n1 [label="/3↑ " style=dotted] + n3 -> n2 [label="97/2↑ " ] + n3 -> n1 [label="/3↑ " style=dotted] +} diff --git a/re2c/test/debug/adfa.i--posix-captures--dump-adfa.re b/re2c/test/debug/adfa.i--posix-captures--dump-adfa.re new file mode 100644 index 00000000..3621b9b7 --- /dev/null +++ b/re2c/test/debug/adfa.i--posix-captures--dump-adfa.re @@ -0,0 +1,3 @@ +/*!re2c + ("a")* {} +*/ diff --git a/re2c/test/debug/cfg.i--posix-captures--dump-cfg.c b/re2c/test/debug/cfg.i--posix-captures--dump-cfg.c new file mode 100644 index 00000000..fec75006 --- /dev/null +++ b/re2c/test/debug/cfg.i--posix-captures--dump-cfg.c @@ -0,0 +1,71 @@ +/* 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': + yyt2 = YYCURSOR; + goto yy3; + default: + yyt3 = YYCURSOR; + goto yy2; + } +} + +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] +digraph CFG { + rankdir=LR + node[shape=Mrecord fontname=Terminus height=0.2 width=0.2] + edge[arrowhead=vee fontname=Terminus] + + n0 [label="0\n/\nneed:"] + n0 -> n1 [style=solid] + n0 -> n3 [style=solid] + n1 [label="1\n5↑ 4↑ /\nneed: 4 5"] + n1 -> n2 [style=solid] + n1 -> n4 [style=solid] + n2 [label="2\n5↑ /\nneed: 4 5"] + n2 -> n2 [style=solid] + n2 -> n4 [style=solid] + n3 [label="3\n3↓ 2↓ 1↑ /1 2 3 \nneed: 1 2 3"] + n4 [label="4\n2=5 1=4 3↑ /1 2 3 \nneed: 1 2 3"] +} +digraph CFG { + rankdir=LR + node[shape=Mrecord fontname=Terminus height=0.2 width=0.2] + edge[arrowhead=vee fontname=Terminus] + + n0 [label="0\n/\nneed:"] + n0 -> n1 [style=solid] + n0 -> n3 [style=solid] + n1 [label="1\n1↑ 2↑ /\nneed: 1 2"] + n1 -> n2 [style=solid] + n1 -> n4 [style=solid] + n2 [label="2\n2↑ /\nneed: 1 2"] + n2 -> n2 [style=solid] + n2 -> n4 [style=solid] + n3 [label="3\n1↑ 2↓ 3↓ /1 2 3 \nneed: 1 2 3"] + n4 [label="4\n3↑ /1 2 3 \nneed: 1 2 3"] +} diff --git a/re2c/test/debug/cfg.i--posix-captures--dump-cfg.re b/re2c/test/debug/cfg.i--posix-captures--dump-cfg.re new file mode 100644 index 00000000..3621b9b7 --- /dev/null +++ b/re2c/test/debug/cfg.i--posix-captures--dump-cfg.re @@ -0,0 +1,3 @@ +/*!re2c + ("a")* {} +*/ diff --git a/re2c/test/posix_captures/debug/clstats01.i--posix-captures--posix-closure(gor1)--dump-closure-stats.c b/re2c/test/debug/closure_stats.i--posix-captures--posix-closure(gor1)--dump-closure-stats.c similarity index 100% rename from re2c/test/posix_captures/debug/clstats01.i--posix-captures--posix-closure(gor1)--dump-closure-stats.c rename to re2c/test/debug/closure_stats.i--posix-captures--posix-closure(gor1)--dump-closure-stats.c diff --git a/re2c/test/posix_captures/debug/clstats01.i--posix-captures--posix-closure(gor1)--dump-closure-stats.re b/re2c/test/debug/closure_stats.i--posix-captures--posix-closure(gor1)--dump-closure-stats.re similarity index 100% rename from re2c/test/posix_captures/debug/clstats01.i--posix-captures--posix-closure(gor1)--dump-closure-stats.re rename to re2c/test/debug/closure_stats.i--posix-captures--posix-closure(gor1)--dump-closure-stats.re diff --git a/re2c/test/posix_captures/debug/clstats01.i--posix-captures--posix-closure(gtop)--dump-closure-stats.c b/re2c/test/debug/closure_stats.i--posix-captures--posix-closure(gtop)--dump-closure-stats.c similarity index 100% rename from re2c/test/posix_captures/debug/clstats01.i--posix-captures--posix-closure(gtop)--dump-closure-stats.c rename to re2c/test/debug/closure_stats.i--posix-captures--posix-closure(gtop)--dump-closure-stats.c diff --git a/re2c/test/posix_captures/debug/clstats01.i--posix-captures--posix-closure(gtop)--dump-closure-stats.re b/re2c/test/debug/closure_stats.i--posix-captures--posix-closure(gtop)--dump-closure-stats.re similarity index 100% rename from re2c/test/posix_captures/debug/clstats01.i--posix-captures--posix-closure(gtop)--dump-closure-stats.re rename to re2c/test/debug/closure_stats.i--posix-captures--posix-closure(gtop)--dump-closure-stats.re diff --git a/re2c/test/debug/dfa_det.i--posix-captures--dump-dfa-det.c b/re2c/test/debug/dfa_det.i--posix-captures--dump-dfa-det.c new file mode 100644 index 00000000..7d416376 --- /dev/null +++ b/re2c/test/debug/dfa_det.i--posix-captures--dump-dfa-det.c @@ -0,0 +1,50 @@ +/* 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': + yyt2 = YYCURSOR; + goto yy3; + default: + yyt3 = YYCURSOR; + goto yy2; + } +} + +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] +digraph DFA { + rankdir=LR + node[shape=Mrecord fontname=Courier] + edge[arrowhead=vee fontname=Courier] + + n [shape=point] n -> n0 [style=dotted label=""] + n0 [height=0.2 width=0.2 label="0"] +subgraph { rank=same n0 [style=filled fillcolor=lightgray] dr0 [shape=none label="/7↓ 6↓ 5↑ (5 0 6 7)"] n0:s -> dr0:n [style=dotted minlen=0]} + n0 -> n1 [label="1/9↑ 8↑ "] + n1 [height=0.2 width=0.2 label="1"] +subgraph { rank=same n1 [style=filled fillcolor=lightgray] dr1 [shape=none label="/6=9 5=8 7↑ (5 0 6 7)"] n1:s -> dr1:n [style=dotted minlen=0]} + n1 -> n1 [label="1/9↑ "] +} diff --git a/re2c/test/debug/dfa_det.i--posix-captures--dump-dfa-det.re b/re2c/test/debug/dfa_det.i--posix-captures--dump-dfa-det.re new file mode 100644 index 00000000..3621b9b7 --- /dev/null +++ b/re2c/test/debug/dfa_det.i--posix-captures--dump-dfa-det.re @@ -0,0 +1,3 @@ +/*!re2c + ("a")* {} +*/ diff --git a/re2c/test/debug/dfa_min.i--posix-captures--dump-dfa-min.c b/re2c/test/debug/dfa_min.i--posix-captures--dump-dfa-min.c new file mode 100644 index 00000000..5aee3901 --- /dev/null +++ b/re2c/test/debug/dfa_min.i--posix-captures--dump-dfa-min.c @@ -0,0 +1,50 @@ +/* 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': + yyt2 = YYCURSOR; + goto yy3; + default: + yyt3 = YYCURSOR; + goto yy2; + } +} + +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] +digraph DFA { + rankdir=LR + node[shape=Mrecord fontname=Courier] + edge[arrowhead=vee fontname=Courier] + + n [shape=point] n -> n0 [style=dotted label=""] + n0 [height=0.2 width=0.2 label="0"] +subgraph { rank=same n0 [style=filled fillcolor=lightgray] dr0 [shape=none label="/1↑ 2↓ 3↓ (1 0 2 3)"] n0:s -> dr0:n [style=dotted minlen=0]} + n0 -> n1 [label="1/1↑ 2↑ "] + n1 [height=0.2 width=0.2 label="1"] +subgraph { rank=same n1 [style=filled fillcolor=lightgray] dr1 [shape=none label="/3↑ (1 0 2 3)"] n1:s -> dr1:n [style=dotted minlen=0]} + n1 -> n1 [label="1/2↑ "] +} diff --git a/re2c/test/debug/dfa_min.i--posix-captures--dump-dfa-min.re b/re2c/test/debug/dfa_min.i--posix-captures--dump-dfa-min.re new file mode 100644 index 00000000..3621b9b7 --- /dev/null +++ b/re2c/test/debug/dfa_min.i--posix-captures--dump-dfa-min.re @@ -0,0 +1,3 @@ +/*!re2c + ("a")* {} +*/ diff --git a/re2c/test/debug/dfa_raw.i--posix-captures--dump-dfa-raw.c b/re2c/test/debug/dfa_raw.i--posix-captures--dump-dfa-raw.c new file mode 100644 index 00000000..34c656c4 --- /dev/null +++ b/re2c/test/debug/dfa_raw.i--posix-captures--dump-dfa-raw.c @@ -0,0 +1,61 @@ +/* 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': + yyt2 = YYCURSOR; + goto yy3; + default: + yyt3 = YYCURSOR; + goto yy2; + } +} + +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] +digraph DFA { + rankdir=LR + node[shape=plaintext fontname=Courier] + edge[arrowhead=vee fontname=Courier] + + 0 [label=<
0 1 2 3 4 /0↑ 2↓ 3↓ 1↑
4 1 2 3 4 /0↑ 2↑
>] + void [shape=point] + void -> 0:0:w [style=dotted label=""] + void -> 0:1:w [style=dotted label=""] + r0 [shape=none label="(5 0 6 7)"] + 0:0:e -> r0 [style=dotted label="/7↓ 6↓ 5↑ "] + 1 [label=<
0 8 2 9 4 /3↑ 1↑
4 8 2 9 4 /3↑ 2↑
>] + 0:1:e -> 1:0:w [label="1/8 9↑ "] + 0:1:e -> 1:1:w [label="1/8 9↑ "] + r1 [shape=none label="(5 0 6 7)"] + 1:1:e -> r1 [style=dotted label="/6=9 5=8 7↑ "] + i1 [label=<
0 8 2 10 11 /3↑ 1↑
4 8 2 10 11 /3↑ 2↑
>] + i1 [style=dotted] + i1:s -> 1:s [style=dotted label="/9↑ "] + 1:1:e -> i1:0:w [label="1/10↑ 11↑ "] + 1:1:e -> i1:1:w [label="1/10↑ 11↑ "] + r1 [shape=none label="(5 0 6 7)"] + 1:1:e -> r1 [style=dotted label="/6=9 5=8 7↑ "] +} diff --git a/re2c/test/debug/dfa_raw.i--posix-captures--dump-dfa-raw.re b/re2c/test/debug/dfa_raw.i--posix-captures--dump-dfa-raw.re new file mode 100644 index 00000000..3621b9b7 --- /dev/null +++ b/re2c/test/debug/dfa_raw.i--posix-captures--dump-dfa-raw.re @@ -0,0 +1,3 @@ +/*!re2c + ("a")* {} +*/ diff --git a/re2c/test/debug/dfa_tagopt.i--posix-captures--dump-dfa-tagopt.c b/re2c/test/debug/dfa_tagopt.i--posix-captures--dump-dfa-tagopt.c new file mode 100644 index 00000000..5aee3901 --- /dev/null +++ b/re2c/test/debug/dfa_tagopt.i--posix-captures--dump-dfa-tagopt.c @@ -0,0 +1,50 @@ +/* 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': + yyt2 = YYCURSOR; + goto yy3; + default: + yyt3 = YYCURSOR; + goto yy2; + } +} + +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] +digraph DFA { + rankdir=LR + node[shape=Mrecord fontname=Courier] + edge[arrowhead=vee fontname=Courier] + + n [shape=point] n -> n0 [style=dotted label=""] + n0 [height=0.2 width=0.2 label="0"] +subgraph { rank=same n0 [style=filled fillcolor=lightgray] dr0 [shape=none label="/1↑ 2↓ 3↓ (1 0 2 3)"] n0:s -> dr0:n [style=dotted minlen=0]} + n0 -> n1 [label="1/1↑ 2↑ "] + n1 [height=0.2 width=0.2 label="1"] +subgraph { rank=same n1 [style=filled fillcolor=lightgray] dr1 [shape=none label="/3↑ (1 0 2 3)"] n1:s -> dr1:n [style=dotted minlen=0]} + n1 -> n1 [label="1/2↑ "] +} diff --git a/re2c/test/debug/dfa_tagopt.i--posix-captures--dump-dfa-tagopt.re b/re2c/test/debug/dfa_tagopt.i--posix-captures--dump-dfa-tagopt.re new file mode 100644 index 00000000..3621b9b7 --- /dev/null +++ b/re2c/test/debug/dfa_tagopt.i--posix-captures--dump-dfa-tagopt.re @@ -0,0 +1,3 @@ +/*!re2c + ("a")* {} +*/ diff --git a/re2c/test/debug/interf.i--posix-captures--dump-interf.c b/re2c/test/debug/interf.i--posix-captures--dump-interf.c new file mode 100644 index 00000000..97135a36 --- /dev/null +++ b/re2c/test/debug/interf.i--posix-captures--dump-interf.c @@ -0,0 +1,52 @@ +/* Generated by re2c */ + +{ + YYCTYPE yych; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + switch (yych) { + case 'a': + yyt1 = YYCURSOR; + goto yy4; + case 'b': + yyt1 = yyt2 = NULL; + yyt3 = YYCURSOR; + goto yy6; + default: goto yy2; + } +yy2: + ++YYCURSOR; + {} +yy4: + ++YYCURSOR; + yyt3 = yyt4 = NULL; + yyt2 = YYCURSOR; +yy5: + yynmatch = 3; + yypmatch[2] = yyt1; + yypmatch[3] = yyt2; + yypmatch[4] = yyt3; + yypmatch[5] = yyt4; + yypmatch[0] = YYCURSOR - 1; + yypmatch[1] = YYCURSOR; + {} +yy6: + ++YYCURSOR; + yyt4 = YYCURSOR; + goto yy5; +} + + 1 2 3 4 5 6 7 8 + * * * * . . . . + * * * * . * . . + * * * * . * * . + * * * * . . . . + . . . . * . . . + . * * . . * . * + . . * . . . * * + . . . . . * * * + 1 2 3 4 + * * * * + * * * * + * * * * + * * * * diff --git a/re2c/test/debug/interf.i--posix-captures--dump-interf.re b/re2c/test/debug/interf.i--posix-captures--dump-interf.re new file mode 100644 index 00000000..89da1591 --- /dev/null +++ b/re2c/test/debug/interf.i--posix-captures--dump-interf.re @@ -0,0 +1,4 @@ +/*!re2c + ("a")|("b") {} + * {} +*/ diff --git a/re2c/test/debug/nfa.i--posix-captures--dump-nfa.c b/re2c/test/debug/nfa.i--posix-captures--dump-nfa.c new file mode 100644 index 00000000..15af40bb --- /dev/null +++ b/re2c/test/debug/nfa.i--posix-captures--dump-nfa.c @@ -0,0 +1,64 @@ +/* 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': + yyt2 = YYCURSOR; + goto yy3; + default: + yyt3 = YYCURSOR; + goto yy2; + } +} + +re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] +digraph NFA { + rankdir=LR + node[shape=Mrecord fontname=Courier height=0.2 width=0.2] + edge[arrowhead=vee fontname=Courier label=" "] + + n9 [label="9(1)"] + n9 -> n8 [label="/0↑(1)"] + n8 [label="8(1)"] + n8 -> n5 + n8 -> n7 [color=lightgray] + n7 [label="7(1)"] + n7 -> n6 [label="/2↓(2)"] + n6 [label="6(1)"] + n6 -> n1 [label="/3↓(1)"] + n5 [label="5(2)"] + n5 -> n4 [label="/2↑(2)"] + n4 [label="4(1)"] + n4 -> n3 [label="97"] + n3 [label="3(1)"] + n3 -> n2 [label="/3↑(1)"] + n2 [label="2(1)"] + n2 -> n5 + n2 -> n1 [color=lightgray] + n1 [label="1(2)"] + n1 -> n0 [label="/1↑(0)"] + n0 [label="0(1)"] [fillcolor=gray] +} diff --git a/re2c/test/debug/nfa.i--posix-captures--dump-nfa.re b/re2c/test/debug/nfa.i--posix-captures--dump-nfa.re new file mode 100644 index 00000000..3621b9b7 --- /dev/null +++ b/re2c/test/debug/nfa.i--posix-captures--dump-nfa.re @@ -0,0 +1,3 @@ +/*!re2c + ("a")* {} +*/