-/* Generated by re2c 1.1.1 on Thu Dec 27 22:47:12 2018 */
+/* Generated by re2c 1.1.1 on Sun Dec 30 10:57:46 2018 */
#line 1 "../src/ast/lex.re"
#include "src/util/c99_stdint.h"
#include <stddef.h>
#line 199 "../src/ast/lex.re"
{
out.wraw(tok, ptr);
- include(std::string(x + 1, static_cast<size_t>(y - x) - 2));
+ include(getstr(x + 1, y - 1));
goto next;
}
#line 923 "src/ast/lex.cc"
#line 357 "../src/ast/lex.re"
{
if (!globopts->FFlag || lex_namedef_context_re2c()) {
- yylval.str = new std::string (tok, tok_len());
+ yylval.str = newstr(tok, cur);
return TOKEN_ID;
}
else if (lex_namedef_context_flex()) {
- yylval.str = new std::string (tok, tok_len());
+ yylval.str = newstr(tok, cur);
lexer_state = LEX_FLEX_NAME;
return TOKEN_FID;
}
yy262:
#line 307 "../src/ast/lex.re"
{
- const std::string *name = new std::string(tok + 1, tok_len() - 1);
- yylval.regexp = ast_tag(get_line(), get_column(), name, tok[0] == '#');
+ yylval.regexp = ast_tag(get_line(), get_column()
+ , newstr(tok + 1, cur), tok[0] == '#');
return TOKEN_REGEXP;
}
#line 1511 "src/ast/lex.cc"
p = yyt1;
#line 290 "../src/ast/lex.re"
{
- yylval.str = new std::string(p, static_cast<size_t>(cur - p));
+ yylval.str = newstr(p, cur);
return tok[0] == ':' ? TOKEN_CJUMP : TOKEN_CNEXT;
}
#line 1645 "src/ast/lex.cc"
fatal_lc(get_line(), get_column(),
"curly braces for names only allowed with -F switch");
}
- yylval.str = new std::string (tok + 1, tok_len () - 2); // -2 to omit braces
+ yylval.str = newstr(tok + 1, cur - 1);
return TOKEN_ID;
}
#line 1679 "src/ast/lex.cc"
goto yy349;
}
#line 439 "../src/ast/lex.re"
- { cl->insert(std::string(tok, tok_len())); goto next; }
+ { cl->insert(getstr(tok, cur)); goto next; }
#line 2133 "src/ast/lex.cc"
}
#line 442 "../src/ast/lex.re"
{
while (isspace(tok[0])) ++tok;
while (cur > tok && isspace(cur[-1])) --cur;
- yylval.code = new Code(get_fname (), line, tok, tok_len ());
+ yylval.code = new Code(get_fname (), line, getstr(tok, cur));
return;
}
#line 2309 "src/ast/lex.cc"
#line 486 "../src/ast/lex.re"
{
if (--depth == 0) {
- yylval.code = new Code(get_fname (), line, tok, tok_len ());
+ yylval.code = new Code(get_fname (), line, getstr(tok, cur));
return;
}
goto code;
#line 659 "../src/ast/lex.re"
{
std::string &name = get_input().escaped_name;
- name = std::string(tok + 1, tok_len () - 2); // strip quotes
+ name = getstr(tok + 1, cur - 1);
strrreplace(name, "\\", "\\\\");
goto sourceline;
}
-/* Generated by re2c 1.1.1 on Thu Dec 27 22:47:12 2018 */
+/* Generated by re2c 1.1.1 on Sun Dec 30 10:57:46 2018 */
#include <string.h>
#include "src/util/forbid_copy.h"
-/* Generated by re2c 1.1.1 on Wed Dec 26 20:02:53 2018 */
+/* Generated by re2c 1.1.1 on Sun Dec 30 10:58:27 2018 */
#line 1 "../src/ast/lex_conf.re"
#include "src/util/c99_stdint.h"
#include <string>
#include "src/re/encoding/enc.h"
#include "src/ast/scanner.h"
#include "src/util/s_to_n32_unsafe.h"
+#include "src/util/string_utils.h"
namespace re2c
{
#define YYFILL(n) { if (!fill (n)) fatal("unexpected end of input"); }
// global re2c config (affects the whole file)
-#line 36 "../src/ast/lex_conf.re"
+#line 37 "../src/ast/lex_conf.re"
void Scanner::lex_conf(Opt &opts)
tok = cur;
const uint32_t l = get_line(), c = get_column();
-#line 27 "src/ast/lex_conf.cc"
+#line 28 "src/ast/lex_conf.cc"
{
unsigned char yych;
unsigned int yyaccept = 0;
}
}
yy2:
-#line 171 "../src/ast/lex_conf.re"
+#line 172 "../src/ast/lex_conf.re"
{
fatal_lc(l, c, "unrecognized configuration '%.*s'",
static_cast<int>(cur - tok), tok);
}
-#line 113 "src/ast/lex_conf.cc"
+#line 114 "src/ast/lex_conf.cc"
yy3:
++cur;
if (lim <= cur) YYFILL(1);
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 69 "../src/ast/lex_conf.re"
+#line 70 "../src/ast/lex_conf.re"
{
const int32_t eof = lex_conf_number();
if (eof < 0) fatal_lc(l, c, "eof cannot have negative value");
opts.set_eof(static_cast<uint32_t>(eof));
return;
}
-#line 238 "src/ast/lex_conf.cc"
+#line 239 "src/ast/lex_conf.cc"
yy31:
yych = (unsigned char)*++cur;
if (yych == 'g') goto yy43;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 62 "../src/ast/lex_conf.re"
+#line 63 "../src/ast/lex_conf.re"
{ lex_conf_enc(Enc::UTF8, opts); return; }
-#line 525 "src/ast/lex_conf.cc"
+#line 526 "src/ast/lex_conf.cc"
yy95:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 49 "../src/ast/lex_conf.re"
+#line 50 "../src/ast/lex_conf.re"
{ opts.set_posix_captures (lex_conf_bool()); return; }
-#line 533 "src/ast/lex_conf.cc"
+#line 534 "src/ast/lex_conf.cc"
yy97:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 48 "../src/ast/lex_conf.re"
+#line 49 "../src/ast/lex_conf.re"
{ opts.set_tags (lex_conf_bool()); return; }
-#line 541 "src/ast/lex_conf.cc"
+#line 542 "src/ast/lex_conf.cc"
yy99:
yych = (unsigned char)*++cur;
if (yych <= 'Z') {
}
}
yy100:
-#line 43 "../src/ast/lex_conf.re"
+#line 44 "../src/ast/lex_conf.re"
{ opts.set_bFlag (lex_conf_bool()); return; }
-#line 562 "src/ast/lex_conf.cc"
+#line 563 "src/ast/lex_conf.cc"
yy101:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy145;
}
}
yy103:
-#line 44 "../src/ast/lex_conf.re"
+#line 45 "../src/ast/lex_conf.re"
{ opts.set_dFlag (lex_conf_bool()); return; }
-#line 590 "src/ast/lex_conf.cc"
+#line 591 "src/ast/lex_conf.cc"
yy104:
yych = (unsigned char)*++cur;
if (yych <= '_') {
}
}
yy105:
-#line 58 "../src/ast/lex_conf.re"
+#line 59 "../src/ast/lex_conf.re"
{ lex_conf_enc(Enc::EBCDIC, opts); return; }
-#line 621 "src/ast/lex_conf.cc"
+#line 622 "src/ast/lex_conf.cc"
yy106:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 45 "../src/ast/lex_conf.re"
+#line 46 "../src/ast/lex_conf.re"
{ opts.set_gFlag (lex_conf_bool()); return; }
-#line 629 "src/ast/lex_conf.cc"
+#line 630 "src/ast/lex_conf.cc"
yy108:
yych = (unsigned char)*++cur;
if (yych <= 'Z') {
}
}
yy109:
-#line 46 "../src/ast/lex_conf.re"
+#line 47 "../src/ast/lex_conf.re"
{ opts.set_iFlag (lex_conf_bool()); return; }
-#line 650 "src/ast/lex_conf.cc"
+#line 651 "src/ast/lex_conf.cc"
yy110:
yych = (unsigned char)*++cur;
if (yych == 'o') goto yy154;
}
}
yy113:
-#line 55 "../src/ast/lex_conf.re"
+#line 56 "../src/ast/lex_conf.re"
{ opts.set_output_file (lex_conf_string()); return; }
-#line 683 "src/ast/lex_conf.cc"
+#line 684 "src/ast/lex_conf.cc"
yy114:
yych = (unsigned char)*++cur;
if (yych == 'o') goto yy159;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 47 "../src/ast/lex_conf.re"
+#line 48 "../src/ast/lex_conf.re"
{ opts.set_sFlag (lex_conf_bool()); return; }
-#line 695 "src/ast/lex_conf.cc"
+#line 696 "src/ast/lex_conf.cc"
yy117:
yych = (unsigned char)*++cur;
if (yych <= '^') {
}
}
yy118:
-#line 56 "../src/ast/lex_conf.re"
+#line 57 "../src/ast/lex_conf.re"
{ opts.set_header_file (lex_conf_string()); return; }
-#line 718 "src/ast/lex_conf.cc"
+#line 719 "src/ast/lex_conf.cc"
yy119:
yych = (unsigned char)*++cur;
if (yych <= '^') {
}
}
yy120:
-#line 59 "../src/ast/lex_conf.re"
+#line 60 "../src/ast/lex_conf.re"
{ lex_conf_enc(Enc::UTF32, opts); return; }
-#line 742 "src/ast/lex_conf.cc"
+#line 743 "src/ast/lex_conf.cc"
yy121:
yych = (unsigned char)*++cur;
if (yych <= 'Z') {
}
}
yy122:
-#line 60 "../src/ast/lex_conf.re"
+#line 61 "../src/ast/lex_conf.re"
{ lex_conf_enc(Enc::UCS2, opts); return; }
-#line 763 "src/ast/lex_conf.cc"
+#line 764 "src/ast/lex_conf.cc"
yy123:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 61 "../src/ast/lex_conf.re"
+#line 62 "../src/ast/lex_conf.re"
{ lex_conf_enc(Enc::UTF16, opts); return; }
-#line 771 "src/ast/lex_conf.cc"
+#line 772 "src/ast/lex_conf.cc"
yy125:
yych = (unsigned char)*++cur;
if (yych <= 'r') goto yy4;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 102 "../src/ast/lex_conf.re"
+#line 103 "../src/ast/lex_conf.re"
{ opts.set_yybmHexTable (lex_conf_bool()); return; }
-#line 988 "src/ast/lex_conf.cc"
+#line 989 "src/ast/lex_conf.cc"
yy177:
yych = (unsigned char)*++cur;
if (yych == 'v') goto yy221;
}
if (yych == '@') goto yy229;
yy185:
-#line 86 "../src/ast/lex_conf.re"
+#line 87 "../src/ast/lex_conf.re"
{ opts.set_condGoto (lex_conf_string ()); return; }
-#line 1027 "src/ast/lex_conf.cc"
+#line 1028 "src/ast/lex_conf.cc"
yy186:
yych = (unsigned char)*++cur;
if (yych == 'r') goto yy231;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 153 "../src/ast/lex_conf.re"
+#line 154 "../src/ast/lex_conf.re"
{ opts.set_bEmitYYCh (lex_conf_bool()); return; }
-#line 1192 "src/ast/lex_conf.cc"
+#line 1193 "src/ast/lex_conf.cc"
yy224:
yych = (unsigned char)*++cur;
if (yych == 'e') goto yy277;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 82 "../src/ast/lex_conf.re"
+#line 83 "../src/ast/lex_conf.re"
{ opts.set_condPrefix (lex_conf_string ()); return; }
-#line 1250 "src/ast/lex_conf.cc"
+#line 1251 "src/ast/lex_conf.cc"
yy234:
yych = (unsigned char)*++cur;
if (yych == 'A') goto yy284;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 138 "../src/ast/lex_conf.re"
+#line 139 "../src/ast/lex_conf.re"
{
const int32_t n = lex_conf_number ();
if (n < 0)
opts.set_topIndent (static_cast<uint32_t> (n));
return;
}
-#line 1401 "src/ast/lex_conf.cc"
+#line 1402 "src/ast/lex_conf.cc"
yy266:
yych = (unsigned char)*++cur;
if (yych == 'l') goto yy321;
}
}
yy270:
-#line 166 "../src/ast/lex_conf.re"
+#line 167 "../src/ast/lex_conf.re"
{ opts.set_startlabel (lex_conf_string()); return; }
-#line 1438 "src/ast/lex_conf.cc"
+#line 1439 "src/ast/lex_conf.cc"
yy271:
yych = (unsigned char)*++cur;
if (yych == 't') goto yy329;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 65 "../src/ast/lex_conf.re"
+#line 66 "../src/ast/lex_conf.re"
{ lex_conf_input(opts); return; }
-#line 1596 "src/ast/lex_conf.cc"
+#line 1597 "src/ast/lex_conf.cc"
yy310:
yych = (unsigned char)*++cur;
if (yych == 'h') goto yy370;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 162 "../src/ast/lex_conf.re"
+#line 163 "../src/ast/lex_conf.re"
{ opts.set_labelPrefix (lex_conf_string ()); return; }
-#line 1656 "src/ast/lex_conf.cc"
+#line 1657 "src/ast/lex_conf.cc"
yy325:
++cur;
if (lim <= cur) YYFILL(1);
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 97 "../src/ast/lex_conf.re"
+#line 98 "../src/ast/lex_conf.re"
{ opts.set_bUseStateAbort (lex_conf_bool()); return; }
-#line 1694 "src/ast/lex_conf.cc"
+#line 1695 "src/ast/lex_conf.cc"
yy331:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy388;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 133 "../src/ast/lex_conf.re"
+#line 134 "../src/ast/lex_conf.re"
{ opts.set_tags_prefix (lex_conf_string ()); return; }
-#line 1710 "src/ast/lex_conf.cc"
+#line 1711 "src/ast/lex_conf.cc"
yy335:
yych = (unsigned char)*++cur;
if (yych <= 'c') {
}
if (yych == '@') goto yy401;
yy342:
-#line 84 "../src/ast/lex_conf.re"
+#line 85 "../src/ast/lex_conf.re"
{ opts.set_condDivider (lex_conf_string ()); return; }
-#line 1754 "src/ast/lex_conf.cc"
+#line 1755 "src/ast/lex_conf.cc"
yy343:
yych = (unsigned char)*++cur;
if (yych == 'n') goto yy402;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 96 "../src/ast/lex_conf.re"
+#line 97 "../src/ast/lex_conf.re"
{ opts.set_yynext (lex_conf_string ()); return; }
-#line 1918 "src/ast/lex_conf.cc"
+#line 1919 "src/ast/lex_conf.cc"
yy383:
yych = (unsigned char)*++cur;
if (yych <= '0') goto yy230;
++cur;
yy385:
cur = ctx;
-#line 165 "../src/ast/lex_conf.re"
+#line 166 "../src/ast/lex_conf.re"
{ opts.set_startlabel_force (lex_conf_bool()); return; }
-#line 1930 "src/ast/lex_conf.cc"
+#line 1931 "src/ast/lex_conf.cc"
yy386:
++cur;
if (lim <= cur) YYFILL(1);
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 160 "../src/ast/lex_conf.re"
+#line 161 "../src/ast/lex_conf.re"
{ opts.set_fill_check (lex_conf_bool()); return; }
-#line 1979 "src/ast/lex_conf.cc"
+#line 1980 "src/ast/lex_conf.cc"
yy398:
yych = (unsigned char)*++cur;
if (yych == 'e') goto yy456;
}
}
yy411:
-#line 155 "../src/ast/lex_conf.re"
+#line 156 "../src/ast/lex_conf.re"
{ opts.set_fill (lex_conf_string ()); return; }
-#line 2050 "src/ast/lex_conf.cc"
+#line 2051 "src/ast/lex_conf.cc"
yy412:
yych = (unsigned char)*++cur;
if (yych == 'O') goto yy475;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 120 "../src/ast/lex_conf.re"
+#line 121 "../src/ast/lex_conf.re"
{ opts.set_yypeek (lex_conf_string ()); return; }
-#line 2083 "src/ast/lex_conf.cc"
+#line 2084 "src/ast/lex_conf.cc"
yy420:
yych = (unsigned char)*++cur;
if (yych == 'O') goto yy485;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 121 "../src/ast/lex_conf.re"
+#line 122 "../src/ast/lex_conf.re"
{ opts.set_yyskip (lex_conf_string ()); return; }
-#line 2103 "src/ast/lex_conf.cc"
+#line 2104 "src/ast/lex_conf.cc"
yy425:
yych = (unsigned char)*++cur;
if (yych == 'N') goto yy488;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 136 "../src/ast/lex_conf.re"
+#line 137 "../src/ast/lex_conf.re"
{ opts.set_indString (lex_conf_string ()); return; }
-#line 2183 "src/ast/lex_conf.cc"
+#line 2184 "src/ast/lex_conf.cc"
yy444:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy508;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 101 "../src/ast/lex_conf.re"
+#line 102 "../src/ast/lex_conf.re"
{ opts.set_yybm (lex_conf_string ()); return; }
-#line 2207 "src/ast/lex_conf.cc"
+#line 2208 "src/ast/lex_conf.cc"
yy450:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 151 "../src/ast/lex_conf.re"
+#line 152 "../src/ast/lex_conf.re"
{ opts.set_yych (lex_conf_string ()); return; }
-#line 2215 "src/ast/lex_conf.cc"
+#line 2216 "src/ast/lex_conf.cc"
yy452:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy512;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 156 "../src/ast/lex_conf.re"
+#line 157 "../src/ast/lex_conf.re"
{ opts.set_fill_use (lex_conf_bool()); return; }
-#line 2239 "src/ast/lex_conf.cc"
+#line 2240 "src/ast/lex_conf.cc"
yy458:
yych = (unsigned char)*++cur;
if (yych == 't') goto yy516;
goto yy230;
yy461:
++cur;
-#line 87 "../src/ast/lex_conf.re"
+#line 88 "../src/ast/lex_conf.re"
{ opts.set_condGotoParam (lex_conf_string ()); return; }
-#line 2256 "src/ast/lex_conf.cc"
+#line 2257 "src/ast/lex_conf.cc"
yy463:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 83 "../src/ast/lex_conf.re"
+#line 84 "../src/ast/lex_conf.re"
{ opts.set_condEnumPrefix (lex_conf_string ()); return; }
-#line 2264 "src/ast/lex_conf.cc"
+#line 2265 "src/ast/lex_conf.cc"
yy465:
yych = (unsigned char)*++cur;
if (yych == 'P') goto yy520;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 150 "../src/ast/lex_conf.re"
+#line 151 "../src/ast/lex_conf.re"
{ opts.set_yyctype (lex_conf_string ()); return; }
-#line 2284 "src/ast/lex_conf.cc"
+#line 2285 "src/ast/lex_conf.cc"
yy470:
yych = (unsigned char)*++cur;
if (yych == 'R') goto yy524;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 148 "../src/ast/lex_conf.re"
+#line 149 "../src/ast/lex_conf.re"
{ opts.set_yydebug (lex_conf_string ()); return; }
-#line 2296 "src/ast/lex_conf.cc"
+#line 2297 "src/ast/lex_conf.cc"
yy473:
yych = (unsigned char)*++cur;
if (yych == 'n') goto yy526;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 118 "../src/ast/lex_conf.re"
+#line 119 "../src/ast/lex_conf.re"
{ opts.set_yylimit (lex_conf_string ()); return; }
-#line 2324 "src/ast/lex_conf.cc"
+#line 2325 "src/ast/lex_conf.cc"
yy480:
yych = (unsigned char)*++cur;
if (yych == 'R') goto yy531;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 130 "../src/ast/lex_conf.re"
+#line 131 "../src/ast/lex_conf.re"
{ opts.set_yymtagn (lex_conf_string ()); return; }
-#line 2336 "src/ast/lex_conf.cc"
+#line 2337 "src/ast/lex_conf.cc"
yy483:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 131 "../src/ast/lex_conf.re"
+#line 132 "../src/ast/lex_conf.re"
{ opts.set_yymtagp (lex_conf_string ()); return; }
-#line 2344 "src/ast/lex_conf.cc"
+#line 2345 "src/ast/lex_conf.cc"
yy485:
yych = (unsigned char)*++cur;
if (yych == 'R') goto yy533;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 128 "../src/ast/lex_conf.re"
+#line 129 "../src/ast/lex_conf.re"
{ opts.set_yystagn (lex_conf_string ()); return; }
-#line 2364 "src/ast/lex_conf.cc"
+#line 2365 "src/ast/lex_conf.cc"
yy490:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 129 "../src/ast/lex_conf.re"
+#line 130 "../src/ast/lex_conf.re"
{ opts.set_yystagp (lex_conf_string ()); return; }
-#line 2372 "src/ast/lex_conf.cc"
+#line 2373 "src/ast/lex_conf.cc"
yy492:
yych = (unsigned char)*++cur;
if (yych == 'o') goto yy536;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 104 "../src/ast/lex_conf.re"
+#line 105 "../src/ast/lex_conf.re"
{
const int32_t n = lex_conf_number ();
if (n < 0)
opts.set_cGotoThreshold (static_cast<uint32_t> (n));
return;
}
-#line 2488 "src/ast/lex_conf.cc"
+#line 2489 "src/ast/lex_conf.cc"
yy519:
yych = (unsigned char)*++cur;
if (yych == 'n') goto yy565;
}
}
yy521:
-#line 122 "../src/ast/lex_conf.re"
+#line 123 "../src/ast/lex_conf.re"
{ opts.set_yybackup (lex_conf_string ()); return; }
-#line 2514 "src/ast/lex_conf.cc"
+#line 2515 "src/ast/lex_conf.cc"
yy522:
yych = (unsigned char)*++cur;
if (yych == 'P') goto yy567;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 115 "../src/ast/lex_conf.re"
+#line 116 "../src/ast/lex_conf.re"
{ opts.set_yycursor (lex_conf_string ()); return; }
-#line 2530 "src/ast/lex_conf.cc"
+#line 2531 "src/ast/lex_conf.cc"
yy526:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy569;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 116 "../src/ast/lex_conf.re"
+#line 117 "../src/ast/lex_conf.re"
{ opts.set_yymarker (lex_conf_string ()); return; }
-#line 2558 "src/ast/lex_conf.cc"
+#line 2559 "src/ast/lex_conf.cc"
yy533:
yych = (unsigned char)*++cur;
if (yych == 'E') goto yy574;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 52 "../src/ast/lex_conf.re"
+#line 53 "../src/ast/lex_conf.re"
{ opts.set_lookahead (lex_conf_bool()); return; }
-#line 2614 "src/ast/lex_conf.cc"
+#line 2615 "src/ast/lex_conf.cc"
yy547:
yych = (unsigned char)*++cur;
if (yych == 's') goto yy115;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 98 "../src/ast/lex_conf.re"
+#line 99 "../src/ast/lex_conf.re"
{ opts.set_bUseStateNext (lex_conf_bool()); return; }
-#line 2650 "src/ast/lex_conf.cc"
+#line 2651 "src/ast/lex_conf.cc"
yy556:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 134 "../src/ast/lex_conf.re"
+#line 135 "../src/ast/lex_conf.re"
{ opts.set_tags_expression(lex_conf_string ()); return; }
-#line 2658 "src/ast/lex_conf.cc"
+#line 2659 "src/ast/lex_conf.cc"
yy558:
yych = (unsigned char)*++cur;
if (yych == 'p') goto yy594;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 152 "../src/ast/lex_conf.re"
+#line 153 "../src/ast/lex_conf.re"
{ opts.set_yychConversion (lex_conf_bool()); return; }
-#line 2682 "src/ast/lex_conf.cc"
+#line 2683 "src/ast/lex_conf.cc"
yy564:
yych = (unsigned char)*++cur;
if (yych == 'r') goto yy598;
}
}
yy575:
-#line 124 "../src/ast/lex_conf.re"
+#line 125 "../src/ast/lex_conf.re"
{ opts.set_yyrestore (lex_conf_string ()); return; }
-#line 2746 "src/ast/lex_conf.cc"
+#line 2747 "src/ast/lex_conf.cc"
yy576:
yych = (unsigned char)*++cur;
if (yych == 'I') goto yy616;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 54 "../src/ast/lex_conf.re"
+#line 55 "../src/ast/lex_conf.re"
{ opts.set_eager_skip (lex_conf_bool()); return; }
-#line 2786 "src/ast/lex_conf.cc"
+#line 2787 "src/ast/lex_conf.cc"
yy586:
yych = (unsigned char)*++cur;
if (yych == 's') goto yy625;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 158 "../src/ast/lex_conf.re"
+#line 159 "../src/ast/lex_conf.re"
{ opts.set_fill_arg_use (lex_conf_bool()); return; }
-#line 2844 "src/ast/lex_conf.cc"
+#line 2845 "src/ast/lex_conf.cc"
yy600:
++cur;
-#line 85 "../src/ast/lex_conf.re"
+#line 86 "../src/ast/lex_conf.re"
{ opts.set_condDividerParam (lex_conf_string ()); return; }
-#line 2849 "src/ast/lex_conf.cc"
+#line 2850 "src/ast/lex_conf.cc"
yy602:
yych = (unsigned char)*++cur;
if (yych == 'X') goto yy642;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 76 "../src/ast/lex_conf.re"
+#line 77 "../src/ast/lex_conf.re"
{ opts.set_yycondtype (lex_conf_string ()); return; }
-#line 2861 "src/ast/lex_conf.cc"
+#line 2862 "src/ast/lex_conf.cc"
yy605:
yych = (unsigned char)*++cur;
if (yych == 'R') goto yy644;
goto yy4;
yy607:
++cur;
-#line 157 "../src/ast/lex_conf.re"
+#line 158 "../src/ast/lex_conf.re"
{ opts.set_fill_arg (lex_conf_string ()); return; }
-#line 2874 "src/ast/lex_conf.cc"
+#line 2875 "src/ast/lex_conf.cc"
yy609:
yych = (unsigned char)*++cur;
if (yych == 'T') goto yy647;
}
}
yy611:
-#line 90 "../src/ast/lex_conf.re"
+#line 91 "../src/ast/lex_conf.re"
{ opts.set_state_get (lex_conf_string ()); return; }
-#line 2900 "src/ast/lex_conf.cc"
+#line 2901 "src/ast/lex_conf.cc"
yy612:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 127 "../src/ast/lex_conf.re"
+#line 128 "../src/ast/lex_conf.re"
{ opts.set_yylessthan (lex_conf_string ()); return; }
-#line 2908 "src/ast/lex_conf.cc"
+#line 2909 "src/ast/lex_conf.cc"
yy614:
yych = (unsigned char)*++cur;
if (yych == 'T') goto yy649;
}
}
yy618:
-#line 92 "../src/ast/lex_conf.re"
+#line 93 "../src/ast/lex_conf.re"
{ opts.set_state_set (lex_conf_string ()); return; }
-#line 2943 "src/ast/lex_conf.cc"
+#line 2944 "src/ast/lex_conf.cc"
yy619:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 66 "../src/ast/lex_conf.re"
+#line 67 "../src/ast/lex_conf.re"
{ lex_conf_empty_class(opts); return; }
-#line 2977 "src/ast/lex_conf.cc"
+#line 2978 "src/ast/lex_conf.cc"
yy627:
yych = (unsigned char)*++cur;
if (yych == 'l') goto yy659;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 95 "../src/ast/lex_conf.re"
+#line 96 "../src/ast/lex_conf.re"
{ opts.set_yyfilllabel (lex_conf_string ()); return; }
-#line 3007 "src/ast/lex_conf.cc"
+#line 3008 "src/ast/lex_conf.cc"
yy634:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 99 "../src/ast/lex_conf.re"
+#line 100 "../src/ast/lex_conf.re"
{ opts.set_yyaccept (lex_conf_string ()); return; }
-#line 3015 "src/ast/lex_conf.cc"
+#line 3016 "src/ast/lex_conf.cc"
yy636:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 88 "../src/ast/lex_conf.re"
+#line 89 "../src/ast/lex_conf.re"
{ opts.set_yyctable (lex_conf_string ()); return; }
-#line 3023 "src/ast/lex_conf.cc"
+#line 3024 "src/ast/lex_conf.cc"
yy638:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 169 "../src/ast/lex_conf.re"
+#line 170 "../src/ast/lex_conf.re"
{ lex_conf_string (); return; }
-#line 3031 "src/ast/lex_conf.cc"
+#line 3032 "src/ast/lex_conf.cc"
yy640:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 113 "../src/ast/lex_conf.re"
+#line 114 "../src/ast/lex_conf.re"
{ opts.set_yytarget (lex_conf_string ()); return; }
-#line 3039 "src/ast/lex_conf.cc"
+#line 3040 "src/ast/lex_conf.cc"
yy642:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 123 "../src/ast/lex_conf.re"
+#line 124 "../src/ast/lex_conf.re"
{ opts.set_yybackupctx (lex_conf_string ()); return; }
-#line 3047 "src/ast/lex_conf.cc"
+#line 3048 "src/ast/lex_conf.cc"
yy644:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 117 "../src/ast/lex_conf.re"
+#line 118 "../src/ast/lex_conf.re"
{ opts.set_yyctxmarker (lex_conf_string ()); return; }
-#line 3055 "src/ast/lex_conf.cc"
+#line 3056 "src/ast/lex_conf.cc"
yy646:
yych = (unsigned char)*++cur;
if (yych == 'd') goto yy663;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 159 "../src/ast/lex_conf.re"
+#line 160 "../src/ast/lex_conf.re"
{ opts.set_fill_naked (lex_conf_bool()); return; }
-#line 3133 "src/ast/lex_conf.cc"
+#line 3134 "src/ast/lex_conf.cc"
yy665:
yych = (unsigned char)*++cur;
if (yych == 'O') goto yy684;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 125 "../src/ast/lex_conf.re"
+#line 126 "../src/ast/lex_conf.re"
{ opts.set_yyrestorectx (lex_conf_string ()); return; }
-#line 3149 "src/ast/lex_conf.cc"
+#line 3150 "src/ast/lex_conf.cc"
yy669:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 126 "../src/ast/lex_conf.re"
+#line 127 "../src/ast/lex_conf.re"
{ opts.set_yyrestoretag (lex_conf_string ()); return; }
-#line 3157 "src/ast/lex_conf.cc"
+#line 3158 "src/ast/lex_conf.cc"
yy671:
yych = (unsigned char)*++cur;
if (yych == 'O') goto yy686;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 51 "../src/ast/lex_conf.re"
+#line 52 "../src/ast/lex_conf.re"
{ opts.set_bCaseInverted (lex_conf_bool()); return; }
-#line 3181 "src/ast/lex_conf.cc"
+#line 3182 "src/ast/lex_conf.cc"
yy677:
yych = (unsigned char)*++cur;
if (yych == 's') goto yy106;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 53 "../src/ast/lex_conf.re"
+#line 54 "../src/ast/lex_conf.re"
{ opts.set_optimize_tags (lex_conf_bool()); return; }
-#line 3207 "src/ast/lex_conf.cc"
+#line 3208 "src/ast/lex_conf.cc"
yy683:
yych = (unsigned char)*++cur;
if (yych == 's') goto yy95;
}
}
yy693:
-#line 77 "../src/ast/lex_conf.re"
+#line 78 "../src/ast/lex_conf.re"
{ opts.set_cond_get (lex_conf_string ()); return; }
-#line 3265 "src/ast/lex_conf.cc"
+#line 3266 "src/ast/lex_conf.cc"
yy694:
yych = (unsigned char)*++cur;
if (yych == 'e') goto yy704;
}
}
yy696:
-#line 79 "../src/ast/lex_conf.re"
+#line 80 "../src/ast/lex_conf.re"
{ opts.set_cond_set (lex_conf_string ()); return; }
-#line 3292 "src/ast/lex_conf.cc"
+#line 3293 "src/ast/lex_conf.cc"
yy697:
yych = (unsigned char)*++cur;
if (yych == 'e') goto yy707;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 64 "../src/ast/lex_conf.re"
+#line 65 "../src/ast/lex_conf.re"
{ lex_conf_encoding_policy(opts); return; }
-#line 3316 "src/ast/lex_conf.cc"
+#line 3317 "src/ast/lex_conf.cc"
yy703:
yych = (unsigned char)*++cur;
if (yych == 'n') goto yy713;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 50 "../src/ast/lex_conf.re"
+#line 51 "../src/ast/lex_conf.re"
{ opts.set_bCaseInsensitive (lex_conf_bool()); return; }
-#line 3348 "src/ast/lex_conf.cc"
+#line 3349 "src/ast/lex_conf.cc"
yy711:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 67 "../src/ast/lex_conf.re"
+#line 68 "../src/ast/lex_conf.re"
{ lex_conf_dfa_minimization(opts); return; }
-#line 3356 "src/ast/lex_conf.cc"
+#line 3357 "src/ast/lex_conf.cc"
yy713:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy722;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 91 "../src/ast/lex_conf.re"
+#line 92 "../src/ast/lex_conf.re"
{ opts.set_state_get_naked (lex_conf_bool()); return; }
-#line 3368 "src/ast/lex_conf.cc"
+#line 3369 "src/ast/lex_conf.cc"
yy716:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy723;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 93 "../src/ast/lex_conf.re"
+#line 94 "../src/ast/lex_conf.re"
{ opts.set_state_set_naked (lex_conf_bool()); return; }
-#line 3384 "src/ast/lex_conf.cc"
+#line 3385 "src/ast/lex_conf.cc"
yy720:
++cur;
-#line 94 "../src/ast/lex_conf.re"
+#line 95 "../src/ast/lex_conf.re"
{ opts.set_state_set_arg (lex_conf_string ()); return; }
-#line 3389 "src/ast/lex_conf.cc"
+#line 3390 "src/ast/lex_conf.cc"
yy722:
yych = (unsigned char)*++cur;
if (yych == 'k') goto yy725;
goto yy4;
yy730:
++cur;
-#line 80 "../src/ast/lex_conf.re"
+#line 81 "../src/ast/lex_conf.re"
{ opts.set_cond_set_arg (lex_conf_string ()); return; }
-#line 3426 "src/ast/lex_conf.cc"
+#line 3427 "src/ast/lex_conf.cc"
yy732:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 78 "../src/ast/lex_conf.re"
+#line 79 "../src/ast/lex_conf.re"
{ opts.set_cond_get_naked (lex_conf_bool()); return; }
-#line 3434 "src/ast/lex_conf.cc"
+#line 3435 "src/ast/lex_conf.cc"
yy734:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 81 "../src/ast/lex_conf.re"
+#line 82 "../src/ast/lex_conf.re"
{ opts.set_cond_set_naked (lex_conf_bool()); return; }
-#line 3442 "src/ast/lex_conf.cc"
+#line 3443 "src/ast/lex_conf.cc"
}
-#line 175 "../src/ast/lex_conf.re"
+#line 176 "../src/ast/lex_conf.re"
}
{
lex_conf_assign ();
-#line 3452 "src/ast/lex_conf.cc"
+#line 3453 "src/ast/lex_conf.cc"
{
unsigned char yych;
if ((lim - cur) < 10) YYFILL(10);
}
++cur;
yy739:
-#line 182 "../src/ast/lex_conf.re"
+#line 183 "../src/ast/lex_conf.re"
{ fatal_lc(get_line(), get_column(),
"bad configuration value (expected: 'ignore', 'substitute', 'fail')"); }
-#line 3468 "src/ast/lex_conf.cc"
+#line 3469 "src/ast/lex_conf.cc"
yy740:
yych = (unsigned char)*(mar = ++cur);
if (yych == 'a') goto yy743;
goto yy744;
yy750:
++cur;
-#line 186 "../src/ast/lex_conf.re"
+#line 187 "../src/ast/lex_conf.re"
{ opts.set_encoding_policy(Enc::POLICY_FAIL); goto end; }
-#line 3511 "src/ast/lex_conf.cc"
+#line 3512 "src/ast/lex_conf.cc"
yy752:
yych = (unsigned char)*++cur;
if (yych == 'r') goto yy754;
goto yy744;
yy756:
++cur;
-#line 184 "../src/ast/lex_conf.re"
+#line 185 "../src/ast/lex_conf.re"
{ opts.set_encoding_policy(Enc::POLICY_IGNORE); goto end; }
-#line 3532 "src/ast/lex_conf.cc"
+#line 3533 "src/ast/lex_conf.cc"
yy758:
yych = (unsigned char)*++cur;
if (yych != 't') goto yy744;
yych = (unsigned char)*++cur;
if (yych != 'e') goto yy744;
++cur;
-#line 185 "../src/ast/lex_conf.re"
+#line 186 "../src/ast/lex_conf.re"
{ opts.set_encoding_policy(Enc::POLICY_SUBSTITUTE); goto end; }
-#line 3545 "src/ast/lex_conf.cc"
+#line 3546 "src/ast/lex_conf.cc"
}
-#line 187 "../src/ast/lex_conf.re"
+#line 188 "../src/ast/lex_conf.re"
end:
lex_conf_semicolon();
{
lex_conf_assign ();
-#line 3557 "src/ast/lex_conf.cc"
+#line 3558 "src/ast/lex_conf.cc"
{
unsigned char yych;
if ((lim - cur) < 7) YYFILL(7);
yy766:
++cur;
yy767:
-#line 196 "../src/ast/lex_conf.re"
+#line 197 "../src/ast/lex_conf.re"
{ fatal_lc(get_line(), get_column(),
"bad configuration value (expected: 'default', 'custom')"); }
-#line 3571 "src/ast/lex_conf.cc"
+#line 3572 "src/ast/lex_conf.cc"
yy768:
yych = (unsigned char)*(mar = ++cur);
if (yych == 'u') goto yy770;
goto yy771;
yy779:
++cur;
-#line 199 "../src/ast/lex_conf.re"
+#line 200 "../src/ast/lex_conf.re"
{ opts.set_input_api(INPUT_CUSTOM); goto end; }
-#line 3618 "src/ast/lex_conf.cc"
+#line 3619 "src/ast/lex_conf.cc"
yy781:
yych = (unsigned char)*++cur;
if (yych != 't') goto yy771;
++cur;
-#line 198 "../src/ast/lex_conf.re"
+#line 199 "../src/ast/lex_conf.re"
{ opts.set_input_api(INPUT_DEFAULT); goto end; }
-#line 3625 "src/ast/lex_conf.cc"
+#line 3626 "src/ast/lex_conf.cc"
}
-#line 200 "../src/ast/lex_conf.re"
+#line 201 "../src/ast/lex_conf.re"
end:
lex_conf_semicolon();
{
lex_conf_assign ();
-#line 3637 "src/ast/lex_conf.cc"
+#line 3638 "src/ast/lex_conf.cc"
{
unsigned char yych;
if ((lim - cur) < 11) YYFILL(11);
if (yych == 'm') goto yy789;
++cur;
yy787:
-#line 209 "../src/ast/lex_conf.re"
+#line 210 "../src/ast/lex_conf.re"
{ fatal_lc(get_line(), get_column(),
"bad configuration value (expected: 'match-empty', 'match-none', 'error')"); }
-#line 3649 "src/ast/lex_conf.cc"
+#line 3650 "src/ast/lex_conf.cc"
yy788:
yych = (unsigned char)*(mar = ++cur);
if (yych == 'r') goto yy790;
goto yy791;
yy797:
++cur;
-#line 213 "../src/ast/lex_conf.re"
+#line 214 "../src/ast/lex_conf.re"
{ opts.set_empty_class_policy(EMPTY_CLASS_ERROR); goto end; }
-#line 3688 "src/ast/lex_conf.cc"
+#line 3689 "src/ast/lex_conf.cc"
yy799:
yych = (unsigned char)*++cur;
if (yych != '-') goto yy791;
goto yy791;
yy808:
++cur;
-#line 212 "../src/ast/lex_conf.re"
+#line 213 "../src/ast/lex_conf.re"
{ opts.set_empty_class_policy(EMPTY_CLASS_MATCH_NONE); goto end; }
-#line 3728 "src/ast/lex_conf.cc"
+#line 3729 "src/ast/lex_conf.cc"
yy810:
++cur;
-#line 211 "../src/ast/lex_conf.re"
+#line 212 "../src/ast/lex_conf.re"
{ opts.set_empty_class_policy(EMPTY_CLASS_MATCH_EMPTY); goto end; }
-#line 3733 "src/ast/lex_conf.cc"
+#line 3734 "src/ast/lex_conf.cc"
}
-#line 214 "../src/ast/lex_conf.re"
+#line 215 "../src/ast/lex_conf.re"
end:
lex_conf_semicolon();
{
lex_conf_assign ();
-#line 3745 "src/ast/lex_conf.cc"
+#line 3746 "src/ast/lex_conf.cc"
{
unsigned char yych;
if ((lim - cur) < 5) YYFILL(5);
if (yych == 't') goto yy817;
++cur;
yy815:
-#line 223 "../src/ast/lex_conf.re"
+#line 224 "../src/ast/lex_conf.re"
{ fatal_lc(get_line(), get_column(),
"bad configuration value (expected: 'table', 'moore')"); }
-#line 3757 "src/ast/lex_conf.cc"
+#line 3758 "src/ast/lex_conf.cc"
yy816:
yych = (unsigned char)*(mar = ++cur);
if (yych == 'o') goto yy818;
goto yy819;
yy825:
++cur;
-#line 226 "../src/ast/lex_conf.re"
+#line 227 "../src/ast/lex_conf.re"
{ opts.set_dfa_minimization(DFA_MINIMIZATION_MOORE); goto end; }
-#line 3796 "src/ast/lex_conf.cc"
+#line 3797 "src/ast/lex_conf.cc"
yy827:
++cur;
-#line 225 "../src/ast/lex_conf.re"
+#line 226 "../src/ast/lex_conf.re"
{ opts.set_dfa_minimization(DFA_MINIMIZATION_TABLE); goto end; }
-#line 3801 "src/ast/lex_conf.cc"
+#line 3802 "src/ast/lex_conf.cc"
}
-#line 227 "../src/ast/lex_conf.re"
+#line 228 "../src/ast/lex_conf.re"
end:
lex_conf_semicolon();
void Scanner::lex_conf_assign ()
{
-#line 3821 "src/ast/lex_conf.cc"
+#line 3822 "src/ast/lex_conf.cc"
{
unsigned char yych;
static const unsigned char yybm[] = {
}
++cur;
yy832:
-#line 244 "../src/ast/lex_conf.re"
+#line 245 "../src/ast/lex_conf.re"
{ fatal_lc(get_line(), get_column(), "missing '=' in configuration"); }
-#line 3870 "src/ast/lex_conf.cc"
+#line 3871 "src/ast/lex_conf.cc"
yy833:
yych = (unsigned char)*(mar = ++cur);
if (yych <= 0x1F) {
if (yybm[0+yych] & 128) {
goto yy834;
}
-#line 245 "../src/ast/lex_conf.re"
+#line 246 "../src/ast/lex_conf.re"
{ return; }
-#line 3889 "src/ast/lex_conf.cc"
+#line 3890 "src/ast/lex_conf.cc"
yy837:
++cur;
if (lim <= cur) YYFILL(1);
cur = mar;
goto yy832;
}
-#line 246 "../src/ast/lex_conf.re"
+#line 247 "../src/ast/lex_conf.re"
}
void Scanner::lex_conf_semicolon ()
{
-#line 3910 "src/ast/lex_conf.cc"
+#line 3911 "src/ast/lex_conf.cc"
{
unsigned char yych;
static const unsigned char yybm[] = {
}
++cur;
yy843:
-#line 252 "../src/ast/lex_conf.re"
+#line 253 "../src/ast/lex_conf.re"
{ fatal_lc(get_line(), get_column(), "missing ending ';' in configuration"); }
-#line 3959 "src/ast/lex_conf.cc"
+#line 3960 "src/ast/lex_conf.cc"
yy844:
yych = (unsigned char)*(mar = ++cur);
if (yybm[0+yych] & 128) {
if (yych != ';') goto yy843;
yy845:
++cur;
-#line 253 "../src/ast/lex_conf.re"
+#line 254 "../src/ast/lex_conf.re"
{ return; }
-#line 3970 "src/ast/lex_conf.cc"
+#line 3971 "src/ast/lex_conf.cc"
yy847:
++cur;
if (lim <= cur) YYFILL(1);
cur = mar;
goto yy843;
}
-#line 254 "../src/ast/lex_conf.re"
+#line 255 "../src/ast/lex_conf.re"
}
lex_conf_assign ();
tok = cur;
-#line 3996 "src/ast/lex_conf.cc"
+#line 3997 "src/ast/lex_conf.cc"
{
unsigned char yych;
static const unsigned char yybm[] = {
}
++cur;
yy853:
-#line 267 "../src/ast/lex_conf.re"
+#line 268 "../src/ast/lex_conf.re"
{ fatal_lc(get_line(), get_column(),
"bad configuration value (expected number)"); }
-#line 4046 "src/ast/lex_conf.cc"
+#line 4047 "src/ast/lex_conf.cc"
yy854:
yych = (unsigned char)*++cur;
if (yych <= '0') goto yy853;
yy855:
++cur;
yy856:
-#line 269 "../src/ast/lex_conf.re"
+#line 270 "../src/ast/lex_conf.re"
{
int32_t n = 0;
if (!s_to_i32_unsafe (tok, cur, n)) {
lex_conf_semicolon ();
return n;
}
-#line 4064 "src/ast/lex_conf.cc"
+#line 4065 "src/ast/lex_conf.cc"
yy857:
++cur;
if (lim <= cur) YYFILL(1);
}
goto yy856;
}
-#line 277 "../src/ast/lex_conf.re"
+#line 278 "../src/ast/lex_conf.re"
}
std::string s;
tok = cur;
-#line 4084 "src/ast/lex_conf.cc"
+#line 4085 "src/ast/lex_conf.cc"
{
unsigned char yych;
static const unsigned char yybm[] = {
}
}
yy861:
-#line 305 "../src/ast/lex_conf.re"
+#line 306 "../src/ast/lex_conf.re"
{ goto end; }
-#line 4142 "src/ast/lex_conf.cc"
+#line 4143 "src/ast/lex_conf.cc"
yy862:
++cur;
if (lim <= cur) YYFILL(1);
if (yybm[0+yych] & 128) {
goto yy862;
}
-#line 301 "../src/ast/lex_conf.re"
+#line 302 "../src/ast/lex_conf.re"
{
- s = std::string(tok, tok_len());
+ s = getstr(tok, cur);
goto end;
}
-#line 4155 "src/ast/lex_conf.cc"
+#line 4156 "src/ast/lex_conf.cc"
yy865:
++cur;
-#line 286 "../src/ast/lex_conf.re"
+#line 287 "../src/ast/lex_conf.re"
{
const char quote = tok[0];
for (bool end;;) {
}
}
}
-#line 4174 "src/ast/lex_conf.cc"
+#line 4175 "src/ast/lex_conf.cc"
}
-#line 306 "../src/ast/lex_conf.re"
+#line 307 "../src/ast/lex_conf.re"
end:
lex_conf_semicolon ();
-/* Generated by re2c 1.1.1 on Sun Dec 30 10:30:10 2018 */
+/* Generated by re2c 1.1.1 on Sun Dec 30 10:57:46 2018 */
#line 1 "../src/conf/parse_opts.re"
#include "src/code/input_api.h"
#include "src/conf/msg.h"
#include "src/conf/opt.h"
#include "src/re/empty_class_policy.h"
#include "src/re/encoding/enc.h"
+#include "src/util/string_utils.h"
namespace re2c
{
char *YYCURSOR, *YYMARKER, *p;
Warn::option_t option;
-#line 28 "../src/conf/parse_opts.re"
+#line 29 "../src/conf/parse_opts.re"
opt:
goto end;
}
-#line 34 "src/conf/parse_opts.cc"
+#line 35 "src/conf/parse_opts.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
goto yy4;
yy2:
++YYCURSOR;
-#line 37 "../src/conf/parse_opts.re"
+#line 38 "../src/conf/parse_opts.re"
{
error ("bad option: %s", *argv);
return EXIT_FAIL;
}
-#line 83 "src/conf/parse_opts.cc"
+#line 84 "src/conf/parse_opts.cc"
yy4:
yych = (YYCTYPE)*++YYCURSOR;
if (yybm[0+yych] & 128) {
} else {
if (yych == 'W') goto yy14;
}
-#line 60 "../src/conf/parse_opts.re"
+#line 61 "../src/conf/parse_opts.re"
{ goto opt_short; }
-#line 100 "src/conf/parse_opts.cc"
+#line 101 "src/conf/parse_opts.cc"
yy8:
++YYCURSOR;
-#line 58 "../src/conf/parse_opts.re"
+#line 59 "../src/conf/parse_opts.re"
{ if (!opts.source (*argv)) return EXIT_FAIL; goto opt; }
-#line 105 "src/conf/parse_opts.cc"
+#line 106 "src/conf/parse_opts.cc"
yy10:
++YYCURSOR;
-#line 57 "../src/conf/parse_opts.re"
+#line 58 "../src/conf/parse_opts.re"
{ if (!opts.source ("<stdin>")) return EXIT_FAIL; goto opt; }
-#line 110 "src/conf/parse_opts.cc"
+#line 111 "src/conf/parse_opts.cc"
yy12:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy16;
-#line 61 "../src/conf/parse_opts.re"
+#line 62 "../src/conf/parse_opts.re"
{ goto opt_long; }
-#line 116 "src/conf/parse_opts.cc"
+#line 117 "src/conf/parse_opts.cc"
yy14:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == 'n') goto yy22;
}
yy15:
-#line 65 "../src/conf/parse_opts.re"
+#line 66 "../src/conf/parse_opts.re"
{ option = Warn::W; goto opt_warn; }
-#line 129 "src/conf/parse_opts.cc"
+#line 130 "src/conf/parse_opts.cc"
yy16:
++YYCURSOR;
-#line 43 "../src/conf/parse_opts.re"
+#line 44 "../src/conf/parse_opts.re"
{
// all remaining arguments are non-options
// so they must be input files
}
goto end;
}
-#line 146 "src/conf/parse_opts.cc"
+#line 147 "src/conf/parse_opts.cc"
yy18:
++YYCURSOR;
-#line 63 "../src/conf/parse_opts.re"
+#line 64 "../src/conf/parse_opts.re"
{ warn.set_all (); goto opt; }
-#line 151 "src/conf/parse_opts.cc"
+#line 152 "src/conf/parse_opts.cc"
yy20:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy23;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == 'e') goto yy29;
yy27:
-#line 66 "../src/conf/parse_opts.re"
+#line 67 "../src/conf/parse_opts.re"
{ option = Warn::WNO; goto opt_warn; }
-#line 185 "src/conf/parse_opts.cc"
+#line 186 "src/conf/parse_opts.cc"
yy28:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy30;
goto yy21;
yy32:
++YYCURSOR;
-#line 64 "../src/conf/parse_opts.re"
+#line 65 "../src/conf/parse_opts.re"
{ warn.set_all_error (); goto opt; }
-#line 207 "src/conf/parse_opts.cc"
+#line 208 "src/conf/parse_opts.cc"
yy34:
++YYCURSOR;
-#line 67 "../src/conf/parse_opts.re"
+#line 68 "../src/conf/parse_opts.re"
{ option = Warn::WERROR; goto opt_warn; }
-#line 212 "src/conf/parse_opts.cc"
+#line 213 "src/conf/parse_opts.cc"
yy36:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'o') goto yy21;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != '-') goto yy21;
++YYCURSOR;
-#line 68 "../src/conf/parse_opts.re"
+#line 69 "../src/conf/parse_opts.re"
{ option = Warn::WNOERROR; goto opt_warn; }
-#line 223 "src/conf/parse_opts.cc"
+#line 224 "src/conf/parse_opts.cc"
}
-#line 69 "../src/conf/parse_opts.re"
+#line 70 "../src/conf/parse_opts.re"
opt_warn:
-#line 230 "src/conf/parse_opts.cc"
+#line 231 "src/conf/parse_opts.cc"
{
YYCTYPE yych;
yych = (YYCTYPE)*YYCURSOR;
yy43:
++YYCURSOR;
yy44:
-#line 74 "../src/conf/parse_opts.re"
+#line 75 "../src/conf/parse_opts.re"
{
error ("bad warning: %s", *argv);
return EXIT_FAIL;
}
-#line 251 "src/conf/parse_opts.cc"
+#line 252 "src/conf/parse_opts.cc"
yy45:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == 'o') goto yy51;
goto yy52;
yy151:
++YYCURSOR;
-#line 82 "../src/conf/parse_opts.re"
+#line 83 "../src/conf/parse_opts.re"
{ warn.set (Warn::SWAPPED_RANGE, option); goto opt; }
-#line 680 "src/conf/parse_opts.cc"
+#line 681 "src/conf/parse_opts.cc"
yy153:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy160;
goto yy52;
yy162:
++YYCURSOR;
-#line 85 "../src/conf/parse_opts.re"
+#line 86 "../src/conf/parse_opts.re"
{ warn.set (Warn::USELESS_ESCAPE, option); goto opt; }
-#line 721 "src/conf/parse_opts.cc"
+#line 722 "src/conf/parse_opts.cc"
yy164:
++YYCURSOR;
-#line 78 "../src/conf/parse_opts.re"
+#line 79 "../src/conf/parse_opts.re"
{ warn.set (Warn::CONDITION_ORDER, option); goto opt; }
-#line 726 "src/conf/parse_opts.cc"
+#line 727 "src/conf/parse_opts.cc"
yy166:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'c') goto yy171;
goto yy52;
yy180:
++YYCURSOR;
-#line 84 "../src/conf/parse_opts.re"
+#line 85 "../src/conf/parse_opts.re"
{ warn.set (Warn::UNREACHABLE_RULES, option); goto opt; }
-#line 787 "src/conf/parse_opts.cc"
+#line 788 "src/conf/parse_opts.cc"
yy182:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 's') goto yy187;
goto yy52;
yy183:
++YYCURSOR;
-#line 80 "../src/conf/parse_opts.re"
+#line 81 "../src/conf/parse_opts.re"
{ warn.set (Warn::MATCH_EMPTY_STRING, option); goto opt; }
-#line 796 "src/conf/parse_opts.cc"
+#line 797 "src/conf/parse_opts.cc"
yy185:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'g') goto yy188;
goto yy52;
yy193:
++YYCURSOR;
-#line 79 "../src/conf/parse_opts.re"
+#line 80 "../src/conf/parse_opts.re"
{ warn.set (Warn::EMPTY_CHARACTER_CLASS, option); goto opt; }
-#line 833 "src/conf/parse_opts.cc"
+#line 834 "src/conf/parse_opts.cc"
yy195:
++YYCURSOR;
-#line 81 "../src/conf/parse_opts.re"
+#line 82 "../src/conf/parse_opts.re"
{ warn.set (Warn::NONDETERMINISTIC_TAGS, option); goto opt; }
-#line 838 "src/conf/parse_opts.cc"
+#line 839 "src/conf/parse_opts.cc"
yy197:
yych = (YYCTYPE)*++YYCURSOR;
if (yych >= 0x01) goto yy52;
++YYCURSOR;
-#line 83 "../src/conf/parse_opts.re"
+#line 84 "../src/conf/parse_opts.re"
{ warn.set (Warn::UNDEFINED_CONTROL_FLOW, option); goto opt; }
-#line 845 "src/conf/parse_opts.cc"
+#line 846 "src/conf/parse_opts.cc"
}
-#line 86 "../src/conf/parse_opts.re"
+#line 87 "../src/conf/parse_opts.re"
opt_short:
-#line 852 "src/conf/parse_opts.cc"
+#line 853 "src/conf/parse_opts.cc"
{
YYCTYPE yych;
yych = (YYCTYPE)*YYCURSOR;
}
}
++YYCURSOR;
-#line 95 "../src/conf/parse_opts.re"
+#line 96 "../src/conf/parse_opts.re"
{ goto opt; }
-#line 942 "src/conf/parse_opts.cc"
+#line 943 "src/conf/parse_opts.cc"
yy204:
++YYCURSOR;
-#line 91 "../src/conf/parse_opts.re"
+#line 92 "../src/conf/parse_opts.re"
{
error ("bad short option: %s", *argv);
return EXIT_FAIL;
}
-#line 950 "src/conf/parse_opts.cc"
+#line 951 "src/conf/parse_opts.cc"
yy206:
++YYCURSOR;
-#line 126 "../src/conf/parse_opts.re"
+#line 127 "../src/conf/parse_opts.re"
{ goto opt_short; }
-#line 955 "src/conf/parse_opts.cc"
+#line 956 "src/conf/parse_opts.cc"
yy208:
++YYCURSOR;
-#line 121 "../src/conf/parse_opts.re"
+#line 122 "../src/conf/parse_opts.re"
{ opts.set_encoding(Enc::UTF8); goto opt_short; }
-#line 960 "src/conf/parse_opts.cc"
+#line 961 "src/conf/parse_opts.cc"
yy210:
++YYCURSOR;
-#line 96 "../src/conf/parse_opts.re"
+#line 97 "../src/conf/parse_opts.re"
{ usage (); return EXIT_OK; }
-#line 965 "src/conf/parse_opts.cc"
+#line 966 "src/conf/parse_opts.cc"
yy212:
++YYCURSOR;
-#line 101 "../src/conf/parse_opts.re"
+#line 102 "../src/conf/parse_opts.re"
{ globopts.target = TARGET_DOT; goto opt_short; }
-#line 970 "src/conf/parse_opts.cc"
+#line 971 "src/conf/parse_opts.cc"
yy214:
++YYCURSOR;
-#line 103 "../src/conf/parse_opts.re"
+#line 104 "../src/conf/parse_opts.re"
{ globopts.FFlag = true; goto opt_short; }
-#line 975 "src/conf/parse_opts.cc"
+#line 976 "src/conf/parse_opts.cc"
yy216:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy256;
-#line 108 "../src/conf/parse_opts.re"
+#line 109 "../src/conf/parse_opts.re"
{ goto opt_incpath; }
-#line 981 "src/conf/parse_opts.cc"
+#line 982 "src/conf/parse_opts.cc"
yy218:
++YYCURSOR;
-#line 116 "../src/conf/parse_opts.re"
+#line 117 "../src/conf/parse_opts.re"
{ opts.set_posix_captures(true); goto opt_short; }
-#line 986 "src/conf/parse_opts.cc"
+#line 987 "src/conf/parse_opts.cc"
yy220:
++YYCURSOR;
-#line 105 "../src/conf/parse_opts.re"
+#line 106 "../src/conf/parse_opts.re"
{ globopts.target = TARGET_SKELETON; goto opt_short; }
-#line 991 "src/conf/parse_opts.cc"
+#line 992 "src/conf/parse_opts.cc"
yy222:
++YYCURSOR;
-#line 115 "../src/conf/parse_opts.re"
+#line 116 "../src/conf/parse_opts.re"
{ opts.set_tags(true); goto opt_short; }
-#line 996 "src/conf/parse_opts.cc"
+#line 997 "src/conf/parse_opts.cc"
yy224:
++YYCURSOR;
-#line 98 "../src/conf/parse_opts.re"
+#line 99 "../src/conf/parse_opts.re"
{ vernum (); return EXIT_OK; }
-#line 1001 "src/conf/parse_opts.cc"
+#line 1002 "src/conf/parse_opts.cc"
yy226:
++YYCURSOR;
-#line 110 "../src/conf/parse_opts.re"
+#line 111 "../src/conf/parse_opts.re"
{ opts.set_bFlag(true); goto opt_short; }
-#line 1006 "src/conf/parse_opts.cc"
+#line 1007 "src/conf/parse_opts.cc"
yy228:
++YYCURSOR;
-#line 100 "../src/conf/parse_opts.re"
+#line 101 "../src/conf/parse_opts.re"
{ globopts.cFlag = true; goto opt_short; }
-#line 1011 "src/conf/parse_opts.cc"
+#line 1012 "src/conf/parse_opts.cc"
yy230:
++YYCURSOR;
-#line 111 "../src/conf/parse_opts.re"
+#line 112 "../src/conf/parse_opts.re"
{ opts.set_dFlag(true); goto opt_short; }
-#line 1016 "src/conf/parse_opts.cc"
+#line 1017 "src/conf/parse_opts.cc"
yy232:
++YYCURSOR;
-#line 117 "../src/conf/parse_opts.re"
+#line 118 "../src/conf/parse_opts.re"
{ opts.set_encoding(Enc::EBCDIC); goto opt_short; }
-#line 1021 "src/conf/parse_opts.cc"
+#line 1022 "src/conf/parse_opts.cc"
yy234:
++YYCURSOR;
-#line 102 "../src/conf/parse_opts.re"
+#line 103 "../src/conf/parse_opts.re"
{ globopts.fFlag = true; goto opt_short; }
-#line 1026 "src/conf/parse_opts.cc"
+#line 1027 "src/conf/parse_opts.cc"
yy236:
++YYCURSOR;
-#line 112 "../src/conf/parse_opts.re"
+#line 113 "../src/conf/parse_opts.re"
{ opts.set_gFlag(true); goto opt_short; }
-#line 1031 "src/conf/parse_opts.cc"
+#line 1032 "src/conf/parse_opts.cc"
yy238:
++YYCURSOR;
-#line 113 "../src/conf/parse_opts.re"
+#line 114 "../src/conf/parse_opts.re"
{ opts.set_iFlag(true); goto opt_short; }
-#line 1036 "src/conf/parse_opts.cc"
+#line 1037 "src/conf/parse_opts.cc"
yy240:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy258;
-#line 123 "../src/conf/parse_opts.re"
+#line 124 "../src/conf/parse_opts.re"
{ *argv = YYCURSOR; goto opt_output; }
-#line 1042 "src/conf/parse_opts.cc"
+#line 1043 "src/conf/parse_opts.cc"
yy242:
++YYCURSOR;
-#line 104 "../src/conf/parse_opts.re"
+#line 105 "../src/conf/parse_opts.re"
{ globopts.rFlag = true; goto opt_short; }
-#line 1047 "src/conf/parse_opts.cc"
+#line 1048 "src/conf/parse_opts.cc"
yy244:
++YYCURSOR;
-#line 114 "../src/conf/parse_opts.re"
+#line 115 "../src/conf/parse_opts.re"
{ opts.set_sFlag(true); goto opt_short; }
-#line 1052 "src/conf/parse_opts.cc"
+#line 1053 "src/conf/parse_opts.cc"
yy246:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy260;
-#line 125 "../src/conf/parse_opts.re"
+#line 126 "../src/conf/parse_opts.re"
{ *argv = YYCURSOR; goto opt_header; }
-#line 1058 "src/conf/parse_opts.cc"
+#line 1059 "src/conf/parse_opts.cc"
yy248:
++YYCURSOR;
-#line 118 "../src/conf/parse_opts.re"
+#line 119 "../src/conf/parse_opts.re"
{ opts.set_encoding(Enc::UTF32); goto opt_short; }
-#line 1063 "src/conf/parse_opts.cc"
+#line 1064 "src/conf/parse_opts.cc"
yy250:
++YYCURSOR;
-#line 97 "../src/conf/parse_opts.re"
+#line 98 "../src/conf/parse_opts.re"
{ version (); return EXIT_OK; }
-#line 1068 "src/conf/parse_opts.cc"
+#line 1069 "src/conf/parse_opts.cc"
yy252:
++YYCURSOR;
-#line 119 "../src/conf/parse_opts.re"
+#line 120 "../src/conf/parse_opts.re"
{ opts.set_encoding(Enc::UCS2); goto opt_short; }
-#line 1073 "src/conf/parse_opts.cc"
+#line 1074 "src/conf/parse_opts.cc"
yy254:
++YYCURSOR;
-#line 120 "../src/conf/parse_opts.re"
+#line 121 "../src/conf/parse_opts.re"
{ opts.set_encoding(Enc::UTF16); goto opt_short; }
-#line 1078 "src/conf/parse_opts.cc"
+#line 1079 "src/conf/parse_opts.cc"
yy256:
++YYCURSOR;
-#line 107 "../src/conf/parse_opts.re"
+#line 108 "../src/conf/parse_opts.re"
{ if (!next (YYCURSOR, argv)) { error_arg ("-I"); return EXIT_FAIL; } goto opt_incpath; }
-#line 1083 "src/conf/parse_opts.cc"
+#line 1084 "src/conf/parse_opts.cc"
yy258:
++YYCURSOR;
-#line 122 "../src/conf/parse_opts.re"
+#line 123 "../src/conf/parse_opts.re"
{ if (!next (YYCURSOR, argv)) { error_arg ("-o, --output"); return EXIT_FAIL; } goto opt_output; }
-#line 1088 "src/conf/parse_opts.cc"
+#line 1089 "src/conf/parse_opts.cc"
yy260:
++YYCURSOR;
-#line 124 "../src/conf/parse_opts.re"
+#line 125 "../src/conf/parse_opts.re"
{ if (!next (YYCURSOR, argv)) { error_arg ("-t, --type-header"); return EXIT_FAIL; } goto opt_header; }
-#line 1093 "src/conf/parse_opts.cc"
+#line 1094 "src/conf/parse_opts.cc"
}
-#line 127 "../src/conf/parse_opts.re"
+#line 128 "../src/conf/parse_opts.re"
opt_long:
-#line 1100 "src/conf/parse_opts.cc"
+#line 1101 "src/conf/parse_opts.cc"
{
YYCTYPE yych;
yych = (YYCTYPE)*YYCURSOR;
yy264:
++YYCURSOR;
yy265:
-#line 132 "../src/conf/parse_opts.re"
+#line 133 "../src/conf/parse_opts.re"
{
error ("bad long option: %s", *argv);
return EXIT_FAIL;
}
-#line 1131 "src/conf/parse_opts.cc"
+#line 1132 "src/conf/parse_opts.cc"
yy266:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == 'i') goto yy282;
goto yy283;
yy348:
++YYCURSOR;
-#line 161 "../src/conf/parse_opts.re"
+#line 162 "../src/conf/parse_opts.re"
{ opts.set_encoding(Enc::EBCDIC); goto opt; }
-#line 1497 "src/conf/parse_opts.cc"
+#line 1498 "src/conf/parse_opts.cc"
yy350:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '-') goto yy384;
goto yy283;
yy388:
++YYCURSOR;
-#line 136 "../src/conf/parse_opts.re"
+#line 137 "../src/conf/parse_opts.re"
{ usage (); return EXIT_OK; }
-#line 1661 "src/conf/parse_opts.cc"
+#line 1662 "src/conf/parse_opts.cc"
yy390:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy427;
goto yy283;
yy404:
++YYCURSOR;
-#line 156 "../src/conf/parse_opts.re"
+#line 157 "../src/conf/parse_opts.re"
{ opts.set_tags (true); goto opt; }
-#line 1722 "src/conf/parse_opts.cc"
+#line 1723 "src/conf/parse_opts.cc"
yy406:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'h') goto yy442;
goto yy283;
yy427:
++YYCURSOR;
-#line 169 "../src/conf/parse_opts.re"
+#line 170 "../src/conf/parse_opts.re"
{ goto opt_input; }
-#line 1811 "src/conf/parse_opts.cc"
+#line 1812 "src/conf/parse_opts.cc"
yy429:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '-') goto yy464;
goto yy283;
yy445:
++YYCURSOR;
-#line 165 "../src/conf/parse_opts.re"
+#line 166 "../src/conf/parse_opts.re"
{ opts.set_encoding(Enc::UTF8); goto opt; }
-#line 1880 "src/conf/parse_opts.cc"
+#line 1881 "src/conf/parse_opts.cc"
yy447:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy482;
goto yy283;
yy470:
++YYCURSOR;
-#line 166 "../src/conf/parse_opts.re"
+#line 167 "../src/conf/parse_opts.re"
{ if (!next (YYCURSOR, argv)) { error_arg ("-o, --output"); return EXIT_FAIL; } goto opt_output; }
-#line 1978 "src/conf/parse_opts.cc"
+#line 1979 "src/conf/parse_opts.cc"
yy472:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'a') goto yy507;
goto yy283;
yy480:
++YYCURSOR;
-#line 164 "../src/conf/parse_opts.re"
+#line 165 "../src/conf/parse_opts.re"
{ opts.set_encoding(Enc::UTF16); goto opt; }
-#line 2015 "src/conf/parse_opts.cc"
+#line 2016 "src/conf/parse_opts.cc"
yy482:
++YYCURSOR;
-#line 138 "../src/conf/parse_opts.re"
+#line 139 "../src/conf/parse_opts.re"
{ vernum (); return EXIT_OK; }
-#line 2020 "src/conf/parse_opts.cc"
+#line 2021 "src/conf/parse_opts.cc"
yy484:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy516;
goto yy283;
yy514:
++YYCURSOR;
-#line 162 "../src/conf/parse_opts.re"
+#line 163 "../src/conf/parse_opts.re"
{ opts.set_encoding(Enc::UTF32); goto opt; }
-#line 2145 "src/conf/parse_opts.cc"
+#line 2146 "src/conf/parse_opts.cc"
yy516:
++YYCURSOR;
-#line 137 "../src/conf/parse_opts.re"
+#line 138 "../src/conf/parse_opts.re"
{ version (); return EXIT_OK; }
-#line 2150 "src/conf/parse_opts.cc"
+#line 2151 "src/conf/parse_opts.cc"
yy518:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy550;
}
yy528:
++YYCURSOR;
-#line 174 "../src/conf/parse_opts.re"
+#line 175 "../src/conf/parse_opts.re"
{ globopts.dump_nfa = true; goto opt; }
-#line 2200 "src/conf/parse_opts.cc"
+#line 2201 "src/conf/parse_opts.cc"
yy530:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'p') goto yy564;
goto yy283;
yy531:
++YYCURSOR;
-#line 141 "../src/conf/parse_opts.re"
+#line 142 "../src/conf/parse_opts.re"
{ globopts.target = TARGET_DOT; goto opt; }
-#line 2209 "src/conf/parse_opts.cc"
+#line 2210 "src/conf/parse_opts.cc"
yy533:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 's') goto yy565;
goto yy283;
yy543:
++YYCURSOR;
-#line 144 "../src/conf/parse_opts.re"
+#line 145 "../src/conf/parse_opts.re"
{ globopts.rFlag = true; goto opt; }
-#line 2254 "src/conf/parse_opts.cc"
+#line 2255 "src/conf/parse_opts.cc"
yy545:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 's') goto yy575;
goto yy283;
yy546:
++YYCURSOR;
-#line 147 "../src/conf/parse_opts.re"
+#line 148 "../src/conf/parse_opts.re"
{ globopts.target = TARGET_SKELETON; goto opt; }
-#line 2263 "src/conf/parse_opts.cc"
+#line 2264 "src/conf/parse_opts.cc"
yy548:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 's') goto yy576;
goto yy283;
yy558:
++YYCURSOR;
-#line 179 "../src/conf/parse_opts.re"
+#line 180 "../src/conf/parse_opts.re"
{ globopts.dump_adfa = true; goto opt; }
-#line 2308 "src/conf/parse_opts.cc"
+#line 2309 "src/conf/parse_opts.cc"
yy560:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'e') goto yy587;
goto yy283;
yy583:
++YYCURSOR;
-#line 140 "../src/conf/parse_opts.re"
+#line 141 "../src/conf/parse_opts.re"
{ globopts.cFlag = true; goto opt; }
-#line 2405 "src/conf/parse_opts.cc"
+#line 2406 "src/conf/parse_opts.cc"
yy585:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 't') goto yy615;
goto yy283;
yy591:
++YYCURSOR;
-#line 160 "../src/conf/parse_opts.re"
+#line 161 "../src/conf/parse_opts.re"
{ opts.set_eager_skip(true); goto opt; }
-#line 2434 "src/conf/parse_opts.cc"
+#line 2435 "src/conf/parse_opts.cc"
yy593:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy621;
goto yy283;
yy596:
++YYCURSOR;
-#line 153 "../src/conf/parse_opts.re"
+#line 154 "../src/conf/parse_opts.re"
{ opts.set_sFlag (true); goto opt; }
-#line 2451 "src/conf/parse_opts.cc"
+#line 2452 "src/conf/parse_opts.cc"
yy598:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'f') goto yy626;
goto yy283;
yy602:
++YYCURSOR;
-#line 146 "../src/conf/parse_opts.re"
+#line 147 "../src/conf/parse_opts.re"
{ globopts.version = false; goto opt; }
-#line 2472 "src/conf/parse_opts.cc"
+#line 2473 "src/conf/parse_opts.cc"
yy604:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy630;
goto yy283;
yy608:
++YYCURSOR;
-#line 163 "../src/conf/parse_opts.re"
+#line 164 "../src/conf/parse_opts.re"
{ opts.set_encoding(Enc::UCS2); goto opt; }
-#line 2493 "src/conf/parse_opts.cc"
+#line 2494 "src/conf/parse_opts.cc"
yy610:
++YYCURSOR;
-#line 149 "../src/conf/parse_opts.re"
+#line 150 "../src/conf/parse_opts.re"
{ opts.set_bFlag (true); goto opt; }
-#line 2498 "src/conf/parse_opts.cc"
+#line 2499 "src/conf/parse_opts.cc"
yy612:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 't') goto yy636;
goto yy283;
yy621:
++YYCURSOR;
-#line 170 "../src/conf/parse_opts.re"
+#line 171 "../src/conf/parse_opts.re"
{ goto opt_empty_class; }
-#line 2539 "src/conf/parse_opts.cc"
+#line 2540 "src/conf/parse_opts.cc"
yy623:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'i') goto yy649;
goto yy283;
yy624:
++YYCURSOR;
-#line 143 "../src/conf/parse_opts.re"
+#line 144 "../src/conf/parse_opts.re"
{ globopts.FFlag = true; goto opt; }
-#line 2548 "src/conf/parse_opts.cc"
+#line 2549 "src/conf/parse_opts.cc"
yy626:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'o') goto yy650;
goto yy283;
yy631:
++YYCURSOR;
-#line 172 "../src/conf/parse_opts.re"
+#line 173 "../src/conf/parse_opts.re"
{ goto opt; }
-#line 2573 "src/conf/parse_opts.cc"
+#line 2574 "src/conf/parse_opts.cc"
yy633:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 't') goto yy656;
goto yy283;
yy634:
++YYCURSOR;
-#line 167 "../src/conf/parse_opts.re"
+#line 168 "../src/conf/parse_opts.re"
{ if (!next (YYCURSOR, argv)) { error_arg ("-t, --type-header"); return EXIT_FAIL; } goto opt_header; }
-#line 2582 "src/conf/parse_opts.cc"
+#line 2583 "src/conf/parse_opts.cc"
yy636:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'i') goto yy657;
goto yy283;
yy639:
++YYCURSOR;
-#line 150 "../src/conf/parse_opts.re"
+#line 151 "../src/conf/parse_opts.re"
{ opts.set_dFlag (true); goto opt; }
-#line 2599 "src/conf/parse_opts.cc"
+#line 2600 "src/conf/parse_opts.cc"
yy641:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'i') goto yy661;
goto yy283;
yy642:
++YYCURSOR;
-#line 176 "../src/conf/parse_opts.re"
+#line 177 "../src/conf/parse_opts.re"
{ globopts.dump_dfa_det = true; goto opt; }
-#line 2608 "src/conf/parse_opts.cc"
+#line 2609 "src/conf/parse_opts.cc"
yy644:
++YYCURSOR;
-#line 178 "../src/conf/parse_opts.re"
+#line 179 "../src/conf/parse_opts.re"
{ globopts.dump_dfa_min = true; goto opt; }
-#line 2613 "src/conf/parse_opts.cc"
+#line 2614 "src/conf/parse_opts.cc"
yy646:
++YYCURSOR;
-#line 175 "../src/conf/parse_opts.re"
+#line 176 "../src/conf/parse_opts.re"
{ globopts.dump_dfa_raw = true; goto opt; }
-#line 2618 "src/conf/parse_opts.cc"
+#line 2619 "src/conf/parse_opts.cc"
yy648:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'p') goto yy662;
goto yy283;
yy652:
++YYCURSOR;
-#line 158 "../src/conf/parse_opts.re"
+#line 159 "../src/conf/parse_opts.re"
{ opts.set_lookahead(false); goto opt; }
-#line 2639 "src/conf/parse_opts.cc"
+#line 2640 "src/conf/parse_opts.cc"
yy654:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'a') goto yy667;
goto yy283;
yy658:
++YYCURSOR;
-#line 155 "../src/conf/parse_opts.re"
+#line 156 "../src/conf/parse_opts.re"
{ opts.set_bCaseInverted (true); goto opt; }
-#line 2660 "src/conf/parse_opts.cc"
+#line 2661 "src/conf/parse_opts.cc"
yy660:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy671;
goto yy283;
yy664:
++YYCURSOR;
-#line 152 "../src/conf/parse_opts.re"
+#line 153 "../src/conf/parse_opts.re"
{ opts.set_iFlag (true); goto opt; }
-#line 2681 "src/conf/parse_opts.cc"
+#line 2682 "src/conf/parse_opts.cc"
yy666:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'd') goto yy676;
goto yy283;
yy671:
++YYCURSOR;
-#line 151 "../src/conf/parse_opts.re"
+#line 152 "../src/conf/parse_opts.re"
{ opts.set_gFlag (true); goto opt; }
-#line 2706 "src/conf/parse_opts.cc"
+#line 2707 "src/conf/parse_opts.cc"
yy673:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'n') goto yy683;
goto yy283;
yy678:
++YYCURSOR;
-#line 157 "../src/conf/parse_opts.re"
+#line 158 "../src/conf/parse_opts.re"
{ opts.set_posix_captures(true); goto opt; }
-#line 2731 "src/conf/parse_opts.cc"
+#line 2732 "src/conf/parse_opts.cc"
yy680:
++YYCURSOR;
-#line 142 "../src/conf/parse_opts.re"
+#line 143 "../src/conf/parse_opts.re"
{ globopts.fFlag = true; goto opt; }
-#line 2736 "src/conf/parse_opts.cc"
+#line 2737 "src/conf/parse_opts.cc"
yy682:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy690;
goto yy283;
yy684:
++YYCURSOR;
-#line 177 "../src/conf/parse_opts.re"
+#line 178 "../src/conf/parse_opts.re"
{ globopts.dump_dfa_tagopt = true; goto opt; }
-#line 2749 "src/conf/parse_opts.cc"
+#line 2750 "src/conf/parse_opts.cc"
yy686:
++YYCURSOR;
-#line 168 "../src/conf/parse_opts.re"
+#line 169 "../src/conf/parse_opts.re"
{ goto opt_encoding_policy; }
-#line 2754 "src/conf/parse_opts.cc"
+#line 2755 "src/conf/parse_opts.cc"
yy688:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 't') goto yy694;
goto yy283;
yy690:
++YYCURSOR;
-#line 154 "../src/conf/parse_opts.re"
+#line 155 "../src/conf/parse_opts.re"
{ opts.set_bCaseInsensitive (true); goto opt; }
-#line 2767 "src/conf/parse_opts.cc"
+#line 2768 "src/conf/parse_opts.cc"
yy692:
++YYCURSOR;
-#line 171 "../src/conf/parse_opts.re"
+#line 172 "../src/conf/parse_opts.re"
{ goto opt_dfa_minimization; }
-#line 2772 "src/conf/parse_opts.cc"
+#line 2773 "src/conf/parse_opts.cc"
yy694:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'e') goto yy697;
goto yy283;
yy695:
++YYCURSOR;
-#line 159 "../src/conf/parse_opts.re"
+#line 160 "../src/conf/parse_opts.re"
{ opts.set_optimize_tags(false); goto opt; }
-#line 2781 "src/conf/parse_opts.cc"
+#line 2782 "src/conf/parse_opts.cc"
yy697:
yych = (YYCTYPE)*++YYCURSOR;
if (yych >= 0x01) goto yy283;
++YYCURSOR;
-#line 145 "../src/conf/parse_opts.re"
+#line 146 "../src/conf/parse_opts.re"
{ globopts.bNoGenerationDate = true; goto opt; }
-#line 2788 "src/conf/parse_opts.cc"
+#line 2789 "src/conf/parse_opts.cc"
}
-#line 180 "../src/conf/parse_opts.re"
+#line 181 "../src/conf/parse_opts.re"
opt_output:
-#line 2795 "src/conf/parse_opts.cc"
+#line 2796 "src/conf/parse_opts.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
if (yych != '-') goto yy704;
yy702:
++YYCURSOR;
-#line 185 "../src/conf/parse_opts.re"
+#line 186 "../src/conf/parse_opts.re"
{
error ("bad argument to option -o, --output: %s", *argv);
return EXIT_FAIL;
}
-#line 2842 "src/conf/parse_opts.cc"
+#line 2843 "src/conf/parse_opts.cc"
yy704:
yych = (YYCTYPE)*++YYCURSOR;
if (yybm[0+yych] & 128) {
goto yy704;
}
++YYCURSOR;
-#line 189 "../src/conf/parse_opts.re"
+#line 190 "../src/conf/parse_opts.re"
{ opts.set_output_file (*argv); goto opt; }
-#line 2851 "src/conf/parse_opts.cc"
+#line 2852 "src/conf/parse_opts.cc"
}
-#line 190 "../src/conf/parse_opts.re"
+#line 191 "../src/conf/parse_opts.re"
opt_header:
-#line 2858 "src/conf/parse_opts.cc"
+#line 2859 "src/conf/parse_opts.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
if (yych != '-') goto yy712;
yy710:
++YYCURSOR;
-#line 195 "../src/conf/parse_opts.re"
+#line 196 "../src/conf/parse_opts.re"
{
error ("bad argument to option -t, --type-header: %s", *argv);
return EXIT_FAIL;
}
-#line 2905 "src/conf/parse_opts.cc"
+#line 2906 "src/conf/parse_opts.cc"
yy712:
yych = (YYCTYPE)*++YYCURSOR;
if (yybm[0+yych] & 128) {
goto yy712;
}
++YYCURSOR;
-#line 199 "../src/conf/parse_opts.re"
+#line 200 "../src/conf/parse_opts.re"
{ opts.set_header_file (*argv); goto opt; }
-#line 2914 "src/conf/parse_opts.cc"
+#line 2915 "src/conf/parse_opts.cc"
}
-#line 200 "../src/conf/parse_opts.re"
+#line 201 "../src/conf/parse_opts.re"
opt_incpath:
p = YYCURSOR;
-#line 2922 "src/conf/parse_opts.cc"
+#line 2923 "src/conf/parse_opts.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
if (yych != '-') goto yy720;
yy718:
++YYCURSOR;
-#line 205 "../src/conf/parse_opts.re"
+#line 206 "../src/conf/parse_opts.re"
{
error ("bad argument to option -I: %s", *argv);
return EXIT_FAIL;
}
-#line 2969 "src/conf/parse_opts.cc"
+#line 2970 "src/conf/parse_opts.cc"
yy720:
yych = (YYCTYPE)*++YYCURSOR;
if (yybm[0+yych] & 128) {
goto yy720;
}
++YYCURSOR;
-#line 209 "../src/conf/parse_opts.re"
+#line 210 "../src/conf/parse_opts.re"
{
- std::string name(p, static_cast<size_t>(YYCURSOR - p - 1));
- globopts.incpaths.push_back(name);
+ globopts.incpaths.push_back(getstr(p, YYCURSOR - 1));
goto opt;
}
#line 2982 "src/conf/parse_opts.cc"
"/*!include:re2c" space+ @x dstring @y space* eoc {
out.wraw(tok, ptr);
- include(std::string(x + 1, static_cast<size_t>(y - x) - 2));
+ include(getstr(x + 1, y - 1));
goto next;
}
":=" { lex_code_indented(); return TOKEN_CODE; }
":"? "=>" space* @p name {
- yylval.str = new std::string(p, static_cast<size_t>(cur - p));
+ yylval.str = newstr(p, cur);
return tok[0] == ':' ? TOKEN_CJUMP : TOKEN_CNEXT;
}
"[^" { yylval.regexp = lex_cls(true); return TOKEN_REGEXP; }
[@#] name {
- const std::string *name = new std::string(tok + 1, tok_len() - 1);
- yylval.regexp = ast_tag(get_line(), get_column(), name, tok[0] == '#');
+ yylval.regexp = ast_tag(get_line(), get_column()
+ , newstr(tok + 1, cur), tok[0] == '#');
return TOKEN_REGEXP;
}
fatal_lc(get_line(), get_column(),
"curly braces for names only allowed with -F switch");
}
- yylval.str = new std::string (tok + 1, tok_len () - 2); // -2 to omit braces
+ yylval.str = newstr(tok + 1, cur - 1);
return TOKEN_ID;
}
name {
if (!globopts->FFlag || lex_namedef_context_re2c()) {
- yylval.str = new std::string (tok, tok_len());
+ yylval.str = newstr(tok, cur);
return TOKEN_ID;
}
else if (lex_namedef_context_flex()) {
- yylval.str = new std::string (tok, tok_len());
+ yylval.str = newstr(tok, cur);
lexer_state = LEX_FLEX_NAME;
return TOKEN_FID;
}
cond:
tok = cur;
/*!re2c
- name { cl->insert(std::string(tok, tok_len())); goto next; }
+ name { cl->insert(getstr(tok, cur)); goto next; }
"*" { if (!cl->empty()) goto error; cl->insert("*"); goto next; }
* { goto error; }
*/
eol {
while (isspace(tok[0])) ++tok;
while (cur > tok && isspace(cur[-1])) --cur;
- yylval.code = new Code(get_fname (), line, tok, tok_len ());
+ yylval.code = new Code(get_fname (), line, getstr(tok, cur));
return;
}
/*!re2c
"}" {
if (--depth == 0) {
- yylval.code = new Code(get_fname (), line, tok, tok_len ());
+ yylval.code = new Code(get_fname (), line, getstr(tok, cur));
return;
}
goto code;
dstring {
std::string &name = get_input().escaped_name;
- name = std::string(tok + 1, tok_len () - 2); // strip quotes
+ name = getstr(tok + 1, cur - 1);
strrreplace(name, "\\", "\\\\");
goto sourceline;
}
#include "src/re/encoding/enc.h"
#include "src/ast/scanner.h"
#include "src/util/s_to_n32_unsafe.h"
+#include "src/util/string_utils.h"
namespace re2c
{
}
}
naked {
- s = std::string(tok, tok_len());
+ s = getstr(tok, cur);
goto end;
}
"" { goto end; }
const Input& get_cinput() const;
inline void set_line(uint32_t l);
inline void next_line();
- size_t tok_len() const;
void set_sourceline ();
void lex_end_of_comment(Output &out);
void lex_code_indented();
, warn(w)
{}
-inline size_t Scanner::tok_len() const
-{
- return static_cast<size_t>(cur - tok);
-}
-
inline const std::string & Scanner::get_fname() const
{
return get_cinput().escaped_name;
#include "src/conf/opt.h"
#include "src/re/empty_class_policy.h"
#include "src/re/encoding/enc.h"
+#include "src/util/string_utils.h"
namespace re2c
{
return EXIT_FAIL;
}
filename end {
- std::string name(p, static_cast<size_t>(YYCURSOR - p - 1));
- globopts.incpaths.push_back(name);
+ globopts.incpaths.push_back(getstr(p, YYCURSOR - 1));
goto opt;
}
*/
{
flist.insert(this);
}
- Code(const std::string &file, uint32_t line, const char *s, size_t slen)
+ Code(const std::string &file, uint32_t line, const std::string &t)
: fname(file)
, fline(line)
, autogen(false)
- , text(s, slen)
+ , text(t)
, cond("")
{
flist.insert(this);
return s.str();
}
+// Yet another constructor of std::string, useful when the strings
+// are constructed from fragments in buffer. A separate function is
+// needed mainly to avoid static_cast's everywhere.
+inline std::string getstr(const char *s, const char *e)
+{
+ return std::string(s, static_cast<size_t>(e - s));
+}
+inline std::string *newstr(const char *s, const char *e)
+{
+ return new std::string(s, static_cast<size_t>(e - s));
+}
+
} // namespace re2c
#endif // _RE2C_UTIL_STRING_UTILS_