From 6b2fe2895ba72576a71017b4096b0efa68ee52de Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Mon, 5 Dec 2016 17:32:41 +0000 Subject: [PATCH] Added debug option '--dump-dfa-raw'. It dumps DFA at the very early stage of construction, expanding underlying state kernels with NFA substates and correspondings sets of tag versions. --- re2c/bootstrap/src/conf/parse_opts.cc | 1050 +++++++++++++------------ re2c/src/conf/opt.cc | 1 + re2c/src/conf/opt.h | 1 + re2c/src/conf/parse_opts.re | 1 + re2c/src/ir/dfa/closure.cc | 3 +- re2c/src/ir/dfa/closure.h | 1 + re2c/src/ir/dfa/determinization.cc | 24 +- re2c/src/ir/dfa/dump.cc | 208 ++++- re2c/src/ir/dfa/dump.h | 22 + 9 files changed, 765 insertions(+), 546 deletions(-) diff --git a/re2c/bootstrap/src/conf/parse_opts.cc b/re2c/bootstrap/src/conf/parse_opts.cc index 8edc62bb..21877c61 100644 --- a/re2c/bootstrap/src/conf/parse_opts.cc +++ b/re2c/bootstrap/src/conf/parse_opts.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 0.16 on Sun Dec 4 14:30:33 2016 */ +/* Generated by re2c 0.16 on Mon Dec 5 17:26:15 2016 */ #line 1 "../src/conf/parse_opts.re" #include "src/codegen/input_api.h" #include "src/conf/msg.h" @@ -2025,169 +2025,168 @@ yy489: goto yy276; yy490: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 'l') { - if (yych == 'd') goto yy518; - goto yy276; - } else { - if (yych <= 'm') goto yy519; - if (yych == 't') goto yy520; - goto yy276; + switch (yych) { + case 'd': goto yy518; + case 'm': goto yy519; + case 'r': goto yy520; + case 't': goto yy521; + default: goto yy276; } yy491: ++YYCURSOR; #line 139 "../src/conf/parse_opts.re" { opts.set_target (opt_t::DOT); goto opt; } -#line 2041 "src/conf/parse_opts.cc" +#line 2040 "src/conf/parse_opts.cc" yy493: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy521; + if (yych == 's') goto yy522; goto yy276; yy494: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'p') goto yy522; + if (yych == 'p') goto yy523; goto yy276; yy495: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy523; + if (yych == 'a') goto yy524; goto yy276; yy496: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy524; + if (yych == 's') goto yy525; goto yy276; yy497: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy525; + if (yych == 'i') goto yy526; goto yy276; yy498: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy526; + if (yych == 't') goto yy527; goto yy276; yy499: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy527; + if (yych == 'n') goto yy528; goto yy276; yy500: ++YYCURSOR; #line 144 "../src/conf/parse_opts.re" { opts.set_rFlag (true); goto opt; } -#line 2074 "src/conf/parse_opts.cc" +#line 2073 "src/conf/parse_opts.cc" yy502: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy528; + if (yych == 's') goto yy529; goto yy276; yy503: ++YYCURSOR; #line 150 "../src/conf/parse_opts.re" { opts.set_target (opt_t::SKELETON); goto opt; } -#line 2083 "src/conf/parse_opts.cc" +#line 2082 "src/conf/parse_opts.cc" yy505: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'd') goto yy529; + if (yych == 'd') goto yy530; goto yy276; yy506: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy530; + if (yych == 's') goto yy531; goto yy276; yy507: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy531; + if (yych == 'e') goto yy532; goto yy276; yy508: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy532; + if (yych == 's') goto yy533; goto yy276; yy509: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy533; + if (yych == 's') goto yy534; goto yy276; yy510: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy534; + if (yych == 's') goto yy535; goto yy276; yy511: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy535; + if (yych == 't') goto yy536; goto yy276; yy512: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy536; + if (yych == 'o') goto yy537; goto yy276; yy513: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'u') goto yy537; + if (yych == 'u') goto yy538; goto yy276; yy514: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'g') goto yy538; + if (yych == 'g') goto yy539; goto yy276; yy515: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'z') goto yy539; + if (yych == 'z') goto yy540; goto yy276; yy516: ++YYCURSOR; -#line 169 "../src/conf/parse_opts.re" +#line 170 "../src/conf/parse_opts.re" { opts.set_dump_adfa(true); goto opt; } -#line 2132 "src/conf/parse_opts.cc" +#line 2131 "src/conf/parse_opts.cc" yy518: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy540; + if (yych == 'e') goto yy541; goto yy276; yy519: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy541; + if (yych == 'i') goto yy542; goto yy276; yy520: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy542; + if (yych == 'a') goto yy543; goto yy276; yy521: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy543; + if (yych == 'a') goto yy544; goto yy276; yy522: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy544; + if (yych == 's') goto yy545; goto yy276; yy523: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'x') goto yy545; + if (yych == 'o') goto yy546; goto yy276; yy524: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy546; + if (yych == 'x') goto yy547; goto yy276; yy525: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy548; + if (yych <= 0x00) goto yy548; goto yy276; yy526: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy549; + if (yych == 'n') goto yy550; goto yy276; yy527: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy550; + if (yych == 'i') goto yy551; goto yy276; yy528: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy552; + if (yych <= 0x00) goto yy552; goto yy276; yy529: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy553; + if (yych == 's') goto yy554; goto yy276; yy530: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy554; + if (yych == 'i') goto yy555; goto yy276; yy531: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy555; + if (yych == 't') goto yy556; goto yy276; yy532: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy556; + if (yych == 'r') goto yy557; goto yy276; yy533: yych = (YYCTYPE)*++YYCURSOR; @@ -2195,363 +2194,380 @@ yy533: goto yy276; yy534: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy560; + if (yych <= 0x00) goto yy560; goto yy276; yy535: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy561; + if (yych == 'i') goto yy562; goto yy276; yy536: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy562; + if (yych == 'e') goto yy563; goto yy276; yy537: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy563; + if (yych == 't') goto yy564; goto yy276; yy538: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy564; + if (yych == 't') goto yy565; goto yy276; yy539: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy566; + if (yych <= 0x00) goto yy566; goto yy276; yy540: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy567; + if (yych == 'a') goto yy568; goto yy276; yy541: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy568; + if (yych == 't') goto yy569; goto yy276; yy542: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'g') goto yy569; + if (yych == 'n') goto yy570; goto yy276; yy543: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy570; + if (yych == 'w') goto yy571; goto yy276; yy544: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'l') goto yy572; + if (yych == 'g') goto yy572; goto yy276; yy545: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy573; goto yy276; yy546: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'l') goto yy575; + goto yy276; +yy547: + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 0x00) goto yy576; + goto yy276; +yy548: ++YYCURSOR; #line 145 "../src/conf/parse_opts.re" { opts.set_sFlag (true); goto opt; } -#line 2249 "src/conf/parse_opts.cc" -yy548: +#line 2256 "src/conf/parse_opts.cc" +yy550: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'f') goto yy575; + if (yych == 'f') goto yy578; goto yy276; -yy549: +yy551: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy576; + if (yych == 'o') goto yy579; goto yy276; -yy550: +yy552: ++YYCURSOR; #line 147 "../src/conf/parse_opts.re" { opts.set_version (false); goto opt; } -#line 2262 "src/conf/parse_opts.cc" -yy552: +#line 2269 "src/conf/parse_opts.cc" +yy554: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy577; + if (yych <= 0x00) goto yy580; goto yy276; -yy553: +yy555: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy579; + if (yych == 't') goto yy582; goto yy276; -yy554: +yy556: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy580; + if (yych == 'a') goto yy583; goto yy276; -yy555: +yy557: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy581; + if (yych <= 0x00) goto yy584; goto yy276; -yy556: +yy558: ++YYCURSOR; #line 154 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UCS2)) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 2283 "src/conf/parse_opts.cc" -yy558: +#line 2290 "src/conf/parse_opts.cc" +yy560: ++YYCURSOR; #line 136 "../src/conf/parse_opts.re" { opts.set_bFlag (true); goto opt; } -#line 2288 "src/conf/parse_opts.cc" -yy560: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy583; - goto yy276; -yy561: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'd') goto yy584; - goto yy276; +#line 2295 "src/conf/parse_opts.cc" yy562: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy585; + if (yych == 't') goto yy586; goto yy276; yy563: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy586; + if (yych == 'd') goto yy587; goto yy276; yy564: - ++YYCURSOR; -#line 163 "../src/conf/parse_opts.re" - { goto opt_dfa_mapping; } -#line 2309 "src/conf/parse_opts.cc" -yy566: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy588; + if (yych == 'o') goto yy588; goto yy276; -yy567: +yy565: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy589; goto yy276; +yy566: + ++YYCURSOR; +#line 163 "../src/conf/parse_opts.re" + { goto opt_dfa_mapping; } +#line 2316 "src/conf/parse_opts.cc" yy568: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy591; + if (yych == 't') goto yy591; goto yy276; yy569: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy593; + if (yych <= 0x00) goto yy592; goto yy276; yy570: + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 0x00) goto yy594; + goto yy276; +yy571: + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 0x00) goto yy596; + goto yy276; +yy572: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'o') goto yy598; + goto yy276; +yy573: ++YYCURSOR; #line 161 "../src/conf/parse_opts.re" { goto opt_empty_class; } -#line 2330 "src/conf/parse_opts.cc" -yy572: +#line 2341 "src/conf/parse_opts.cc" +yy575: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy594; + if (yych == 'i') goto yy599; goto yy276; -yy573: +yy576: ++YYCURSOR; #line 141 "../src/conf/parse_opts.re" { opts.set_FFlag (true); goto opt; } -#line 2339 "src/conf/parse_opts.cc" -yy575: +#line 2350 "src/conf/parse_opts.cc" +yy578: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy595; + if (yych == 'o') goto yy600; goto yy276; -yy576: +yy579: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy596; + if (yych == 'n') goto yy601; goto yy276; -yy577: +yy580: ++YYCURSOR; #line 164 "../src/conf/parse_opts.re" { goto opt; } -#line 2352 "src/conf/parse_opts.cc" -yy579: +#line 2363 "src/conf/parse_opts.cc" +yy582: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy597; + if (yych == 'i') goto yy602; goto yy276; -yy580: +yy583: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy598; + if (yych == 't') goto yy603; goto yy276; -yy581: +yy584: ++YYCURSOR; #line 158 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-t, --type-header"); return EXIT_FAIL; } goto opt_header; } -#line 2365 "src/conf/parse_opts.cc" -yy583: +#line 2376 "src/conf/parse_opts.cc" +yy586: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy599; + if (yych == 'i') goto yy604; goto yy276; -yy584: +yy587: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy600; + if (yych <= 0x00) goto yy605; goto yy276; -yy585: +yy588: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy602; + if (yych == 's') goto yy607; goto yy276; -yy586: +yy589: ++YYCURSOR; #line 138 "../src/conf/parse_opts.re" { opts.set_dFlag (true); goto opt; } -#line 2382 "src/conf/parse_opts.cc" -yy588: +#line 2393 "src/conf/parse_opts.cc" +yy591: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy603; + if (yych == 'i') goto yy608; goto yy276; -yy589: +yy592: ++YYCURSOR; -#line 166 "../src/conf/parse_opts.re" +#line 167 "../src/conf/parse_opts.re" { opts.set_dump_dfa_det(true); goto opt; } -#line 2391 "src/conf/parse_opts.cc" -yy591: +#line 2402 "src/conf/parse_opts.cc" +yy594: ++YYCURSOR; -#line 168 "../src/conf/parse_opts.re" +#line 169 "../src/conf/parse_opts.re" { opts.set_dump_dfa_min(true); goto opt; } -#line 2396 "src/conf/parse_opts.cc" -yy593: +#line 2407 "src/conf/parse_opts.cc" +yy596: + ++YYCURSOR; +#line 166 "../src/conf/parse_opts.re" + { opts.set_dump_dfa_raw(true); goto opt; } +#line 2412 "src/conf/parse_opts.cc" +yy598: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'p') goto yy604; + if (yych == 'p') goto yy609; goto yy276; -yy594: +yy599: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy605; + if (yych == 'c') goto yy610; goto yy276; -yy595: +yy600: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy606; + if (yych <= 0x00) goto yy611; goto yy276; -yy596: +yy601: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '-') goto yy608; + if (yych == '-') goto yy613; goto yy276; -yy597: +yy602: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy609; + if (yych == 'o') goto yy614; goto yy276; -yy598: +yy603: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy610; + if (yych == 'e') goto yy615; goto yy276; -yy599: +yy604: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'v') goto yy611; + if (yych == 'v') goto yy616; goto yy276; -yy600: +yy605: ++YYCURSOR; #line 149 "../src/conf/parse_opts.re" { opts.set_bCaseInverted (true); goto opt; } -#line 2429 "src/conf/parse_opts.cc" -yy602: +#line 2445 "src/conf/parse_opts.cc" +yy607: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy612; + if (yych <= 0x00) goto yy617; goto yy276; -yy603: +yy608: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy614; + if (yych == 'o') goto yy619; goto yy276; -yy604: +yy609: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy615; + if (yych == 't') goto yy620; goto yy276; -yy605: +yy610: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'y') goto yy616; + if (yych == 'y') goto yy621; goto yy276; -yy606: +yy611: ++YYCURSOR; #line 143 "../src/conf/parse_opts.re" { opts.set_iFlag (true); goto opt; } -#line 2450 "src/conf/parse_opts.cc" -yy608: +#line 2466 "src/conf/parse_opts.cc" +yy613: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'd') goto yy617; + if (yych == 'd') goto yy622; goto yy276; -yy609: +yy614: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy618; + if (yych == 'n') goto yy623; goto yy276; -yy610: +yy615: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy619; + if (yych <= 0x00) goto yy624; goto yy276; -yy611: +yy616: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy621; + if (yych == 'e') goto yy626; goto yy276; -yy612: +yy617: ++YYCURSOR; #line 142 "../src/conf/parse_opts.re" { opts.set_gFlag (true); goto opt; } -#line 2471 "src/conf/parse_opts.cc" -yy614: +#line 2487 "src/conf/parse_opts.cc" +yy619: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy622; + if (yych == 'n') goto yy627; goto yy276; -yy615: +yy620: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy623; + if (yych <= 0x00) goto yy628; goto yy276; -yy616: +yy621: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy625; + if (yych <= 0x00) goto yy630; goto yy276; -yy617: +yy622: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy627; + if (yych == 'a') goto yy632; goto yy276; -yy618: +yy623: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy628; + if (yych == 's') goto yy633; goto yy276; -yy619: +yy624: ++YYCURSOR; #line 140 "../src/conf/parse_opts.re" { opts.set_fFlag (true); goto opt; } -#line 2496 "src/conf/parse_opts.cc" -yy621: +#line 2512 "src/conf/parse_opts.cc" +yy626: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy629; + if (yych <= 0x00) goto yy634; goto yy276; -yy622: +yy627: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy631; + if (yych <= 0x00) goto yy636; goto yy276; -yy623: +yy628: ++YYCURSOR; -#line 167 "../src/conf/parse_opts.re" +#line 168 "../src/conf/parse_opts.re" { opts.set_dump_dfa_tagopt(true); goto opt; } -#line 2509 "src/conf/parse_opts.cc" -yy625: +#line 2525 "src/conf/parse_opts.cc" +yy630: ++YYCURSOR; #line 159 "../src/conf/parse_opts.re" { goto opt_encoding_policy; } -#line 2514 "src/conf/parse_opts.cc" -yy627: +#line 2530 "src/conf/parse_opts.cc" +yy632: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy633; + if (yych == 't') goto yy638; goto yy276; -yy628: +yy633: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy634; + if (yych <= 0x00) goto yy639; goto yy276; -yy629: +yy634: ++YYCURSOR; #line 148 "../src/conf/parse_opts.re" { opts.set_bCaseInsensitive (true); goto opt; } -#line 2527 "src/conf/parse_opts.cc" -yy631: +#line 2543 "src/conf/parse_opts.cc" +yy636: ++YYCURSOR; #line 162 "../src/conf/parse_opts.re" { goto opt_dfa_minimization; } -#line 2532 "src/conf/parse_opts.cc" -yy633: +#line 2548 "src/conf/parse_opts.cc" +yy638: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy636; + if (yych == 'e') goto yy641; goto yy276; -yy634: +yy639: ++YYCURSOR; #line 137 "../src/conf/parse_opts.re" { opts.set_cFlag (true); goto opt; } -#line 2541 "src/conf/parse_opts.cc" -yy636: +#line 2557 "src/conf/parse_opts.cc" +yy641: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy276; ++YYCURSOR; #line 146 "../src/conf/parse_opts.re" { opts.set_bNoGenerationDate (true); goto opt; } -#line 2548 "src/conf/parse_opts.cc" +#line 2564 "src/conf/parse_opts.cc" } -#line 170 "../src/conf/parse_opts.re" +#line 171 "../src/conf/parse_opts.re" opt_output: -#line 2555 "src/conf/parse_opts.cc" +#line 2571 "src/conf/parse_opts.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2589,33 +2605,33 @@ opt_output: 128, 128, 128, 128, 128, 128, 128, 128, }; yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x00) goto yy641; - if (yych != '-') goto yy643; -yy641: + if (yych <= 0x00) goto yy646; + if (yych != '-') goto yy648; +yy646: ++YYCURSOR; -#line 175 "../src/conf/parse_opts.re" +#line 176 "../src/conf/parse_opts.re" { error ("bad argument to option -o, --output: %s", *argv); return EXIT_FAIL; } -#line 2602 "src/conf/parse_opts.cc" -yy643: +#line 2618 "src/conf/parse_opts.cc" +yy648: ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy643; + goto yy648; } ++YYCURSOR; -#line 179 "../src/conf/parse_opts.re" +#line 180 "../src/conf/parse_opts.re" { opts.set_output_file(*argv); goto opt; } -#line 2612 "src/conf/parse_opts.cc" +#line 2628 "src/conf/parse_opts.cc" } -#line 180 "../src/conf/parse_opts.re" +#line 181 "../src/conf/parse_opts.re" opt_header: -#line 2619 "src/conf/parse_opts.cc" +#line 2635 "src/conf/parse_opts.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2653,28 +2669,28 @@ opt_header: 128, 128, 128, 128, 128, 128, 128, 128, }; yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x00) goto yy649; - if (yych != '-') goto yy651; -yy649: + if (yych <= 0x00) goto yy654; + if (yych != '-') goto yy656; +yy654: ++YYCURSOR; -#line 185 "../src/conf/parse_opts.re" +#line 186 "../src/conf/parse_opts.re" { error ("bad argument to option -t, --type-header: %s", *argv); return EXIT_FAIL; } -#line 2666 "src/conf/parse_opts.cc" -yy651: +#line 2682 "src/conf/parse_opts.cc" +yy656: ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; if (yybm[0+yych] & 128) { - goto yy651; + goto yy656; } ++YYCURSOR; -#line 189 "../src/conf/parse_opts.re" +#line 190 "../src/conf/parse_opts.re" { opts.set_header_file (*argv); goto opt; } -#line 2676 "src/conf/parse_opts.cc" +#line 2692 "src/conf/parse_opts.cc" } -#line 190 "../src/conf/parse_opts.re" +#line 191 "../src/conf/parse_opts.re" opt_encoding_policy: @@ -2684,115 +2700,115 @@ opt_encoding_policy: return EXIT_FAIL; } -#line 2688 "src/conf/parse_opts.cc" +#line 2704 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; if (yych <= 'h') { - if (yych == 'f') goto yy659; + if (yych == 'f') goto yy664; } else { - if (yych <= 'i') goto yy660; - if (yych == 's') goto yy661; + if (yych <= 'i') goto yy665; + if (yych == 's') goto yy666; } ++YYCURSOR; -yy658: -#line 200 "../src/conf/parse_opts.re" +yy663: +#line 201 "../src/conf/parse_opts.re" { error ("bad argument to option --encoding-policy (expected: ignore | substitute | fail): %s", *argv); return EXIT_FAIL; } -#line 2705 "src/conf/parse_opts.cc" -yy659: - yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'a') goto yy662; - goto yy658; -yy660: - yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'g') goto yy664; - goto yy658; -yy661: - yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'u') goto yy665; - goto yy658; -yy662: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy666; -yy663: - YYCURSOR = YYMARKER; - goto yy658; +#line 2721 "src/conf/parse_opts.cc" yy664: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy667; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'a') goto yy667; goto yy663; yy665: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'b') goto yy668; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'g') goto yy669; goto yy663; yy666: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'l') goto yy669; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'u') goto yy670; goto yy663; yy667: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy670; - goto yy663; + if (yych == 'i') goto yy671; yy668: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy671; + YYCURSOR = YYMARKER; goto yy663; yy669: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy672; - goto yy663; + if (yych == 'n') goto yy672; + goto yy668; yy670: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy674; - goto yy663; + if (yych == 'b') goto yy673; + goto yy668; yy671: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy675; - goto yy663; + if (yych == 'l') goto yy674; + goto yy668; yy672: - ++YYCURSOR; -#line 206 "../src/conf/parse_opts.re" - { opts.set_encoding_policy (Enc::POLICY_FAIL); goto opt; } -#line 2760 "src/conf/parse_opts.cc" + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'o') goto yy675; + goto yy668; +yy673: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 's') goto yy676; + goto yy668; yy674: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy676; - goto yy663; + if (yych <= 0x00) goto yy677; + goto yy668; yy675: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy677; - goto yy663; + if (yych == 'r') goto yy679; + goto yy668; yy676: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy678; - goto yy663; + if (yych == 't') goto yy680; + goto yy668; yy677: + ++YYCURSOR; +#line 207 "../src/conf/parse_opts.re" + { opts.set_encoding_policy (Enc::POLICY_FAIL); goto opt; } +#line 2776 "src/conf/parse_opts.cc" +yy679: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy680; - goto yy663; -yy678: + if (yych == 'e') goto yy681; + goto yy668; +yy680: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'i') goto yy682; + goto yy668; +yy681: + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 0x00) goto yy683; + goto yy668; +yy682: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 't') goto yy685; + goto yy668; +yy683: ++YYCURSOR; -#line 204 "../src/conf/parse_opts.re" +#line 205 "../src/conf/parse_opts.re" { opts.set_encoding_policy (Enc::POLICY_IGNORE); goto opt; } -#line 2781 "src/conf/parse_opts.cc" -yy680: +#line 2797 "src/conf/parse_opts.cc" +yy685: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'u') goto yy663; + if (yych != 'u') goto yy668; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy663; + if (yych != 't') goto yy668; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy663; + if (yych != 'e') goto yy668; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy663; + if (yych >= 0x01) goto yy668; ++YYCURSOR; -#line 205 "../src/conf/parse_opts.re" +#line 206 "../src/conf/parse_opts.re" { opts.set_encoding_policy (Enc::POLICY_SUBSTITUTE); goto opt; } -#line 2794 "src/conf/parse_opts.cc" +#line 2810 "src/conf/parse_opts.cc" } -#line 207 "../src/conf/parse_opts.re" +#line 208 "../src/conf/parse_opts.re" opt_input: @@ -2802,86 +2818,86 @@ opt_input: return EXIT_FAIL; } -#line 2806 "src/conf/parse_opts.cc" +#line 2822 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; - if (yych <= 'b') goto yy688; - if (yych <= 'c') goto yy690; - if (yych <= 'd') goto yy691; -yy688: + if (yych <= 'b') goto yy693; + if (yych <= 'c') goto yy695; + if (yych <= 'd') goto yy696; +yy693: ++YYCURSOR; -yy689: -#line 217 "../src/conf/parse_opts.re" +yy694: +#line 218 "../src/conf/parse_opts.re" { error ("bad argument to option --input (expected: default | custom): %s", *argv); return EXIT_FAIL; } -#line 2821 "src/conf/parse_opts.cc" -yy690: - yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'u') goto yy692; - goto yy689; -yy691: - yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'e') goto yy694; - goto yy689; -yy692: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy695; -yy693: - YYCURSOR = YYMARKER; - goto yy689; -yy694: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'f') goto yy696; - goto yy693; +#line 2837 "src/conf/parse_opts.cc" yy695: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy697; - goto yy693; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'u') goto yy697; + goto yy694; yy696: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy698; - goto yy693; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'e') goto yy699; + goto yy694; yy697: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy699; - goto yy693; + if (yych == 's') goto yy700; yy698: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'u') goto yy700; - goto yy693; + YYCURSOR = YYMARKER; + goto yy694; yy699: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'm') goto yy701; - goto yy693; + if (yych == 'f') goto yy701; + goto yy698; yy700: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'l') goto yy702; - goto yy693; + if (yych == 't') goto yy702; + goto yy698; yy701: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy703; - goto yy693; + if (yych == 'a') goto yy703; + goto yy698; yy702: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy705; - goto yy693; + if (yych == 'o') goto yy704; + goto yy698; yy703: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'u') goto yy705; + goto yy698; +yy704: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'm') goto yy706; + goto yy698; +yy705: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'l') goto yy707; + goto yy698; +yy706: + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 0x00) goto yy708; + goto yy698; +yy707: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 't') goto yy710; + goto yy698; +yy708: ++YYCURSOR; -#line 222 "../src/conf/parse_opts.re" +#line 223 "../src/conf/parse_opts.re" { opts.set_input_api (InputAPI::CUSTOM); goto opt; } -#line 2876 "src/conf/parse_opts.cc" -yy705: +#line 2892 "src/conf/parse_opts.cc" +yy710: yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy693; + if (yych >= 0x01) goto yy698; ++YYCURSOR; -#line 221 "../src/conf/parse_opts.re" +#line 222 "../src/conf/parse_opts.re" { opts.set_input_api (InputAPI::DEFAULT); goto opt; } -#line 2883 "src/conf/parse_opts.cc" +#line 2899 "src/conf/parse_opts.cc" } -#line 223 "../src/conf/parse_opts.re" +#line 224 "../src/conf/parse_opts.re" opt_empty_class: @@ -2891,120 +2907,120 @@ opt_empty_class: return EXIT_FAIL; } -#line 2895 "src/conf/parse_opts.cc" +#line 2911 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; - if (yych == 'e') goto yy712; - if (yych == 'm') goto yy713; + if (yych == 'e') goto yy717; + if (yych == 'm') goto yy718; ++YYCURSOR; -yy711: -#line 233 "../src/conf/parse_opts.re" +yy716: +#line 234 "../src/conf/parse_opts.re" { error ("bad argument to option --empty-class (expected: match-empty | match-none | error): %s", *argv); return EXIT_FAIL; } -#line 2908 "src/conf/parse_opts.cc" -yy712: - yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'r') goto yy714; - goto yy711; -yy713: - yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'a') goto yy716; - goto yy711; -yy714: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy717; -yy715: - YYCURSOR = YYMARKER; - goto yy711; -yy716: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy718; - goto yy715; +#line 2924 "src/conf/parse_opts.cc" yy717: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy719; - goto yy715; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'r') goto yy719; + goto yy716; yy718: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy720; - goto yy715; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'a') goto yy721; + goto yy716; yy719: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy721; - goto yy715; + if (yych == 'r') goto yy722; yy720: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'h') goto yy722; - goto yy715; + YYCURSOR = YYMARKER; + goto yy716; yy721: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy723; - goto yy715; + if (yych == 't') goto yy723; + goto yy720; yy722: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '-') goto yy725; - goto yy715; + if (yych == 'o') goto yy724; + goto yy720; yy723: - ++YYCURSOR; -#line 239 "../src/conf/parse_opts.re" - { opts.set_empty_class_policy (EMPTY_CLASS_ERROR); goto opt; } -#line 2955 "src/conf/parse_opts.cc" + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'c') goto yy725; + goto yy720; +yy724: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'r') goto yy726; + goto yy720; yy725: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy726; - if (yych == 'n') goto yy727; - goto yy715; + if (yych == 'h') goto yy727; + goto yy720; yy726: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'm') goto yy728; - goto yy715; + if (yych <= 0x00) goto yy728; + goto yy720; yy727: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy729; - goto yy715; + if (yych == '-') goto yy730; + goto yy720; yy728: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'p') goto yy730; - goto yy715; -yy729: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy731; - goto yy715; + ++YYCURSOR; +#line 240 "../src/conf/parse_opts.re" + { opts.set_empty_class_policy (EMPTY_CLASS_ERROR); goto opt; } +#line 2971 "src/conf/parse_opts.cc" yy730: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy732; - goto yy715; + if (yych == 'e') goto yy731; + if (yych == 'n') goto yy732; + goto yy720; yy731: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy733; - goto yy715; + if (yych == 'm') goto yy733; + goto yy720; yy732: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'y') goto yy734; - goto yy715; + if (yych == 'o') goto yy734; + goto yy720; yy733: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy735; - goto yy715; + if (yych == 'p') goto yy735; + goto yy720; yy734: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy737; - goto yy715; + if (yych == 'n') goto yy736; + goto yy720; yy735: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 't') goto yy737; + goto yy720; +yy736: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy738; + goto yy720; +yy737: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'y') goto yy739; + goto yy720; +yy738: + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 0x00) goto yy740; + goto yy720; +yy739: + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 0x00) goto yy742; + goto yy720; +yy740: ++YYCURSOR; -#line 238 "../src/conf/parse_opts.re" +#line 239 "../src/conf/parse_opts.re" { opts.set_empty_class_policy (EMPTY_CLASS_MATCH_NONE); goto opt; } -#line 3001 "src/conf/parse_opts.cc" -yy737: +#line 3017 "src/conf/parse_opts.cc" +yy742: ++YYCURSOR; -#line 237 "../src/conf/parse_opts.re" +#line 238 "../src/conf/parse_opts.re" { opts.set_empty_class_policy (EMPTY_CLASS_MATCH_EMPTY); goto opt; } -#line 3006 "src/conf/parse_opts.cc" +#line 3022 "src/conf/parse_opts.cc" } -#line 240 "../src/conf/parse_opts.re" +#line 241 "../src/conf/parse_opts.re" opt_dfa_minimization: @@ -3014,74 +3030,74 @@ opt_dfa_minimization: return EXIT_FAIL; } -#line 3018 "src/conf/parse_opts.cc" +#line 3034 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; - if (yych == 'm') goto yy743; - if (yych == 't') goto yy744; + if (yych == 'm') goto yy748; + if (yych == 't') goto yy749; ++YYCURSOR; -yy742: -#line 250 "../src/conf/parse_opts.re" +yy747: +#line 251 "../src/conf/parse_opts.re" { error ("bad argument to option --dfa-minimization (expected: table | moore): %s", *argv); return EXIT_FAIL; } -#line 3031 "src/conf/parse_opts.cc" -yy743: +#line 3047 "src/conf/parse_opts.cc" +yy748: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'o') goto yy745; - goto yy742; -yy744: + if (yych == 'o') goto yy750; + goto yy747; +yy749: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'a') goto yy747; - goto yy742; -yy745: + if (yych == 'a') goto yy752; + goto yy747; +yy750: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy748; -yy746: + if (yych == 'o') goto yy753; +yy751: YYCURSOR = YYMARKER; - goto yy742; -yy747: + goto yy747; +yy752: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'b') goto yy749; - goto yy746; -yy748: + if (yych == 'b') goto yy754; + goto yy751; +yy753: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy750; - goto yy746; -yy749: + if (yych == 'r') goto yy755; + goto yy751; +yy754: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'l') goto yy751; - goto yy746; -yy750: + if (yych == 'l') goto yy756; + goto yy751; +yy755: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy752; - goto yy746; -yy751: + if (yych == 'e') goto yy757; + goto yy751; +yy756: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy753; - goto yy746; -yy752: + if (yych == 'e') goto yy758; + goto yy751; +yy757: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy754; - goto yy746; -yy753: + if (yych <= 0x00) goto yy759; + goto yy751; +yy758: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy756; - goto yy746; -yy754: + if (yych <= 0x00) goto yy761; + goto yy751; +yy759: ++YYCURSOR; -#line 255 "../src/conf/parse_opts.re" +#line 256 "../src/conf/parse_opts.re" { opts.set_dfa_minimization (DFA_MINIMIZATION_MOORE); goto opt; } -#line 3078 "src/conf/parse_opts.cc" -yy756: +#line 3094 "src/conf/parse_opts.cc" +yy761: ++YYCURSOR; -#line 254 "../src/conf/parse_opts.re" +#line 255 "../src/conf/parse_opts.re" { opts.set_dfa_minimization (DFA_MINIMIZATION_TABLE); goto opt; } -#line 3083 "src/conf/parse_opts.cc" +#line 3099 "src/conf/parse_opts.cc" } -#line 256 "../src/conf/parse_opts.re" +#line 257 "../src/conf/parse_opts.re" opt_dfa_mapping: @@ -3090,106 +3106,106 @@ opt_dfa_mapping: return EXIT_FAIL; } -#line 3094 "src/conf/parse_opts.cc" +#line 3110 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; - if (yych == 'b') goto yy762; - if (yych == 'i') goto yy763; + if (yych == 'b') goto yy767; + if (yych == 'i') goto yy768; ++YYCURSOR; -yy761: -#line 264 "../src/conf/parse_opts.re" +yy766: +#line 265 "../src/conf/parse_opts.re" { error("bad argument to option --dfa-mapping (expected: bijective | injective): %s", *argv); return EXIT_FAIL; } -#line 3107 "src/conf/parse_opts.cc" -yy762: - yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'i') goto yy764; - goto yy761; -yy763: - yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'n') goto yy766; - goto yy761; -yy764: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'j') goto yy767; -yy765: - YYCURSOR = YYMARKER; - goto yy761; -yy766: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'j') goto yy768; - goto yy765; +#line 3123 "src/conf/parse_opts.cc" yy767: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy769; - goto yy765; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'i') goto yy769; + goto yy766; yy768: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy770; - goto yy765; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'n') goto yy771; + goto yy766; yy769: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy771; - goto yy765; + if (yych == 'j') goto yy772; yy770: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy772; - goto yy765; + YYCURSOR = YYMARKER; + goto yy766; yy771: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy773; - goto yy765; + if (yych == 'j') goto yy773; + goto yy770; yy772: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy774; - goto yy765; + if (yych == 'e') goto yy774; + goto yy770; yy773: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy775; - goto yy765; + if (yych == 'e') goto yy775; + goto yy770; yy774: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy776; - goto yy765; + if (yych == 'c') goto yy776; + goto yy770; yy775: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'v') goto yy777; - goto yy765; + if (yych == 'c') goto yy777; + goto yy770; yy776: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'v') goto yy778; - goto yy765; + if (yych == 't') goto yy778; + goto yy770; yy777: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy779; - goto yy765; + if (yych == 't') goto yy779; + goto yy770; yy778: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy780; - goto yy765; + if (yych == 'i') goto yy780; + goto yy770; yy779: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy781; - goto yy765; + if (yych == 'i') goto yy781; + goto yy770; yy780: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= 0x00) goto yy783; - goto yy765; + if (yych == 'v') goto yy782; + goto yy770; yy781: - ++YYCURSOR; -#line 268 "../src/conf/parse_opts.re" - { opts.set_dfa_mapping(mapping_t::BIJECTIVE); goto opt; } -#line 3186 "src/conf/parse_opts.cc" + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'v') goto yy783; + goto yy770; +yy782: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy784; + goto yy770; yy783: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy785; + goto yy770; +yy784: + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 0x00) goto yy786; + goto yy770; +yy785: + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 0x00) goto yy788; + goto yy770; +yy786: ++YYCURSOR; #line 269 "../src/conf/parse_opts.re" + { opts.set_dfa_mapping(mapping_t::BIJECTIVE); goto opt; } +#line 3202 "src/conf/parse_opts.cc" +yy788: + ++YYCURSOR; +#line 270 "../src/conf/parse_opts.re" { opts.set_dfa_mapping(mapping_t::INJECTIVE); goto opt; } -#line 3191 "src/conf/parse_opts.cc" +#line 3207 "src/conf/parse_opts.cc" } -#line 270 "../src/conf/parse_opts.re" +#line 271 "../src/conf/parse_opts.re" end: diff --git a/re2c/src/conf/opt.cc b/re2c/src/conf/opt.cc index a05127d8..f8c515d2 100644 --- a/re2c/src/conf/opt.cc +++ b/re2c/src/conf/opt.cc @@ -114,6 +114,7 @@ void opt_t::fix () fill_arg_use = Opt::baseopt.fill_arg_use; fill_naked = Opt::baseopt.fill_naked; labelPrefix = Opt::baseopt.labelPrefix; + dump_dfa_raw = Opt::baseopt.dump_dfa_raw; dump_dfa_det = Opt::baseopt.dump_dfa_det; dump_dfa_tagopt = Opt::baseopt.dump_dfa_tagopt; dump_dfa_min = Opt::baseopt.dump_dfa_min; diff --git a/re2c/src/conf/opt.h b/re2c/src/conf/opt.h index 4e4e2cad..850b80b3 100644 --- a/re2c/src/conf/opt.h +++ b/re2c/src/conf/opt.h @@ -116,6 +116,7 @@ namespace re2c OPT (dfa_minimization_t, dfa_minimization, DFA_MINIMIZATION_MOORE) \ OPT (mapping_t::type_t, dfa_mapping, mapping_t::BIJECTIVE) \ /* dump */ \ + OPT (bool, dump_dfa_raw, false) \ OPT (bool, dump_dfa_det, false) \ OPT (bool, dump_dfa_tagopt, false) \ OPT (bool, dump_dfa_min, false) \ diff --git a/re2c/src/conf/parse_opts.re b/re2c/src/conf/parse_opts.re index 2bbb9347..eeb237ed 100644 --- a/re2c/src/conf/parse_opts.re +++ b/re2c/src/conf/parse_opts.re @@ -163,6 +163,7 @@ opt_long: "dfa-mapping" end { goto opt_dfa_mapping; } "single-pass" end { goto opt; } // deprecated + "dump-dfa-raw" end { opts.set_dump_dfa_raw(true); goto opt; } "dump-dfa-det" end { opts.set_dump_dfa_det(true); goto opt; } "dump-dfa-tagopt" end { opts.set_dump_dfa_tagopt(true); goto opt; } "dump-dfa-min" end { opts.set_dump_dfa_min(true); goto opt; } diff --git a/re2c/src/ir/dfa/closure.cc b/re2c/src/ir/dfa/closure.cc index 967338c3..6450daa5 100644 --- a/re2c/src/ir/dfa/closure.cc +++ b/re2c/src/ir/dfa/closure.cc @@ -157,7 +157,8 @@ bool compare_by_rule(const clos_t &c1, const clos_t &c2) if (s1 > s2) return false; // each closure item has unique state - assert(c1.tvers == c2.tvers + assert(c1.origin == c2.origin + && c1.tvers == c2.tvers && c1.ttran == c2.ttran && c1.tlook == c2.tlook); return false; diff --git a/re2c/src/ir/dfa/closure.h b/re2c/src/ir/dfa/closure.h index e44bc7eb..636435d5 100644 --- a/re2c/src/ir/dfa/closure.h +++ b/re2c/src/ir/dfa/closure.h @@ -11,6 +11,7 @@ namespace re2c struct clos_t { + nfa_state_t *origin; // for debug only nfa_state_t *state; size_t tvers; // tag versions size_t ttran; // transition tags (lookahead tags of parent closure) diff --git a/re2c/src/ir/dfa/determinization.cc b/re2c/src/ir/dfa/determinization.cc index 94c80dc6..10c6270e 100644 --- a/re2c/src/ir/dfa/determinization.cc +++ b/re2c/src/ir/dfa/determinization.cc @@ -3,8 +3,9 @@ #include #include "src/conf/warn.h" -#include "src/ir/dfa/dfa.h" #include "src/ir/dfa/closure.h" +#include "src/ir/dfa/dfa.h" +#include "src/ir/dfa/dump.h" #include "src/ir/dfa/find_state.h" #include "src/ir/nfa/nfa.h" #include "src/ir/regexp/regexp.h" @@ -38,9 +39,10 @@ void reach(const kernel_t *kernel, closure_t &clos, uint32_t symbol) { clos.clear(); for (size_t i = 0; i < kernel->size; ++i) { - nfa_state_t *s = transition(kernel->state[i], symbol); - if (s) { - clos_t c = {s, kernel->tvers[i], kernel->tlook[i], ZERO_TAGS}; + nfa_state_t *s1 = kernel->state[i], + *s2 = transition(s1, symbol); + if (s2) { + clos_t c = {s1, s2, kernel->tvers[i], kernel->tlook[i], ZERO_TAGS}; clos.push_back(c); } } @@ -63,6 +65,7 @@ dfa_t::dfa_t(const nfa_t &nfa, kernels_t kernels(tagpool, tcpool); closure_t clos1, clos2; bool *badtags = new bool[ntag](); + dump_dfa_t dump(*this, tagpool, nfa); // all-zero tag configuration must have static number zero assert(ZERO_TAGS == tagpool.insert_const(TAGVER_ZERO)); @@ -75,10 +78,11 @@ dfa_t::dfa_t(const nfa_t &nfa, // other versions: [ .. -(2*N+1)] and [2*N+1 .. ] maxtagver = static_cast(ntag) * 2; - clos_t c0 = {nfa.root, INITIAL_TAGS, ZERO_TAGS, ZERO_TAGS}; + clos_t c0 = {NULL, nfa.root, INITIAL_TAGS, ZERO_TAGS, ZERO_TAGS}; clos1.push_back(c0); closure(clos1, clos2, tagpool, tcpool, rules, badtags, maxtagver); kernels.insert(clos2, NULL, maxtagver); + dump.state0(clos2); // closure kernels are in sync with DFA states for (size_t i = 0; i < kernels.size(); ++i) { @@ -90,13 +94,14 @@ dfa_t::dfa_t(const nfa_t &nfa, // check if the new state is final // see note [at most one final item per closure] - for (size_t i = 0; i < kernel->size; ++i) { - const nfa_state_t *f = kernel->state[i]; + for (size_t j = 0; j < kernel->size; ++j) { + const nfa_state_t *f = kernel->state[j]; if (f->type == nfa_state_t::FIN) { s->rule = f->rule; const Rule &rule = rules[s->rule]; - s->tcmd[nchars] = tcpool.conv_to_tcmd(tagpool[kernel->tvers[i]], - tagpool[kernel->tlook[i]], finvers, rule.lvar, rule.hvar); + s->tcmd[nchars] = tcpool.conv_to_tcmd(tagpool[kernel->tvers[j]], + tagpool[kernel->tlook[j]], finvers, rule.lvar, rule.hvar); + dump.final(i, f); break; } } @@ -108,6 +113,7 @@ dfa_t::dfa_t(const nfa_t &nfa, reach(kernel, clos1, charset[c]); s->tcmd[c].save = closure(clos1, clos2, tagpool, tcpool, rules, badtags, maxtagver); s->arcs[c] = kernels.insert(clos2, &s->tcmd[c], maxtagver); + dump.state(clos2, i, c); } } diff --git a/re2c/src/ir/dfa/dump.cc b/re2c/src/ir/dfa/dump.cc index 6d773b33..1c856591 100644 --- a/re2c/src/ir/dfa/dump.cc +++ b/re2c/src/ir/dfa/dump.cc @@ -1,34 +1,156 @@ #include +#include "src/conf/opt.h" #include "src/ir/dfa/dump.h" +#include "src/globals.h" namespace re2c { -static void dump_tcmd(const dfa_t &dfa, const dfa_state_t *state, size_t sym) +static void dump_tcmd_or_tcid(const dfa_state_t *state, size_t sym, const tcpool_t &tcpool); +static void dump_tcmd(const tagsave_t *s, const tagcopy_t *c); +static const char *tagname(const VarTag &t); +static void dump_tags(const Tagpool &tagpool, size_t ttran, size_t tvers); + +dump_dfa_t::dump_dfa_t(const dfa_t &d, const Tagpool &pool, const nfa_t &n) + : debug(opts->dump_dfa_raw) + , dfa(d) + , tagpool(pool) + , uniqidx(0) + , base(n.states) + , done() { - const tagsave_t *s; - const tagcopy_t *c; + if (!debug) return; - if (state->tcmd) { - const tcmd_t &cmd = state->tcmd[sym]; - s = cmd.save; - c = cmd.copy; - } else { - const tccmd_t &cmd = dfa.tcpool[state->tcid[sym]]; - s = cmd.save; - c = cmd.copy; + fprintf(stderr, "digraph DFA {\n" + " rankdir=LR\n" + " node[shape=Mrecord fontname=fixed]\n" + " edge[arrowhead=vee fontname=fixed]\n\n"); +} + +dump_dfa_t::~dump_dfa_t() +{ + if (!debug) return; + + fprintf(stderr, "}\n"); +} + +uint32_t dump_dfa_t::index(const nfa_state_t *s) +{ + return static_cast(s - base); +} + +void dump_dfa_t::closure(const closure_t &clos, uint32_t state, bool isnew) +{ + if (!debug) return; + + fprintf(stderr, " %s%u [label=\"", isnew ? "" : "i", state); + + const size_t ntag = tagpool.ntags; + cclositer_t b = clos.begin(), e = clos.end(), c; + for (c = b; c != e; ++c) { + + if (c != b) fprintf(stderr, "|"); + fprintf(stderr, "<%u> %u", index(c->state), index(c->state)); + + if (c->tvers != ZERO_TAGS) { + fprintf(stderr, "/"); + const tagver_t *vers = tagpool[c->tvers]; + for (size_t t = 0; t < ntag; ++t) { + if (t > 0) fprintf(stderr, " "); + fprintf(stderr, "%s%d", tagname(dfa.vartags[t]), abs(vers[t])); + } + } + + if (c->tlook != ZERO_TAGS) { + fprintf(stderr, "/"); + const tagver_t *look = tagpool[c->tlook]; + for (size_t t = 0; t < ntag; ++t) { + const char *name = tagname(dfa.vartags[t]); + switch (look[t]) { + case TAGVER_ZERO: break; + case TAGVER_CURSOR: fprintf(stderr, "%s ", name); break; + case TAGVER_BOTTOM: fprintf(stderr, "%s? ", name); break; + } + } + } } - if (!s && !c) return; + fprintf(stderr, "\"]\n"); +} - fprintf(stderr, "/"); - for (; c; c = c->next) { - fprintf(stderr, "%d=%d ", c->lhs, c->rhs); +void dump_dfa_t::state0(const closure_t &clos) +{ + if (!debug) return; + + done.insert(0); + + closure(clos, 0, true); + + fprintf(stderr, " void [shape=point]\n"); + for (cclositer_t c = clos.begin(); c != clos.end(); ++c) { + fprintf(stderr, " void -> 0:%u:w [style=dotted label=\"", index(c->state)); + dump_tags(tagpool, c->ttran, c->tvers); + fprintf(stderr, "\"]\n"); } - for (; s; s = s->next) { - fprintf(stderr, "%d%s ", s->ver, s->bottom ? "?" : ""); +} + +void dump_dfa_t::state(const closure_t &clos, size_t state, size_t symbol) +{ + if (!debug) return; + + const dfa_state_t *s = dfa.states[state]; + const size_t state2 = s->arcs[symbol]; + + if (state2 == dfa_t::NIL) return; + + const bool isnew = done.insert(state2).second; + const tagcopy_t *copy = s->tcmd[symbol].copy; + const uint32_t + a = static_cast(symbol), + x = static_cast(state), + y = static_cast(state2), + z = isnew ? y : ++uniqidx; + const char *prefix = isnew ? "" : "i"; + + closure(clos, z, isnew); + + if (!isnew) { + fprintf(stderr, " i%u [style=dotted]\n" + " i%u -> %u [style=dotted label=\"", z, z, y); + for (const tagcopy_t *p = copy; p; p = p->next) { + fprintf(stderr, "%d=%d ", p->lhs, p->rhs); + } + fprintf(stderr, "\"]\n"); + } + + for (cclositer_t c = clos.begin(); c != clos.end(); ++c) { + fprintf(stderr, " %u:%u -> %s%u:%u [label=\"%u", + x, index(c->origin), prefix, z, index(c->state), a); + dump_tags(tagpool, c->ttran, c->tvers); + fprintf(stderr, "\"]\n"); + } +} + +void dump_dfa_t::final(size_t state, const nfa_state_t *port) +{ + if (!debug) return; + + const dfa_state_t *s = dfa.states[state]; + const Rule &r = dfa.rules[s->rule]; + const tcmd_t &cmd = s->tcmd[dfa.nchars]; + const uint32_t x = static_cast(state); + + fprintf(stderr, " r%u [shape=none label=\"(", x); + for (size_t t = r.lvar; t < r.hvar; ++t) { + if (t > r.lvar) fprintf(stderr, " "); + fprintf(stderr, "%s%d", tagname(dfa.vartags[t]), abs(dfa.finvers[t])); } + fprintf(stderr, ")\"]\n"); + + fprintf(stderr, " %u:%u -> r%u [style=dotted label=\"", x, index(port), x); + dump_tcmd(cmd.save, cmd.copy); + fprintf(stderr, "\"]\n"); } void dump_dfa(const dfa_t &dfa) @@ -58,7 +180,7 @@ void dump_dfa(const dfa_t &dfa) " n%u [style=filled fillcolor=lightgray]" " dr%u [shape=none label=\"", i, i); - dump_tcmd(dfa, s, nsym); + dump_tcmd_or_tcid(s, nsym, dfa.tcpool); fprintf(stderr, "("); for (size_t t = r.lvar; t < r.hvar; ++t) { @@ -78,7 +200,7 @@ void dump_dfa(const dfa_t &dfa) if (j != dfa_t::NIL) { fprintf(stderr, " n%u -> n%u [label=\"%u", i, static_cast(j), c); - dump_tcmd(dfa, s, c); + dump_tcmd_or_tcid(s, c, dfa.tcpool); fprintf(stderr, "\"]\n"); } } @@ -87,4 +209,52 @@ void dump_dfa(const dfa_t &dfa) fprintf(stderr, "}\n"); } +void dump_tcmd_or_tcid(const dfa_state_t *state, size_t sym, const tcpool_t &tcpool) +{ + if (state->tcmd) { + const tcmd_t &cmd = state->tcmd[sym]; + dump_tcmd(cmd.save, cmd.copy); + } else { + const tccmd_t &cmd = tcpool[state->tcid[sym]]; + dump_tcmd(cmd.save, cmd.copy); + } +} + +void dump_tcmd(const tagsave_t *s, const tagcopy_t *c) +{ + if (!s && !c) return; + + fprintf(stderr, "/"); + for (; c; c = c->next) { + fprintf(stderr, "%d=%d ", c->lhs, c->rhs); + } + for (; s; s = s->next) { + fprintf(stderr, "%d%s ", s->ver, s->bottom ? "?" : ""); + } +} + +const char *tagname(const VarTag &t) +{ + return t.name ? t.name->c_str() : ""; +} + +void dump_tags(const Tagpool &tagpool, size_t ttran, size_t tvers) +{ + if (ttran == ZERO_TAGS) return; + + const tagver_t + *ts = tagpool[ttran], + *vs = tagpool[tvers]; + + fprintf(stderr, "/"); + for (size_t t = 0; t < tagpool.ntags; ++t) { + const tagver_t v = abs(vs[t]); + switch (ts[t]) { + case TAGVER_ZERO: break; + case TAGVER_CURSOR: fprintf(stderr, "%d ", v); break; + case TAGVER_BOTTOM: fprintf(stderr, "%d? ", v); break; + } + } +} + } // namespace re2c diff --git a/re2c/src/ir/dfa/dump.h b/re2c/src/ir/dfa/dump.h index 9a72cc2e..8e70dec0 100644 --- a/re2c/src/ir/dfa/dump.h +++ b/re2c/src/ir/dfa/dump.h @@ -1,11 +1,33 @@ #ifndef _RE2C_IR_DFA_DUMP_ #define _RE2C_IR_DFA_DUMP_ +#include + +#include "src/ir/dfa/closure.h" #include "src/ir/dfa/dfa.h" namespace re2c { +struct dump_dfa_t +{ + const bool debug; + const dfa_t &dfa; + const Tagpool &tagpool; + uint32_t uniqidx; + const nfa_state_t *base; + std::set done; + + dump_dfa_t(const dfa_t &d, const Tagpool &pool, const nfa_t &n); + ~dump_dfa_t(); + void closure(const closure_t &clos, uint32_t state, bool isnew); + void state0(const closure_t &clos); + void state(const closure_t &clos, size_t state, size_t symbol); + void final(size_t state, const nfa_state_t *port); + uint32_t index(const nfa_state_t *s); + FORBID_COPY(dump_dfa_t); +}; + void dump_dfa(const dfa_t &dfa); } // namespace re2c -- 2.40.0