From eb03931ac9fa5dd6479093419d7da644e836b714 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Tue, 1 Sep 2015 15:27:48 +0100 Subject: [PATCH] Renamed and fixed warning about undefined control flow in generated lexer. Renamed '-Wnaked-default' to '-Wundefined-control-flow': the latter sounds much scarier. :D Completely changed the algorithm that is used to determine if default case is not handled properly. Prior to this commit a simple and incorrent criterion was used: whether there are code units that (alone) do not match any rule. This gived false positives in cases like this: [^] [^] { rule } here all code units meet the criterion: no single code unit matches a rule. But obviously, default case is handled properly, because any input string matches 'rule' (strictly speaking, any input string of length 2 or more, but that's YYFILL's problem). The new algorithm is more complex (in terms of time and space), yet it is less heuristic: re2c parforms exhaustive deep-first-search on graph skeleton and collects all bad paths. --- re2c/Makefile.am | 3 + re2c/bootstrap/src/conf/parse_opts.cc | 1496 +++++++++-------- re2c/src/codegen/emit_dfa.cc | 2 +- re2c/src/codegen/prepare_dfa.cc | 8 +- re2c/src/codegen/skeleton/control_flow.cc | 57 + re2c/src/codegen/skeleton/multipath.cc | 71 + re2c/src/codegen/skeleton/multipath.h | 33 + re2c/src/codegen/skeleton/path.cc | 5 - re2c/src/codegen/skeleton/path.h | 5 - re2c/src/codegen/skeleton/skeleton.cc | 12 +- re2c/src/codegen/skeleton/skeleton.h | 10 +- re2c/src/conf/msg.cc | 16 +- re2c/src/conf/msg.h | 2 + re2c/src/conf/parse_opts.re | 12 +- re2c/src/conf/warn.cc | 86 +- re2c/src/conf/warn.h | 17 +- re2c/src/ir/bytecode/bytecode.cc | 10 +- re2c/src/ir/dfa/dfa.h | 2 +- re2c/test/bug1454253b.s.c | 2 +- re2c/test/bug47_dot_escapes.D.c | 2 +- re2c/test/bug59_bogus_yyaccept.ci.c | 4 +- re2c/test/bug60_redundant_yymarker.ci.c | 2 +- re2c/test/bug61.i--empty-class(match-none).c | 10 +- ...fference_full.i--empty-class(match-none).c | 2 +- ...ence_negative.i--empty-class(match-none).c | 2 +- ...ence_positive.i--empty-class(match-none).c | 2 +- ...ug61_negative.i--empty-class(match-none).c | 2 +- ...ug61_positive.i--empty-class(match-none).c | 2 +- re2c/test/casing-flags.i--case-insensitive.c | 2 +- re2c/test/casing-flags.i--case-inverted.c | 2 +- re2c/test/casing-flags.i.c | 2 +- re2c/test/code_points.8.c | 38 +- re2c/test/code_points.c | 26 +- re2c/test/code_points.e.c | 26 +- re2c/test/code_points.u.c | 26 +- re2c/test/code_points.w.c | 26 +- re2c/test/code_points.x.c | 26 +- re2c/test/cond_error_10.c.c | 4 +- re2c/test/cond_error_11.c.c | 4 +- re2c/test/condition_01.c.c | 10 +- re2c/test/condition_01a.c.c | 10 +- re2c/test/condition_01b.c.c | 10 +- re2c/test/condition_02.c.c | 4 +- re2c/test/condition_02.cg.c | 4 +- re2c/test/condition_03.cg.c | 4 +- re2c/test/condition_04.cg.c | 4 +- re2c/test/condition_11.cg.c | 4 +- re2c/test/condition_13.cg.c | 4 +- re2c/test/condtype.c.c | 4 +- re2c/test/condtype.cg.c | 4 +- re2c/test/condtype.cgtcondtype.cg.h.c | 4 +- re2c/test/condtype.cs.c | 4 +- re2c/test/condtype.cstcondtype.cs.h.c | 4 +- re2c/test/condtype.ctcondtype.c.h.c | 4 +- re2c/test/condtype_decl.c.c | 4 +- re2c/test/condtype_decl.cg.c | 4 +- re2c/test/condtype_decl.cs.c | 4 +- re2c/test/condtype_forwdecl.cg.c | 4 +- re2c/test/condtype_forwdecl.cs.c | 4 +- re2c/test/condtype_single.c.c | 2 +- re2c/test/condtype_single.cg.c | 2 +- re2c/test/condtype_single.cs.c | 2 +- re2c/test/condtype_yysetcondition.cg.c | 4 +- re2c/test/condtype_yysetcondition.cs.c | 4 +- re2c/test/config11.ei.c | 2 +- re2c/test/control_flow_fail.c | 39 + re2c/test/control_flow_fail.re | 6 + re2c/test/control_flow_ok.c | 26 + re2c/test/control_flow_ok.re | 6 + re2c/test/control_flow_yymarker_fail.c | 40 + re2c/test/control_flow_yymarker_fail.re | 6 + re2c/test/control_flow_yymarker_ok.c | 32 + re2c/test/control_flow_yymarker_ok.re | 6 + .../control_flow_yymarker_yyaccept_fail.c | 62 + .../control_flow_yymarker_yyaccept_fail.re | 7 + re2c/test/control_flow_yymarker_yyaccept_ok.c | 54 + .../test/control_flow_yymarker_yyaccept_ok.re | 7 + re2c/test/dot_backslash.D.c | 2 +- re2c/test/dot_conditions.Dc.c | 14 +- re2c/test/empty_code.c.c | 2 +- re2c/test/flex-01.iF.c | 2 +- re2c/test/input12.boinput12.c.c | 8 +- re2c/test/input12.oinput12.c.c | 8 +- re2c/test/input2.c | 8 +- re2c/test/input3.c | 8 +- re2c/test/line-01.c | 2 +- re2c/test/overflow-1.c | 11 +- re2c/test/overflow-4.c | 6 +- re2c/test/php20150211_pdo_sql_parser.ig.c | 2 +- re2c/test/php20150211_phar_path_check.ig.c | 2 +- re2c/test/range_dot.8.c | 11 +- re2c/test/range_dot.c | 2 +- re2c/test/range_dot.e.c | 2 +- re2c/test/range_dot.u.c | 2 +- re2c/test/range_dot.w.c | 2 +- re2c/test/range_dot.x.c | 2 +- re2c/test/range_full.8.c | 11 +- re2c/test/range_neg_lf.8.c | 11 +- re2c/test/range_neg_lf.c | 2 +- re2c/test/range_neg_lf.e.c | 2 +- re2c/test/range_neg_lf.u.c | 2 +- re2c/test/range_neg_lf.w.c | 2 +- re2c/test/range_neg_lf.x.c | 2 +- re2c/test/repeat-01.cgir.c | 4 +- re2c/test/repeat-02.cgir.c | 4 +- re2c/test/repeat-03.cgir.c | 12 +- re2c/test/repeat-04.cgir.c | 4 +- re2c/test/repeat-06.gir.c | 8 +- re2c/test/repeat-07.gir.c | 8 +- re2c/test/repeat-07_error.gir.c | 6 +- re2c/test/repeater2.c | 41 +- re2c/test/reuse_conds_default_0.cgir.c | 4 +- re2c/test/reuse_conds_default_1.cgir.c | 2 +- re2c/test/reuse_conds_setup_0.cgir.c | 4 +- re2c/test/reuse_conds_setup_1.cgir.c | 4 +- re2c/test/rexx.--empty-class(match-none).c | 5 +- re2c/test/utf32_0x10000.u.c | 2 +- re2c/test/utf8-full_range-2.8.c | 11 +- re2c/test/utf8-range_0x00_0x7f.8.c | 2 +- re2c/test/utf8-range_0x100000_0x10ffff.8.c | 7 +- re2c/test/utf8-range_0x10000_0x3ffff.8.c | 7 +- re2c/test/utf8-range_0x1000_0xffff.8.c | 6 +- re2c/test/utf8-range_0x40000_0xfffff.8.c | 7 +- re2c/test/utf8-range_0x800_0xfff.8.c | 6 +- re2c/test/utf8-range_0x80_0x7ff.8.c | 5 +- re2c/test/utf8-range_single_symbol.8.c | 5 +- 126 files changed, 1768 insertions(+), 988 deletions(-) create mode 100644 re2c/src/codegen/skeleton/control_flow.cc create mode 100644 re2c/src/codegen/skeleton/multipath.cc create mode 100644 re2c/src/codegen/skeleton/multipath.h create mode 100644 re2c/test/control_flow_fail.c create mode 100644 re2c/test/control_flow_fail.re create mode 100644 re2c/test/control_flow_ok.c create mode 100644 re2c/test/control_flow_ok.re create mode 100644 re2c/test/control_flow_yymarker_fail.c create mode 100644 re2c/test/control_flow_yymarker_fail.re create mode 100644 re2c/test/control_flow_yymarker_ok.c create mode 100644 re2c/test/control_flow_yymarker_ok.re create mode 100644 re2c/test/control_flow_yymarker_yyaccept_fail.c create mode 100644 re2c/test/control_flow_yymarker_yyaccept_fail.re create mode 100644 re2c/test/control_flow_yymarker_yyaccept_ok.c create mode 100644 re2c/test/control_flow_yymarker_yyaccept_ok.re diff --git a/re2c/Makefile.am b/re2c/Makefile.am index 93b0d8e2..820a867f 100644 --- a/re2c/Makefile.am +++ b/re2c/Makefile.am @@ -19,6 +19,7 @@ SRC_HDR = \ src/codegen/output.h \ src/codegen/print.h \ src/codegen/scc.h \ + src/codegen/skeleton/multipath.h \ src/codegen/skeleton/path.h \ src/codegen/skeleton/skeleton.h \ src/conf/msg.h \ @@ -85,6 +86,8 @@ SRC = \ src/codegen/output.cc \ src/codegen/print.cc \ src/codegen/scc.cc \ + src/codegen/skeleton/control_flow.cc \ + src/codegen/skeleton/multipath.cc \ src/codegen/skeleton/path.cc \ src/codegen/skeleton/skeleton.cc \ src/conf/msg.cc \ diff --git a/re2c/bootstrap/src/conf/parse_opts.cc b/re2c/bootstrap/src/conf/parse_opts.cc index 283b6dd0..72eef21c 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.14.3 on Wed Aug 26 15:05:25 2015 */ +/* Generated by re2c 0.14.3 on Mon Aug 31 14:38:31 2015 */ #line 1 "../src/conf/parse_opts.re" #include @@ -228,9 +228,8 @@ opt_warn: case 'c': goto yy46; case 'e': goto yy47; case 'm': goto yy48; - case 'n': goto yy49; - case 's': goto yy50; - case 'u': goto yy51; + case 's': goto yy49; + case 'u': goto yy50; default: goto yy44; } yy44: @@ -241,1204 +240,1219 @@ yy45: error ("bad warning: %s", *argv); return EXIT_FAIL; } -#line 245 "src/conf/parse_opts.cc" +#line 244 "src/conf/parse_opts.cc" yy46: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'o') goto yy137; + if (yych == 'o') goto yy145; goto yy45; yy47: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'm') goto yy115; + if (yych == 'm') goto yy123; goto yy45; yy48: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'a') goto yy96; + if (yych == 'a') goto yy104; goto yy45; yy49: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'a') goto yy82; + if (yych == 'w') goto yy90; goto yy45; yy50: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'w') goto yy68; - goto yy45; -yy51: - yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych == 'n') goto yy53; if (yych != 's') goto yy45; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy54; -yy53: + if (yych == 'e') goto yy76; +yy52: YYCURSOR = YYMARKER; goto yy45; -yy54: +yy53: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'd') goto yy52; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy52; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'f') goto yy52; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'i') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy53; + if (yych != 'n') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy53; + if (yych != 'e') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy53; + if (yych != 'd') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy53; + if (yych != '-') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy53; + if (yych != 'c') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy53; + if (yych != 'o') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy53; + if (yych != 'n') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'c') goto yy53; + if (yych != 't') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy53; + if (yych != 'r') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'p') goto yy53; + if (yych != 'o') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy53; + if (yych != 'l') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy53; + if (yych != '-') goto yy52; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'f') goto yy52; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy52; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'o') goto yy52; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'w') goto yy52; + yych = (YYCTYPE)*++YYCURSOR; + if (yych >= 0x01) goto yy52; ++YYCURSOR; -#line 83 "../src/conf/parse_opts.re" - { warn.set (Warn::USELESS_ESCAPE, option); goto opt; } -#line 302 "src/conf/parse_opts.cc" -yy68: +#line 82 "../src/conf/parse_opts.re" + { warn.set (Warn::UNDEFINED_CONTROL_FLOW, option); goto opt; } +#line 316 "src/conf/parse_opts.cc" +yy76: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy53; + if (yych != 'l') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'p') goto yy53; + if (yych != 'e') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'p') goto yy53; + if (yych != 's') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy53; + if (yych != 's') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'd') goto yy53; + if (yych != '-') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy53; + if (yych != 'e') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy53; + if (yych != 's') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy53; + if (yych != 'c') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy53; + if (yych != 'a') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'g') goto yy53; + if (yych != 'p') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy53; + if (yych != 'e') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy53; + if (yych >= 0x01) goto yy52; ++YYCURSOR; -#line 82 "../src/conf/parse_opts.re" - { warn.set (Warn::SWAPPED_RANGE, option); goto opt; } -#line 331 "src/conf/parse_opts.cc" -yy82: +#line 83 "../src/conf/parse_opts.re" + { warn.set (Warn::USELESS_ESCAPE, option); goto opt; } +#line 345 "src/conf/parse_opts.cc" +yy90: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'k') goto yy53; + if (yych != 'a') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy53; + if (yych != 'p') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'd') goto yy53; + if (yych != 'p') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy53; + if (yych != 'e') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'd') goto yy53; + if (yych != 'd') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy53; + if (yych != '-') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'f') goto yy53; + if (yych != 'r') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy53; + if (yych != 'a') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'u') goto yy53; + if (yych != 'n') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy53; + if (yych != 'g') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy53; + if (yych != 'e') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy53; + if (yych >= 0x01) goto yy52; ++YYCURSOR; #line 81 "../src/conf/parse_opts.re" - { warn.set (Warn::NAKED_DEFAULT, option); goto opt; } -#line 360 "src/conf/parse_opts.cc" -yy96: + { warn.set (Warn::SWAPPED_RANGE, option); goto opt; } +#line 374 "src/conf/parse_opts.cc" +yy104: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy53; + if (yych != 't') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'c') goto yy53; + if (yych != 'c') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'h') goto yy53; + if (yych != 'h') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy53; + if (yych != '-') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy53; + if (yych != 'e') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'm') goto yy53; + if (yych != 'm') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'p') goto yy53; + if (yych != 'p') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy53; + if (yych != 't') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'y') goto yy53; + if (yych != 'y') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy53; + if (yych != '-') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy53; + if (yych != 's') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy53; + if (yych != 't') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy53; + if (yych != 'r') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy53; + if (yych != 'i') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy53; + if (yych != 'n') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'g') goto yy53; + if (yych != 'g') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy53; + if (yych >= 0x01) goto yy52; ++YYCURSOR; #line 80 "../src/conf/parse_opts.re" - { warn.set (Warn::MATCH_EMPTY_STRING, option); goto opt; } -#line 399 "src/conf/parse_opts.cc" -yy115: + { warn.set (Warn::MATCH_EMPTY_STRING, option); goto opt; } +#line 413 "src/conf/parse_opts.cc" +yy123: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'p') goto yy53; + if (yych != 'p') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy53; + if (yych != 't') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'y') goto yy53; + if (yych != 'y') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy53; + if (yych != '-') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'c') goto yy53; + if (yych != 'c') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'h') goto yy53; + if (yych != 'h') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy53; + if (yych != 'a') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy53; + if (yych != 'r') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy53; + if (yych != 'a') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'c') goto yy53; + if (yych != 'c') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy53; + if (yych != 't') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy53; + if (yych != 'e') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy53; + if (yych != 'r') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy53; + if (yych != '-') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'c') goto yy53; + if (yych != 'c') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy53; + if (yych != 'l') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy53; + if (yych != 'a') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy53; + if (yych != 's') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy53; + if (yych != 's') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy53; + if (yych >= 0x01) goto yy52; ++YYCURSOR; #line 79 "../src/conf/parse_opts.re" - { warn.set (Warn::EMPTY_CHARACTER_CLASS, option); goto opt; } -#line 444 "src/conf/parse_opts.cc" -yy137: + { warn.set (Warn::EMPTY_CHARACTER_CLASS, option); goto opt; } +#line 458 "src/conf/parse_opts.cc" +yy145: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy53; + if (yych != 'n') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'd') goto yy53; + if (yych != 'd') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy53; + if (yych != 'i') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy53; + if (yych != 't') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy53; + if (yych != 'i') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy53; + if (yych != 'o') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy53; + if (yych != 'n') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy53; + if (yych != '-') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy53; + if (yych != 'o') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy53; + if (yych != 'r') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'd') goto yy53; + if (yych != 'd') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy53; + if (yych != 'e') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy53; + if (yych != 'r') goto yy52; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy53; + if (yych >= 0x01) goto yy52; ++YYCURSOR; #line 78 "../src/conf/parse_opts.re" - { warn.set (Warn::CONDITION_ORDER, option); goto opt; } -#line 477 "src/conf/parse_opts.cc" + { warn.set (Warn::CONDITION_ORDER, option); goto opt; } +#line 491 "src/conf/parse_opts.cc" } #line 84 "../src/conf/parse_opts.re" opt_short: -#line 484 "src/conf/parse_opts.cc" +#line 498 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; if (yych <= 'c') { if (yych <= 'C') { if (yych <= '7') { - if (yych <= 0x00) goto yy155; - if (yych == '1') goto yy159; - goto yy157; + if (yych <= 0x00) goto yy163; + if (yych == '1') goto yy167; + goto yy165; } else { - if (yych <= '8') goto yy161; - if (yych == '?') goto yy163; - goto yy157; + if (yych <= '8') goto yy169; + if (yych == '?') goto yy171; + goto yy165; } } else { if (yych <= 'U') { - if (yych <= 'D') goto yy165; - if (yych == 'F') goto yy167; - goto yy157; + if (yych <= 'D') goto yy173; + if (yych == 'F') goto yy175; + goto yy165; } else { - if (yych <= 'V') goto yy169; - if (yych <= 'a') goto yy157; - if (yych <= 'b') goto yy171; - goto yy173; + if (yych <= 'V') goto yy177; + if (yych <= 'a') goto yy165; + if (yych <= 'b') goto yy179; + goto yy181; } } } else { if (yych <= 'o') { if (yych <= 'g') { - if (yych <= 'd') goto yy175; - if (yych <= 'e') goto yy177; - if (yych <= 'f') goto yy179; - goto yy181; + if (yych <= 'd') goto yy183; + if (yych <= 'e') goto yy185; + if (yych <= 'f') goto yy187; + goto yy189; } else { - if (yych <= 'h') goto yy163; - if (yych <= 'i') goto yy183; - if (yych <= 'n') goto yy157; - goto yy185; + if (yych <= 'h') goto yy171; + if (yych <= 'i') goto yy191; + if (yych <= 'n') goto yy165; + goto yy193; } } else { if (yych <= 't') { - if (yych <= 'q') goto yy157; - if (yych <= 'r') goto yy187; - if (yych <= 's') goto yy189; - goto yy191; + if (yych <= 'q') goto yy165; + if (yych <= 'r') goto yy195; + if (yych <= 's') goto yy197; + goto yy199; } else { if (yych <= 'v') { - if (yych <= 'u') goto yy193; - goto yy195; + if (yych <= 'u') goto yy201; + goto yy203; } else { - if (yych <= 'w') goto yy197; - if (yych <= 'x') goto yy199; - goto yy157; + if (yych <= 'w') goto yy205; + if (yych <= 'x') goto yy207; + goto yy165; } } } } -yy155: +yy163: ++YYCURSOR; #line 93 "../src/conf/parse_opts.re" { goto opt; } -#line 546 "src/conf/parse_opts.cc" -yy157: +#line 560 "src/conf/parse_opts.cc" +yy165: ++YYCURSOR; #line 89 "../src/conf/parse_opts.re" { error ("bad short option: %s", *argv); return EXIT_FAIL; } -#line 554 "src/conf/parse_opts.cc" -yy159: +#line 568 "src/conf/parse_opts.cc" +yy167: ++YYCURSOR; #line 116 "../src/conf/parse_opts.re" { goto opt_short; } -#line 559 "src/conf/parse_opts.cc" -yy161: +#line 573 "src/conf/parse_opts.cc" +yy169: ++YYCURSOR; #line 111 "../src/conf/parse_opts.re" { if (!opts.utf_8 ()) { error_encoding (); return EXIT_FAIL; } goto opt_short; } -#line 564 "src/conf/parse_opts.cc" -yy163: +#line 578 "src/conf/parse_opts.cc" +yy171: ++YYCURSOR; #line 94 "../src/conf/parse_opts.re" { usage (); return EXIT_OK; } -#line 569 "src/conf/parse_opts.cc" -yy165: +#line 583 "src/conf/parse_opts.cc" +yy173: ++YYCURSOR; #line 100 "../src/conf/parse_opts.re" { opts.emit_dot (); goto opt_short; } -#line 574 "src/conf/parse_opts.cc" -yy167: +#line 588 "src/conf/parse_opts.cc" +yy175: ++YYCURSOR; #line 102 "../src/conf/parse_opts.re" { opts.flex_syntax (); goto opt_short; } -#line 579 "src/conf/parse_opts.cc" -yy169: +#line 593 "src/conf/parse_opts.cc" +yy177: ++YYCURSOR; #line 96 "../src/conf/parse_opts.re" { vernum (); return EXIT_OK; } -#line 584 "src/conf/parse_opts.cc" -yy171: +#line 598 "src/conf/parse_opts.cc" +yy179: ++YYCURSOR; #line 97 "../src/conf/parse_opts.re" { opts.bit_vectors (); goto opt_short; } -#line 589 "src/conf/parse_opts.cc" -yy173: +#line 603 "src/conf/parse_opts.cc" +yy181: ++YYCURSOR; #line 98 "../src/conf/parse_opts.re" { opts.start_conditions (); goto opt_short; } -#line 594 "src/conf/parse_opts.cc" -yy175: +#line 608 "src/conf/parse_opts.cc" +yy183: ++YYCURSOR; #line 99 "../src/conf/parse_opts.re" { opts.debug_output (); goto opt_short; } -#line 599 "src/conf/parse_opts.cc" -yy177: +#line 613 "src/conf/parse_opts.cc" +yy185: ++YYCURSOR; #line 107 "../src/conf/parse_opts.re" { if (!opts.ecb ()) { error_encoding (); return EXIT_FAIL; } goto opt_short; } -#line 604 "src/conf/parse_opts.cc" -yy179: +#line 618 "src/conf/parse_opts.cc" +yy187: ++YYCURSOR; #line 101 "../src/conf/parse_opts.re" { opts.storable_state (); goto opt_short; } -#line 609 "src/conf/parse_opts.cc" -yy181: +#line 623 "src/conf/parse_opts.cc" +yy189: ++YYCURSOR; #line 103 "../src/conf/parse_opts.re" { opts.computed_gotos (); goto opt_short; } -#line 614 "src/conf/parse_opts.cc" -yy183: +#line 628 "src/conf/parse_opts.cc" +yy191: ++YYCURSOR; #line 104 "../src/conf/parse_opts.re" { opts.no_debug_info (); goto opt_short; } -#line 619 "src/conf/parse_opts.cc" -yy185: +#line 633 "src/conf/parse_opts.cc" +yy193: ++YYCURSOR; - if ((yych = (YYCTYPE)*YYCURSOR) <= 0x00) goto yy203; + if ((yych = (YYCTYPE)*YYCURSOR) <= 0x00) goto yy211; #line 113 "../src/conf/parse_opts.re" { *argv = YYCURSOR; goto opt_output; } -#line 625 "src/conf/parse_opts.cc" -yy187: +#line 639 "src/conf/parse_opts.cc" +yy195: ++YYCURSOR; #line 105 "../src/conf/parse_opts.re" { opts.reusable (); goto opt_short; } -#line 630 "src/conf/parse_opts.cc" -yy189: +#line 644 "src/conf/parse_opts.cc" +yy197: ++YYCURSOR; #line 106 "../src/conf/parse_opts.re" { opts.nested_ifs (); goto opt_short; } -#line 635 "src/conf/parse_opts.cc" -yy191: +#line 649 "src/conf/parse_opts.cc" +yy199: ++YYCURSOR; - if ((yych = (YYCTYPE)*YYCURSOR) <= 0x00) goto yy201; + if ((yych = (YYCTYPE)*YYCURSOR) <= 0x00) goto yy209; #line 115 "../src/conf/parse_opts.re" { *argv = YYCURSOR; goto opt_header; } -#line 641 "src/conf/parse_opts.cc" -yy193: +#line 655 "src/conf/parse_opts.cc" +yy201: ++YYCURSOR; #line 108 "../src/conf/parse_opts.re" { if (!opts.unicode ()) { error_encoding (); return EXIT_FAIL; } goto opt_short; } -#line 646 "src/conf/parse_opts.cc" -yy195: +#line 660 "src/conf/parse_opts.cc" +yy203: ++YYCURSOR; #line 95 "../src/conf/parse_opts.re" { version (); return EXIT_OK; } -#line 651 "src/conf/parse_opts.cc" -yy197: +#line 665 "src/conf/parse_opts.cc" +yy205: ++YYCURSOR; #line 109 "../src/conf/parse_opts.re" { if (!opts.wide_chars ()) { error_encoding (); return EXIT_FAIL; } goto opt_short; } -#line 656 "src/conf/parse_opts.cc" -yy199: +#line 670 "src/conf/parse_opts.cc" +yy207: ++YYCURSOR; #line 110 "../src/conf/parse_opts.re" { if (!opts.utf_16 ()) { error_encoding (); return EXIT_FAIL; } goto opt_short; } -#line 661 "src/conf/parse_opts.cc" -yy201: +#line 675 "src/conf/parse_opts.cc" +yy209: ++YYCURSOR; #line 114 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-t, --type-header"); return EXIT_FAIL; } goto opt_header; } -#line 666 "src/conf/parse_opts.cc" -yy203: +#line 680 "src/conf/parse_opts.cc" +yy211: ++YYCURSOR; #line 112 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-o, --output"); return EXIT_FAIL; } goto opt_output; } -#line 671 "src/conf/parse_opts.cc" +#line 685 "src/conf/parse_opts.cc" } #line 117 "../src/conf/parse_opts.re" opt_long: -#line 678 "src/conf/parse_opts.cc" +#line 692 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; switch (yych) { - case 'b': goto yy209; - case 'c': goto yy210; - case 'd': goto yy211; - case 'e': goto yy212; - case 'f': goto yy213; - case 'h': goto yy214; - case 'i': goto yy215; - case 'n': goto yy216; - case 'o': goto yy217; - case 'r': goto yy218; - case 's': goto yy219; - case 't': goto yy220; - case 'u': goto yy221; - case 'v': goto yy222; - case 'w': goto yy223; - default: goto yy207; + case 'b': goto yy217; + case 'c': goto yy218; + case 'd': goto yy219; + case 'e': goto yy220; + case 'f': goto yy221; + case 'h': goto yy222; + case 'i': goto yy223; + case 'n': goto yy224; + case 'o': goto yy225; + case 'r': goto yy226; + case 's': goto yy227; + case 't': goto yy228; + case 'u': goto yy229; + case 'v': goto yy230; + case 'w': goto yy231; + default: goto yy215; } -yy207: +yy215: ++YYCURSOR; -yy208: +yy216: #line 122 "../src/conf/parse_opts.re" { error ("bad long option: %s", *argv); return EXIT_FAIL; } -#line 708 "src/conf/parse_opts.cc" -yy209: +#line 722 "src/conf/parse_opts.cc" +yy217: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'i') goto yy505; - goto yy208; -yy210: + if (yych == 'i') goto yy513; + goto yy216; +yy218: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'a') goto yy465; - if (yych == 'o') goto yy466; - goto yy208; -yy211: + if (yych == 'a') goto yy473; + if (yych == 'o') goto yy474; + goto yy216; +yy219: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'e') goto yy452; - goto yy208; -yy212: + if (yych == 'e') goto yy460; + goto yy216; +yy220: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= 'l') { - if (yych == 'c') goto yy414; - goto yy208; + if (yych == 'c') goto yy422; + goto yy216; } else { - if (yych <= 'm') goto yy412; - if (yych <= 'n') goto yy413; - goto yy208; + if (yych <= 'm') goto yy420; + if (yych <= 'n') goto yy421; + goto yy216; } -yy213: +yy221: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'l') goto yy400; - goto yy208; -yy214: + if (yych == 'l') goto yy408; + goto yy216; +yy222: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'e') goto yy395; - goto yy208; -yy215: + if (yych == 'e') goto yy403; + goto yy216; +yy223: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'n') goto yy389; - goto yy208; -yy216: + if (yych == 'n') goto yy397; + goto yy216; +yy224: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'e') goto yy348; - if (yych == 'o') goto yy347; - goto yy208; -yy217: + if (yych == 'e') goto yy356; + if (yych == 'o') goto yy355; + goto yy216; +yy225: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'u') goto yy340; - goto yy208; -yy218: + if (yych == 'u') goto yy348; + goto yy216; +yy226: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'e') goto yy331; - goto yy208; -yy219: + if (yych == 'e') goto yy339; + goto yy216; +yy227: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= 'j') { - if (yych == 'i') goto yy279; - goto yy208; + if (yych == 'i') goto yy287; + goto yy216; } else { - if (yych <= 'k') goto yy280; - if (yych == 't') goto yy281; - goto yy208; + if (yych <= 'k') goto yy288; + if (yych == 't') goto yy289; + goto yy216; } -yy220: +yy228: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'y') goto yy267; - goto yy208; -yy221: + if (yych == 'y') goto yy275; + goto yy216; +yy229: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'n') goto yy250; - if (yych == 't') goto yy249; - goto yy208; -yy222: + if (yych == 'n') goto yy258; + if (yych == 't') goto yy257; + goto yy216; +yy230: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'e') goto yy236; - goto yy208; -yy223: + if (yych == 'e') goto yy244; + goto yy216; +yy231: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych != 'i') goto yy208; + if (yych != 'i') goto yy216; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'd') goto yy226; -yy225: + if (yych == 'd') goto yy234; +yy233: YYCURSOR = YYMARKER; - goto yy208; -yy226: + goto yy216; +yy234: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'c') goto yy225; + if (yych != 'c') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'h') goto yy225; + if (yych != 'h') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy225; + if (yych != 'a') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy225; + if (yych != 'r') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy225; + if (yych != 's') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 145 "../src/conf/parse_opts.re" { if (!opts.wide_chars ()) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 808 "src/conf/parse_opts.cc" -yy236: +#line 822 "src/conf/parse_opts.cc" +yy244: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy225; + if (yych != 'r') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy238; - if (yych == 's') goto yy239; - goto yy225; -yy238: + if (yych == 'n') goto yy246; + if (yych == 's') goto yy247; + goto yy233; +yy246: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'u') goto yy245; - goto yy225; -yy239: + if (yych == 'u') goto yy253; + goto yy233; +yy247: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy225; + if (yych != 'i') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy225; + if (yych != 'o') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy225; + if (yych != 'n') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 127 "../src/conf/parse_opts.re" { version (); return EXIT_OK; } -#line 832 "src/conf/parse_opts.cc" -yy245: +#line 846 "src/conf/parse_opts.cc" +yy253: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'm') goto yy225; + if (yych != 'm') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 128 "../src/conf/parse_opts.re" { vernum (); return EXIT_OK; } -#line 841 "src/conf/parse_opts.cc" -yy249: +#line 855 "src/conf/parse_opts.cc" +yy257: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'f') goto yy258; - goto yy225; -yy250: + if (yych == 'f') goto yy266; + goto yy233; +yy258: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy225; + if (yych != 'i') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'c') goto yy225; + if (yych != 'c') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy225; + if (yych != 'o') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'd') goto yy225; + if (yych != 'd') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 144 "../src/conf/parse_opts.re" { if (!opts.unicode ()) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 862 "src/conf/parse_opts.cc" -yy258: +#line 876 "src/conf/parse_opts.cc" +yy266: yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych == '1') goto yy260; - if (yych == '8') goto yy261; - goto yy225; -yy260: + if (yych == '1') goto yy268; + if (yych == '8') goto yy269; + goto yy233; +yy268: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '6') goto yy264; - goto yy225; -yy261: + if (yych == '6') goto yy272; + goto yy233; +yy269: yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 147 "../src/conf/parse_opts.re" { if (!opts.utf_8 ()) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 880 "src/conf/parse_opts.cc" -yy264: +#line 894 "src/conf/parse_opts.cc" +yy272: yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 146 "../src/conf/parse_opts.re" { if (!opts.utf_16 ()) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 887 "src/conf/parse_opts.cc" -yy267: +#line 901 "src/conf/parse_opts.cc" +yy275: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'p') goto yy225; + if (yych != 'p') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'h') goto yy225; + if (yych != 'h') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy225; + if (yych != 'a') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'd') goto yy225; + if (yych != 'd') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy225; + if (yych != 'r') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 149 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-t, --type-header"); return EXIT_FAIL; } goto opt_header; } -#line 912 "src/conf/parse_opts.cc" -yy279: +#line 926 "src/conf/parse_opts.cc" +yy287: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy320; - goto yy225; -yy280: + if (yych == 'n') goto yy328; + goto yy233; +yy288: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy312; - goto yy225; -yy281: + if (yych == 'e') goto yy320; + goto yy233; +yy289: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy282; - if (yych == 'o') goto yy283; - goto yy225; -yy282: + if (yych == 'a') goto yy290; + if (yych == 'o') goto yy291; + goto yy233; +yy290: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy297; - goto yy225; -yy283: + if (yych == 'r') goto yy305; + goto yy233; +yy291: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy225; + if (yych != 'r') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy225; + if (yych != 'a') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'b') goto yy225; + if (yych != 'b') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy225; + if (yych != 'l') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy225; + if (yych != 's') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy225; + if (yych != 'a') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 133 "../src/conf/parse_opts.re" { opts.storable_state (); goto opt; } -#line 958 "src/conf/parse_opts.cc" -yy297: +#line 972 "src/conf/parse_opts.cc" +yy305: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'c') goto yy225; + if (yych != 'c') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy225; + if (yych != 'o') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy225; + if (yych != 'n') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'd') goto yy225; + if (yych != 'd') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy225; + if (yych != 'i') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy225; + if (yych != 'i') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy225; + if (yych != 'o') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy225; + if (yych != 'n') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy225; + if (yych != 's') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 130 "../src/conf/parse_opts.re" { opts.start_conditions (); goto opt; } -#line 989 "src/conf/parse_opts.cc" -yy312: +#line 1003 "src/conf/parse_opts.cc" +yy320: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy225; + if (yych != 'l') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy225; + if (yych != 'o') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy225; + if (yych != 'n') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 142 "../src/conf/parse_opts.re" { opts.skeleton (); goto opt; } -#line 1006 "src/conf/parse_opts.cc" -yy320: +#line 1020 "src/conf/parse_opts.cc" +yy328: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'g') goto yy225; + if (yych != 'g') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy225; + if (yych != 'l') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'p') goto yy225; + if (yych != 'p') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy225; + if (yych != 'a') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy225; + if (yych != 's') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy225; + if (yych != 's') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 153 "../src/conf/parse_opts.re" { goto opt; } -#line 1029 "src/conf/parse_opts.cc" -yy331: +#line 1043 "src/conf/parse_opts.cc" +yy339: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'u') goto yy225; + if (yych != 'u') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy225; + if (yych != 's') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy225; + if (yych != 'a') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'b') goto yy225; + if (yych != 'b') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy225; + if (yych != 'l') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 137 "../src/conf/parse_opts.re" { opts.reusable (); goto opt; } -#line 1048 "src/conf/parse_opts.cc" -yy340: +#line 1062 "src/conf/parse_opts.cc" +yy348: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'p') goto yy225; + if (yych != 'p') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'u') goto yy225; + if (yych != 'u') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 148 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-o, --output"); return EXIT_FAIL; } goto opt_output; } -#line 1063 "src/conf/parse_opts.cc" -yy347: +#line 1077 "src/conf/parse_opts.cc" +yy355: yych = (YYCTYPE)*++YYCURSOR; - if (yych == '-') goto yy359; - goto yy225; -yy348: + if (yych == '-') goto yy367; + goto yy233; +yy356: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy225; + if (yych != 's') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'd') goto yy225; + if (yych != 'd') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy225; + if (yych != 'i') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'f') goto yy225; + if (yych != 'f') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy225; + if (yych != 's') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 138 "../src/conf/parse_opts.re" { opts.nested_ifs (); goto opt; } -#line 1090 "src/conf/parse_opts.cc" -yy359: +#line 1104 "src/conf/parse_opts.cc" +yy367: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'd') goto yy361; - if (yych != 'g') goto yy225; + if (yych == 'd') goto yy369; + if (yych != 'g') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy373; - goto yy225; -yy361: + if (yych == 'e') goto yy381; + goto yy233; +yy369: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'b') goto yy225; + if (yych != 'b') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'u') goto yy225; + if (yych != 'u') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'g') goto yy225; + if (yych != 'g') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy225; + if (yych != 'i') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy225; + if (yych != 'n') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'f') goto yy225; + if (yych != 'f') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy225; + if (yych != 'o') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 136 "../src/conf/parse_opts.re" { opts.no_debug_info (); goto opt; } -#line 1122 "src/conf/parse_opts.cc" -yy373: +#line 1136 "src/conf/parse_opts.cc" +yy381: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy225; + if (yych != 'n') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy225; + if (yych != 'r') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy225; + if (yych != 'a') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy225; + if (yych != 'i') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy225; + if (yych != 'o') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy225; + if (yych != 'n') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'd') goto yy225; + if (yych != 'd') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy225; + if (yych != 'a') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 139 "../src/conf/parse_opts.re" { opts.no_generation_date (); goto opt; } -#line 1155 "src/conf/parse_opts.cc" -yy389: +#line 1169 "src/conf/parse_opts.cc" +yy397: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'p') goto yy225; + if (yych != 'p') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'u') goto yy225; + if (yych != 'u') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 151 "../src/conf/parse_opts.re" { goto opt_input; } -#line 1168 "src/conf/parse_opts.cc" -yy395: +#line 1182 "src/conf/parse_opts.cc" +yy403: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy225; + if (yych != 'l') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'p') goto yy225; + if (yych != 'p') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 126 "../src/conf/parse_opts.re" { usage (); return EXIT_OK; } -#line 1179 "src/conf/parse_opts.cc" -yy400: +#line 1193 "src/conf/parse_opts.cc" +yy408: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'x') goto yy225; + if (yych != 'x') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy225; + if (yych != 's') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'y') goto yy225; + if (yych != 'y') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy225; + if (yych != 'n') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy225; + if (yych != 'a') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'x') goto yy225; + if (yych != 'x') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 134 "../src/conf/parse_opts.re" { opts.flex_syntax (); goto opt; } -#line 1204 "src/conf/parse_opts.cc" -yy412: +#line 1218 "src/conf/parse_opts.cc" +yy420: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy433; - if (yych == 'p') goto yy434; - goto yy225; -yy413: + if (yych == 'i') goto yy441; + if (yych == 'p') goto yy442; + goto yy233; +yy421: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy418; - goto yy225; -yy414: + if (yych == 'c') goto yy426; + goto yy233; +yy422: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'b') goto yy225; + if (yych != 'b') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 143 "../src/conf/parse_opts.re" { if (!opts.ecb ()) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 1222 "src/conf/parse_opts.cc" -yy418: +#line 1236 "src/conf/parse_opts.cc" +yy426: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy225; + if (yych != 'o') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'd') goto yy225; + if (yych != 'd') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy225; + if (yych != 'i') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy225; + if (yych != 'n') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'g') goto yy225; + if (yych != 'g') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'p') goto yy225; + if (yych != 'p') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy225; + if (yych != 'o') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy225; + if (yych != 'l') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy225; + if (yych != 'i') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'c') goto yy225; + if (yych != 'c') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'y') goto yy225; + if (yych != 'y') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 150 "../src/conf/parse_opts.re" { goto opt_encoding_policy; } -#line 1253 "src/conf/parse_opts.cc" -yy433: +#line 1267 "src/conf/parse_opts.cc" +yy441: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy445; - goto yy225; -yy434: + if (yych == 't') goto yy453; + goto yy233; +yy442: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'y') goto yy225; + if (yych != 'y') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'c') goto yy225; + if (yych != 'c') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy225; + if (yych != 'l') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy225; + if (yych != 'a') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy225; + if (yych != 's') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy225; + if (yych != 's') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 152 "../src/conf/parse_opts.re" { goto opt_empty_class; } -#line 1280 "src/conf/parse_opts.cc" -yy445: +#line 1294 "src/conf/parse_opts.cc" +yy453: yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'd') goto yy225; + if (yych != 'd') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy225; + if (yych != 'o') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 132 "../src/conf/parse_opts.re" { opts.emit_dot (); goto opt; } -#line 1295 "src/conf/parse_opts.cc" -yy452: +#line 1309 "src/conf/parse_opts.cc" +yy460: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'b') goto yy225; + if (yych != 'b') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'u') goto yy225; + if (yych != 'u') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'g') goto yy225; + if (yych != 'g') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy225; + if (yych != 'o') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'u') goto yy225; + if (yych != 'u') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'p') goto yy225; + if (yych != 'p') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'u') goto yy225; + if (yych != 'u') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 131 "../src/conf/parse_opts.re" { opts.debug_output (); goto opt; } -#line 1322 "src/conf/parse_opts.cc" -yy465: +#line 1336 "src/conf/parse_opts.cc" +yy473: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy481; - goto yy225; -yy466: + if (yych == 's') goto yy489; + goto yy233; +yy474: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'm') goto yy225; + if (yych != 'm') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'p') goto yy225; + if (yych != 'p') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'u') goto yy225; + if (yych != 'u') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'd') goto yy225; + if (yych != 'd') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'g') goto yy225; + if (yych != 'g') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy225; + if (yych != 'o') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy225; + if (yych != 'o') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy225; + if (yych != 's') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 135 "../src/conf/parse_opts.re" { opts.computed_gotos (); goto opt; } -#line 1357 "src/conf/parse_opts.cc" -yy481: +#line 1371 "src/conf/parse_opts.cc" +yy489: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy225; + if (yych != 'i') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy225; + if (yych != 'n') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy487; - if (yych != 'v') goto yy225; + if (yych == 's') goto yy495; + if (yych != 'v') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy498; - goto yy225; -yy487: + if (yych == 'e') goto yy506; + goto yy233; +yy495: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy225; + if (yych != 'n') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy225; + if (yych != 's') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy225; + if (yych != 'i') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy225; + if (yych != 'i') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'v') goto yy225; + if (yych != 'v') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 140 "../src/conf/parse_opts.re" { opts.case_insensitive (); goto opt; } -#line 1395 "src/conf/parse_opts.cc" -yy498: +#line 1409 "src/conf/parse_opts.cc" +yy506: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy225; + if (yych != 'r') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'd') goto yy225; + if (yych != 'd') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 141 "../src/conf/parse_opts.re" { opts.case_inverted (); goto opt; } -#line 1410 "src/conf/parse_opts.cc" -yy505: +#line 1424 "src/conf/parse_opts.cc" +yy513: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy225; + if (yych != '-') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'v') goto yy225; + if (yych != 'v') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy225; + if (yych != 'e') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'c') goto yy225; + if (yych != 'c') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy225; + if (yych != 't') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy225; + if (yych != 'o') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy225; + if (yych != 'r') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy225; + if (yych != 's') goto yy233; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy225; + if (yych >= 0x01) goto yy233; ++YYCURSOR; #line 129 "../src/conf/parse_opts.re" { opts.bit_vectors (); goto opt; } -#line 1435 "src/conf/parse_opts.cc" +#line 1449 "src/conf/parse_opts.cc" } #line 154 "../src/conf/parse_opts.re" opt_output: -#line 1442 "src/conf/parse_opts.cc" +#line 1456 "src/conf/parse_opts.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -1476,37 +1490,37 @@ opt_output: 128, 128, 128, 128, 128, 128, 128, 128, }; yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x00) goto yy519; - if (yych != '-') goto yy521; -yy519: + if (yych <= 0x00) goto yy527; + if (yych != '-') goto yy529; +yy527: ++YYCURSOR; #line 159 "../src/conf/parse_opts.re" { error ("bad argument to option -o, --output: %s", *argv); return EXIT_FAIL; } -#line 1489 "src/conf/parse_opts.cc" -yy521: +#line 1503 "src/conf/parse_opts.cc" +yy529: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - goto yy523; -yy522: + goto yy531; +yy530: ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; -yy523: +yy531: if (yybm[0+yych] & 128) { - goto yy522; + goto yy530; } ++YYCURSOR; #line 163 "../src/conf/parse_opts.re" { if (!opts.output (*argv)) return EXIT_FAIL; goto opt; } -#line 1503 "src/conf/parse_opts.cc" +#line 1517 "src/conf/parse_opts.cc" } #line 164 "../src/conf/parse_opts.re" opt_header: -#line 1510 "src/conf/parse_opts.cc" +#line 1524 "src/conf/parse_opts.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -1544,30 +1558,30 @@ opt_header: 128, 128, 128, 128, 128, 128, 128, 128, }; yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x00) goto yy528; - if (yych != '-') goto yy530; -yy528: + if (yych <= 0x00) goto yy536; + if (yych != '-') goto yy538; +yy536: ++YYCURSOR; #line 169 "../src/conf/parse_opts.re" { error ("bad argument to option -t, --type-header: %s", *argv); return EXIT_FAIL; } -#line 1557 "src/conf/parse_opts.cc" -yy530: +#line 1571 "src/conf/parse_opts.cc" +yy538: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - goto yy532; -yy531: + goto yy540; +yy539: ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; -yy532: +yy540: if (yybm[0+yych] & 128) { - goto yy531; + goto yy539; } ++YYCURSOR; #line 173 "../src/conf/parse_opts.re" { if (!opts.type_header (*argv)) return EXIT_FAIL; goto opt; } -#line 1571 "src/conf/parse_opts.cc" +#line 1585 "src/conf/parse_opts.cc" } #line 174 "../src/conf/parse_opts.re" @@ -1579,87 +1593,87 @@ opt_encoding_policy: return EXIT_FAIL; } -#line 1583 "src/conf/parse_opts.cc" +#line 1597 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; if (yych <= 'h') { - if (yych == 'f') goto yy539; + if (yych == 'f') goto yy547; } else { - if (yych <= 'i') goto yy540; - if (yych == 's') goto yy541; + if (yych <= 'i') goto yy548; + if (yych == 's') goto yy549; } ++YYCURSOR; -yy538: +yy546: #line 184 "../src/conf/parse_opts.re" { error ("bad argument to option --encoding-policy (expected: ignore | substitute | fail): %s", *argv); return EXIT_FAIL; } -#line 1600 "src/conf/parse_opts.cc" -yy539: +#line 1614 "src/conf/parse_opts.cc" +yy547: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'a') goto yy561; - goto yy538; -yy540: + if (yych == 'a') goto yy569; + goto yy546; +yy548: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'g') goto yy554; - goto yy538; -yy541: + if (yych == 'g') goto yy562; + goto yy546; +yy549: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych != 'u') goto yy538; + if (yych != 'u') goto yy546; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'b') goto yy544; -yy543: + if (yych == 'b') goto yy552; +yy551: YYCURSOR = YYMARKER; - goto yy538; -yy544: + goto yy546; +yy552: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy543; + if (yych != 's') goto yy551; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy543; + if (yych != 't') goto yy551; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy543; + if (yych != 'i') goto yy551; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy543; + if (yych != 't') goto yy551; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'u') goto yy543; + if (yych != 'u') goto yy551; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy543; + if (yych != 't') goto yy551; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy543; + if (yych != 'e') goto yy551; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy543; + if (yych >= 0x01) goto yy551; ++YYCURSOR; #line 189 "../src/conf/parse_opts.re" { opts.encoding_policy (Enc::POLICY_SUBSTITUTE); goto opt; } -#line 1637 "src/conf/parse_opts.cc" -yy554: +#line 1651 "src/conf/parse_opts.cc" +yy562: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy543; + if (yych != 'n') goto yy551; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy543; + if (yych != 'o') goto yy551; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy543; + if (yych != 'r') goto yy551; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy543; + if (yych != 'e') goto yy551; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy543; + if (yych >= 0x01) goto yy551; ++YYCURSOR; #line 188 "../src/conf/parse_opts.re" { opts.encoding_policy (Enc::POLICY_IGNORE); goto opt; } -#line 1652 "src/conf/parse_opts.cc" -yy561: +#line 1666 "src/conf/parse_opts.cc" +yy569: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy543; + if (yych != 'i') goto yy551; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy543; + if (yych != 'l') goto yy551; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy543; + if (yych >= 0x01) goto yy551; ++YYCURSOR; #line 190 "../src/conf/parse_opts.re" { opts.encoding_policy (Enc::POLICY_FAIL); goto opt; } -#line 1663 "src/conf/parse_opts.cc" +#line 1677 "src/conf/parse_opts.cc" } #line 191 "../src/conf/parse_opts.re" @@ -1671,64 +1685,64 @@ opt_input: return EXIT_FAIL; } -#line 1675 "src/conf/parse_opts.cc" +#line 1689 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; - if (yych <= 'b') goto yy568; - if (yych <= 'c') goto yy570; - if (yych <= 'd') goto yy571; -yy568: + if (yych <= 'b') goto yy576; + if (yych <= 'c') goto yy578; + if (yych <= 'd') goto yy579; +yy576: ++YYCURSOR; -yy569: +yy577: #line 201 "../src/conf/parse_opts.re" { error ("bad argument to option --input (expected: default | custom): %s", *argv); return EXIT_FAIL; } -#line 1690 "src/conf/parse_opts.cc" -yy570: +#line 1704 "src/conf/parse_opts.cc" +yy578: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'u') goto yy581; - goto yy569; -yy571: + if (yych == 'u') goto yy589; + goto yy577; +yy579: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych != 'e') goto yy569; + if (yych != 'e') goto yy577; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'f') goto yy574; -yy573: + if (yych == 'f') goto yy582; +yy581: YYCURSOR = YYMARKER; - goto yy569; -yy574: + goto yy577; +yy582: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy573; + if (yych != 'a') goto yy581; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'u') goto yy573; + if (yych != 'u') goto yy581; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy573; + if (yych != 'l') goto yy581; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy573; + if (yych != 't') goto yy581; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy573; + if (yych >= 0x01) goto yy581; ++YYCURSOR; #line 205 "../src/conf/parse_opts.re" { opts.input (InputAPI::DEFAULT); goto opt; } -#line 1717 "src/conf/parse_opts.cc" -yy581: +#line 1731 "src/conf/parse_opts.cc" +yy589: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy573; + if (yych != 's') goto yy581; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy573; + if (yych != 't') goto yy581; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy573; + if (yych != 'o') goto yy581; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'm') goto yy573; + if (yych != 'm') goto yy581; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy573; + if (yych >= 0x01) goto yy581; ++YYCURSOR; #line 206 "../src/conf/parse_opts.re" { opts.input (InputAPI::CUSTOM); goto opt; } -#line 1732 "src/conf/parse_opts.cc" +#line 1746 "src/conf/parse_opts.cc" } #line 207 "../src/conf/parse_opts.re" @@ -1740,86 +1754,86 @@ opt_empty_class: return EXIT_FAIL; } -#line 1744 "src/conf/parse_opts.cc" +#line 1758 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; - if (yych == 'e') goto yy592; - if (yych == 'm') goto yy593; + if (yych == 'e') goto yy600; + if (yych == 'm') goto yy601; ++YYCURSOR; -yy591: +yy599: #line 217 "../src/conf/parse_opts.re" { error ("bad argument to option --empty-class (expected: match-empty | match-none | error): %s", *argv); return EXIT_FAIL; } -#line 1757 "src/conf/parse_opts.cc" -yy592: +#line 1771 "src/conf/parse_opts.cc" +yy600: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'r') goto yy613; - goto yy591; -yy593: + if (yych == 'r') goto yy621; + goto yy599; +yy601: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych != 'a') goto yy591; + if (yych != 'a') goto yy599; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy596; -yy595: + if (yych == 't') goto yy604; +yy603: YYCURSOR = YYMARKER; - goto yy591; -yy596: + goto yy599; +yy604: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'c') goto yy595; + if (yych != 'c') goto yy603; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'h') goto yy595; + if (yych != 'h') goto yy603; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy595; + if (yych != '-') goto yy603; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy600; - if (yych == 'n') goto yy601; - goto yy595; -yy600: + if (yych == 'e') goto yy608; + if (yych == 'n') goto yy609; + goto yy603; +yy608: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'm') goto yy607; - goto yy595; -yy601: + if (yych == 'm') goto yy615; + goto yy603; +yy609: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy595; + if (yych != 'o') goto yy603; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy595; + if (yych != 'n') goto yy603; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy595; + if (yych != 'e') goto yy603; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy595; + if (yych >= 0x01) goto yy603; ++YYCURSOR; #line 222 "../src/conf/parse_opts.re" { opts.empty_class (EMPTY_CLASS_MATCH_NONE); goto opt; } -#line 1797 "src/conf/parse_opts.cc" -yy607: +#line 1811 "src/conf/parse_opts.cc" +yy615: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'p') goto yy595; + if (yych != 'p') goto yy603; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy595; + if (yych != 't') goto yy603; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'y') goto yy595; + if (yych != 'y') goto yy603; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy595; + if (yych >= 0x01) goto yy603; ++YYCURSOR; #line 221 "../src/conf/parse_opts.re" { opts.empty_class (EMPTY_CLASS_MATCH_EMPTY); goto opt; } -#line 1810 "src/conf/parse_opts.cc" -yy613: +#line 1824 "src/conf/parse_opts.cc" +yy621: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy595; + if (yych != 'r') goto yy603; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy595; + if (yych != 'o') goto yy603; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy595; + if (yych != 'r') goto yy603; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy595; + if (yych >= 0x01) goto yy603; ++YYCURSOR; #line 223 "../src/conf/parse_opts.re" { opts.empty_class (EMPTY_CLASS_ERROR); goto opt; } -#line 1823 "src/conf/parse_opts.cc" +#line 1837 "src/conf/parse_opts.cc" } #line 224 "../src/conf/parse_opts.re" diff --git a/re2c/src/codegen/emit_dfa.cc b/re2c/src/codegen/emit_dfa.cc index b971fa86..e6be4915 100644 --- a/re2c/src/codegen/emit_dfa.cc +++ b/re2c/src/codegen/emit_dfa.cc @@ -229,7 +229,7 @@ void DFA::emit(Output & output, uint32_t& ind, const std::string& condName, bool } if (flag_skeleton) { - skeleton::emit_epilog (o, ind); + emit_epilog (o, ind); } // Cleanup diff --git a/re2c/src/codegen/prepare_dfa.cc b/re2c/src/codegen/prepare_dfa.cc index cbe2c4f0..397ab4bb 100644 --- a/re2c/src/codegen/prepare_dfa.cc +++ b/re2c/src/codegen/prepare_dfa.cc @@ -154,7 +154,7 @@ void DFA::findBaseState() operator delete (span); } -void DFA::prepare(OutputFile & o, uint32_t & max_fill, const std::string & cond) +void DFA::prepare(OutputFile & o, uint32_t & max_fill) { bUsedYYBitmap = false; @@ -248,12 +248,6 @@ void DFA::prepare(OutputFile & o, uint32_t & max_fill, const std::string & cond) lb = head->go.span[i].ub; } - // warn if default case is not handled - if (default_state && !stray_cunits.empty () && !empty_rule) - { - warn.naked_default (o.get_block_line (), stray_cunits, cond); - } - // warn about not shadowed rule that matches empty string if (empty_rule && !stray_cunits.empty ()) { diff --git a/re2c/src/codegen/skeleton/control_flow.cc b/re2c/src/codegen/skeleton/control_flow.cc new file mode 100644 index 00000000..19e19199 --- /dev/null +++ b/re2c/src/codegen/skeleton/control_flow.cc @@ -0,0 +1,57 @@ +#include "src/codegen/skeleton/skeleton.h" + +namespace re2c +{ + +// see note [estimating total size of paths in skeleton] +// neither do we need all default paths, nor default path cover: +// just one path per each default final state, the shorter the better +arccount_t Node::generate_paths_default (const multipath_t & prefix, std::vector & paths) +{ + if (!rule.is_none ()) + { + return arccount_t (0u); + } + else if (end ()) + { + paths.push_back (prefix); + return arccount_t (prefix.len ()); + } + else if (loop < 2) + { + local_inc _ (loop); + arccount_t size (0u); + for (arcsets_t::iterator i = arcsets.begin (); i != arcsets.end (); ++i) + { + multipath_t p = prefix; + p.extend (&i->second); + size = size + i->first->generate_paths_default (p, paths); + if (size.overflow ()) + { + return arccount_t::limit (); + } + } + return size; + } + else + { + return arccount_t (0u); + } +} + +void Skeleton::warn_undefined_control_flow (uint32_t line, const std::string & cond) +{ + multipath_t prefix; + std::vector paths; + const bool overflow = nodes->generate_paths_default (prefix, paths).overflow (); + if (!paths.empty ()) + { + warn.undefined_control_flow (line, cond, paths, overflow); + } + else if (overflow) + { + warn.fail (Warn::UNDEFINED_CONTROL_FLOW, line, "DFA is too large to check undefined control flow"); + } +} + +} // namespace re2c diff --git a/re2c/src/codegen/skeleton/multipath.cc b/re2c/src/codegen/skeleton/multipath.cc new file mode 100644 index 00000000..aad4ab75 --- /dev/null +++ b/re2c/src/codegen/skeleton/multipath.cc @@ -0,0 +1,71 @@ +#include "src/codegen/skeleton/multipath.h" + +namespace re2c +{ + +multipath_t::multipath_t () + : arcs () +{} + +size_t multipath_t::len () const +{ + return arcs.size (); +} + +void multipath_t::extend (const arc_t * arc) +{ + arcs.push_back (arc); +} + +void multipath_t::fprint_arc (FILE * f, const arc_t & arc) +{ + const size_t ranges = arc.size (); + if (ranges == 1 && arc[0].first == arc[0].second) + { + fprintf (f, "\\x%X", arc[0].first); + } + else + { + fprintf (f, "["); + for (size_t i = 0; i < ranges; ++i) + { + const uint32_t l = arc[i].first; + const uint32_t u = arc[i].second; + fprintf (f, "\\x%X", l); + if (l != u) + { + fprintf (f, "-\\x%X", u); + } + } + fprintf (f, "]"); + } +} + +void multipath_t::fprint (FILE * f) const +{ + fprintf (f, "'"); + const size_t len = arcs.size (); + for (size_t i = 0 ; i < len; ++i) + { + if (i > 0) + { + fprintf (f, " "); + } + if (arcs[i] == NULL) + { + fprintf (stderr, "(nil)"); + } + else + { + fprint_arc (stderr, *arcs[i]); + } + } + fprintf (f, "'"); +} + +bool multipath_t::compare (const multipath_t & x, const multipath_t & y) +{ + return x.arcs.size () < y.arcs.size (); +} + +} // namespace re2c diff --git a/re2c/src/codegen/skeleton/multipath.h b/re2c/src/codegen/skeleton/multipath.h new file mode 100644 index 00000000..ab6a30f8 --- /dev/null +++ b/re2c/src/codegen/skeleton/multipath.h @@ -0,0 +1,33 @@ +#ifndef _RE2C_CODEGEN_SKELETON_MULTIPATH_ +#define _RE2C_CODEGEN_SKELETON_MULTIPATH_ + +#include +#include + +#include "src/util/c99_stdint.h" + +namespace re2c +{ + +class multipath_t +{ +public: + typedef std::vector > arc_t; + +private: + std::vector arcs; + +public: + multipath_t (); + size_t len () const; + void extend (const arc_t * arc); + void fprint (FILE * f) const; + static bool compare (const multipath_t & x, const multipath_t & y); + +private: + static void fprint_arc (FILE * f, const arc_t & arc); +}; + +} // namespace re2c + +#endif // _RE2C_CODEGEN_SKELETON_MULTIPATH_ diff --git a/re2c/src/codegen/skeleton/path.cc b/re2c/src/codegen/skeleton/path.cc index 750e8aea..e83b507e 100644 --- a/re2c/src/codegen/skeleton/path.cc +++ b/re2c/src/codegen/skeleton/path.cc @@ -3,9 +3,6 @@ namespace re2c { -namespace skeleton -{ - Path::Path (const chars_t & cs, size_t l, rule_rank_t r) : chars (cs) , length (l) @@ -41,6 +38,4 @@ void Path::append (const Path * p) } } -} // namespace skeleton - } // namespace re2c diff --git a/re2c/src/codegen/skeleton/path.h b/re2c/src/codegen/skeleton/path.h index 9fc2cbf7..6aaa4a83 100644 --- a/re2c/src/codegen/skeleton/path.h +++ b/re2c/src/codegen/skeleton/path.h @@ -9,9 +9,6 @@ namespace re2c { -namespace skeleton -{ - struct Path { typedef std::vector chars_t; @@ -26,8 +23,6 @@ struct Path void append (const Path * p); }; -} // namespace skeleton - } // namespace re2c #endif // _RE2C_CODEGEN_SKELETON_PATH_ diff --git a/re2c/src/codegen/skeleton/skeleton.cc b/re2c/src/codegen/skeleton/skeleton.cc index a974c978..6cb75bff 100644 --- a/re2c/src/codegen/skeleton/skeleton.cc +++ b/re2c/src/codegen/skeleton/skeleton.cc @@ -7,11 +7,9 @@ namespace re2c { -namespace skeleton -{ - Node::Node (const State * s, const s2n_map & s2n) : arcs () + , arcsets () , loop (0) , rule (rule_rank_t::none ()) , path_len_init (false) @@ -37,11 +35,13 @@ Node::Node (const State * s, const s2n_map & s2n) { const Span & span = s->go.span[i]; Node * n = s2n.find (span.to)->second; + const uint32_t ub = span.ub - 1; arcs[n].push_back (lb); - if (lb != span.ub - 1) + if (lb != ub) { - arcs[n].push_back (span.ub - 1); + arcs[n].push_back (ub); } + arcsets[n].push_back (std::make_pair (lb, ub)); lb = span.ub; } } @@ -371,6 +371,4 @@ void emit_epilog (OutputFile & o, uint32_t ind) o << indent (ind) << "}\n"; } -} // namespace skeleton - } // namespace re2c diff --git a/re2c/src/codegen/skeleton/skeleton.h b/re2c/src/codegen/skeleton/skeleton.h index b4f05a71..3a624db2 100644 --- a/re2c/src/codegen/skeleton/skeleton.h +++ b/re2c/src/codegen/skeleton/skeleton.h @@ -3,6 +3,7 @@ #include +#include "src/codegen/skeleton/multipath.h" #include "src/codegen/skeleton/path.h" #include "src/ir/dfa/dfa.h" #include "src/util/c99_stdint.h" @@ -14,9 +15,6 @@ namespace re2c { -namespace skeleton -{ - static const uint32_t ARC_LIMIT = 1024 * 1024 * 1024; // ~1Gb typedef u32lim_t arccount_t; @@ -24,11 +22,13 @@ struct Node { typedef std::map s2n_map; typedef std::map > arcs_t; + typedef std::map arcsets_t; typedef local_increment_t local_inc; typedef wrap_iterator_t wrap_iter; // outgoing arcs arcs_t arcs; + arcsets_t arcsets; // how many times this node has been visited // (controls looping in graph traversals) @@ -49,6 +49,7 @@ struct Node arccount_t estimate_size_cover (arccount_t inarcs, arccount_t len); void generate_paths_all (const std::vector & prefixes, std::vector & results); void generate_paths_cover (const std::vector & prefixes, std::vector & results); + arccount_t generate_paths_default (const multipath_t & prefix, std::vector & paths); FORBID_COPY (Node); }; @@ -60,6 +61,7 @@ struct Skeleton Skeleton (const DFA & dfa); ~Skeleton (); void generate_paths (std::vector & results); + void warn_undefined_control_flow (uint32_t line, const std::string & cond); void emit_data (DataFile & o); FORBID_COPY (Skeleton); @@ -68,8 +70,6 @@ struct Skeleton void emit_prolog (OutputFile & o, uint32_t ind, const char * data_name); void emit_epilog (OutputFile & o, uint32_t ind); -} // namespace skeleton - } // namespace re2c #endif // _RE2C_CODEGEN_SKELETON_SKELETON_ diff --git a/re2c/src/conf/msg.cc b/re2c/src/conf/msg.cc index ca89cce6..a23abaa4 100644 --- a/re2c/src/conf/msg.cc +++ b/re2c/src/conf/msg.cc @@ -29,18 +29,28 @@ void error_arg (const char * option) error ("expected argument to option %s", option); } -void warning (const char * type, uint32_t line, bool error, const char * fmt, ...) +void warning_start (uint32_t line, bool error) { static const char * msg = error ? "error" : "warning"; fprintf (stderr, "re2c: %s: line %u: ", msg, line); +} + +void warning_end (const char * type, bool error) +{ + const char * prefix = error ? "error-" : ""; + fprintf (stderr, " [-W%s%s]\n", prefix, type); +} + +void warning (const char * type, uint32_t line, bool error, const char * fmt, ...) +{ + warning_start (line, error); va_list args; va_start (args, fmt); vfprintf (stderr, fmt, args); va_end (args); - const char * prefix = error ? "error-" : ""; - fprintf (stderr, " [-W%s%s]\n", prefix, type); + warning_end (type, error); } void usage () diff --git a/re2c/src/conf/msg.h b/re2c/src/conf/msg.h index f3397d7c..d9a4b326 100644 --- a/re2c/src/conf/msg.h +++ b/re2c/src/conf/msg.h @@ -9,6 +9,8 @@ namespace re2c { void error (const char * fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 1, 2))); void error_encoding (); void error_arg (const char * option); +void warning_start (uint32_t line, bool error); +void warning_end (const char * type, bool error); void warning (const char * type, uint32_t line, bool error, const char * fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 4, 5))); void usage (); void vernum (); diff --git a/re2c/src/conf/parse_opts.re b/re2c/src/conf/parse_opts.re index e3e8aa52..5cc208ef 100644 --- a/re2c/src/conf/parse_opts.re +++ b/re2c/src/conf/parse_opts.re @@ -75,12 +75,12 @@ opt_warn: error ("bad warning: %s", *argv); return EXIT_FAIL; } - "condition-order" end { warn.set (Warn::CONDITION_ORDER, option); goto opt; } - "empty-character-class" end { warn.set (Warn::EMPTY_CHARACTER_CLASS, option); goto opt; } - "match-empty-string" end { warn.set (Warn::MATCH_EMPTY_STRING, option); goto opt; } - "naked-default" end { warn.set (Warn::NAKED_DEFAULT, option); goto opt; } - "swapped-range" end { warn.set (Warn::SWAPPED_RANGE, option); goto opt; } - "useless-escape" end { warn.set (Warn::USELESS_ESCAPE, option); goto opt; } + "condition-order" end { warn.set (Warn::CONDITION_ORDER, option); goto opt; } + "empty-character-class" end { warn.set (Warn::EMPTY_CHARACTER_CLASS, option); goto opt; } + "match-empty-string" end { warn.set (Warn::MATCH_EMPTY_STRING, option); goto opt; } + "swapped-range" end { warn.set (Warn::SWAPPED_RANGE, option); goto opt; } + "undefined-control-flow" end { warn.set (Warn::UNDEFINED_CONTROL_FLOW, option); goto opt; } + "useless-escape" end { warn.set (Warn::USELESS_ESCAPE, option); goto opt; } */ opt_short: diff --git a/re2c/src/conf/warn.cc b/re2c/src/conf/warn.cc index 3d16da92..f96cb61c 100644 --- a/re2c/src/conf/warn.cc +++ b/re2c/src/conf/warn.cc @@ -1,5 +1,6 @@ -#include -#include +#include +#include +#include #include "src/codegen/print.h" #include "src/conf/msg.h" @@ -73,6 +74,15 @@ void Warn::set_all_error () } } +void Warn::fail (type_t t, uint32_t line, const char * s) +{ + if (mask[t] & WARNING) + { + // -Werror has no effect + warning (names[t], line, false, "%s", s); + } +} + void Warn::condition_order (uint32_t line) { if (mask[CONDITION_ORDER] & WARNING) @@ -106,39 +116,63 @@ void Warn::match_empty_string (uint32_t line) } } -void Warn::naked_default (uint32_t line, const std::vector > & stray_cunits, const std::string & cond) +void Warn::swapped_range (uint32_t line, uint32_t l, uint32_t u) { - if (mask[NAKED_DEFAULT] & WARNING) + if (mask[SWAPPED_RANGE] & WARNING) { - const bool e = mask[NAKED_DEFAULT] & ERROR; + const bool e = mask[SWAPPED_RANGE] & ERROR; error_accuml |= e; - std::ostringstream cunits; - for (uint32_t i = 0; i < stray_cunits.size (); ++i) - { - printSpan (cunits, stray_cunits[i].first, stray_cunits[i].second); - } - const char * cond_prefix = cond == "" - ? "" - : " in condition "; - warning - ( names[NAKED_DEFAULT] - , line - , e - , "naked default case%s%s (stray code units: %s), better add default rule *" - , cond_prefix - , cond.c_str () - , cunits.str ().c_str () - ); + warning (names[SWAPPED_RANGE], line, e, "range lower bound (0x%X) is greater than upper bound (0x%X), swapping", l, u); } } -void Warn::swapped_range (uint32_t line, uint32_t l, uint32_t u) +void Warn::undefined_control_flow (uint32_t line, const std::string & cond, std::vector & paths, bool overflow) { - if (mask[SWAPPED_RANGE] & WARNING) + if (mask[UNDEFINED_CONTROL_FLOW] & WARNING) { - const bool e = mask[SWAPPED_RANGE] & ERROR; + const bool e = mask[UNDEFINED_CONTROL_FLOW] & ERROR; error_accuml |= e; - warning (names[SWAPPED_RANGE], line, e, "range lower bound (0x%X) is greater than upper bound (0x%X), swapping", l, u); + + // limit the number of patterns reported + static const size_t MAX = 8; + const size_t all = paths.size (); + const size_t some = std::min (MAX, all); + const size_t rest = all - some; + + // report shorter patterns first + std::vector::iterator middle = paths.begin (); + std::advance (middle, some); + std::partial_sort (paths.begin (), middle, paths.end (), multipath_t::compare); + + warning_start (line, e); + fprintf (stderr, "control flow "); + if (!cond.empty ()) + { + fprintf (stderr, "in condition '%s' ", cond.c_str ()); + } + fprintf (stderr, "is undefined for strings that match "); + if (some == 1) + { + paths[0].fprint (stderr); + } + else + { + for (size_t i = 0; i < some; ++i) + { + fprintf (stderr, "\n\t"); + paths[i].fprint (stderr); + } + fprintf (stderr, "\n"); + } + if (rest > 0) + { + const char * at_least = overflow + ? "at least " + : ""; + fprintf (stderr, " ... and %s%lu more", at_least, rest); + } + fprintf (stderr, ", use default rule '*'"); + warning_end (names[UNDEFINED_CONTROL_FLOW], e); } } diff --git a/re2c/src/conf/warn.h b/re2c/src/conf/warn.h index 1c52c314..ecfec094 100644 --- a/re2c/src/conf/warn.h +++ b/re2c/src/conf/warn.h @@ -3,17 +3,18 @@ #include +#include "src/codegen/skeleton/multipath.h" #include "src/util/c99_stdint.h" namespace re2c { #define RE2C_WARNING_TYPES \ - W (CONDITION_ORDER, "condition-order"), \ - W (EMPTY_CHARACTER_CLASS, "empty-character-class"), \ - W (MATCH_EMPTY_STRING, "match-empty-string"), \ - W (NAKED_DEFAULT, "naked-default"), \ - W (SWAPPED_RANGE, "swapped-range"), \ - W (USELESS_ESCAPE, "useless-escape"), + W (CONDITION_ORDER, "condition-order"), \ + W (EMPTY_CHARACTER_CLASS, "empty-character-class"), \ + W (MATCH_EMPTY_STRING, "match-empty-string"), \ + W (SWAPPED_RANGE, "swapped-range"), \ + W (UNDEFINED_CONTROL_FLOW, "undefined-control-flow"), \ + W (USELESS_ESCAPE, "useless-escape"), class Warn { @@ -47,11 +48,13 @@ public: void set (type_t t, option_t o); void set_all (); void set_all_error (); + void fail (type_t t, uint32_t line, const char * s); + void condition_order (uint32_t line); void empty_class (uint32_t line); void match_empty_string (uint32_t line); - void naked_default (uint32_t line, const std::vector > & stray_cunits, const std::string & cond); void swapped_range (uint32_t line, uint32_t l, uint32_t u); + void undefined_control_flow (uint32_t line, const std::string & cond, std::vector & paths, bool overflow); void useless_escape (uint32_t line, uint32_t col, char c); }; diff --git a/re2c/src/ir/bytecode/bytecode.cc b/re2c/src/ir/bytecode/bytecode.cc index a14b2d58..b38ff8c2 100644 --- a/re2c/src/ir/bytecode/bytecode.cc +++ b/re2c/src/ir/bytecode/bytecode.cc @@ -55,13 +55,17 @@ smart_ptr genCode (RegExp *re, Output & output, uint32_t ind, const std::st } smart_ptr dfa = make_smart_ptr(new DFA(ins, size, 0, encoding.nCodeUnits(), rep)); + + Skeleton skeleton (*dfa); + skeleton.warn_undefined_control_flow (output.source.get_block_line (), cond); + if (flag_skeleton) { - skeleton::Skeleton skeleton (*dfa); skeleton.emit_data (output.data); - skeleton::emit_prolog (output.source, ind, output.data.file_name.c_str ()); + emit_prolog (output.source, ind, output.data.file_name.c_str ()); } - dfa->prepare (output.source, output.max_fill, cond); + + dfa->prepare (output.source, output.max_fill); return dfa; } diff --git a/re2c/src/ir/dfa/dfa.h b/re2c/src/ir/dfa/dfa.h index 59d96a10..90acd5f7 100644 --- a/re2c/src/ir/dfa/dfa.h +++ b/re2c/src/ir/dfa/dfa.h @@ -32,7 +32,7 @@ public: void findSCCs (); void findBaseState (); - void prepare (OutputFile & o, uint32_t &, const std::string & cond); + void prepare (OutputFile & o, uint32_t &); void count_used_labels (std::set & used, label_t prolog, label_t start, bool force_start) const; void emit (Output &, uint32_t &, const std::string &, bool, bool &); diff --git a/re2c/test/bug1454253b.s.c b/re2c/test/bug1454253b.s.c index a88578fa..efc01dc0 100644 --- a/re2c/test/bug1454253b.s.c +++ b/re2c/test/bug1454253b.s.c @@ -1,4 +1,4 @@ -re2c: warning: line 38: naked default case (stray code units: [?]), better add default rule * [-Wnaked-default] +re2c: warning: line 38: control flow is undefined for strings that match '\x3F [\x0-\x20\x22-\x2F\x3A-\x40\x5B-\x60\x7B-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "bug1454253b.s.re" #include diff --git a/re2c/test/bug47_dot_escapes.D.c b/re2c/test/bug47_dot_escapes.D.c index f862fcf6..8c0577ce 100644 --- a/re2c/test/bug47_dot_escapes.D.c +++ b/re2c/test/bug47_dot_escapes.D.c @@ -1,4 +1,4 @@ -re2c: warning: line 14: naked default case (stray code units: [0x00-0x06][0x0E-!][#-&][(-[][0x5D-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 14: control flow is undefined for strings that match '[\x0-\x6\xE-\x21\x23-\x26\x28-\x5B\x5D-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ digraph re2c { diff --git a/re2c/test/bug59_bogus_yyaccept.ci.c b/re2c/test/bug59_bogus_yyaccept.ci.c index d6ba3b46..86fc9829 100644 --- a/re2c/test/bug59_bogus_yyaccept.ci.c +++ b/re2c/test/bug59_bogus_yyaccept.ci.c @@ -1,5 +1,5 @@ -re2c: warning: line 10: naked default case in condition c1 (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 10: naked default case in condition c2 (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 10: control flow in condition 'c1' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 10: control flow in condition 'c2' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ { diff --git a/re2c/test/bug60_redundant_yymarker.ci.c b/re2c/test/bug60_redundant_yymarker.ci.c index 418671ab..ca8c8e0a 100644 --- a/re2c/test/bug60_redundant_yymarker.ci.c +++ b/re2c/test/bug60_redundant_yymarker.ci.c @@ -1,4 +1,4 @@ -re2c: warning: line 9: naked default case in condition c2 (stray code units: [0x00-c][e-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 9: control flow in condition 'c2' is undefined for strings that match '[\x0-\x63\x65-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ { diff --git a/re2c/test/bug61.i--empty-class(match-none).c b/re2c/test/bug61.i--empty-class(match-none).c index d35fe94c..298f8d09 100644 --- a/re2c/test/bug61.i--empty-class(match-none).c +++ b/re2c/test/bug61.i--empty-class(match-none).c @@ -1,17 +1,17 @@ re2c: warning: line 2: empty character class [-Wempty-character-class] -re2c: warning: line 3: naked default case (stray code units: [0x00-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 6: empty character class [-Wempty-character-class] -re2c: warning: line 7: naked default case (stray code units: [0x00-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 7: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 10: empty character class [-Wempty-character-class] -re2c: warning: line 11: naked default case (stray code units: [0x00-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 11: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 14: empty character class [-Wempty-character-class] re2c: warning: line 14: empty character class [-Wempty-character-class] re2c: warning: line 14: empty character class [-Wempty-character-class] -re2c: warning: line 15: naked default case (stray code units: [0x00-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 15: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 18: empty character class [-Wempty-character-class] re2c: warning: line 18: empty character class [-Wempty-character-class] re2c: warning: line 18: empty character class [-Wempty-character-class] -re2c: warning: line 19: naked default case (stray code units: [0x00-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 19: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ { diff --git a/re2c/test/bug61_difference_full.i--empty-class(match-none).c b/re2c/test/bug61_difference_full.i--empty-class(match-none).c index 7f095d57..5da7b28c 100644 --- a/re2c/test/bug61_difference_full.i--empty-class(match-none).c +++ b/re2c/test/bug61_difference_full.i--empty-class(match-none).c @@ -1,5 +1,5 @@ re2c: warning: line 2: empty character class [-Wempty-character-class] -re2c: warning: line 3: naked default case (stray code units: [0x00-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ { diff --git a/re2c/test/bug61_difference_negative.i--empty-class(match-none).c b/re2c/test/bug61_difference_negative.i--empty-class(match-none).c index e4fed2de..64e78ff0 100644 --- a/re2c/test/bug61_difference_negative.i--empty-class(match-none).c +++ b/re2c/test/bug61_difference_negative.i--empty-class(match-none).c @@ -1,7 +1,7 @@ re2c: warning: line 2: empty character class [-Wempty-character-class] re2c: warning: line 2: empty character class [-Wempty-character-class] re2c: warning: line 2: empty character class [-Wempty-character-class] -re2c: warning: line 3: naked default case (stray code units: [0x00-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ { diff --git a/re2c/test/bug61_difference_positive.i--empty-class(match-none).c b/re2c/test/bug61_difference_positive.i--empty-class(match-none).c index e4fed2de..64e78ff0 100644 --- a/re2c/test/bug61_difference_positive.i--empty-class(match-none).c +++ b/re2c/test/bug61_difference_positive.i--empty-class(match-none).c @@ -1,7 +1,7 @@ re2c: warning: line 2: empty character class [-Wempty-character-class] re2c: warning: line 2: empty character class [-Wempty-character-class] re2c: warning: line 2: empty character class [-Wempty-character-class] -re2c: warning: line 3: naked default case (stray code units: [0x00-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ { diff --git a/re2c/test/bug61_negative.i--empty-class(match-none).c b/re2c/test/bug61_negative.i--empty-class(match-none).c index 7f095d57..5da7b28c 100644 --- a/re2c/test/bug61_negative.i--empty-class(match-none).c +++ b/re2c/test/bug61_negative.i--empty-class(match-none).c @@ -1,5 +1,5 @@ re2c: warning: line 2: empty character class [-Wempty-character-class] -re2c: warning: line 3: naked default case (stray code units: [0x00-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ { diff --git a/re2c/test/bug61_positive.i--empty-class(match-none).c b/re2c/test/bug61_positive.i--empty-class(match-none).c index 7f095d57..5da7b28c 100644 --- a/re2c/test/bug61_positive.i--empty-class(match-none).c +++ b/re2c/test/bug61_positive.i--empty-class(match-none).c @@ -1,5 +1,5 @@ re2c: warning: line 2: empty character class [-Wempty-character-class] -re2c: warning: line 3: naked default case (stray code units: [0x00-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ { diff --git a/re2c/test/casing-flags.i--case-insensitive.c b/re2c/test/casing-flags.i--case-insensitive.c index b7f04643..d9adb194 100644 --- a/re2c/test/casing-flags.i--case-insensitive.c +++ b/re2c/test/casing-flags.i--case-insensitive.c @@ -1,4 +1,4 @@ -re2c: warning: line 4: naked default case (stray code units: [0x00-@][C-`][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 4: control flow is undefined for strings that match '[\x0-\x40\x43-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ { diff --git a/re2c/test/casing-flags.i--case-inverted.c b/re2c/test/casing-flags.i--case-inverted.c index 95613eef..26aa5cdc 100644 --- a/re2c/test/casing-flags.i--case-inverted.c +++ b/re2c/test/casing-flags.i--case-inverted.c @@ -1,4 +1,4 @@ -re2c: warning: line 4: naked default case (stray code units: [0x00-@][B-`][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 4: control flow is undefined for strings that match '[\x0-\x40\x42-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ { diff --git a/re2c/test/casing-flags.i.c b/re2c/test/casing-flags.i.c index 8d277791..cc31ef38 100644 --- a/re2c/test/casing-flags.i.c +++ b/re2c/test/casing-flags.i.c @@ -1,4 +1,4 @@ -re2c: warning: line 4: naked default case (stray code units: [0x00-A][C-`][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 4: control flow is undefined for strings that match '[\x0-\x41\x43-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ { diff --git a/re2c/test/code_points.8.c b/re2c/test/code_points.8.c index e0d8496d..3b5f9097 100644 --- a/re2c/test/code_points.8.c +++ b/re2c/test/code_points.8.c @@ -1,7 +1,37 @@ -re2c: warning: line 3: naked default case (stray code units: [0x00][0x01][0x02-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 7: naked default case (stray code units: [0x00][0x01][0x02-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 11: naked default case (stray code units: [0x00][0x0A][0x80-0xC1][0xC2-0xC3][0xC4-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 15: naked default case (stray code units: [0x01-0x09][0x0B-0xC3][0xC4-0xDF][0xE0][0xE1-0xEF][0xF0][0xF1-0xF3][0xF4][0xF5-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\x0\x2-\xFF]' + '\x1 [\x0-\x1\x3-\xFF]' + '\x1 \x2 [\x0-\x2\x4-\xFF]' + '\x1 \x2 \x3 [\x0-\x3\x5-\xFF]' + '\x1 \x2 \x3 \x4 [\x0-\x4\x6-\xFF]' + '\x1 \x2 \x3 \x4 \x5 [\x0-\x5\x7-\xFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 [\x0-\x6\x8-\xFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 \x7 [\x0-\x7\x9-\xFF]' + ... and 374 more, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 7: control flow is undefined for strings that match + '[\x0\x2-\xFF]' + '\x1 [\x0-\x1\x3-\xFF]' + '\x1 \x2 [\x0-\x2\x4-\xFF]' + '\x1 \x2 \x3 [\x0-\x3\x5-\xFF]' + '\x1 \x2 \x3 \x4 [\x0-\x4\x6-\xFF]' + '\x1 \x2 \x3 \x4 \x5 [\x0-\x5\x7-\xFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 [\x0-\x6\x8-\xFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 \x7 [\x0-\x7\x9-\xFF]' + ... and 374 more, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 11: control flow is undefined for strings that match + '[\x0\xA\x80-\xC1\xC4-\xFF]' + '[\xC2-\xC3] [\x0-\x7F\xC0-\xFF]' +, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 15: control flow is undefined for strings that match + '[\x1-\x9\xB-\xC3\xF5-\xFF]' + '\xF0 [\x0-\x8F\xC0-\xFF]' + '[\xE1-\xEF] [\x0-\x7F\xC0-\xFF]' + '\xF4 [\x0-\x7F\x90-\xFF]' + '\xE0 [\x0-\x9F\xC0-\xFF]' + '[\xF1-\xF3] [\x0-\x7F\xC0-\xFF]' + '[\xC4-\xDF] [\x0-\x7F\xC0-\xFF]' + '\xE0 [\xA0-\xBF] [\x0-\x7F\xC0-\xFF]' + ... and 7 more, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "code_points.8.re" diff --git a/re2c/test/code_points.c b/re2c/test/code_points.c index 71d0ea0c..f2f03a90 100644 --- a/re2c/test/code_points.c +++ b/re2c/test/code_points.c @@ -1,7 +1,25 @@ -re2c: warning: line 3: naked default case (stray code units: [0x00][0x01][0x02-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 7: naked default case (stray code units: [0x00][0x01][0x02-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 11: naked default case (stray code units: [0x00][0x0A]), better add default rule * [-Wnaked-default] -re2c: warning: line 15: naked default case (stray code units: [0x01-0x09][0x0B-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\x0\x2-\xFF]' + '\x1 [\x0-\x1\x3-\xFF]' + '\x1 \x2 [\x0-\x2\x4-\xFF]' + '\x1 \x2 \x3 [\x0-\x3\x5-\xFF]' + '\x1 \x2 \x3 \x4 [\x0-\x4\x6-\xFF]' + '\x1 \x2 \x3 \x4 \x5 [\x0-\x5\x7-\xFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 [\x0-\x6\x8-\xFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 \x7 [\x0-\x7\x9-\xFF]' + ... and 246 more, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 7: control flow is undefined for strings that match + '[\x0\x2-\xFF]' + '\x1 [\x0-\x1\x3-\xFF]' + '\x1 \x2 [\x0-\x2\x4-\xFF]' + '\x1 \x2 \x3 [\x0-\x3\x5-\xFF]' + '\x1 \x2 \x3 \x4 [\x0-\x4\x6-\xFF]' + '\x1 \x2 \x3 \x4 \x5 [\x0-\x5\x7-\xFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 [\x0-\x6\x8-\xFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 \x7 [\x0-\x7\x9-\xFF]' + ... and 246 more, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 11: control flow is undefined for strings that match '[\x0\xA]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 15: control flow is undefined for strings that match '[\x1-\x9\xB-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "code_points.re" diff --git a/re2c/test/code_points.e.c b/re2c/test/code_points.e.c index 249466ca..8ff72a56 100644 --- a/re2c/test/code_points.e.c +++ b/re2c/test/code_points.e.c @@ -1,7 +1,25 @@ -re2c: warning: line 3: naked default case (stray code units: [0x00][0x01][0x02-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 7: naked default case (stray code units: [0x00][0x01][0x02-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 11: naked default case (stray code units: [0x00][0x25]), better add default rule * [-Wnaked-default] -re2c: warning: line 15: naked default case (stray code units: [0x01-0x24][0x26-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\x0\x2-\xFF]' + '\x1 [\x0-\x1\x3-\xFF]' + '\x1 \x2 [\x0-\x2\x4-\xFF]' + '\x1 \x2 \x3 [\x0-\x36\x38-\xFF]' + '\x1 \x2 \x3 \x37 [\x0-\x2C\x2E-\xFF]' + '\x1 \x2 \x3 \x37 \x2D [\x0-\x2D\x2F-\xFF]' + '\x1 \x2 \x3 \x37 \x2D \x2E [\x0-\x2E\x30-\xFF]' + '\x1 \x2 \x3 \x37 \x2D \x2E \x2F [\x0-\x15\x17-\xFF]' + ... and 246 more, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 7: control flow is undefined for strings that match + '[\x0\x2-\xFF]' + '\x1 [\x0-\x1\x3-\xFF]' + '\x1 \x2 [\x0-\x2\x4-\xFF]' + '\x1 \x2 \x3 [\x0-\x36\x38-\xFF]' + '\x1 \x2 \x3 \x37 [\x0-\x2C\x2E-\xFF]' + '\x1 \x2 \x3 \x37 \x2D [\x0-\x2D\x2F-\xFF]' + '\x1 \x2 \x3 \x37 \x2D \x2E [\x0-\x2E\x30-\xFF]' + '\x1 \x2 \x3 \x37 \x2D \x2E \x2F [\x0-\x15\x17-\xFF]' + ... and 246 more, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 11: control flow is undefined for strings that match '[\x0\x25]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 15: control flow is undefined for strings that match '[\x1-\x24\x26-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "code_points.e.re" diff --git a/re2c/test/code_points.u.c b/re2c/test/code_points.u.c index ca149304..570f6281 100644 --- a/re2c/test/code_points.u.c +++ b/re2c/test/code_points.u.c @@ -1,7 +1,25 @@ -re2c: warning: line 3: naked default case (stray code units: [0x00000000][0x00000001][0x00000002-0x0010FFFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 7: naked default case (stray code units: [0x00000000][0x00000001][0x00000002-0x0010FFFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 11: naked default case (stray code units: [0x00000000][0x0000000A][0x00000100-0x0010FFFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 15: naked default case (stray code units: [0x00000001-0x00000009][0x0000000B-0x000000FF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\x0\x2-\x10FFFF]' + '\x1 [\x0-\x1\x3-\x10FFFF]' + '\x1 \x2 [\x0-\x2\x4-\x10FFFF]' + '\x1 \x2 \x3 [\x0-\x3\x5-\x10FFFF]' + '\x1 \x2 \x3 \x4 [\x0-\x4\x6-\x10FFFF]' + '\x1 \x2 \x3 \x4 \x5 [\x0-\x5\x7-\x10FFFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 [\x0-\x6\x8-\x10FFFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 \x7 [\x0-\x7\x9-\x10FFFF]' + ... and 246 more, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 7: control flow is undefined for strings that match + '[\x0\x2-\x10FFFF]' + '\x1 [\x0-\x1\x3-\x10FFFF]' + '\x1 \x2 [\x0-\x2\x4-\x10FFFF]' + '\x1 \x2 \x3 [\x0-\x3\x5-\x10FFFF]' + '\x1 \x2 \x3 \x4 [\x0-\x4\x6-\x10FFFF]' + '\x1 \x2 \x3 \x4 \x5 [\x0-\x5\x7-\x10FFFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 [\x0-\x6\x8-\x10FFFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 \x7 [\x0-\x7\x9-\x10FFFF]' + ... and 246 more, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 11: control flow is undefined for strings that match '[\x0\xA\x100-\x10FFFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 15: control flow is undefined for strings that match '[\x1-\x9\xB-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "code_points.u.re" diff --git a/re2c/test/code_points.w.c b/re2c/test/code_points.w.c index c36af7a2..c721a011 100644 --- a/re2c/test/code_points.w.c +++ b/re2c/test/code_points.w.c @@ -1,7 +1,25 @@ -re2c: warning: line 3: naked default case (stray code units: [0x0000][0x0001][0x0002-0xFFFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 7: naked default case (stray code units: [0x0000][0x0001][0x0002-0xFFFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 11: naked default case (stray code units: [0x0000][0x000A][0x0100-0xFFFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 15: naked default case (stray code units: [0x0001-0x0009][0x000B-0x00FF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\x0\x2-\xFFFF]' + '\x1 [\x0-\x1\x3-\xFFFF]' + '\x1 \x2 [\x0-\x2\x4-\xFFFF]' + '\x1 \x2 \x3 [\x0-\x3\x5-\xFFFF]' + '\x1 \x2 \x3 \x4 [\x0-\x4\x6-\xFFFF]' + '\x1 \x2 \x3 \x4 \x5 [\x0-\x5\x7-\xFFFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 [\x0-\x6\x8-\xFFFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 \x7 [\x0-\x7\x9-\xFFFF]' + ... and 246 more, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 7: control flow is undefined for strings that match + '[\x0\x2-\xFFFF]' + '\x1 [\x0-\x1\x3-\xFFFF]' + '\x1 \x2 [\x0-\x2\x4-\xFFFF]' + '\x1 \x2 \x3 [\x0-\x3\x5-\xFFFF]' + '\x1 \x2 \x3 \x4 [\x0-\x4\x6-\xFFFF]' + '\x1 \x2 \x3 \x4 \x5 [\x0-\x5\x7-\xFFFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 [\x0-\x6\x8-\xFFFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 \x7 [\x0-\x7\x9-\xFFFF]' + ... and 246 more, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 11: control flow is undefined for strings that match '[\x0\xA\x100-\xFFFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 15: control flow is undefined for strings that match '[\x1-\x9\xB-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "code_points.w.re" diff --git a/re2c/test/code_points.x.c b/re2c/test/code_points.x.c index 58fb54d1..2aafa4aa 100644 --- a/re2c/test/code_points.x.c +++ b/re2c/test/code_points.x.c @@ -1,7 +1,25 @@ -re2c: warning: line 3: naked default case (stray code units: [0x0000][0x0001][0x0002-0xFFFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 7: naked default case (stray code units: [0x0000][0x0001][0x0002-0xFFFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 11: naked default case (stray code units: [0x0000][0x000A][0x0100-0xFFFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 15: naked default case (stray code units: [0x0001-0x0009][0x000B-0x00FF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\x0\x2-\xFFFF]' + '\x1 [\x0-\x1\x3-\xFFFF]' + '\x1 \x2 [\x0-\x2\x4-\xFFFF]' + '\x1 \x2 \x3 [\x0-\x3\x5-\xFFFF]' + '\x1 \x2 \x3 \x4 [\x0-\x4\x6-\xFFFF]' + '\x1 \x2 \x3 \x4 \x5 [\x0-\x5\x7-\xFFFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 [\x0-\x6\x8-\xFFFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 \x7 [\x0-\x7\x9-\xFFFF]' + ... and 246 more, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 7: control flow is undefined for strings that match + '[\x0\x2-\xFFFF]' + '\x1 [\x0-\x1\x3-\xFFFF]' + '\x1 \x2 [\x0-\x2\x4-\xFFFF]' + '\x1 \x2 \x3 [\x0-\x3\x5-\xFFFF]' + '\x1 \x2 \x3 \x4 [\x0-\x4\x6-\xFFFF]' + '\x1 \x2 \x3 \x4 \x5 [\x0-\x5\x7-\xFFFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 [\x0-\x6\x8-\xFFFF]' + '\x1 \x2 \x3 \x4 \x5 \x6 \x7 [\x0-\x7\x9-\xFFFF]' + ... and 246 more, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 11: control flow is undefined for strings that match '[\x0\xA\x100-\xFFFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 15: control flow is undefined for strings that match '[\x1-\x9\xB-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "code_points.x.re" diff --git a/re2c/test/cond_error_10.c.c b/re2c/test/cond_error_10.c.c index 9f1b573d..44e90a1c 100644 --- a/re2c/test/cond_error_10.c.c +++ b/re2c/test/cond_error_10.c.c @@ -1,3 +1,3 @@ -re2c: warning: line 8: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 8: naked default case in condition b (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 8: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 8: control flow in condition 'b' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: error: line 6, column 1: setup for non existing rule 'c' found diff --git a/re2c/test/cond_error_11.c.c b/re2c/test/cond_error_11.c.c index cfd13f21..90c177b6 100644 --- a/re2c/test/cond_error_11.c.c +++ b/re2c/test/cond_error_11.c.c @@ -1,3 +1,3 @@ -re2c: warning: line 9: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 9: naked default case in condition b (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 9: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 9: control flow in condition 'b' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: error: line 7, column 1: setup for all rules with '*' not possible when all rules are setup explicitly diff --git a/re2c/test/condition_01.c.c b/re2c/test/condition_01.c.c index 935e08d1..556be794 100644 --- a/re2c/test/condition_01.c.c +++ b/re2c/test/condition_01.c.c @@ -1,5 +1,11 @@ -re2c: warning: line 5: naked default case in condition a (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 5: naked default case in condition b (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 5: control flow in condition 'a' is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x61\x63-\xFF]' +, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 5: control flow in condition 'b' is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x61\x63-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condition_01.c.re" diff --git a/re2c/test/condition_01a.c.c b/re2c/test/condition_01a.c.c index e296a92a..14ea2934 100644 --- a/re2c/test/condition_01a.c.c +++ b/re2c/test/condition_01a.c.c @@ -1,6 +1,12 @@ re2c: warning: line 2: column 39: escape has no effect: '\/' [-Wuseless-escape] -re2c: warning: line 5: naked default case in condition a (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 5: naked default case in condition b (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 5: control flow in condition 'a' is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x61\x63-\xFF]' +, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 5: control flow in condition 'b' is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x61\x63-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condition_01a.c.re" diff --git a/re2c/test/condition_01b.c.c b/re2c/test/condition_01b.c.c index 9d7384c4..e448ef30 100644 --- a/re2c/test/condition_01b.c.c +++ b/re2c/test/condition_01b.c.c @@ -1,5 +1,11 @@ -re2c: warning: line 5: naked default case in condition a (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 5: naked default case in condition b (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 5: control flow in condition 'a' is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x61\x63-\xFF]' +, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 5: control flow in condition 'b' is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x61\x63-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condition_01b.c.re" diff --git a/re2c/test/condition_02.c.c b/re2c/test/condition_02.c.c index 07cf5e60..28feb3d9 100644 --- a/re2c/test/condition_02.c.c +++ b/re2c/test/condition_02.c.c @@ -1,6 +1,6 @@ re2c: warning: line 3: rule matches empty string [-Wmatch-empty-string] -re2c: warning: line 7: naked default case in condition r1 (stray code units: [0x00-`][c-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 7: naked default case in condition r2 (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 7: control flow in condition 'r1' is undefined for strings that match '[\x0-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 7: control flow in condition 'r2' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condition_02.c.re" diff --git a/re2c/test/condition_02.cg.c b/re2c/test/condition_02.cg.c index 63a84c2d..82188eca 100644 --- a/re2c/test/condition_02.cg.c +++ b/re2c/test/condition_02.cg.c @@ -1,6 +1,6 @@ re2c: warning: line 3: rule matches empty string [-Wmatch-empty-string] -re2c: warning: line 7: naked default case in condition r1 (stray code units: [0x00-`][c-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 7: naked default case in condition r2 (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 7: control flow in condition 'r1' is undefined for strings that match '[\x0-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 7: control flow in condition 'r2' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 7: looks like you use hardcoded numbers instead of autogenerated condition names: better add '/*!types:re2c*/' directive or '-t, --type-header' option and don't rely on fixed condition order. [-Wcondition-order] /* Generated by re2c */ #line 1 "condition_02.cg.re" diff --git a/re2c/test/condition_03.cg.c b/re2c/test/condition_03.cg.c index 603afd15..9ef2e4ee 100644 --- a/re2c/test/condition_03.cg.c +++ b/re2c/test/condition_03.cg.c @@ -1,6 +1,6 @@ re2c: warning: line 3: rule matches empty string [-Wmatch-empty-string] -re2c: warning: line 9: naked default case in condition r1 (stray code units: [0x00-0][3-`][c-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 9: naked default case in condition r2 (stray code units: [0x00-0][3-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 9: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 9: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 9: looks like you use hardcoded numbers instead of autogenerated condition names: better add '/*!types:re2c*/' directive or '-t, --type-header' option and don't rely on fixed condition order. [-Wcondition-order] /* Generated by re2c */ #line 1 "condition_03.cg.re" diff --git a/re2c/test/condition_04.cg.c b/re2c/test/condition_04.cg.c index 6b70a598..6bdbafbf 100644 --- a/re2c/test/condition_04.cg.c +++ b/re2c/test/condition_04.cg.c @@ -1,5 +1,5 @@ -re2c: warning: line 8: naked default case in condition r1 (stray code units: [0x00-0][3-`][c-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 8: naked default case in condition r2 (stray code units: [0x00-0][3-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 8: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 8: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 8: looks like you use hardcoded numbers instead of autogenerated condition names: better add '/*!types:re2c*/' directive or '-t, --type-header' option and don't rely on fixed condition order. [-Wcondition-order] /* Generated by re2c */ #line 1 "condition_04.cg.re" diff --git a/re2c/test/condition_11.cg.c b/re2c/test/condition_11.cg.c index 84f4e1c8..e7745afb 100644 --- a/re2c/test/condition_11.cg.c +++ b/re2c/test/condition_11.cg.c @@ -1,6 +1,6 @@ re2c: warning: line 3: rule matches empty string [-Wmatch-empty-string] -re2c: warning: line 9: naked default case in condition r1 (stray code units: [0x00-0][3-`][c-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 9: naked default case in condition r2 (stray code units: [0x00-0][3-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 9: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 9: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condition_11.cg.re" diff --git a/re2c/test/condition_13.cg.c b/re2c/test/condition_13.cg.c index f456b226..09f198a2 100644 --- a/re2c/test/condition_13.cg.c +++ b/re2c/test/condition_13.cg.c @@ -1,6 +1,6 @@ re2c: warning: line 3: rule matches empty string [-Wmatch-empty-string] -re2c: warning: line 9: naked default case in condition r1 (stray code units: [0x00-0][3-`][c-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 9: naked default case in condition r2 (stray code units: [0x00-0][3-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 9: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 9: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condition_13.cg.re" diff --git a/re2c/test/condtype.c.c b/re2c/test/condtype.c.c index bdd426f4..6e42f587 100644 --- a/re2c/test/condtype.c.c +++ b/re2c/test/condtype.c.c @@ -1,5 +1,5 @@ -re2c: warning: line 11: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 11: naked default case in condition b (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 11: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 11: control flow in condition 'b' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condtype.c.re" int main () diff --git a/re2c/test/condtype.cg.c b/re2c/test/condtype.cg.c index 42cfb76c..f03cc4d3 100644 --- a/re2c/test/condtype.cg.c +++ b/re2c/test/condtype.cg.c @@ -1,5 +1,5 @@ -re2c: warning: line 11: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 11: naked default case in condition b (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 11: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 11: control flow in condition 'b' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 11: looks like you use hardcoded numbers instead of autogenerated condition names: better add '/*!types:re2c*/' directive or '-t, --type-header' option and don't rely on fixed condition order. [-Wcondition-order] /* Generated by re2c */ #line 1 "condtype.cg.re" diff --git a/re2c/test/condtype.cgtcondtype.cg.h.c b/re2c/test/condtype.cgtcondtype.cg.h.c index 8827a85b..8b714e15 100644 --- a/re2c/test/condtype.cgtcondtype.cg.h.c +++ b/re2c/test/condtype.cgtcondtype.cg.h.c @@ -1,5 +1,5 @@ -re2c: warning: line 11: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 11: naked default case in condition b (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 11: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 11: control flow in condition 'b' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condtype.cgtcondtype.cg.h.re" int main () diff --git a/re2c/test/condtype.cs.c b/re2c/test/condtype.cs.c index 838aaf4b..919443cb 100644 --- a/re2c/test/condtype.cs.c +++ b/re2c/test/condtype.cs.c @@ -1,5 +1,5 @@ -re2c: warning: line 11: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 11: naked default case in condition b (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 11: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 11: control flow in condition 'b' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 11: looks like you use hardcoded numbers instead of autogenerated condition names: better add '/*!types:re2c*/' directive or '-t, --type-header' option and don't rely on fixed condition order. [-Wcondition-order] /* Generated by re2c */ #line 1 "condtype.cs.re" diff --git a/re2c/test/condtype.cstcondtype.cs.h.c b/re2c/test/condtype.cstcondtype.cs.h.c index 4d91ae24..c84d1087 100644 --- a/re2c/test/condtype.cstcondtype.cs.h.c +++ b/re2c/test/condtype.cstcondtype.cs.h.c @@ -1,5 +1,5 @@ -re2c: warning: line 11: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 11: naked default case in condition b (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 11: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 11: control flow in condition 'b' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condtype.cstcondtype.cs.h.re" int main () diff --git a/re2c/test/condtype.ctcondtype.c.h.c b/re2c/test/condtype.ctcondtype.c.h.c index b787389f..e6fbd57a 100644 --- a/re2c/test/condtype.ctcondtype.c.h.c +++ b/re2c/test/condtype.ctcondtype.c.h.c @@ -1,5 +1,5 @@ -re2c: warning: line 11: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 11: naked default case in condition b (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 11: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 11: control flow in condition 'b' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condtype.ctcondtype.c.h.re" int main () diff --git a/re2c/test/condtype_decl.c.c b/re2c/test/condtype_decl.c.c index 792e396b..6d98baa2 100644 --- a/re2c/test/condtype_decl.c.c +++ b/re2c/test/condtype_decl.c.c @@ -1,5 +1,5 @@ -re2c: warning: line 13: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 13: naked default case in condition b (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 13: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 13: control flow in condition 'b' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condtype_decl.c.re" #line 4 "" diff --git a/re2c/test/condtype_decl.cg.c b/re2c/test/condtype_decl.cg.c index 50b45b8f..7bc8de3e 100644 --- a/re2c/test/condtype_decl.cg.c +++ b/re2c/test/condtype_decl.cg.c @@ -1,5 +1,5 @@ -re2c: warning: line 13: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 13: naked default case in condition b (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 13: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 13: control flow in condition 'b' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condtype_decl.cg.re" #line 4 "" diff --git a/re2c/test/condtype_decl.cs.c b/re2c/test/condtype_decl.cs.c index 29bac287..a5159a93 100644 --- a/re2c/test/condtype_decl.cs.c +++ b/re2c/test/condtype_decl.cs.c @@ -1,5 +1,5 @@ -re2c: warning: line 13: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 13: naked default case in condition b (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 13: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 13: control flow in condition 'b' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condtype_decl.cs.re" #line 4 "" diff --git a/re2c/test/condtype_forwdecl.cg.c b/re2c/test/condtype_forwdecl.cg.c index 8182f9e9..377fdbc8 100644 --- a/re2c/test/condtype_forwdecl.cg.c +++ b/re2c/test/condtype_forwdecl.cg.c @@ -1,5 +1,5 @@ -re2c: warning: line 14: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 14: naked default case in condition b (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 14: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 14: control flow in condition 'b' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condtype_forwdecl.cg.re" enum cond_t : int; diff --git a/re2c/test/condtype_forwdecl.cs.c b/re2c/test/condtype_forwdecl.cs.c index 37a72771..1e459912 100644 --- a/re2c/test/condtype_forwdecl.cs.c +++ b/re2c/test/condtype_forwdecl.cs.c @@ -1,5 +1,5 @@ -re2c: warning: line 14: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 14: naked default case in condition b (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 14: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 14: control flow in condition 'b' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condtype_forwdecl.cs.re" enum cond_t : int; diff --git a/re2c/test/condtype_single.c.c b/re2c/test/condtype_single.c.c index 4ac7755e..080954ec 100644 --- a/re2c/test/condtype_single.c.c +++ b/re2c/test/condtype_single.c.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condtype_single.c.re" diff --git a/re2c/test/condtype_single.cg.c b/re2c/test/condtype_single.cg.c index 75fbdfa5..f8167d9a 100644 --- a/re2c/test/condtype_single.cg.c +++ b/re2c/test/condtype_single.cg.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 3: looks like you use hardcoded numbers instead of autogenerated condition names: better add '/*!types:re2c*/' directive or '-t, --type-header' option and don't rely on fixed condition order. [-Wcondition-order] /* Generated by re2c */ #line 1 "condtype_single.cg.re" diff --git a/re2c/test/condtype_single.cs.c b/re2c/test/condtype_single.cs.c index e8499e22..e1d191b8 100644 --- a/re2c/test/condtype_single.cs.c +++ b/re2c/test/condtype_single.cs.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condtype_single.cs.re" diff --git a/re2c/test/condtype_yysetcondition.cg.c b/re2c/test/condtype_yysetcondition.cg.c index 66aee2f9..b8ba9581 100644 --- a/re2c/test/condtype_yysetcondition.cg.c +++ b/re2c/test/condtype_yysetcondition.cg.c @@ -1,5 +1,5 @@ -re2c: warning: line 11: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 11: naked default case in condition b (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 11: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 11: control flow in condition 'b' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condtype_yysetcondition.cg.re" int main () diff --git a/re2c/test/condtype_yysetcondition.cs.c b/re2c/test/condtype_yysetcondition.cs.c index c41af549..867334b5 100644 --- a/re2c/test/condtype_yysetcondition.cs.c +++ b/re2c/test/condtype_yysetcondition.cs.c @@ -1,5 +1,5 @@ -re2c: warning: line 11: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 11: naked default case in condition b (stray code units: [0x00-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 11: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 11: control flow in condition 'b' is undefined for strings that match '[\x0-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "condtype_yysetcondition.cs.re" int main () diff --git a/re2c/test/config11.ei.c b/re2c/test/config11.ei.c index 559880aa..7c86b104 100644 --- a/re2c/test/config11.ei.c +++ b/re2c/test/config11.ei.c @@ -1,4 +1,4 @@ -re2c: warning: line 16: naked default case (stray code units: [0x00-0x80][0x83-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 16: control flow is undefined for strings that match '[\x0-\x80\x83-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ unsigned char scan(const unsigned char *s) { diff --git a/re2c/test/control_flow_fail.c b/re2c/test/control_flow_fail.c new file mode 100644 index 00000000..a974a32c --- /dev/null +++ b/re2c/test/control_flow_fail.c @@ -0,0 +1,39 @@ +re2c: warning: line 6: control flow is undefined for strings that match '[\x0-\xFF] \x61 [\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +/* Generated by re2c */ +#line 1 "control_flow_fail.re" + +#line 5 "" +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR; + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + ++YYCURSOR; + switch ((yych = *YYCURSOR)) { + case 'a': goto yy7; + default: goto yy4; + } +yy4: +#line 4 "control_flow_fail.re" + { action2 } +#line 24 "" +yy5: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy7; + default: goto yy6; + } +yy6: +yy7: + ++YYCURSOR; +#line 3 "control_flow_fail.re" + { action1 } +#line 36 "" +} +#line 6 "control_flow_fail.re" + diff --git a/re2c/test/control_flow_fail.re b/re2c/test/control_flow_fail.re new file mode 100644 index 00000000..fcb0a354 --- /dev/null +++ b/re2c/test/control_flow_fail.re @@ -0,0 +1,6 @@ +/*!re2c + + [^] [^] "a" { action1 } + [^] [^a] { action2 } + +*/ diff --git a/re2c/test/control_flow_ok.c b/re2c/test/control_flow_ok.c new file mode 100644 index 00000000..81a6b128 --- /dev/null +++ b/re2c/test/control_flow_ok.c @@ -0,0 +1,26 @@ +/* Generated by re2c */ +#line 1 "control_flow_ok.re" + +#line 5 "" +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR; + yych = *++YYCURSOR; + ++YYCURSOR; + switch ((yych = *YYCURSOR)) { + case 'a': goto yy5; + default: goto yy4; + } +yy4: +#line 4 "control_flow_ok.re" + { action2 } +#line 19 "" +yy5: + ++YYCURSOR; +#line 3 "control_flow_ok.re" + { action1 } +#line 24 "" +} +#line 6 "control_flow_ok.re" + diff --git a/re2c/test/control_flow_ok.re b/re2c/test/control_flow_ok.re new file mode 100644 index 00000000..74982f7e --- /dev/null +++ b/re2c/test/control_flow_ok.re @@ -0,0 +1,6 @@ +/*!re2c + + [^] [^] "a" { action1 } + [^] [^] { action2 } + +*/ diff --git a/re2c/test/control_flow_yymarker_fail.c b/re2c/test/control_flow_yymarker_fail.c new file mode 100644 index 00000000..fce4e4c1 --- /dev/null +++ b/re2c/test/control_flow_yymarker_fail.c @@ -0,0 +1,40 @@ +re2c: warning: line 6: control flow is undefined for strings that match '[\x0-\xFF] \x61 [\x0-\xFF] [\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +/* Generated by re2c */ +#line 1 "control_flow_yymarker_fail.re" + +#line 5 "" +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); + yych = *YYCURSOR; + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + yych = *(YYMARKER = ++YYCURSOR); + goto yy6; +yy4: +#line 4 "control_flow_yymarker_fail.re" + { action2 } +#line 21 "" +yy5: + yych = *++YYCURSOR; +yy6: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy8; + default: goto yy7; + } +yy7: + YYCURSOR = YYMARKER; + goto yy4; +yy8: + ++YYCURSOR; +#line 3 "control_flow_yymarker_fail.re" + { action1 } +#line 37 "" +} +#line 6 "control_flow_yymarker_fail.re" + diff --git a/re2c/test/control_flow_yymarker_fail.re b/re2c/test/control_flow_yymarker_fail.re new file mode 100644 index 00000000..055b9d7f --- /dev/null +++ b/re2c/test/control_flow_yymarker_fail.re @@ -0,0 +1,6 @@ +/*!re2c + + [^] [^] [^] "a" { action1 } + [^] [^a] { action2 } + +*/ diff --git a/re2c/test/control_flow_yymarker_ok.c b/re2c/test/control_flow_yymarker_ok.c new file mode 100644 index 00000000..a5b0697a --- /dev/null +++ b/re2c/test/control_flow_yymarker_ok.c @@ -0,0 +1,32 @@ +/* Generated by re2c */ +#line 1 "control_flow_yymarker_ok.re" + +#line 5 "" +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); + yych = *YYCURSOR; + yych = *++YYCURSOR; + yych = *(YYMARKER = ++YYCURSOR); + goto yy5; +yy4: +#line 4 "control_flow_yymarker_ok.re" + { action2 } +#line 16 "" +yy5: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy7; + default: goto yy6; + } +yy6: + YYCURSOR = YYMARKER; + goto yy4; +yy7: + ++YYCURSOR; +#line 3 "control_flow_yymarker_ok.re" + { action1 } +#line 30 "" +} +#line 6 "control_flow_yymarker_ok.re" + diff --git a/re2c/test/control_flow_yymarker_ok.re b/re2c/test/control_flow_yymarker_ok.re new file mode 100644 index 00000000..41aa98fc --- /dev/null +++ b/re2c/test/control_flow_yymarker_ok.re @@ -0,0 +1,6 @@ +/*!re2c + + [^] [^] [^] "a" { action1 } + [^] [^] { action2 } + +*/ diff --git a/re2c/test/control_flow_yymarker_yyaccept_fail.c b/re2c/test/control_flow_yymarker_yyaccept_fail.c new file mode 100644 index 00000000..fa6db61f --- /dev/null +++ b/re2c/test/control_flow_yymarker_yyaccept_fail.c @@ -0,0 +1,62 @@ +re2c: warning: line 7: control flow is undefined for strings that match '[\x0-\xFF] \x61 [\x0-\xFF] [\x0-\x60\x62-\xFF] [\x0-\xFF] [\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +/* Generated by re2c */ +#line 1 "control_flow_yymarker_yyaccept_fail.re" + +#line 5 "" +{ + YYCTYPE yych; + unsigned int yyaccept = 0; + if ((YYLIMIT - YYCURSOR) < 6) YYFILL(6); + yych = *YYCURSOR; + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy5; + default: goto yy3; + } +yy3: + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + goto yy6; +yy4: +#line 5 "control_flow_yymarker_yyaccept_fail.re" + { action3 } +#line 23 "" +yy5: + yych = *++YYCURSOR; +yy6: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy7; + default: goto yy9; + } +yy7: + yyaccept = 1; + yych = *(YYMARKER = ++YYCURSOR); + goto yy10; +yy8: +#line 4 "control_flow_yymarker_yyaccept_fail.re" + { action2 } +#line 39 "" +yy9: + yych = *++YYCURSOR; +yy10: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy12; + default: goto yy11; + } +yy11: + YYCURSOR = YYMARKER; + if (yyaccept == 0) { + goto yy4; + } else { + goto yy8; + } +yy12: + ++YYCURSOR; +#line 3 "control_flow_yymarker_yyaccept_fail.re" + { action1 } +#line 59 "" +} +#line 7 "control_flow_yymarker_yyaccept_fail.re" + diff --git a/re2c/test/control_flow_yymarker_yyaccept_fail.re b/re2c/test/control_flow_yymarker_yyaccept_fail.re new file mode 100644 index 00000000..e6dbf6a5 --- /dev/null +++ b/re2c/test/control_flow_yymarker_yyaccept_fail.re @@ -0,0 +1,7 @@ +/*!re2c + + [^] [^] [^] [^] [^] "a" { action1 } + [^] [^] [^] "a" { action2 } + [^] [^a] { action3 } + +*/ diff --git a/re2c/test/control_flow_yymarker_yyaccept_ok.c b/re2c/test/control_flow_yymarker_yyaccept_ok.c new file mode 100644 index 00000000..174c663e --- /dev/null +++ b/re2c/test/control_flow_yymarker_yyaccept_ok.c @@ -0,0 +1,54 @@ +/* Generated by re2c */ +#line 1 "control_flow_yymarker_yyaccept_ok.re" + +#line 5 "" +{ + YYCTYPE yych; + unsigned int yyaccept = 0; + if ((YYLIMIT - YYCURSOR) < 6) YYFILL(6); + yych = *YYCURSOR; + yych = *++YYCURSOR; + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + goto yy5; +yy4: +#line 5 "control_flow_yymarker_yyaccept_ok.re" + { action3 } +#line 18 "" +yy5: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy6; + default: goto yy8; + } +yy6: + yyaccept = 1; + yych = *(YYMARKER = ++YYCURSOR); + goto yy9; +yy7: +#line 4 "control_flow_yymarker_yyaccept_ok.re" + { action2 } +#line 32 "" +yy8: + yych = *++YYCURSOR; +yy9: + yych = *++YYCURSOR; + switch (yych) { + case 'a': goto yy11; + default: goto yy10; + } +yy10: + YYCURSOR = YYMARKER; + if (yyaccept == 0) { + goto yy4; + } else { + goto yy7; + } +yy11: + ++YYCURSOR; +#line 3 "control_flow_yymarker_yyaccept_ok.re" + { action1 } +#line 52 "" +} +#line 7 "control_flow_yymarker_yyaccept_ok.re" + diff --git a/re2c/test/control_flow_yymarker_yyaccept_ok.re b/re2c/test/control_flow_yymarker_yyaccept_ok.re new file mode 100644 index 00000000..d067e263 --- /dev/null +++ b/re2c/test/control_flow_yymarker_yyaccept_ok.re @@ -0,0 +1,7 @@ +/*!re2c + + [^] [^] [^] [^] [^] "a" { action1 } + [^] [^] [^] "a" { action2 } + [^] [^] { action3 } + +*/ diff --git a/re2c/test/dot_backslash.D.c b/re2c/test/dot_backslash.D.c index e3452fec..37b94fb1 100644 --- a/re2c/test/dot_backslash.D.c +++ b/re2c/test/dot_backslash.D.c @@ -1,4 +1,4 @@ -re2c: warning: line 5: naked default case (stray code units: [0x00-[][0x5D-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 5: control flow is undefined for strings that match '[\x0-\x5B\x5D-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ digraph re2c { diff --git a/re2c/test/dot_conditions.Dc.c b/re2c/test/dot_conditions.Dc.c index d7e41b7e..c5a4dd2b 100644 --- a/re2c/test/dot_conditions.Dc.c +++ b/re2c/test/dot_conditions.Dc.c @@ -1,5 +1,15 @@ -re2c: warning: line 10: naked default case in condition state1 (stray code units: [0x00-`][a][b-e][f][g-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 10: naked default case in condition state2 (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 10: control flow in condition 'state1' is undefined for strings that match + '[\x0-\x60\x62-\x65\x67-\xFF]' + '\x61 [\x0-\x61\x63-\xFF]' + '\x66 [\x0-\x6E\x70-\xFF]' + '\x61 \x62 [\x0-\x62\x64-\xFF]' + '\x66 \x6F [\x0-\x6E\x70-\xFF]' +, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 10: control flow in condition 'state2' is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x61\x63-\xFF]' + '\x61 \x62 [\x0-\x62\x64-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ digraph re2c { diff --git a/re2c/test/empty_code.c.c b/re2c/test/empty_code.c.c index a59ac5aa..4c85986e 100644 --- a/re2c/test/empty_code.c.c +++ b/re2c/test/empty_code.c.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case in condition a (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow in condition 'a' is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "empty_code.c.re" diff --git a/re2c/test/flex-01.iF.c b/re2c/test/flex-01.iF.c index 6b182eda..aee245d9 100644 --- a/re2c/test/flex-01.iF.c +++ b/re2c/test/flex-01.iF.c @@ -1,4 +1,4 @@ -re2c: warning: line 9: naked default case (stray code units: [0x00-`][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 9: control flow is undefined for strings that match '[\x0-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ { diff --git a/re2c/test/input12.boinput12.c.c b/re2c/test/input12.boinput12.c.c index c8f2c9e6..1a9c8a7e 100644 --- a/re2c/test/input12.boinput12.c.c +++ b/re2c/test/input12.boinput12.c.c @@ -1,4 +1,10 @@ -re2c: warning: line 5: naked default case (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 5: control flow is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x60\x63-\xFF]' + '\x61 \x61 [\x0-\x60\x63-\xFF]' + '\x61 \x62 [\x0-\x61\x63-\xFF]' + '\x61 \x61 \x62 [\x0-\x61\x63-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "input12.boinput12.c.re" diff --git a/re2c/test/input12.oinput12.c.c b/re2c/test/input12.oinput12.c.c index 411db52d..b2ac4bc2 100644 --- a/re2c/test/input12.oinput12.c.c +++ b/re2c/test/input12.oinput12.c.c @@ -1,4 +1,10 @@ -re2c: warning: line 5: naked default case (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 5: control flow is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x60\x63-\xFF]' + '\x61 \x61 [\x0-\x60\x63-\xFF]' + '\x61 \x62 [\x0-\x61\x63-\xFF]' + '\x61 \x61 \x62 [\x0-\x61\x63-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "input12.oinput12.c.re" diff --git a/re2c/test/input2.c b/re2c/test/input2.c index f7c107a5..4c1dffc6 100644 --- a/re2c/test/input2.c +++ b/re2c/test/input2.c @@ -1,4 +1,10 @@ -re2c: warning: line 5: naked default case (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 5: control flow is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x60\x63-\xFF]' + '\x61 \x61 [\x0-\x60\x63-\xFF]' + '\x61 \x62 [\x0-\x61\x63-\xFF]' + '\x61 \x61 \x62 [\x0-\x61\x63-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "input2.re" diff --git a/re2c/test/input3.c b/re2c/test/input3.c index 155aa5cf..7e7cbc71 100644 --- a/re2c/test/input3.c +++ b/re2c/test/input3.c @@ -1,4 +1,10 @@ -re2c: warning: line 5: naked default case (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 5: control flow is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x60\x63-\xFF]' + '\x61 \x61 [\x0-\x60\x63-\xFF]' + '\x61 \x62 [\x0-\x61\x63-\xFF]' + '\x61 \x61 \x62 [\x0-\x61\x63-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "input3.re" diff --git a/re2c/test/line-01.c b/re2c/test/line-01.c index b074ae49..f3c540d4 100644 --- a/re2c/test/line-01.c +++ b/re2c/test/line-01.c @@ -1,4 +1,4 @@ -re2c: warning: line 1: naked default case (stray code units: [0x0A]), better add default rule * [-Wnaked-default] +re2c: warning: line 1: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "line-01.re" const char* scan(unsigned char* in) diff --git a/re2c/test/overflow-1.c b/re2c/test/overflow-1.c index 4e2e98d0..dbbe9a3e 100644 --- a/re2c/test/overflow-1.c +++ b/re2c/test/overflow-1.c @@ -1,4 +1,13 @@ -re2c: warning: line 3: naked default case (stray code units: [0x00-/][0][1-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\x0-\x2F\x31-\xFF]' + '\x30 [\x0-\x2F\x31-\xFF]' + '\x30 \x30 [\x0-\x2F\x31-\xFF]' + '\x30 \x30 \x30 [\x0-\x2F\x31-\xFF]' + '\x30 \x30 \x30 \x30 [\x0-\x2F\x31-\xFF]' + '\x30 \x30 \x30 \x30 \x30 [\x0-\x5E\x60-\xFF]' + '\x30 \x30 \x30 \x30 \x30 \x5F [\x0-\x60\x62-\xFF]' + '\x30 \x30 \x30 \x30 \x30 \x5F \x61 [\x0-\x60\x62-\xFF]' + ... and 8209 more, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "overflow-1.re" diff --git a/re2c/test/overflow-4.c b/re2c/test/overflow-4.c index 8b927f3c..7cdcdea0 100644 --- a/re2c/test/overflow-4.c +++ b/re2c/test/overflow-4.c @@ -1,4 +1,8 @@ -re2c: warning: line 6: naked default case (stray code units: [0x00-a][b][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 6: control flow is undefined for strings that match + '[\x0-\x61\x63-\xFF]' + '\x62 [\x0-\x6B\x6D-\xFF]' + '\x62 \x6C [\x0-\x60\x62-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "overflow-4.re" diff --git a/re2c/test/php20150211_pdo_sql_parser.ig.c b/re2c/test/php20150211_pdo_sql_parser.ig.c index 07d83355..88b27b4a 100644 --- a/re2c/test/php20150211_pdo_sql_parser.ig.c +++ b/re2c/test/php20150211_pdo_sql_parser.ig.c @@ -1,4 +1,4 @@ -re2c: warning: line 66: naked default case (stray code units: [0x00]), better add default rule * [-Wnaked-default] +re2c: warning: line 66: control flow is undefined for strings that match '\x0', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ /* +----------------------------------------------------------------------+ diff --git a/re2c/test/php20150211_phar_path_check.ig.c b/re2c/test/php20150211_phar_path_check.ig.c index f29e8dc5..0676b666 100644 --- a/re2c/test/php20150211_phar_path_check.ig.c +++ b/re2c/test/php20150211_phar_path_check.ig.c @@ -1,4 +1,4 @@ -re2c: warning: line 108: naked default case (stray code units: [0x0A]), better add default rule * [-Wnaked-default] +re2c: warning: line 108: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ /* +----------------------------------------------------------------------+ diff --git a/re2c/test/range_dot.8.c b/re2c/test/range_dot.8.c index 53132816..4b6a78e5 100644 --- a/re2c/test/range_dot.8.c +++ b/re2c/test/range_dot.8.c @@ -1,4 +1,13 @@ -re2c: warning: line 3: naked default case (stray code units: [0x0A][0x80-0xC1][0xC2-0xDF][0xE0][0xE1-0xEF][0xF0][0xF1-0xF3][0xF4][0xF5-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\xA\x80-\xC1\xF5-\xFF]' + '\xF0 [\x0-\x8F\xC0-\xFF]' + '[\xE1-\xEF] [\x0-\x7F\xC0-\xFF]' + '\xF4 [\x0-\x7F\x90-\xFF]' + '\xE0 [\x0-\x9F\xC0-\xFF]' + '[\xF1-\xF3] [\x0-\x7F\xC0-\xFF]' + '[\xC2-\xDF] [\x0-\x7F\xC0-\xFF]' + '\xE0 [\xA0-\xBF] [\x0-\x7F\xC0-\xFF]' + ... and 7 more, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "range_dot.8.re" diff --git a/re2c/test/range_dot.c b/re2c/test/range_dot.c index 1d01c4b6..b35560d4 100644 --- a/re2c/test/range_dot.c +++ b/re2c/test/range_dot.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case (stray code units: [0x0A]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "range_dot.re" diff --git a/re2c/test/range_dot.e.c b/re2c/test/range_dot.e.c index a35782a7..10082792 100644 --- a/re2c/test/range_dot.e.c +++ b/re2c/test/range_dot.e.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case (stray code units: [0x25]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '\x25', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "range_dot.e.re" diff --git a/re2c/test/range_dot.u.c b/re2c/test/range_dot.u.c index c5f1ea12..ca3f7268 100644 --- a/re2c/test/range_dot.u.c +++ b/re2c/test/range_dot.u.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case (stray code units: [0x0000000A]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "range_dot.u.re" diff --git a/re2c/test/range_dot.w.c b/re2c/test/range_dot.w.c index 10a17876..2f37734a 100644 --- a/re2c/test/range_dot.w.c +++ b/re2c/test/range_dot.w.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case (stray code units: [0x000A]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "range_dot.w.re" diff --git a/re2c/test/range_dot.x.c b/re2c/test/range_dot.x.c index 5b60f0f3..a3579cee 100644 --- a/re2c/test/range_dot.x.c +++ b/re2c/test/range_dot.x.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case (stray code units: [0x000A]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "range_dot.x.re" diff --git a/re2c/test/range_full.8.c b/re2c/test/range_full.8.c index 465f855a..cc3eb6db 100644 --- a/re2c/test/range_full.8.c +++ b/re2c/test/range_full.8.c @@ -1,4 +1,13 @@ -re2c: warning: line 3: naked default case (stray code units: [0x80-0xC1][0xC2-0xDF][0xE0][0xE1-0xEF][0xF0][0xF1-0xF3][0xF4][0xF5-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\x80-\xC1\xF5-\xFF]' + '\xF0 [\x0-\x8F\xC0-\xFF]' + '[\xE1-\xEF] [\x0-\x7F\xC0-\xFF]' + '\xF4 [\x0-\x7F\x90-\xFF]' + '\xE0 [\x0-\x9F\xC0-\xFF]' + '[\xF1-\xF3] [\x0-\x7F\xC0-\xFF]' + '[\xC2-\xDF] [\x0-\x7F\xC0-\xFF]' + '\xE0 [\xA0-\xBF] [\x0-\x7F\xC0-\xFF]' + ... and 7 more, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "range_full.8.re" diff --git a/re2c/test/range_neg_lf.8.c b/re2c/test/range_neg_lf.8.c index 4c3afc3a..c9456145 100644 --- a/re2c/test/range_neg_lf.8.c +++ b/re2c/test/range_neg_lf.8.c @@ -1,4 +1,13 @@ -re2c: warning: line 3: naked default case (stray code units: [0x0A][0x80-0xC1][0xC2-0xDF][0xE0][0xE1-0xEF][0xF0][0xF1-0xF3][0xF4][0xF5-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\xA\x80-\xC1\xF5-\xFF]' + '\xF0 [\x0-\x8F\xC0-\xFF]' + '[\xE1-\xEF] [\x0-\x7F\xC0-\xFF]' + '\xF4 [\x0-\x7F\x90-\xFF]' + '\xE0 [\x0-\x9F\xC0-\xFF]' + '[\xF1-\xF3] [\x0-\x7F\xC0-\xFF]' + '[\xC2-\xDF] [\x0-\x7F\xC0-\xFF]' + '\xE0 [\xA0-\xBF] [\x0-\x7F\xC0-\xFF]' + ... and 7 more, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "range_neg_lf.8.re" diff --git a/re2c/test/range_neg_lf.c b/re2c/test/range_neg_lf.c index 048876c4..d2cc4837 100644 --- a/re2c/test/range_neg_lf.c +++ b/re2c/test/range_neg_lf.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case (stray code units: [0x0A]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "range_neg_lf.re" diff --git a/re2c/test/range_neg_lf.e.c b/re2c/test/range_neg_lf.e.c index a5760517..a804fb89 100644 --- a/re2c/test/range_neg_lf.e.c +++ b/re2c/test/range_neg_lf.e.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case (stray code units: [0x25]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '\x25', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "range_neg_lf.e.re" diff --git a/re2c/test/range_neg_lf.u.c b/re2c/test/range_neg_lf.u.c index 8f25a1c5..d3fcc046 100644 --- a/re2c/test/range_neg_lf.u.c +++ b/re2c/test/range_neg_lf.u.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case (stray code units: [0x0000000A]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "range_neg_lf.u.re" diff --git a/re2c/test/range_neg_lf.w.c b/re2c/test/range_neg_lf.w.c index dbc2facb..a6db5292 100644 --- a/re2c/test/range_neg_lf.w.c +++ b/re2c/test/range_neg_lf.w.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case (stray code units: [0x000A]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "range_neg_lf.w.re" diff --git a/re2c/test/range_neg_lf.x.c b/re2c/test/range_neg_lf.x.c index c824e7bf..1f8aa8be 100644 --- a/re2c/test/range_neg_lf.x.c +++ b/re2c/test/range_neg_lf.x.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case (stray code units: [0x000A]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "range_neg_lf.x.re" diff --git a/re2c/test/repeat-01.cgir.c b/re2c/test/repeat-01.cgir.c index a24c92a4..88c9b718 100644 --- a/re2c/test/repeat-01.cgir.c +++ b/re2c/test/repeat-01.cgir.c @@ -1,5 +1,5 @@ -re2c: warning: line 13: naked default case in condition r1 (stray code units: [0x00-0][3-`][c-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 13: naked default case in condition r2 (stray code units: [0x00-0][3-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 13: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 13: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ // multiple scanners diff --git a/re2c/test/repeat-02.cgir.c b/re2c/test/repeat-02.cgir.c index a37dfd08..fd22eaa5 100644 --- a/re2c/test/repeat-02.cgir.c +++ b/re2c/test/repeat-02.cgir.c @@ -1,5 +1,5 @@ -re2c: warning: line 13: naked default case in condition r1 (stray code units: [0x00-0][3-`][c-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 13: naked default case in condition r2 (stray code units: [0x00-0][3-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 13: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 13: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ // multiple scanners diff --git a/re2c/test/repeat-03.cgir.c b/re2c/test/repeat-03.cgir.c index fd304855..d6d021db 100644 --- a/re2c/test/repeat-03.cgir.c +++ b/re2c/test/repeat-03.cgir.c @@ -1,9 +1,9 @@ -re2c: warning: line 14: naked default case in condition r1 (stray code units: [0x0A]), better add default rule * [-Wnaked-default] -re2c: warning: line 14: naked default case in condition r2 (stray code units: [0x0A]), better add default rule * [-Wnaked-default] -re2c: warning: line 18: naked default case in condition r1 (stray code units: [0x0A]), better add default rule * [-Wnaked-default] -re2c: warning: line 18: naked default case in condition r2 (stray code units: [0x0A]), better add default rule * [-Wnaked-default] -re2c: warning: line 28: naked default case in condition r1 (stray code units: [0x0A]), better add default rule * [-Wnaked-default] -re2c: warning: line 28: naked default case in condition r2 (stray code units: [0x0A]), better add default rule * [-Wnaked-default] +re2c: warning: line 14: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 14: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 18: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 18: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 28: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 28: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ // multiple scanners diff --git a/re2c/test/repeat-04.cgir.c b/re2c/test/repeat-04.cgir.c index 7ee373ab..c4e18734 100644 --- a/re2c/test/repeat-04.cgir.c +++ b/re2c/test/repeat-04.cgir.c @@ -1,3 +1,3 @@ -re2c: warning: line 14: naked default case in condition r1 (stray code units: [0x00-0][3-`][c-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 14: naked default case in condition r2 (stray code units: [0x00-0][3-a][c-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 14: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 14: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow] re2c: error: line 20, column 1: cannot have a second 'rules:re2c' block diff --git a/re2c/test/repeat-06.gir.c b/re2c/test/repeat-06.gir.c index 5566196c..3d4b6b18 100644 --- a/re2c/test/repeat-06.gir.c +++ b/re2c/test/repeat-06.gir.c @@ -1,7 +1,7 @@ -re2c: warning: line 14: naked default case (stray code units: [0x00-`][e-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 24: naked default case (stray code units: [0x0A]), better add default rule * [-Wnaked-default] -re2c: warning: line 39: naked default case (stray code units: [0x0A]), better add default rule * [-Wnaked-default] -re2c: warning: line 54: naked default case (stray code units: [0x0A]), better add default rule * [-Wnaked-default] +re2c: warning: line 14: control flow is undefined for strings that match '[\x0-\x60\x65-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 24: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 39: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 54: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ // multiple scanners, additional rules, no char width change diff --git a/re2c/test/repeat-07.gir.c b/re2c/test/repeat-07.gir.c index 89cb3bba..384698c0 100644 --- a/re2c/test/repeat-07.gir.c +++ b/re2c/test/repeat-07.gir.c @@ -1,7 +1,7 @@ -re2c: warning: line 14: naked default case (stray code units: [0x00-`][e-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 27: naked default case (stray code units: [0x0A]), better add default rule * [-Wnaked-default] -re2c: warning: line 45: naked default case (stray code units: [0x000A]), better add default rule * [-Wnaked-default] -re2c: warning: line 63: naked default case (stray code units: [0x0000000A]), better add default rule * [-Wnaked-default] +re2c: warning: line 14: control flow is undefined for strings that match '[\x0-\x60\x65-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 27: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 45: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 63: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ // multiple scanners, additional rules, char width change diff --git a/re2c/test/repeat-07_error.gir.c b/re2c/test/repeat-07_error.gir.c index ad74b451..63daf4a7 100644 --- a/re2c/test/repeat-07_error.gir.c +++ b/re2c/test/repeat-07_error.gir.c @@ -1,4 +1,4 @@ -re2c: warning: line 14: naked default case (stray code units: [0x00-`][e-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 27: naked default case (stray code units: [0x0A]), better add default rule * [-Wnaked-default] -re2c: warning: line 45: naked default case (stray code units: [0x000A]), better add default rule * [-Wnaked-default] +re2c: warning: line 14: control flow is undefined for strings that match '[\x0-\x60\x65-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 27: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 45: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: error: line 52, column 17: Cannot set UTF32 encoding: please reset USC2 encoding first diff --git a/re2c/test/repeater2.c b/re2c/test/repeater2.c index 4b702297..057ae553 100644 --- a/re2c/test/repeater2.c +++ b/re2c/test/repeater2.c @@ -1,16 +1,39 @@ re2c: warning: line 2: rule matches empty string [-Wmatch-empty-string] -re2c: warning: line 7: naked default case (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 11: naked default case (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 7: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 11: control flow is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x60\x62-\xFF]' + '\x61 \x61 [\x0-\x60\x62-\xFF]' +, use default rule '*' [-Wundefined-control-flow] re2c: warning: line 14: rule matches empty string [-Wmatch-empty-string] -re2c: warning: line 19: naked default case (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 23: naked default case (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 19: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 23: control flow is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x60\x62-\xFF]' + '\x61 \x61 [\x0-\x60\x62-\xFF]' +, use default rule '*' [-Wundefined-control-flow] re2c: warning: line 26: rule matches empty string [-Wmatch-empty-string] re2c: warning: line 30: rule matches empty string [-Wmatch-empty-string] -re2c: warning: line 35: naked default case (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 39: naked default case (stray code units: [0x00-`][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 43: naked default case (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 47: naked default case (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] -re2c: warning: line 51: naked default case (stray code units: [0x00-`][a][b-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 35: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 39: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 43: control flow is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x60\x62-\xFF]' +, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 47: control flow is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x60\x62-\xFF]' + '\x61 \x61 [\x0-\x60\x62-\xFF]' + '\x61 \x61 \x61 [\x0-\x60\x62-\xFF]' + '\x61 \x61 \x61 \x61 [\x0-\x60\x62-\xFF]' +, use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 51: control flow is undefined for strings that match + '[\x0-\x60\x62-\xFF]' + '\x61 [\x0-\x60\x62-\xFF]' + '\x61 \x61 [\x0-\x60\x62-\xFF]' + '\x61 \x61 \x61 [\x0-\x60\x62-\xFF]' + '\x61 \x61 \x61 \x61 [\x0-\x60\x62-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "repeater2.re" diff --git a/re2c/test/reuse_conds_default_0.cgir.c b/re2c/test/reuse_conds_default_0.cgir.c index 751d2fb0..acf7550e 100644 --- a/re2c/test/reuse_conds_default_0.cgir.c +++ b/re2c/test/reuse_conds_default_0.cgir.c @@ -1,3 +1,3 @@ -re2c: warning: line 10: naked default case in condition r1 (stray code units: [0x0A]), better add default rule * [-Wnaked-default] -re2c: warning: line 10: naked default case in condition r2 (stray code units: [0x0A]), better add default rule * [-Wnaked-default] +re2c: warning: line 10: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 10: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: error: line 13, column 9: code to default rule 'r1' is already defined diff --git a/re2c/test/reuse_conds_default_1.cgir.c b/re2c/test/reuse_conds_default_1.cgir.c index fde83043..82f77304 100644 --- a/re2c/test/reuse_conds_default_1.cgir.c +++ b/re2c/test/reuse_conds_default_1.cgir.c @@ -1,2 +1,2 @@ -re2c: warning: line 17: naked default case in condition r2 (stray code units: [0x0A]), better add default rule * [-Wnaked-default] +re2c: warning: line 17: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: error: line 11, column 9: code to default rule 'r1' is already defined diff --git a/re2c/test/reuse_conds_setup_0.cgir.c b/re2c/test/reuse_conds_setup_0.cgir.c index 41c8b1e7..47807d22 100644 --- a/re2c/test/reuse_conds_setup_0.cgir.c +++ b/re2c/test/reuse_conds_setup_0.cgir.c @@ -1,3 +1,3 @@ -re2c: warning: line 10: naked default case in condition r1 (stray code units: [0x0A]), better add default rule * [-Wnaked-default] -re2c: warning: line 10: naked default case in condition r2 (stray code units: [0x0A]), better add default rule * [-Wnaked-default] +re2c: warning: line 10: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 10: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: error: line 13, column 9: code to setup rule 'r1' is already defined diff --git a/re2c/test/reuse_conds_setup_1.cgir.c b/re2c/test/reuse_conds_setup_1.cgir.c index ee31e769..f39bb25e 100644 --- a/re2c/test/reuse_conds_setup_1.cgir.c +++ b/re2c/test/reuse_conds_setup_1.cgir.c @@ -1,3 +1,3 @@ -re2c: warning: line 17: naked default case in condition r1 (stray code units: [0x0A]), better add default rule * [-Wnaked-default] -re2c: warning: line 17: naked default case in condition r2 (stray code units: [0x0A]), better add default rule * [-Wnaked-default] +re2c: warning: line 17: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] +re2c: warning: line 17: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: error: line 11, column 9: code to setup rule 'r1' is already defined diff --git a/re2c/test/rexx.--empty-class(match-none).c b/re2c/test/rexx.--empty-class(match-none).c index 215bf6fd..1a66bfd6 100644 --- a/re2c/test/rexx.--empty-class(match-none).c +++ b/re2c/test/rexx.--empty-class(match-none).c @@ -1,5 +1,8 @@ re2c: warning: line 288: empty character class [-Wempty-character-class] -re2c: warning: line 290: naked default case (stray code units: [0x00-0x08][0x0A-0x0C][0x0E-0x1F][!-.][/][0-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 290: control flow is undefined for strings that match + '[\x0-\x8\xA-\xC\xE-\x1F\x21-\x2E\x30-\xFF]' + '\x2F [\x0-\x29\x2B-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "rexx.--empty-class(match-none).re" #include "scanio.h" diff --git a/re2c/test/utf32_0x10000.u.c b/re2c/test/utf32_0x10000.u.c index 424633e3..5f5cc02d 100644 --- a/re2c/test/utf32_0x10000.u.c +++ b/re2c/test/utf32_0x10000.u.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case (stray code units: [0x00000000-0x0000FFFF][0x00010001-0x0010FFFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '[\x0-\xFFFF\x10001-\x10FFFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "utf32_0x10000.u.re" diff --git a/re2c/test/utf8-full_range-2.8.c b/re2c/test/utf8-full_range-2.8.c index 98072d4e..2e34bb64 100644 --- a/re2c/test/utf8-full_range-2.8.c +++ b/re2c/test/utf8-full_range-2.8.c @@ -1,4 +1,13 @@ -re2c: warning: line 9: naked default case (stray code units: [0x80-0xC1][0xC2-0xDF][0xE0][0xE1-0xEF][0xF0][0xF1-0xF3][0xF4][0xF5-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 9: control flow is undefined for strings that match + '[\x80-\xC1\xF5-\xFF]' + '\xF0 [\x0-\x8F\xC0-\xFF]' + '[\xE1-\xEF] [\x0-\x7F\xC0-\xFF]' + '\xF4 [\x0-\x7F\x90-\xFF]' + '\xE0 [\x0-\x9F\xC0-\xFF]' + '[\xF1-\xF3] [\x0-\x7F\xC0-\xFF]' + '[\xC2-\xDF] [\x0-\x7F\xC0-\xFF]' + '\xE0 [\xA0-\xBF] [\x0-\x7F\xC0-\xFF]' + ... and 7 more, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "utf8-full_range-2.8.re" diff --git a/re2c/test/utf8-range_0x00_0x7f.8.c b/re2c/test/utf8-range_0x00_0x7f.8.c index 7248bacb..5057b53b 100644 --- a/re2c/test/utf8-range_0x00_0x7f.8.c +++ b/re2c/test/utf8-range_0x00_0x7f.8.c @@ -1,4 +1,4 @@ -re2c: warning: line 3: naked default case (stray code units: [0x80-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match '[\x80-\xFF]', use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "utf8-range_0x00_0x7f.8.re" diff --git a/re2c/test/utf8-range_0x100000_0x10ffff.8.c b/re2c/test/utf8-range_0x100000_0x10ffff.8.c index eeff2915..ad0f70d8 100644 --- a/re2c/test/utf8-range_0x100000_0x10ffff.8.c +++ b/re2c/test/utf8-range_0x100000_0x10ffff.8.c @@ -1,4 +1,9 @@ -re2c: warning: line 3: naked default case (stray code units: [0x00-0xF3][0xF4][0xF5-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\x0-\xF3\xF5-\xFF]' + '\xF4 [\x0-\x7F\x90-\xFF]' + '\xF4 [\x80-\x8F] [\x0-\x7F\xC0-\xFF]' + '\xF4 [\x80-\x8F] [\x80-\xBF] [\x0-\x7F\xC0-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "utf8-range_0x100000_0x10ffff.8.re" diff --git a/re2c/test/utf8-range_0x10000_0x3ffff.8.c b/re2c/test/utf8-range_0x10000_0x3ffff.8.c index 628cc07b..65cf8d87 100644 --- a/re2c/test/utf8-range_0x10000_0x3ffff.8.c +++ b/re2c/test/utf8-range_0x10000_0x3ffff.8.c @@ -1,4 +1,9 @@ -re2c: warning: line 3: naked default case (stray code units: [0x00-0xEF][0xF0][0xF1-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\x0-\xEF\xF1-\xFF]' + '\xF0 [\x0-\x8F\xC0-\xFF]' + '\xF0 [\x90-\xBF] [\x0-\x7F\xC0-\xFF]' + '\xF0 [\x90-\xBF] [\x80-\xBF] [\x0-\x7F\xC0-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "utf8-range_0x10000_0x3ffff.8.re" diff --git a/re2c/test/utf8-range_0x1000_0xffff.8.c b/re2c/test/utf8-range_0x1000_0xffff.8.c index abe9e8ac..bea482d4 100644 --- a/re2c/test/utf8-range_0x1000_0xffff.8.c +++ b/re2c/test/utf8-range_0x1000_0xffff.8.c @@ -1,4 +1,8 @@ -re2c: warning: line 3: naked default case (stray code units: [0x00-0xE0][0xE1-0xEF][0xF0-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\x0-\xE0\xF0-\xFF]' + '[\xE1-\xEF] [\x0-\x7F\xC0-\xFF]' + '[\xE1-\xEF] [\x80-\xBF] [\x0-\x7F\xC0-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "utf8-range_0x1000_0xffff.8.re" diff --git a/re2c/test/utf8-range_0x40000_0xfffff.8.c b/re2c/test/utf8-range_0x40000_0xfffff.8.c index 23582245..a134353b 100644 --- a/re2c/test/utf8-range_0x40000_0xfffff.8.c +++ b/re2c/test/utf8-range_0x40000_0xfffff.8.c @@ -1,4 +1,9 @@ -re2c: warning: line 3: naked default case (stray code units: [0x00-0xF0][0xF1-0xF3][0xF4-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\x0-\xF0\xF4-\xFF]' + '[\xF1-\xF3] [\x0-\x7F\xC0-\xFF]' + '[\xF1-\xF3] [\x80-\xBF] [\x0-\x7F\xC0-\xFF]' + '[\xF1-\xF3] [\x80-\xBF] [\x80-\xBF] [\x0-\x7F\xC0-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "utf8-range_0x40000_0xfffff.8.re" diff --git a/re2c/test/utf8-range_0x800_0xfff.8.c b/re2c/test/utf8-range_0x800_0xfff.8.c index 9a4be791..94172e3e 100644 --- a/re2c/test/utf8-range_0x800_0xfff.8.c +++ b/re2c/test/utf8-range_0x800_0xfff.8.c @@ -1,4 +1,8 @@ -re2c: warning: line 3: naked default case (stray code units: [0x00-0xDF][0xE0][0xE1-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\x0-\xDF\xE1-\xFF]' + '\xE0 [\x0-\x9F\xC0-\xFF]' + '\xE0 [\xA0-\xBF] [\x0-\x7F\xC0-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "utf8-range_0x800_0xfff.8.re" diff --git a/re2c/test/utf8-range_0x80_0x7ff.8.c b/re2c/test/utf8-range_0x80_0x7ff.8.c index d8d4f7e8..4ec8f43b 100644 --- a/re2c/test/utf8-range_0x80_0x7ff.8.c +++ b/re2c/test/utf8-range_0x80_0x7ff.8.c @@ -1,4 +1,7 @@ -re2c: warning: line 3: naked default case (stray code units: [0x00-0xC1][0xC2-0xDF][0xE0-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\x0-\xC1\xE0-\xFF]' + '[\xC2-\xDF] [\x0-\x7F\xC0-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "utf8-range_0x80_0x7ff.8.re" diff --git a/re2c/test/utf8-range_single_symbol.8.c b/re2c/test/utf8-range_single_symbol.8.c index 451d008a..18ba9a96 100644 --- a/re2c/test/utf8-range_single_symbol.8.c +++ b/re2c/test/utf8-range_single_symbol.8.c @@ -1,4 +1,7 @@ -re2c: warning: line 3: naked default case (stray code units: [0x00-0xCF][0xD0][0xD1-0xFF]), better add default rule * [-Wnaked-default] +re2c: warning: line 3: control flow is undefined for strings that match + '[\x0-\xCF\xD1-\xFF]' + '\xD0 [\x0-\xAF\xB1-\xFF]' +, use default rule '*' [-Wundefined-control-flow] /* Generated by re2c */ #line 1 "utf8-range_single_symbol.8.re" -- 2.40.0