From 2aae55c656d678e774ee4616f526a21db1e23ea7 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Sun, 29 Nov 2015 10:57:47 +0000 Subject: [PATCH] Added option '--no-version' that omits version in fingerprint. --- re2c/bootstrap/src/conf/parse_opts.cc | 464 ++++++++++++++------------ re2c/src/codegen/output.cc | 8 +- re2c/src/conf/opt.h | 1 + re2c/src/conf/parse_opts.re | 1 + 4 files changed, 253 insertions(+), 221 deletions(-) diff --git a/re2c/bootstrap/src/conf/parse_opts.cc b/re2c/bootstrap/src/conf/parse_opts.cc index 19e05cb0..3c161ef1 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.15.2 on Fri Nov 27 13:55:15 2015*/ +/* Generated by re2c 0.15.2 on Sun Nov 29 10:27:59 2015 */ #line 1 "../src/conf/parse_opts.re" #include @@ -774,38 +774,38 @@ yy235: #line 775 "src/conf/parse_opts.cc" yy236: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'i') goto yy532; + if (yych == 'i') goto yy541; goto yy235; yy237: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'a') goto yy492; - if (yych == 'o') goto yy493; + if (yych == 'a') goto yy501; + if (yych == 'o') goto yy502; goto yy235; yy238: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'e') goto yy479; + if (yych == 'e') goto yy488; goto yy235; yy239: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= 'l') { - if (yych == 'c') goto yy441; + if (yych == 'c') goto yy450; goto yy235; } else { - if (yych <= 'm') goto yy439; - if (yych <= 'n') goto yy440; + if (yych <= 'm') goto yy448; + if (yych <= 'n') goto yy449; goto yy235; } yy240: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'l') goto yy427; + if (yych == 'l') goto yy436; goto yy235; yy241: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'e') goto yy422; + if (yych == 'e') goto yy431; goto yy235; yy242: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'n') goto yy416; + if (yych == 'n') goto yy425; goto yy235; yy243: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -869,7 +869,7 @@ yy253: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy252; ++YYCURSOR; -#line 148 "../src/conf/parse_opts.re" +#line 149 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UCS2)) { error_encoding (); return EXIT_FAIL; } goto opt; } #line 875 "src/conf/parse_opts.cc" yy263: @@ -923,7 +923,7 @@ yy277: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy252; ++YYCURSOR; -#line 147 "../src/conf/parse_opts.re" +#line 148 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UTF32)) { error_encoding (); return EXIT_FAIL; } goto opt; } #line 929 "src/conf/parse_opts.cc" yy285: @@ -941,14 +941,14 @@ yy288: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy252; ++YYCURSOR; -#line 150 "../src/conf/parse_opts.re" +#line 151 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UTF8)) { error_encoding (); return EXIT_FAIL; } goto opt; } #line 947 "src/conf/parse_opts.cc" yy291: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy252; ++YYCURSOR; -#line 149 "../src/conf/parse_opts.re" +#line 150 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::UTF16)) { error_encoding (); return EXIT_FAIL; } goto opt; } #line 954 "src/conf/parse_opts.cc" yy294: @@ -973,7 +973,7 @@ yy294: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy252; ++YYCURSOR; -#line 152 "../src/conf/parse_opts.re" +#line 153 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-t, --type-header"); return EXIT_FAIL; } goto opt_header; } #line 979 "src/conf/parse_opts.cc" yy306: @@ -1067,7 +1067,7 @@ yy339: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy252; ++YYCURSOR; -#line 145 "../src/conf/parse_opts.re" +#line 146 "../src/conf/parse_opts.re" { opts.set_target (opt_t::SKELETON); goto opt; } #line 1073 "src/conf/parse_opts.cc" yy347: @@ -1090,7 +1090,7 @@ yy347: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy252; ++YYCURSOR; -#line 156 "../src/conf/parse_opts.re" +#line 157 "../src/conf/parse_opts.re" { goto opt; } #line 1096 "src/conf/parse_opts.cc" yy358: @@ -1124,7 +1124,7 @@ yy367: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy252; ++YYCURSOR; -#line 151 "../src/conf/parse_opts.re" +#line 152 "../src/conf/parse_opts.re" { if (!next (YYCURSOR, argv)) { error_arg ("-o, --output"); return EXIT_FAIL; } goto opt_output; } #line 1130 "src/conf/parse_opts.cc" yy374: @@ -1156,12 +1156,21 @@ yy375: #line 1157 "src/conf/parse_opts.cc" yy386: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'd') goto yy388; - if (yych != 'g') goto yy252; + if (yych <= 'f') { + if (yych == 'd') goto yy389; + goto yy252; + } else { + if (yych <= 'g') goto yy388; + if (yych != 'v') goto yy252; + } yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy400; + if (yych == 'e') goto yy417; goto yy252; yy388: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'e') goto yy401; + goto yy252; +yy389: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'e') goto yy252; yych = (YYCTYPE)*++YYCURSOR; @@ -1185,8 +1194,8 @@ yy388: ++YYCURSOR; #line 139 "../src/conf/parse_opts.re" { opts.set_iFlag (true); goto opt; } -#line 1189 "src/conf/parse_opts.cc" -yy400: +#line 1198 "src/conf/parse_opts.cc" +yy401: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'n') goto yy252; yych = (YYCTYPE)*++YYCURSOR; @@ -1218,8 +1227,25 @@ yy400: ++YYCURSOR; #line 142 "../src/conf/parse_opts.re" { opts.set_bNoGenerationDate (true); goto opt; } -#line 1222 "src/conf/parse_opts.cc" -yy416: +#line 1231 "src/conf/parse_opts.cc" +yy417: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'r') goto yy252; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 's') goto yy252; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'i') goto yy252; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'o') goto yy252; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'n') goto yy252; + yych = (YYCTYPE)*++YYCURSOR; + if (yych >= 0x01) goto yy252; + ++YYCURSOR; +#line 143 "../src/conf/parse_opts.re" + { opts.set_version (false); goto opt; } +#line 1248 "src/conf/parse_opts.cc" +yy425: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'p') goto yy252; yych = (YYCTYPE)*++YYCURSOR; @@ -1229,10 +1255,10 @@ yy416: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy252; ++YYCURSOR; -#line 154 "../src/conf/parse_opts.re" +#line 155 "../src/conf/parse_opts.re" { goto opt_input; } -#line 1235 "src/conf/parse_opts.cc" -yy422: +#line 1261 "src/conf/parse_opts.cc" +yy431: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'l') goto yy252; yych = (YYCTYPE)*++YYCURSOR; @@ -1242,8 +1268,8 @@ yy422: ++YYCURSOR; #line 129 "../src/conf/parse_opts.re" { usage (); return EXIT_OK; } -#line 1246 "src/conf/parse_opts.cc" -yy427: +#line 1272 "src/conf/parse_opts.cc" +yy436: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'e') goto yy252; yych = (YYCTYPE)*++YYCURSOR; @@ -1267,26 +1293,26 @@ yy427: ++YYCURSOR; #line 137 "../src/conf/parse_opts.re" { opts.set_FFlag (true); goto opt; } -#line 1271 "src/conf/parse_opts.cc" -yy439: +#line 1297 "src/conf/parse_opts.cc" +yy448: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy460; - if (yych == 'p') goto yy461; + if (yych == 'i') goto yy469; + if (yych == 'p') goto yy470; goto yy252; -yy440: +yy449: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'c') goto yy445; + if (yych == 'c') goto yy454; goto yy252; -yy441: +yy450: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'b') goto yy252; yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy252; ++YYCURSOR; -#line 146 "../src/conf/parse_opts.re" +#line 147 "../src/conf/parse_opts.re" { if (!opts.set_encoding (Enc::EBCDIC)) { error_encoding (); return EXIT_FAIL; } goto opt; } -#line 1289 "src/conf/parse_opts.cc" -yy445: +#line 1315 "src/conf/parse_opts.cc" +yy454: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'o') goto yy252; yych = (YYCTYPE)*++YYCURSOR; @@ -1314,14 +1340,14 @@ yy445: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy252; ++YYCURSOR; -#line 153 "../src/conf/parse_opts.re" +#line 154 "../src/conf/parse_opts.re" { goto opt_encoding_policy; } -#line 1320 "src/conf/parse_opts.cc" -yy460: +#line 1346 "src/conf/parse_opts.cc" +yy469: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy472; + if (yych == 't') goto yy481; goto yy252; -yy461: +yy470: yych = (YYCTYPE)*++YYCURSOR; if (yych != 't') goto yy252; yych = (YYCTYPE)*++YYCURSOR; @@ -1341,10 +1367,10 @@ yy461: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy252; ++YYCURSOR; -#line 155 "../src/conf/parse_opts.re" +#line 156 "../src/conf/parse_opts.re" { goto opt_empty_class; } -#line 1347 "src/conf/parse_opts.cc" -yy472: +#line 1373 "src/conf/parse_opts.cc" +yy481: yych = (YYCTYPE)*++YYCURSOR; if (yych != '-') goto yy252; yych = (YYCTYPE)*++YYCURSOR; @@ -1358,8 +1384,8 @@ yy472: ++YYCURSOR; #line 135 "../src/conf/parse_opts.re" { opts.set_target (opt_t::DOT); goto opt; } -#line 1362 "src/conf/parse_opts.cc" -yy479: +#line 1388 "src/conf/parse_opts.cc" +yy488: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'b') goto yy252; yych = (YYCTYPE)*++YYCURSOR; @@ -1385,12 +1411,12 @@ yy479: ++YYCURSOR; #line 134 "../src/conf/parse_opts.re" { opts.set_dFlag (true); goto opt; } -#line 1389 "src/conf/parse_opts.cc" -yy492: +#line 1415 "src/conf/parse_opts.cc" +yy501: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy508; + if (yych == 's') goto yy517; goto yy252; -yy493: +yy502: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'm') goto yy252; yych = (YYCTYPE)*++YYCURSOR; @@ -1420,8 +1446,8 @@ yy493: ++YYCURSOR; #line 138 "../src/conf/parse_opts.re" { opts.set_gFlag (true); goto opt; } -#line 1424 "src/conf/parse_opts.cc" -yy508: +#line 1450 "src/conf/parse_opts.cc" +yy517: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'e') goto yy252; yych = (YYCTYPE)*++YYCURSOR; @@ -1431,12 +1457,12 @@ yy508: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'n') goto yy252; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy514; + if (yych == 's') goto yy523; if (yych != 'v') goto yy252; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy525; + if (yych == 'e') goto yy534; goto yy252; -yy514: +yy523: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'e') goto yy252; yych = (YYCTYPE)*++YYCURSOR; @@ -1456,10 +1482,10 @@ yy514: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy252; ++YYCURSOR; -#line 143 "../src/conf/parse_opts.re" +#line 144 "../src/conf/parse_opts.re" { opts.set_bCaseInsensitive (true); goto opt; } -#line 1462 "src/conf/parse_opts.cc" -yy525: +#line 1488 "src/conf/parse_opts.cc" +yy534: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'r') goto yy252; yych = (YYCTYPE)*++YYCURSOR; @@ -1471,10 +1497,10 @@ yy525: yych = (YYCTYPE)*++YYCURSOR; if (yych >= 0x01) goto yy252; ++YYCURSOR; -#line 144 "../src/conf/parse_opts.re" +#line 145 "../src/conf/parse_opts.re" { opts.set_bCaseInverted (true); goto opt; } -#line 1477 "src/conf/parse_opts.cc" -yy532: +#line 1503 "src/conf/parse_opts.cc" +yy541: yych = (YYCTYPE)*++YYCURSOR; if (yych != 't') goto yy252; yych = (YYCTYPE)*++YYCURSOR; @@ -1498,14 +1524,14 @@ yy532: ++YYCURSOR; #line 132 "../src/conf/parse_opts.re" { opts.set_bFlag (true); goto opt; } -#line 1502 "src/conf/parse_opts.cc" +#line 1528 "src/conf/parse_opts.cc" } -#line 157 "../src/conf/parse_opts.re" +#line 158 "../src/conf/parse_opts.re" opt_output: -#line 1509 "src/conf/parse_opts.cc" +#line 1535 "src/conf/parse_opts.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -1543,37 +1569,37 @@ opt_output: 128, 128, 128, 128, 128, 128, 128, 128, }; yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x00) goto yy546; - if (yych != '-') goto yy548; -yy546: + if (yych <= 0x00) goto yy555; + if (yych != '-') goto yy557; +yy555: ++YYCURSOR; -#line 162 "../src/conf/parse_opts.re" +#line 163 "../src/conf/parse_opts.re" { error ("bad argument to option -o, --output: %s", *argv); return EXIT_FAIL; } -#line 1556 "src/conf/parse_opts.cc" -yy548: +#line 1582 "src/conf/parse_opts.cc" +yy557: yych = (YYCTYPE)*++YYCURSOR; - goto yy550; -yy549: + goto yy559; +yy558: ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; -yy550: +yy559: if (yybm[0+yych] & 128) { - goto yy549; + goto yy558; } ++YYCURSOR; -#line 166 "../src/conf/parse_opts.re" +#line 167 "../src/conf/parse_opts.re" { if (!opts.output (*argv)) return EXIT_FAIL; goto opt; } -#line 1570 "src/conf/parse_opts.cc" +#line 1596 "src/conf/parse_opts.cc" } -#line 167 "../src/conf/parse_opts.re" +#line 168 "../src/conf/parse_opts.re" opt_header: -#line 1577 "src/conf/parse_opts.cc" +#line 1603 "src/conf/parse_opts.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -1611,32 +1637,32 @@ opt_header: 128, 128, 128, 128, 128, 128, 128, 128, }; yych = (YYCTYPE)*YYCURSOR; - if (yych <= 0x00) goto yy555; - if (yych != '-') goto yy557; -yy555: + if (yych <= 0x00) goto yy564; + if (yych != '-') goto yy566; +yy564: ++YYCURSOR; -#line 172 "../src/conf/parse_opts.re" +#line 173 "../src/conf/parse_opts.re" { error ("bad argument to option -t, --type-header: %s", *argv); return EXIT_FAIL; } -#line 1624 "src/conf/parse_opts.cc" -yy557: +#line 1650 "src/conf/parse_opts.cc" +yy566: yych = (YYCTYPE)*++YYCURSOR; - goto yy559; -yy558: + goto yy568; +yy567: ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; -yy559: +yy568: if (yybm[0+yych] & 128) { - goto yy558; + goto yy567; } ++YYCURSOR; -#line 176 "../src/conf/parse_opts.re" +#line 177 "../src/conf/parse_opts.re" { opts.set_header_file (*argv); goto opt; } -#line 1638 "src/conf/parse_opts.cc" +#line 1664 "src/conf/parse_opts.cc" } -#line 177 "../src/conf/parse_opts.re" +#line 178 "../src/conf/parse_opts.re" opt_encoding_policy: @@ -1646,89 +1672,89 @@ opt_encoding_policy: return EXIT_FAIL; } -#line 1650 "src/conf/parse_opts.cc" +#line 1676 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; if (yych <= 'h') { - if (yych == 'f') goto yy566; + if (yych == 'f') goto yy575; } else { - if (yych <= 'i') goto yy567; - if (yych == 's') goto yy568; + if (yych <= 'i') goto yy576; + if (yych == 's') goto yy577; } ++YYCURSOR; -yy565: -#line 187 "../src/conf/parse_opts.re" +yy574: +#line 188 "../src/conf/parse_opts.re" { error ("bad argument to option --encoding-policy (expected: ignore | substitute | fail): %s", *argv); return EXIT_FAIL; } -#line 1667 "src/conf/parse_opts.cc" -yy566: +#line 1693 "src/conf/parse_opts.cc" +yy575: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'a') goto yy588; - goto yy565; -yy567: + if (yych == 'a') goto yy597; + goto yy574; +yy576: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'g') goto yy581; - goto yy565; -yy568: + if (yych == 'g') goto yy590; + goto yy574; +yy577: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych != 'u') goto yy565; + if (yych != 'u') goto yy574; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'b') goto yy571; -yy570: + if (yych == 'b') goto yy580; +yy579: YYCURSOR = YYMARKER; - goto yy565; -yy571: + goto yy574; +yy580: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy570; + if (yych != 's') goto yy579; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy570; + if (yych != 't') goto yy579; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy570; + if (yych != 'i') goto yy579; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy570; + if (yych != 't') goto yy579; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'u') goto yy570; + if (yych != 'u') goto yy579; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy570; + if (yych != 't') goto yy579; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy570; + if (yych != 'e') goto yy579; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy570; + if (yych >= 0x01) goto yy579; ++YYCURSOR; -#line 192 "../src/conf/parse_opts.re" +#line 193 "../src/conf/parse_opts.re" { opts.set_encoding_policy (Enc::POLICY_SUBSTITUTE); goto opt; } -#line 1704 "src/conf/parse_opts.cc" -yy581: +#line 1730 "src/conf/parse_opts.cc" +yy590: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy570; + if (yych != 'n') goto yy579; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy570; + if (yych != 'o') goto yy579; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy570; + if (yych != 'r') goto yy579; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy570; + if (yych != 'e') goto yy579; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy570; + if (yych >= 0x01) goto yy579; ++YYCURSOR; -#line 191 "../src/conf/parse_opts.re" +#line 192 "../src/conf/parse_opts.re" { opts.set_encoding_policy (Enc::POLICY_IGNORE); goto opt; } -#line 1719 "src/conf/parse_opts.cc" -yy588: +#line 1745 "src/conf/parse_opts.cc" +yy597: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'i') goto yy570; + if (yych != 'i') goto yy579; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy570; + if (yych != 'l') goto yy579; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy570; + if (yych >= 0x01) goto yy579; ++YYCURSOR; -#line 193 "../src/conf/parse_opts.re" +#line 194 "../src/conf/parse_opts.re" { opts.set_encoding_policy (Enc::POLICY_FAIL); goto opt; } -#line 1730 "src/conf/parse_opts.cc" +#line 1756 "src/conf/parse_opts.cc" } -#line 194 "../src/conf/parse_opts.re" +#line 195 "../src/conf/parse_opts.re" opt_input: @@ -1738,66 +1764,66 @@ opt_input: return EXIT_FAIL; } -#line 1742 "src/conf/parse_opts.cc" +#line 1768 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; - if (yych <= 'b') goto yy595; - if (yych <= 'c') goto yy597; - if (yych <= 'd') goto yy598; -yy595: + if (yych <= 'b') goto yy604; + if (yych <= 'c') goto yy606; + if (yych <= 'd') goto yy607; +yy604: ++YYCURSOR; -yy596: -#line 204 "../src/conf/parse_opts.re" +yy605: +#line 205 "../src/conf/parse_opts.re" { error ("bad argument to option --input (expected: default | custom): %s", *argv); return EXIT_FAIL; } -#line 1757 "src/conf/parse_opts.cc" -yy597: +#line 1783 "src/conf/parse_opts.cc" +yy606: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'u') goto yy608; - goto yy596; -yy598: + if (yych == 'u') goto yy617; + goto yy605; +yy607: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych != 'e') goto yy596; + if (yych != 'e') goto yy605; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'f') goto yy601; -yy600: + if (yych == 'f') goto yy610; +yy609: YYCURSOR = YYMARKER; - goto yy596; -yy601: + goto yy605; +yy610: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy600; + if (yych != 'a') goto yy609; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'u') goto yy600; + if (yych != 'u') goto yy609; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy600; + if (yych != 'l') goto yy609; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy600; + if (yych != 't') goto yy609; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy600; + if (yych >= 0x01) goto yy609; ++YYCURSOR; -#line 208 "../src/conf/parse_opts.re" +#line 209 "../src/conf/parse_opts.re" { opts.set_input_api (InputAPI::DEFAULT); goto opt; } -#line 1784 "src/conf/parse_opts.cc" -yy608: +#line 1810 "src/conf/parse_opts.cc" +yy617: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 's') goto yy600; + if (yych != 's') goto yy609; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy600; + if (yych != 't') goto yy609; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy600; + if (yych != 'o') goto yy609; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'm') goto yy600; + if (yych != 'm') goto yy609; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy600; + if (yych >= 0x01) goto yy609; ++YYCURSOR; -#line 209 "../src/conf/parse_opts.re" +#line 210 "../src/conf/parse_opts.re" { opts.set_input_api (InputAPI::CUSTOM); goto opt; } -#line 1799 "src/conf/parse_opts.cc" +#line 1825 "src/conf/parse_opts.cc" } -#line 210 "../src/conf/parse_opts.re" +#line 211 "../src/conf/parse_opts.re" opt_empty_class: @@ -1807,88 +1833,88 @@ opt_empty_class: return EXIT_FAIL; } -#line 1811 "src/conf/parse_opts.cc" +#line 1837 "src/conf/parse_opts.cc" { YYCTYPE yych; yych = (YYCTYPE)*YYCURSOR; - if (yych == 'e') goto yy619; - if (yych == 'm') goto yy620; + if (yych == 'e') goto yy628; + if (yych == 'm') goto yy629; ++YYCURSOR; -yy618: -#line 220 "../src/conf/parse_opts.re" +yy627: +#line 221 "../src/conf/parse_opts.re" { error ("bad argument to option --empty-class (expected: match-empty | match-none | error): %s", *argv); return EXIT_FAIL; } -#line 1824 "src/conf/parse_opts.cc" -yy619: +#line 1850 "src/conf/parse_opts.cc" +yy628: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'r') goto yy640; - goto yy618; -yy620: + if (yych == 'r') goto yy649; + goto yy627; +yy629: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych != 'a') goto yy618; + if (yych != 'a') goto yy627; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 't') goto yy623; -yy622: + if (yych == 't') goto yy632; +yy631: YYCURSOR = YYMARKER; - goto yy618; -yy623: + goto yy627; +yy632: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'c') goto yy622; + if (yych != 'c') goto yy631; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'h') goto yy622; + if (yych != 'h') goto yy631; yych = (YYCTYPE)*++YYCURSOR; - if (yych != '-') goto yy622; + if (yych != '-') goto yy631; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy627; - if (yych == 'n') goto yy628; - goto yy622; -yy627: + if (yych == 'e') goto yy636; + if (yych == 'n') goto yy637; + goto yy631; +yy636: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'm') goto yy634; - goto yy622; -yy628: + if (yych == 'm') goto yy643; + goto yy631; +yy637: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy622; + if (yych != 'o') goto yy631; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'n') goto yy622; + if (yych != 'n') goto yy631; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'e') goto yy622; + if (yych != 'e') goto yy631; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy622; + if (yych >= 0x01) goto yy631; ++YYCURSOR; -#line 225 "../src/conf/parse_opts.re" +#line 226 "../src/conf/parse_opts.re" { opts.set_empty_class_policy (EMPTY_CLASS_MATCH_NONE); goto opt; } -#line 1864 "src/conf/parse_opts.cc" -yy634: +#line 1890 "src/conf/parse_opts.cc" +yy643: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'p') goto yy622; + if (yych != 'p') goto yy631; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy622; + if (yych != 't') goto yy631; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'y') goto yy622; + if (yych != 'y') goto yy631; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy622; + if (yych >= 0x01) goto yy631; ++YYCURSOR; -#line 224 "../src/conf/parse_opts.re" +#line 225 "../src/conf/parse_opts.re" { opts.set_empty_class_policy (EMPTY_CLASS_MATCH_EMPTY); goto opt; } -#line 1877 "src/conf/parse_opts.cc" -yy640: +#line 1903 "src/conf/parse_opts.cc" +yy649: yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy622; + if (yych != 'r') goto yy631; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'o') goto yy622; + if (yych != 'o') goto yy631; yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'r') goto yy622; + if (yych != 'r') goto yy631; yych = (YYCTYPE)*++YYCURSOR; - if (yych >= 0x01) goto yy622; + if (yych >= 0x01) goto yy631; ++YYCURSOR; -#line 226 "../src/conf/parse_opts.re" +#line 227 "../src/conf/parse_opts.re" { opts.set_empty_class_policy (EMPTY_CLASS_ERROR); goto opt; } -#line 1890 "src/conf/parse_opts.cc" +#line 1916 "src/conf/parse_opts.cc" } -#line 227 "../src/conf/parse_opts.re" +#line 228 "../src/conf/parse_opts.re" end: diff --git a/re2c/src/codegen/output.cc b/re2c/src/codegen/output.cc index c466f8ab..581c8f66 100644 --- a/re2c/src/codegen/output.cc +++ b/re2c/src/codegen/output.cc @@ -439,14 +439,18 @@ void output_types (std::ostream & o, uint32_t ind, const std::vectorversion) + { + o << " " << PACKAGE_VERSION; + } if (!opts->bNoGenerationDate) { o << " on "; time_t now = time (NULL); o.write (ctime (&now), 24); } - o << "*/" << "\n"; + o << " */" << "\n"; } std::string output_get_state () diff --git a/re2c/src/conf/opt.h b/re2c/src/conf/opt.h index 78a8eb64..4a088adb 100644 --- a/re2c/src/conf/opt.h +++ b/re2c/src/conf/opt.h @@ -15,6 +15,7 @@ namespace re2c OPT1 (opt_t::target_t, target, CODE) \ /* fingerprint */ \ OPT (bool, bNoGenerationDate, false) \ + OPT (bool, version, true) \ /* regular expressions */ \ OPT (Enc, encoding, Enc ()) \ OPT (bool, bCaseInsensitive, false) \ diff --git a/re2c/src/conf/parse_opts.re b/re2c/src/conf/parse_opts.re index 6006f063..6a391cfa 100644 --- a/re2c/src/conf/parse_opts.re +++ b/re2c/src/conf/parse_opts.re @@ -140,6 +140,7 @@ opt_long: "reusable" end { opts.set_rFlag (true); goto opt; } "nested-ifs" end { opts.set_sFlag (true); goto opt; } "no-generation-date" end { opts.set_bNoGenerationDate (true); goto opt; } + "no-version" end { opts.set_version (false); goto opt; } "case-insensitive" end { opts.set_bCaseInsensitive (true); goto opt; } "case-inverted" end { opts.set_bCaseInverted (true); goto opt; } "skeleton" end { opts.set_target (opt_t::SKELETON); goto opt; } -- 2.40.0