]> granicus.if.org Git - re2c/commitdiff
Added tests for debug options.
authorUlya Trofimovich <skvadrik@gmail.com>
Thu, 3 Jan 2019 22:37:54 +0000 (22:37 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Thu, 3 Jan 2019 22:37:54 +0000 (22:37 +0000)
21 files changed:
re2c/src/debug/dump_adfa.cc
re2c/test/debug/adfa.i--posix-captures--dump-adfa.c [new file with mode: 0644]
re2c/test/debug/adfa.i--posix-captures--dump-adfa.re [new file with mode: 0644]
re2c/test/debug/cfg.i--posix-captures--dump-cfg.c [new file with mode: 0644]
re2c/test/debug/cfg.i--posix-captures--dump-cfg.re [new file with mode: 0644]
re2c/test/debug/closure_stats.i--posix-captures--posix-closure(gor1)--dump-closure-stats.c [moved from re2c/test/posix_captures/debug/clstats01.i--posix-captures--posix-closure(gor1)--dump-closure-stats.c with 100% similarity]
re2c/test/debug/closure_stats.i--posix-captures--posix-closure(gor1)--dump-closure-stats.re [moved from re2c/test/posix_captures/debug/clstats01.i--posix-captures--posix-closure(gor1)--dump-closure-stats.re with 100% similarity]
re2c/test/debug/closure_stats.i--posix-captures--posix-closure(gtop)--dump-closure-stats.c [moved from re2c/test/posix_captures/debug/clstats01.i--posix-captures--posix-closure(gtop)--dump-closure-stats.c with 100% similarity]
re2c/test/debug/closure_stats.i--posix-captures--posix-closure(gtop)--dump-closure-stats.re [moved from re2c/test/posix_captures/debug/clstats01.i--posix-captures--posix-closure(gtop)--dump-closure-stats.re with 100% similarity]
re2c/test/debug/dfa_det.i--posix-captures--dump-dfa-det.c [new file with mode: 0644]
re2c/test/debug/dfa_det.i--posix-captures--dump-dfa-det.re [new file with mode: 0644]
re2c/test/debug/dfa_min.i--posix-captures--dump-dfa-min.c [new file with mode: 0644]
re2c/test/debug/dfa_min.i--posix-captures--dump-dfa-min.re [new file with mode: 0644]
re2c/test/debug/dfa_raw.i--posix-captures--dump-dfa-raw.c [new file with mode: 0644]
re2c/test/debug/dfa_raw.i--posix-captures--dump-dfa-raw.re [new file with mode: 0644]
re2c/test/debug/dfa_tagopt.i--posix-captures--dump-dfa-tagopt.c [new file with mode: 0644]
re2c/test/debug/dfa_tagopt.i--posix-captures--dump-dfa-tagopt.re [new file with mode: 0644]
re2c/test/debug/interf.i--posix-captures--dump-interf.c [new file with mode: 0644]
re2c/test/debug/interf.i--posix-captures--dump-interf.re [new file with mode: 0644]
re2c/test/debug/nfa.i--posix-captures--dump-nfa.c [new file with mode: 0644]
re2c/test/debug/nfa.i--posix-captures--dump-nfa.re [new file with mode: 0644]

index fb3d1e24044973a378180e763b6cb3e4d64d9ddc..1ceab69a4ef59163701746c4a2d6989e13e78021 100644 (file)
@@ -1,6 +1,7 @@
 #ifdef RE2C_DEBUG
 
 #include "src/util/c99_stdint.h"
+#include <map>
 #include <stdio.h>
 #include <string>
 #include <utility>
@@ -28,6 +29,12 @@ static void dump_adfa_range(uint32_t lower, uint32_t upper)
 
 void dump_adfa(const DFA &dfa)
 {
+    std::map<const State*, uint32_t> 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 (file)
index 0000000..1b0107b
--- /dev/null
@@ -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&uarr; 2&darr; 3&darr; " style=dotted]
+  n0 -> n2 [label="97/1&uarr; 2&uarr; " ]
+  n0 -> n1 [label="/1&uarr; 2&darr; 3&darr; " 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&uarr; " style=dotted]
+  n3 -> n2 [label="97/2&uarr; " ]
+  n3 -> n1 [label="/3&uarr; " 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 (file)
index 0000000..3621b9b
--- /dev/null
@@ -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 (file)
index 0000000..fec7500
--- /dev/null
@@ -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&uarr; 4&uarr; /\nneed: 4 5"]
+  n1 -> n2 [style=solid]
+  n1 -> n4 [style=solid]
+  n2 [label="2\n5&uarr; /\nneed: 4 5"]
+  n2 -> n2 [style=solid]
+  n2 -> n4 [style=solid]
+  n3 [label="3\n3&darr; 2&darr; 1&uarr; /1 2 3 \nneed: 1 2 3"]
+  n4 [label="4\n2=5 1=4 3&uarr; /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&uarr; 2&uarr; /\nneed: 1 2"]
+  n1 -> n2 [style=solid]
+  n1 -> n4 [style=solid]
+  n2 [label="2\n2&uarr; /\nneed: 1 2"]
+  n2 -> n2 [style=solid]
+  n2 -> n4 [style=solid]
+  n3 [label="3\n1&uarr; 2&darr; 3&darr; /1 2 3 \nneed: 1 2 3"]
+  n4 [label="4\n3&uarr; /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 (file)
index 0000000..3621b9b
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    ("a")* {}
+*/
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 (file)
index 0000000..7d41637
--- /dev/null
@@ -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&darr; 6&darr; 5&uarr; (5 0 6 7)"] n0:s -> dr0:n [style=dotted minlen=0]}
+  n0 -> n1 [label="1/9&uarr; 8&uarr; "]
+  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&uarr; (5 0 6 7)"] n1:s -> dr1:n [style=dotted minlen=0]}
+  n1 -> n1 [label="1/9&uarr; "]
+}
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 (file)
index 0000000..3621b9b
--- /dev/null
@@ -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 (file)
index 0000000..5aee390
--- /dev/null
@@ -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&uarr; 2&darr; 3&darr; (1 0 2 3)"] n0:s -> dr0:n [style=dotted minlen=0]}
+  n0 -> n1 [label="1/1&uarr; 2&uarr; "]
+  n1 [height=0.2 width=0.2 label="1"]
+subgraph { rank=same n1 [style=filled fillcolor=lightgray] dr1 [shape=none label="/3&uarr; (1 0 2 3)"] n1:s -> dr1:n [style=dotted minlen=0]}
+  n1 -> n1 [label="1/2&uarr; "]
+}
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 (file)
index 0000000..3621b9b
--- /dev/null
@@ -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 (file)
index 0000000..34c656c
--- /dev/null
@@ -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=<<TABLE BORDER="0" CELLBORDER="1"><TR><TD ALIGN="left" PORT="0">0 1 2 3 4 /0&uarr; 2&darr; 3&darr; 1&uarr; </TD></TR><TR><TD ALIGN="left" PORT="1">4 1 2 3 4 /0&uarr; 2&uarr; </TD></TR></TABLE>>]
+  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&darr; 6&darr; 5&uarr; "]
+  1 [label=<<TABLE BORDER="0" CELLBORDER="1"><TR><TD ALIGN="left" PORT="0">0 8 2 9 4 /3&uarr; 1&uarr; </TD></TR><TR><TD ALIGN="left" PORT="1">4 8 2 9 4 /3&uarr; 2&uarr; </TD></TR></TABLE>>]
+  0:1:e -> 1:0:w [label="1/8 9&uarr; "]
+  0:1:e -> 1:1:w [label="1/8 9&uarr; "]
+  r1 [shape=none label="(5 0 6 7)"]
+  1:1:e -> r1 [style=dotted label="/6=9 5=8 7&uarr; "]
+  i1 [label=<<TABLE BORDER="0" CELLBORDER="1"><TR><TD ALIGN="left" PORT="0" STYLE="dotted">0 8 2 10 11 /3&uarr; 1&uarr; </TD></TR><TR><TD ALIGN="left" PORT="1" STYLE="dotted">4 8 2 10 11 /3&uarr; 2&uarr; </TD></TR></TABLE>>]
+  i1 [style=dotted]
+  i1:s -> 1:s [style=dotted label="/9&uarr; "]
+  1:1:e -> i1:0:w [label="1/10&uarr; 11&uarr; "]
+  1:1:e -> i1:1:w [label="1/10&uarr; 11&uarr; "]
+  r1 [shape=none label="(5 0 6 7)"]
+  1:1:e -> r1 [style=dotted label="/6=9 5=8 7&uarr; "]
+}
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 (file)
index 0000000..3621b9b
--- /dev/null
@@ -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 (file)
index 0000000..5aee390
--- /dev/null
@@ -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&uarr; 2&darr; 3&darr; (1 0 2 3)"] n0:s -> dr0:n [style=dotted minlen=0]}
+  n0 -> n1 [label="1/1&uarr; 2&uarr; "]
+  n1 [height=0.2 width=0.2 label="1"]
+subgraph { rank=same n1 [style=filled fillcolor=lightgray] dr1 [shape=none label="/3&uarr; (1 0 2 3)"] n1:s -> dr1:n [style=dotted minlen=0]}
+  n1 -> n1 [label="1/2&uarr; "]
+}
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 (file)
index 0000000..3621b9b
--- /dev/null
@@ -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 (file)
index 0000000..97135a3
--- /dev/null
@@ -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 (file)
index 0000000..89da159
--- /dev/null
@@ -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 (file)
index 0000000..15af40b
--- /dev/null
@@ -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&uarr;(1)"]
+  n8 [label="8(1)"]
+  n8 -> n5
+  n8 -> n7 [color=lightgray]
+  n7 [label="7(1)"]
+  n7 -> n6 [label="/2&darr;(2)"]
+  n6 [label="6(1)"]
+  n6 -> n1 [label="/3&darr;(1)"]
+  n5 [label="5(2)"]
+  n5 -> n4 [label="/2&uarr;(2)"]
+  n4 [label="4(1)"]
+  n4 -> n3 [label="97"]
+  n3 [label="3(1)"]
+  n3 -> n2 [label="/3&uarr;(1)"]
+  n2 [label="2(1)"]
+  n2 -> n5
+  n2 -> n1 [color=lightgray]
+  n1 [label="1(2)"]
+  n1 -> n0 [label="/1&uarr;(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 (file)
index 0000000..3621b9b
--- /dev/null
@@ -0,0 +1,3 @@
+/*!re2c
+    ("a")* {}
+*/