From c9542e0863a230b2406a7966fde501f8ca5ca94e Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Sun, 18 Dec 2016 12:27:19 +0000 Subject: [PATCH] Removed warnings from global scope. --- re2c/bootstrap/src/conf/parse_opts.cc | 480 ++++++++++++------------ re2c/bootstrap/src/parse/lex.cc | 503 +++++++++++++------------- re2c/src/codegen/output.cc | 10 +- re2c/src/codegen/output.h | 6 +- re2c/src/conf/opt.h | 3 +- re2c/src/conf/parse_opts.re | 4 +- re2c/src/conf/warn.cc | 3 - re2c/src/globals.h | 3 - re2c/src/ir/compile.cc | 9 +- re2c/src/ir/dfa/dead_rules.cc | 6 +- re2c/src/ir/dfa/determinization.cc | 10 +- re2c/src/ir/dfa/dfa.h | 5 +- re2c/src/ir/regexp/nullable.cc | 2 +- re2c/src/ir/regexp/regexp.cc | 2 - re2c/src/ir/regexp/regexp.h | 3 +- re2c/src/ir/skeleton/control_flow.cc | 4 +- re2c/src/ir/skeleton/skeleton.h | 2 +- re2c/src/main.cc | 5 +- re2c/src/parse/lex.re | 1 - re2c/src/parse/scanner.cc | 1 + re2c/src/parse/scanner.h | 2 + 21 files changed, 528 insertions(+), 536 deletions(-) diff --git a/re2c/bootstrap/src/conf/parse_opts.cc b/re2c/bootstrap/src/conf/parse_opts.cc index 4b859f09..34725411 100644 --- a/re2c/bootstrap/src/conf/parse_opts.cc +++ b/re2c/bootstrap/src/conf/parse_opts.cc @@ -1,10 +1,8 @@ -/* Generated by re2c 0.16 on Mon Dec 12 13:39:55 2016 */ +/* Generated by re2c 0.16 on Sun Dec 18 12:23:03 2016 */ #line 1 "../src/conf/parse_opts.re" #include "src/codegen/input_api.h" #include "src/conf/msg.h" #include "src/conf/opt.h" -#include "src/conf/warn.h" -#include "src/globals.h" #include "src/ir/regexp/empty_class_policy.h" #include "src/ir/regexp/encoding/enc.h" @@ -17,14 +15,14 @@ static inline bool next (char * & arg, char ** & argv) return arg != NULL; } -parse_opts_t parse_opts (char ** argv, Opt & opts) +parse_opts_t parse_opts (char **argv, Opt &opts, Warn &warn) { #define YYCTYPE unsigned char char * YYCURSOR; char * YYMARKER; Warn::option_t option; -#line 31 "../src/conf/parse_opts.re" +#line 29 "../src/conf/parse_opts.re" opt: @@ -33,7 +31,7 @@ opt: goto end; } -#line 37 "src/conf/parse_opts.cc" +#line 35 "src/conf/parse_opts.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -77,12 +75,12 @@ opt: goto yy4; yy2: ++YYCURSOR; -#line 40 "../src/conf/parse_opts.re" +#line 38 "../src/conf/parse_opts.re" { error ("bad option: %s", *argv); return EXIT_FAIL; } -#line 86 "src/conf/parse_opts.cc" +#line 84 "src/conf/parse_opts.cc" yy4: ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; @@ -91,32 +89,32 @@ yy4: } goto yy8; yy6: - ++YYCURSOR; - if ((yych = (YYCTYPE)*YYCURSOR) <= '-') { + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= '-') { if (yych <= 0x00) goto yy10; if (yych >= '-') goto yy12; } else { if (yych == 'W') goto yy14; } -#line 63 "../src/conf/parse_opts.re" +#line 61 "../src/conf/parse_opts.re" { goto opt_short; } -#line 104 "src/conf/parse_opts.cc" +#line 102 "src/conf/parse_opts.cc" yy8: ++YYCURSOR; -#line 61 "../src/conf/parse_opts.re" +#line 59 "../src/conf/parse_opts.re" { if (!opts.source (*argv)) return EXIT_FAIL; goto opt; } -#line 109 "src/conf/parse_opts.cc" +#line 107 "src/conf/parse_opts.cc" yy10: ++YYCURSOR; -#line 60 "../src/conf/parse_opts.re" +#line 58 "../src/conf/parse_opts.re" { if (!opts.source ("")) return EXIT_FAIL; goto opt; } -#line 114 "src/conf/parse_opts.cc" +#line 112 "src/conf/parse_opts.cc" yy12: - ++YYCURSOR; - if ((yych = (YYCTYPE)*YYCURSOR) <= 0x00) goto yy16; -#line 64 "../src/conf/parse_opts.re" + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 0x00) goto yy16; +#line 62 "../src/conf/parse_opts.re" { goto opt_long; } -#line 120 "src/conf/parse_opts.cc" +#line 118 "src/conf/parse_opts.cc" yy14: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -127,12 +125,12 @@ yy14: if (yych == 'n') goto yy22; } yy15: -#line 68 "../src/conf/parse_opts.re" +#line 66 "../src/conf/parse_opts.re" { option = Warn::W; goto opt_warn; } -#line 133 "src/conf/parse_opts.cc" +#line 131 "src/conf/parse_opts.cc" yy16: ++YYCURSOR; -#line 46 "../src/conf/parse_opts.re" +#line 44 "../src/conf/parse_opts.re" { // all remaining arguments are non-options // so they must be input files @@ -146,12 +144,12 @@ yy16: } goto end; } -#line 150 "src/conf/parse_opts.cc" +#line 148 "src/conf/parse_opts.cc" yy18: ++YYCURSOR; -#line 66 "../src/conf/parse_opts.re" +#line 64 "../src/conf/parse_opts.re" { warn.set_all (); goto opt; } -#line 155 "src/conf/parse_opts.cc" +#line 153 "src/conf/parse_opts.cc" yy20: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy23; @@ -183,9 +181,9 @@ yy26: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'e') goto yy29; yy27: -#line 69 "../src/conf/parse_opts.re" +#line 67 "../src/conf/parse_opts.re" { option = Warn::WNO; goto opt_warn; } -#line 189 "src/conf/parse_opts.cc" +#line 187 "src/conf/parse_opts.cc" yy28: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy30; @@ -205,14 +203,14 @@ yy31: goto yy21; yy32: ++YYCURSOR; -#line 67 "../src/conf/parse_opts.re" +#line 65 "../src/conf/parse_opts.re" { warn.set_all_error (); goto opt; } -#line 211 "src/conf/parse_opts.cc" +#line 209 "src/conf/parse_opts.cc" yy34: ++YYCURSOR; -#line 70 "../src/conf/parse_opts.re" +#line 68 "../src/conf/parse_opts.re" { option = Warn::WERROR; goto opt_warn; } -#line 216 "src/conf/parse_opts.cc" +#line 214 "src/conf/parse_opts.cc" yy36: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'o') goto yy21; @@ -221,16 +219,16 @@ yy36: yych = (YYCTYPE)*++YYCURSOR; if (yych != '-') goto yy21; ++YYCURSOR; -#line 71 "../src/conf/parse_opts.re" +#line 69 "../src/conf/parse_opts.re" { option = Warn::WNOERROR; goto opt_warn; } -#line 227 "src/conf/parse_opts.cc" +#line 225 "src/conf/parse_opts.cc" } -#line 72 "../src/conf/parse_opts.re" +#line 70 "../src/conf/parse_opts.re" opt_warn: -#line 234 "src/conf/parse_opts.cc" +#line 232 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -246,12 +244,12 @@ opt_warn: yy43: ++YYCURSOR; yy44: -#line 77 "../src/conf/parse_opts.re" +#line 75 "../src/conf/parse_opts.re" { error ("bad warning: %s", *argv); return EXIT_FAIL; } -#line 255 "src/conf/parse_opts.cc" +#line 253 "src/conf/parse_opts.cc" yy45: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'o') goto yy51; @@ -678,9 +676,9 @@ yy150: goto yy52; yy151: ++YYCURSOR; -#line 85 "../src/conf/parse_opts.re" +#line 83 "../src/conf/parse_opts.re" { warn.set (Warn::SWAPPED_RANGE, option); goto opt; } -#line 684 "src/conf/parse_opts.cc" +#line 682 "src/conf/parse_opts.cc" yy153: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy160; @@ -719,14 +717,14 @@ yy161: goto yy52; yy162: ++YYCURSOR; -#line 88 "../src/conf/parse_opts.re" +#line 86 "../src/conf/parse_opts.re" { warn.set (Warn::USELESS_ESCAPE, option); goto opt; } -#line 725 "src/conf/parse_opts.cc" +#line 723 "src/conf/parse_opts.cc" yy164: ++YYCURSOR; -#line 81 "../src/conf/parse_opts.re" +#line 79 "../src/conf/parse_opts.re" { warn.set (Warn::CONDITION_ORDER, option); goto opt; } -#line 730 "src/conf/parse_opts.cc" +#line 728 "src/conf/parse_opts.cc" yy166: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'c') goto yy171; @@ -785,18 +783,18 @@ yy179: goto yy52; yy180: ++YYCURSOR; -#line 87 "../src/conf/parse_opts.re" +#line 85 "../src/conf/parse_opts.re" { warn.set (Warn::UNREACHABLE_RULES, option); goto opt; } -#line 791 "src/conf/parse_opts.cc" +#line 789 "src/conf/parse_opts.cc" yy182: yych = (YYCTYPE)*++YYCURSOR; if (yych == 's') goto yy187; goto yy52; yy183: ++YYCURSOR; -#line 83 "../src/conf/parse_opts.re" +#line 81 "../src/conf/parse_opts.re" { warn.set (Warn::MATCH_EMPTY_STRING, option); goto opt; } -#line 800 "src/conf/parse_opts.cc" +#line 798 "src/conf/parse_opts.cc" yy185: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'g') goto yy188; @@ -831,28 +829,28 @@ yy192: goto yy52; yy193: ++YYCURSOR; -#line 82 "../src/conf/parse_opts.re" +#line 80 "../src/conf/parse_opts.re" { warn.set (Warn::EMPTY_CHARACTER_CLASS, option); goto opt; } -#line 837 "src/conf/parse_opts.cc" +#line 835 "src/conf/parse_opts.cc" yy195: ++YYCURSOR; -#line 84 "../src/conf/parse_opts.re" +#line 82 "../src/conf/parse_opts.re" { warn.set (Warn::NONDETERMINISTIC_TAGS, option); goto opt; } -#line 842 "src/conf/parse_opts.cc" +#line 840 "src/conf/parse_opts.cc" yy197: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy52; ++YYCURSOR; -#line 86 "../src/conf/parse_opts.re" +#line 84 "../src/conf/parse_opts.re" { warn.set (Warn::UNDEFINED_CONTROL_FLOW, option); goto opt; } -#line 849 "src/conf/parse_opts.cc" +#line 847 "src/conf/parse_opts.cc" } -#line 89 "../src/conf/parse_opts.re" +#line 87 "../src/conf/parse_opts.re" opt_short: -#line 856 "src/conf/parse_opts.cc" +#line 854 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -925,151 +923,151 @@ opt_short: } yy202: ++YYCURSOR; -#line 98 "../src/conf/parse_opts.re" +#line 96 "../src/conf/parse_opts.re" { goto opt; } -#line 931 "src/conf/parse_opts.cc" +#line 929 "src/conf/parse_opts.cc" yy204: ++YYCURSOR; -#line 94 "../src/conf/parse_opts.re" +#line 92 "../src/conf/parse_opts.re" { error ("bad short option: %s", *argv); return EXIT_FAIL; } -#line 939 "src/conf/parse_opts.cc" +#line 937 "src/conf/parse_opts.cc" yy206: ++YYCURSOR; -#line 123 "../src/conf/parse_opts.re" +#line 121 "../src/conf/parse_opts.re" { goto opt_short; } -#line 944 "src/conf/parse_opts.cc" +#line 942 "src/conf/parse_opts.cc" yy208: ++YYCURSOR; -#line 118 "../src/conf/parse_opts.re" +#line 116 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UTF8)) { error_encoding (); return EXIT_FAIL; } goto opt_short; } -#line 949 "src/conf/parse_opts.cc" +#line 947 "src/conf/parse_opts.cc" yy210: ++YYCURSOR; -#line 99 "../src/conf/parse_opts.re" +#line 97 "../src/conf/parse_opts.re" { usage (); return EXIT_OK; } -#line 954 "src/conf/parse_opts.cc" +#line 952 "src/conf/parse_opts.cc" yy212: ++YYCURSOR; -#line 105 "../src/conf/parse_opts.re" +#line 103 "../src/conf/parse_opts.re" { opts.set_target (opt_t::DOT); goto opt_short; } -#line 959 "src/conf/parse_opts.cc" +#line 957 "src/conf/parse_opts.cc" yy214: ++YYCURSOR; -#line 107 "../src/conf/parse_opts.re" +#line 105 "../src/conf/parse_opts.re" { opts.set_FFlag (true); goto opt_short; } -#line 964 "src/conf/parse_opts.cc" +#line 962 "src/conf/parse_opts.cc" yy216: ++YYCURSOR; -#line 112 "../src/conf/parse_opts.re" +#line 110 "../src/conf/parse_opts.re" { opts.set_target (opt_t::SKELETON); goto opt_short; } -#line 969 "src/conf/parse_opts.cc" +#line 967 "src/conf/parse_opts.cc" yy218: ++YYCURSOR; -#line 113 "../src/conf/parse_opts.re" +#line 111 "../src/conf/parse_opts.re" { opts.set_tags (true); goto opt_short; } -#line 974 "src/conf/parse_opts.cc" +#line 972 "src/conf/parse_opts.cc" yy220: ++YYCURSOR; -#line 101 "../src/conf/parse_opts.re" +#line 99 "../src/conf/parse_opts.re" { vernum (); return EXIT_OK; } -#line 979 "src/conf/parse_opts.cc" +#line 977 "src/conf/parse_opts.cc" yy222: ++YYCURSOR; -#line 102 "../src/conf/parse_opts.re" +#line 100 "../src/conf/parse_opts.re" { opts.set_bFlag (true); goto opt_short; } -#line 984 "src/conf/parse_opts.cc" +#line 982 "src/conf/parse_opts.cc" yy224: ++YYCURSOR; -#line 103 "../src/conf/parse_opts.re" +#line 101 "../src/conf/parse_opts.re" { opts.set_cFlag (true); goto opt_short; } -#line 989 "src/conf/parse_opts.cc" +#line 987 "src/conf/parse_opts.cc" yy226: ++YYCURSOR; -#line 104 "../src/conf/parse_opts.re" +#line 102 "../src/conf/parse_opts.re" { opts.set_dFlag (true); goto opt_short; } -#line 994 "src/conf/parse_opts.cc" +#line 992 "src/conf/parse_opts.cc" yy228: ++YYCURSOR; -#line 114 "../src/conf/parse_opts.re" +#line 112 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::EBCDIC)) { error_encoding (); return EXIT_FAIL; } goto opt_short; } -#line 999 "src/conf/parse_opts.cc" +#line 997 "src/conf/parse_opts.cc" yy230: ++YYCURSOR; -#line 106 "../src/conf/parse_opts.re" +#line 104 "../src/conf/parse_opts.re" { opts.set_fFlag (true); goto opt_short; } -#line 1004 "src/conf/parse_opts.cc" +#line 1002 "src/conf/parse_opts.cc" yy232: ++YYCURSOR; -#line 108 "../src/conf/parse_opts.re" +#line 106 "../src/conf/parse_opts.re" { opts.set_gFlag (true); goto opt_short; } -#line 1009 "src/conf/parse_opts.cc" +#line 1007 "src/conf/parse_opts.cc" yy234: ++YYCURSOR; -#line 109 "../src/conf/parse_opts.re" +#line 107 "../src/conf/parse_opts.re" { opts.set_iFlag (true); goto opt_short; } -#line 1014 "src/conf/parse_opts.cc" +#line 1012 "src/conf/parse_opts.cc" yy236: - ++YYCURSOR; - if ((yych = (YYCTYPE)*YYCURSOR) <= 0x00) goto yy252; -#line 120 "../src/conf/parse_opts.re" + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 0x00) goto yy252; +#line 118 "../src/conf/parse_opts.re" { *argv = YYCURSOR; goto opt_output; } -#line 1020 "src/conf/parse_opts.cc" +#line 1018 "src/conf/parse_opts.cc" yy238: ++YYCURSOR; -#line 110 "../src/conf/parse_opts.re" +#line 108 "../src/conf/parse_opts.re" { opts.set_rFlag (true); goto opt_short; } -#line 1025 "src/conf/parse_opts.cc" +#line 1023 "src/conf/parse_opts.cc" yy240: ++YYCURSOR; -#line 111 "../src/conf/parse_opts.re" +#line 109 "../src/conf/parse_opts.re" { opts.set_sFlag (true); goto opt_short; } -#line 1030 "src/conf/parse_opts.cc" +#line 1028 "src/conf/parse_opts.cc" yy242: - ++YYCURSOR; - if ((yych = (YYCTYPE)*YYCURSOR) <= 0x00) goto yy254; -#line 122 "../src/conf/parse_opts.re" + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= 0x00) goto yy254; +#line 120 "../src/conf/parse_opts.re" { *argv = YYCURSOR; goto opt_header; } -#line 1036 "src/conf/parse_opts.cc" +#line 1034 "src/conf/parse_opts.cc" yy244: ++YYCURSOR; -#line 115 "../src/conf/parse_opts.re" +#line 113 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UTF32)) { error_encoding (); return EXIT_FAIL; } goto opt_short; } -#line 1041 "src/conf/parse_opts.cc" +#line 1039 "src/conf/parse_opts.cc" yy246: ++YYCURSOR; -#line 100 "../src/conf/parse_opts.re" +#line 98 "../src/conf/parse_opts.re" { version (); return EXIT_OK; } -#line 1046 "src/conf/parse_opts.cc" +#line 1044 "src/conf/parse_opts.cc" yy248: ++YYCURSOR; -#line 116 "../src/conf/parse_opts.re" +#line 114 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UCS2)) { error_encoding (); return EXIT_FAIL; } goto opt_short; } -#line 1051 "src/conf/parse_opts.cc" +#line 1049 "src/conf/parse_opts.cc" yy250: ++YYCURSOR; -#line 117 "../src/conf/parse_opts.re" +#line 115 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UTF16)) { error_encoding (); return EXIT_FAIL; } goto opt_short; } -#line 1056 "src/conf/parse_opts.cc" +#line 1054 "src/conf/parse_opts.cc" yy252: ++YYCURSOR; -#line 119 "../src/conf/parse_opts.re" +#line 117 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-o, --output"); return EXIT_FAIL; } goto opt_output; } -#line 1061 "src/conf/parse_opts.cc" +#line 1059 "src/conf/parse_opts.cc" yy254: ++YYCURSOR; -#line 121 "../src/conf/parse_opts.re" +#line 119 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-t, --type-header"); return EXIT_FAIL; } goto opt_header; } -#line 1066 "src/conf/parse_opts.cc" +#line 1064 "src/conf/parse_opts.cc" } -#line 124 "../src/conf/parse_opts.re" +#line 122 "../src/conf/parse_opts.re" opt_long: -#line 1073 "src/conf/parse_opts.cc" +#line 1071 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -1094,12 +1092,12 @@ opt_long: yy258: ++YYCURSOR; yy259: -#line 129 "../src/conf/parse_opts.re" +#line 127 "../src/conf/parse_opts.re" { error ("bad long option: %s", *argv); return EXIT_FAIL; } -#line 1103 "src/conf/parse_opts.cc" +#line 1101 "src/conf/parse_opts.cc" yy260: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'i') goto yy275; @@ -1432,9 +1430,9 @@ yy334: goto yy276; yy335: ++YYCURSOR; -#line 153 "../src/conf/parse_opts.re" +#line 151 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::EBCDIC)) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 1438 "src/conf/parse_opts.cc" +#line 1436 "src/conf/parse_opts.cc" yy337: yych = (YYCTYPE)*++YYCURSOR; if (yych == '-') goto yy367; @@ -1575,9 +1573,9 @@ yy370: goto yy276; yy371: ++YYCURSOR; -#line 133 "../src/conf/parse_opts.re" +#line 131 "../src/conf/parse_opts.re" { usage (); return EXIT_OK; } -#line 1581 "src/conf/parse_opts.cc" +#line 1579 "src/conf/parse_opts.cc" yy373: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy405; @@ -1628,9 +1626,9 @@ yy384: goto yy276; yy385: ++YYCURSOR; -#line 151 "../src/conf/parse_opts.re" +#line 149 "../src/conf/parse_opts.re" { opts.set_tags (true); goto opt; } -#line 1634 "src/conf/parse_opts.cc" +#line 1632 "src/conf/parse_opts.cc" yy387: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'h') goto yy418; @@ -1705,9 +1703,9 @@ yy404: goto yy276; yy405: ++YYCURSOR; -#line 161 "../src/conf/parse_opts.re" +#line 159 "../src/conf/parse_opts.re" { goto opt_input; } -#line 1711 "src/conf/parse_opts.cc" +#line 1709 "src/conf/parse_opts.cc" yy407: yych = (YYCTYPE)*++YYCURSOR; if (yych == '-') goto yy437; @@ -1766,9 +1764,9 @@ yy420: goto yy276; yy421: ++YYCURSOR; -#line 157 "../src/conf/parse_opts.re" +#line 155 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UTF8)) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 1772 "src/conf/parse_opts.cc" +#line 1770 "src/conf/parse_opts.cc" yy423: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy453; @@ -1848,9 +1846,9 @@ yy441: goto yy276; yy442: ++YYCURSOR; -#line 158 "../src/conf/parse_opts.re" +#line 156 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-o, --output"); return EXIT_FAIL; } goto opt_output; } -#line 1854 "src/conf/parse_opts.cc" +#line 1852 "src/conf/parse_opts.cc" yy444: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy474; @@ -1881,14 +1879,14 @@ yy450: goto yy276; yy451: ++YYCURSOR; -#line 156 "../src/conf/parse_opts.re" +#line 154 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UTF16)) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 1887 "src/conf/parse_opts.cc" +#line 1885 "src/conf/parse_opts.cc" yy453: ++YYCURSOR; -#line 135 "../src/conf/parse_opts.re" +#line 133 "../src/conf/parse_opts.re" { vernum (); return EXIT_OK; } -#line 1892 "src/conf/parse_opts.cc" +#line 1890 "src/conf/parse_opts.cc" yy455: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy482; @@ -1991,14 +1989,14 @@ yy479: goto yy276; yy480: ++YYCURSOR; -#line 154 "../src/conf/parse_opts.re" +#line 152 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UTF32)) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 1997 "src/conf/parse_opts.cc" +#line 1995 "src/conf/parse_opts.cc" yy482: ++YYCURSOR; -#line 134 "../src/conf/parse_opts.re" +#line 132 "../src/conf/parse_opts.re" { version (); return EXIT_OK; } -#line 2002 "src/conf/parse_opts.cc" +#line 2000 "src/conf/parse_opts.cc" yy484: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy511; @@ -2042,9 +2040,9 @@ yy492: } yy493: ++YYCURSOR; -#line 139 "../src/conf/parse_opts.re" +#line 137 "../src/conf/parse_opts.re" { opts.set_target (opt_t::DOT); goto opt; } -#line 2048 "src/conf/parse_opts.cc" +#line 2046 "src/conf/parse_opts.cc" yy495: yych = (YYCTYPE)*++YYCURSOR; if (yych == 's') goto yy524; @@ -2079,18 +2077,18 @@ yy502: goto yy276; yy503: ++YYCURSOR; -#line 144 "../src/conf/parse_opts.re" +#line 142 "../src/conf/parse_opts.re" { opts.set_rFlag (true); goto opt; } -#line 2085 "src/conf/parse_opts.cc" +#line 2083 "src/conf/parse_opts.cc" yy505: yych = (YYCTYPE)*++YYCURSOR; if (yych == 's') goto yy532; goto yy276; yy506: ++YYCURSOR; -#line 150 "../src/conf/parse_opts.re" +#line 148 "../src/conf/parse_opts.re" { opts.set_target (opt_t::SKELETON); goto opt; } -#line 2094 "src/conf/parse_opts.cc" +#line 2092 "src/conf/parse_opts.cc" yy508: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'd') goto yy533; @@ -2133,9 +2131,9 @@ yy517: goto yy276; yy518: ++YYCURSOR; -#line 170 "../src/conf/parse_opts.re" +#line 168 "../src/conf/parse_opts.re" { opts.set_dump_adfa(true); goto opt; } -#line 2139 "src/conf/parse_opts.cc" +#line 2137 "src/conf/parse_opts.cc" yy520: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy543; @@ -2258,9 +2256,9 @@ yy549: goto yy276; yy550: ++YYCURSOR; -#line 145 "../src/conf/parse_opts.re" +#line 143 "../src/conf/parse_opts.re" { opts.set_sFlag (true); goto opt; } -#line 2264 "src/conf/parse_opts.cc" +#line 2262 "src/conf/parse_opts.cc" yy552: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'f') goto yy579; @@ -2271,9 +2269,9 @@ yy553: goto yy276; yy554: ++YYCURSOR; -#line 147 "../src/conf/parse_opts.re" +#line 145 "../src/conf/parse_opts.re" { opts.set_version (false); goto opt; } -#line 2277 "src/conf/parse_opts.cc" +#line 2275 "src/conf/parse_opts.cc" yy556: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'v') goto yy581; @@ -2296,14 +2294,14 @@ yy560: goto yy276; yy561: ++YYCURSOR; -#line 155 "../src/conf/parse_opts.re" +#line 153 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UCS2)) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 2302 "src/conf/parse_opts.cc" +#line 2300 "src/conf/parse_opts.cc" yy563: ++YYCURSOR; -#line 136 "../src/conf/parse_opts.re" +#line 134 "../src/conf/parse_opts.re" { opts.set_bFlag (true); goto opt; } -#line 2307 "src/conf/parse_opts.cc" +#line 2305 "src/conf/parse_opts.cc" yy565: yych = (YYCTYPE)*++YYCURSOR; if (yych == 't') goto yy588; @@ -2342,18 +2340,18 @@ yy573: goto yy276; yy574: ++YYCURSOR; -#line 162 "../src/conf/parse_opts.re" +#line 160 "../src/conf/parse_opts.re" { goto opt_empty_class; } -#line 2348 "src/conf/parse_opts.cc" +#line 2346 "src/conf/parse_opts.cc" yy576: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'i') goto yy601; goto yy276; yy577: ++YYCURSOR; -#line 141 "../src/conf/parse_opts.re" +#line 139 "../src/conf/parse_opts.re" { opts.set_FFlag (true); goto opt; } -#line 2357 "src/conf/parse_opts.cc" +#line 2355 "src/conf/parse_opts.cc" yy579: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'o') goto yy602; @@ -2368,9 +2366,9 @@ yy581: goto yy276; yy582: ++YYCURSOR; -#line 164 "../src/conf/parse_opts.re" +#line 162 "../src/conf/parse_opts.re" { goto opt; } -#line 2374 "src/conf/parse_opts.cc" +#line 2372 "src/conf/parse_opts.cc" yy584: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'i') goto yy605; @@ -2381,9 +2379,9 @@ yy585: goto yy276; yy586: ++YYCURSOR; -#line 159 "../src/conf/parse_opts.re" +#line 157 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-t, --type-header"); return EXIT_FAIL; } goto opt_header; } -#line 2387 "src/conf/parse_opts.cc" +#line 2385 "src/conf/parse_opts.cc" yy588: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'i') goto yy607; @@ -2398,28 +2396,28 @@ yy590: goto yy276; yy591: ++YYCURSOR; -#line 138 "../src/conf/parse_opts.re" +#line 136 "../src/conf/parse_opts.re" { opts.set_dFlag (true); goto opt; } -#line 2404 "src/conf/parse_opts.cc" +#line 2402 "src/conf/parse_opts.cc" yy593: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'i') goto yy611; goto yy276; yy594: ++YYCURSOR; -#line 167 "../src/conf/parse_opts.re" +#line 165 "../src/conf/parse_opts.re" { opts.set_dump_dfa_det(true); goto opt; } -#line 2413 "src/conf/parse_opts.cc" +#line 2411 "src/conf/parse_opts.cc" yy596: ++YYCURSOR; -#line 169 "../src/conf/parse_opts.re" +#line 167 "../src/conf/parse_opts.re" { opts.set_dump_dfa_min(true); goto opt; } -#line 2418 "src/conf/parse_opts.cc" +#line 2416 "src/conf/parse_opts.cc" yy598: ++YYCURSOR; -#line 166 "../src/conf/parse_opts.re" +#line 164 "../src/conf/parse_opts.re" { opts.set_dump_dfa_raw(true); goto opt; } -#line 2423 "src/conf/parse_opts.cc" +#line 2421 "src/conf/parse_opts.cc" yy600: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'p') goto yy612; @@ -2454,9 +2452,9 @@ yy607: goto yy276; yy608: ++YYCURSOR; -#line 149 "../src/conf/parse_opts.re" +#line 147 "../src/conf/parse_opts.re" { opts.set_bCaseInverted (true); goto opt; } -#line 2460 "src/conf/parse_opts.cc" +#line 2458 "src/conf/parse_opts.cc" yy610: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy621; @@ -2475,9 +2473,9 @@ yy613: goto yy276; yy614: ++YYCURSOR; -#line 143 "../src/conf/parse_opts.re" +#line 141 "../src/conf/parse_opts.re" { opts.set_iFlag (true); goto opt; } -#line 2481 "src/conf/parse_opts.cc" +#line 2479 "src/conf/parse_opts.cc" yy616: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'd') goto yy626; @@ -2500,9 +2498,9 @@ yy620: goto yy276; yy621: ++YYCURSOR; -#line 142 "../src/conf/parse_opts.re" +#line 140 "../src/conf/parse_opts.re" { opts.set_gFlag (true); goto opt; } -#line 2506 "src/conf/parse_opts.cc" +#line 2504 "src/conf/parse_opts.cc" yy623: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'n') goto yy632; @@ -2529,9 +2527,9 @@ yy628: goto yy276; yy629: ++YYCURSOR; -#line 140 "../src/conf/parse_opts.re" +#line 138 "../src/conf/parse_opts.re" { opts.set_fFlag (true); goto opt; } -#line 2535 "src/conf/parse_opts.cc" +#line 2533 "src/conf/parse_opts.cc" yy631: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy640; @@ -2542,14 +2540,14 @@ yy632: goto yy276; yy633: ++YYCURSOR; -#line 168 "../src/conf/parse_opts.re" +#line 166 "../src/conf/parse_opts.re" { opts.set_dump_dfa_tagopt(true); goto opt; } -#line 2548 "src/conf/parse_opts.cc" +#line 2546 "src/conf/parse_opts.cc" yy635: ++YYCURSOR; -#line 160 "../src/conf/parse_opts.re" +#line 158 "../src/conf/parse_opts.re" { goto opt_encoding_policy; } -#line 2553 "src/conf/parse_opts.cc" +#line 2551 "src/conf/parse_opts.cc" yy637: yych = (YYCTYPE)*++YYCURSOR; if (yych == 't') goto yy644; @@ -2564,14 +2562,14 @@ yy639: goto yy276; yy640: ++YYCURSOR; -#line 148 "../src/conf/parse_opts.re" +#line 146 "../src/conf/parse_opts.re" { opts.set_bCaseInsensitive (true); goto opt; } -#line 2570 "src/conf/parse_opts.cc" +#line 2568 "src/conf/parse_opts.cc" yy642: ++YYCURSOR; -#line 163 "../src/conf/parse_opts.re" +#line 161 "../src/conf/parse_opts.re" { goto opt_dfa_minimization; } -#line 2575 "src/conf/parse_opts.cc" +#line 2573 "src/conf/parse_opts.cc" yy644: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy648; @@ -2582,9 +2580,9 @@ yy645: goto yy276; yy646: ++YYCURSOR; -#line 137 "../src/conf/parse_opts.re" +#line 135 "../src/conf/parse_opts.re" { opts.set_cFlag (true); goto opt; } -#line 2588 "src/conf/parse_opts.cc" +#line 2586 "src/conf/parse_opts.cc" yy648: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 0x00) goto yy650; @@ -2595,9 +2593,9 @@ yy649: goto yy276; yy650: ++YYCURSOR; -#line 146 "../src/conf/parse_opts.re" +#line 144 "../src/conf/parse_opts.re" { opts.set_bNoGenerationDate (true); goto opt; } -#line 2601 "src/conf/parse_opts.cc" +#line 2599 "src/conf/parse_opts.cc" yy652: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'n') goto yy276; @@ -2606,16 +2604,16 @@ yy652: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy276; ++YYCURSOR; -#line 152 "../src/conf/parse_opts.re" +#line 150 "../src/conf/parse_opts.re" { opts.set_bijective_mapping(false); goto opt; } -#line 2612 "src/conf/parse_opts.cc" +#line 2610 "src/conf/parse_opts.cc" } -#line 171 "../src/conf/parse_opts.re" +#line 169 "../src/conf/parse_opts.re" opt_output: -#line 2619 "src/conf/parse_opts.cc" +#line 2617 "src/conf/parse_opts.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2657,12 +2655,12 @@ opt_output: if (yych != '-') goto yy661; yy659: ++YYCURSOR; -#line 176 "../src/conf/parse_opts.re" +#line 174 "../src/conf/parse_opts.re" { error ("bad argument to option -o, --output: %s", *argv); return EXIT_FAIL; } -#line 2666 "src/conf/parse_opts.cc" +#line 2664 "src/conf/parse_opts.cc" yy661: ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; @@ -2670,16 +2668,16 @@ yy661: goto yy661; } ++YYCURSOR; -#line 180 "../src/conf/parse_opts.re" +#line 178 "../src/conf/parse_opts.re" { opts.set_output_file(*argv); goto opt; } -#line 2676 "src/conf/parse_opts.cc" +#line 2674 "src/conf/parse_opts.cc" } -#line 181 "../src/conf/parse_opts.re" +#line 179 "../src/conf/parse_opts.re" opt_header: -#line 2683 "src/conf/parse_opts.cc" +#line 2681 "src/conf/parse_opts.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2721,12 +2719,12 @@ opt_header: if (yych != '-') goto yy669; yy667: ++YYCURSOR; -#line 186 "../src/conf/parse_opts.re" +#line 184 "../src/conf/parse_opts.re" { error ("bad argument to option -t, --type-header: %s", *argv); return EXIT_FAIL; } -#line 2730 "src/conf/parse_opts.cc" +#line 2728 "src/conf/parse_opts.cc" yy669: ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; @@ -2734,11 +2732,11 @@ yy669: goto yy669; } ++YYCURSOR; -#line 190 "../src/conf/parse_opts.re" +#line 188 "../src/conf/parse_opts.re" { opts.set_header_file (*argv); goto opt; } -#line 2740 "src/conf/parse_opts.cc" +#line 2738 "src/conf/parse_opts.cc" } -#line 191 "../src/conf/parse_opts.re" +#line 189 "../src/conf/parse_opts.re" opt_encoding_policy: @@ -2748,7 +2746,7 @@ opt_encoding_policy: return EXIT_FAIL; } -#line 2752 "src/conf/parse_opts.cc" +#line 2750 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -2760,12 +2758,12 @@ opt_encoding_policy: } ++YYCURSOR; yy676: -#line 201 "../src/conf/parse_opts.re" +#line 199 "../src/conf/parse_opts.re" { error ("bad argument to option --encoding-policy (expected: ignore | substitute | fail): %s", *argv); return EXIT_FAIL; } -#line 2769 "src/conf/parse_opts.cc" +#line 2767 "src/conf/parse_opts.cc" yy677: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'a') goto yy680; @@ -2818,9 +2816,9 @@ yy689: goto yy681; yy690: ++YYCURSOR; -#line 207 "../src/conf/parse_opts.re" +#line 205 "../src/conf/parse_opts.re" { opts.set_encoding_policy (Enc::POLICY_FAIL); goto opt; } -#line 2824 "src/conf/parse_opts.cc" +#line 2822 "src/conf/parse_opts.cc" yy692: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy694; @@ -2839,9 +2837,9 @@ yy695: goto yy681; yy696: ++YYCURSOR; -#line 205 "../src/conf/parse_opts.re" +#line 203 "../src/conf/parse_opts.re" { opts.set_encoding_policy (Enc::POLICY_IGNORE); goto opt; } -#line 2845 "src/conf/parse_opts.cc" +#line 2843 "src/conf/parse_opts.cc" yy698: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'u') goto yy681; @@ -2852,11 +2850,11 @@ yy698: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy681; ++YYCURSOR; -#line 206 "../src/conf/parse_opts.re" +#line 204 "../src/conf/parse_opts.re" { opts.set_encoding_policy (Enc::POLICY_SUBSTITUTE); goto opt; } -#line 2858 "src/conf/parse_opts.cc" +#line 2856 "src/conf/parse_opts.cc" } -#line 208 "../src/conf/parse_opts.re" +#line 206 "../src/conf/parse_opts.re" opt_input: @@ -2866,7 +2864,7 @@ opt_input: return EXIT_FAIL; } -#line 2870 "src/conf/parse_opts.cc" +#line 2868 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -2876,12 +2874,12 @@ opt_input: yy706: ++YYCURSOR; yy707: -#line 218 "../src/conf/parse_opts.re" +#line 216 "../src/conf/parse_opts.re" { error ("bad argument to option --input (expected: default | custom): %s", *argv); return EXIT_FAIL; } -#line 2885 "src/conf/parse_opts.cc" +#line 2883 "src/conf/parse_opts.cc" yy708: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'u') goto yy710; @@ -2934,18 +2932,18 @@ yy720: goto yy711; yy721: ++YYCURSOR; -#line 223 "../src/conf/parse_opts.re" +#line 221 "../src/conf/parse_opts.re" { opts.set_input_api (InputAPI::CUSTOM); goto opt; } -#line 2940 "src/conf/parse_opts.cc" +#line 2938 "src/conf/parse_opts.cc" yy723: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy711; ++YYCURSOR; -#line 222 "../src/conf/parse_opts.re" +#line 220 "../src/conf/parse_opts.re" { opts.set_input_api (InputAPI::DEFAULT); goto opt; } -#line 2947 "src/conf/parse_opts.cc" +#line 2945 "src/conf/parse_opts.cc" } -#line 224 "../src/conf/parse_opts.re" +#line 222 "../src/conf/parse_opts.re" opt_empty_class: @@ -2955,7 +2953,7 @@ opt_empty_class: return EXIT_FAIL; } -#line 2959 "src/conf/parse_opts.cc" +#line 2957 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -2963,12 +2961,12 @@ opt_empty_class: if (yych == 'm') goto yy731; ++YYCURSOR; yy729: -#line 234 "../src/conf/parse_opts.re" +#line 232 "../src/conf/parse_opts.re" { error ("bad argument to option --empty-class (expected: match-empty | match-none | error): %s", *argv); return EXIT_FAIL; } -#line 2972 "src/conf/parse_opts.cc" +#line 2970 "src/conf/parse_opts.cc" yy730: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'r') goto yy732; @@ -3013,9 +3011,9 @@ yy740: goto yy733; yy741: ++YYCURSOR; -#line 240 "../src/conf/parse_opts.re" +#line 238 "../src/conf/parse_opts.re" { opts.set_empty_class_policy (EMPTY_CLASS_ERROR); goto opt; } -#line 3019 "src/conf/parse_opts.cc" +#line 3017 "src/conf/parse_opts.cc" yy743: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy744; @@ -3059,16 +3057,16 @@ yy752: goto yy733; yy753: ++YYCURSOR; -#line 239 "../src/conf/parse_opts.re" +#line 237 "../src/conf/parse_opts.re" { opts.set_empty_class_policy (EMPTY_CLASS_MATCH_NONE); goto opt; } -#line 3065 "src/conf/parse_opts.cc" +#line 3063 "src/conf/parse_opts.cc" yy755: ++YYCURSOR; -#line 238 "../src/conf/parse_opts.re" +#line 236 "../src/conf/parse_opts.re" { opts.set_empty_class_policy (EMPTY_CLASS_MATCH_EMPTY); goto opt; } -#line 3070 "src/conf/parse_opts.cc" +#line 3068 "src/conf/parse_opts.cc" } -#line 241 "../src/conf/parse_opts.re" +#line 239 "../src/conf/parse_opts.re" opt_dfa_minimization: @@ -3078,7 +3076,7 @@ opt_dfa_minimization: return EXIT_FAIL; } -#line 3082 "src/conf/parse_opts.cc" +#line 3080 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; @@ -3086,12 +3084,12 @@ opt_dfa_minimization: if (yych == 't') goto yy762; ++YYCURSOR; yy760: -#line 251 "../src/conf/parse_opts.re" +#line 249 "../src/conf/parse_opts.re" { error ("bad argument to option --dfa-minimization (expected: table | moore): %s", *argv); return EXIT_FAIL; } -#line 3095 "src/conf/parse_opts.cc" +#line 3093 "src/conf/parse_opts.cc" yy761: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == 'o') goto yy763; @@ -3136,16 +3134,16 @@ yy771: goto yy764; yy772: ++YYCURSOR; -#line 256 "../src/conf/parse_opts.re" +#line 254 "../src/conf/parse_opts.re" { opts.set_dfa_minimization (DFA_MINIMIZATION_MOORE); goto opt; } -#line 3142 "src/conf/parse_opts.cc" +#line 3140 "src/conf/parse_opts.cc" yy774: ++YYCURSOR; -#line 255 "../src/conf/parse_opts.re" +#line 253 "../src/conf/parse_opts.re" { opts.set_dfa_minimization (DFA_MINIMIZATION_TABLE); goto opt; } -#line 3147 "src/conf/parse_opts.cc" +#line 3145 "src/conf/parse_opts.cc" } -#line 257 "../src/conf/parse_opts.re" +#line 255 "../src/conf/parse_opts.re" end: diff --git a/re2c/bootstrap/src/parse/lex.cc b/re2c/bootstrap/src/parse/lex.cc index ec10a9d5..3b61d943 100644 --- a/re2c/bootstrap/src/parse/lex.cc +++ b/re2c/bootstrap/src/parse/lex.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 0.16 on Sun Dec 18 11:56:11 2016 */ +/* Generated by re2c 0.16 on Sun Dec 18 12:25:39 2016 */ #line 1 "../src/parse/lex.re" #include "src/util/c99_stdint.h" #include @@ -8,7 +8,6 @@ #include #include "src/codegen/output.h" -#include "src/conf/warn.h" #include "src/globals.h" #include "src/ir/regexp/encoding/enc.h" #include "src/ir/regexp/regexp.h" @@ -37,10 +36,10 @@ namespace re2c // source code is in ASCII: pointers have type 'char *' // but re2c makes an implicit assumption that YYCTYPE is unsigned // when it generates comparisons -#line 40 "../src/parse/lex.re" +#line 39 "../src/parse/lex.re" -#line 61 "../src/parse/lex.re" +#line 60 "../src/parse/lex.re" Scanner::ParseMode Scanner::echo() @@ -55,7 +54,7 @@ echo: const char *start = cur; -#line 59 "src/parse/lex.cc" +#line 58 "src/parse/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -113,7 +112,7 @@ echo: } } ++YYCURSOR; -#line 152 "../src/parse/lex.re" +#line 151 "../src/parse/lex.re" { if (cur == eof) { if (opts->target == opt_t::CODE) { @@ -123,13 +122,13 @@ echo: } goto echo; } -#line 127 "src/parse/lex.cc" +#line 126 "src/parse/lex.cc" yy4: ++YYCURSOR; yy5: -#line 173 "../src/parse/lex.re" +#line 172 "../src/parse/lex.re" { goto echo; } -#line 133 "src/parse/lex.cc" +#line 132 "src/parse/lex.cc" yy6: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -138,13 +137,13 @@ yy6: } if (yych == '#') goto yy14; yy7: -#line 167 "../src/parse/lex.re" +#line 166 "../src/parse/lex.re" { cline++; pos = cur; goto echo; } -#line 148 "src/parse/lex.cc" +#line 147 "src/parse/lex.cc" yy8: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy6; @@ -187,7 +186,7 @@ yy14: } yy16: ++YYCURSOR; -#line 75 "../src/parse/lex.re" +#line 74 "../src/parse/lex.re" { if (opts->rFlag) { fatal("found standard 're2c' block while using -r flag"); @@ -197,7 +196,7 @@ yy16: } return Parse; } -#line 201 "src/parse/lex.cc" +#line 200 "src/parse/lex.cc" yy18: yych = (YYCTYPE)*++YYCURSOR; if (yych == '!') goto yy20; @@ -425,12 +424,12 @@ yy64: yy66: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 162 "../src/parse/lex.re" +#line 161 "../src/parse/lex.re" { set_sourceline(); goto echo; } -#line 434 "src/parse/lex.cc" +#line 433 "src/parse/lex.cc" yy68: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy66; @@ -522,7 +521,7 @@ yy88: goto yy13; yy89: ++YYCURSOR; -#line 115 "../src/parse/lex.re" +#line 114 "../src/parse/lex.re" { if (opts->target == opt_t::CODE) { out.wraw(tok, start) @@ -531,7 +530,7 @@ yy89: lex_end_of_comment(); goto echo; } -#line 535 "src/parse/lex.cc" +#line 534 "src/parse/lex.cc" yy91: yych = (YYCTYPE)*++YYCURSOR; if (yych == '2') goto yy98; @@ -546,7 +545,7 @@ yy93: goto yy13; yy94: ++YYCURSOR; -#line 96 "../src/parse/lex.re" +#line 95 "../src/parse/lex.re" { if (!opts->rFlag) { fatal("found 'use:re2c' block without -r flag"); @@ -557,7 +556,7 @@ yy94: reuse(); return Reuse; } -#line 561 "src/parse/lex.cc" +#line 560 "src/parse/lex.cc" yy96: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy102; @@ -572,7 +571,7 @@ yy98: goto yy13; yy99: ++YYCURSOR; -#line 144 "../src/parse/lex.re" +#line 143 "../src/parse/lex.re" { if (opts->target == opt_t::CODE) { out.wraw(tok, start); @@ -580,7 +579,7 @@ yy99: lex_tags(); goto echo; } -#line 584 "src/parse/lex.cc" +#line 583 "src/parse/lex.cc" yy101: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'c') goto yy106; @@ -595,7 +594,7 @@ yy103: goto yy13; yy104: ++YYCURSOR; -#line 85 "../src/parse/lex.re" +#line 84 "../src/parse/lex.re" { if (!opts->rFlag) { fatal("found 'rules:re2c' block without -r flag"); @@ -606,10 +605,10 @@ yy104: opts.reset_mapCodeName (); return Rules; } -#line 610 "src/parse/lex.cc" +#line 609 "src/parse/lex.cc" yy106: ++YYCURSOR; -#line 133 "../src/parse/lex.re" +#line 132 "../src/parse/lex.re" { if (opts->target == opt_t::CODE) { out.wraw(tok, start) @@ -620,14 +619,14 @@ yy106: lex_end_of_comment(); goto echo; } -#line 624 "src/parse/lex.cc" +#line 623 "src/parse/lex.cc" yy108: yych = (YYCTYPE)*++YYCURSOR; if (yych == '2') goto yy111; goto yy13; yy109: ++YYCURSOR; -#line 107 "../src/parse/lex.re" +#line 106 "../src/parse/lex.re" { if (opts->target == opt_t::CODE) { out.wraw(tok, start); @@ -635,12 +634,12 @@ yy109: lex_end_of_comment(); goto echo; } -#line 639 "src/parse/lex.cc" +#line 638 "src/parse/lex.cc" yy111: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy13; ++YYCURSOR; -#line 124 "../src/parse/lex.re" +#line 123 "../src/parse/lex.re" { if (opts->target == opt_t::CODE) { out.wraw(tok, start) @@ -649,9 +648,9 @@ yy111: lex_end_of_comment(); goto echo; } -#line 653 "src/parse/lex.cc" +#line 652 "src/parse/lex.cc" } -#line 174 "../src/parse/lex.re" +#line 173 "../src/parse/lex.re" } @@ -659,7 +658,7 @@ void Scanner::lex_end_of_comment() { uint32_t ignored = 0; for (;;) { -#line 663 "src/parse/lex.cc" +#line 662 "src/parse/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -675,20 +674,20 @@ void Scanner::lex_end_of_comment() } yy116: ++YYCURSOR; -#line 181 "../src/parse/lex.re" +#line 180 "../src/parse/lex.re" { fatal("expected end of block"); } -#line 681 "src/parse/lex.cc" +#line 680 "src/parse/lex.cc" yy118: ++YYCURSOR; yy119: -#line 183 "../src/parse/lex.re" +#line 182 "../src/parse/lex.re" { continue; } -#line 687 "src/parse/lex.cc" +#line 686 "src/parse/lex.cc" yy120: ++YYCURSOR; -#line 184 "../src/parse/lex.re" +#line 183 "../src/parse/lex.re" { ++ignored; continue; } -#line 692 "src/parse/lex.cc" +#line 691 "src/parse/lex.cc" yy122: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy120; @@ -697,7 +696,7 @@ yy123: yych = (YYCTYPE)*++YYCURSOR; if (yych != '/') goto yy119; ++YYCURSOR; -#line 185 "../src/parse/lex.re" +#line 184 "../src/parse/lex.re" { if (ignored > 0) { cline += ignored; @@ -706,9 +705,9 @@ yy123: tok = pos = cur; return; } -#line 710 "src/parse/lex.cc" +#line 709 "src/parse/lex.cc" } -#line 193 "../src/parse/lex.re" +#line 192 "../src/parse/lex.re" } } @@ -716,7 +715,7 @@ void Scanner::lex_tags() { std::string fmt, sep; for (;;) { -#line 720 "src/parse/lex.cc" +#line 719 "src/parse/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -774,9 +773,9 @@ void Scanner::lex_tags() } ++YYCURSOR; yy129: -#line 200 "../src/parse/lex.re" +#line 199 "../src/parse/lex.re" { fatal("unrecognized configuration"); } -#line 780 "src/parse/lex.cc" +#line 779 "src/parse/lex.cc" yy130: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -784,14 +783,14 @@ yy130: if (yybm[0+yych] & 128) { goto yy130; } -#line 205 "../src/parse/lex.re" +#line 204 "../src/parse/lex.re" { continue; } -#line 790 "src/parse/lex.cc" +#line 789 "src/parse/lex.cc" yy133: ++YYCURSOR; -#line 206 "../src/parse/lex.re" +#line 205 "../src/parse/lex.re" { ++cline; continue; } -#line 795 "src/parse/lex.cc" +#line 794 "src/parse/lex.cc" yy135: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy133; @@ -810,7 +809,7 @@ yy138: goto yy129; yy139: ++YYCURSOR; -#line 207 "../src/parse/lex.re" +#line 206 "../src/parse/lex.re" { if (opts->target == opt_t::CODE) { out.wdelay_tags(opts->topIndent, @@ -819,7 +818,7 @@ yy139: tok = pos = cur; return; } -#line 823 "src/parse/lex.cc" +#line 822 "src/parse/lex.cc" yy141: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'r') goto yy144; @@ -856,9 +855,9 @@ yy149: goto yy142; yy150: ++YYCURSOR; -#line 202 "../src/parse/lex.re" +#line 201 "../src/parse/lex.re" { fmt = lex_conf_string(); continue; } -#line 862 "src/parse/lex.cc" +#line 861 "src/parse/lex.cc" yy152: yych = (YYCTYPE)*++YYCURSOR; if (yych != 't') goto yy142; @@ -867,11 +866,11 @@ yy152: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'r') goto yy142; ++YYCURSOR; -#line 203 "../src/parse/lex.re" +#line 202 "../src/parse/lex.re" { sep = lex_conf_string(); continue; } -#line 873 "src/parse/lex.cc" +#line 872 "src/parse/lex.cc" } -#line 215 "../src/parse/lex.re" +#line 214 "../src/parse/lex.re" } } @@ -891,7 +890,7 @@ scan: start: -#line 895 "src/parse/lex.cc" +#line 894 "src/parse/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -997,12 +996,12 @@ start: yy159: ++YYCURSOR; yy160: -#line 397 "../src/parse/lex.re" +#line 396 "../src/parse/lex.re" { fatalf("unexpected character: '%c'", *tok); goto scan; } -#line 1006 "src/parse/lex.cc" +#line 1005 "src/parse/lex.cc" yy161: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -1010,11 +1009,11 @@ yy161: if (yybm[0+yych] & 16) { goto yy161; } -#line 381 "../src/parse/lex.re" +#line 380 "../src/parse/lex.re" { goto scan; } -#line 1018 "src/parse/lex.cc" +#line 1017 "src/parse/lex.cc" yy164: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -1025,65 +1024,65 @@ yy164: if (yych == '#') goto yy194; } yy165: -#line 390 "../src/parse/lex.re" +#line 389 "../src/parse/lex.re" { if (cur == eof) return 0; pos = cur; cline++; goto scan; } -#line 1036 "src/parse/lex.cc" +#line 1035 "src/parse/lex.cc" yy166: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy164; goto yy160; yy167: ++YYCURSOR; -#line 264 "../src/parse/lex.re" +#line 263 "../src/parse/lex.re" { yylval.regexp = lex_str('"', opts->bCaseInsensitive || opts->bCaseInverted); return TOKEN_REGEXP; } -#line 1045 "src/parse/lex.cc" +#line 1044 "src/parse/lex.cc" yy169: yych = (YYCTYPE)*++YYCURSOR; if (yych == '}') goto yy196; goto yy160; yy170: ++YYCURSOR; -#line 263 "../src/parse/lex.re" +#line 262 "../src/parse/lex.re" { yylval.regexp = lex_str('\'', opts->bCaseInsensitive || !opts->bCaseInverted); return TOKEN_REGEXP; } -#line 1054 "src/parse/lex.cc" +#line 1053 "src/parse/lex.cc" yy172: ++YYCURSOR; yy173: -#line 284 "../src/parse/lex.re" +#line 283 "../src/parse/lex.re" { return *tok; } -#line 1062 "src/parse/lex.cc" +#line 1061 "src/parse/lex.cc" yy174: yych = (YYCTYPE)*++YYCURSOR; if (yych == '/') goto yy196; -#line 288 "../src/parse/lex.re" +#line 287 "../src/parse/lex.re" { yylval.op = *tok; return TOKEN_STAR; } -#line 1071 "src/parse/lex.cc" +#line 1070 "src/parse/lex.cc" yy176: ++YYCURSOR; -#line 292 "../src/parse/lex.re" +#line 291 "../src/parse/lex.re" { yylval.op = *tok; return TOKEN_CLOSE; } -#line 1079 "src/parse/lex.cc" +#line 1078 "src/parse/lex.cc" yy178: ++YYCURSOR; -#line 376 "../src/parse/lex.re" +#line 375 "../src/parse/lex.re" { yylval.regexp = mkDot(); return TOKEN_REGEXP; } -#line 1087 "src/parse/lex.cc" +#line 1086 "src/parse/lex.cc" yy180: yych = (YYCTYPE)*++YYCURSOR; if (yych == '*') goto yy198; @@ -1149,9 +1148,9 @@ yy185: yy186: yych = (YYCTYPE)*++YYCURSOR; if (yych == '^') goto yy216; -#line 265 "../src/parse/lex.re" +#line 264 "../src/parse/lex.re" { yylval.regexp = lex_cls(false); return TOKEN_REGEXP; } -#line 1155 "src/parse/lex.cc" +#line 1154 "src/parse/lex.cc" yy188: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy218; @@ -1174,12 +1173,12 @@ yy189: } } yy190: -#line 234 "../src/parse/lex.re" +#line 233 "../src/parse/lex.re" { depth = 1; goto code; } -#line 1183 "src/parse/lex.cc" +#line 1182 "src/parse/lex.cc" yy191: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -1219,31 +1218,31 @@ yy194: } yy196: ++YYCURSOR; -#line 258 "../src/parse/lex.re" +#line 257 "../src/parse/lex.re" { tok = cur; return 0; } -#line 1228 "src/parse/lex.cc" +#line 1227 "src/parse/lex.cc" yy198: ++YYCURSOR; -#line 252 "../src/parse/lex.re" +#line 251 "../src/parse/lex.re" { depth = 1; goto comment; } -#line 1236 "src/parse/lex.cc" +#line 1235 "src/parse/lex.cc" yy200: ++YYCURSOR; -#line 249 "../src/parse/lex.re" +#line 248 "../src/parse/lex.re" { goto nextLine; } -#line 1243 "src/parse/lex.cc" +#line 1242 "src/parse/lex.cc" yy202: ++YYCURSOR; YYCURSOR -= 1; -#line 360 "../src/parse/lex.re" +#line 359 "../src/parse/lex.re" { if (!opts->FFlag) { yylval.str = new std::string (tok, tok_len()); @@ -1259,7 +1258,7 @@ yy202: return TOKEN_REGEXP; } } -#line 1263 "src/parse/lex.cc" +#line 1262 "src/parse/lex.cc" yy204: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -1279,29 +1278,29 @@ yy204: yy206: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 355 "../src/parse/lex.re" +#line 354 "../src/parse/lex.re" { yylval.str = new std::string (tok, tok_len ()); return TOKEN_ID; } -#line 1288 "src/parse/lex.cc" +#line 1287 "src/parse/lex.cc" yy208: yych = (YYCTYPE)*++YYCURSOR; if (yych == '>') goto yy228; -#line 243 "../src/parse/lex.re" +#line 242 "../src/parse/lex.re" { tok += 2; /* skip ":=" */ depth = 0; goto code; } -#line 1298 "src/parse/lex.cc" +#line 1297 "src/parse/lex.cc" yy210: ++YYCURSOR; -#line 271 "../src/parse/lex.re" +#line 270 "../src/parse/lex.re" { return TOKEN_SETUP; } -#line 1305 "src/parse/lex.cc" +#line 1304 "src/parse/lex.cc" yy212: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '9') { @@ -1350,7 +1349,7 @@ yy213: } } yy215: -#line 275 "../src/parse/lex.re" +#line 274 "../src/parse/lex.re" { if (!opts->tags) { fatal("tags are only allowed with '-T, --tags' option"); @@ -1359,12 +1358,12 @@ yy215: yylval.regexp = RegExp::make_tag(name); return TOKEN_REGEXP; } -#line 1363 "src/parse/lex.cc" +#line 1362 "src/parse/lex.cc" yy216: ++YYCURSOR; -#line 266 "../src/parse/lex.re" +#line 265 "../src/parse/lex.re" { yylval.regexp = lex_cls(true); return TOKEN_REGEXP; } -#line 1368 "src/parse/lex.cc" +#line 1367 "src/parse/lex.cc" yy218: yych = (YYCTYPE)*++YYCURSOR; if (yych == '2') goto yy236; @@ -1372,11 +1371,11 @@ yy218: yy219: ++YYCURSOR; yy220: -#line 328 "../src/parse/lex.re" +#line 327 "../src/parse/lex.re" { fatal("illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers"); } -#line 1380 "src/parse/lex.cc" +#line 1379 "src/parse/lex.cc" yy221: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -1429,7 +1428,7 @@ yy225: yy226: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 342 "../src/parse/lex.re" +#line 341 "../src/parse/lex.re" { yylval.str = new std::string (tok, tok_len ()); if (opts->FFlag) @@ -1442,15 +1441,15 @@ yy226: return TOKEN_ID; } } -#line 1446 "src/parse/lex.cc" +#line 1445 "src/parse/lex.cc" yy228: ++YYCURSOR; YYCURSOR -= 2; -#line 239 "../src/parse/lex.re" +#line 238 "../src/parse/lex.re" { return *tok; } -#line 1454 "src/parse/lex.cc" +#line 1453 "src/parse/lex.cc" yy230: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -1483,11 +1482,11 @@ yy233: yy234: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 268 "../src/parse/lex.re" +#line 267 "../src/parse/lex.re" { return TOKEN_NOCOND; } -#line 1491 "src/parse/lex.cc" +#line 1490 "src/parse/lex.cc" yy236: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'c') goto yy243; @@ -1501,7 +1500,7 @@ yy237: goto yy220; yy238: ++YYCURSOR; -#line 297 "../src/parse/lex.re" +#line 296 "../src/parse/lex.re" { if (!s_to_u32_unsafe (tok + 1, cur - 1, yylval.extop.min)) { @@ -1510,10 +1509,10 @@ yy238: yylval.extop.max = yylval.extop.min; return TOKEN_CLOSESIZE; } -#line 1514 "src/parse/lex.cc" +#line 1513 "src/parse/lex.cc" yy240: ++YYCURSOR; -#line 332 "../src/parse/lex.re" +#line 331 "../src/parse/lex.re" { if (!opts->FFlag) { fatal("curly braces for names only allowed with -F switch"); @@ -1521,7 +1520,7 @@ yy240: yylval.str = new std::string (tok + 1, tok_len () - 2); // -2 to omit braces return TOKEN_ID; } -#line 1525 "src/parse/lex.cc" +#line 1524 "src/parse/lex.cc" yy242: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'n') goto yy248; @@ -1540,7 +1539,7 @@ yy244: goto yy193; yy246: ++YYCURSOR; -#line 319 "../src/parse/lex.re" +#line 318 "../src/parse/lex.re" { if (!s_to_u32_unsafe (tok + 1, cur - 2, yylval.extop.min)) { @@ -1549,19 +1548,19 @@ yy246: yylval.extop.max = std::numeric_limits::max(); return TOKEN_CLOSESIZE; } -#line 1553 "src/parse/lex.cc" +#line 1552 "src/parse/lex.cc" yy248: yych = (YYCTYPE)*++YYCURSOR; if (yych == 'e') goto yy253; goto yy193; yy249: ++YYCURSOR; -#line 340 "../src/parse/lex.re" +#line 339 "../src/parse/lex.re" { lex_conf (); return TOKEN_CONF; } -#line 1562 "src/parse/lex.cc" +#line 1561 "src/parse/lex.cc" yy251: ++YYCURSOR; -#line 306 "../src/parse/lex.re" +#line 305 "../src/parse/lex.re" { const char * p = strchr (tok, ','); if (!s_to_u32_unsafe (tok + 1, p, yylval.extop.min)) @@ -1574,7 +1573,7 @@ yy251: } return TOKEN_CLOSESIZE; } -#line 1578 "src/parse/lex.cc" +#line 1577 "src/parse/lex.cc" yy253: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '0') goto yy255; @@ -1630,12 +1629,12 @@ yy258: yy260: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 385 "../src/parse/lex.re" +#line 384 "../src/parse/lex.re" { set_sourceline (); goto scan; } -#line 1639 "src/parse/lex.cc" +#line 1638 "src/parse/lex.cc" yy262: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy260; @@ -1660,12 +1659,12 @@ yy266: if (yych == '\n') goto yy193; goto yy263; } -#line 401 "../src/parse/lex.re" +#line 400 "../src/parse/lex.re" flex_name: -#line 1669 "src/parse/lex.cc" +#line 1668 "src/parse/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -1674,32 +1673,32 @@ flex_name: if (yych == '\r') goto yy273; ++YYCURSOR; yy270: -#line 412 "../src/parse/lex.re" +#line 411 "../src/parse/lex.re" { YYCURSOR = tok; goto start; } -#line 1683 "src/parse/lex.cc" +#line 1682 "src/parse/lex.cc" yy271: ++YYCURSOR; -#line 406 "../src/parse/lex.re" +#line 405 "../src/parse/lex.re" { YYCURSOR = tok; lexer_state = LEX_NORMAL; return TOKEN_FID_END; } -#line 1692 "src/parse/lex.cc" +#line 1691 "src/parse/lex.cc" yy273: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy271; goto yy270; } -#line 416 "../src/parse/lex.re" +#line 415 "../src/parse/lex.re" code: -#line 1703 "src/parse/lex.cc" +#line 1702 "src/parse/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -1760,7 +1759,7 @@ code: } yy276: ++YYCURSOR; -#line 479 "../src/parse/lex.re" +#line 478 "../src/parse/lex.re" { if (cur == eof) { @@ -1772,15 +1771,15 @@ yy276: } goto code; } -#line 1776 "src/parse/lex.cc" +#line 1775 "src/parse/lex.cc" yy278: ++YYCURSOR; yy279: -#line 493 "../src/parse/lex.re" +#line 492 "../src/parse/lex.re" { goto code; } -#line 1784 "src/parse/lex.cc" +#line 1783 "src/parse/lex.cc" yy280: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -1799,7 +1798,7 @@ yy280: } } yy281: -#line 460 "../src/parse/lex.re" +#line 459 "../src/parse/lex.re" { if (depth == 0) { @@ -1819,7 +1818,7 @@ yy281: cline++; goto code; } -#line 1823 "src/parse/lex.cc" +#line 1822 "src/parse/lex.cc" yy282: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -1832,7 +1831,7 @@ yy283: goto yy300; yy284: ++YYCURSOR; -#line 432 "../src/parse/lex.re" +#line 431 "../src/parse/lex.re" { if (depth == 0) { @@ -1844,10 +1843,10 @@ yy284: } goto code; } -#line 1848 "src/parse/lex.cc" +#line 1847 "src/parse/lex.cc" yy286: ++YYCURSOR; -#line 420 "../src/parse/lex.re" +#line 419 "../src/parse/lex.re" { if (depth == 0) { @@ -1860,7 +1859,7 @@ yy286: } goto code; } -#line 1864 "src/parse/lex.cc" +#line 1863 "src/parse/lex.cc" yy288: yyaccept = 2; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -1872,7 +1871,7 @@ yy288: } yy289: YYCURSOR -= 1; -#line 447 "../src/parse/lex.re" +#line 446 "../src/parse/lex.re" { if (depth == 0) { @@ -1886,7 +1885,7 @@ yy289: cline++; goto code; } -#line 1890 "src/parse/lex.cc" +#line 1889 "src/parse/lex.cc" yy290: ++YYCURSOR; goto yy289; @@ -1921,11 +1920,11 @@ yy295: if (yych >= '#') goto yy298; yy296: ++YYCURSOR; -#line 490 "../src/parse/lex.re" +#line 489 "../src/parse/lex.re" { goto code; } -#line 1929 "src/parse/lex.cc" +#line 1928 "src/parse/lex.cc" yy298: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -2015,12 +2014,12 @@ yy312: yy314: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 443 "../src/parse/lex.re" +#line 442 "../src/parse/lex.re" { set_sourceline (); goto code; } -#line 2024 "src/parse/lex.cc" +#line 2023 "src/parse/lex.cc" yy316: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy314; @@ -2049,12 +2048,12 @@ yy320: if (yych == '\n') goto yy293; goto yy317; } -#line 496 "../src/parse/lex.re" +#line 495 "../src/parse/lex.re" comment: -#line 2058 "src/parse/lex.cc" +#line 2057 "src/parse/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -2101,7 +2100,7 @@ comment: } ++YYCURSOR; yy324: -#line 528 "../src/parse/lex.re" +#line 527 "../src/parse/lex.re" { if (cur == eof) { @@ -2109,7 +2108,7 @@ yy324: } goto comment; } -#line 2113 "src/parse/lex.cc" +#line 2112 "src/parse/lex.cc" yy325: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 32) { @@ -2117,7 +2116,7 @@ yy325: } if (yych == '#') goto yy332; yy326: -#line 519 "../src/parse/lex.re" +#line 518 "../src/parse/lex.re" { if (cur == eof) { @@ -2127,7 +2126,7 @@ yy326: cline++; goto comment; } -#line 2131 "src/parse/lex.cc" +#line 2130 "src/parse/lex.cc" yy327: yych = (YYCTYPE)*++YYCURSOR; if (yych == '/') goto yy334; @@ -2161,7 +2160,7 @@ yy332: } yy334: ++YYCURSOR; -#line 500 "../src/parse/lex.re" +#line 499 "../src/parse/lex.re" { if (--depth == 0) { @@ -2172,16 +2171,16 @@ yy334: goto comment; } } -#line 2176 "src/parse/lex.cc" +#line 2175 "src/parse/lex.cc" yy336: ++YYCURSOR; -#line 510 "../src/parse/lex.re" +#line 509 "../src/parse/lex.re" { ++depth; fatal("ambiguous /* found"); goto comment; } -#line 2185 "src/parse/lex.cc" +#line 2184 "src/parse/lex.cc" yy338: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'i') goto yy331; @@ -2238,12 +2237,12 @@ yy346: yy348: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 515 "../src/parse/lex.re" +#line 514 "../src/parse/lex.re" { set_sourceline (); goto comment; } -#line 2247 "src/parse/lex.cc" +#line 2246 "src/parse/lex.cc" yy350: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy348; @@ -2268,28 +2267,28 @@ yy354: if (yych == '\n') goto yy331; goto yy351; } -#line 535 "../src/parse/lex.re" +#line 534 "../src/parse/lex.re" nextLine: -#line 2277 "src/parse/lex.cc" +#line 2276 "src/parse/lex.cc" { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych == '\n') goto yy359; ++YYCURSOR; -#line 546 "../src/parse/lex.re" +#line 545 "../src/parse/lex.re" { if(cur == eof) { return 0; } goto nextLine; } -#line 2290 "src/parse/lex.cc" +#line 2289 "src/parse/lex.cc" yy359: ++YYCURSOR; -#line 539 "../src/parse/lex.re" +#line 538 "../src/parse/lex.re" { if(cur == eof) { return 0; } @@ -2297,9 +2296,9 @@ yy359: cline++; goto scan; } -#line 2301 "src/parse/lex.cc" +#line 2300 "src/parse/lex.cc" } -#line 551 "../src/parse/lex.re" +#line 550 "../src/parse/lex.re" } @@ -2323,35 +2322,35 @@ const RegExp *Scanner::lex_cls(bool neg) uint32_t u, l; fst: -#line 2327 "src/parse/lex.cc" +#line 2326 "src/parse/lex.cc" { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych == ']') goto yy364; -#line 575 "../src/parse/lex.re" +#line 574 "../src/parse/lex.re" { l = lex_cls_chr(); goto snd; } -#line 2335 "src/parse/lex.cc" +#line 2334 "src/parse/lex.cc" yy364: ++YYCURSOR; -#line 574 "../src/parse/lex.re" +#line 573 "../src/parse/lex.re" { goto end; } -#line 2340 "src/parse/lex.cc" +#line 2339 "src/parse/lex.cc" } -#line 576 "../src/parse/lex.re" +#line 575 "../src/parse/lex.re" snd: -#line 2346 "src/parse/lex.cc" +#line 2345 "src/parse/lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*(YYMARKER = YYCURSOR); if (yych == '-') goto yy369; yy368: -#line 579 "../src/parse/lex.re" +#line 578 "../src/parse/lex.re" { u = l; goto add; } -#line 2355 "src/parse/lex.cc" +#line 2354 "src/parse/lex.cc" yy369: yych = (YYCTYPE)*++YYCURSOR; if (yych != ']') goto yy371; @@ -2360,7 +2359,7 @@ yy369: yy371: ++YYCURSOR; YYCURSOR -= 1; -#line 580 "../src/parse/lex.re" +#line 579 "../src/parse/lex.re" { u = lex_cls_chr(); if (l > u) { @@ -2369,9 +2368,9 @@ yy371: } goto add; } -#line 2373 "src/parse/lex.cc" +#line 2372 "src/parse/lex.cc" } -#line 588 "../src/parse/lex.re" +#line 587 "../src/parse/lex.re" add: if (!(s = opts->encoding.encodeRange(l, u))) { @@ -2390,7 +2389,7 @@ uint32_t Scanner::lex_cls_chr() { tok = cur; -#line 2394 "src/parse/lex.cc" +#line 2393 "src/parse/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -2399,14 +2398,14 @@ uint32_t Scanner::lex_cls_chr() if (yych == '\n') goto yy377; if (yych == '\\') goto yy379; ++YYCURSOR; -#line 611 "../src/parse/lex.re" +#line 610 "../src/parse/lex.re" { return static_cast(tok[0]); } -#line 2405 "src/parse/lex.cc" +#line 2404 "src/parse/lex.cc" yy377: ++YYCURSOR; -#line 606 "../src/parse/lex.re" +#line 605 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error"); } -#line 2410 "src/parse/lex.cc" +#line 2409 "src/parse/lex.cc" yy379: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '`') { @@ -2455,31 +2454,31 @@ yy379: } } } -#line 609 "../src/parse/lex.re" +#line 608 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error in escape sequence"); } -#line 2461 "src/parse/lex.cc" +#line 2460 "src/parse/lex.cc" yy381: ++YYCURSOR; -#line 624 "../src/parse/lex.re" +#line 623 "../src/parse/lex.re" { warn.useless_escape(tline, tok - pos, tok[1]); return static_cast(tok[1]); } -#line 2469 "src/parse/lex.cc" +#line 2468 "src/parse/lex.cc" yy383: ++YYCURSOR; -#line 622 "../src/parse/lex.re" +#line 621 "../src/parse/lex.re" { return static_cast('-'); } -#line 2474 "src/parse/lex.cc" +#line 2473 "src/parse/lex.cc" yy385: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy386; if (yych <= '7') goto yy410; yy386: -#line 608 "../src/parse/lex.re" +#line 607 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error in octal escape sequence"); } -#line 2483 "src/parse/lex.cc" +#line 2482 "src/parse/lex.cc" yy387: ++YYCURSOR; goto yy386; @@ -2495,9 +2494,9 @@ yy388: if (yych <= 'f') goto yy412; } yy389: -#line 607 "../src/parse/lex.re" +#line 606 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error in hexadecimal escape sequence"); } -#line 2501 "src/parse/lex.cc" +#line 2500 "src/parse/lex.cc" yy390: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -2513,49 +2512,49 @@ yy390: } yy391: ++YYCURSOR; -#line 621 "../src/parse/lex.re" +#line 620 "../src/parse/lex.re" { return static_cast('\\'); } -#line 2519 "src/parse/lex.cc" +#line 2518 "src/parse/lex.cc" yy393: ++YYCURSOR; -#line 623 "../src/parse/lex.re" +#line 622 "../src/parse/lex.re" { return static_cast(']'); } -#line 2524 "src/parse/lex.cc" +#line 2523 "src/parse/lex.cc" yy395: ++YYCURSOR; -#line 614 "../src/parse/lex.re" +#line 613 "../src/parse/lex.re" { return static_cast('\a'); } -#line 2529 "src/parse/lex.cc" +#line 2528 "src/parse/lex.cc" yy397: ++YYCURSOR; -#line 615 "../src/parse/lex.re" +#line 614 "../src/parse/lex.re" { return static_cast('\b'); } -#line 2534 "src/parse/lex.cc" +#line 2533 "src/parse/lex.cc" yy399: ++YYCURSOR; -#line 616 "../src/parse/lex.re" +#line 615 "../src/parse/lex.re" { return static_cast('\f'); } -#line 2539 "src/parse/lex.cc" +#line 2538 "src/parse/lex.cc" yy401: ++YYCURSOR; -#line 617 "../src/parse/lex.re" +#line 616 "../src/parse/lex.re" { return static_cast('\n'); } -#line 2544 "src/parse/lex.cc" +#line 2543 "src/parse/lex.cc" yy403: ++YYCURSOR; -#line 618 "../src/parse/lex.re" +#line 617 "../src/parse/lex.re" { return static_cast('\r'); } -#line 2549 "src/parse/lex.cc" +#line 2548 "src/parse/lex.cc" yy405: ++YYCURSOR; -#line 619 "../src/parse/lex.re" +#line 618 "../src/parse/lex.re" { return static_cast('\t'); } -#line 2554 "src/parse/lex.cc" +#line 2553 "src/parse/lex.cc" yy407: ++YYCURSOR; -#line 620 "../src/parse/lex.re" +#line 619 "../src/parse/lex.re" { return static_cast('\v'); } -#line 2559 "src/parse/lex.cc" +#line 2558 "src/parse/lex.cc" yy409: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -2618,9 +2617,9 @@ yy414: } yy415: ++YYCURSOR; -#line 613 "../src/parse/lex.re" +#line 612 "../src/parse/lex.re" { return unesc_oct(tok, cur); } -#line 2624 "src/parse/lex.cc" +#line 2623 "src/parse/lex.cc" yy417: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { @@ -2647,9 +2646,9 @@ yy418: } yy419: ++YYCURSOR; -#line 612 "../src/parse/lex.re" +#line 611 "../src/parse/lex.re" { return unesc_hex(tok, cur); } -#line 2653 "src/parse/lex.cc" +#line 2652 "src/parse/lex.cc" yy421: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { @@ -2673,7 +2672,7 @@ yy422: goto yy411; } } -#line 628 "../src/parse/lex.re" +#line 627 "../src/parse/lex.re" } @@ -2682,7 +2681,7 @@ uint32_t Scanner::lex_str_chr(char quote, bool &end) end = false; tok = cur; -#line 2686 "src/parse/lex.cc" +#line 2685 "src/parse/lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -2691,17 +2690,17 @@ uint32_t Scanner::lex_str_chr(char quote, bool &end) if (yych == '\n') goto yy427; if (yych == '\\') goto yy429; ++YYCURSOR; -#line 641 "../src/parse/lex.re" +#line 640 "../src/parse/lex.re" { end = tok[0] == quote; return static_cast(tok[0]); } -#line 2700 "src/parse/lex.cc" +#line 2699 "src/parse/lex.cc" yy427: ++YYCURSOR; -#line 636 "../src/parse/lex.re" +#line 635 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error"); } -#line 2705 "src/parse/lex.cc" +#line 2704 "src/parse/lex.cc" yy429: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 'a') { @@ -2747,28 +2746,28 @@ yy429: } } } -#line 639 "../src/parse/lex.re" +#line 638 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error in escape sequence"); } -#line 2753 "src/parse/lex.cc" +#line 2752 "src/parse/lex.cc" yy431: ++YYCURSOR; -#line 655 "../src/parse/lex.re" +#line 654 "../src/parse/lex.re" { if (tok[1] != quote) { warn.useless_escape(tline, tok - pos, tok[1]); } return static_cast(tok[1]); } -#line 2763 "src/parse/lex.cc" +#line 2762 "src/parse/lex.cc" yy433: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy434; if (yych <= '7') goto yy456; yy434: -#line 638 "../src/parse/lex.re" +#line 637 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error in octal escape sequence"); } -#line 2772 "src/parse/lex.cc" +#line 2771 "src/parse/lex.cc" yy435: ++YYCURSOR; goto yy434; @@ -2784,9 +2783,9 @@ yy436: if (yych <= 'f') goto yy458; } yy437: -#line 637 "../src/parse/lex.re" +#line 636 "../src/parse/lex.re" { fatal ((tok - pos) - tchar, "syntax error in hexadecimal escape sequence"); } -#line 2790 "src/parse/lex.cc" +#line 2789 "src/parse/lex.cc" yy438: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -2802,44 +2801,44 @@ yy438: } yy439: ++YYCURSOR; -#line 654 "../src/parse/lex.re" +#line 653 "../src/parse/lex.re" { return static_cast('\\'); } -#line 2808 "src/parse/lex.cc" +#line 2807 "src/parse/lex.cc" yy441: ++YYCURSOR; -#line 647 "../src/parse/lex.re" +#line 646 "../src/parse/lex.re" { return static_cast('\a'); } -#line 2813 "src/parse/lex.cc" +#line 2812 "src/parse/lex.cc" yy443: ++YYCURSOR; -#line 648 "../src/parse/lex.re" +#line 647 "../src/parse/lex.re" { return static_cast('\b'); } -#line 2818 "src/parse/lex.cc" +#line 2817 "src/parse/lex.cc" yy445: ++YYCURSOR; -#line 649 "../src/parse/lex.re" +#line 648 "../src/parse/lex.re" { return static_cast('\f'); } -#line 2823 "src/parse/lex.cc" +#line 2822 "src/parse/lex.cc" yy447: ++YYCURSOR; -#line 650 "../src/parse/lex.re" +#line 649 "../src/parse/lex.re" { return static_cast('\n'); } -#line 2828 "src/parse/lex.cc" +#line 2827 "src/parse/lex.cc" yy449: ++YYCURSOR; -#line 651 "../src/parse/lex.re" +#line 650 "../src/parse/lex.re" { return static_cast('\r'); } -#line 2833 "src/parse/lex.cc" +#line 2832 "src/parse/lex.cc" yy451: ++YYCURSOR; -#line 652 "../src/parse/lex.re" +#line 651 "../src/parse/lex.re" { return static_cast('\t'); } -#line 2838 "src/parse/lex.cc" +#line 2837 "src/parse/lex.cc" yy453: ++YYCURSOR; -#line 653 "../src/parse/lex.re" +#line 652 "../src/parse/lex.re" { return static_cast('\v'); } -#line 2843 "src/parse/lex.cc" +#line 2842 "src/parse/lex.cc" yy455: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -2902,9 +2901,9 @@ yy460: } yy461: ++YYCURSOR; -#line 646 "../src/parse/lex.re" +#line 645 "../src/parse/lex.re" { return unesc_oct(tok, cur); } -#line 2908 "src/parse/lex.cc" +#line 2907 "src/parse/lex.cc" yy463: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { @@ -2931,9 +2930,9 @@ yy464: } yy465: ++YYCURSOR; -#line 645 "../src/parse/lex.re" +#line 644 "../src/parse/lex.re" { return unesc_hex(tok, cur); } -#line 2937 "src/parse/lex.cc" +#line 2936 "src/parse/lex.cc" yy467: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { @@ -2957,7 +2956,7 @@ yy468: goto yy457; } } -#line 661 "../src/parse/lex.re" +#line 660 "../src/parse/lex.re" } @@ -2978,7 +2977,7 @@ void Scanner::set_sourceline () sourceline: tok = cur; -#line 2982 "src/parse/lex.cc" +#line 2981 "src/parse/lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -3027,14 +3026,14 @@ sourceline: yy471: ++YYCURSOR; yy472: -#line 704 "../src/parse/lex.re" +#line 703 "../src/parse/lex.re" { goto sourceline; } -#line 3035 "src/parse/lex.cc" +#line 3034 "src/parse/lex.cc" yy473: ++YYCURSOR; -#line 692 "../src/parse/lex.re" +#line 691 "../src/parse/lex.re" { if (cur == eof) { @@ -3047,7 +3046,7 @@ yy473: tok = cur; return; } -#line 3051 "src/parse/lex.cc" +#line 3050 "src/parse/lex.cc" yy475: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych == '\n') goto yy472; @@ -3059,7 +3058,7 @@ yy476: if (yybm[0+yych] & 64) { goto yy476; } -#line 681 "../src/parse/lex.re" +#line 680 "../src/parse/lex.re" { if (!s_to_u32_unsafe (tok, cur, cline)) { @@ -3067,7 +3066,7 @@ yy476: } goto sourceline; } -#line 3071 "src/parse/lex.cc" +#line 3070 "src/parse/lex.cc" yy479: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -3084,12 +3083,12 @@ yy481: goto yy472; yy482: ++YYCURSOR; -#line 688 "../src/parse/lex.re" +#line 687 "../src/parse/lex.re" { escape (in.file_name, std::string (tok + 1, tok_len () - 2)); // -2 to omit quotes goto sourceline; } -#line 3093 "src/parse/lex.cc" +#line 3092 "src/parse/lex.cc" yy484: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -3097,7 +3096,7 @@ yy484: if (yych == '\n') goto yy481; goto yy479; } -#line 707 "../src/parse/lex.re" +#line 706 "../src/parse/lex.re" } diff --git a/re2c/src/codegen/output.cc b/re2c/src/codegen/output.cc index a4b86774..7a61aa27 100644 --- a/re2c/src/codegen/output.cc +++ b/re2c/src/codegen/output.cc @@ -6,7 +6,6 @@ #include "src/codegen/output.h" #include "src/codegen/print.h" #include "src/conf/msg.h" -#include "src/conf/warn.h" #include "src/util/string_utils.h" #include "src/globals.h" @@ -61,11 +60,12 @@ OutputBlock::~OutputBlock () } } -OutputFile::OutputFile(Opt &o) +OutputFile::OutputFile(Opt &o, Warn &w) : blocks () , label_counter () , warn_condition_order (!o->tFlag) // see note [condition order] , opts(o) + , warn(w) { new_block (); } @@ -356,8 +356,8 @@ bool HeaderFile::emit(const uniq_vector_t &types, Opt &opts) return true; } -Output::Output(Opt &o) - : source(o) +Output::Output(Opt &o, Warn &w) + : source(o, w) , header() , skeletons() , max_fill(1) @@ -365,7 +365,7 @@ Output::Output(Opt &o) bool Output::emit() { - if (warn.error()) { + if (source.warn.error()) { return false; } diff --git a/re2c/src/codegen/output.h b/re2c/src/codegen/output.h index 898ce585..72d42b94 100644 --- a/re2c/src/codegen/output.h +++ b/re2c/src/codegen/output.h @@ -12,6 +12,7 @@ #include "src/codegen/label.h" #include "src/conf/opt.h" +#include "src/conf/warn.h" #include "src/util/counter.h" #include "src/util/forbid_copy.h" #include "src/util/uniq_vector.h" @@ -77,8 +78,9 @@ public: counter_t label_counter; bool warn_condition_order; Opt &opts; + Warn &warn; - explicit OutputFile(Opt &o); + OutputFile(Opt &o, Warn &w); ~OutputFile(); std::ostream & stream (); @@ -139,7 +141,7 @@ struct Output std::set skeletons; size_t max_fill; - explicit Output(Opt &o); + Output(Opt &o, Warn &w); bool emit(); }; diff --git a/re2c/src/conf/opt.h b/re2c/src/conf/opt.h index 0ee13340..17e85348 100644 --- a/re2c/src/conf/opt.h +++ b/re2c/src/conf/opt.h @@ -6,6 +6,7 @@ #include #include "src/codegen/input_api.h" +#include "src/conf/warn.h" #include "src/ir/dfa/dfa.h" #include "src/ir/regexp/empty_class_policy.h" #include "src/ir/regexp/encoding/enc.h" @@ -225,7 +226,7 @@ enum parse_opts_t EXIT_FAIL }; -parse_opts_t parse_opts (char ** argv, Opt & opts); +parse_opts_t parse_opts(char **argv, Opt &opts, Warn &warn); } // namespace re2c diff --git a/re2c/src/conf/parse_opts.re b/re2c/src/conf/parse_opts.re index a55e8f81..36117716 100644 --- a/re2c/src/conf/parse_opts.re +++ b/re2c/src/conf/parse_opts.re @@ -1,8 +1,6 @@ #include "src/codegen/input_api.h" #include "src/conf/msg.h" #include "src/conf/opt.h" -#include "src/conf/warn.h" -#include "src/globals.h" #include "src/ir/regexp/empty_class_policy.h" #include "src/ir/regexp/encoding/enc.h" @@ -15,7 +13,7 @@ static inline bool next (char * & arg, char ** & argv) return arg != NULL; } -parse_opts_t parse_opts (char ** argv, Opt & opts) +parse_opts_t parse_opts (char **argv, Opt &opts, Warn &warn) { #define YYCTYPE unsigned char char * YYCURSOR; diff --git a/re2c/src/conf/warn.cc b/re2c/src/conf/warn.cc index 3904d8cb..f6e6d992 100644 --- a/re2c/src/conf/warn.cc +++ b/re2c/src/conf/warn.cc @@ -7,12 +7,9 @@ #include "src/conf/warn.h" #include "src/ir/skeleton/path.h" #include "src/ir/skeleton/skeleton.h" -#include "src/globals.h" namespace re2c { -Warn warn; - const uint32_t Warn::SILENT = 0; const uint32_t Warn::WARNING = 1u << 0; const uint32_t Warn::ERROR = 1u << 1; diff --git a/re2c/src/globals.h b/re2c/src/globals.h index 7ab3cac7..e270d249 100644 --- a/re2c/src/globals.h +++ b/re2c/src/globals.h @@ -3,7 +3,6 @@ #include -#include "src/conf/warn.h" #include "src/util/c99_stdint.h" namespace re2c @@ -15,8 +14,6 @@ extern bool bWroteCondCheck; extern uint32_t last_fill_index; extern std::string yySetupRule; -extern Warn warn; - } // end namespace re2c #endif // _RE2C_GLOBALS_ diff --git a/re2c/src/ir/compile.cc b/re2c/src/ir/compile.cc index 930a88cd..e003d7a4 100644 --- a/re2c/src/ir/compile.cc +++ b/re2c/src/ir/compile.cc @@ -38,8 +38,9 @@ static smart_ptr compile_rules( const uint32_t line = output.source.block().line; const std::string name = make_name(cond, line); Opt &opts = output.source.opts; + Warn &warn = output.source.warn; - warn_nullable(rules, cond); + warn_nullable(rules, cond, warn); // The original set of code units (charset) might be very large. // A common trick it is to split charset into disjoint character ranges @@ -59,18 +60,18 @@ static smart_ptr compile_rules( nfa_t nfa(rules, opts->input_api.type()); - dfa_t dfa(nfa, cs, cond, opts->bijective_mapping, opts->dump_dfa_raw); + dfa_t dfa(nfa, cs, cond, opts->bijective_mapping, opts->dump_dfa_raw, warn); if (opts->dump_dfa_det) dump_dfa(dfa); // skeleton must be constructed after DFA construction // but prior to any other DFA transformations Skeleton skeleton(dfa, cs, defrule, name, cond, line); - warn_undefined_control_flow(skeleton); + warn_undefined_control_flow(skeleton, warn); if (opts->target == opt_t::SKELETON) { emit_data(skeleton, opts->output_file, opts->encoding.szCodeUnit()); } - cutoff_dead_rules(dfa, defrule, cond); + cutoff_dead_rules(dfa, defrule, cond, warn); insert_fallback_tags(dfa); diff --git a/re2c/src/ir/dfa/dead_rules.cc b/re2c/src/ir/dfa/dead_rules.cc index 2be44084..14573d7b 100644 --- a/re2c/src/ir/dfa/dead_rules.cc +++ b/re2c/src/ir/dfa/dead_rules.cc @@ -132,7 +132,7 @@ static void liveness_analyses(const rdfa_t &rdfa, bool *live) } static void warn_dead_rules(const dfa_t &dfa, size_t defrule, - const std::string &cond, const bool *live) + const std::string &cond, const bool *live, Warn &warn) { const size_t nstates = dfa.states.size(); const size_t nrules = dfa.rules.size(); @@ -223,7 +223,7 @@ static void find_fallback_states(dfa_t &dfa, const bool *fallthru) } } -void cutoff_dead_rules(dfa_t &dfa, size_t defrule, const std::string &cond) +void cutoff_dead_rules(dfa_t &dfa, size_t defrule, const std::string &cond, Warn &warn) { const rdfa_t rdfa(dfa); const size_t @@ -234,7 +234,7 @@ void cutoff_dead_rules(dfa_t &dfa, size_t defrule, const std::string &cond) memset(live, 0, nl * sizeof(bool)); liveness_analyses(rdfa, live); - warn_dead_rules(dfa, defrule, cond, live); + warn_dead_rules(dfa, defrule, cond, live, warn); remove_dead_final_states(dfa, fallthru); find_fallback_states(dfa, fallthru); diff --git a/re2c/src/ir/dfa/determinization.cc b/re2c/src/ir/dfa/determinization.cc index 0e1297ab..49be63e7 100644 --- a/re2c/src/ir/dfa/determinization.cc +++ b/re2c/src/ir/dfa/determinization.cc @@ -2,7 +2,6 @@ #include #include -#include "src/conf/warn.h" #include "src/ir/dfa/closure.h" #include "src/ir/dfa/dfa.h" #include "src/ir/dfa/dump.h" @@ -10,7 +9,6 @@ #include "src/ir/nfa/nfa.h" #include "src/ir/regexp/regexp.h" #include "src/util/range.h" -#include "src/globals.h" namespace re2c { @@ -19,7 +17,7 @@ static nfa_state_t *transition(nfa_state_t *state, uint32_t symbol); static void reach(const kernel_t *kernel, closure_t &clos, uint32_t symbol); static void warn_nondeterministic_tags(const kernels_t &kernels, const Tagpool &tagpool, const std::vector &tags, - const std::valarray &rules, const std::string &cond); + const std::valarray &rules, const std::string &cond, Warn &warn); const size_t dfa_t::NIL = std::numeric_limits::max(); @@ -50,7 +48,7 @@ void reach(const kernel_t *kernel, closure_t &clos, uint32_t symbol) } dfa_t::dfa_t(const nfa_t &nfa, const charset_t &charset, - const std::string &cond, bool bijection, bool debug) + const std::string &cond, bool bijection, bool debug, Warn &warn) : states() , nchars(charset.size() - 1) // (n + 1) bounds for n ranges , rules(nfa.rules) @@ -94,7 +92,7 @@ dfa_t::dfa_t(const nfa_t &nfa, const charset_t &charset, } } - warn_nondeterministic_tags(kernels, tagpool, vartags, rules, cond); + warn_nondeterministic_tags(kernels, tagpool, vartags, rules, cond, warn); } /* @@ -106,7 +104,7 @@ dfa_t::dfa_t(const nfa_t &nfa, const charset_t &charset, */ void warn_nondeterministic_tags(const kernels_t &kernels, const Tagpool &tagpool, const std::vector &tags, - const std::valarray &rules, const std::string &cond) + const std::valarray &rules, const std::string &cond, Warn &warn) { const size_t ntag = tagpool.ntags, diff --git a/re2c/src/ir/dfa/dfa.h b/re2c/src/ir/dfa/dfa.h index 20a3c765..26400e2e 100644 --- a/re2c/src/ir/dfa/dfa.h +++ b/re2c/src/ir/dfa/dfa.h @@ -6,6 +6,7 @@ #include #include +#include "src/conf/warn.h" #include "src/ir/regexp/regexp.h" #include "src/ir/rule.h" #include "src/ir/tag.h" @@ -58,7 +59,7 @@ struct dfa_t tagver_t maxtagver; dfa_t(const nfa_t &nfa, const charset_t &charset, - const std::string &cond, bool bijection, bool debug); + const std::string &cond, bool bijection, bool debug, Warn &warn); ~dfa_t(); FORBID_COPY(dfa_t); @@ -72,7 +73,7 @@ enum dfa_minimization_t void minimization(dfa_t &dfa, dfa_minimization_t type); void fillpoints(const dfa_t &dfa, std::vector &fill); -void cutoff_dead_rules(dfa_t &dfa, size_t defrule, const std::string &cond); +void cutoff_dead_rules(dfa_t &dfa, size_t defrule, const std::string &cond, Warn &warn); void insert_fallback_tags(dfa_t &dfa); void optimize_tags(dfa_t &dfa); diff --git a/re2c/src/ir/regexp/nullable.cc b/re2c/src/ir/regexp/nullable.cc index 296b7a2d..9bdd257e 100644 --- a/re2c/src/ir/regexp/nullable.cc +++ b/re2c/src/ir/regexp/nullable.cc @@ -33,7 +33,7 @@ static bool nullable(const RegExp *re, bool &trail) * false positives on partially self-shadowed rules like [^]? */ void warn_nullable(const std::vector ®exps, - const std::string &cond) + const std::string &cond, Warn &warn) { const size_t nregexps = regexps.size(); for (size_t i = 0; i < nregexps; ++i) { diff --git a/re2c/src/ir/regexp/regexp.cc b/re2c/src/ir/regexp/regexp.cc index 5357e4b6..4dcf482e 100644 --- a/re2c/src/ir/regexp/regexp.cc +++ b/re2c/src/ir/regexp/regexp.cc @@ -1,8 +1,6 @@ #include #include -#include "src/conf/warn.h" -#include "src/globals.h" #include "src/ir/regexp/empty_class_policy.h" #include "src/ir/regexp/encoding/case.h" #include "src/ir/regexp/encoding/enc.h" diff --git a/re2c/src/ir/regexp/regexp.h b/re2c/src/ir/regexp/regexp.h index 9f083eca..f0a5b4a8 100644 --- a/re2c/src/ir/regexp/regexp.h +++ b/re2c/src/ir/regexp/regexp.h @@ -6,6 +6,7 @@ #include #include +#include "src/conf/warn.h" #include "src/ir/rule.h" #include "src/util/free_list.h" #include "src/util/range.h" @@ -129,7 +130,7 @@ const RegExp *repeat(const RegExp *re, uint32_t n); const RegExp *repeat_from_to(const RegExp *re, uint32_t n, uint32_t m); const RegExp *repeat_from(const RegExp *re, uint32_t n); void warn_nullable(const std::vector ®exps, - const std::string &cond); + const std::string &cond, Warn &warn); } // end namespace re2c diff --git a/re2c/src/ir/skeleton/control_flow.cc b/re2c/src/ir/skeleton/control_flow.cc index 072ef97d..9d861602 100644 --- a/re2c/src/ir/skeleton/control_flow.cc +++ b/re2c/src/ir/skeleton/control_flow.cc @@ -1,8 +1,6 @@ #include #include -#include "src/conf/warn.h" -#include "src/globals.h" #include "src/ir/skeleton/path.h" #include "src/ir/skeleton/skeleton.h" #include "src/util/u32lim.h" @@ -60,7 +58,7 @@ static void naked_paths( } } -void warn_undefined_control_flow(const Skeleton &skel) +void warn_undefined_control_flow(const Skeleton &skel, Warn &warn) { ucf_t ucf(skel.nodes_count); naked_paths(skel, ucf, 0); diff --git a/re2c/src/ir/skeleton/skeleton.h b/re2c/src/ir/skeleton/skeleton.h index 86c0e7b4..ce1c9919 100644 --- a/re2c/src/ir/skeleton/skeleton.h +++ b/re2c/src/ir/skeleton/skeleton.h @@ -96,7 +96,7 @@ template key_t rule2key(size_t r, size_t def) size_t rule2key(size_t rule, size_t key, size_t def); uint32_t maxpath(const Skeleton &skel); -void warn_undefined_control_flow(const Skeleton &skel); +void warn_undefined_control_flow(const Skeleton &skel, Warn &warn); void fprint_default_path(FILE *f, const Skeleton &skel, const path_t &p); void emit_data(const Skeleton &skel, std::string fname, size_t cunit_size); void emit_prolog(OutputFile & o); diff --git a/re2c/src/main.cc b/re2c/src/main.cc index 09338d6d..49a599f8 100644 --- a/re2c/src/main.cc +++ b/re2c/src/main.cc @@ -26,8 +26,9 @@ using namespace re2c; int main(int, char *argv[]) { Opt opts; + Warn warn; - switch (parse_opts (argv, opts)) + switch (parse_opts(argv, opts, warn)) { case OK: break; case EXIT_OK: return 0; @@ -43,7 +44,7 @@ int main(int, char *argv[]) } // set up the output streams - re2c::Output output(opts); + re2c::Output output(opts, warn); Scanner scanner (input, output.source); parse (scanner, output); diff --git a/re2c/src/parse/lex.re b/re2c/src/parse/lex.re index 8dd3a6bd..bb6d0ae4 100644 --- a/re2c/src/parse/lex.re +++ b/re2c/src/parse/lex.re @@ -6,7 +6,6 @@ #include #include "src/codegen/output.h" -#include "src/conf/warn.h" #include "src/globals.h" #include "src/ir/regexp/encoding/enc.h" #include "src/ir/regexp/regexp.h" diff --git a/re2c/src/parse/scanner.cc b/re2c/src/parse/scanner.cc index b243cc4e..3ef425f7 100644 --- a/re2c/src/parse/scanner.cc +++ b/re2c/src/parse/scanner.cc @@ -66,6 +66,7 @@ Scanner::Scanner (Input & i, OutputFile & o) , in (i) , out (o) , opts (o.opts) + , warn (o.warn) {} void Scanner::fill (uint32_t need) diff --git a/re2c/src/parse/scanner.h b/re2c/src/parse/scanner.h index f285ec9b..87f5e145 100644 --- a/re2c/src/parse/scanner.h +++ b/re2c/src/parse/scanner.h @@ -6,6 +6,7 @@ #include #include "src/conf/opt.h" +#include "src/conf/warn.h" #include "src/parse/input.h" #include "src/util/attribute.h" #include "src/util/forbid_copy.h" @@ -58,6 +59,7 @@ class Scanner: private ScannerState public: OutputFile & out; Opt &opts; + Warn &warn; private: void fill (uint32_t); -- 2.40.0