src/codegen/label.h \
src/codegen/output.h \
src/codegen/print.h \
- src/options/msg.h \
src/options/opt.h \
src/options/ver_to_vernum.h \
src/options/warn.h \
src/encoding/utf16/utf16_regexp.h \
src/encoding/utf16/utf16.h \
src/msg/location.h \
+ src/msg/msg.h \
src/regexp/empty_class_policy.h \
src/regexp/re.h \
src/regexp/rule.h \
src/codegen/input_api.cc \
src/codegen/output.cc \
src/codegen/print.cc \
- src/options/msg.cc \
src/options/opt.cc \
src/options/warn.cc \
src/nfa/estimate_size.cc \
src/encoding/utf8/utf8.cc \
src/encoding/utf16/utf16_regexp.cc \
src/encoding/utf16/utf16.cc \
+ src/msg/msg.cc \
src/regexp/ast_to_re.cc \
src/regexp/default_tags.cc \
src/regexp/fixed_tags.cc \
src/codegen/label.h \
src/codegen/output.h \
src/codegen/print.h \
- src/options/msg.h \
src/options/opt.h \
src/options/ver_to_vernum.h \
src/options/warn.h \
src/encoding/utf16/utf16_regexp.h \
src/encoding/utf16/utf16.h \
src/msg/location.h \
+ src/msg/msg.h \
src/regexp/empty_class_policy.h \
src/regexp/re.h \
src/regexp/rule.h \
lib/regfree.cc \
lib/stubs.cc \
src/parse/ast.cc \
- src/options/msg.cc \
src/options/opt.cc \
src/options/warn.cc \
src/cfg/cfg.cc \
src/encoding/utf16/utf16_regexp.cc \
src/encoding/utf8/utf8.cc \
src/encoding/utf8/utf8_regexp.cc \
+ src/msg/msg.cc \
src/regexp/ast_to_re.cc \
src/regexp/default_tags.cc \
src/regexp/fixed_tags.cc \
-/* Generated by re2c 1.1.1 on Tue Feb 12 16:51:04 2019 */
+/* Generated by re2c 1.1.1 on Tue Feb 12 22:51:09 2019 */
#line 1 "../lib/lex.re"
#include <stdio.h>
#include "src/encoding/enc.h"
#include "src/parse/ast.h"
-#include "src/options/msg.h"
#include "src/util/range.h"
#include "src/util/s_to_n32_unsafe.h"
#include "parse.h"
static int32_t lex_cls_chr(const char *&, uint32_t &);
-#line 29 "../lib/lex.re"
+#line 28 "../lib/lex.re"
int lex(const char *&cur)
std::vector<ASTRange> cls;
bool neg = false;
uint32_t l, u;
- const loc_t nowhere(0, 0, "void");
-#line 36 "lib/lex.cc"
+#line 34 "lib/lex.cc"
{
char yych;
static const unsigned char yybm[] = {
}
yy2:
++cur;
-#line 43 "../lib/lex.re"
+#line 41 "../lib/lex.re"
{ return 0; }
-#line 104 "lib/lex.cc"
+#line 102 "lib/lex.cc"
yy4:
++cur;
yy5:
-#line 78 "../lib/lex.re"
+#line 76 "../lib/lex.re"
{
- ASTChar c(static_cast<uint32_t>(cur[-1]), nowhere);
+ ASTChar c = {static_cast<uint32_t>(cur[-1]), NOWHERE};
std::vector<ASTChar> *str = new std::vector<ASTChar>;
str->push_back(c);
- yylval.regexp = ast_str(nowhere, str, false);
+ yylval.regexp = ast_str(NOWHERE, str, false);
return REGEXP;
}
-#line 116 "lib/lex.cc"
+#line 114 "lib/lex.cc"
yy6:
++cur;
-#line 47 "../lib/lex.re"
+#line 45 "../lib/lex.re"
{
error("anchors are not supported");
return ERROR;
}
-#line 124 "lib/lex.cc"
+#line 122 "lib/lex.cc"
yy8:
++cur;
-#line 45 "../lib/lex.re"
+#line 43 "../lib/lex.re"
{ return cur[-1]; }
-#line 129 "lib/lex.cc"
+#line 127 "lib/lex.cc"
yy10:
++cur;
-#line 73 "../lib/lex.re"
+#line 71 "../lib/lex.re"
{
- yylval.regexp = ast_dot(nowhere);
+ yylval.regexp = ast_dot(NOWHERE);
return REGEXP;
}
-#line 137 "lib/lex.cc"
+#line 135 "lib/lex.cc"
yy12:
yych = *++cur;
if (yych == '^') goto yy15;
-#line 53 "../lib/lex.re"
+#line 51 "../lib/lex.re"
{ goto cls; }
-#line 143 "lib/lex.cc"
+#line 141 "lib/lex.cc"
yy14:
yych = *(mar = ++cur);
if (yych <= '/') goto yy5;
goto yy5;
yy15:
++cur;
-#line 52 "../lib/lex.re"
+#line 50 "../lib/lex.re"
{ neg = true; goto cls; }
-#line 156 "lib/lex.cc"
+#line 154 "lib/lex.cc"
yy17:
yych = *++cur;
if (yybm[0+yych] & 128) {
yy21:
++cur;
x = yyt1;
-#line 55 "../lib/lex.re"
+#line 53 "../lib/lex.re"
{
if (!s_to_u32_unsafe(x, cur - 1, yylval.bounds.min)) goto err_cnt;
yylval.bounds.max = yylval.bounds.min;
return COUNT;
}
-#line 185 "lib/lex.cc"
+#line 183 "lib/lex.cc"
yy23:
yych = *++cur;
if (yych <= '/') goto yy19;
yy25:
++cur;
x = yyt1;
-#line 67 "../lib/lex.re"
+#line 65 "../lib/lex.re"
{
if (!s_to_u32_unsafe(x, cur - 2, yylval.bounds.min)) goto err_cnt;
yylval.bounds.max = AST::MANY;
return COUNT;
}
-#line 201 "lib/lex.cc"
+#line 199 "lib/lex.cc"
yy27:
++cur;
x = yyt1;
y = yyt2;
-#line 61 "../lib/lex.re"
+#line 59 "../lib/lex.re"
{
if (!s_to_u32_unsafe(x, y - 1, yylval.bounds.min)
|| !s_to_u32_unsafe(y, cur - 1, yylval.bounds.max)) goto err_cnt;
return COUNT;
}
-#line 212 "lib/lex.cc"
+#line 210 "lib/lex.cc"
}
-#line 85 "../lib/lex.re"
+#line 83 "../lib/lex.re"
cls:
if (lex_cls_chr(cur, l) != 0) goto err;
-#line 220 "lib/lex.cc"
+#line 218 "lib/lex.cc"
{
char yych;
yych = *(mar = cur);
if (yych == '-') goto yy32;
yy31:
-#line 90 "../lib/lex.re"
+#line 88 "../lib/lex.re"
{ u = l; goto add; }
-#line 228 "lib/lex.cc"
+#line 226 "lib/lex.cc"
yy32:
yych = *++cur;
if (yych != ']') goto yy34;
yy34:
++cur;
cur -= 1;
-#line 91 "../lib/lex.re"
+#line 89 "../lib/lex.re"
{ if (lex_cls_chr(cur, u) != 0) goto err; goto add; }
-#line 239 "lib/lex.cc"
+#line 237 "lib/lex.cc"
}
-#line 92 "../lib/lex.re"
+#line 90 "../lib/lex.re"
add:
if (l > u) goto err;
- cls.push_back(ASTRange(l, u, nowhere));
+ cls.push_back(ASTRange(l, u, NOWHERE));
-#line 247 "lib/lex.cc"
+#line 245 "lib/lex.cc"
{
char yych;
yych = *cur;
if (yych == ']') goto yy39;
-#line 97 "../lib/lex.re"
+#line 95 "../lib/lex.re"
{ goto cls; }
-#line 254 "lib/lex.cc"
+#line 252 "lib/lex.cc"
yy39:
++cur;
-#line 98 "../lib/lex.re"
+#line 96 "../lib/lex.re"
{
std::vector<ASTRange> *p = new std::vector<ASTRange>;
p->swap(cls);
- yylval.regexp = ast_cls(nowhere, p, neg);
+ yylval.regexp = ast_cls(NOWHERE, p, neg);
return REGEXP;
}
-#line 264 "lib/lex.cc"
+#line 262 "lib/lex.cc"
}
-#line 104 "../lib/lex.re"
+#line 102 "../lib/lex.re"
err:
int32_t lex_cls_chr(const char *&cur, uint32_t &c)
{
-#line 281 "lib/lex.cc"
+#line 279 "lib/lex.cc"
{
char yych;
yych = *cur;
goto yy45;
yy43:
++cur;
-#line 118 "../lib/lex.re"
+#line 116 "../lib/lex.re"
{ return 1; }
-#line 292 "lib/lex.cc"
+#line 290 "lib/lex.cc"
yy45:
++cur;
yy46:
-#line 123 "../lib/lex.re"
+#line 121 "../lib/lex.re"
{ c = static_cast<uint8_t>(cur[-1]); return 0; }
-#line 298 "lib/lex.cc"
+#line 296 "lib/lex.cc"
yy47:
yych = *++cur;
if (yych <= '9') {
goto yy46;
}
++cur;
-#line 119 "../lib/lex.re"
+#line 117 "../lib/lex.re"
{ error("collating characters not supported"); return 1; }
-#line 311 "lib/lex.cc"
+#line 309 "lib/lex.cc"
yy50:
++cur;
-#line 120 "../lib/lex.re"
+#line 118 "../lib/lex.re"
{ error("character classes not supported"); return 1; }
-#line 316 "lib/lex.cc"
+#line 314 "lib/lex.cc"
yy52:
++cur;
-#line 121 "../lib/lex.re"
+#line 119 "../lib/lex.re"
{ error("equivalence classes not supported"); return 1; }
-#line 321 "lib/lex.cc"
+#line 319 "lib/lex.cc"
}
-#line 124 "../lib/lex.re"
+#line 122 "../lib/lex.re"
}
case 13:
#line 61 "../lib/parse.ypp" /* yacc.c:1646 */
- { (yyval.regexp) = ast_cap(ast_nil(loc_t(0, 0, "void"))); }
+ { (yyval.regexp) = ast_cap(ast_nil(NOWHERE)); }
#line 1273 "lib/parse.cc" /* yacc.c:1646 */
break;
-/* Generated by re2c 1.1.1 on Tue Feb 5 11:51:11 2019 */
+/* Generated by re2c 1.1.1 on Tue Feb 12 22:50:47 2019 */
#line 1 "../src/options/parse_opts.re"
#include "src/codegen/input_api.h"
-#include "src/options/msg.h"
#include "src/options/opt.h"
#include "src/regexp/empty_class_policy.h"
#include "src/encoding/enc.h"
return arg != NULL;
}
-parse_opts_t parse_opts(char **argv, conopt_t &globopts, Opt &opts, Warn &warn)
+parse_opts_t parse_opts(char **argv, conopt_t &globopts, Opt &opts, Msg &msg)
{
#define YYCTYPE unsigned char
char *YYCURSOR, *YYMARKER;
Warn::option_t option;
-#line 39 "../src/options/parse_opts.re"
+#line 38 "../src/options/parse_opts.re"
opt:
if (!next (YYCURSOR, argv)) goto end;
-#line 42 "src/options/parse_opts.cc"
+#line 41 "src/options/parse_opts.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
goto yy4;
yy2:
++YYCURSOR;
-#line 44 "../src/options/parse_opts.re"
+#line 43 "../src/options/parse_opts.re"
{ ERROR("bad option: %s", *argv); }
-#line 88 "src/options/parse_opts.cc"
+#line 87 "src/options/parse_opts.cc"
yy4:
yych = (YYCTYPE)*++YYCURSOR;
if (yybm[0+yych] & 128) {
} else {
if (yych == 'W') goto yy14;
}
-#line 58 "../src/options/parse_opts.re"
+#line 57 "../src/options/parse_opts.re"
{ goto opt_short; }
-#line 105 "src/options/parse_opts.cc"
+#line 104 "src/options/parse_opts.cc"
yy8:
++YYCURSOR;
-#line 56 "../src/options/parse_opts.re"
+#line 55 "../src/options/parse_opts.re"
{ if (!opts.source (*argv)) return EXIT_FAIL; goto opt; }
-#line 110 "src/options/parse_opts.cc"
+#line 109 "src/options/parse_opts.cc"
yy10:
++YYCURSOR;
-#line 55 "../src/options/parse_opts.re"
+#line 54 "../src/options/parse_opts.re"
{ if (!opts.source ("<stdin>")) return EXIT_FAIL; goto opt; }
-#line 115 "src/options/parse_opts.cc"
+#line 114 "src/options/parse_opts.cc"
yy12:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy16;
-#line 59 "../src/options/parse_opts.re"
+#line 58 "../src/options/parse_opts.re"
{ goto opt_long; }
-#line 121 "src/options/parse_opts.cc"
+#line 120 "src/options/parse_opts.cc"
yy14:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == 'n') goto yy22;
}
yy15:
-#line 63 "../src/options/parse_opts.re"
+#line 62 "../src/options/parse_opts.re"
{ option = Warn::W; goto opt_warn; }
-#line 134 "src/options/parse_opts.cc"
+#line 133 "src/options/parse_opts.cc"
yy16:
++YYCURSOR;
-#line 46 "../src/options/parse_opts.re"
+#line 45 "../src/options/parse_opts.re"
{
// remaining args are non-options, so they must be input files
// re2c expects exactly one input file
}
goto end;
}
-#line 146 "src/options/parse_opts.cc"
+#line 145 "src/options/parse_opts.cc"
yy18:
++YYCURSOR;
-#line 61 "../src/options/parse_opts.re"
- { warn.set_all (); goto opt; }
-#line 151 "src/options/parse_opts.cc"
+#line 60 "../src/options/parse_opts.re"
+ { msg.warn.set_all (); goto opt; }
+#line 150 "src/options/parse_opts.cc"
yy20:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy23;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == 'e') goto yy29;
yy27:
-#line 64 "../src/options/parse_opts.re"
+#line 63 "../src/options/parse_opts.re"
{ option = Warn::WNO; goto opt_warn; }
-#line 185 "src/options/parse_opts.cc"
+#line 184 "src/options/parse_opts.cc"
yy28:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy30;
goto yy21;
yy32:
++YYCURSOR;
-#line 62 "../src/options/parse_opts.re"
- { warn.set_all_error (); goto opt; }
-#line 207 "src/options/parse_opts.cc"
+#line 61 "../src/options/parse_opts.re"
+ { msg.warn.set_all_error (); goto opt; }
+#line 206 "src/options/parse_opts.cc"
yy34:
++YYCURSOR;
-#line 65 "../src/options/parse_opts.re"
+#line 64 "../src/options/parse_opts.re"
{ option = Warn::WERROR; goto opt_warn; }
-#line 212 "src/options/parse_opts.cc"
+#line 211 "src/options/parse_opts.cc"
yy36:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'o') goto yy21;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != '-') goto yy21;
++YYCURSOR;
-#line 66 "../src/options/parse_opts.re"
+#line 65 "../src/options/parse_opts.re"
{ option = Warn::WNOERROR; goto opt_warn; }
-#line 223 "src/options/parse_opts.cc"
+#line 222 "src/options/parse_opts.cc"
}
-#line 67 "../src/options/parse_opts.re"
+#line 66 "../src/options/parse_opts.re"
opt_warn:
-#line 230 "src/options/parse_opts.cc"
+#line 229 "src/options/parse_opts.cc"
{
YYCTYPE yych;
yych = (YYCTYPE)*YYCURSOR;
yy43:
++YYCURSOR;
yy44:
-#line 71 "../src/options/parse_opts.re"
+#line 70 "../src/options/parse_opts.re"
{ ERROR("bad warning: %s", *argv); }
-#line 248 "src/options/parse_opts.cc"
+#line 247 "src/options/parse_opts.cc"
yy45:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == 'o') goto yy51;
goto yy52;
yy151:
++YYCURSOR;
-#line 77 "../src/options/parse_opts.re"
- { warn.set (Warn::SWAPPED_RANGE, option); goto opt; }
-#line 677 "src/options/parse_opts.cc"
+#line 76 "../src/options/parse_opts.re"
+ { msg.warn.set (Warn::SWAPPED_RANGE, option); goto opt; }
+#line 676 "src/options/parse_opts.cc"
yy153:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy160;
goto yy52;
yy162:
++YYCURSOR;
-#line 80 "../src/options/parse_opts.re"
- { warn.set (Warn::USELESS_ESCAPE, option); goto opt; }
-#line 718 "src/options/parse_opts.cc"
+#line 79 "../src/options/parse_opts.re"
+ { msg.warn.set (Warn::USELESS_ESCAPE, option); goto opt; }
+#line 717 "src/options/parse_opts.cc"
yy164:
++YYCURSOR;
-#line 73 "../src/options/parse_opts.re"
- { warn.set (Warn::CONDITION_ORDER, option); goto opt; }
-#line 723 "src/options/parse_opts.cc"
+#line 72 "../src/options/parse_opts.re"
+ { msg.warn.set (Warn::CONDITION_ORDER, option); goto opt; }
+#line 722 "src/options/parse_opts.cc"
yy166:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'c') goto yy171;
goto yy52;
yy180:
++YYCURSOR;
-#line 79 "../src/options/parse_opts.re"
- { warn.set (Warn::UNREACHABLE_RULES, option); goto opt; }
-#line 784 "src/options/parse_opts.cc"
+#line 78 "../src/options/parse_opts.re"
+ { msg.warn.set (Warn::UNREACHABLE_RULES, option); goto opt; }
+#line 783 "src/options/parse_opts.cc"
yy182:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 's') goto yy187;
goto yy52;
yy183:
++YYCURSOR;
-#line 75 "../src/options/parse_opts.re"
- { warn.set (Warn::MATCH_EMPTY_STRING, option); goto opt; }
-#line 793 "src/options/parse_opts.cc"
+#line 74 "../src/options/parse_opts.re"
+ { msg.warn.set (Warn::MATCH_EMPTY_STRING, option); goto opt; }
+#line 792 "src/options/parse_opts.cc"
yy185:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'g') goto yy188;
goto yy52;
yy193:
++YYCURSOR;
-#line 74 "../src/options/parse_opts.re"
- { warn.set (Warn::EMPTY_CHARACTER_CLASS, option); goto opt; }
-#line 830 "src/options/parse_opts.cc"
+#line 73 "../src/options/parse_opts.re"
+ { msg.warn.set (Warn::EMPTY_CHARACTER_CLASS, option); goto opt; }
+#line 829 "src/options/parse_opts.cc"
yy195:
++YYCURSOR;
-#line 76 "../src/options/parse_opts.re"
- { warn.set (Warn::NONDETERMINISTIC_TAGS, option); goto opt; }
-#line 835 "src/options/parse_opts.cc"
+#line 75 "../src/options/parse_opts.re"
+ { msg.warn.set (Warn::NONDETERMINISTIC_TAGS, option); goto opt; }
+#line 834 "src/options/parse_opts.cc"
yy197:
yych = (YYCTYPE)*++YYCURSOR;
if (yych >= 0x01) goto yy52;
++YYCURSOR;
-#line 78 "../src/options/parse_opts.re"
- { warn.set (Warn::UNDEFINED_CONTROL_FLOW, option); goto opt; }
-#line 842 "src/options/parse_opts.cc"
+#line 77 "../src/options/parse_opts.re"
+ { msg.warn.set (Warn::UNDEFINED_CONTROL_FLOW, option); goto opt; }
+#line 841 "src/options/parse_opts.cc"
}
-#line 81 "../src/options/parse_opts.re"
+#line 80 "../src/options/parse_opts.re"
opt_short:
-#line 849 "src/options/parse_opts.cc"
+#line 848 "src/options/parse_opts.cc"
{
YYCTYPE yych;
yych = (YYCTYPE)*YYCURSOR;
}
}
++YYCURSOR;
-#line 87 "../src/options/parse_opts.re"
+#line 86 "../src/options/parse_opts.re"
{ goto opt; }
-#line 939 "src/options/parse_opts.cc"
+#line 938 "src/options/parse_opts.cc"
yy204:
++YYCURSOR;
-#line 85 "../src/options/parse_opts.re"
+#line 84 "../src/options/parse_opts.re"
{ ERROR("bad short option: %s", *argv); }
-#line 944 "src/options/parse_opts.cc"
+#line 943 "src/options/parse_opts.cc"
yy206:
++YYCURSOR;
-#line 126 "../src/options/parse_opts.re"
+#line 125 "../src/options/parse_opts.re"
{ goto opt_short; }
-#line 949 "src/options/parse_opts.cc"
+#line 948 "src/options/parse_opts.cc"
yy208:
++YYCURSOR;
-#line 109 "../src/options/parse_opts.re"
+#line 108 "../src/options/parse_opts.re"
{ opts.set_encoding(Enc::UTF8); goto opt_short; }
-#line 954 "src/options/parse_opts.cc"
+#line 953 "src/options/parse_opts.cc"
yy210:
++YYCURSOR;
-#line 88 "../src/options/parse_opts.re"
+#line 87 "../src/options/parse_opts.re"
{ usage (); return EXIT_OK; }
-#line 959 "src/options/parse_opts.cc"
+#line 958 "src/options/parse_opts.cc"
yy212:
++YYCURSOR;
-#line 93 "../src/options/parse_opts.re"
+#line 92 "../src/options/parse_opts.re"
{ globopts.target = TARGET_DOT; goto opt_short; }
-#line 964 "src/options/parse_opts.cc"
+#line 963 "src/options/parse_opts.cc"
yy214:
++YYCURSOR;
-#line 95 "../src/options/parse_opts.re"
+#line 94 "../src/options/parse_opts.re"
{ globopts.FFlag = true; goto opt_short; }
-#line 969 "src/options/parse_opts.cc"
+#line 968 "src/options/parse_opts.cc"
yy216:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy256;
-#line 118 "../src/options/parse_opts.re"
+#line 117 "../src/options/parse_opts.re"
{ *argv = YYCURSOR; goto opt_incpath; }
-#line 975 "src/options/parse_opts.cc"
+#line 974 "src/options/parse_opts.cc"
yy218:
++YYCURSOR;
-#line 111 "../src/options/parse_opts.re"
+#line 110 "../src/options/parse_opts.re"
{
opts.set_posix_syntax(true);
opts.set_posix_semantics(true);
goto opt_short;
}
-#line 984 "src/options/parse_opts.cc"
+#line 983 "src/options/parse_opts.cc"
yy220:
++YYCURSOR;
-#line 97 "../src/options/parse_opts.re"
+#line 96 "../src/options/parse_opts.re"
{ globopts.target = TARGET_SKELETON; goto opt_short; }
-#line 989 "src/options/parse_opts.cc"
+#line 988 "src/options/parse_opts.cc"
yy222:
++YYCURSOR;
-#line 104 "../src/options/parse_opts.re"
+#line 103 "../src/options/parse_opts.re"
{ opts.set_tags(true); goto opt_short; }
-#line 994 "src/options/parse_opts.cc"
+#line 993 "src/options/parse_opts.cc"
yy224:
++YYCURSOR;
-#line 90 "../src/options/parse_opts.re"
+#line 89 "../src/options/parse_opts.re"
{ vernum (); return EXIT_OK; }
-#line 999 "src/options/parse_opts.cc"
+#line 998 "src/options/parse_opts.cc"
yy226:
++YYCURSOR;
-#line 99 "../src/options/parse_opts.re"
+#line 98 "../src/options/parse_opts.re"
{ opts.set_bFlag(true); goto opt_short; }
-#line 1004 "src/options/parse_opts.cc"
+#line 1003 "src/options/parse_opts.cc"
yy228:
++YYCURSOR;
-#line 92 "../src/options/parse_opts.re"
+#line 91 "../src/options/parse_opts.re"
{ globopts.cFlag = true; goto opt_short; }
-#line 1009 "src/options/parse_opts.cc"
+#line 1008 "src/options/parse_opts.cc"
yy230:
++YYCURSOR;
-#line 100 "../src/options/parse_opts.re"
+#line 99 "../src/options/parse_opts.re"
{ opts.set_dFlag(true); goto opt_short; }
-#line 1014 "src/options/parse_opts.cc"
+#line 1013 "src/options/parse_opts.cc"
yy232:
++YYCURSOR;
-#line 105 "../src/options/parse_opts.re"
+#line 104 "../src/options/parse_opts.re"
{ opts.set_encoding(Enc::EBCDIC); goto opt_short; }
-#line 1019 "src/options/parse_opts.cc"
+#line 1018 "src/options/parse_opts.cc"
yy234:
++YYCURSOR;
-#line 94 "../src/options/parse_opts.re"
+#line 93 "../src/options/parse_opts.re"
{ globopts.fFlag = true; goto opt_short; }
-#line 1024 "src/options/parse_opts.cc"
+#line 1023 "src/options/parse_opts.cc"
yy236:
++YYCURSOR;
-#line 101 "../src/options/parse_opts.re"
+#line 100 "../src/options/parse_opts.re"
{ opts.set_gFlag(true); goto opt_short; }
-#line 1029 "src/options/parse_opts.cc"
+#line 1028 "src/options/parse_opts.cc"
yy238:
++YYCURSOR;
-#line 102 "../src/options/parse_opts.re"
+#line 101 "../src/options/parse_opts.re"
{ opts.set_iFlag(true); goto opt_short; }
-#line 1034 "src/options/parse_opts.cc"
+#line 1033 "src/options/parse_opts.cc"
yy240:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy258;
-#line 121 "../src/options/parse_opts.re"
+#line 120 "../src/options/parse_opts.re"
{ *argv = YYCURSOR; goto opt_output; }
-#line 1040 "src/options/parse_opts.cc"
+#line 1039 "src/options/parse_opts.cc"
yy242:
++YYCURSOR;
-#line 96 "../src/options/parse_opts.re"
+#line 95 "../src/options/parse_opts.re"
{ globopts.rFlag = true; goto opt_short; }
-#line 1045 "src/options/parse_opts.cc"
+#line 1044 "src/options/parse_opts.cc"
yy244:
++YYCURSOR;
-#line 103 "../src/options/parse_opts.re"
+#line 102 "../src/options/parse_opts.re"
{ opts.set_sFlag(true); goto opt_short; }
-#line 1050 "src/options/parse_opts.cc"
+#line 1049 "src/options/parse_opts.cc"
yy246:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy260;
-#line 124 "../src/options/parse_opts.re"
+#line 123 "../src/options/parse_opts.re"
{ *argv = YYCURSOR; goto opt_header; }
-#line 1056 "src/options/parse_opts.cc"
+#line 1055 "src/options/parse_opts.cc"
yy248:
++YYCURSOR;
-#line 106 "../src/options/parse_opts.re"
+#line 105 "../src/options/parse_opts.re"
{ opts.set_encoding(Enc::UTF32); goto opt_short; }
-#line 1061 "src/options/parse_opts.cc"
+#line 1060 "src/options/parse_opts.cc"
yy250:
++YYCURSOR;
-#line 89 "../src/options/parse_opts.re"
+#line 88 "../src/options/parse_opts.re"
{ version (); return EXIT_OK; }
-#line 1066 "src/options/parse_opts.cc"
+#line 1065 "src/options/parse_opts.cc"
yy252:
++YYCURSOR;
-#line 107 "../src/options/parse_opts.re"
+#line 106 "../src/options/parse_opts.re"
{ opts.set_encoding(Enc::UCS2); goto opt_short; }
-#line 1071 "src/options/parse_opts.cc"
+#line 1070 "src/options/parse_opts.cc"
yy254:
++YYCURSOR;
-#line 108 "../src/options/parse_opts.re"
+#line 107 "../src/options/parse_opts.re"
{ opts.set_encoding(Enc::UTF16); goto opt_short; }
-#line 1076 "src/options/parse_opts.cc"
+#line 1075 "src/options/parse_opts.cc"
yy256:
++YYCURSOR;
-#line 117 "../src/options/parse_opts.re"
+#line 116 "../src/options/parse_opts.re"
{ NEXT_ARG("-I", opt_incpath); }
-#line 1081 "src/options/parse_opts.cc"
+#line 1080 "src/options/parse_opts.cc"
yy258:
++YYCURSOR;
-#line 120 "../src/options/parse_opts.re"
+#line 119 "../src/options/parse_opts.re"
{ NEXT_ARG("-o, --output", opt_output); }
-#line 1086 "src/options/parse_opts.cc"
+#line 1085 "src/options/parse_opts.cc"
yy260:
++YYCURSOR;
-#line 123 "../src/options/parse_opts.re"
+#line 122 "../src/options/parse_opts.re"
{ NEXT_ARG("-t, --type-header", opt_header); }
-#line 1091 "src/options/parse_opts.cc"
+#line 1090 "src/options/parse_opts.cc"
}
-#line 127 "../src/options/parse_opts.re"
+#line 126 "../src/options/parse_opts.re"
opt_long:
-#line 1098 "src/options/parse_opts.cc"
+#line 1097 "src/options/parse_opts.cc"
{
YYCTYPE yych;
yych = (YYCTYPE)*YYCURSOR;
yy264:
++YYCURSOR;
yy265:
-#line 131 "../src/options/parse_opts.re"
+#line 130 "../src/options/parse_opts.re"
{ ERROR("bad long option: %s", *argv); }
-#line 1126 "src/options/parse_opts.cc"
+#line 1125 "src/options/parse_opts.cc"
yy266:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == 'i') goto yy282;
goto yy283;
yy348:
++YYCURSOR;
-#line 154 "../src/options/parse_opts.re"
+#line 153 "../src/options/parse_opts.re"
{ opts.set_encoding(Enc::EBCDIC); goto opt; }
-#line 1492 "src/options/parse_opts.cc"
+#line 1491 "src/options/parse_opts.cc"
yy350:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '-') goto yy384;
goto yy283;
yy388:
++YYCURSOR;
-#line 133 "../src/options/parse_opts.re"
+#line 132 "../src/options/parse_opts.re"
{ usage (); return EXIT_OK; }
-#line 1656 "src/options/parse_opts.cc"
+#line 1655 "src/options/parse_opts.cc"
yy390:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy429;
goto yy283;
yy404:
++YYCURSOR;
-#line 153 "../src/options/parse_opts.re"
+#line 152 "../src/options/parse_opts.re"
{ opts.set_tags (true); goto opt; }
-#line 1717 "src/options/parse_opts.cc"
+#line 1716 "src/options/parse_opts.cc"
yy406:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'h') goto yy444;
goto yy283;
yy429:
++YYCURSOR;
-#line 169 "../src/options/parse_opts.re"
+#line 168 "../src/options/parse_opts.re"
{ NEXT_ARG("--input", opt_input); }
-#line 1815 "src/options/parse_opts.cc"
+#line 1814 "src/options/parse_opts.cc"
yy431:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '-') goto yy469;
goto yy283;
yy447:
++YYCURSOR;
-#line 158 "../src/options/parse_opts.re"
+#line 157 "../src/options/parse_opts.re"
{ opts.set_encoding(Enc::UTF8); goto opt; }
-#line 1884 "src/options/parse_opts.cc"
+#line 1883 "src/options/parse_opts.cc"
yy449:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy487;
goto yy283;
yy475:
++YYCURSOR;
-#line 166 "../src/options/parse_opts.re"
+#line 165 "../src/options/parse_opts.re"
{ NEXT_ARG("-o, --output", opt_output); }
-#line 1994 "src/options/parse_opts.cc"
+#line 1993 "src/options/parse_opts.cc"
yy477:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'a') goto yy515;
goto yy283;
yy485:
++YYCURSOR;
-#line 157 "../src/options/parse_opts.re"
+#line 156 "../src/options/parse_opts.re"
{ opts.set_encoding(Enc::UTF16); goto opt; }
-#line 2032 "src/options/parse_opts.cc"
+#line 2031 "src/options/parse_opts.cc"
yy487:
++YYCURSOR;
-#line 135 "../src/options/parse_opts.re"
+#line 134 "../src/options/parse_opts.re"
{ vernum (); return EXIT_OK; }
-#line 2037 "src/options/parse_opts.cc"
+#line 2036 "src/options/parse_opts.cc"
yy489:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy525;
goto yy283;
yy523:
++YYCURSOR;
-#line 155 "../src/options/parse_opts.re"
+#line 154 "../src/options/parse_opts.re"
{ opts.set_encoding(Enc::UTF32); goto opt; }
-#line 2178 "src/options/parse_opts.cc"
+#line 2177 "src/options/parse_opts.cc"
yy525:
++YYCURSOR;
-#line 134 "../src/options/parse_opts.re"
+#line 133 "../src/options/parse_opts.re"
{ version (); return EXIT_OK; }
-#line 2183 "src/options/parse_opts.cc"
+#line 2182 "src/options/parse_opts.cc"
yy527:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy564;
goto yy283;
yy536:
++YYCURSOR;
-#line 188 "../src/options/parse_opts.re"
+#line 187 "../src/options/parse_opts.re"
{ globopts.dump_cfg = true; goto opt; }
-#line 2224 "src/options/parse_opts.cc"
+#line 2223 "src/options/parse_opts.cc"
yy538:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'u') goto yy574;
goto yy283;
yy541:
++YYCURSOR;
-#line 182 "../src/options/parse_opts.re"
+#line 181 "../src/options/parse_opts.re"
{ globopts.dump_nfa = true; goto opt; }
-#line 2246 "src/options/parse_opts.cc"
+#line 2245 "src/options/parse_opts.cc"
yy543:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'p') goto yy580;
goto yy283;
yy544:
++YYCURSOR;
-#line 138 "../src/options/parse_opts.re"
+#line 137 "../src/options/parse_opts.re"
{ globopts.target = TARGET_DOT; goto opt; }
-#line 2255 "src/options/parse_opts.cc"
+#line 2254 "src/options/parse_opts.cc"
yy546:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 's') goto yy581;
goto yy283;
yy557:
++YYCURSOR;
-#line 141 "../src/options/parse_opts.re"
+#line 140 "../src/options/parse_opts.re"
{ globopts.rFlag = true; goto opt; }
-#line 2304 "src/options/parse_opts.cc"
+#line 2303 "src/options/parse_opts.cc"
yy559:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 's') goto yy592;
goto yy283;
yy560:
++YYCURSOR;
-#line 144 "../src/options/parse_opts.re"
+#line 143 "../src/options/parse_opts.re"
{ globopts.target = TARGET_SKELETON; goto opt; }
-#line 2313 "src/options/parse_opts.cc"
+#line 2312 "src/options/parse_opts.cc"
yy562:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 's') goto yy593;
goto yy283;
yy572:
++YYCURSOR;
-#line 187 "../src/options/parse_opts.re"
+#line 186 "../src/options/parse_opts.re"
{ globopts.dump_adfa = true; goto opt; }
-#line 2358 "src/options/parse_opts.cc"
+#line 2357 "src/options/parse_opts.cc"
yy574:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy604;
goto yy283;
yy600:
++YYCURSOR;
-#line 137 "../src/options/parse_opts.re"
+#line 136 "../src/options/parse_opts.re"
{ globopts.cFlag = true; goto opt; }
-#line 2467 "src/options/parse_opts.cc"
+#line 2466 "src/options/parse_opts.cc"
yy602:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 't') goto yy635;
goto yy283;
yy610:
++YYCURSOR;
-#line 179 "../src/options/parse_opts.re"
+#line 178 "../src/options/parse_opts.re"
{ globopts.eager_skip = true; goto opt; }
-#line 2504 "src/options/parse_opts.cc"
+#line 2503 "src/options/parse_opts.cc"
yy612:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy644;
goto yy283;
yy615:
++YYCURSOR;
-#line 150 "../src/options/parse_opts.re"
+#line 149 "../src/options/parse_opts.re"
{ opts.set_sFlag (true); goto opt; }
-#line 2521 "src/options/parse_opts.cc"
+#line 2520 "src/options/parse_opts.cc"
yy617:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'f') goto yy649;
goto yy283;
yy621:
++YYCURSOR;
-#line 143 "../src/options/parse_opts.re"
+#line 142 "../src/options/parse_opts.re"
{ globopts.version = false; goto opt; }
-#line 2542 "src/options/parse_opts.cc"
+#line 2541 "src/options/parse_opts.cc"
yy623:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy653;
goto yy283;
yy628:
++YYCURSOR;
-#line 156 "../src/options/parse_opts.re"
+#line 155 "../src/options/parse_opts.re"
{ opts.set_encoding(Enc::UCS2); goto opt; }
-#line 2567 "src/options/parse_opts.cc"
+#line 2566 "src/options/parse_opts.cc"
yy630:
++YYCURSOR;
-#line 146 "../src/options/parse_opts.re"
+#line 145 "../src/options/parse_opts.re"
{ opts.set_bFlag (true); goto opt; }
-#line 2572 "src/options/parse_opts.cc"
+#line 2571 "src/options/parse_opts.cc"
yy632:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 't') goto yy660;
goto yy283;
yy642:
++YYCURSOR;
-#line 189 "../src/options/parse_opts.re"
+#line 188 "../src/options/parse_opts.re"
{ globopts.dump_interf = true; goto opt; }
-#line 2617 "src/options/parse_opts.cc"
+#line 2616 "src/options/parse_opts.cc"
yy644:
++YYCURSOR;
-#line 170 "../src/options/parse_opts.re"
+#line 169 "../src/options/parse_opts.re"
{ NEXT_ARG("--empty-class", opt_empty_class); }
-#line 2622 "src/options/parse_opts.cc"
+#line 2621 "src/options/parse_opts.cc"
yy646:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'i') goto yy674;
goto yy283;
yy647:
++YYCURSOR;
-#line 140 "../src/options/parse_opts.re"
+#line 139 "../src/options/parse_opts.re"
{ globopts.FFlag = true; goto opt; }
-#line 2631 "src/options/parse_opts.cc"
+#line 2630 "src/options/parse_opts.cc"
yy649:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'o') goto yy675;
goto yy283;
yy655:
++YYCURSOR;
-#line 172 "../src/options/parse_opts.re"
+#line 171 "../src/options/parse_opts.re"
{ goto opt; }
-#line 2660 "src/options/parse_opts.cc"
+#line 2659 "src/options/parse_opts.cc"
yy657:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 't') goto yy682;
goto yy283;
yy658:
++YYCURSOR;
-#line 167 "../src/options/parse_opts.re"
+#line 166 "../src/options/parse_opts.re"
{ NEXT_ARG("-t, --type-header", opt_header); }
-#line 2669 "src/options/parse_opts.cc"
+#line 2668 "src/options/parse_opts.cc"
yy660:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'i') goto yy683;
goto yy283;
yy663:
++YYCURSOR;
-#line 147 "../src/options/parse_opts.re"
+#line 146 "../src/options/parse_opts.re"
{ opts.set_dFlag (true); goto opt; }
-#line 2686 "src/options/parse_opts.cc"
+#line 2685 "src/options/parse_opts.cc"
yy665:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'i') goto yy687;
goto yy283;
yy667:
++YYCURSOR;
-#line 184 "../src/options/parse_opts.re"
+#line 183 "../src/options/parse_opts.re"
{ globopts.dump_dfa_det = true; goto opt; }
-#line 2699 "src/options/parse_opts.cc"
+#line 2698 "src/options/parse_opts.cc"
yy669:
++YYCURSOR;
-#line 186 "../src/options/parse_opts.re"
+#line 185 "../src/options/parse_opts.re"
{ globopts.dump_dfa_min = true; goto opt; }
-#line 2704 "src/options/parse_opts.cc"
+#line 2703 "src/options/parse_opts.cc"
yy671:
++YYCURSOR;
-#line 183 "../src/options/parse_opts.re"
+#line 182 "../src/options/parse_opts.re"
{ globopts.dump_dfa_raw = true; goto opt; }
-#line 2709 "src/options/parse_opts.cc"
+#line 2708 "src/options/parse_opts.cc"
yy673:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'p') goto yy689;
goto yy283;
yy677:
++YYCURSOR;
-#line 177 "../src/options/parse_opts.re"
+#line 176 "../src/options/parse_opts.re"
{ globopts.lookahead = false; goto opt; }
-#line 2730 "src/options/parse_opts.cc"
+#line 2729 "src/options/parse_opts.cc"
yy679:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'a') goto yy694;
goto yy283;
yy684:
++YYCURSOR;
-#line 152 "../src/options/parse_opts.re"
+#line 151 "../src/options/parse_opts.re"
{ opts.set_bCaseInverted (true); goto opt; }
-#line 2755 "src/options/parse_opts.cc"
+#line 2754 "src/options/parse_opts.cc"
yy686:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy700;
goto yy283;
yy691:
++YYCURSOR;
-#line 149 "../src/options/parse_opts.re"
+#line 148 "../src/options/parse_opts.re"
{ opts.set_iFlag (true); goto opt; }
-#line 2780 "src/options/parse_opts.cc"
+#line 2779 "src/options/parse_opts.cc"
yy693:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'd') goto yy706;
goto yy283;
yy696:
++YYCURSOR;
-#line 176 "../src/options/parse_opts.re"
+#line 175 "../src/options/parse_opts.re"
{ NEXT_ARG("--posix-closure", opt_posix_closure); }
-#line 2797 "src/options/parse_opts.cc"
+#line 2796 "src/options/parse_opts.cc"
yy698:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy710;
goto yy283;
yy700:
++YYCURSOR;
-#line 148 "../src/options/parse_opts.re"
+#line 147 "../src/options/parse_opts.re"
{ opts.set_gFlag (true); goto opt; }
-#line 2810 "src/options/parse_opts.cc"
+#line 2809 "src/options/parse_opts.cc"
yy702:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'n') goto yy713;
goto yy283;
yy708:
++YYCURSOR;
-#line 160 "../src/options/parse_opts.re"
+#line 159 "../src/options/parse_opts.re"
{
opts.set_posix_syntax(true);
opts.set_posix_semantics(true);
goto opt;
}
-#line 2843 "src/options/parse_opts.cc"
+#line 2842 "src/options/parse_opts.cc"
yy710:
++YYCURSOR;
-#line 139 "../src/options/parse_opts.re"
+#line 138 "../src/options/parse_opts.re"
{ globopts.fFlag = true; goto opt; }
-#line 2848 "src/options/parse_opts.cc"
+#line 2847 "src/options/parse_opts.cc"
yy712:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy721;
goto yy283;
yy715:
++YYCURSOR;
-#line 185 "../src/options/parse_opts.re"
+#line 184 "../src/options/parse_opts.re"
{ globopts.dump_dfa_tagopt = true; goto opt; }
-#line 2865 "src/options/parse_opts.cc"
+#line 2864 "src/options/parse_opts.cc"
yy717:
++YYCURSOR;
-#line 168 "../src/options/parse_opts.re"
+#line 167 "../src/options/parse_opts.re"
{ NEXT_ARG("--encoding-policy", opt_encoding_policy); }
-#line 2870 "src/options/parse_opts.cc"
+#line 2869 "src/options/parse_opts.cc"
yy719:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 't') goto yy726;
goto yy283;
yy721:
++YYCURSOR;
-#line 151 "../src/options/parse_opts.re"
+#line 150 "../src/options/parse_opts.re"
{ opts.set_bCaseInsensitive (true); goto opt; }
-#line 2883 "src/options/parse_opts.cc"
+#line 2882 "src/options/parse_opts.cc"
yy723:
++YYCURSOR;
-#line 175 "../src/options/parse_opts.re"
+#line 174 "../src/options/parse_opts.re"
{ NEXT_ARG("--dfa-minimization", opt_dfa_minimization); }
-#line 2888 "src/options/parse_opts.cc"
+#line 2887 "src/options/parse_opts.cc"
yy725:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 's') goto yy729;
goto yy283;
yy727:
++YYCURSOR;
-#line 178 "../src/options/parse_opts.re"
+#line 177 "../src/options/parse_opts.re"
{ globopts.optimize_tags = false; goto opt; }
-#line 2901 "src/options/parse_opts.cc"
+#line 2900 "src/options/parse_opts.cc"
yy729:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x00) goto yy731;
goto yy283;
yy731:
++YYCURSOR;
-#line 190 "../src/options/parse_opts.re"
+#line 189 "../src/options/parse_opts.re"
{ globopts.dump_closure_stats = true; goto opt; }
-#line 2914 "src/options/parse_opts.cc"
+#line 2913 "src/options/parse_opts.cc"
yy733:
++YYCURSOR;
-#line 142 "../src/options/parse_opts.re"
+#line 141 "../src/options/parse_opts.re"
{ globopts.bNoGenerationDate = true; goto opt; }
-#line 2919 "src/options/parse_opts.cc"
+#line 2918 "src/options/parse_opts.cc"
}
-#line 191 "../src/options/parse_opts.re"
+#line 190 "../src/options/parse_opts.re"
opt_output:
-#line 2926 "src/options/parse_opts.cc"
+#line 2925 "src/options/parse_opts.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
if (yych != '-') goto yy739;
yy737:
++YYCURSOR;
-#line 195 "../src/options/parse_opts.re"
+#line 194 "../src/options/parse_opts.re"
{ ERROR("bad argument to option -o, --output: %s", *argv); }
-#line 2970 "src/options/parse_opts.cc"
+#line 2969 "src/options/parse_opts.cc"
yy739:
yych = (YYCTYPE)*++YYCURSOR;
if (yybm[0+yych] & 128) {
goto yy739;
}
++YYCURSOR;
-#line 196 "../src/options/parse_opts.re"
+#line 195 "../src/options/parse_opts.re"
{ opts.set_output_file (*argv); goto opt; }
-#line 2979 "src/options/parse_opts.cc"
+#line 2978 "src/options/parse_opts.cc"
}
-#line 197 "../src/options/parse_opts.re"
+#line 196 "../src/options/parse_opts.re"
opt_header:
-#line 2986 "src/options/parse_opts.cc"
+#line 2985 "src/options/parse_opts.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
if (yych != '-') goto yy747;
yy745:
++YYCURSOR;
-#line 201 "../src/options/parse_opts.re"
+#line 200 "../src/options/parse_opts.re"
{ ERROR("bad argument to option -t, --type-header: %s", *argv); }
-#line 3030 "src/options/parse_opts.cc"
+#line 3029 "src/options/parse_opts.cc"
yy747:
yych = (YYCTYPE)*++YYCURSOR;
if (yybm[0+yych] & 128) {
goto yy747;
}
++YYCURSOR;
-#line 202 "../src/options/parse_opts.re"
+#line 201 "../src/options/parse_opts.re"
{ opts.set_header_file (*argv); goto opt; }
-#line 3039 "src/options/parse_opts.cc"
+#line 3038 "src/options/parse_opts.cc"
}
-#line 203 "../src/options/parse_opts.re"
+#line 202 "../src/options/parse_opts.re"
opt_incpath:
-#line 3046 "src/options/parse_opts.cc"
+#line 3045 "src/options/parse_opts.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
if (yych != '-') goto yy755;
yy753:
++YYCURSOR;
-#line 207 "../src/options/parse_opts.re"
+#line 206 "../src/options/parse_opts.re"
{ ERROR("bad argument to option -I: %s", *argv); }
-#line 3090 "src/options/parse_opts.cc"
+#line 3089 "src/options/parse_opts.cc"
yy755:
yych = (YYCTYPE)*++YYCURSOR;
if (yybm[0+yych] & 128) {
goto yy755;
}
++YYCURSOR;
-#line 208 "../src/options/parse_opts.re"
+#line 207 "../src/options/parse_opts.re"
{ globopts.incpaths.push_back(*argv); goto opt; }
-#line 3099 "src/options/parse_opts.cc"
+#line 3098 "src/options/parse_opts.cc"
}
-#line 209 "../src/options/parse_opts.re"
+#line 208 "../src/options/parse_opts.re"
opt_encoding_policy:
-#line 3106 "src/options/parse_opts.cc"
+#line 3105 "src/options/parse_opts.cc"
{
YYCTYPE yych;
yych = (YYCTYPE)*YYCURSOR;
}
++YYCURSOR;
yy762:
-#line 213 "../src/options/parse_opts.re"
+#line 212 "../src/options/parse_opts.re"
{
ERROR("bad argument to option --encoding-policy "
"(expected: ignore | substitute | fail): %s", *argv);
}
-#line 3123 "src/options/parse_opts.cc"
+#line 3122 "src/options/parse_opts.cc"
yy763:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == 'a') goto yy766;
goto yy767;
yy776:
++YYCURSOR;
-#line 219 "../src/options/parse_opts.re"
+#line 218 "../src/options/parse_opts.re"
{ opts.set_encoding_policy (Enc::POLICY_FAIL); goto opt; }
-#line 3178 "src/options/parse_opts.cc"
+#line 3177 "src/options/parse_opts.cc"
yy778:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'e') goto yy780;
goto yy767;
yy782:
++YYCURSOR;
-#line 217 "../src/options/parse_opts.re"
+#line 216 "../src/options/parse_opts.re"
{ opts.set_encoding_policy (Enc::POLICY_IGNORE); goto opt; }
-#line 3199 "src/options/parse_opts.cc"
+#line 3198 "src/options/parse_opts.cc"
yy784:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'u') goto yy767;
yych = (YYCTYPE)*++YYCURSOR;
if (yych >= 0x01) goto yy767;
++YYCURSOR;
-#line 218 "../src/options/parse_opts.re"
+#line 217 "../src/options/parse_opts.re"
{ opts.set_encoding_policy (Enc::POLICY_SUBSTITUTE); goto opt; }
-#line 3212 "src/options/parse_opts.cc"
+#line 3211 "src/options/parse_opts.cc"
}
-#line 220 "../src/options/parse_opts.re"
+#line 219 "../src/options/parse_opts.re"
opt_input:
-#line 3219 "src/options/parse_opts.cc"
+#line 3218 "src/options/parse_opts.cc"
{
YYCTYPE yych;
yych = (YYCTYPE)*YYCURSOR;
yy792:
++YYCURSOR;
yy793:
-#line 224 "../src/options/parse_opts.re"
+#line 223 "../src/options/parse_opts.re"
{
ERROR("bad argument to option --input "
"(expected: default | custom): %s", *argv);
}
-#line 3234 "src/options/parse_opts.cc"
+#line 3233 "src/options/parse_opts.cc"
yy794:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == 'u') goto yy796;
goto yy797;
yy807:
++YYCURSOR;
-#line 229 "../src/options/parse_opts.re"
+#line 228 "../src/options/parse_opts.re"
{ opts.set_input_api(INPUT_CUSTOM); goto opt; }
-#line 3289 "src/options/parse_opts.cc"
+#line 3288 "src/options/parse_opts.cc"
yy809:
yych = (YYCTYPE)*++YYCURSOR;
if (yych >= 0x01) goto yy797;
++YYCURSOR;
-#line 228 "../src/options/parse_opts.re"
+#line 227 "../src/options/parse_opts.re"
{ opts.set_input_api(INPUT_DEFAULT); goto opt; }
-#line 3296 "src/options/parse_opts.cc"
+#line 3295 "src/options/parse_opts.cc"
}
-#line 230 "../src/options/parse_opts.re"
+#line 229 "../src/options/parse_opts.re"
opt_empty_class:
-#line 3303 "src/options/parse_opts.cc"
+#line 3302 "src/options/parse_opts.cc"
{
YYCTYPE yych;
yych = (YYCTYPE)*YYCURSOR;
if (yych == 'm') goto yy817;
++YYCURSOR;
yy815:
-#line 234 "../src/options/parse_opts.re"
+#line 233 "../src/options/parse_opts.re"
{
ERROR("bad argument to option --empty-class "
"(expected: match-empty | match-none | error): %s", *argv);
}
-#line 3316 "src/options/parse_opts.cc"
+#line 3315 "src/options/parse_opts.cc"
yy816:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == 'r') goto yy818;
goto yy819;
yy827:
++YYCURSOR;
-#line 240 "../src/options/parse_opts.re"
+#line 239 "../src/options/parse_opts.re"
{ opts.set_empty_class_policy (EMPTY_CLASS_ERROR); goto opt; }
-#line 3363 "src/options/parse_opts.cc"
+#line 3362 "src/options/parse_opts.cc"
yy829:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'e') goto yy830;
goto yy819;
yy839:
++YYCURSOR;
-#line 239 "../src/options/parse_opts.re"
+#line 238 "../src/options/parse_opts.re"
{ opts.set_empty_class_policy (EMPTY_CLASS_MATCH_NONE); goto opt; }
-#line 3409 "src/options/parse_opts.cc"
+#line 3408 "src/options/parse_opts.cc"
yy841:
++YYCURSOR;
-#line 238 "../src/options/parse_opts.re"
+#line 237 "../src/options/parse_opts.re"
{ opts.set_empty_class_policy (EMPTY_CLASS_MATCH_EMPTY); goto opt; }
-#line 3414 "src/options/parse_opts.cc"
+#line 3413 "src/options/parse_opts.cc"
}
-#line 241 "../src/options/parse_opts.re"
+#line 240 "../src/options/parse_opts.re"
opt_dfa_minimization:
-#line 3421 "src/options/parse_opts.cc"
+#line 3420 "src/options/parse_opts.cc"
{
YYCTYPE yych;
yych = (YYCTYPE)*YYCURSOR;
if (yych == 't') goto yy848;
++YYCURSOR;
yy846:
-#line 245 "../src/options/parse_opts.re"
+#line 244 "../src/options/parse_opts.re"
{
ERROR("bad argument to option --dfa-minimization "
"(expected: table | moore): %s", *argv);
}
-#line 3434 "src/options/parse_opts.cc"
+#line 3433 "src/options/parse_opts.cc"
yy847:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == 'o') goto yy849;
goto yy850;
yy858:
++YYCURSOR;
-#line 250 "../src/options/parse_opts.re"
+#line 249 "../src/options/parse_opts.re"
{ globopts.dfa_minimization = DFA_MINIMIZATION_MOORE; goto opt; }
-#line 3481 "src/options/parse_opts.cc"
+#line 3480 "src/options/parse_opts.cc"
yy860:
++YYCURSOR;
-#line 249 "../src/options/parse_opts.re"
+#line 248 "../src/options/parse_opts.re"
{ globopts.dfa_minimization = DFA_MINIMIZATION_TABLE; goto opt; }
-#line 3486 "src/options/parse_opts.cc"
+#line 3485 "src/options/parse_opts.cc"
}
-#line 251 "../src/options/parse_opts.re"
+#line 250 "../src/options/parse_opts.re"
opt_posix_closure:
-#line 3493 "src/options/parse_opts.cc"
+#line 3492 "src/options/parse_opts.cc"
{
YYCTYPE yych;
yych = (YYCTYPE)*YYCURSOR;
if (yych == 'g') goto yy866;
++YYCURSOR;
yy865:
-#line 255 "../src/options/parse_opts.re"
+#line 254 "../src/options/parse_opts.re"
{
ERROR("bad argument to option --posix_closure "
"(expected: gor1 | gtop): %s", *argv);
}
-#line 3505 "src/options/parse_opts.cc"
+#line 3504 "src/options/parse_opts.cc"
yy866:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == 'o') goto yy867;
goto yy868;
yy874:
++YYCURSOR;
-#line 259 "../src/options/parse_opts.re"
+#line 258 "../src/options/parse_opts.re"
{ globopts.posix_closure = POSIX_CLOSURE_GOR1; goto opt; }
-#line 3541 "src/options/parse_opts.cc"
+#line 3540 "src/options/parse_opts.cc"
yy876:
++YYCURSOR;
-#line 260 "../src/options/parse_opts.re"
+#line 259 "../src/options/parse_opts.re"
{ globopts.posix_closure = POSIX_CLOSURE_GTOP; goto opt; }
-#line 3546 "src/options/parse_opts.cc"
+#line 3545 "src/options/parse_opts.cc"
}
-#line 261 "../src/options/parse_opts.re"
+#line 260 "../src/options/parse_opts.re"
end:
-/* Generated by re2c 1.1.1 on Tue Feb 12 17:26:39 2019 */
+/* Generated by re2c 1.1.1 on Tue Feb 12 22:50:47 2019 */
#line 1 "../src/parse/lex.re"
#include "src/util/c99_stdint.h"
#include <stddef.h>
#include <limits>
#include <string>
-#include "src/options/msg.h"
#include "src/codegen/output.h"
#include "src/encoding/enc.h"
#include "src/parse/input.h"
#define YYMARKER mar
#define YYFILL(n) { if (!fill (n)) fatal("unexpected end of input"); }
-#line 55 "../src/parse/lex.re"
+#line 54 "../src/parse/lex.re"
-#line 108 "../src/parse/lex.re"
+#line 107 "../src/parse/lex.re"
Scanner::ParseMode Scanner::echo(Output &out)
loc = cur_loc();
ptr = cur;
-#line 51 "src/parse/lex.cc"
+#line 50 "src/parse/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
}
}
++YYCURSOR;
-#line 206 "../src/parse/lex.re"
+#line 205 "../src/parse/lex.re"
{
if (is_eof()) {
out.wraw(tok, ptr);
}
goto loop;
}
-#line 117 "src/parse/lex.cc"
+#line 116 "src/parse/lex.cc"
yy4:
++YYCURSOR;
yy5:
-#line 225 "../src/parse/lex.re"
+#line 224 "../src/parse/lex.re"
{ goto loop; }
-#line 123 "src/parse/lex.cc"
+#line 122 "src/parse/lex.cc"
yy6:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
if (yych == '#') goto yy14;
yy7:
-#line 220 "../src/parse/lex.re"
+#line 219 "../src/parse/lex.re"
{
next_line();
goto loop;
}
-#line 137 "src/parse/lex.cc"
+#line 136 "src/parse/lex.cc"
yy8:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy6;
}
yy16:
++YYCURSOR;
-#line 121 "../src/parse/lex.re"
+#line 120 "../src/parse/lex.re"
{
out.wraw(tok, ptr);
return Parse;
}
-#line 185 "src/parse/lex.cc"
+#line 184 "src/parse/lex.cc"
yy18:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '!') goto yy20;
yy82:
++YYCURSOR;
YYCURSOR = yyt1;
-#line 214 "../src/parse/lex.re"
+#line 213 "../src/parse/lex.re"
{
out.wraw(tok, ptr + 1);
set_sourceline();
goto next;
}
-#line 487 "src/parse/lex.cc"
+#line 486 "src/parse/lex.cc"
yy84:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy82;
goto yy13;
yy115:
++YYCURSOR;
-#line 142 "../src/parse/lex.re"
+#line 141 "../src/parse/lex.re"
{
out.wraw(tok, ptr);
out.wdelay_yymaxfill();
lex_end_of_comment(out);
goto next;
}
-#line 627 "src/parse/lex.cc"
+#line 626 "src/parse/lex.cc"
yy117:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'h') goto yy128;
goto yy13;
yy122:
++YYCURSOR;
-#line 131 "../src/parse/lex.re"
+#line 130 "../src/parse/lex.re"
{
out.wraw(tok, ptr);
return Reuse;
}
-#line 655 "src/parse/lex.cc"
+#line 654 "src/parse/lex.cc"
yy124:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy133;
goto yy13;
yy138:
++YYCURSOR;
-#line 178 "../src/parse/lex.re"
+#line 177 "../src/parse/lex.re"
{
out.wraw(tok, ptr);
lex_tags(out, true);
goto next;
}
-#line 720 "src/parse/lex.cc"
+#line 719 "src/parse/lex.cc"
yy140:
++YYCURSOR;
-#line 126 "../src/parse/lex.re"
+#line 125 "../src/parse/lex.re"
{
out.wraw(tok, ptr);
return Rules;
}
-#line 728 "src/parse/lex.cc"
+#line 727 "src/parse/lex.cc"
yy142:
++YYCURSOR;
-#line 172 "../src/parse/lex.re"
+#line 171 "../src/parse/lex.re"
{
out.wraw(tok, ptr);
lex_tags(out, false);
goto next;
}
-#line 737 "src/parse/lex.cc"
+#line 736 "src/parse/lex.cc"
yy144:
++YYCURSOR;
-#line 163 "../src/parse/lex.re"
+#line 162 "../src/parse/lex.re"
{
out.wraw(tok, ptr);
out.wdelay_line_info_output();
lex_end_of_comment(out);
goto next;
}
-#line 749 "src/parse/lex.cc"
+#line 748 "src/parse/lex.cc"
yy146:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '2') goto yy152;
goto yy13;
yy148:
++YYCURSOR;
-#line 136 "../src/parse/lex.re"
+#line 135 "../src/parse/lex.re"
{
out.wraw(tok, ptr);
lex_end_of_comment(out);
goto next;
}
-#line 766 "src/parse/lex.cc"
+#line 765 "src/parse/lex.cc"
yy150:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'c') goto yy154;
goto yy13;
yy156:
++YYCURSOR;
-#line 156 "../src/parse/lex.re"
+#line 155 "../src/parse/lex.re"
{
out.wraw(tok, ptr);
out.wdelay_state_goto(0);
lex_end_of_comment(out);
goto next;
}
-#line 800 "src/parse/lex.cc"
+#line 799 "src/parse/lex.cc"
yy158:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'f') goto yy162;
goto yy13;
yy163:
++YYCURSOR;
-#line 184 "../src/parse/lex.re"
+#line 183 "../src/parse/lex.re"
{
out.wraw(tok, ptr);
out.header_mode(true);
lex_end_of_comment(out);
goto next;
}
-#line 840 "src/parse/lex.cc"
+#line 839 "src/parse/lex.cc"
yy165:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
}
yy167:
++YYCURSOR;
-#line 149 "../src/parse/lex.re"
+#line 148 "../src/parse/lex.re"
{
out.wraw(tok, ptr);
out.wdelay_yymaxnmatch();
lex_end_of_comment(out);
goto next;
}
-#line 863 "src/parse/lex.cc"
+#line 862 "src/parse/lex.cc"
yy169:
++YYCURSOR;
-#line 192 "../src/parse/lex.re"
+#line 191 "../src/parse/lex.re"
{
out.wraw(tok, ptr);
out.header_mode(false);
lex_end_of_comment(out);
goto next;
}
-#line 874 "src/parse/lex.cc"
+#line 873 "src/parse/lex.cc"
yy171:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 0x1F) {
++YYCURSOR;
x = yyt1;
y = yyt2;
-#line 200 "../src/parse/lex.re"
+#line 199 "../src/parse/lex.re"
{
out.wraw(tok, ptr);
include(getstr(x + 1, y - 1));
goto next;
}
-#line 924 "src/parse/lex.cc"
+#line 923 "src/parse/lex.cc"
}
-#line 226 "../src/parse/lex.re"
+#line 225 "../src/parse/lex.re"
}
bool multiline = false;
loop:
-#line 935 "src/parse/lex.cc"
+#line 934 "src/parse/lex.cc"
{
YYCTYPE yych;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
}
yy180:
++YYCURSOR;
-#line 235 "../src/parse/lex.re"
+#line 234 "../src/parse/lex.re"
{
- fatal(cur_loc(), "expected end of block");
+ msg.fatal(cur_loc(), "expected end of block");
}
-#line 955 "src/parse/lex.cc"
+#line 954 "src/parse/lex.cc"
yy182:
++YYCURSOR;
yy183:
-#line 234 "../src/parse/lex.re"
+#line 233 "../src/parse/lex.re"
{ goto loop; }
-#line 961 "src/parse/lex.cc"
+#line 960 "src/parse/lex.cc"
yy184:
++YYCURSOR;
-#line 238 "../src/parse/lex.re"
+#line 237 "../src/parse/lex.re"
{
next_line();
multiline = true;
goto loop;
}
-#line 970 "src/parse/lex.cc"
+#line 969 "src/parse/lex.cc"
yy186:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy184;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != '/') goto yy183;
++YYCURSOR;
-#line 243 "../src/parse/lex.re"
+#line 242 "../src/parse/lex.re"
{
if (multiline) {
out.wdelay_line_info_input(cur_loc());
}
return;
}
-#line 986 "src/parse/lex.cc"
+#line 985 "src/parse/lex.cc"
}
-#line 249 "../src/parse/lex.re"
+#line 248 "../src/parse/lex.re"
}
std::string fmt, sep;
loop:
-#line 997 "src/parse/lex.cc"
+#line 996 "src/parse/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
}
++YYCURSOR;
yy193:
-#line 257 "../src/parse/lex.re"
+#line 256 "../src/parse/lex.re"
{
- fatal(cur_loc(), "unrecognized configuration");
+ msg.fatal(cur_loc(), "unrecognized configuration");
}
-#line 1059 "src/parse/lex.cc"
+#line 1058 "src/parse/lex.cc"
yy194:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
if (yybm[0+yych] & 128) {
goto yy194;
}
-#line 268 "../src/parse/lex.re"
+#line 267 "../src/parse/lex.re"
{
goto loop;
}
-#line 1071 "src/parse/lex.cc"
+#line 1070 "src/parse/lex.cc"
yy197:
++YYCURSOR;
-#line 271 "../src/parse/lex.re"
+#line 270 "../src/parse/lex.re"
{
next_line();
goto loop;
}
-#line 1079 "src/parse/lex.cc"
+#line 1078 "src/parse/lex.cc"
yy199:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy197;
goto yy193;
yy203:
++YYCURSOR;
-#line 275 "../src/parse/lex.re"
+#line 274 "../src/parse/lex.re"
{
out.wdelay_tags(new ConfTags(fmt, sep), mtags);
return;
}
-#line 1103 "src/parse/lex.cc"
+#line 1102 "src/parse/lex.cc"
yy205:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy208;
goto yy206;
yy214:
++YYCURSOR;
-#line 260 "../src/parse/lex.re"
+#line 259 "../src/parse/lex.re"
{
fmt = lex_conf_string();
goto loop;
}
-#line 1145 "src/parse/lex.cc"
+#line 1144 "src/parse/lex.cc"
yy216:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 't') goto yy206;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'r') goto yy206;
++YYCURSOR;
-#line 264 "../src/parse/lex.re"
+#line 263 "../src/parse/lex.re"
{
sep = lex_conf_string();
goto loop;
}
-#line 1159 "src/parse/lex.cc"
+#line 1158 "src/parse/lex.cc"
}
-#line 279 "../src/parse/lex.re"
+#line 278 "../src/parse/lex.re"
}
tok = cur;
loc = cur_loc();
-#line 1172 "src/parse/lex.cc"
+#line 1171 "src/parse/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
yy223:
++YYCURSOR;
yy224:
-#line 403 "../src/parse/lex.re"
+#line 402 "../src/parse/lex.re"
{
- fatal(tok_loc(), "unexpected character: '%c'", *tok);
+ msg.fatal(tok_loc(), "unexpected character: '%c'", *tok);
goto scan;
}
-#line 1287 "src/parse/lex.cc"
+#line 1286 "src/parse/lex.cc"
yy225:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
if (yybm[0+yych] & 16) {
goto yy225;
}
-#line 385 "../src/parse/lex.re"
+#line 384 "../src/parse/lex.re"
{ goto scan; }
-#line 1297 "src/parse/lex.cc"
+#line 1296 "src/parse/lex.cc"
yy228:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == '#') goto yy258;
}
yy229:
-#line 392 "../src/parse/lex.re"
+#line 391 "../src/parse/lex.re"
{
next_line();
if (lexer_state == LEX_FLEX_NAME) {
goto scan;
}
}
-#line 1319 "src/parse/lex.cc"
+#line 1318 "src/parse/lex.cc"
yy230:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy228;
goto yy224;
yy231:
++YYCURSOR;
-#line 305 "../src/parse/lex.re"
+#line 304 "../src/parse/lex.re"
{ yylval.regexp = lex_str('"'); return TOKEN_REGEXP; }
-#line 1328 "src/parse/lex.cc"
+#line 1327 "src/parse/lex.cc"
yy233:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '^') {
yy234:
++YYCURSOR;
yy235:
-#line 314 "../src/parse/lex.re"
+#line 313 "../src/parse/lex.re"
{ return *tok; }
-#line 1345 "src/parse/lex.cc"
+#line 1344 "src/parse/lex.cc"
yy236:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '}') goto yy263;
goto yy224;
yy237:
++YYCURSOR;
-#line 304 "../src/parse/lex.re"
+#line 303 "../src/parse/lex.re"
{ yylval.regexp = lex_str('\''); return TOKEN_REGEXP; }
-#line 1354 "src/parse/lex.cc"
+#line 1353 "src/parse/lex.cc"
yy239:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '/') goto yy263;
goto yy235;
yy240:
++YYCURSOR;
-#line 380 "../src/parse/lex.re"
+#line 379 "../src/parse/lex.re"
{
yylval.regexp = ast_dot(tok_loc());
return TOKEN_REGEXP;
}
-#line 1366 "src/parse/lex.cc"
+#line 1365 "src/parse/lex.cc"
yy242:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '*') goto yy265;
goto yy224;
yy244:
++YYCURSOR;
-#line 297 "../src/parse/lex.re"
+#line 296 "../src/parse/lex.re"
{ return lex_clist(); }
-#line 1380 "src/parse/lex.cc"
+#line 1379 "src/parse/lex.cc"
yy246:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 32) {
goto yy247;
}
-#line 357 "../src/parse/lex.re"
+#line 356 "../src/parse/lex.re"
{
if (!globopts->FFlag || lex_namedef_context_re2c()) {
yylval.str = newstr(tok, cur);
// precedence in cases like ab*: it should be a(b)*, not (ab)*
cur = tok + 1;
- ASTChar c(static_cast<uint8_t>(tok[0]), tok_loc());
+ ASTChar c = {static_cast<uint8_t>(tok[0]), tok_loc()};
std::vector<ASTChar> *str = new std::vector<ASTChar>;
str->push_back(c);
yylval.regexp = ast_str(tok_loc(), str, false);
return TOKEN_REGEXP;
}
}
-#line 1417 "src/parse/lex.cc"
+#line 1416 "src/parse/lex.cc"
yy250:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '^') goto yy273;
-#line 306 "../src/parse/lex.re"
+#line 305 "../src/parse/lex.re"
{ yylval.regexp = lex_cls(false); return TOKEN_REGEXP; }
-#line 1423 "src/parse/lex.cc"
+#line 1422 "src/parse/lex.cc"
yy252:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'e') goto yy275;
}
}
yy254:
-#line 289 "../src/parse/lex.re"
+#line 288 "../src/parse/lex.re"
{ lex_code_in_braces(); return TOKEN_CODE; }
-#line 1448 "src/parse/lex.cc"
+#line 1447 "src/parse/lex.cc"
yy255:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
}
}
yy262:
-#line 309 "../src/parse/lex.re"
+#line 308 "../src/parse/lex.re"
{
yylval.regexp = ast_tag(tok_loc(), newstr(tok + 1, cur), tok[0] == '#');
return TOKEN_REGEXP;
}
-#line 1512 "src/parse/lex.cc"
+#line 1511 "src/parse/lex.cc"
yy263:
++YYCURSOR;
-#line 302 "../src/parse/lex.re"
+#line 301 "../src/parse/lex.re"
{ tok = cur; return 0; }
-#line 1517 "src/parse/lex.cc"
+#line 1516 "src/parse/lex.cc"
yy265:
++YYCURSOR;
-#line 300 "../src/parse/lex.re"
+#line 299 "../src/parse/lex.re"
{ lex_c_comment(); goto scan; }
-#line 1522 "src/parse/lex.cc"
+#line 1521 "src/parse/lex.cc"
yy267:
++YYCURSOR;
-#line 299 "../src/parse/lex.re"
+#line 298 "../src/parse/lex.re"
{ lex_cpp_comment(); goto scan; }
-#line 1527 "src/parse/lex.cc"
+#line 1526 "src/parse/lex.cc"
yy269:
yyaccept = 3;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == '>') goto yy271;
yy270:
-#line 290 "../src/parse/lex.re"
+#line 289 "../src/parse/lex.re"
{ lex_code_indented(); return TOKEN_CODE; }
-#line 1535 "src/parse/lex.cc"
+#line 1534 "src/parse/lex.cc"
yy271:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
}
yy273:
++YYCURSOR;
-#line 307 "../src/parse/lex.re"
+#line 306 "../src/parse/lex.re"
{ yylval.regexp = lex_cls(true); return TOKEN_REGEXP; }
-#line 1570 "src/parse/lex.cc"
+#line 1569 "src/parse/lex.cc"
yy275:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '2') goto yy286;
yy276:
++YYCURSOR;
yy277:
-#line 342 "../src/parse/lex.re"
+#line 341 "../src/parse/lex.re"
{
- fatal(tok_loc(), "illegal closure form, use '{n}', '{n,}', '{n,m}' "
+ msg.fatal(tok_loc(), "illegal closure form, use '{n}', '{n,}', '{n,m}' "
"where n and m are numbers");
}
-#line 1583 "src/parse/lex.cc"
+#line 1582 "src/parse/lex.cc"
yy278:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
}
yy285:
p = yyt1;
-#line 292 "../src/parse/lex.re"
+#line 291 "../src/parse/lex.re"
{
yylval.str = newstr(p, cur);
return tok[0] == ':' ? TOKEN_CJUMP : TOKEN_CNEXT;
}
-#line 1646 "src/parse/lex.cc"
+#line 1645 "src/parse/lex.cc"
yy286:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'c') goto yy293;
goto yy277;
yy288:
++YYCURSOR;
-#line 316 "../src/parse/lex.re"
+#line 315 "../src/parse/lex.re"
{
if (!s_to_u32_unsafe (tok + 1, cur - 1, yylval.bounds.min)) {
- fatal(tok_loc(), "repetition count overflow");
+ msg.fatal(tok_loc(), "repetition count overflow");
}
yylval.bounds.max = yylval.bounds.min;
return TOKEN_CLOSESIZE;
}
-#line 1668 "src/parse/lex.cc"
+#line 1667 "src/parse/lex.cc"
yy290:
++YYCURSOR;
-#line 347 "../src/parse/lex.re"
+#line 346 "../src/parse/lex.re"
{
if (!globopts->FFlag) {
- fatal(tok_loc(), "curly braces for names only allowed with -F switch");
+ msg.fatal(tok_loc(), "curly braces for names only allowed with -F switch");
}
yylval.str = newstr(tok + 1, cur - 1);
return TOKEN_ID;
}
-#line 1679 "src/parse/lex.cc"
+#line 1678 "src/parse/lex.cc"
yy292:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'n') goto yy298;
goto yy257;
yy296:
++YYCURSOR;
-#line 334 "../src/parse/lex.re"
+#line 333 "../src/parse/lex.re"
{
if (!s_to_u32_unsafe (tok + 1, cur - 2, yylval.bounds.min)) {
- fatal(tok_loc(), "repetition lower bound overflow");
+ msg.fatal(tok_loc(), "repetition lower bound overflow");
}
yylval.bounds.max = std::numeric_limits<uint32_t>::max();
return TOKEN_CLOSESIZE;
}
-#line 1706 "src/parse/lex.cc"
+#line 1705 "src/parse/lex.cc"
yy298:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'e') goto yy303;
goto yy257;
yy299:
++YYCURSOR;
-#line 355 "../src/parse/lex.re"
+#line 354 "../src/parse/lex.re"
{ return TOKEN_CONF; }
-#line 1715 "src/parse/lex.cc"
+#line 1714 "src/parse/lex.cc"
yy301:
++YYCURSOR;
p = yyt1;
-#line 324 "../src/parse/lex.re"
+#line 323 "../src/parse/lex.re"
{
if (!s_to_u32_unsafe (tok + 1, p, yylval.bounds.min)) {
- fatal(tok_loc(), "repetition lower bound overflow");
+ msg.fatal(tok_loc(), "repetition lower bound overflow");
}
if (!s_to_u32_unsafe (p + 1, cur - 1, yylval.bounds.max)) {
- fatal(tok_loc(), "repetition upper bound overflow");
+ msg.fatal(tok_loc(), "repetition upper bound overflow");
}
return TOKEN_CLOSESIZE;
}
-#line 1729 "src/parse/lex.cc"
+#line 1728 "src/parse/lex.cc"
yy303:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '0') goto yy305;
yy310:
++YYCURSOR;
YYCURSOR = yyt1;
-#line 387 "../src/parse/lex.re"
+#line 386 "../src/parse/lex.re"
{
set_sourceline ();
return TOKEN_LINE_INFO;
}
-#line 1790 "src/parse/lex.cc"
+#line 1789 "src/parse/lex.cc"
yy312:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy310;
if (yych == '\n') goto yy257;
goto yy313;
}
-#line 407 "../src/parse/lex.re"
+#line 406 "../src/parse/lex.re"
}
bool Scanner::lex_namedef_context_re2c()
{
-#line 1823 "src/parse/lex.cc"
+#line 1822 "src/parse/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
}
}
yy319:
-#line 414 "../src/parse/lex.re"
+#line 413 "../src/parse/lex.re"
{ return false; }
-#line 1880 "src/parse/lex.cc"
+#line 1879 "src/parse/lex.cc"
yy320:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
if (yych == '>') goto yy322;
++YYCURSOR;
YYCURSOR = yyt1;
-#line 413 "../src/parse/lex.re"
+#line 412 "../src/parse/lex.re"
{ return true; }
-#line 1899 "src/parse/lex.cc"
+#line 1898 "src/parse/lex.cc"
}
-#line 415 "../src/parse/lex.re"
+#line 414 "../src/parse/lex.re"
}
bool Scanner::lex_namedef_context_flex()
{
-#line 1908 "src/parse/lex.cc"
+#line 1907 "src/parse/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
yyt1 = YYCURSOR;
goto yy329;
}
-#line 423 "../src/parse/lex.re"
+#line 422 "../src/parse/lex.re"
{ return false; }
-#line 1957 "src/parse/lex.cc"
+#line 1956 "src/parse/lex.cc"
yy329:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
if (yych == '{') goto yy332;
}
YYCURSOR = yyt1;
-#line 422 "../src/parse/lex.re"
+#line 421 "../src/parse/lex.re"
{ return true; }
-#line 1974 "src/parse/lex.cc"
+#line 1973 "src/parse/lex.cc"
yy332:
++YYCURSOR;
YYCURSOR = yyt1;
-#line 421 "../src/parse/lex.re"
+#line 420 "../src/parse/lex.re"
{ return false; }
-#line 1980 "src/parse/lex.cc"
+#line 1979 "src/parse/lex.cc"
}
-#line 424 "../src/parse/lex.re"
+#line 423 "../src/parse/lex.re"
}
int kind = TOKEN_CLIST;
CondList *cl = new CondList;
-#line 1991 "src/parse/lex.cc"
+#line 1990 "src/parse/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
if (yych <= '!') goto yy338;
if (yych == '>') goto yy341;
yy337:
-#line 434 "../src/parse/lex.re"
+#line 433 "../src/parse/lex.re"
{ goto cond; }
-#line 2043 "src/parse/lex.cc"
+#line 2042 "src/parse/lex.cc"
yy338:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
if (yych == '\t') goto yy338;
if (yych == ' ') goto yy338;
-#line 432 "../src/parse/lex.re"
+#line 431 "../src/parse/lex.re"
{ kind = TOKEN_CSETUP; goto cond; }
-#line 2052 "src/parse/lex.cc"
+#line 2051 "src/parse/lex.cc"
yy341:
++YYCURSOR;
-#line 433 "../src/parse/lex.re"
+#line 432 "../src/parse/lex.re"
{ kind = TOKEN_CZERO; goto end; }
-#line 2057 "src/parse/lex.cc"
+#line 2056 "src/parse/lex.cc"
}
-#line 435 "../src/parse/lex.re"
+#line 434 "../src/parse/lex.re"
cond:
tok = cur;
-#line 2064 "src/parse/lex.cc"
+#line 2063 "src/parse/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
}
yy345:
++YYCURSOR;
-#line 441 "../src/parse/lex.re"
+#line 440 "../src/parse/lex.re"
{ goto error; }
-#line 2118 "src/parse/lex.cc"
+#line 2117 "src/parse/lex.cc"
yy347:
++YYCURSOR;
-#line 440 "../src/parse/lex.re"
+#line 439 "../src/parse/lex.re"
{ if (!cl->empty()) goto error; cl->insert("*"); goto next; }
-#line 2123 "src/parse/lex.cc"
+#line 2122 "src/parse/lex.cc"
yy349:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
if (yybm[0+yych] & 128) {
goto yy349;
}
-#line 439 "../src/parse/lex.re"
+#line 438 "../src/parse/lex.re"
{ cl->insert(getstr(tok, cur)); goto next; }
-#line 2133 "src/parse/lex.cc"
+#line 2132 "src/parse/lex.cc"
}
-#line 442 "../src/parse/lex.re"
+#line 441 "../src/parse/lex.re"
next:
-#line 2139 "src/parse/lex.cc"
+#line 2138 "src/parse/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
}
++YYCURSOR;
yy355:
-#line 447 "../src/parse/lex.re"
+#line 446 "../src/parse/lex.re"
{ goto error; }
-#line 2192 "src/parse/lex.cc"
+#line 2191 "src/parse/lex.cc"
yy356:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= ' ') {
if (yybm[0+yych] & 128) {
goto yy357;
}
-#line 445 "../src/parse/lex.re"
+#line 444 "../src/parse/lex.re"
{ goto cond; }
-#line 2216 "src/parse/lex.cc"
+#line 2215 "src/parse/lex.cc"
yy360:
++YYCURSOR;
-#line 446 "../src/parse/lex.re"
+#line 445 "../src/parse/lex.re"
{ goto end; }
-#line 2221 "src/parse/lex.cc"
+#line 2220 "src/parse/lex.cc"
yy362:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
YYCURSOR = YYMARKER;
goto yy355;
}
-#line 448 "../src/parse/lex.re"
+#line 447 "../src/parse/lex.re"
end:
yylval.clist = cl;
return kind;
error:
delete cl;
- fatal(cur_loc(), "syntax error in condition list");
+ msg.fatal(cur_loc(), "syntax error in condition list");
}
void Scanner::lex_code_indented()
tok = cur;
code:
-#line 2255 "src/parse/lex.cc"
+#line 2254 "src/parse/lex.cc"
{
YYCTYPE yych;
if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
}
yy367:
++YYCURSOR;
-#line 473 "../src/parse/lex.re"
+#line 472 "../src/parse/lex.re"
{ fail_if_eof(); goto code; }
-#line 2285 "src/parse/lex.cc"
+#line 2284 "src/parse/lex.cc"
yy369:
++YYCURSOR;
yy370:
-#line 478 "../src/parse/lex.re"
+#line 477 "../src/parse/lex.re"
{ goto code; }
-#line 2291 "src/parse/lex.cc"
+#line 2290 "src/parse/lex.cc"
yy371:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '\f') {
if (yych == ' ') goto yy379;
}
yy372:
-#line 464 "../src/parse/lex.re"
+#line 463 "../src/parse/lex.re"
{
next_line();
while (isspace(tok[0])) ++tok;
yylval.code = new Code(loc, getstr(tok, p));
return;
}
-#line 2311 "src/parse/lex.cc"
+#line 2310 "src/parse/lex.cc"
yy373:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy371;
goto yy370;
yy374:
++YYCURSOR;
-#line 477 "../src/parse/lex.re"
+#line 476 "../src/parse/lex.re"
{ lex_string(cur[-1]); goto code; }
-#line 2320 "src/parse/lex.cc"
+#line 2319 "src/parse/lex.cc"
yy376:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '*') goto yy381;
goto yy370;
yy377:
++YYCURSOR;
-#line 474 "../src/parse/lex.re"
- { fatal(cur_loc(), "Curly braces are not allowed after ':='"); }
-#line 2330 "src/parse/lex.cc"
+#line 473 "../src/parse/lex.re"
+ { msg.fatal(cur_loc(), "Curly braces are not allowed after ':='"); }
+#line 2329 "src/parse/lex.cc"
yy379:
++YYCURSOR;
YYCURSOR -= 1;
-#line 463 "../src/parse/lex.re"
+#line 462 "../src/parse/lex.re"
{ next_line(); goto code; }
-#line 2336 "src/parse/lex.cc"
+#line 2335 "src/parse/lex.cc"
yy381:
++YYCURSOR;
-#line 475 "../src/parse/lex.re"
+#line 474 "../src/parse/lex.re"
{ lex_c_comment(); goto code; }
-#line 2341 "src/parse/lex.cc"
+#line 2340 "src/parse/lex.cc"
yy383:
++YYCURSOR;
-#line 476 "../src/parse/lex.re"
+#line 475 "../src/parse/lex.re"
{ lex_cpp_comment(); goto code; }
-#line 2346 "src/parse/lex.cc"
+#line 2345 "src/parse/lex.cc"
}
-#line 479 "../src/parse/lex.re"
+#line 478 "../src/parse/lex.re"
}
uint32_t depth = 1;
code:
-#line 2358 "src/parse/lex.cc"
+#line 2357 "src/parse/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
}
yy387:
++YYCURSOR;
-#line 499 "../src/parse/lex.re"
+#line 498 "../src/parse/lex.re"
{ fail_if_eof(); goto code; }
-#line 2422 "src/parse/lex.cc"
+#line 2421 "src/parse/lex.cc"
yy389:
++YYCURSOR;
yy390:
-#line 503 "../src/parse/lex.re"
+#line 502 "../src/parse/lex.re"
{ goto code; }
-#line 2428 "src/parse/lex.cc"
+#line 2427 "src/parse/lex.cc"
yy391:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 32) {
}
if (yych == '#') goto yy404;
yy392:
-#line 498 "../src/parse/lex.re"
+#line 497 "../src/parse/lex.re"
{ next_line(); goto code; }
-#line 2438 "src/parse/lex.cc"
+#line 2437 "src/parse/lex.cc"
yy393:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy391;
goto yy390;
yy394:
++YYCURSOR;
-#line 502 "../src/parse/lex.re"
+#line 501 "../src/parse/lex.re"
{ lex_string(cur[-1]); goto code; }
-#line 2447 "src/parse/lex.cc"
+#line 2446 "src/parse/lex.cc"
yy396:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '*') goto yy406;
goto yy390;
yy397:
++YYCURSOR;
-#line 496 "../src/parse/lex.re"
+#line 495 "../src/parse/lex.re"
{ ++depth; goto code; }
-#line 2457 "src/parse/lex.cc"
+#line 2456 "src/parse/lex.cc"
yy399:
++YYCURSOR;
-#line 488 "../src/parse/lex.re"
+#line 487 "../src/parse/lex.re"
{
if (--depth == 0) {
yylval.code = new Code(loc, getstr(tok, cur));
}
goto code;
}
-#line 2468 "src/parse/lex.cc"
+#line 2467 "src/parse/lex.cc"
yy401:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
}
yy406:
++YYCURSOR;
-#line 500 "../src/parse/lex.re"
+#line 499 "../src/parse/lex.re"
{ lex_c_comment(); goto code; }
-#line 2496 "src/parse/lex.cc"
+#line 2495 "src/parse/lex.cc"
yy408:
++YYCURSOR;
-#line 501 "../src/parse/lex.re"
+#line 500 "../src/parse/lex.re"
{ lex_cpp_comment(); goto code; }
-#line 2501 "src/parse/lex.cc"
+#line 2500 "src/parse/lex.cc"
yy410:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'i') goto yy403;
yy420:
++YYCURSOR;
YYCURSOR = yyt1;
-#line 497 "../src/parse/lex.re"
+#line 496 "../src/parse/lex.re"
{ set_sourceline (); goto code; }
-#line 2560 "src/parse/lex.cc"
+#line 2559 "src/parse/lex.cc"
yy422:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy420;
if (yych == '\n') goto yy403;
goto yy423;
}
-#line 504 "../src/parse/lex.re"
+#line 503 "../src/parse/lex.re"
}
{
loop:
-#line 2594 "src/parse/lex.cc"
+#line 2593 "src/parse/lex.cc"
{
YYCTYPE yych;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
}
yy429:
++YYCURSOR;
-#line 514 "../src/parse/lex.re"
+#line 513 "../src/parse/lex.re"
{ fail_if_eof(); goto loop; }
-#line 2622 "src/parse/lex.cc"
+#line 2621 "src/parse/lex.cc"
yy431:
++YYCURSOR;
yy432:
-#line 515 "../src/parse/lex.re"
+#line 514 "../src/parse/lex.re"
{ goto loop; }
-#line 2628 "src/parse/lex.cc"
+#line 2627 "src/parse/lex.cc"
yy433:
++YYCURSOR;
-#line 513 "../src/parse/lex.re"
+#line 512 "../src/parse/lex.re"
{ next_line(); goto loop; }
-#line 2633 "src/parse/lex.cc"
+#line 2632 "src/parse/lex.cc"
yy435:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy433;
goto yy432;
yy436:
++YYCURSOR;
-#line 511 "../src/parse/lex.re"
+#line 510 "../src/parse/lex.re"
{ if (cur[-1] == delim) return; else goto loop; }
-#line 2642 "src/parse/lex.cc"
+#line 2641 "src/parse/lex.cc"
yy438:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '&') {
}
yy439:
++YYCURSOR;
-#line 512 "../src/parse/lex.re"
+#line 511 "../src/parse/lex.re"
{ goto loop; }
-#line 2655 "src/parse/lex.cc"
+#line 2654 "src/parse/lex.cc"
}
-#line 516 "../src/parse/lex.re"
+#line 515 "../src/parse/lex.re"
}
{
loop:
-#line 2665 "src/parse/lex.cc"
+#line 2664 "src/parse/lex.cc"
{
YYCTYPE yych;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
}
yy443:
++YYCURSOR;
-#line 525 "../src/parse/lex.re"
+#line 524 "../src/parse/lex.re"
{ fail_if_eof(); goto loop; }
-#line 2683 "src/parse/lex.cc"
+#line 2682 "src/parse/lex.cc"
yy445:
++YYCURSOR;
yy446:
-#line 526 "../src/parse/lex.re"
+#line 525 "../src/parse/lex.re"
{ goto loop; }
-#line 2689 "src/parse/lex.cc"
+#line 2688 "src/parse/lex.cc"
yy447:
++YYCURSOR;
-#line 524 "../src/parse/lex.re"
+#line 523 "../src/parse/lex.re"
{ next_line(); goto loop; }
-#line 2694 "src/parse/lex.cc"
+#line 2693 "src/parse/lex.cc"
yy449:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy447;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != '/') goto yy446;
++YYCURSOR;
-#line 523 "../src/parse/lex.re"
+#line 522 "../src/parse/lex.re"
{ return; }
-#line 2705 "src/parse/lex.cc"
+#line 2704 "src/parse/lex.cc"
}
-#line 527 "../src/parse/lex.re"
+#line 526 "../src/parse/lex.re"
}
{
loop:
-#line 2715 "src/parse/lex.cc"
+#line 2714 "src/parse/lex.cc"
{
YYCTYPE yych;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
}
yy455:
++YYCURSOR;
-#line 535 "../src/parse/lex.re"
+#line 534 "../src/parse/lex.re"
{ fail_if_eof(); goto loop; }
-#line 2732 "src/parse/lex.cc"
+#line 2731 "src/parse/lex.cc"
yy457:
++YYCURSOR;
yy458:
-#line 536 "../src/parse/lex.re"
+#line 535 "../src/parse/lex.re"
{ goto loop; }
-#line 2738 "src/parse/lex.cc"
+#line 2737 "src/parse/lex.cc"
yy459:
++YYCURSOR;
-#line 534 "../src/parse/lex.re"
+#line 533 "../src/parse/lex.re"
{ next_line(); return; }
-#line 2743 "src/parse/lex.cc"
+#line 2742 "src/parse/lex.cc"
yy461:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy459;
goto yy458;
}
-#line 537 "../src/parse/lex.re"
+#line 536 "../src/parse/lex.re"
}
fst:
tok = cur;
-#line 2762 "src/parse/lex.cc"
+#line 2761 "src/parse/lex.cc"
{
YYCTYPE yych;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
if (yych == ']') goto yy465;
-#line 550 "../src/parse/lex.re"
+#line 549 "../src/parse/lex.re"
{ l = lex_cls_chr(); goto snd; }
-#line 2770 "src/parse/lex.cc"
+#line 2769 "src/parse/lex.cc"
yy465:
++YYCURSOR;
-#line 549 "../src/parse/lex.re"
+#line 548 "../src/parse/lex.re"
{ return ast_cls(loc0, cls, neg); }
-#line 2775 "src/parse/lex.cc"
+#line 2774 "src/parse/lex.cc"
}
-#line 551 "../src/parse/lex.re"
+#line 550 "../src/parse/lex.re"
snd:
-#line 2781 "src/parse/lex.cc"
+#line 2780 "src/parse/lex.cc"
{
YYCTYPE yych;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = (YYCTYPE)*(YYMARKER = YYCURSOR);
if (yych == '-') goto yy470;
yy469:
-#line 554 "../src/parse/lex.re"
+#line 553 "../src/parse/lex.re"
{ u = l; goto add; }
-#line 2790 "src/parse/lex.cc"
+#line 2789 "src/parse/lex.cc"
yy470:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != ']') goto yy472;
yy472:
++YYCURSOR;
YYCURSOR -= 1;
-#line 555 "../src/parse/lex.re"
+#line 554 "../src/parse/lex.re"
{
u = lex_cls_chr();
if (l > u) {
- warn.swapped_range(loc, l, u);
+ msg.warn.swapped_range(loc, l, u);
std::swap(l, u);
}
goto add;
}
-#line 2808 "src/parse/lex.cc"
+#line 2807 "src/parse/lex.cc"
}
-#line 563 "../src/parse/lex.re"
+#line 562 "../src/parse/lex.re"
add:
cls->push_back(ASTRange(l, u, loc));
tok = cur;
const loc_t &loc = cur_loc();
-#line 2823 "src/parse/lex.cc"
+#line 2822 "src/parse/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
}
yy476:
++YYCURSOR;
-#line 576 "../src/parse/lex.re"
+#line 575 "../src/parse/lex.re"
{ fail_if_eof(); return 0; }
-#line 2842 "src/parse/lex.cc"
+#line 2841 "src/parse/lex.cc"
yy478:
++YYCURSOR;
yy479:
-#line 582 "../src/parse/lex.re"
+#line 581 "../src/parse/lex.re"
{ return static_cast<uint8_t>(tok[0]); }
-#line 2848 "src/parse/lex.cc"
+#line 2847 "src/parse/lex.cc"
yy480:
++YYCURSOR;
-#line 577 "../src/parse/lex.re"
- { fatal(loc, "newline in character class"); }
-#line 2853 "src/parse/lex.cc"
+#line 576 "../src/parse/lex.re"
+ { msg.fatal(loc, "newline in character class"); }
+#line 2852 "src/parse/lex.cc"
yy482:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy480;
}
}
yy484:
-#line 580 "../src/parse/lex.re"
- { fatal(loc, "syntax error in escape sequence"); }
-#line 2914 "src/parse/lex.cc"
+#line 579 "../src/parse/lex.re"
+ { msg.fatal(loc, "syntax error in escape sequence"); }
+#line 2913 "src/parse/lex.cc"
yy485:
++YYCURSOR;
yy486:
-#line 595 "../src/parse/lex.re"
+#line 594 "../src/parse/lex.re"
{
- warn.useless_escape(loc, tok[1]);
+ msg.warn.useless_escape(loc, tok[1]);
return static_cast<uint8_t>(tok[1]);
}
-#line 2923 "src/parse/lex.cc"
+#line 2922 "src/parse/lex.cc"
yy487:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy480;
goto yy486;
yy488:
++YYCURSOR;
-#line 593 "../src/parse/lex.re"
+#line 592 "../src/parse/lex.re"
{ return static_cast<uint8_t>('-'); }
-#line 2932 "src/parse/lex.cc"
+#line 2931 "src/parse/lex.cc"
yy490:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= '/') goto yy491;
if (yych <= '7') goto yy515;
yy491:
-#line 579 "../src/parse/lex.re"
- { fatal(loc, "syntax error in octal escape sequence"); }
-#line 2941 "src/parse/lex.cc"
+#line 578 "../src/parse/lex.re"
+ { msg.fatal(loc, "syntax error in octal escape sequence"); }
+#line 2940 "src/parse/lex.cc"
yy492:
++YYCURSOR;
goto yy491;
if (yych <= 'f') goto yy517;
}
yy494:
-#line 578 "../src/parse/lex.re"
- { fatal(loc, "syntax error in hexadecimal escape sequence"); }
-#line 2959 "src/parse/lex.cc"
+#line 577 "../src/parse/lex.re"
+ { msg.fatal(loc, "syntax error in hexadecimal escape sequence"); }
+#line 2958 "src/parse/lex.cc"
yy495:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
yy496:
++YYCURSOR;
-#line 592 "../src/parse/lex.re"
+#line 591 "../src/parse/lex.re"
{ return static_cast<uint8_t>('\\'); }
-#line 2977 "src/parse/lex.cc"
+#line 2976 "src/parse/lex.cc"
yy498:
++YYCURSOR;
-#line 594 "../src/parse/lex.re"
+#line 593 "../src/parse/lex.re"
{ return static_cast<uint8_t>(']'); }
-#line 2982 "src/parse/lex.cc"
+#line 2981 "src/parse/lex.cc"
yy500:
++YYCURSOR;
-#line 585 "../src/parse/lex.re"
+#line 584 "../src/parse/lex.re"
{ return static_cast<uint8_t>('\a'); }
-#line 2987 "src/parse/lex.cc"
+#line 2986 "src/parse/lex.cc"
yy502:
++YYCURSOR;
-#line 586 "../src/parse/lex.re"
+#line 585 "../src/parse/lex.re"
{ return static_cast<uint8_t>('\b'); }
-#line 2992 "src/parse/lex.cc"
+#line 2991 "src/parse/lex.cc"
yy504:
++YYCURSOR;
-#line 587 "../src/parse/lex.re"
+#line 586 "../src/parse/lex.re"
{ return static_cast<uint8_t>('\f'); }
-#line 2997 "src/parse/lex.cc"
+#line 2996 "src/parse/lex.cc"
yy506:
++YYCURSOR;
-#line 588 "../src/parse/lex.re"
+#line 587 "../src/parse/lex.re"
{ return static_cast<uint8_t>('\n'); }
-#line 3002 "src/parse/lex.cc"
+#line 3001 "src/parse/lex.cc"
yy508:
++YYCURSOR;
-#line 589 "../src/parse/lex.re"
+#line 588 "../src/parse/lex.re"
{ return static_cast<uint8_t>('\r'); }
-#line 3007 "src/parse/lex.cc"
+#line 3006 "src/parse/lex.cc"
yy510:
++YYCURSOR;
-#line 590 "../src/parse/lex.re"
+#line 589 "../src/parse/lex.re"
{ return static_cast<uint8_t>('\t'); }
-#line 3012 "src/parse/lex.cc"
+#line 3011 "src/parse/lex.cc"
yy512:
++YYCURSOR;
-#line 591 "../src/parse/lex.re"
+#line 590 "../src/parse/lex.re"
{ return static_cast<uint8_t>('\v'); }
-#line 3017 "src/parse/lex.cc"
+#line 3016 "src/parse/lex.cc"
yy514:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
yy520:
++YYCURSOR;
-#line 584 "../src/parse/lex.re"
+#line 583 "../src/parse/lex.re"
{ return unesc_oct(tok, cur); }
-#line 3082 "src/parse/lex.cc"
+#line 3081 "src/parse/lex.cc"
yy522:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
}
yy524:
++YYCURSOR;
-#line 583 "../src/parse/lex.re"
+#line 582 "../src/parse/lex.re"
{ return unesc_hex(tok, cur); }
-#line 3111 "src/parse/lex.cc"
+#line 3110 "src/parse/lex.cc"
yy526:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
goto yy516;
}
}
-#line 599 "../src/parse/lex.re"
+#line 598 "../src/parse/lex.re"
}
const loc_t &loc = ast.loc;
bool ok = true;
-#line 3146 "src/parse/lex.cc"
+#line 3145 "src/parse/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
}
yy530:
++YYCURSOR;
-#line 615 "../src/parse/lex.re"
+#line 614 "../src/parse/lex.re"
{ fail_if_eof(); ast.chr = 0; goto end; }
-#line 3165 "src/parse/lex.cc"
+#line 3164 "src/parse/lex.cc"
yy532:
++YYCURSOR;
yy533:
-#line 617 "../src/parse/lex.re"
+#line 616 "../src/parse/lex.re"
{ ok = tok[0] != quote; ast.chr = static_cast<uint8_t>(tok[0]); goto end; }
-#line 3171 "src/parse/lex.cc"
+#line 3170 "src/parse/lex.cc"
yy534:
++YYCURSOR;
-#line 610 "../src/parse/lex.re"
- { fatal(loc, "newline in character string"); }
-#line 3176 "src/parse/lex.cc"
+#line 609 "../src/parse/lex.re"
+ { msg.fatal(loc, "newline in character string"); }
+#line 3175 "src/parse/lex.cc"
yy536:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy534;
}
}
yy538:
-#line 613 "../src/parse/lex.re"
- { fatal(loc, "syntax error in escape sequence"); }
-#line 3232 "src/parse/lex.cc"
+#line 612 "../src/parse/lex.re"
+ { msg.fatal(loc, "syntax error in escape sequence"); }
+#line 3231 "src/parse/lex.cc"
yy539:
++YYCURSOR;
yy540:
-#line 628 "../src/parse/lex.re"
+#line 627 "../src/parse/lex.re"
{
const char c = tok[1];
ast.chr = static_cast<uint8_t>(c);
if (tok[1] != quote) {
- warn.useless_escape(loc, c);
+ msg.warn.useless_escape(loc, c);
}
goto end;
}
-#line 3245 "src/parse/lex.cc"
+#line 3244 "src/parse/lex.cc"
yy541:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy534;
if (yych <= '/') goto yy543;
if (yych <= '7') goto yy565;
yy543:
-#line 612 "../src/parse/lex.re"
- { fatal(loc, "syntax error in octal escape sequence"); }
-#line 3258 "src/parse/lex.cc"
+#line 611 "../src/parse/lex.re"
+ { msg.fatal(loc, "syntax error in octal escape sequence"); }
+#line 3257 "src/parse/lex.cc"
yy544:
++YYCURSOR;
goto yy543;
if (yych <= 'f') goto yy567;
}
yy546:
-#line 611 "../src/parse/lex.re"
- { fatal(loc, "syntax error in hexadecimal escape sequence"); }
-#line 3276 "src/parse/lex.cc"
+#line 610 "../src/parse/lex.re"
+ { msg.fatal(loc, "syntax error in hexadecimal escape sequence"); }
+#line 3275 "src/parse/lex.cc"
yy547:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
yy548:
++YYCURSOR;
-#line 627 "../src/parse/lex.re"
+#line 626 "../src/parse/lex.re"
{ ast.chr = static_cast<uint8_t>('\\'); goto end; }
-#line 3294 "src/parse/lex.cc"
+#line 3293 "src/parse/lex.cc"
yy550:
++YYCURSOR;
-#line 620 "../src/parse/lex.re"
+#line 619 "../src/parse/lex.re"
{ ast.chr = static_cast<uint8_t>('\a'); goto end; }
-#line 3299 "src/parse/lex.cc"
+#line 3298 "src/parse/lex.cc"
yy552:
++YYCURSOR;
-#line 621 "../src/parse/lex.re"
+#line 620 "../src/parse/lex.re"
{ ast.chr = static_cast<uint8_t>('\b'); goto end; }
-#line 3304 "src/parse/lex.cc"
+#line 3303 "src/parse/lex.cc"
yy554:
++YYCURSOR;
-#line 622 "../src/parse/lex.re"
+#line 621 "../src/parse/lex.re"
{ ast.chr = static_cast<uint8_t>('\f'); goto end; }
-#line 3309 "src/parse/lex.cc"
+#line 3308 "src/parse/lex.cc"
yy556:
++YYCURSOR;
-#line 623 "../src/parse/lex.re"
+#line 622 "../src/parse/lex.re"
{ ast.chr = static_cast<uint8_t>('\n'); goto end; }
-#line 3314 "src/parse/lex.cc"
+#line 3313 "src/parse/lex.cc"
yy558:
++YYCURSOR;
-#line 624 "../src/parse/lex.re"
+#line 623 "../src/parse/lex.re"
{ ast.chr = static_cast<uint8_t>('\r'); goto end; }
-#line 3319 "src/parse/lex.cc"
+#line 3318 "src/parse/lex.cc"
yy560:
++YYCURSOR;
-#line 625 "../src/parse/lex.re"
+#line 624 "../src/parse/lex.re"
{ ast.chr = static_cast<uint8_t>('\t'); goto end; }
-#line 3324 "src/parse/lex.cc"
+#line 3323 "src/parse/lex.cc"
yy562:
++YYCURSOR;
-#line 626 "../src/parse/lex.re"
+#line 625 "../src/parse/lex.re"
{ ast.chr = static_cast<uint8_t>('\v'); goto end; }
-#line 3329 "src/parse/lex.cc"
+#line 3328 "src/parse/lex.cc"
yy564:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
yy570:
++YYCURSOR;
-#line 619 "../src/parse/lex.re"
+#line 618 "../src/parse/lex.re"
{ ast.chr = unesc_oct(tok, cur); goto end; }
-#line 3394 "src/parse/lex.cc"
+#line 3393 "src/parse/lex.cc"
yy572:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
}
yy574:
++YYCURSOR;
-#line 618 "../src/parse/lex.re"
+#line 617 "../src/parse/lex.re"
{ ast.chr = unesc_hex(tok, cur); goto end; }
-#line 3423 "src/parse/lex.cc"
+#line 3422 "src/parse/lex.cc"
yy576:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
goto yy566;
}
}
-#line 636 "../src/parse/lex.re"
+#line 635 "../src/parse/lex.re"
end:
return ok;
sourceline:
tok = cur;
-#line 3471 "src/parse/lex.cc"
+#line 3470 "src/parse/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
}
}
++YYCURSOR;
-#line 676 "../src/parse/lex.re"
+#line 678 "../src/parse/lex.re"
{ --cur; return; }
-#line 3531 "src/parse/lex.cc"
+#line 3530 "src/parse/lex.cc"
yy582:
++YYCURSOR;
yy583:
-#line 677 "../src/parse/lex.re"
+#line 679 "../src/parse/lex.re"
{ goto sourceline; }
-#line 3537 "src/parse/lex.cc"
+#line 3536 "src/parse/lex.cc"
yy584:
++YYCURSOR;
-#line 675 "../src/parse/lex.re"
+#line 677 "../src/parse/lex.re"
{ pos = tok = cur; return; }
-#line 3542 "src/parse/lex.cc"
+#line 3541 "src/parse/lex.cc"
yy586:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy584;
if (yybm[0+yych] & 64) {
goto yy588;
}
-#line 659 "../src/parse/lex.re"
+#line 658 "../src/parse/lex.re"
{
uint32_t l;
if (!s_to_u32_unsafe(tok, cur, l)) {
- fatal(tok_loc(), "line number overflow");
+ msg.fatal(tok_loc(), "line number overflow");
}
set_line(l);
goto sourceline;
}
-#line 3568 "src/parse/lex.cc"
+#line 3567 "src/parse/lex.cc"
yy591:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
goto yy583;
yy594:
++YYCURSOR;
-#line 668 "../src/parse/lex.re"
+#line 667 "../src/parse/lex.re"
{
- std::string &name = get_input().escaped_name;
+ Input &in = get_input();
+ std::string &name = in.escaped_name;
name = getstr(tok + 1, cur - 1);
strrreplace(name, "\\", "\\\\");
+ in.fidx = static_cast<uint32_t>(msg.filenames.size());
+ msg.filenames.push_back(name);
goto sourceline;
}
-#line 3592 "src/parse/lex.cc"
+#line 3594 "src/parse/lex.cc"
yy596:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
if (yych == '\n') goto yy593;
goto yy591;
}
-#line 678 "../src/parse/lex.re"
+#line 680 "../src/parse/lex.re"
}
void Scanner::fail_if_eof() const
{
if (is_eof()) {
- fatal(cur_loc(), "unexpected end of input");
+ msg.fatal(cur_loc(), "unexpected end of input");
}
}
-/* Generated by re2c 1.1.1 on Tue Feb 12 17:26:39 2019 */
+/* Generated by re2c 1.1.1 on Tue Feb 12 22:50:47 2019 */
#include <string.h>
#include "src/util/forbid_copy.h"
-/* Generated by re2c 1.1.1 on Tue Feb 12 17:07:55 2019 */
+/* Generated by re2c 1.1.1 on Tue Feb 12 22:50:47 2019 */
#line 1 "../src/parse/lex_conf.re"
#include "src/util/c99_stdint.h"
#include <string>
#include "src/codegen/output.h"
-#include "src/options/msg.h"
#include "src/encoding/enc.h"
#include "src/parse/ast.h"
#include "src/parse/scanner.h"
#define YYFILL(n) { if (!fill (n)) fatal("unexpected end of input"); }
// global re2c config (affects the whole file)
-#line 38 "../src/parse/lex_conf.re"
+#line 37 "../src/parse/lex_conf.re"
void Scanner::lex_conf(Opt &opts)
{
tok = cur;
-#line 28 "src/parse/lex_conf.cc"
+#line 27 "src/parse/lex_conf.cc"
{
unsigned char yych;
unsigned int yyaccept = 0;
}
}
yy2:
-#line 174 "../src/parse/lex_conf.re"
+#line 173 "../src/parse/lex_conf.re"
{
- fatal(tok_loc(), "unrecognized configuration '%.*s'",
+ msg.fatal(tok_loc(), "unrecognized configuration '%.*s'",
static_cast<int>(cur - tok), tok);
}
-#line 114 "src/parse/lex_conf.cc"
+#line 113 "src/parse/lex_conf.cc"
yy3:
++cur;
if (lim <= cur) YYFILL(1);
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 72 "../src/parse/lex_conf.re"
+#line 71 "../src/parse/lex_conf.re"
{
const int32_t eof = lex_conf_number();
if (eof < 0) {
- fatal(cur_loc(), "eof cannot have negative value");
+ msg.fatal(cur_loc(), "eof cannot have negative value");
}
opts.set_eof(static_cast<uint32_t>(eof));
return;
}
-#line 241 "src/parse/lex_conf.cc"
+#line 240 "src/parse/lex_conf.cc"
yy31:
yych = (unsigned char)*++cur;
if (yych == 'g') goto yy43;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 66 "../src/parse/lex_conf.re"
+#line 65 "../src/parse/lex_conf.re"
{ lex_conf_enc(Enc::UTF8, opts); return; }
-#line 527 "src/parse/lex_conf.cc"
+#line 526 "src/parse/lex_conf.cc"
yy95:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 55 "../src/parse/lex_conf.re"
+#line 54 "../src/parse/lex_conf.re"
{
bool b = lex_conf_bool();
opts.set_posix_syntax(b);
opts.set_posix_semantics(b);
return;
}
-#line 540 "src/parse/lex_conf.cc"
+#line 539 "src/parse/lex_conf.cc"
yy97:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 49 "../src/parse/lex_conf.re"
+#line 48 "../src/parse/lex_conf.re"
{ opts.set_tags (lex_conf_bool()); return; }
-#line 548 "src/parse/lex_conf.cc"
+#line 547 "src/parse/lex_conf.cc"
yy99:
yych = (unsigned char)*++cur;
if (yych <= 'Z') {
}
}
yy100:
-#line 44 "../src/parse/lex_conf.re"
+#line 43 "../src/parse/lex_conf.re"
{ opts.set_bFlag (lex_conf_bool()); return; }
-#line 569 "src/parse/lex_conf.cc"
+#line 568 "src/parse/lex_conf.cc"
yy101:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy144;
}
}
yy103:
-#line 45 "../src/parse/lex_conf.re"
+#line 44 "../src/parse/lex_conf.re"
{ opts.set_dFlag (lex_conf_bool()); return; }
-#line 595 "src/parse/lex_conf.cc"
+#line 594 "src/parse/lex_conf.cc"
yy104:
yych = (unsigned char)*++cur;
if (yych <= '_') {
}
}
yy105:
-#line 62 "../src/parse/lex_conf.re"
+#line 61 "../src/parse/lex_conf.re"
{ lex_conf_enc(Enc::EBCDIC, opts); return; }
-#line 621 "src/parse/lex_conf.cc"
+#line 620 "src/parse/lex_conf.cc"
yy106:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 46 "../src/parse/lex_conf.re"
+#line 45 "../src/parse/lex_conf.re"
{ opts.set_gFlag (lex_conf_bool()); return; }
-#line 629 "src/parse/lex_conf.cc"
+#line 628 "src/parse/lex_conf.cc"
yy108:
yych = (unsigned char)*++cur;
if (yych <= 'Z') {
}
}
yy109:
-#line 47 "../src/parse/lex_conf.re"
+#line 46 "../src/parse/lex_conf.re"
{ opts.set_iFlag (lex_conf_bool()); return; }
-#line 650 "src/parse/lex_conf.cc"
+#line 649 "src/parse/lex_conf.cc"
yy110:
yych = (unsigned char)*++cur;
if (yych == 'e') goto yy151;
}
}
yy112:
-#line 52 "../src/parse/lex_conf.re"
+#line 51 "../src/parse/lex_conf.re"
{ opts.set_output_file (lex_conf_string()); return; }
-#line 676 "src/parse/lex_conf.cc"
+#line 675 "src/parse/lex_conf.cc"
yy113:
yych = (unsigned char)*++cur;
if (yych == 'o') goto yy154;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 48 "../src/parse/lex_conf.re"
+#line 47 "../src/parse/lex_conf.re"
{ opts.set_sFlag (lex_conf_bool()); return; }
-#line 688 "src/parse/lex_conf.cc"
+#line 687 "src/parse/lex_conf.cc"
yy116:
yych = (unsigned char)*++cur;
if (yych <= '^') {
}
}
yy117:
-#line 53 "../src/parse/lex_conf.re"
+#line 52 "../src/parse/lex_conf.re"
{ opts.set_header_file (lex_conf_string()); return; }
-#line 711 "src/parse/lex_conf.cc"
+#line 710 "src/parse/lex_conf.cc"
yy118:
yych = (unsigned char)*++cur;
if (yych <= '^') {
}
}
yy119:
-#line 63 "../src/parse/lex_conf.re"
+#line 62 "../src/parse/lex_conf.re"
{ lex_conf_enc(Enc::UTF32, opts); return; }
-#line 735 "src/parse/lex_conf.cc"
+#line 734 "src/parse/lex_conf.cc"
yy120:
yych = (unsigned char)*++cur;
if (yych <= 'Z') {
}
}
yy121:
-#line 64 "../src/parse/lex_conf.re"
+#line 63 "../src/parse/lex_conf.re"
{ lex_conf_enc(Enc::UCS2, opts); return; }
-#line 756 "src/parse/lex_conf.cc"
+#line 755 "src/parse/lex_conf.cc"
yy122:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 65 "../src/parse/lex_conf.re"
+#line 64 "../src/parse/lex_conf.re"
{ lex_conf_enc(Enc::UTF16, opts); return; }
-#line 764 "src/parse/lex_conf.cc"
+#line 763 "src/parse/lex_conf.cc"
yy124:
yych = (unsigned char)*++cur;
if (yych <= 'r') goto yy4;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 109 "../src/parse/lex_conf.re"
+#line 108 "../src/parse/lex_conf.re"
{ opts.set_yybmHexTable (lex_conf_bool()); return; }
-#line 965 "src/parse/lex_conf.cc"
+#line 964 "src/parse/lex_conf.cc"
yy172:
yych = (unsigned char)*++cur;
if (yych == 'v') goto yy212;
}
if (yych == '@') goto yy220;
yy180:
-#line 93 "../src/parse/lex_conf.re"
+#line 92 "../src/parse/lex_conf.re"
{ opts.set_condGoto (lex_conf_string ()); return; }
-#line 1004 "src/parse/lex_conf.cc"
+#line 1003 "src/parse/lex_conf.cc"
yy181:
yych = (unsigned char)*++cur;
if (yych == 'r') goto yy222;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 156 "../src/parse/lex_conf.re"
+#line 155 "../src/parse/lex_conf.re"
{ opts.set_bEmitYYCh (lex_conf_bool()); return; }
-#line 1153 "src/parse/lex_conf.cc"
+#line 1152 "src/parse/lex_conf.cc"
yy215:
yych = (unsigned char)*++cur;
if (yych == 'e') goto yy264;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 89 "../src/parse/lex_conf.re"
+#line 88 "../src/parse/lex_conf.re"
{ opts.set_condPrefix (lex_conf_string ()); return; }
-#line 1211 "src/parse/lex_conf.cc"
+#line 1210 "src/parse/lex_conf.cc"
yy225:
yych = (unsigned char)*++cur;
if (yych == 'A') goto yy271;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 142 "../src/parse/lex_conf.re"
+#line 141 "../src/parse/lex_conf.re"
{
const int32_t n = lex_conf_number ();
if (n < 0) {
- fatal(cur_loc(), "configuration 'indent:top' must be nonnegative");
+ msg.fatal(cur_loc(), "configuration 'indent:top' must be nonnegative");
}
opts.set_topIndent (static_cast<uint32_t> (n));
return;
}
-#line 1345 "src/parse/lex_conf.cc"
+#line 1344 "src/parse/lex_conf.cc"
yy253:
yych = (unsigned char)*++cur;
if (yych == 'l') goto yy304;
}
}
yy257:
-#line 169 "../src/parse/lex_conf.re"
+#line 168 "../src/parse/lex_conf.re"
{ opts.set_startlabel (lex_conf_string()); return; }
-#line 1382 "src/parse/lex_conf.cc"
+#line 1381 "src/parse/lex_conf.cc"
yy258:
yych = (unsigned char)*++cur;
if (yych == 't') goto yy312;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 69 "../src/parse/lex_conf.re"
+#line 68 "../src/parse/lex_conf.re"
{ lex_conf_input(opts); return; }
-#line 1532 "src/parse/lex_conf.cc"
+#line 1531 "src/parse/lex_conf.cc"
yy295:
yych = (unsigned char)*++cur;
if (yych == 'd') goto yy351;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 165 "../src/parse/lex_conf.re"
+#line 164 "../src/parse/lex_conf.re"
{ opts.set_labelPrefix (lex_conf_string ()); return; }
-#line 1584 "src/parse/lex_conf.cc"
+#line 1583 "src/parse/lex_conf.cc"
yy308:
++cur;
if (lim <= cur) YYFILL(1);
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 104 "../src/parse/lex_conf.re"
+#line 103 "../src/parse/lex_conf.re"
{ opts.set_bUseStateAbort (lex_conf_bool()); return; }
-#line 1622 "src/parse/lex_conf.cc"
+#line 1621 "src/parse/lex_conf.cc"
yy314:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy367;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 138 "../src/parse/lex_conf.re"
+#line 137 "../src/parse/lex_conf.re"
{ opts.set_tags_prefix (lex_conf_string ()); return; }
-#line 1638 "src/parse/lex_conf.cc"
+#line 1637 "src/parse/lex_conf.cc"
yy318:
yych = (unsigned char)*++cur;
if (yych <= 'c') {
}
if (yych == '@') goto yy380;
yy325:
-#line 91 "../src/parse/lex_conf.re"
+#line 90 "../src/parse/lex_conf.re"
{ opts.set_condDivider (lex_conf_string ()); return; }
-#line 1682 "src/parse/lex_conf.cc"
+#line 1681 "src/parse/lex_conf.cc"
yy326:
yych = (unsigned char)*++cur;
if (yych == 'n') goto yy381;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 103 "../src/parse/lex_conf.re"
+#line 102 "../src/parse/lex_conf.re"
{ opts.set_yynext (lex_conf_string ()); return; }
-#line 1830 "src/parse/lex_conf.cc"
+#line 1829 "src/parse/lex_conf.cc"
yy362:
yych = (unsigned char)*++cur;
if (yych <= '0') goto yy221;
++cur;
yy364:
cur = ctx;
-#line 168 "../src/parse/lex_conf.re"
+#line 167 "../src/parse/lex_conf.re"
{ opts.set_startlabel_force (lex_conf_bool()); return; }
-#line 1842 "src/parse/lex_conf.cc"
+#line 1841 "src/parse/lex_conf.cc"
yy365:
++cur;
if (lim <= cur) YYFILL(1);
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 163 "../src/parse/lex_conf.re"
+#line 162 "../src/parse/lex_conf.re"
{ opts.set_fill_check (lex_conf_bool()); return; }
-#line 1891 "src/parse/lex_conf.cc"
+#line 1890 "src/parse/lex_conf.cc"
yy377:
yych = (unsigned char)*++cur;
if (yych == 'e') goto yy431;
}
}
yy390:
-#line 158 "../src/parse/lex_conf.re"
+#line 157 "../src/parse/lex_conf.re"
{ opts.set_fill (lex_conf_string ()); return; }
-#line 1962 "src/parse/lex_conf.cc"
+#line 1961 "src/parse/lex_conf.cc"
yy391:
yych = (unsigned char)*++cur;
if (yych == 'O') goto yy450;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 125 "../src/parse/lex_conf.re"
+#line 124 "../src/parse/lex_conf.re"
{ opts.set_yypeek (lex_conf_string ()); return; }
-#line 1995 "src/parse/lex_conf.cc"
+#line 1994 "src/parse/lex_conf.cc"
yy399:
yych = (unsigned char)*++cur;
if (yych == 'O') goto yy460;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 126 "../src/parse/lex_conf.re"
+#line 125 "../src/parse/lex_conf.re"
{ opts.set_yyskip (lex_conf_string ()); return; }
-#line 2015 "src/parse/lex_conf.cc"
+#line 2014 "src/parse/lex_conf.cc"
yy404:
yych = (unsigned char)*++cur;
if (yych == 'N') goto yy463;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 141 "../src/parse/lex_conf.re"
+#line 140 "../src/parse/lex_conf.re"
{ opts.set_indString (lex_conf_string ()); return; }
-#line 2079 "src/parse/lex_conf.cc"
+#line 2078 "src/parse/lex_conf.cc"
yy419:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy479;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 108 "../src/parse/lex_conf.re"
+#line 107 "../src/parse/lex_conf.re"
{ opts.set_yybm (lex_conf_string ()); return; }
-#line 2103 "src/parse/lex_conf.cc"
+#line 2102 "src/parse/lex_conf.cc"
yy425:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 154 "../src/parse/lex_conf.re"
+#line 153 "../src/parse/lex_conf.re"
{ opts.set_yych (lex_conf_string ()); return; }
-#line 2111 "src/parse/lex_conf.cc"
+#line 2110 "src/parse/lex_conf.cc"
yy427:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy483;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 159 "../src/parse/lex_conf.re"
+#line 158 "../src/parse/lex_conf.re"
{ opts.set_fill_use (lex_conf_bool()); return; }
-#line 2135 "src/parse/lex_conf.cc"
+#line 2134 "src/parse/lex_conf.cc"
yy433:
yych = (unsigned char)*++cur;
if (yych == 't') goto yy487;
goto yy221;
yy436:
++cur;
-#line 94 "../src/parse/lex_conf.re"
+#line 93 "../src/parse/lex_conf.re"
{ opts.set_condGotoParam (lex_conf_string ()); return; }
-#line 2152 "src/parse/lex_conf.cc"
+#line 2151 "src/parse/lex_conf.cc"
yy438:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 90 "../src/parse/lex_conf.re"
+#line 89 "../src/parse/lex_conf.re"
{ opts.set_condEnumPrefix (lex_conf_string ()); return; }
-#line 2160 "src/parse/lex_conf.cc"
+#line 2159 "src/parse/lex_conf.cc"
yy440:
yych = (unsigned char)*++cur;
if (yych == 'P') goto yy491;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 153 "../src/parse/lex_conf.re"
+#line 152 "../src/parse/lex_conf.re"
{ opts.set_yyctype (lex_conf_string ()); return; }
-#line 2180 "src/parse/lex_conf.cc"
+#line 2179 "src/parse/lex_conf.cc"
yy445:
yych = (unsigned char)*++cur;
if (yych == 'R') goto yy495;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 151 "../src/parse/lex_conf.re"
+#line 150 "../src/parse/lex_conf.re"
{ opts.set_yydebug (lex_conf_string ()); return; }
-#line 2192 "src/parse/lex_conf.cc"
+#line 2191 "src/parse/lex_conf.cc"
yy448:
yych = (unsigned char)*++cur;
if (yych == 'n') goto yy497;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 123 "../src/parse/lex_conf.re"
+#line 122 "../src/parse/lex_conf.re"
{ opts.set_yylimit (lex_conf_string ()); return; }
-#line 2220 "src/parse/lex_conf.cc"
+#line 2219 "src/parse/lex_conf.cc"
yy455:
yych = (unsigned char)*++cur;
if (yych == 'R') goto yy502;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 135 "../src/parse/lex_conf.re"
+#line 134 "../src/parse/lex_conf.re"
{ opts.set_yymtagn (lex_conf_string ()); return; }
-#line 2232 "src/parse/lex_conf.cc"
+#line 2231 "src/parse/lex_conf.cc"
yy458:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 136 "../src/parse/lex_conf.re"
+#line 135 "../src/parse/lex_conf.re"
{ opts.set_yymtagp (lex_conf_string ()); return; }
-#line 2240 "src/parse/lex_conf.cc"
+#line 2239 "src/parse/lex_conf.cc"
yy460:
yych = (unsigned char)*++cur;
if (yych == 'R') goto yy504;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 133 "../src/parse/lex_conf.re"
+#line 132 "../src/parse/lex_conf.re"
{ opts.set_yystagn (lex_conf_string ()); return; }
-#line 2260 "src/parse/lex_conf.cc"
+#line 2259 "src/parse/lex_conf.cc"
yy465:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 134 "../src/parse/lex_conf.re"
+#line 133 "../src/parse/lex_conf.re"
{ opts.set_yystagp (lex_conf_string ()); return; }
-#line 2268 "src/parse/lex_conf.cc"
+#line 2267 "src/parse/lex_conf.cc"
yy467:
yych = (unsigned char)*++cur;
if (yych == 'o') goto yy507;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 110 "../src/parse/lex_conf.re"
+#line 109 "../src/parse/lex_conf.re"
{
const int32_t n = lex_conf_number ();
if (n < 0) {
- fatal(cur_loc(), "configuration 'cgoto:threshold' must be nonnegative");
+ msg.fatal(cur_loc(), "configuration 'cgoto:threshold' must be nonnegative");
}
opts.set_cGotoThreshold (static_cast<uint32_t> (n));
return;
}
-#line 2367 "src/parse/lex_conf.cc"
+#line 2366 "src/parse/lex_conf.cc"
yy490:
yych = (unsigned char)*++cur;
if (yych == 'n') goto yy531;
}
}
yy492:
-#line 127 "../src/parse/lex_conf.re"
+#line 126 "../src/parse/lex_conf.re"
{ opts.set_yybackup (lex_conf_string ()); return; }
-#line 2393 "src/parse/lex_conf.cc"
+#line 2392 "src/parse/lex_conf.cc"
yy493:
yych = (unsigned char)*++cur;
if (yych == 'P') goto yy533;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 120 "../src/parse/lex_conf.re"
+#line 119 "../src/parse/lex_conf.re"
{ opts.set_yycursor (lex_conf_string ()); return; }
-#line 2409 "src/parse/lex_conf.cc"
+#line 2408 "src/parse/lex_conf.cc"
yy497:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy535;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 121 "../src/parse/lex_conf.re"
+#line 120 "../src/parse/lex_conf.re"
{ opts.set_yymarker (lex_conf_string ()); return; }
-#line 2437 "src/parse/lex_conf.cc"
+#line 2436 "src/parse/lex_conf.cc"
yy504:
yych = (unsigned char)*++cur;
if (yych == 'E') goto yy540;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 105 "../src/parse/lex_conf.re"
+#line 104 "../src/parse/lex_conf.re"
{ opts.set_bUseStateNext (lex_conf_bool()); return; }
-#line 2509 "src/parse/lex_conf.cc"
+#line 2508 "src/parse/lex_conf.cc"
yy522:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 139 "../src/parse/lex_conf.re"
+#line 138 "../src/parse/lex_conf.re"
{ opts.set_tags_expression(lex_conf_string ()); return; }
-#line 2517 "src/parse/lex_conf.cc"
+#line 2516 "src/parse/lex_conf.cc"
yy524:
yych = (unsigned char)*++cur;
if (yych == 'p') goto yy556;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 155 "../src/parse/lex_conf.re"
+#line 154 "../src/parse/lex_conf.re"
{ opts.set_yychConversion (lex_conf_bool()); return; }
-#line 2541 "src/parse/lex_conf.cc"
+#line 2540 "src/parse/lex_conf.cc"
yy530:
yych = (unsigned char)*++cur;
if (yych == 'r') goto yy560;
}
}
yy541:
-#line 129 "../src/parse/lex_conf.re"
+#line 128 "../src/parse/lex_conf.re"
{ opts.set_yyrestore (lex_conf_string ()); return; }
-#line 2605 "src/parse/lex_conf.cc"
+#line 2604 "src/parse/lex_conf.cc"
yy542:
yych = (unsigned char)*++cur;
if (yych == 'I') goto yy578;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 161 "../src/parse/lex_conf.re"
+#line 160 "../src/parse/lex_conf.re"
{ opts.set_fill_arg_use (lex_conf_bool()); return; }
-#line 2687 "src/parse/lex_conf.cc"
+#line 2686 "src/parse/lex_conf.cc"
yy562:
++cur;
-#line 92 "../src/parse/lex_conf.re"
+#line 91 "../src/parse/lex_conf.re"
{ opts.set_condDividerParam (lex_conf_string ()); return; }
-#line 2692 "src/parse/lex_conf.cc"
+#line 2691 "src/parse/lex_conf.cc"
yy564:
yych = (unsigned char)*++cur;
if (yych == 'X') goto yy602;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 83 "../src/parse/lex_conf.re"
+#line 82 "../src/parse/lex_conf.re"
{ opts.set_yycondtype (lex_conf_string ()); return; }
-#line 2704 "src/parse/lex_conf.cc"
+#line 2703 "src/parse/lex_conf.cc"
yy567:
yych = (unsigned char)*++cur;
if (yych == 'R') goto yy604;
goto yy4;
yy569:
++cur;
-#line 160 "../src/parse/lex_conf.re"
+#line 159 "../src/parse/lex_conf.re"
{ opts.set_fill_arg (lex_conf_string ()); return; }
-#line 2717 "src/parse/lex_conf.cc"
+#line 2716 "src/parse/lex_conf.cc"
yy571:
yych = (unsigned char)*++cur;
if (yych == 'T') goto yy607;
}
}
yy573:
-#line 97 "../src/parse/lex_conf.re"
+#line 96 "../src/parse/lex_conf.re"
{ opts.set_state_get (lex_conf_string ()); return; }
-#line 2743 "src/parse/lex_conf.cc"
+#line 2742 "src/parse/lex_conf.cc"
yy574:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 132 "../src/parse/lex_conf.re"
+#line 131 "../src/parse/lex_conf.re"
{ opts.set_yylessthan (lex_conf_string ()); return; }
-#line 2751 "src/parse/lex_conf.cc"
+#line 2750 "src/parse/lex_conf.cc"
yy576:
yych = (unsigned char)*++cur;
if (yych == 'T') goto yy609;
}
}
yy580:
-#line 99 "../src/parse/lex_conf.re"
+#line 98 "../src/parse/lex_conf.re"
{ opts.set_state_set (lex_conf_string ()); return; }
-#line 2786 "src/parse/lex_conf.cc"
+#line 2785 "src/parse/lex_conf.cc"
yy581:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 70 "../src/parse/lex_conf.re"
+#line 69 "../src/parse/lex_conf.re"
{ lex_conf_empty_class(opts); return; }
-#line 2816 "src/parse/lex_conf.cc"
+#line 2815 "src/parse/lex_conf.cc"
yy588:
yych = (unsigned char)*++cur;
if (yych == 'l') goto yy618;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 102 "../src/parse/lex_conf.re"
+#line 101 "../src/parse/lex_conf.re"
{ opts.set_yyfilllabel (lex_conf_string ()); return; }
-#line 2842 "src/parse/lex_conf.cc"
+#line 2841 "src/parse/lex_conf.cc"
yy594:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 106 "../src/parse/lex_conf.re"
+#line 105 "../src/parse/lex_conf.re"
{ opts.set_yyaccept (lex_conf_string ()); return; }
-#line 2850 "src/parse/lex_conf.cc"
+#line 2849 "src/parse/lex_conf.cc"
yy596:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 95 "../src/parse/lex_conf.re"
+#line 94 "../src/parse/lex_conf.re"
{ opts.set_yyctable (lex_conf_string ()); return; }
-#line 2858 "src/parse/lex_conf.cc"
+#line 2857 "src/parse/lex_conf.cc"
yy598:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 172 "../src/parse/lex_conf.re"
+#line 171 "../src/parse/lex_conf.re"
{ lex_conf_string (); return; }
-#line 2866 "src/parse/lex_conf.cc"
+#line 2865 "src/parse/lex_conf.cc"
yy600:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 118 "../src/parse/lex_conf.re"
+#line 117 "../src/parse/lex_conf.re"
{ opts.set_yytarget (lex_conf_string ()); return; }
-#line 2874 "src/parse/lex_conf.cc"
+#line 2873 "src/parse/lex_conf.cc"
yy602:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 128 "../src/parse/lex_conf.re"
+#line 127 "../src/parse/lex_conf.re"
{ opts.set_yybackupctx (lex_conf_string ()); return; }
-#line 2882 "src/parse/lex_conf.cc"
+#line 2881 "src/parse/lex_conf.cc"
yy604:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 122 "../src/parse/lex_conf.re"
+#line 121 "../src/parse/lex_conf.re"
{ opts.set_yyctxmarker (lex_conf_string ()); return; }
-#line 2890 "src/parse/lex_conf.cc"
+#line 2889 "src/parse/lex_conf.cc"
yy606:
yych = (unsigned char)*++cur;
if (yych == 'd') goto yy621;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 162 "../src/parse/lex_conf.re"
+#line 161 "../src/parse/lex_conf.re"
{ opts.set_fill_naked (lex_conf_bool()); return; }
-#line 2960 "src/parse/lex_conf.cc"
+#line 2959 "src/parse/lex_conf.cc"
yy623:
yych = (unsigned char)*++cur;
if (yych == 'O') goto yy639;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 130 "../src/parse/lex_conf.re"
+#line 129 "../src/parse/lex_conf.re"
{ opts.set_yyrestorectx (lex_conf_string ()); return; }
-#line 2976 "src/parse/lex_conf.cc"
+#line 2975 "src/parse/lex_conf.cc"
yy627:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 131 "../src/parse/lex_conf.re"
+#line 130 "../src/parse/lex_conf.re"
{ opts.set_yyrestoretag (lex_conf_string ()); return; }
-#line 2984 "src/parse/lex_conf.cc"
+#line 2983 "src/parse/lex_conf.cc"
yy629:
yych = (unsigned char)*++cur;
if (yych == 'O') goto yy641;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 51 "../src/parse/lex_conf.re"
+#line 50 "../src/parse/lex_conf.re"
{ opts.set_bCaseInverted (lex_conf_bool()); return; }
-#line 3008 "src/parse/lex_conf.cc"
+#line 3007 "src/parse/lex_conf.cc"
yy635:
yych = (unsigned char)*++cur;
if (yych == 's') goto yy106;
}
}
yy647:
-#line 84 "../src/parse/lex_conf.re"
+#line 83 "../src/parse/lex_conf.re"
{ opts.set_cond_get (lex_conf_string ()); return; }
-#line 3076 "src/parse/lex_conf.cc"
+#line 3075 "src/parse/lex_conf.cc"
yy648:
yych = (unsigned char)*++cur;
if (yych == 'e') goto yy657;
}
}
yy650:
-#line 86 "../src/parse/lex_conf.re"
+#line 85 "../src/parse/lex_conf.re"
{ opts.set_cond_set (lex_conf_string ()); return; }
-#line 3103 "src/parse/lex_conf.cc"
+#line 3102 "src/parse/lex_conf.cc"
yy651:
yych = (unsigned char)*++cur;
if (yych == 'e') goto yy660;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 68 "../src/parse/lex_conf.re"
+#line 67 "../src/parse/lex_conf.re"
{ lex_conf_encoding_policy(opts); return; }
-#line 3123 "src/parse/lex_conf.cc"
+#line 3122 "src/parse/lex_conf.cc"
yy656:
yych = (unsigned char)*++cur;
if (yych == 'n') goto yy664;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 50 "../src/parse/lex_conf.re"
+#line 49 "../src/parse/lex_conf.re"
{ opts.set_bCaseInsensitive (lex_conf_bool()); return; }
-#line 3155 "src/parse/lex_conf.cc"
+#line 3154 "src/parse/lex_conf.cc"
yy664:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy673;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 98 "../src/parse/lex_conf.re"
+#line 97 "../src/parse/lex_conf.re"
{ opts.set_state_get_naked (lex_conf_bool()); return; }
-#line 3167 "src/parse/lex_conf.cc"
+#line 3166 "src/parse/lex_conf.cc"
yy667:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy674;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 100 "../src/parse/lex_conf.re"
+#line 99 "../src/parse/lex_conf.re"
{ opts.set_state_set_naked (lex_conf_bool()); return; }
-#line 3183 "src/parse/lex_conf.cc"
+#line 3182 "src/parse/lex_conf.cc"
yy671:
++cur;
-#line 101 "../src/parse/lex_conf.re"
+#line 100 "../src/parse/lex_conf.re"
{ opts.set_state_set_arg (lex_conf_string ()); return; }
-#line 3188 "src/parse/lex_conf.cc"
+#line 3187 "src/parse/lex_conf.cc"
yy673:
yych = (unsigned char)*++cur;
if (yych == 'k') goto yy676;
goto yy4;
yy681:
++cur;
-#line 87 "../src/parse/lex_conf.re"
+#line 86 "../src/parse/lex_conf.re"
{ opts.set_cond_set_arg (lex_conf_string ()); return; }
-#line 3225 "src/parse/lex_conf.cc"
+#line 3224 "src/parse/lex_conf.cc"
yy683:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 85 "../src/parse/lex_conf.re"
+#line 84 "../src/parse/lex_conf.re"
{ opts.set_cond_get_naked (lex_conf_bool()); return; }
-#line 3233 "src/parse/lex_conf.cc"
+#line 3232 "src/parse/lex_conf.cc"
yy685:
yych = (unsigned char)*++cur;
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 88 "../src/parse/lex_conf.re"
+#line 87 "../src/parse/lex_conf.re"
{ opts.set_cond_set_naked (lex_conf_bool()); return; }
-#line 3241 "src/parse/lex_conf.cc"
+#line 3240 "src/parse/lex_conf.cc"
}
-#line 178 "../src/parse/lex_conf.re"
+#line 177 "../src/parse/lex_conf.re"
}
{
lex_conf_assign ();
-#line 3251 "src/parse/lex_conf.cc"
+#line 3250 "src/parse/lex_conf.cc"
{
unsigned char yych;
if ((lim - cur) < 10) YYFILL(10);
}
++cur;
yy690:
-#line 185 "../src/parse/lex_conf.re"
- { fatal(cur_loc(),
+#line 184 "../src/parse/lex_conf.re"
+ { msg.fatal(cur_loc(),
"bad configuration value (expected: 'ignore', 'substitute', 'fail')"); }
-#line 3267 "src/parse/lex_conf.cc"
+#line 3266 "src/parse/lex_conf.cc"
yy691:
yych = (unsigned char)*(mar = ++cur);
if (yych == 'a') goto yy694;
goto yy695;
yy701:
++cur;
-#line 189 "../src/parse/lex_conf.re"
+#line 188 "../src/parse/lex_conf.re"
{ opts.set_encoding_policy(Enc::POLICY_FAIL); goto end; }
-#line 3310 "src/parse/lex_conf.cc"
+#line 3309 "src/parse/lex_conf.cc"
yy703:
yych = (unsigned char)*++cur;
if (yych == 'r') goto yy705;
goto yy695;
yy707:
++cur;
-#line 187 "../src/parse/lex_conf.re"
+#line 186 "../src/parse/lex_conf.re"
{ opts.set_encoding_policy(Enc::POLICY_IGNORE); goto end; }
-#line 3331 "src/parse/lex_conf.cc"
+#line 3330 "src/parse/lex_conf.cc"
yy709:
yych = (unsigned char)*++cur;
if (yych != 't') goto yy695;
yych = (unsigned char)*++cur;
if (yych != 'e') goto yy695;
++cur;
-#line 188 "../src/parse/lex_conf.re"
+#line 187 "../src/parse/lex_conf.re"
{ opts.set_encoding_policy(Enc::POLICY_SUBSTITUTE); goto end; }
-#line 3344 "src/parse/lex_conf.cc"
+#line 3343 "src/parse/lex_conf.cc"
}
-#line 190 "../src/parse/lex_conf.re"
+#line 189 "../src/parse/lex_conf.re"
end:
lex_conf_semicolon();
{
lex_conf_assign ();
-#line 3356 "src/parse/lex_conf.cc"
+#line 3355 "src/parse/lex_conf.cc"
{
unsigned char yych;
if ((lim - cur) < 7) YYFILL(7);
yy717:
++cur;
yy718:
-#line 199 "../src/parse/lex_conf.re"
- { fatal(cur_loc(), "bad configuration value (expected: 'default', 'custom')"); }
-#line 3369 "src/parse/lex_conf.cc"
+#line 198 "../src/parse/lex_conf.re"
+ { msg.fatal(cur_loc(), "bad configuration value (expected: 'default', 'custom')"); }
+#line 3368 "src/parse/lex_conf.cc"
yy719:
yych = (unsigned char)*(mar = ++cur);
if (yych == 'u') goto yy721;
goto yy722;
yy730:
++cur;
-#line 201 "../src/parse/lex_conf.re"
+#line 200 "../src/parse/lex_conf.re"
{ opts.set_input_api(INPUT_CUSTOM); goto end; }
-#line 3416 "src/parse/lex_conf.cc"
+#line 3415 "src/parse/lex_conf.cc"
yy732:
yych = (unsigned char)*++cur;
if (yych != 't') goto yy722;
++cur;
-#line 200 "../src/parse/lex_conf.re"
+#line 199 "../src/parse/lex_conf.re"
{ opts.set_input_api(INPUT_DEFAULT); goto end; }
-#line 3423 "src/parse/lex_conf.cc"
+#line 3422 "src/parse/lex_conf.cc"
}
-#line 202 "../src/parse/lex_conf.re"
+#line 201 "../src/parse/lex_conf.re"
end:
lex_conf_semicolon();
{
lex_conf_assign ();
-#line 3435 "src/parse/lex_conf.cc"
+#line 3434 "src/parse/lex_conf.cc"
{
unsigned char yych;
if ((lim - cur) < 11) YYFILL(11);
if (yych == 'm') goto yy740;
++cur;
yy738:
-#line 211 "../src/parse/lex_conf.re"
- { fatal(cur_loc(),
+#line 210 "../src/parse/lex_conf.re"
+ { msg.fatal(cur_loc(),
"bad configuration value (expected: 'match-empty', 'match-none', 'error')"); }
-#line 3447 "src/parse/lex_conf.cc"
+#line 3446 "src/parse/lex_conf.cc"
yy739:
yych = (unsigned char)*(mar = ++cur);
if (yych == 'r') goto yy741;
goto yy742;
yy748:
++cur;
-#line 215 "../src/parse/lex_conf.re"
+#line 214 "../src/parse/lex_conf.re"
{ opts.set_empty_class_policy(EMPTY_CLASS_ERROR); goto end; }
-#line 3486 "src/parse/lex_conf.cc"
+#line 3485 "src/parse/lex_conf.cc"
yy750:
yych = (unsigned char)*++cur;
if (yych != '-') goto yy742;
goto yy742;
yy759:
++cur;
-#line 214 "../src/parse/lex_conf.re"
+#line 213 "../src/parse/lex_conf.re"
{ opts.set_empty_class_policy(EMPTY_CLASS_MATCH_NONE); goto end; }
-#line 3526 "src/parse/lex_conf.cc"
+#line 3525 "src/parse/lex_conf.cc"
yy761:
++cur;
-#line 213 "../src/parse/lex_conf.re"
+#line 212 "../src/parse/lex_conf.re"
{ opts.set_empty_class_policy(EMPTY_CLASS_MATCH_EMPTY); goto end; }
-#line 3531 "src/parse/lex_conf.cc"
+#line 3530 "src/parse/lex_conf.cc"
}
-#line 216 "../src/parse/lex_conf.re"
+#line 215 "../src/parse/lex_conf.re"
end:
lex_conf_semicolon();
void Scanner::lex_conf_assign ()
{
-#line 3551 "src/parse/lex_conf.cc"
+#line 3550 "src/parse/lex_conf.cc"
{
unsigned char yych;
static const unsigned char yybm[] = {
}
++cur;
yy766:
-#line 233 "../src/parse/lex_conf.re"
- { fatal(cur_loc(), "missing '=' in configuration"); }
-#line 3600 "src/parse/lex_conf.cc"
+#line 232 "../src/parse/lex_conf.re"
+ { msg.fatal(cur_loc(), "missing '=' in configuration"); }
+#line 3599 "src/parse/lex_conf.cc"
yy767:
yych = (unsigned char)*(mar = ++cur);
if (yych <= 0x1F) {
if (yybm[0+yych] & 128) {
goto yy768;
}
-#line 234 "../src/parse/lex_conf.re"
+#line 233 "../src/parse/lex_conf.re"
{ return; }
-#line 3619 "src/parse/lex_conf.cc"
+#line 3618 "src/parse/lex_conf.cc"
yy771:
++cur;
if (lim <= cur) YYFILL(1);
cur = mar;
goto yy766;
}
-#line 235 "../src/parse/lex_conf.re"
+#line 234 "../src/parse/lex_conf.re"
}
void Scanner::lex_conf_semicolon ()
{
-#line 3640 "src/parse/lex_conf.cc"
+#line 3639 "src/parse/lex_conf.cc"
{
unsigned char yych;
static const unsigned char yybm[] = {
}
++cur;
yy777:
-#line 241 "../src/parse/lex_conf.re"
- { fatal(cur_loc(), "missing ending ';' in configuration"); }
-#line 3689 "src/parse/lex_conf.cc"
+#line 240 "../src/parse/lex_conf.re"
+ { msg.fatal(cur_loc(), "missing ending ';' in configuration"); }
+#line 3688 "src/parse/lex_conf.cc"
yy778:
yych = (unsigned char)*(mar = ++cur);
if (yybm[0+yych] & 128) {
if (yych != ';') goto yy777;
yy779:
++cur;
-#line 242 "../src/parse/lex_conf.re"
+#line 241 "../src/parse/lex_conf.re"
{ return; }
-#line 3700 "src/parse/lex_conf.cc"
+#line 3699 "src/parse/lex_conf.cc"
yy781:
++cur;
if (lim <= cur) YYFILL(1);
cur = mar;
goto yy777;
}
-#line 243 "../src/parse/lex_conf.re"
+#line 242 "../src/parse/lex_conf.re"
}
lex_conf_assign ();
tok = cur;
-#line 3726 "src/parse/lex_conf.cc"
+#line 3725 "src/parse/lex_conf.cc"
{
unsigned char yych;
static const unsigned char yybm[] = {
}
++cur;
yy787:
-#line 256 "../src/parse/lex_conf.re"
- { fatal(cur_loc(), "bad configuration value (expected number)"); }
-#line 3775 "src/parse/lex_conf.cc"
+#line 255 "../src/parse/lex_conf.re"
+ { msg.fatal(cur_loc(), "bad configuration value (expected number)"); }
+#line 3774 "src/parse/lex_conf.cc"
yy788:
yych = (unsigned char)*++cur;
if (yych <= '0') goto yy787;
yy789:
++cur;
yy790:
-#line 257 "../src/parse/lex_conf.re"
+#line 256 "../src/parse/lex_conf.re"
{
int32_t n = 0;
if (!s_to_i32_unsafe (tok, cur, n)) {
- fatal(cur_loc(), "configuration value overflow");
+ msg.fatal(cur_loc(), "configuration value overflow");
}
lex_conf_semicolon ();
return n;
}
-#line 3793 "src/parse/lex_conf.cc"
+#line 3792 "src/parse/lex_conf.cc"
yy791:
++cur;
if (lim <= cur) YYFILL(1);
}
goto yy790;
}
-#line 265 "../src/parse/lex_conf.re"
+#line 264 "../src/parse/lex_conf.re"
}
std::string s;
tok = cur;
-#line 3813 "src/parse/lex_conf.cc"
+#line 3812 "src/parse/lex_conf.cc"
{
unsigned char yych;
static const unsigned char yybm[] = {
}
}
yy795:
-#line 292 "../src/parse/lex_conf.re"
+#line 293 "../src/parse/lex_conf.re"
{ goto end; }
-#line 3871 "src/parse/lex_conf.cc"
+#line 3870 "src/parse/lex_conf.cc"
yy796:
++cur;
if (lim <= cur) YYFILL(1);
if (yybm[0+yych] & 128) {
goto yy796;
}
-#line 288 "../src/parse/lex_conf.re"
+#line 289 "../src/parse/lex_conf.re"
{
s = getstr(tok, cur);
goto end;
}
-#line 3884 "src/parse/lex_conf.cc"
+#line 3883 "src/parse/lex_conf.cc"
yy799:
++cur;
-#line 274 "../src/parse/lex_conf.re"
+#line 273 "../src/parse/lex_conf.re"
{
const char quote = tok[0];
for (;;) {
goto end;
}
if (c.chr > 0xFF) {
- fatal(c.loc, "multibyte character in configuration string: 0x%X", c.chr);
+ msg.fatal(c.loc
+ , "multibyte character in configuration string: 0x%X"
+ , c.chr);
} else {
s += static_cast<char>(c.chr);
}
}
}
-#line 3902 "src/parse/lex_conf.cc"
+#line 3903 "src/parse/lex_conf.cc"
}
-#line 293 "../src/parse/lex_conf.re"
+#line 294 "../src/parse/lex_conf.re"
end:
lex_conf_semicolon ();
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
- 0, 62, 62, 64, 65, 66, 67, 71, 78, 84,
- 85, 88, 88, 91, 94, 97, 100, 106, 112, 118,
- 124, 131, 132, 137, 144, 145, 151, 152, 156, 157,
- 161, 163, 167, 168, 175, 181, 182, 186, 187, 188,
- 192, 193, 204
+ 0, 62, 62, 64, 65, 66, 67, 71, 79, 85,
+ 86, 89, 89, 92, 95, 98, 101, 107, 113, 119,
+ 125, 132, 133, 138, 145, 146, 152, 153, 157, 158,
+ 162, 164, 168, 169, 176, 182, 183, 187, 188, 189,
+ 193, 194, 206
};
#endif
#line 71 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
if (!context.symtab.insert(std::make_pair(*(yyvsp[-2].str), (yyvsp[-1].regexp))).second) {
- fatal(context.input.tok_loc(), "sym already defined");
+ context.input.msg.fatal(context.input.tok_loc()
+ , "sym already defined");
}
delete (yyvsp[-2].str);
}
-#line 1301 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1302 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 8:
-#line 78 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 79 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
- fatal(context.input.tok_loc()
+ context.input.msg.fatal(context.input.tok_loc()
, "trailing contexts are not allowed in named definitions");
}
-#line 1310 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1311 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 9:
-#line 84 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 85 "../src/parse/parser.ypp" /* yacc.c:1646 */
{ (yyval.str) = (yyvsp[-1].str); }
-#line 1316 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1317 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 13:
-#line 91 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 92 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
find(context.specs, "").rules.push_back(ASTRule((yyvsp[-1].regexp), (yyvsp[0].code)));
}
-#line 1324 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1325 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 14:
-#line 94 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 95 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
find(context.specs, "").defs.push_back((yyvsp[0].code));
}
-#line 1332 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1333 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 15:
-#line 97 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 98 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
find(context.specs, "").eofs.push_back((yyvsp[0].code));
}
-#line 1340 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1341 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 16:
-#line 100 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 101 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
for(CondList::const_iterator i = (yyvsp[-2].clist)->begin(); i != (yyvsp[-2].clist)->end(); ++i) {
find(context.specs, *i).rules.push_back(ASTRule((yyvsp[-1].regexp), (yyvsp[0].code)));
}
delete (yyvsp[-2].clist);
}
-#line 1351 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1352 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 17:
-#line 106 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 107 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
for(CondList::const_iterator i = (yyvsp[-2].clist)->begin(); i != (yyvsp[-2].clist)->end(); ++i) {
find(context.specs, *i).defs.push_back((yyvsp[0].code));
}
delete (yyvsp[-2].clist);
}
-#line 1362 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1363 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 18:
-#line 112 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 113 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
for(CondList::const_iterator i = (yyvsp[-2].clist)->begin(); i != (yyvsp[-2].clist)->end(); ++i) {
find(context.specs, *i).eofs.push_back((yyvsp[0].code));
}
delete (yyvsp[-2].clist);
}
-#line 1373 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1374 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 19:
-#line 118 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 119 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
for (CondList::const_iterator i = (yyvsp[-1].clist)->begin(); i != (yyvsp[-1].clist)->end(); ++i) {
find(context.specs, *i).setup.push_back((yyvsp[0].code));
}
delete (yyvsp[-1].clist);
}
-#line 1384 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1385 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 20:
-#line 124 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 125 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
const AST *r = ast_nil(context.input.tok_loc());
find(context.specs, "0").rules.push_back(ASTRule(r, (yyvsp[0].code)));
delete (yyvsp[-1].clist);
}
-#line 1394 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1395 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 22:
-#line 132 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 133 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
(yyval.code) = (yyvsp[0].code);
(yyval.code)->cond = *(yyvsp[-1].str);
delete (yyvsp[-1].str);
}
-#line 1404 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1405 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 23:
-#line 137 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 138 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
(yyval.code) = new Code(context.input.tok_loc());
(yyval.code)->cond = *(yyvsp[0].str);
delete (yyvsp[0].str);
}
-#line 1414 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1415 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 24:
-#line 144 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 145 "../src/parse/parser.ypp" /* yacc.c:1646 */
{ (yyval.regexp) = ast_cap((yyvsp[0].regexp)); }
-#line 1420 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1421 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 25:
-#line 145 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 146 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
(yyval.regexp) = ast_cat(ast_cap((yyvsp[-2].regexp)),
ast_cat(ast_tag(context.input.tok_loc(), NULL, false), (yyvsp[0].regexp)));
}
-#line 1429 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1430 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 27:
-#line 152 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 153 "../src/parse/parser.ypp" /* yacc.c:1646 */
{ (yyval.regexp) = ast_alt((yyvsp[-2].regexp), (yyvsp[0].regexp)); }
-#line 1435 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1436 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 29:
-#line 157 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 158 "../src/parse/parser.ypp" /* yacc.c:1646 */
{ (yyval.regexp) = ast_diff((yyvsp[-2].regexp), (yyvsp[0].regexp)); }
-#line 1441 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1442 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 31:
-#line 163 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 164 "../src/parse/parser.ypp" /* yacc.c:1646 */
{ (yyval.regexp) = ast_cat((yyvsp[-1].regexp), (yyvsp[0].regexp)); }
-#line 1447 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1448 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 33:
-#line 168 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 169 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
switch((yyvsp[0].op)) {
case '*': (yyval.regexp) = ast_iter((yyvsp[-1].regexp), 0, AST::MANY); break;
case '?': (yyval.regexp) = ast_iter((yyvsp[-1].regexp), 0, 1); break;
}
}
-#line 1459 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1460 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 34:
-#line 175 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 176 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
(yyval.regexp) = ast_iter((yyvsp[-1].regexp), (yyvsp[0].bounds).min, (yyvsp[0].bounds).max);
}
-#line 1467 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1468 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 36:
-#line 182 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 183 "../src/parse/parser.ypp" /* yacc.c:1646 */
{ (yyval.op) = ((yyvsp[-1].op) == (yyvsp[0].op)) ? (yyvsp[-1].op) : '*'; }
-#line 1473 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1474 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 37:
-#line 186 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 187 "../src/parse/parser.ypp" /* yacc.c:1646 */
{ (yyval.op) = '*'; }
-#line 1479 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1480 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 38:
-#line 187 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 188 "../src/parse/parser.ypp" /* yacc.c:1646 */
{ (yyval.op) = '+'; }
-#line 1485 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1486 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 39:
-#line 188 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 189 "../src/parse/parser.ypp" /* yacc.c:1646 */
{ (yyval.op) = '?'; }
-#line 1491 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1492 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 41:
-#line 193 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 194 "../src/parse/parser.ypp" /* yacc.c:1646 */
{
symtab_t::iterator i = context.symtab.find(*(yyvsp[0].str));
if (i == context.symtab.end()) {
- fatal(context.input.tok_loc(), "undefined symbol '%s'", (yyvsp[0].str)->c_str());
+ context.input.msg.fatal(context.input.tok_loc()
+ , "undefined symbol '%s'", (yyvsp[0].str)->c_str());
}
(yyval.regexp) = i->second;
if (ast_need_wrap((yyval.regexp))) {
}
delete (yyvsp[0].str);
}
-#line 1507 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1509 "src/parse/parser.cc" /* yacc.c:1646 */
break;
case 42:
-#line 204 "../src/parse/parser.ypp" /* yacc.c:1646 */
+#line 206 "../src/parse/parser.ypp" /* yacc.c:1646 */
{ (yyval.regexp) = ast_cap((yyvsp[-1].regexp)); }
-#line 1513 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1515 "src/parse/parser.cc" /* yacc.c:1646 */
break;
-#line 1517 "src/parse/parser.cc" /* yacc.c:1646 */
+#line 1519 "src/parse/parser.cc" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
#endif
return yyresult;
}
-#line 207 "../src/parse/parser.ypp" /* yacc.c:1906 */
+#line 209 "../src/parse/parser.ypp" /* yacc.c:1906 */
extern "C" {
void yyerror(context_t &context, const char* s)
{
- fatal(context.input.tok_loc(), "%s", s);
+ context.input.msg.fatal(context.input.tok_loc(), "%s", s);
}
int yylex(context_t &context)
#ifndef _RE2C_LIB_LEX_
#define _RE2C_LIB_LEX_
+#include "src/msg/location.h"
#include "src/regexp/re.h"
#include "src/parse/ast.h"
#include "src/encoding/enc.h"
#include "src/parse/ast.h"
-#include "src/options/msg.h"
#include "src/util/range.h"
#include "src/util/s_to_n32_unsafe.h"
#include "parse.h"
std::vector<ASTRange> cls;
bool neg = false;
uint32_t l, u;
- const loc_t nowhere(0, 0, "void");
/*!re2c
* { goto err; }
}
"." {
- yylval.regexp = ast_dot(nowhere);
+ yylval.regexp = ast_dot(NOWHERE);
return REGEXP;
}
[^] \ nil {
- ASTChar c(static_cast<uint32_t>(cur[-1]), nowhere);
+ ASTChar c = {static_cast<uint32_t>(cur[-1]), NOWHERE};
std::vector<ASTChar> *str = new std::vector<ASTChar>;
str->push_back(c);
- yylval.regexp = ast_str(nowhere, str, false);
+ yylval.regexp = ast_str(NOWHERE, str, false);
return REGEXP;
}
*/
*/
add:
if (l > u) goto err;
- cls.push_back(ASTRange(l, u, nowhere));
+ cls.push_back(ASTRange(l, u, NOWHERE));
/*!re2c
"" { goto cls; }
"]" {
std::vector<ASTRange> *p = new std::vector<ASTRange>;
p->swap(cls);
- yylval.regexp = ast_cls(nowhere, p, neg);
+ yylval.regexp = ast_cls(NOWHERE, p, neg);
return REGEXP;
}
*/
primary
: REGEXP
-| '(' ')' { $$ = ast_cap(ast_nil(loc_t(0, 0, "void"))); }
+| '(' ')' { $$ = ast_cap(ast_nil(NOWHERE)); }
| '(' expr ')' { $$ = ast_cap($2); }
;
conopt_t globopts;
globopts.FFlag = true;
Opt opts(globopts);
+ Msg msg;
opts.set_posix_syntax(true);
opts.set_posix_semantics((cflags & REG_LEFTMOST) == 0);
const opt_t *opt = opts.snapshot();
- const loc_t loc(0, 0, "void");
-
- Warn warn;
-
preg->flags = cflags;
const AST *a = parse(pattern);
preg->rmgr = new RangeMgr;
- ASTRule ar(a, new Code(loc));
+ ASTRule ar(a, new Code(NOWHERE));
std::vector<ASTRule> arv;
arv.push_back(ar);
- RESpec re(arv, opt, warn, *preg->rmgr);
+ RESpec re(arv, opt, msg, *preg->rmgr);
find_fixed_tags(re);
}
}
- dfa = new dfa_t(*nfa, opt, "", warn);
+ dfa = new dfa_t(*nfa, opt, "", msg);
compact_and_optimize_tags(opt, *dfa);
, const std::string &su
, const Code *eof
, const opt_t *opts
+ , Msg &msg
)
: accepts ()
, loc (loc)
, bitmaps (std::min(ubChar, 256u))
, setup(su)
, eof_action(eof)
+ , msg(msg)
{
const size_t nstates = dfa.states.size();
const size_t nchars = dfa.nchars;
bitmaps_t bitmaps;
std::string setup;
const Code *eof_action;
+ Msg &msg;
DFA ( const dfa_t &dfa
, const std::vector<size_t> &fill
, const std::string &su
, const Code *eof
, const opt_t *opts
+ , Msg &msg
);
~DFA ();
void reorder();
#include "src/adfa/adfa.h"
#include "src/codegen/bitmap.h"
#include "src/codegen/go.h"
-#include "src/options/msg.h"
#include "src/options/opt.h"
#include "src/debug/debug.h"
#include "src/dfa/tcmd.h"
// error if tags are not enabled, but we need them
if (!explicit_tags && maxtagver > 1) {
- fatal(loc, "overlapping trailing contexts need "
+ msg.fatal(loc, "overlapping trailing contexts need "
"multiple context markers, use '-t, --tags' "
"option and '/*!stags:re2c ... */' directive");
}
const Code *code = rules[s->action.info.rule].code;
if (!code->autogen) {
o.wlabel(s->label).ws(" [label=\"")
- .wstring(code->loc.fname)
+ .wstring(msg.filenames[code->loc.file])
.ws(":").wu32(code->loc.line)
.ws("\"]").ws("\n");
}
#include "src/codegen/input_api.h"
#include "src/codegen/output.h"
#include "src/codegen/print.h"
-#include "src/options/msg.h"
+#include "src/msg/msg.h"
#include "src/options/opt.h"
-#include "src/options/warn.h"
#include "src/encoding/enc.h"
#include "src/util/string_utils.h"
#include "src/util/uniq_vector.h"
delete opts;
}
-Output::Output(Warn &w)
+Output::Output(Msg &msg)
: cblocks()
, hblocks()
, blocks(&cblocks)
, cond_goto(false)
, warn_condition_order(true)
, need_header(false)
- , warn(w)
+ , msg(msg)
, skeletons()
, max_fill(1)
, max_nmatch(1)
case OutputFragment::EMPTY:
case OutputFragment::CODE: break;
case OutputFragment::LINE_INFO_INPUT:
- output_line_info(o, f.loc->line, f.loc->fname, bopt->iFlag);
+ output_line_info(o, f.loc->line, msg.filenames[f.loc->file]
+ , bopt->iFlag);
break;
case OutputFragment::LINE_INFO_OUTPUT:
output_line_info(o, line_count + 1, filename, bopt->iFlag);
break;
case OutputFragment::COND_GOTO:
- output_cond_goto(o, ind, b.types, bopt, warn
+ output_cond_goto(o, ind, b.types, bopt, msg
, warn_condition_order, b.loc);
break;
case OutputFragment::COND_TABLE:
bool Output::emit()
{
- if (warn.error()) return false;
+ if (msg.warn.error()) return false;
// gather global lists of conditions and tags
uniq_vector_t<std::string> conds;
}
void output_cond_goto(std::ostream &o, uint32_t ind
- , const std::vector<std::string> &conds, const opt_t *opts, Warn &warn
+ , const std::vector<std::string> &conds, const opt_t *opts, Msg &msg
, bool warn_cond_order, const loc_t &loc)
{
const size_t ncond = conds.size();
warn_cond_order &= opts->header_file.empty();
// see note [condition order]
- if (warn_cond_order) warn.condition_order(loc);
+ if (warn_cond_order) msg.warn.condition_order(loc);
}
void output_cond_table(std::ostream &o, uint32_t ind,
#include "src/codegen/label.h"
#include "src/options/opt.h"
-#include "src/options/warn.h"
#include "src/util/counter.h"
#include "src/util/forbid_copy.h"
#include "src/util/uniq_vector.h"
namespace re2c
{
-class Warn;
+class Msg;
struct Opt;
struct opt_t;
template <typename value_t> class uniq_vector_t;
bool cond_goto;
bool warn_condition_order;
bool need_header;
- Warn &warn;
+ Msg &msg;
std::set<std::string> skeletons;
size_t max_fill;
size_t max_nmatch;
- explicit Output(Warn &w);
+ explicit Output(Msg &msg);
~Output();
std::ostream & stream ();
void output_tags (std::ostream &o, uint32_t ind, const ConfTags &conf, const std::set<std::string> &tags, const opt_t *opts);
void output_line_info (std::ostream &o, uint32_t line, const std::string &fname, bool iflag);
-void output_cond_goto (std::ostream &o, uint32_t ind, const std::vector<std::string> &conds, const opt_t *opts, Warn &warn, bool warn_cond_order, const loc_t &loc);
+void output_cond_goto (std::ostream &o, uint32_t ind, const std::vector<std::string> &conds, const opt_t *opts, Msg &msg, bool warn_cond_order, const loc_t &loc);
void output_cond_table (std::ostream &o, uint32_t ind, const std::vector<std::string> &conds, const opt_t *opts);
void output_state_goto (std::ostream &o, uint32_t ind, uint32_t start_label, uint32_t fill_index, const opt_t *opts);
void output_types (std::ostream &o, uint32_t ind, const opt_t *opts, const uniq_vector_t<std::string> &types);
namespace re2c {
-class Warn;
+class Msg;
static std::string make_name(const std::string &cond, uint32_t line)
{
{
const opt_t *opts = output.block().opts;
const loc_t &loc = output.block().loc;
- Warn &warn = output.warn;
+ Msg &msg = output.msg;
const std::vector<ASTRule> &rules = spec.rules;
const size_t defrule = spec.defs.empty() ? Rule::NONE : rules.size() - 1;
const Code *eof = spec.eofs.empty() ? NULL : spec.eofs.front();
RangeMgr rangemgr;
- RESpec re(rules, opts, warn, rangemgr);
+ RESpec re(rules, opts, msg, rangemgr);
split_charset(re);
find_fixed_tags(re);
insert_default_tags(re);
nfa_t nfa(re);
DDUMP_NFA(opts, nfa);
- dfa_t dfa(nfa, opts, cond, warn);
+ dfa_t dfa(nfa, opts, cond, msg);
DDUMP_DFA_DET(opts, dfa);
rangemgr.clear();
// skeleton must be constructed after DFA construction
// but prior to any other DFA transformations
- Skeleton skeleton(dfa, opts, defrule, name, cond, loc);
- warn_undefined_control_flow(skeleton, warn);
+ Skeleton skeleton(dfa, opts, defrule, name, cond, loc, msg);
+ warn_undefined_control_flow(skeleton);
if (opts->target == TARGET_SKELETON) {
emit_data(skeleton);
}
- cutoff_dead_rules(dfa, defrule, cond, warn);
+ cutoff_dead_rules(dfa, defrule, cond, msg);
insert_fallback_tags(dfa);
// ADFA stands for 'DFA with actions'
DFA *adfa = new DFA(dfa, fill, defrule, skeleton.sizeof_key,
- loc, name, cond, setup, eof, opts);
+ loc, name, cond, setup, eof, opts, msg);
// see note [reordering DFA states]
adfa->reorder();
rspecs = specs;
ropts = output.block().opts;
} else {
- validate_ast(specs, output.block().opts);
+ validate_ast(specs, output.block().opts, output.msg);
normalize_ast(specs);
// compile AST to DFA
#include <valarray>
#include <vector>
-#include "src/options/warn.h"
+#include "src/msg/msg.h"
#include "src/dfa/dfa.h"
#include "src/regexp/rule.h"
#include "src/util/forbid_copy.h"
static void warn_dead_rules(const dfa_t &dfa, size_t defrule,
- const std::string &cond, const bool *live, Warn &warn)
+ const std::string &cond, const bool *live, Msg &msg)
{
const size_t nstates = dfa.states.size();
const size_t nrules = dfa.rules.size();
for (size_t i = 0; i < nrules; ++i) {
// default rule '*' should not be reported
if (i != defrule && !live[i * nstates]) {
- warn.unreachable_rule(cond, dfa.rules[i]);
+ msg.warn.unreachable_rule(cond, dfa.rules[i]);
}
}
}
}
-void cutoff_dead_rules(dfa_t &dfa, size_t defrule, const std::string &cond, Warn &warn)
+void cutoff_dead_rules(dfa_t &dfa, size_t defrule, const std::string &cond
+ , Msg &msg)
{
const rdfa_t rdfa(dfa);
const size_t
memset(live, 0, nl * sizeof(bool));
liveness_analyses(rdfa, live);
- warn_dead_rules(dfa, defrule, cond, live, warn);
+ warn_dead_rules(dfa, defrule, cond, live, msg);
remove_dead_final_states(dfa, fallthru);
find_fallback_states(dfa, fallthru);
#include <vector>
#include "src/options/opt.h"
-#include "src/options/warn.h"
#include "src/debug/debug.h"
#include "src/dfa/dfa.h"
#include "src/dfa/determinization.h"
#include "src/dfa/tcmd.h"
+#include "src/msg/msg.h"
#include "src/nfa/nfa.h"
#include "src/regexp/rule.h"
#include "src/regexp/tag.h"
dfa_t::dfa_t(const nfa_t &nfa, const opt_t *opts, const std::string &cond
- , Warn &warn)
+ , Msg &msg)
: states()
, nchars(nfa.charset.size() - 1) // (n + 1) bounds for n ranges
, charset(nfa.charset)
, tcmd0(NULL)
, tcid0(TCID0)
{
- determ_context_t ctx(opts, warn, cond, nfa, *this);
+ determ_context_t ctx(opts, msg, cond, nfa, *this);
const uint32_t INITIAL_TAGS = init_tag_versions(ctx);
{
if (ctx.dc_opts->posix_syntax) return;
- Warn &warn = ctx.dc_warn;
+ Warn &warn = ctx.dc_msg.warn;
const kernels_t &kernels = ctx.dc_kernels;
const std::vector<Tag> &tags = ctx.dc_dfa.tags;
const std::valarray<Rule> &rules = ctx.dc_dfa.rules;
}
-determ_context_t::determ_context_t(const opt_t *opts, Warn &warn
+determ_context_t::determ_context_t(const opt_t *opts, Msg &msg
, const std::string &condname, const nfa_t &nfa, dfa_t &dfa)
: dc_opts(opts)
- , dc_warn(warn)
+ , dc_msg(msg)
, dc_condname(condname)
, dc_nfa(nfa)
, dc_dfa(dfa)
// fwd
struct opt_t;
-struct Warn;
+struct Msg;
struct dfa_t;
struct tcmd_t;
{
// determinization input
const opt_t *dc_opts; // options
- Warn &dc_warn; // warnings
+ Msg &dc_msg; // error messages and warnings
const std::string &dc_condname; // the name of current condition (with -c)
const nfa_t &dc_nfa; // TNFA
dump_dfa_t dc_dump;
closure_stats_t dc_clstats;
- determ_context_t(const opt_t *, Warn &, const std::string &, const nfa_t &, dfa_t &);
+ determ_context_t(const opt_t *, Msg &, const std::string &, const nfa_t &, dfa_t &);
FORBID_COPY(determ_context_t);
};
#include <set>
#include <string.h>
-#include "src/options/warn.h"
+#include "src/msg/msg.h"
#include "src/dfa/tcmd.h"
#include "src/regexp/rule.h"
#include "src/regexp/tag.h"
tcid_t tcid0;
dfa_t(const nfa_t &nfa, const opt_t *opts, const std::string &cond
- , Warn &warn);
+ , Msg &msg);
~dfa_t();
FORBID_COPY(dfa_t);
void minimization(dfa_t &dfa, dfa_minimization_t type);
void fillpoints(const dfa_t &dfa, std::vector<size_t> &fill);
-void cutoff_dead_rules(dfa_t &dfa, size_t defrule, const std::string &cond, Warn &warn);
+void cutoff_dead_rules(dfa_t &dfa, size_t defrule, const std::string &cond, Msg &msg);
void insert_fallback_tags(dfa_t &dfa);
void compact_and_optimize_tags(const opt_t *opts, dfa_t &dfa);
void freeze_tags(dfa_t &dfa);
#include "src/parse/scanner.h"
#include "src/codegen/output.h"
#include "src/compile.h"
+#include "src/msg/msg.h"
#include "src/options/opt.h"
-#include "src/options/warn.h"
using namespace re2c;
{
conopt_t globopts;
Opt opts(globopts);
- Warn warn;
+ Msg msg;
- switch (parse_opts(argv, globopts, opts, warn)) {
+ switch (parse_opts(argv, globopts, opts, msg)) {
case OK: break;
case EXIT_OK: return 0;
case EXIT_FAIL: return 1;
}
- Scanner scanner(&globopts, warn, opts.source_file);
- if (!scanner.init(opts.source_file)) return 1;
+ Scanner scanner(&globopts, msg);
+ if (!scanner.open(opts.source_file, NULL)) {
+ return 1;
+ }
- Output output(warn);
+ Output output(msg);
compile(scanner, output, opts);
- if (!output.emit()) return 1;
- return warn.error() ? 1 : 0;
+ if (!output.emit()) {
+ return 1;
+ }
+
+ return msg.warn.error() ? 1 : 0;
}
#define _RE2C_MSG_LOCATION_
#include "src/util/c99_stdint.h"
-#include <string.h>
namespace re2c {
{
uint32_t line;
uint32_t coln;
- std::string fname;
-
- loc_t(uint32_t l, uint32_t c, const std::string &f)
- : line(l), coln(c), fname(f) {}
+ uint32_t file;
};
+static const loc_t ATSTART = {1, 0, 0};
+static const loc_t NOWHERE = {~0u, ~0u, ~0u};
+
} // namespace re2c
#endif // _RE2C_MSG_LOCATION_
#include <string>
#include "config.h"
-#include "src/options/msg.h"
+#include "src/msg/msg.h"
#include "src/options/ver_to_vernum.h"
extern const char *help; // autogenerated
exit(1);
}
-void fatal(const loc_t &loc, const char *fmt, ...)
+void Msg::fatal(const loc_t &loc, const char *fmt, ...)
{
- fprintf(stderr, "%s:%u:%u: error: ", loc.fname.c_str(), loc.line, loc.coln);
+ fprintf(stderr, "%s:%u:%u: error: "
+ , filenames[loc.file].c_str(), loc.line, loc.coln);
va_list args;
va_start(args, fmt);
error("expected argument to option %s", option);
}
-void warning_start(const loc_t &loc, bool error)
+void Msg::warning_start(const loc_t &loc, bool error)
{
const char *msg = error ? "error" : "warning";
- fprintf(stderr, "%s:%u:%u: %s: ", loc.fname.c_str(), loc.line, loc.coln, msg);
+ fprintf(stderr, "%s:%u:%u: %s: "
+ , filenames[loc.file].c_str(), loc.line, loc.coln, msg);
}
-void warning_end(const char *type, bool error)
+void Msg::warning_end(const char *type, bool error)
{
if (type != NULL) {
const char *prefix = error ? "error-" : "";
fprintf(stderr, "\n");
}
-void warning(const char *type, const loc_t &loc, bool error
+void Msg::warning(const char *type, const loc_t &loc, bool error
, const char *fmt, ...)
{
warning_start(loc, error);
--- /dev/null
+#ifndef _RE2C_MSG_MSG_
+#define _RE2C_MSG_MSG_
+
+#include "src/util/c99_stdint.h"
+#include <string>
+#include <vector>
+
+#include "src/msg/location.h"
+#include "src/options/warn.h"
+#include "src/util/attribute.h"
+
+
+namespace re2c {
+
+class Msg
+{
+public:
+ std::vector<std::string> filenames;
+ Warn warn;
+
+public:
+ inline Msg(): filenames(), warn(*this) {}
+
+ size_t register_filename(const std::string &filename);
+ void fatal(const loc_t &loc, const char *fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 3, 4), noreturn));
+ void warning(const char *type, const loc_t &loc, bool error, const char *fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 5, 6)));
+
+ friend class Warn;
+
+private:
+ void warning_start(const loc_t &loc, bool error);
+ void warning_end(const char *type, bool error);
+};
+
+void error(const char *fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 1, 2)));
+void fatal(const char *fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 1, 2), noreturn));
+void error_arg(const char *option);
+void usage ();
+void vernum ();
+void version ();
+std::string incond (const std::string & cond);
+
+} // namespace re2c
+
+#endif // _RE2C_MSG_MSG_
+
+++ /dev/null
-#ifndef _RE2C_CONF_MSG_
-#define _RE2C_CONF_MSG_
-
-#include "src/util/c99_stdint.h"
-#include <string>
-
-#include "src/msg/location.h"
-#include "src/util/attribute.h"
-
-namespace re2c {
-
-void error(const char *fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 1, 2)));
-void fatal(const char *fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 1, 2), noreturn));
-void fatal(const loc_t &loc, const char *fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 2, 3), noreturn));
-void error_arg(const char *option);
-void warning_start(const loc_t &loc, bool error);
-void warning_end(const char *type, bool error);
-void warning(const char *type, const loc_t &loc, bool error, const char *fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 4, 5)));
-void usage ();
-void vernum ();
-void version ();
-std::string incond (const std::string & cond);
-
-} // namespace re2c
-
-#endif // _RE2C_CONF_MSG_
-#include "src/options/msg.h"
#include "src/options/opt.h"
namespace re2c
namespace re2c
{
-class Warn;
+class Msg;
enum target_t
{
EXIT_FAIL
};
-parse_opts_t parse_opts(char **argv, conopt_t &globopts, Opt &opts, Warn &warn);
+parse_opts_t parse_opts(char **argv, conopt_t &globopts, Opt &opts, Msg &msg);
} // namespace re2c
#include "src/codegen/input_api.h"
-#include "src/options/msg.h"
#include "src/options/opt.h"
#include "src/regexp/empty_class_policy.h"
#include "src/encoding/enc.h"
return arg != NULL;
}
-parse_opts_t parse_opts(char **argv, conopt_t &globopts, Opt &opts, Warn &warn)
+parse_opts_t parse_opts(char **argv, conopt_t &globopts, Opt &opts, Msg &msg)
{
#define YYCTYPE unsigned char
"-" { goto opt_short; }
"--" { goto opt_long; }
- "-W" end { warn.set_all (); goto opt; }
- "-Werror" end { warn.set_all_error (); goto opt; }
+ "-W" end { msg.warn.set_all (); goto opt; }
+ "-Werror" end { msg.warn.set_all_error (); goto opt; }
"-W" { option = Warn::W; goto opt_warn; }
"-Wno-" { option = Warn::WNO; goto opt_warn; }
"-Werror-" { option = Warn::WERROR; goto opt_warn; }
/*!re2c
* { ERROR("bad warning: %s", *argv); }
- "condition-order" end { warn.set (Warn::CONDITION_ORDER, option); goto opt; }
- "empty-character-class" end { warn.set (Warn::EMPTY_CHARACTER_CLASS, option); goto opt; }
- "match-empty-string" end { warn.set (Warn::MATCH_EMPTY_STRING, option); goto opt; }
- "nondeterministic-tags" end { warn.set (Warn::NONDETERMINISTIC_TAGS, option); goto opt; }
- "swapped-range" end { warn.set (Warn::SWAPPED_RANGE, option); goto opt; }
- "undefined-control-flow" end { warn.set (Warn::UNDEFINED_CONTROL_FLOW, option); goto opt; }
- "unreachable-rules" end { warn.set (Warn::UNREACHABLE_RULES, option); goto opt; }
- "useless-escape" end { warn.set (Warn::USELESS_ESCAPE, option); goto opt; }
+ "condition-order" end { msg.warn.set (Warn::CONDITION_ORDER, option); goto opt; }
+ "empty-character-class" end { msg.warn.set (Warn::EMPTY_CHARACTER_CLASS, option); goto opt; }
+ "match-empty-string" end { msg.warn.set (Warn::MATCH_EMPTY_STRING, option); goto opt; }
+ "nondeterministic-tags" end { msg.warn.set (Warn::NONDETERMINISTIC_TAGS, option); goto opt; }
+ "swapped-range" end { msg.warn.set (Warn::SWAPPED_RANGE, option); goto opt; }
+ "undefined-control-flow" end { msg.warn.set (Warn::UNDEFINED_CONTROL_FLOW, option); goto opt; }
+ "unreachable-rules" end { msg.warn.set (Warn::UNREACHABLE_RULES, option); goto opt; }
+ "useless-escape" end { msg.warn.set (Warn::USELESS_ESCAPE, option); goto opt; }
*/
opt_short:
#include <algorithm>
#include <set>
-#include "src/options/msg.h"
#include "src/options/warn.h"
#include "src/skeleton/path.h"
#include "src/regexp/rule.h"
#undef W
};
-Warn::Warn ()
+Warn::Warn (Msg &msg)
: mask ()
, error_accuml (false)
+ , msg (msg)
{
for (uint32_t i = 0; i < TYPES; ++i)
{
{
if (mask[t] & WARNING) {
// -Werror has no effect
- warning(names[t], loc, false, "%s", s);
+ msg.warning(names[t], loc, false, "%s", s);
}
}
if (mask[CONDITION_ORDER] & WARNING) {
const bool e = mask[CONDITION_ORDER] & ERROR;
error_accuml |= e;
- warning (names[CONDITION_ORDER], loc, e,
+ msg.warning (names[CONDITION_ORDER], loc, e,
"looks like you use hardcoded numbers instead of autogenerated "
"condition names: better add '/*!types:re2c*/' directive or "
"'-t, --type-header' option and don't rely on fixed condition order.");
if (mask[EMPTY_CHARACTER_CLASS] & WARNING) {
const bool e = mask[EMPTY_CHARACTER_CLASS] & ERROR;
error_accuml |= e;
- warning (names[EMPTY_CHARACTER_CLASS], loc, e
+ msg.warning (names[EMPTY_CHARACTER_CLASS], loc, e
, "empty character class");
}
}
if (mask[MATCH_EMPTY_STRING] & WARNING) {
const bool e = mask[MATCH_EMPTY_STRING] & ERROR;
error_accuml |= e;
- warning (names[MATCH_EMPTY_STRING], loc, e,
+ msg.warning (names[MATCH_EMPTY_STRING], loc, e,
"rule %smatches empty string", incond(cond).c_str());
}
}
bool e = mask[NONDETERMINISTIC_TAGS] & ERROR;
error_accuml |= e;
- warning_start(loc, e);
+ msg.warning_start(loc, e);
if (tagname == NULL) {
fprintf(stderr, "trailing context");
}
" %shas %u%s degree of nondeterminism",
incond(cond).c_str(), static_cast<uint32_t>(nver),
nver == 2 ? "nd" : nver == 3 ? "rd" : "th");
- warning_end(names[NONDETERMINISTIC_TAGS], e);
+ msg.warning_end(names[NONDETERMINISTIC_TAGS], e);
}
}
if (mask[SWAPPED_RANGE] & WARNING) {
const bool e = mask[SWAPPED_RANGE] & ERROR;
error_accuml |= e;
- warning(names[SWAPPED_RANGE], loc, e
+ msg.warning(names[SWAPPED_RANGE], loc, e
, "range lower bound (0x%X) is greater than upper bound (0x%X), swapping", l, u);
}
}
// report shorter patterns first
std::sort(paths.begin(), paths.end());
- warning_start(skel.loc, e);
+ msg.warning_start(skel.loc, e);
fprintf(stderr, "control flow %sis undefined for strings that match "
, incond(skel.cond).c_str());
const size_t count = paths.size();
fprintf(stderr, " ... and a few more");
}
fprintf(stderr, ", use default rule '*'");
- warning_end(names[UNDEFINED_CONTROL_FLOW], e);
+ msg.warning_end(names[UNDEFINED_CONTROL_FLOW], e);
}
}
const bool e = mask[UNREACHABLE_RULES] & ERROR;
error_accuml |= e;
- warning_start(rule.code->loc, e);
+ msg.warning_start(rule.code->loc, e);
fprintf(stderr, "unreachable rule %s", incond(cond).c_str());
const size_t shadows = rule.shadow.size();
if (shadows > 0) {
}
fprintf(stderr, ")");
}
- warning_end(names[UNREACHABLE_RULES], e);
+ msg.warning_end(names[UNREACHABLE_RULES], e);
}
}
if (mask[USELESS_ESCAPE] & WARNING) {
const bool e = mask[USELESS_ESCAPE] & ERROR;
error_accuml |= e;
- warning(names[USELESS_ESCAPE], loc, e
+ msg.warning(names[USELESS_ESCAPE], loc, e
, "escape has no effect: '\\%c'", c);
}
}
namespace re2c {
+class Msg;
class path_t;
struct Rule;
struct Skeleton;
static const char * names [TYPES];
uint32_t mask[TYPES];
bool error_accuml;
+ Msg &msg;
public:
- Warn ();
+ explicit Warn (Msg &msg);
bool error () const;
void set (type_t t, option_t o);
void set_all ();
{
uint32_t chr;
loc_t loc;
-
- ASTChar(): chr(0), loc(0, 0, "") {}
- ASTChar(uint32_t c, const loc_t &l): chr(c), loc(l) {}
};
struct ASTRange
#include "src/parse/input.h"
#include "src/parse/scanner.h"
-#include "src/options/msg.h"
#include "src/util/get_dir.h"
#include "src/util/string_utils.h"
namespace re2c {
-Input::Input()
+Input::Input(size_t fidx)
: file(NULL)
, name()
, escaped_name()
, so(Scanner::ENDPOS)
, eo(Scanner::ENDPOS)
, line(1)
+ , fidx(static_cast<uint32_t>(fidx))
{}
bool Input::open(const std::string &filename, const std::string *parent
const char *so; // start offset in buffer
const char *eo; // end offset in buffer
uint32_t line;
+ uint32_t fidx;
- Input();
+ explicit Input(size_t fidx);
~Input();
bool open(const std::string &filename, const std::string *parent
, const std::vector<std::string> &incpaths);
#include <limits>
#include <string>
-#include "src/options/msg.h"
#include "src/codegen/output.h"
#include "src/encoding/enc.h"
#include "src/parse/input.h"
/*!re2c
* { goto loop; }
eof {
- fatal(cur_loc(), "expected end of block");
+ msg.fatal(cur_loc(), "expected end of block");
}
eol {
next_line();
loop:
/*!re2c
* {
- fatal(cur_loc(), "unrecognized configuration");
+ msg.fatal(cur_loc(), "unrecognized configuration");
}
"format" {
fmt = lex_conf_string();
"{" [0-9]+ "}" {
if (!s_to_u32_unsafe (tok + 1, cur - 1, yylval.bounds.min)) {
- fatal(tok_loc(), "repetition count overflow");
+ msg.fatal(tok_loc(), "repetition count overflow");
}
yylval.bounds.max = yylval.bounds.min;
return TOKEN_CLOSESIZE;
"{" [0-9]+ @p "," [0-9]+ "}" {
if (!s_to_u32_unsafe (tok + 1, p, yylval.bounds.min)) {
- fatal(tok_loc(), "repetition lower bound overflow");
+ msg.fatal(tok_loc(), "repetition lower bound overflow");
}
if (!s_to_u32_unsafe (p + 1, cur - 1, yylval.bounds.max)) {
- fatal(tok_loc(), "repetition upper bound overflow");
+ msg.fatal(tok_loc(), "repetition upper bound overflow");
}
return TOKEN_CLOSESIZE;
}
"{" [0-9]+ ",}" {
if (!s_to_u32_unsafe (tok + 1, cur - 2, yylval.bounds.min)) {
- fatal(tok_loc(), "repetition lower bound overflow");
+ msg.fatal(tok_loc(), "repetition lower bound overflow");
}
yylval.bounds.max = std::numeric_limits<uint32_t>::max();
return TOKEN_CLOSESIZE;
}
"{" [0-9]* "," {
- fatal(tok_loc(), "illegal closure form, use '{n}', '{n,}', '{n,m}' "
+ msg.fatal(tok_loc(), "illegal closure form, use '{n}', '{n,}', '{n,m}' "
"where n and m are numbers");
}
"{" name "}" {
if (!globopts->FFlag) {
- fatal(tok_loc(), "curly braces for names only allowed with -F switch");
+ msg.fatal(tok_loc(), "curly braces for names only allowed with -F switch");
}
yylval.str = newstr(tok + 1, cur - 1);
return TOKEN_ID;
// precedence in cases like ab*: it should be a(b)*, not (ab)*
cur = tok + 1;
- ASTChar c(static_cast<uint8_t>(tok[0]), tok_loc());
+ ASTChar c = {static_cast<uint8_t>(tok[0]), tok_loc()};
std::vector<ASTChar> *str = new std::vector<ASTChar>;
str->push_back(c);
yylval.regexp = ast_str(tok_loc(), str, false);
}
* {
- fatal(tok_loc(), "unexpected character: '%c'", *tok);
+ msg.fatal(tok_loc(), "unexpected character: '%c'", *tok);
goto scan;
}
*/
return kind;
error:
delete cl;
- fatal(cur_loc(), "syntax error in condition list");
+ msg.fatal(cur_loc(), "syntax error in condition list");
}
void Scanner::lex_code_indented()
}
eof { fail_if_eof(); goto code; }
- [{}] { fatal(cur_loc(), "Curly braces are not allowed after ':='"); }
+ [{}] { msg.fatal(cur_loc(), "Curly braces are not allowed after ':='"); }
"/*" { lex_c_comment(); goto code; }
"//" { lex_cpp_comment(); goto code; }
["'] { lex_string(cur[-1]); goto code; }
"-" / [^\]] {
u = lex_cls_chr();
if (l > u) {
- warn.swapped_range(loc, l, u);
+ msg.warn.swapped_range(loc, l, u);
std::swap(l, u);
}
goto add;
tok = cur;
const loc_t &loc = cur_loc();
/*!re2c
- * { fatal(loc, "syntax error"); }
+ * { msg.fatal(loc, "syntax error"); }
eof { fail_if_eof(); return 0; }
- esc? eol { fatal(loc, "newline in character class"); }
- esc [xXuU] { fatal(loc, "syntax error in hexadecimal escape sequence"); }
- esc [0-7] { fatal(loc, "syntax error in octal escape sequence"); }
- esc { fatal(loc, "syntax error in escape sequence"); }
+ esc? eol { msg.fatal(loc, "newline in character class"); }
+ esc [xXuU] { msg.fatal(loc, "syntax error in hexadecimal escape sequence"); }
+ esc [0-7] { msg.fatal(loc, "syntax error in octal escape sequence"); }
+ esc { msg.fatal(loc, "syntax error in escape sequence"); }
. \ esc { return static_cast<uint8_t>(tok[0]); }
esc_hex { return unesc_hex(tok, cur); }
esc "-" { return static_cast<uint8_t>('-'); }
esc "]" { return static_cast<uint8_t>(']'); }
esc (.\eof){
- warn.useless_escape(loc, tok[1]);
+ msg.warn.useless_escape(loc, tok[1]);
return static_cast<uint8_t>(tok[1]);
}
*/
const loc_t &loc = ast.loc;
bool ok = true;
/*!re2c
- * { fatal(loc, "syntax error"); }
- esc? eol { fatal(loc, "newline in character string"); }
- esc [xXuU] { fatal(loc, "syntax error in hexadecimal escape sequence"); }
- esc [0-7] { fatal(loc, "syntax error in octal escape sequence"); }
- esc { fatal(loc, "syntax error in escape sequence"); }
+ * { msg.fatal(loc, "syntax error"); }
+ esc? eol { msg.fatal(loc, "newline in character string"); }
+ esc [xXuU] { msg.fatal(loc, "syntax error in hexadecimal escape sequence"); }
+ esc [0-7] { msg.fatal(loc, "syntax error in octal escape sequence"); }
+ esc { msg.fatal(loc, "syntax error in escape sequence"); }
eof { fail_if_eof(); ast.chr = 0; goto end; }
const char c = tok[1];
ast.chr = static_cast<uint8_t>(c);
if (tok[1] != quote) {
- warn.useless_escape(loc, c);
+ msg.warn.useless_escape(loc, c);
}
goto end;
}
lineno {
uint32_t l;
if (!s_to_u32_unsafe(tok, cur, l)) {
- fatal(tok_loc(), "line number overflow");
+ msg.fatal(tok_loc(), "line number overflow");
}
set_line(l);
goto sourceline;
}
dstring {
- std::string &name = get_input().escaped_name;
+ Input &in = get_input();
+ std::string &name = in.escaped_name;
name = getstr(tok + 1, cur - 1);
strrreplace(name, "\\", "\\\\");
+ in.fidx = static_cast<uint32_t>(msg.filenames.size());
+ msg.filenames.push_back(name);
goto sourceline;
}
void Scanner::fail_if_eof() const
{
if (is_eof()) {
- fatal(cur_loc(), "unexpected end of input");
+ msg.fatal(cur_loc(), "unexpected end of input");
}
}
#include <string>
#include "src/codegen/output.h"
-#include "src/options/msg.h"
#include "src/encoding/enc.h"
#include "src/parse/ast.h"
#include "src/parse/scanner.h"
"eof" {
const int32_t eof = lex_conf_number();
if (eof < 0) {
- fatal(cur_loc(), "eof cannot have negative value");
+ msg.fatal(cur_loc(), "eof cannot have negative value");
}
opts.set_eof(static_cast<uint32_t>(eof));
return;
"cgoto:threshold" {
const int32_t n = lex_conf_number ();
if (n < 0) {
- fatal(cur_loc(), "configuration 'cgoto:threshold' must be nonnegative");
+ msg.fatal(cur_loc(), "configuration 'cgoto:threshold' must be nonnegative");
}
opts.set_cGotoThreshold (static_cast<uint32_t> (n));
return;
"indent:top" {
const int32_t n = lex_conf_number ();
if (n < 0) {
- fatal(cur_loc(), "configuration 'indent:top' must be nonnegative");
+ msg.fatal(cur_loc(), "configuration 'indent:top' must be nonnegative");
}
opts.set_topIndent (static_cast<uint32_t> (n));
return;
"variable:yystable" { lex_conf_string (); return; }
[a-zA-Z0-9_:-]* {
- fatal(tok_loc(), "unrecognized configuration '%.*s'",
+ msg.fatal(tok_loc(), "unrecognized configuration '%.*s'",
static_cast<int>(cur - tok), tok);
}
*/
{
lex_conf_assign ();
/*!re2c
- * { fatal(cur_loc(),
+ * { msg.fatal(cur_loc(),
"bad configuration value (expected: 'ignore', 'substitute', 'fail')"); }
"ignore" { opts.set_encoding_policy(Enc::POLICY_IGNORE); goto end; }
"substitute" { opts.set_encoding_policy(Enc::POLICY_SUBSTITUTE); goto end; }
{
lex_conf_assign ();
/*!re2c
- * { fatal(cur_loc(), "bad configuration value (expected: 'default', 'custom')"); }
+ * { msg.fatal(cur_loc(), "bad configuration value (expected: 'default', 'custom')"); }
"default" { opts.set_input_api(INPUT_DEFAULT); goto end; }
"custom" { opts.set_input_api(INPUT_CUSTOM); goto end; }
*/
{
lex_conf_assign ();
/*!re2c
- * { fatal(cur_loc(),
+ * { msg.fatal(cur_loc(),
"bad configuration value (expected: 'match-empty', 'match-none', 'error')"); }
"match-empty" { opts.set_empty_class_policy(EMPTY_CLASS_MATCH_EMPTY); goto end; }
"match-none" { opts.set_empty_class_policy(EMPTY_CLASS_MATCH_NONE); goto end; }
void Scanner::lex_conf_assign ()
{
/*!re2c
- * { fatal(cur_loc(), "missing '=' in configuration"); }
+ * { msg.fatal(cur_loc(), "missing '=' in configuration"); }
conf_assign { return; }
*/
}
void Scanner::lex_conf_semicolon ()
{
/*!re2c
- * { fatal(cur_loc(), "missing ending ';' in configuration"); }
+ * { msg.fatal(cur_loc(), "missing ending ';' in configuration"); }
space* ";" { return; }
*/
}
lex_conf_assign ();
tok = cur;
/*!re2c
- * { fatal(cur_loc(), "bad configuration value (expected number)"); }
+ * { msg.fatal(cur_loc(), "bad configuration value (expected number)"); }
number {
int32_t n = 0;
if (!s_to_i32_unsafe (tok, cur, n)) {
- fatal(cur_loc(), "configuration value overflow");
+ msg.fatal(cur_loc(), "configuration value overflow");
}
lex_conf_semicolon ();
return n;
goto end;
}
if (c.chr > 0xFF) {
- fatal(c.loc, "multibyte character in configuration string: 0x%X", c.chr);
+ msg.fatal(c.loc
+ , "multibyte character in configuration string: 0x%X"
+ , c.chr);
} else {
s += static_cast<char>(c.chr);
}
#include "src/parse/ast.h"
#include "src/parse/scanner.h"
-#include "src/options/msg.h"
#include "src/options/opt.h"
namespace re2c
void parse(Scanner &input, specs_t &specs, symtab_t &symtab, Opt &opts);
void validate_mode(Scanner::ParseMode mode, bool rflag, bool rules, Scanner &input);
-void validate_ast(const specs_t &specs, const opt_t *opts);
+void validate_ast(const specs_t &specs, const opt_t *opts, Msg &msg);
void normalize_ast(specs_t &specs);
} // namespace re2c
def
: name expr enddef {
if (!context.symtab.insert(std::make_pair(*$1, $2)).second) {
- fatal(context.input.tok_loc(), "sym already defined");
+ context.input.msg.fatal(context.input.tok_loc()
+ , "sym already defined");
}
delete $1;
}
/* errors */
| name expr '/' {
- fatal(context.input.tok_loc()
+ context.input.msg.fatal(context.input.tok_loc()
, "trailing contexts are not allowed in named definitions");
};
| TOKEN_ID {
symtab_t::iterator i = context.symtab.find(*$1);
if (i == context.symtab.end()) {
- fatal(context.input.tok_loc(), "undefined symbol '%s'", $1->c_str());
+ context.input.msg.fatal(context.input.tok_loc()
+ , "undefined symbol '%s'", $1->c_str());
}
$$ = i->second;
if (ast_need_wrap($$)) {
void yyerror(context_t &context, const char* s)
{
- fatal(context.input.tok_loc(), "%s", s);
+ context.input.msg.fatal(context.input.tok_loc(), "%s", s);
}
int yylex(context_t &context)
#include <string.h>
#include "src/parse/scanner.h"
-#include "src/options/msg.h"
#include "src/debug/debug.h"
namespace re2c {
-class Warn;
-
const char *const Scanner::ENDPOS = (const char*) ~0LU;
Scanner::~Scanner()
return i;
}
-bool Scanner::init(const std::string &filename)
+bool Scanner::open(const std::string &filename, const std::string *parent)
{
- Input *in = new Input;
+ Input *in = new Input(msg.filenames.size());
files.push_back(in);
- return in->open(filename, NULL, globopts->incpaths);
+ if (!in->open(filename, parent, globopts->incpaths)) {
+ return false;
+ }
+ msg.filenames.push_back(in->escaped_name);
+ return true;
}
bool Scanner::include(const std::string &filename)
}
// open new file and place place at the top of stack
- Input *in = new Input;
- files.push_back(in);
- if (!in->open(filename, &parent, globopts->incpaths)) return false;
+ if (!open(filename, &parent)) {
+ return false;
+ }
// refill buffer (discard everything up to cursor, clear EOF)
lim = cur = mar = ctx = tok = ptr = pos = bot + BSIZE;
#include <vector>
#include "src/msg/location.h"
+#include "src/msg/msg.h"
#include "src/parse/input.h"
#include "src/parse/lex.h"
#include "src/options/opt.h"
-#include "src/options/warn.h"
#include "src/encoding/enc.h"
#include "src/util/attribute.h"
#include "src/util/forbid_copy.h"
namespace re2c
{
-class Warn;
+class Msg;
struct Opt;
struct conopt_t;
class Output;
enum ParseMode {Stop, Parse, Reuse, Rules};
static const char *const ENDPOS;
+ Msg &msg;
+
private:
std::vector<Input*> files;
const conopt_t *globopts;
- Warn &warn;
loc_t loc;
public:
- Scanner(const conopt_t *o, Warn &w, const char *f);
+ Scanner(const conopt_t *o, Msg &m);
~Scanner();
- bool init(const std::string &filename);
+ bool open(const std::string &filename, const std::string *parent);
bool include(const std::string &filename);
const loc_t &tok_loc() const;
loc_t cur_loc() const;
FORBID_COPY (Scanner);
};
-inline Scanner::Scanner(const conopt_t *o, Warn &w, const char *f)
+inline Scanner::Scanner(const conopt_t *o, Msg &m)
: ScannerState()
+ , msg(m)
, files()
, globopts(o)
- , warn(w)
- , loc(1, 0, f)
+ , loc(ATSTART)
{}
inline loc_t Scanner::cur_loc() const
{
- const std::string &f = get_cinput().escaped_name;
- const uint32_t l = get_cinput().line;
+ const Input &in = get_cinput();
uint32_t c = static_cast<uint32_t>(cur - pos);
if (is_eof()) {
DASSERT(c > 0);
--c;
}
- return loc_t(l, c, f);
+ const loc_t loc = {in.line, c, in.fidx};
+ return loc;
}
inline const loc_t &Scanner::tok_loc() const
#include "src/parse/ast.h"
#include "src/parse/scanner.h"
-#include "src/options/msg.h"
#include "src/regexp/rule.h"
namespace re2c {
-void validate_mode(Scanner::ParseMode mode, bool rflag, bool rules, Scanner &input)
+void validate_mode(Scanner::ParseMode mode, bool rflag, bool rules
+ , Scanner &input)
{
+ Msg &msg = input.msg;
const loc_t &l = input.tok_loc();
if (mode == Scanner::Rules) {
if (!rflag) {
- fatal(l, "found 'rules:re2c' block without -r flag");
+ msg.fatal(l, "found 'rules:re2c' block without -r flag");
}
else if (rules) {
- fatal(l, "cannot have a second 'rules:re2c' block");
+ msg.fatal(l, "cannot have a second 'rules:re2c' block");
}
}
else if (mode == Scanner::Reuse) {
if (!rflag) {
- fatal(l, "found 'use:re2c' block without -r flag");
+ msg.fatal(l, "found 'use:re2c' block without -r flag");
}
else if (!rules) {
- fatal(l, "got 'use:re2c' without 'rules:re2c'");
+ msg.fatal(l, "got 'use:re2c' without 'rules:re2c'");
}
}
else if (rflag) {
- fatal(l, "found standard 're2c' block while using -r flag");
+ msg.fatal(l, "found standard 're2c' block while using -r flag");
}
}
-void validate_ast(const specs_t &specs, const opt_t *opts)
+void validate_ast(const specs_t &specs, const opt_t *opts, Msg &msg)
{
- static const uint32_t NONE = ~0u;
specs_t::const_iterator i, b = specs.begin(), e = specs.end();
if (b == e) return;
for (i = b; i != e; ++i) {
if (i->defs.size() > 1) {
- fatal(i->defs[1]->loc,
+ msg.fatal(i->defs[1]->loc,
"code to default rule %sis already defined at line %u",
incond(i->name).c_str(), i->defs[0]->loc.line);
}
if (!i->eofs.empty() && opts->eof == NOEOF) {
- fatal(i->eofs[0]->loc,
+ msg.fatal(i->eofs[0]->loc,
"%sEOF rule found, but 're2c:eof' configuration is not set",
incond(i->name).c_str());
}
incond(i->name).c_str());
}
else if (!i->eofs.empty() && opts->fFlag) {
- fatal(i->eofs[0]->loc,
+ msg.fatal(i->eofs[0]->loc,
"%sEOF rule is unreachable in push-model lexers",
incond(i->name).c_str());
}
else if (i->eofs.size() > 1) {
- fatal(i->eofs[1]->loc,
+ msg.fatal(i->eofs[1]->loc,
"EOF rule %sis already defined at line %u",
incond(i->name).c_str(), i->eofs[0]->loc.line);
}
}
- static const loc_t nowhere(NONE, NONE, "");
-
if (!opts->cFlag) {
for (i = b; i != e; ++i) {
if (!i->name.empty()) {
const loc_t &l = !i->rules.empty()
? i->rules[0].code->loc : !i->defs.empty()
- ? i->defs[0]->loc : nowhere;
- if (l.line != NONE) {
- fatal(l, "conditions are only allowed with '-c', "
- "'--conditions' option");
+ ? i->defs[0]->loc : NOWHERE;
+ if (l.line != NOWHERE.line) {
+ msg.fatal(l, "conditions are only allowed with "
+ "'-c', '--conditions' option");
}
}
}
if (i->name.empty()) {
const loc_t &l = !i->rules.empty()
? i->rules[0].code->loc : !i->defs.empty()
- ? i->defs[0]->loc : nowhere;
- if (l.line != NONE) {
- fatal(l, "non-conditional rules are not allowed with "
+ ? i->defs[0]->loc : NOWHERE;
+ if (l.line != NOWHERE.line) {
+ msg.fatal(l, "non-conditional rules are not allowed with "
"'-c', '--conditions' option");
}
}
for (i = b; i != e; ++i) {
if (i->setup.size() > 1) {
- fatal(i->setup[1]->loc,
+ msg.fatal(i->setup[1]->loc,
"code to setup rule '%s' is already defined at line %u",
i->name.c_str(), i->setup[0]->loc.line);
}
for (i = b; i != e; ++i) {
if (i->name != "*" && !i->setup.empty() && i->rules.empty()) {
- fatal(i->setup[0]->loc,
+ msg.fatal(i->setup[0]->loc,
"setup for non existing condition '%s' found",
i->name.c_str());
}
if (i == e) {
for (i = b; i != e; ++i) {
if (i->name == "*") {
- fatal(i->setup[0]->loc,
+ msg.fatal(i->setup[0]->loc,
"setup for all conditions '<!*>' is illegal "
"if setup for each condition is defined explicitly");
}
for (i = b; i != e; ++i) {
if (i->name == "0" && i->rules.size() > 1) {
- fatal(i->rules[1].code->loc,
+ msg.fatal(i->rules[1].code->loc,
"startup code is already defined at line %u",
i->rules[0].code->loc.line);
}
#include <vector>
#include "src/parse/ast.h"
-#include "src/options/msg.h"
#include "src/options/opt.h"
-#include "src/options/warn.h"
-#include "src/regexp/empty_class_policy.h"
#include "src/encoding/case.h"
#include "src/encoding/enc.h"
#include "src/encoding/ebcdic/ebcdic_regexp.h"
#include "src/encoding/utf16/utf16_regexp.h"
#include "src/encoding/utf8/utf8_regexp.h"
+#include "src/msg/msg.h"
+#include "src/regexp/empty_class_policy.h"
#include "src/regexp/re.h"
#include "src/regexp/rule.h"
#include "src/regexp/tag.h"
static Range *dot_to_range(RESpec &, const AST *);
static Range *cls_to_range(RESpec &, const AST *);
static bool misuse_of_named_def(RESpec &, const AST *);
-static void assert_tags_used_once(const Rule &, const std::vector<Tag> &);
-static void init_rule(Rule &, const Code *, const std::vector<Tag> &, size_t, size_t);
+static void assert_tags_used_once(RESpec &, const Rule &, const std::vector<Tag> &);
+static void init_rule(RESpec &, Rule &, const Code *, const std::vector<Tag> &, size_t, size_t);
static bool is_icase(const opt_t *, bool);
-RESpec::RESpec(const std::vector<ASTRule> &ast, const opt_t *o, Warn &w
+RESpec::RESpec(const std::vector<ASTRule> &ast, const opt_t *o, Msg &msg
, RangeMgr &rm)
: alc()
, rangemgr(rm)
, tags(*new std::vector<Tag>)
, rules(*new std::valarray<Rule>(ast.size()))
, opts(o)
- , warn(w)
+ , msg(msg)
{
for (size_t i = 0; i < ast.size(); ++i) {
size_t ltag = tags.size(), ncap = 0;
res.push_back(ast_to_re(*this, ast[i].ast, ncap, 0));
- init_rule(rules[i], ast[i].code, tags, ltag, ncap);
+ init_rule(*this, rules[i], ast[i].code, tags, ltag, ncap);
}
}
}
case AST::TAG: {
if (ast->tag.name && !opts->tags) {
- fatal(ast->loc, "tags are only allowed with '-T, --tags' option");
+ spec.msg.fatal(ast->loc
+ , "tags are only allowed with '-T, --tags' option");
}
if (opts->posix_syntax) {
- fatal(ast->loc, "simple tags are not allowed with '--posix-captures' option");
+ spec.msg.fatal(ast->loc
+ , "simple tags are not allowed with '--posix-captures' option");
}
RE *t = re_tag(spec, tags.size(), false);
tags.push_back(Tag(ast->tag.name, ast->tag.history, height));
uint32_t c = chr.chr;
if (!spec.opts->encoding.validateChar(c)) {
- fatal(chr.loc, "bad code point: '0x%X'", c);
+ spec.msg.fatal(chr.loc, "bad code point: '0x%X'", c);
}
return icase && is_alpha(c)
for (; i != e; ++i) {
Range *s = spec.opts->encoding.validateRange(rm, i->lower, i->upper);
if (!s) {
- fatal(i->loc, "bad code point range: '0x%X - 0x%X'"
+ spec.msg.fatal(i->loc, "bad code point range: '0x%X - 0x%X'"
, i->lower, i->upper);
}
r = rm.add(r, s);
RangeMgr &rm = spec.rangemgr;
uint32_t c = '\n';
if (!spec.opts->encoding.validateChar(c)) {
- fatal(ast->loc, "bad code point: '0x%X'", c);
+ spec.msg.fatal(ast->loc, "bad code point: '0x%X'", c);
}
return rm.sub(spec.opts->encoding.fullRange(rm), rm.sym(c));
}
return spec.rangemgr.add(x, y);
}
}
- fatal(ast->loc, "can only difference char sets");
+ spec.msg.fatal(ast->loc, "can only difference char sets");
return NULL;
}
RE *re_class(RESpec &spec, const loc_t &loc, const Range *r)
{
if (!r) {
- Warn &w = spec.warn;
switch (spec.opts->empty_class_policy) {
case EMPTY_CLASS_MATCH_EMPTY:
- w.empty_class(loc);
+ spec.msg.warn.empty_class(loc);
return re_nil(spec);
case EMPTY_CLASS_MATCH_NONE:
- w.empty_class(loc);
+ spec.msg.warn.empty_class(loc);
break;
case EMPTY_CLASS_ERROR:
- fatal(loc, "empty character class");
+ spec.msg.fatal(loc, "empty character class");
}
}
if (!spec.opts->posix_syntax) return false;
- fatal(ast->loc
+ spec.msg.fatal(ast->loc
, "implicit grouping is forbidden with '--posix-captures'"
" option, please wrap '%s' in capturing parenthesis"
, ast->ref.name->c_str());
return true;
}
-void assert_tags_used_once(const Rule &rule, const std::vector<Tag> &tags)
+void assert_tags_used_once(RESpec &spec, const Rule &rule
+ , const std::vector<Tag> &tags)
{
std::set<std::string> names;
const std::string *name = NULL;
for (size_t t = rule.ltag; t < rule.htag; ++t) {
name = tags[t].name;
if (name && !names.insert(*name).second) {
- fatal(rule.code->loc
+ spec.msg.fatal(rule.code->loc
, "tag '%s' is used multiple times in the same rule"
, name->c_str());
}
}
}
-void init_rule(Rule &rule, const Code *code, const std::vector<Tag> &tags
- , size_t ltag, size_t ncap)
+void init_rule(RESpec &spec, Rule &rule, const Code *code
+ , const std::vector<Tag> &tags, size_t ltag, size_t ncap)
{
rule.code = code;
rule.ltag = ltag;
rule.htag = tags.size();
for (rule.ttag = ltag; rule.ttag < rule.htag && !trailing(tags[rule.ttag]); ++rule.ttag);
rule.ncap = ncap;
- assert_tags_used_once(rule, tags);
+ assert_tags_used_once(spec, rule, tags);
}
bool is_icase(const opt_t *opts, bool icase)
#include <valarray>
#include <vector>
-#include "src/options/warn.h"
+#include "src/msg/msg.h"
#include "src/regexp/re.h"
#include "src/regexp/rule.h"
#include "src/regexp/tag.h"
for (size_t i = 0; i < nre; ++i) {
bool trail = false;
if (nullable(spec, spec.res[i], trail)) {
- spec.warn.match_empty_string(spec.rules[i].code->loc, cond);
+ spec.msg.warn.match_empty_string(spec.rules[i].code->loc, cond);
}
}
}
std::vector<Tag> &tags;
std::valarray<Rule> &rules;
const opt_t *opts;
- Warn &warn;
+ Msg &msg;
- RESpec(const std::vector<ASTRule> &ast, const opt_t *o, Warn &w
+ RESpec(const std::vector<ASTRule> &ast, const opt_t *o, Msg &msg
, RangeMgr &rm);
FORBID_COPY(RESpec);
};
#include <stack>
#include <vector>
-#include "src/options/msg.h"
#include "src/options/opt.h"
#include "src/encoding/enc.h"
#include "src/regexp/re.h"
#include <valarray>
#include <vector>
-#include "src/options/warn.h"
+#include "src/msg/msg.h"
#include "src/regexp/rule.h"
#include "src/skeleton/path.h"
#include "src/skeleton/skeleton.h"
}
}
-void warn_undefined_control_flow(const Skeleton &skel, Warn &warn)
+void warn_undefined_control_flow(const Skeleton &skel)
{
ucf_t ucf(skel.nodes_count);
naked_paths(skel, ucf, 0);
if (!ucf.paths.empty()) {
- warn.undefined_control_flow(skel, ucf.paths, ucf.size.overflow());
+ skel.msg.warn.undefined_control_flow(skel, ucf.paths, ucf.size.overflow());
} else if (ucf.size.overflow()) {
- warn.fail(Warn::UNDEFINED_CONTROL_FLOW, skel.loc,
+ skel.msg.warn.fail(Warn::UNDEFINED_CONTROL_FLOW, skel.loc,
"DFA is too large to check undefined control flow");
}
}
#include <valarray>
#include <vector>
-#include "src/options/msg.h"
#include "src/options/opt.h"
#include "src/debug/debug.h"
#include "src/dfa/tcmd.h"
{
gencover<cunit_t, key_t>(skel, cover, 0);
if (cover.size.overflow()) {
- warning(NULL, skel.loc, false,
+ skel.msg.warning(NULL, skel.loc, false,
"DFA %sis too large: can only generate partial path cover",
incond(skel.cond).c_str());
}
#include <utility>
#include <vector>
-#include "src/options/msg.h"
#include "src/debug/debug.h"
#include "src/skeleton/skeleton.h"
Skeleton::Skeleton(const dfa_t &dfa, const opt_t *op, size_t def
, const std::string &dfa_name, const std::string &dfa_cond
- , const loc_t &loc)
+ , const loc_t &loc, Msg &msg)
: opts(op)
, name(dfa_name)
, cond(dfa_cond)
, loc(loc)
+ , msg(msg)
, nodes_count(dfa.states.size() + 1) // +1 for default state
, nodes(new Node[nodes_count])
, cmd0(dfa.tcmd0)
struct DFA;
struct dfa_state_t;
struct dfa_t;
-class Warn;
+class Msg;
class bitmaps_t;
struct opt_t;
struct tcmd_t;
const std::string name;
const std::string cond;
const loc_t loc;
+ Msg &msg;
const size_t nodes_count;
Node *nodes;
Skeleton(const dfa_t &dfa, const opt_t *op, size_t def
, const std::string &dfa_name, const std::string &dfa_cond
- , const loc_t &loc);
+ , const loc_t &loc, Msg &msg);
~Skeleton ();
FORBID_COPY(Skeleton);
};
uint64_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, Warn &warn);
+void warn_undefined_control_flow(const Skeleton &skel);
void fprint_default_path(FILE *f, const Skeleton &skel, const path_t &p);
void emit_data(const Skeleton &skel);
void emit_prolog(Output & o);