-/* Generated by re2c 0.16 on Fri Jul 28 12:23:09 2017 */
+/* Generated by re2c 0.16 on Sat Jul 29 19:04:57 2017 */
#line 1 "../src/ast/lex.re"
#include "src/util/c99_stdint.h"
#include <stddef.h>
#include <limits>
#include <string>
+#include "src/conf/msg.h"
#include "src/code/output.h"
#include "src/re/encoding/enc.h"
#include "src/ast/input.h"
// source code is in ASCII: pointers have type 'char *'
// but re2c makes an implicit assumption that YYCTYPE is unsigned
// when it generates comparisons
-#line 36 "../src/ast/lex.re"
+#line 37 "../src/ast/lex.re"
-#line 57 "../src/ast/lex.re"
+#line 58 "../src/ast/lex.re"
Scanner::ParseMode Scanner::echo(OutputFile &out)
ptr = cur;
-#line 55 "src/ast/lex.cc"
+#line 56 "src/ast/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
}
}
++YYCURSOR;
-#line 127 "../src/ast/lex.re"
+#line 128 "../src/ast/lex.re"
{
if (cur != eof) goto echo;
out.wraw(tok, ptr);
return Stop;
}
-#line 119 "src/ast/lex.cc"
+#line 120 "src/ast/lex.cc"
yy4:
++YYCURSOR;
yy5:
-#line 144 "../src/ast/lex.re"
+#line 145 "../src/ast/lex.re"
{ goto echo; }
-#line 125 "src/ast/lex.cc"
+#line 126 "src/ast/lex.cc"
yy6:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
if (yych == '#') goto yy14;
yy7:
-#line 138 "../src/ast/lex.re"
+#line 139 "../src/ast/lex.re"
{
cline++;
pos = cur;
goto echo;
}
-#line 140 "src/ast/lex.cc"
+#line 141 "src/ast/lex.cc"
yy8:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy6;
}
yy16:
++YYCURSOR;
-#line 71 "../src/ast/lex.re"
+#line 72 "../src/ast/lex.re"
{
out.wraw(tok, ptr);
return Parse;
}
-#line 188 "src/ast/lex.cc"
+#line 189 "src/ast/lex.cc"
yy18:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '!') goto yy20;
yy71:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 133 "../src/ast/lex.re"
+#line 134 "../src/ast/lex.re"
{
set_sourceline();
goto echo;
}
-#line 442 "src/ast/lex.cc"
+#line 443 "src/ast/lex.cc"
yy73:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy71;
goto yy13;
yy96:
++YYCURSOR;
-#line 92 "../src/ast/lex.re"
+#line 93 "../src/ast/lex.re"
{
out.wraw(tok, ptr);
out.wdelay_yymaxfill();
lex_end_of_comment(out);
goto echo;
}
-#line 549 "src/ast/lex.cc"
+#line 550 "src/ast/lex.cc"
yy98:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '2') goto yy106;
goto yy13;
yy102:
++YYCURSOR;
-#line 81 "../src/ast/lex.re"
+#line 82 "../src/ast/lex.re"
{
out.wraw(tok, ptr);
return Reuse;
}
-#line 573 "src/ast/lex.cc"
+#line 574 "src/ast/lex.cc"
yy104:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy110;
goto yy13;
yy112:
++YYCURSOR;
-#line 121 "../src/ast/lex.re"
+#line 122 "../src/ast/lex.re"
{
out.wraw(tok, ptr);
lex_tags(out, true);
goto echo;
}
-#line 614 "src/ast/lex.cc"
+#line 615 "src/ast/lex.cc"
yy114:
++YYCURSOR;
-#line 76 "../src/ast/lex.re"
+#line 77 "../src/ast/lex.re"
{
out.wraw(tok, ptr);
return Rules;
}
-#line 622 "src/ast/lex.cc"
+#line 623 "src/ast/lex.cc"
yy116:
++YYCURSOR;
-#line 115 "../src/ast/lex.re"
+#line 116 "../src/ast/lex.re"
{
out.wraw(tok, ptr);
lex_tags(out, false);
goto echo;
}
-#line 631 "src/ast/lex.cc"
+#line 632 "src/ast/lex.cc"
yy118:
++YYCURSOR;
-#line 106 "../src/ast/lex.re"
+#line 107 "../src/ast/lex.re"
{
out.wraw(tok, ptr);
out.wdelay_line_info();
lex_end_of_comment(out);
goto echo;
}
-#line 643 "src/ast/lex.cc"
+#line 644 "src/ast/lex.cc"
yy120:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '2') goto yy123;
goto yy13;
yy121:
++YYCURSOR;
-#line 86 "../src/ast/lex.re"
+#line 87 "../src/ast/lex.re"
{
out.wraw(tok, ptr);
lex_end_of_comment(out);
goto echo;
}
-#line 656 "src/ast/lex.cc"
+#line 657 "src/ast/lex.cc"
yy123:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'c') goto yy13;
++YYCURSOR;
-#line 99 "../src/ast/lex.re"
+#line 100 "../src/ast/lex.re"
{
out.wraw(tok, ptr);
out.wdelay_state_goto(0);
lex_end_of_comment(out);
goto echo;
}
-#line 668 "src/ast/lex.cc"
+#line 669 "src/ast/lex.cc"
}
-#line 145 "../src/ast/lex.re"
+#line 146 "../src/ast/lex.re"
}
{
uint32_t ignored = 0;
for (;;) {
-#line 678 "src/ast/lex.cc"
+#line 679 "src/ast/lex.cc"
{
YYCTYPE yych;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
}
yy128:
++YYCURSOR;
-#line 152 "../src/ast/lex.re"
- { fatal("expected end of block"); }
-#line 696 "src/ast/lex.cc"
+#line 153 "../src/ast/lex.re"
+ { fatal_lc(get_cline(), get_column(), "expected end of block"); }
+#line 697 "src/ast/lex.cc"
yy130:
++YYCURSOR;
yy131:
-#line 154 "../src/ast/lex.re"
+#line 155 "../src/ast/lex.re"
{ continue; }
-#line 702 "src/ast/lex.cc"
+#line 703 "src/ast/lex.cc"
yy132:
++YYCURSOR;
-#line 155 "../src/ast/lex.re"
+#line 156 "../src/ast/lex.re"
{ ++ignored; continue; }
-#line 707 "src/ast/lex.cc"
+#line 708 "src/ast/lex.cc"
yy134:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy132;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != '/') goto yy131;
++YYCURSOR;
-#line 156 "../src/ast/lex.re"
+#line 157 "../src/ast/lex.re"
{
if (ignored > 0) {
cline += ignored;
tok = pos = cur;
return;
}
-#line 725 "src/ast/lex.cc"
+#line 726 "src/ast/lex.cc"
}
-#line 164 "../src/ast/lex.re"
+#line 165 "../src/ast/lex.re"
}
}
{
std::string fmt, sep;
for (;;) {
-#line 735 "src/ast/lex.cc"
+#line 736 "src/ast/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
}
++YYCURSOR;
yy141:
-#line 171 "../src/ast/lex.re"
- { fatal("unrecognized configuration"); }
-#line 795 "src/ast/lex.cc"
+#line 172 "../src/ast/lex.re"
+ { fatal_lc(get_cline(), get_column(), "unrecognized configuration"); }
+#line 796 "src/ast/lex.cc"
yy142:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
if (yybm[0+yych] & 128) {
goto yy142;
}
-#line 176 "../src/ast/lex.re"
+#line 177 "../src/ast/lex.re"
{ continue; }
-#line 805 "src/ast/lex.cc"
+#line 806 "src/ast/lex.cc"
yy145:
++YYCURSOR;
-#line 177 "../src/ast/lex.re"
+#line 178 "../src/ast/lex.re"
{ ++cline; continue; }
-#line 810 "src/ast/lex.cc"
+#line 811 "src/ast/lex.cc"
yy147:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy145;
goto yy141;
yy151:
++YYCURSOR;
-#line 178 "../src/ast/lex.re"
+#line 179 "../src/ast/lex.re"
{
out.wdelay_tags(new ConfTags(fmt, sep), mtags);
tok = pos = cur;
return;
}
-#line 835 "src/ast/lex.cc"
+#line 836 "src/ast/lex.cc"
yy153:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy156;
goto yy154;
yy162:
++YYCURSOR;
-#line 173 "../src/ast/lex.re"
+#line 174 "../src/ast/lex.re"
{ fmt = lex_conf_string(); continue; }
-#line 874 "src/ast/lex.cc"
+#line 875 "src/ast/lex.cc"
yy164:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 't') goto yy154;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'r') goto yy154;
++YYCURSOR;
-#line 174 "../src/ast/lex.re"
+#line 175 "../src/ast/lex.re"
{ sep = lex_conf_string(); continue; }
-#line 885 "src/ast/lex.cc"
+#line 886 "src/ast/lex.cc"
}
-#line 183 "../src/ast/lex.re"
+#line 184 "../src/ast/lex.re"
}
}
tchar = cur - pos;
tok = cur;
-#line 898 "src/ast/lex.cc"
+#line 899 "src/ast/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
yy171:
++YYCURSOR;
yy172:
-#line 343 "../src/ast/lex.re"
+#line 344 "../src/ast/lex.re"
{
- fatalf("unexpected character: '%c'", *tok);
+ fatal_lc(get_cline(), get_column(), "unexpected character: '%c'", *tok);
goto scan;
}
-#line 1003 "src/ast/lex.cc"
+#line 1004 "src/ast/lex.cc"
yy173:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
if (yybm[0+yych] & 16) {
goto yy173;
}
-#line 322 "../src/ast/lex.re"
+#line 323 "../src/ast/lex.re"
{
goto scan;
}
-#line 1015 "src/ast/lex.cc"
+#line 1016 "src/ast/lex.cc"
yy176:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == '#') goto yy202;
}
yy177:
-#line 331 "../src/ast/lex.re"
+#line 332 "../src/ast/lex.re"
{
if (cur == eof) return 0;
pos = cur;
goto scan;
}
}
-#line 1038 "src/ast/lex.cc"
+#line 1039 "src/ast/lex.cc"
yy178:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy176;
yy179:
++YYCURSOR;
yy180:
-#line 235 "../src/ast/lex.re"
+#line 236 "../src/ast/lex.re"
{ return *tok; }
-#line 1048 "src/ast/lex.cc"
+#line 1049 "src/ast/lex.cc"
yy181:
++YYCURSOR;
-#line 225 "../src/ast/lex.re"
+#line 226 "../src/ast/lex.re"
{ yylval.regexp = lex_str('"'); return TOKEN_REGEXP; }
-#line 1053 "src/ast/lex.cc"
+#line 1054 "src/ast/lex.cc"
yy183:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 'Z') {
goto yy172;
yy185:
++YYCURSOR;
-#line 224 "../src/ast/lex.re"
+#line 225 "../src/ast/lex.re"
{ yylval.regexp = lex_str('\''); return TOKEN_REGEXP; }
-#line 1079 "src/ast/lex.cc"
+#line 1080 "src/ast/lex.cc"
yy187:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '/') goto yy207;
goto yy180;
yy188:
++YYCURSOR;
-#line 317 "../src/ast/lex.re"
+#line 318 "../src/ast/lex.re"
{
yylval.regexp = ast_dot(cline, get_column());
return TOKEN_REGEXP;
}
-#line 1091 "src/ast/lex.cc"
+#line 1092 "src/ast/lex.cc"
yy190:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '*') goto yy209;
yy194:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '^') goto yy221;
-#line 226 "../src/ast/lex.re"
+#line 227 "../src/ast/lex.re"
{ yylval.regexp = lex_cls(false); return TOKEN_REGEXP; }
-#line 1136 "src/ast/lex.cc"
+#line 1137 "src/ast/lex.cc"
yy196:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'e') goto yy223;
}
}
yy198:
-#line 193 "../src/ast/lex.re"
+#line 194 "../src/ast/lex.re"
{
depth = 1;
code_line = cline;
goto code;
}
-#line 1165 "src/ast/lex.cc"
+#line 1166 "src/ast/lex.cc"
yy199:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
}
}
yy206:
-#line 229 "../src/ast/lex.re"
+#line 230 "../src/ast/lex.re"
{
const std::string *name = new std::string(tok + 1, tok_len() - 1);
yylval.regexp = ast_tag(cline, get_column(), name, tok[0] == '#');
return TOKEN_REGEXP;
}
-#line 1222 "src/ast/lex.cc"
+#line 1223 "src/ast/lex.cc"
yy207:
++YYCURSOR;
-#line 219 "../src/ast/lex.re"
+#line 220 "../src/ast/lex.re"
{
tok = cur;
return 0;
}
-#line 1230 "src/ast/lex.cc"
+#line 1231 "src/ast/lex.cc"
yy209:
++YYCURSOR;
-#line 213 "../src/ast/lex.re"
+#line 214 "../src/ast/lex.re"
{
depth = 1;
goto comment;
}
-#line 1238 "src/ast/lex.cc"
+#line 1239 "src/ast/lex.cc"
yy211:
++YYCURSOR;
-#line 210 "../src/ast/lex.re"
+#line 211 "../src/ast/lex.re"
{
goto nextLine;
}
-#line 1245 "src/ast/lex.cc"
+#line 1246 "src/ast/lex.cc"
yy213:
++YYCURSOR;
YYCURSOR -= 1;
-#line 300 "../src/ast/lex.re"
+#line 301 "../src/ast/lex.re"
{
if (!globopts->FFlag) {
yylval.str = new std::string (tok, tok_len());
return TOKEN_REGEXP;
}
}
-#line 1266 "src/ast/lex.cc"
+#line 1267 "src/ast/lex.cc"
yy215:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yy217:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 295 "../src/ast/lex.re"
+#line 296 "../src/ast/lex.re"
{
yylval.str = new std::string (tok, tok_len ());
return TOKEN_ID;
}
-#line 1291 "src/ast/lex.cc"
+#line 1292 "src/ast/lex.cc"
yy219:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '>') goto yy233;
-#line 203 "../src/ast/lex.re"
+#line 204 "../src/ast/lex.re"
{
tok += 2; /* skip ":=" */
depth = 0;
code_line = cline;
goto code;
}
-#line 1302 "src/ast/lex.cc"
+#line 1303 "src/ast/lex.cc"
yy221:
++YYCURSOR;
-#line 227 "../src/ast/lex.re"
+#line 228 "../src/ast/lex.re"
{ yylval.regexp = lex_cls(true); return TOKEN_REGEXP; }
-#line 1307 "src/ast/lex.cc"
+#line 1308 "src/ast/lex.cc"
yy223:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '2') goto yy235;
yy224:
++YYCURSOR;
yy225:
-#line 268 "../src/ast/lex.re"
+#line 269 "../src/ast/lex.re"
{
- fatal("illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers");
+ fatal_lc(get_cline(), get_column(), "illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers");
}
-#line 1319 "src/ast/lex.cc"
+#line 1320 "src/ast/lex.cc"
yy226:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yy231:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 282 "../src/ast/lex.re"
+#line 283 "../src/ast/lex.re"
{
yylval.str = new std::string (tok, tok_len ());
if (globopts->FFlag)
return TOKEN_ID;
}
}
-#line 1385 "src/ast/lex.cc"
+#line 1386 "src/ast/lex.cc"
yy233:
++YYCURSOR;
YYCURSOR -= 2;
-#line 199 "../src/ast/lex.re"
+#line 200 "../src/ast/lex.re"
{
return *tok;
}
-#line 1393 "src/ast/lex.cc"
+#line 1394 "src/ast/lex.cc"
yy235:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'c') goto yy242;
goto yy225;
yy237:
++YYCURSOR;
-#line 237 "../src/ast/lex.re"
+#line 238 "../src/ast/lex.re"
{
if (!s_to_u32_unsafe (tok + 1, cur - 1, yylval.bounds.min))
{
- fatal ("repetition count overflow");
+ fatal_lc(get_cline(), get_column(), "repetition count overflow");
}
yylval.bounds.max = yylval.bounds.min;
return TOKEN_CLOSESIZE;
}
-#line 1416 "src/ast/lex.cc"
+#line 1417 "src/ast/lex.cc"
yy239:
++YYCURSOR;
-#line 272 "../src/ast/lex.re"
+#line 273 "../src/ast/lex.re"
{
if (!globopts->FFlag) {
- fatal("curly braces for names only allowed with -F switch");
+ fatal_lc(get_cline(), get_column(), "curly braces for names only allowed with -F switch");
}
yylval.str = new std::string (tok + 1, tok_len () - 2); // -2 to omit braces
return TOKEN_ID;
}
-#line 1427 "src/ast/lex.cc"
+#line 1428 "src/ast/lex.cc"
yy241:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'n') goto yy247;
goto yy201;
yy245:
++YYCURSOR;
-#line 259 "../src/ast/lex.re"
+#line 260 "../src/ast/lex.re"
{
if (!s_to_u32_unsafe (tok + 1, cur - 2, yylval.bounds.min))
{
- fatal ("repetition lower bound overflow");
+ fatal_lc(get_cline(), get_column(), "repetition lower bound overflow");
}
yylval.bounds.max = std::numeric_limits<uint32_t>::max();
return TOKEN_CLOSESIZE;
}
-#line 1455 "src/ast/lex.cc"
+#line 1456 "src/ast/lex.cc"
yy247:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'e') goto yy252;
goto yy201;
yy248:
++YYCURSOR;
-#line 280 "../src/ast/lex.re"
+#line 281 "../src/ast/lex.re"
{ return TOKEN_CONF; }
-#line 1464 "src/ast/lex.cc"
+#line 1465 "src/ast/lex.cc"
yy250:
++YYCURSOR;
-#line 246 "../src/ast/lex.re"
+#line 247 "../src/ast/lex.re"
{
const char * p = strchr (tok, ',');
if (!s_to_u32_unsafe (tok + 1, p, yylval.bounds.min))
{
- fatal ("repetition lower bound overflow");
+ fatal_lc(get_cline(), get_column(), "repetition lower bound overflow");
}
if (!s_to_u32_unsafe (p + 1, cur - 1, yylval.bounds.max))
{
- fatal ("repetition upper bound overflow");
+ fatal_lc(get_cline(), get_column(), "repetition upper bound overflow");
}
return TOKEN_CLOSESIZE;
}
-#line 1480 "src/ast/lex.cc"
+#line 1481 "src/ast/lex.cc"
yy252:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '0') goto yy254;
yy259:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 326 "../src/ast/lex.re"
+#line 327 "../src/ast/lex.re"
{
set_sourceline ();
return TOKEN_LINE_INFO;
}
-#line 1541 "src/ast/lex.cc"
+#line 1542 "src/ast/lex.cc"
yy261:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy259;
if (yych == '\n') goto yy201;
goto yy262;
}
-#line 347 "../src/ast/lex.re"
+#line 348 "../src/ast/lex.re"
code:
-#line 1571 "src/ast/lex.cc"
+#line 1572 "src/ast/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
}
yy268:
++YYCURSOR;
-#line 410 "../src/ast/lex.re"
+#line 411 "../src/ast/lex.re"
{
if (cur == eof)
{
if (depth)
{
- fatal("missing '}'");
+ fatal_l(get_cline(), "missing '}'");
}
return 0;
}
goto code;
}
-#line 1644 "src/ast/lex.cc"
+#line 1645 "src/ast/lex.cc"
yy270:
++YYCURSOR;
yy271:
-#line 424 "../src/ast/lex.re"
+#line 425 "../src/ast/lex.re"
{
goto code;
}
-#line 1652 "src/ast/lex.cc"
+#line 1653 "src/ast/lex.cc"
yy272:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
}
yy273:
-#line 391 "../src/ast/lex.re"
+#line 392 "../src/ast/lex.re"
{
if (depth == 0)
{
}
else if (cur == eof)
{
- fatal("missing '}'");
+ fatal_l(get_cline(), "missing '}'");
}
pos = cur;
cline++;
goto code;
}
-#line 1691 "src/ast/lex.cc"
+#line 1692 "src/ast/lex.cc"
yy274:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
goto yy292;
yy276:
++YYCURSOR;
-#line 363 "../src/ast/lex.re"
+#line 364 "../src/ast/lex.re"
{
if (depth == 0)
{
- fatal("Curly braces are not allowed after ':='");
+ fatal_l(get_cline(), "Curly braces are not allowed after ':='");
}
else
{
}
goto code;
}
-#line 1716 "src/ast/lex.cc"
+#line 1717 "src/ast/lex.cc"
yy278:
++YYCURSOR;
-#line 351 "../src/ast/lex.re"
+#line 352 "../src/ast/lex.re"
{
if (depth == 0)
{
- fatal("Curly braces are not allowed after ':='");
+ fatal_l(get_cline(), "Curly braces are not allowed after ':='");
}
else if (--depth == 0)
{
}
goto code;
}
-#line 1732 "src/ast/lex.cc"
+#line 1733 "src/ast/lex.cc"
yy280:
yyaccept = 2;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
yy281:
YYCURSOR -= 1;
-#line 378 "../src/ast/lex.re"
+#line 379 "../src/ast/lex.re"
{
if (depth == 0)
{
}
else if (cur == eof)
{
- fatal("missing '}'");
+ fatal_l(get_cline(), "missing '}'");
}
pos = cur;
cline++;
goto code;
}
-#line 1758 "src/ast/lex.cc"
+#line 1759 "src/ast/lex.cc"
yy282:
++YYCURSOR;
goto yy281;
if (yych >= '#') goto yy290;
yy288:
++YYCURSOR;
-#line 421 "../src/ast/lex.re"
+#line 422 "../src/ast/lex.re"
{
goto code;
}
-#line 1797 "src/ast/lex.cc"
+#line 1798 "src/ast/lex.cc"
yy290:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yy306:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 374 "../src/ast/lex.re"
+#line 375 "../src/ast/lex.re"
{
set_sourceline ();
goto code;
}
-#line 1892 "src/ast/lex.cc"
+#line 1893 "src/ast/lex.cc"
yy308:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy306;
if (yych == '\n') goto yy285;
goto yy309;
}
-#line 427 "../src/ast/lex.re"
+#line 428 "../src/ast/lex.re"
comment:
-#line 1926 "src/ast/lex.cc"
+#line 1927 "src/ast/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
}
++YYCURSOR;
yy316:
-#line 459 "../src/ast/lex.re"
+#line 460 "../src/ast/lex.re"
{
if (cur == eof)
{
}
goto comment;
}
-#line 1981 "src/ast/lex.cc"
+#line 1982 "src/ast/lex.cc"
yy317:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 32) {
}
if (yych == '#') goto yy324;
yy318:
-#line 450 "../src/ast/lex.re"
+#line 451 "../src/ast/lex.re"
{
if (cur == eof)
{
cline++;
goto comment;
}
-#line 1999 "src/ast/lex.cc"
+#line 2000 "src/ast/lex.cc"
yy319:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '/') goto yy326;
}
yy326:
++YYCURSOR;
-#line 431 "../src/ast/lex.re"
+#line 432 "../src/ast/lex.re"
{
if (--depth == 0)
{
goto comment;
}
}
-#line 2044 "src/ast/lex.cc"
+#line 2045 "src/ast/lex.cc"
yy328:
++YYCURSOR;
-#line 441 "../src/ast/lex.re"
+#line 442 "../src/ast/lex.re"
{
++depth;
- fatal("ambiguous /* found");
+ fatal_lc(get_cline(), get_column(), "ambiguous /* found");
goto comment;
}
-#line 2053 "src/ast/lex.cc"
+#line 2054 "src/ast/lex.cc"
yy330:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'i') goto yy323;
yy340:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 446 "../src/ast/lex.re"
+#line 447 "../src/ast/lex.re"
{
set_sourceline ();
goto comment;
}
-#line 2115 "src/ast/lex.cc"
+#line 2116 "src/ast/lex.cc"
yy342:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy340;
if (yych == '\n') goto yy323;
goto yy343;
}
-#line 466 "../src/ast/lex.re"
+#line 467 "../src/ast/lex.re"
nextLine:
-#line 2145 "src/ast/lex.cc"
+#line 2146 "src/ast/lex.cc"
{
YYCTYPE yych;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
if (yych == '\n') goto yy351;
++YYCURSOR;
-#line 477 "../src/ast/lex.re"
+#line 478 "../src/ast/lex.re"
{ if(cur == eof) {
return 0;
}
goto nextLine;
}
-#line 2158 "src/ast/lex.cc"
+#line 2159 "src/ast/lex.cc"
yy351:
++YYCURSOR;
-#line 470 "../src/ast/lex.re"
+#line 471 "../src/ast/lex.re"
{ if(cur == eof) {
return 0;
}
cline++;
goto scan;
}
-#line 2169 "src/ast/lex.cc"
+#line 2170 "src/ast/lex.cc"
}
-#line 482 "../src/ast/lex.re"
+#line 483 "../src/ast/lex.re"
}
tok = cur;
c = get_column();
-#line 2197 "src/ast/lex.cc"
+#line 2198 "src/ast/lex.cc"
{
YYCTYPE yych;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
if (yych == ']') goto yy356;
-#line 508 "../src/ast/lex.re"
+#line 509 "../src/ast/lex.re"
{ l = lex_cls_chr(); goto snd; }
-#line 2205 "src/ast/lex.cc"
+#line 2206 "src/ast/lex.cc"
yy356:
++YYCURSOR;
-#line 507 "../src/ast/lex.re"
+#line 508 "../src/ast/lex.re"
{ return ast_cls(cline, c0, cls, neg); }
-#line 2210 "src/ast/lex.cc"
+#line 2211 "src/ast/lex.cc"
}
-#line 509 "../src/ast/lex.re"
+#line 510 "../src/ast/lex.re"
snd:
-#line 2216 "src/ast/lex.cc"
+#line 2217 "src/ast/lex.cc"
{
YYCTYPE yych;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = (YYCTYPE)*(YYMARKER = YYCURSOR);
if (yych == '-') goto yy361;
yy360:
-#line 512 "../src/ast/lex.re"
+#line 513 "../src/ast/lex.re"
{ u = l; goto add; }
-#line 2225 "src/ast/lex.cc"
+#line 2226 "src/ast/lex.cc"
yy361:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != ']') goto yy363;
yy363:
++YYCURSOR;
YYCURSOR -= 1;
-#line 513 "../src/ast/lex.re"
+#line 514 "../src/ast/lex.re"
{
u = lex_cls_chr();
if (l > u) {
}
goto add;
}
-#line 2243 "src/ast/lex.cc"
+#line 2244 "src/ast/lex.cc"
}
-#line 521 "../src/ast/lex.re"
+#line 522 "../src/ast/lex.re"
add:
cls->push_back(ASTRange(l, u, c));
uint32_t Scanner::lex_cls_chr()
{
tok = cur;
+ const uint32_t l = get_cline(), c = get_column();
-#line 2256 "src/ast/lex.cc"
+#line 2258 "src/ast/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
if (yych == '\n') goto yy369;
if (yych == '\\') goto yy371;
++YYCURSOR;
-#line 536 "../src/ast/lex.re"
+#line 538 "../src/ast/lex.re"
{ return static_cast<uint8_t>(tok[0]); }
-#line 2267 "src/ast/lex.cc"
+#line 2269 "src/ast/lex.cc"
yy369:
++YYCURSOR;
-#line 531 "../src/ast/lex.re"
- { fatal (get_column() - tchar, "syntax error"); }
-#line 2272 "src/ast/lex.cc"
+#line 533 "../src/ast/lex.re"
+ { fatal_lc(l, c, "syntax error"); }
+#line 2274 "src/ast/lex.cc"
yy371:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '`') {
}
}
}
-#line 534 "../src/ast/lex.re"
- { fatal (get_column() - tchar, "syntax error in escape sequence"); }
-#line 2323 "src/ast/lex.cc"
+#line 536 "../src/ast/lex.re"
+ { fatal_lc(l, c, "syntax error in escape sequence"); }
+#line 2325 "src/ast/lex.cc"
yy373:
++YYCURSOR;
-#line 549 "../src/ast/lex.re"
+#line 551 "../src/ast/lex.re"
{
warn.useless_escape(cline, get_column(), tok[1]);
return static_cast<uint8_t>(tok[1]);
}
-#line 2331 "src/ast/lex.cc"
+#line 2333 "src/ast/lex.cc"
yy375:
++YYCURSOR;
-#line 547 "../src/ast/lex.re"
+#line 549 "../src/ast/lex.re"
{ return static_cast<uint8_t>('-'); }
-#line 2336 "src/ast/lex.cc"
+#line 2338 "src/ast/lex.cc"
yy377:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= '/') goto yy378;
if (yych <= '7') goto yy402;
yy378:
-#line 533 "../src/ast/lex.re"
- { fatal (get_column() - tchar, "syntax error in octal escape sequence"); }
-#line 2345 "src/ast/lex.cc"
+#line 535 "../src/ast/lex.re"
+ { fatal_lc(l, c, "syntax error in octal escape sequence"); }
+#line 2347 "src/ast/lex.cc"
yy379:
++YYCURSOR;
goto yy378;
if (yych <= 'f') goto yy404;
}
yy381:
-#line 532 "../src/ast/lex.re"
- { fatal (get_column() - tchar, "syntax error in hexadecimal escape sequence"); }
-#line 2363 "src/ast/lex.cc"
+#line 534 "../src/ast/lex.re"
+ { fatal_lc(l, c, "syntax error in hexadecimal escape sequence"); }
+#line 2365 "src/ast/lex.cc"
yy382:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
yy383:
++YYCURSOR;
-#line 546 "../src/ast/lex.re"
+#line 548 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\\'); }
-#line 2381 "src/ast/lex.cc"
+#line 2383 "src/ast/lex.cc"
yy385:
++YYCURSOR;
-#line 548 "../src/ast/lex.re"
+#line 550 "../src/ast/lex.re"
{ return static_cast<uint8_t>(']'); }
-#line 2386 "src/ast/lex.cc"
+#line 2388 "src/ast/lex.cc"
yy387:
++YYCURSOR;
-#line 539 "../src/ast/lex.re"
+#line 541 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\a'); }
-#line 2391 "src/ast/lex.cc"
+#line 2393 "src/ast/lex.cc"
yy389:
++YYCURSOR;
-#line 540 "../src/ast/lex.re"
+#line 542 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\b'); }
-#line 2396 "src/ast/lex.cc"
+#line 2398 "src/ast/lex.cc"
yy391:
++YYCURSOR;
-#line 541 "../src/ast/lex.re"
+#line 543 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\f'); }
-#line 2401 "src/ast/lex.cc"
+#line 2403 "src/ast/lex.cc"
yy393:
++YYCURSOR;
-#line 542 "../src/ast/lex.re"
+#line 544 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\n'); }
-#line 2406 "src/ast/lex.cc"
+#line 2408 "src/ast/lex.cc"
yy395:
++YYCURSOR;
-#line 543 "../src/ast/lex.re"
+#line 545 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\r'); }
-#line 2411 "src/ast/lex.cc"
+#line 2413 "src/ast/lex.cc"
yy397:
++YYCURSOR;
-#line 544 "../src/ast/lex.re"
+#line 546 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\t'); }
-#line 2416 "src/ast/lex.cc"
+#line 2418 "src/ast/lex.cc"
yy399:
++YYCURSOR;
-#line 545 "../src/ast/lex.re"
+#line 547 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\v'); }
-#line 2421 "src/ast/lex.cc"
+#line 2423 "src/ast/lex.cc"
yy401:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
yy407:
++YYCURSOR;
-#line 538 "../src/ast/lex.re"
+#line 540 "../src/ast/lex.re"
{ return unesc_oct(tok, cur); }
-#line 2486 "src/ast/lex.cc"
+#line 2488 "src/ast/lex.cc"
yy409:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
}
yy411:
++YYCURSOR;
-#line 537 "../src/ast/lex.re"
+#line 539 "../src/ast/lex.re"
{ return unesc_hex(tok, cur); }
-#line 2515 "src/ast/lex.cc"
+#line 2517 "src/ast/lex.cc"
yy413:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
goto yy403;
}
}
-#line 553 "../src/ast/lex.re"
+#line 555 "../src/ast/lex.re"
}
{
end = false;
tok = cur;
+ const uint32_t l = get_cline(), c = get_column();
-#line 2548 "src/ast/lex.cc"
+#line 2551 "src/ast/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
if (yych == '\n') goto yy419;
if (yych == '\\') goto yy421;
++YYCURSOR;
-#line 566 "../src/ast/lex.re"
+#line 569 "../src/ast/lex.re"
{
end = tok[0] == quote;
return static_cast<uint8_t>(tok[0]);
}
-#line 2562 "src/ast/lex.cc"
+#line 2565 "src/ast/lex.cc"
yy419:
++YYCURSOR;
-#line 561 "../src/ast/lex.re"
- { fatal (get_column() - tchar, "syntax error"); }
-#line 2567 "src/ast/lex.cc"
+#line 564 "../src/ast/lex.re"
+ { fatal_lc(l, c, "syntax error"); }
+#line 2570 "src/ast/lex.cc"
yy421:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 'a') {
}
}
}
-#line 564 "../src/ast/lex.re"
- { fatal (get_column() - tchar, "syntax error in escape sequence"); }
-#line 2615 "src/ast/lex.cc"
+#line 567 "../src/ast/lex.re"
+ { fatal_lc(l, c, "syntax error in escape sequence"); }
+#line 2618 "src/ast/lex.cc"
yy423:
++YYCURSOR;
-#line 580 "../src/ast/lex.re"
+#line 583 "../src/ast/lex.re"
{
if (tok[1] != quote) {
warn.useless_escape(cline, get_column(), tok[1]);
}
return static_cast<uint8_t>(tok[1]);
}
-#line 2625 "src/ast/lex.cc"
+#line 2628 "src/ast/lex.cc"
yy425:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= '/') goto yy426;
if (yych <= '7') goto yy448;
yy426:
-#line 563 "../src/ast/lex.re"
- { fatal (get_column() - tchar, "syntax error in octal escape sequence"); }
-#line 2634 "src/ast/lex.cc"
+#line 566 "../src/ast/lex.re"
+ { fatal_lc(l, c, "syntax error in octal escape sequence"); }
+#line 2637 "src/ast/lex.cc"
yy427:
++YYCURSOR;
goto yy426;
if (yych <= 'f') goto yy450;
}
yy429:
-#line 562 "../src/ast/lex.re"
- { fatal (get_column() - tchar, "syntax error in hexadecimal escape sequence"); }
-#line 2652 "src/ast/lex.cc"
+#line 565 "../src/ast/lex.re"
+ { fatal_lc(l, c, "syntax error in hexadecimal escape sequence"); }
+#line 2655 "src/ast/lex.cc"
yy430:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
yy431:
++YYCURSOR;
-#line 579 "../src/ast/lex.re"
+#line 582 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\\'); }
-#line 2670 "src/ast/lex.cc"
+#line 2673 "src/ast/lex.cc"
yy433:
++YYCURSOR;
-#line 572 "../src/ast/lex.re"
+#line 575 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\a'); }
-#line 2675 "src/ast/lex.cc"
+#line 2678 "src/ast/lex.cc"
yy435:
++YYCURSOR;
-#line 573 "../src/ast/lex.re"
+#line 576 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\b'); }
-#line 2680 "src/ast/lex.cc"
+#line 2683 "src/ast/lex.cc"
yy437:
++YYCURSOR;
-#line 574 "../src/ast/lex.re"
+#line 577 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\f'); }
-#line 2685 "src/ast/lex.cc"
+#line 2688 "src/ast/lex.cc"
yy439:
++YYCURSOR;
-#line 575 "../src/ast/lex.re"
+#line 578 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\n'); }
-#line 2690 "src/ast/lex.cc"
+#line 2693 "src/ast/lex.cc"
yy441:
++YYCURSOR;
-#line 576 "../src/ast/lex.re"
+#line 579 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\r'); }
-#line 2695 "src/ast/lex.cc"
+#line 2698 "src/ast/lex.cc"
yy443:
++YYCURSOR;
-#line 577 "../src/ast/lex.re"
+#line 580 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\t'); }
-#line 2700 "src/ast/lex.cc"
+#line 2703 "src/ast/lex.cc"
yy445:
++YYCURSOR;
-#line 578 "../src/ast/lex.re"
+#line 581 "../src/ast/lex.re"
{ return static_cast<uint8_t>('\v'); }
-#line 2705 "src/ast/lex.cc"
+#line 2708 "src/ast/lex.cc"
yy447:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
yy453:
++YYCURSOR;
-#line 571 "../src/ast/lex.re"
+#line 574 "../src/ast/lex.re"
{ return unesc_oct(tok, cur); }
-#line 2770 "src/ast/lex.cc"
+#line 2773 "src/ast/lex.cc"
yy455:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
}
yy457:
++YYCURSOR;
-#line 570 "../src/ast/lex.re"
+#line 573 "../src/ast/lex.re"
{ return unesc_hex(tok, cur); }
-#line 2799 "src/ast/lex.cc"
+#line 2802 "src/ast/lex.cc"
yy459:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
goto yy449;
}
}
-#line 586 "../src/ast/lex.re"
+#line 589 "../src/ast/lex.re"
}
sourceline:
tok = cur;
-#line 2843 "src/ast/lex.cc"
+#line 2846 "src/ast/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
yy463:
++YYCURSOR;
yy464:
-#line 628 "../src/ast/lex.re"
+#line 631 "../src/ast/lex.re"
{
goto sourceline;
}
-#line 2896 "src/ast/lex.cc"
+#line 2899 "src/ast/lex.cc"
yy465:
++YYCURSOR;
-#line 616 "../src/ast/lex.re"
+#line 619 "../src/ast/lex.re"
{
if (cur == eof)
{
tok = cur;
return;
}
-#line 2912 "src/ast/lex.cc"
+#line 2915 "src/ast/lex.cc"
yy467:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == '\n') goto yy464;
if (yybm[0+yych] & 64) {
goto yy468;
}
-#line 605 "../src/ast/lex.re"
+#line 608 "../src/ast/lex.re"
{
if (!s_to_u32_unsafe (tok, cur, cline))
{
- fatal ("line number overflow");
+ fatal_lc(get_cline(), get_column(), "line number overflow");
}
goto sourceline;
}
-#line 2932 "src/ast/lex.cc"
+#line 2935 "src/ast/lex.cc"
yy471:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
goto yy464;
yy474:
++YYCURSOR;
-#line 612 "../src/ast/lex.re"
+#line 615 "../src/ast/lex.re"
{
escape (in.file_name, std::string (tok + 1, tok_len () - 2)); // -2 to omit quotes
goto sourceline;
}
-#line 2954 "src/ast/lex.cc"
+#line 2957 "src/ast/lex.cc"
yy476:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
if (yych == '\n') goto yy473;
goto yy471;
}
-#line 631 "../src/ast/lex.re"
+#line 634 "../src/ast/lex.re"
}
-/* Generated by re2c 0.16 on Fri Jul 28 12:23:09 2017 */
+/* Generated by re2c 0.16 on Sat Jul 29 19:04:57 2017 */
#line 1 "../src/ast/lex_conf.re"
#include "src/util/c99_stdint.h"
#include <string>
void Scanner::lex_conf(Opt &opts)
{
tok = cur;
+ const uint32_t l = get_cline(), c = get_column();
-#line 24 "src/ast/lex_conf.cc"
+#line 25 "src/ast/lex_conf.cc"
{
unsigned char yych;
unsigned int yyaccept = 0;
}
}
yy2:
-#line 160 "../src/ast/lex_conf.re"
+#line 161 "../src/ast/lex_conf.re"
{
- fatal_error(cline, get_column(),
- "unrecognized configuration '%.*s'",
+ fatal_lc(l, c, "unrecognized configuration '%.*s'",
static_cast<int>(cur - tok), tok);
}
#line 111 "src/ast/lex_conf.cc"
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 58 "../src/ast/lex_conf.re"
+#line 59 "../src/ast/lex_conf.re"
{ lex_conf_enc(Enc::UTF8, opts); return; }
#line 501 "src/ast/lex_conf.cc"
yy91:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 46 "../src/ast/lex_conf.re"
+#line 47 "../src/ast/lex_conf.re"
{ opts.set_tags(lex_conf_bool()); return; }
#line 509 "src/ast/lex_conf.cc"
yy93:
}
}
yy94:
-#line 41 "../src/ast/lex_conf.re"
+#line 42 "../src/ast/lex_conf.re"
{ opts.set_bFlag(lex_conf_bool()); return; }
#line 530 "src/ast/lex_conf.cc"
yy95:
}
}
yy97:
-#line 42 "../src/ast/lex_conf.re"
+#line 43 "../src/ast/lex_conf.re"
{ opts.set_dFlag(lex_conf_bool()); return; }
#line 558 "src/ast/lex_conf.cc"
yy98:
}
}
yy99:
-#line 54 "../src/ast/lex_conf.re"
+#line 55 "../src/ast/lex_conf.re"
{ lex_conf_enc(Enc::EBCDIC, opts); return; }
#line 589 "src/ast/lex_conf.cc"
yy100:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 43 "../src/ast/lex_conf.re"
+#line 44 "../src/ast/lex_conf.re"
{ opts.set_gFlag(lex_conf_bool()); return; }
#line 597 "src/ast/lex_conf.cc"
yy102:
}
}
yy103:
-#line 44 "../src/ast/lex_conf.re"
+#line 45 "../src/ast/lex_conf.re"
{ opts.set_iFlag(lex_conf_bool()); return; }
#line 618 "src/ast/lex_conf.cc"
yy104:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 45 "../src/ast/lex_conf.re"
+#line 46 "../src/ast/lex_conf.re"
{ opts.set_sFlag(lex_conf_bool()); return; }
#line 643 "src/ast/lex_conf.cc"
yy110:
}
}
yy112:
-#line 55 "../src/ast/lex_conf.re"
+#line 56 "../src/ast/lex_conf.re"
{ lex_conf_enc(Enc::UTF32, opts); return; }
#line 671 "src/ast/lex_conf.cc"
yy113:
}
}
yy114:
-#line 56 "../src/ast/lex_conf.re"
+#line 57 "../src/ast/lex_conf.re"
{ lex_conf_enc(Enc::UCS2, opts); return; }
#line 692 "src/ast/lex_conf.cc"
yy115:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 57 "../src/ast/lex_conf.re"
+#line 58 "../src/ast/lex_conf.re"
{ lex_conf_enc(Enc::UTF16, opts); return; }
#line 700 "src/ast/lex_conf.cc"
yy117:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 91 "../src/ast/lex_conf.re"
+#line 92 "../src/ast/lex_conf.re"
{ opts.set_yybmHexTable (lex_conf_bool()); return; }
#line 909 "src/ast/lex_conf.cc"
yy167:
}
if (yych == '@') goto yy217;
yy175:
-#line 75 "../src/ast/lex_conf.re"
+#line 76 "../src/ast/lex_conf.re"
{ opts.set_condGoto (lex_conf_string ()); return; }
#line 948 "src/ast/lex_conf.cc"
yy176:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 142 "../src/ast/lex_conf.re"
+#line 143 "../src/ast/lex_conf.re"
{ opts.set_bEmitYYCh (lex_conf_bool()); return; }
#line 1105 "src/ast/lex_conf.cc"
yy212:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 71 "../src/ast/lex_conf.re"
+#line 72 "../src/ast/lex_conf.re"
{ opts.set_condPrefix (lex_conf_string ()); return; }
#line 1163 "src/ast/lex_conf.cc"
yy222:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 127 "../src/ast/lex_conf.re"
+#line 128 "../src/ast/lex_conf.re"
{
const int32_t n = lex_conf_number ();
if (n < 0)
{
- fatal ("configuration 'indent:top' must be nonnegative");
+ fatal_lc(l, c, "configuration 'indent:top' must be nonnegative");
}
opts.set_topIndent (static_cast<uint32_t> (n));
return;
}
}
yy256:
-#line 155 "../src/ast/lex_conf.re"
+#line 156 "../src/ast/lex_conf.re"
{ opts.set_startlabel (lex_conf_string()); return; }
#line 1343 "src/ast/lex_conf.cc"
yy257:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 61 "../src/ast/lex_conf.re"
+#line 62 "../src/ast/lex_conf.re"
{ lex_conf_input(opts); return; }
#line 1501 "src/ast/lex_conf.cc"
yy296:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 151 "../src/ast/lex_conf.re"
+#line 152 "../src/ast/lex_conf.re"
{ opts.set_labelPrefix (lex_conf_string ()); return; }
#line 1553 "src/ast/lex_conf.cc"
yy309:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 86 "../src/ast/lex_conf.re"
+#line 87 "../src/ast/lex_conf.re"
{ opts.set_bUseStateAbort (lex_conf_bool()); return; }
#line 1591 "src/ast/lex_conf.cc"
yy315:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 122 "../src/ast/lex_conf.re"
+#line 123 "../src/ast/lex_conf.re"
{ opts.set_tags_prefix (lex_conf_string ()); return; }
#line 1607 "src/ast/lex_conf.cc"
yy319:
}
if (yych == '@') goto yy383;
yy326:
-#line 73 "../src/ast/lex_conf.re"
+#line 74 "../src/ast/lex_conf.re"
{ opts.set_condDivider (lex_conf_string ()); return; }
#line 1651 "src/ast/lex_conf.cc"
yy327:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 85 "../src/ast/lex_conf.re"
+#line 86 "../src/ast/lex_conf.re"
{ opts.set_yynext (lex_conf_string ()); return; }
#line 1805 "src/ast/lex_conf.cc"
yy365:
++cur;
yy367:
cur = ctx;
-#line 154 "../src/ast/lex_conf.re"
+#line 155 "../src/ast/lex_conf.re"
{ opts.set_startlabel_force (lex_conf_bool()); return; }
#line 1817 "src/ast/lex_conf.cc"
yy368:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 149 "../src/ast/lex_conf.re"
+#line 150 "../src/ast/lex_conf.re"
{ opts.set_fill_check (lex_conf_bool()); return; }
#line 1866 "src/ast/lex_conf.cc"
yy380:
}
}
yy393:
-#line 144 "../src/ast/lex_conf.re"
+#line 145 "../src/ast/lex_conf.re"
{ opts.set_fill (lex_conf_string ()); return; }
#line 1937 "src/ast/lex_conf.cc"
yy394:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 109 "../src/ast/lex_conf.re"
+#line 110 "../src/ast/lex_conf.re"
{ opts.set_yypeek (lex_conf_string ()); return; }
#line 1970 "src/ast/lex_conf.cc"
yy402:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 110 "../src/ast/lex_conf.re"
+#line 111 "../src/ast/lex_conf.re"
{ opts.set_yyskip (lex_conf_string ()); return; }
#line 1990 "src/ast/lex_conf.cc"
yy407:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 125 "../src/ast/lex_conf.re"
+#line 126 "../src/ast/lex_conf.re"
{ opts.set_indString (lex_conf_string ()); return; }
#line 2066 "src/ast/lex_conf.cc"
yy425:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 90 "../src/ast/lex_conf.re"
+#line 91 "../src/ast/lex_conf.re"
{ opts.set_yybm (lex_conf_string ()); return; }
#line 2090 "src/ast/lex_conf.cc"
yy431:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 140 "../src/ast/lex_conf.re"
+#line 141 "../src/ast/lex_conf.re"
{ opts.set_yych (lex_conf_string ()); return; }
#line 2098 "src/ast/lex_conf.cc"
yy433:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 145 "../src/ast/lex_conf.re"
+#line 146 "../src/ast/lex_conf.re"
{ opts.set_fill_use (lex_conf_bool()); return; }
#line 2122 "src/ast/lex_conf.cc"
yy439:
goto yy218;
yy442:
++cur;
-#line 76 "../src/ast/lex_conf.re"
+#line 77 "../src/ast/lex_conf.re"
{ opts.set_condGotoParam (lex_conf_string ()); return; }
#line 2139 "src/ast/lex_conf.cc"
yy444:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 72 "../src/ast/lex_conf.re"
+#line 73 "../src/ast/lex_conf.re"
{ opts.set_condEnumPrefix (lex_conf_string ()); return; }
#line 2147 "src/ast/lex_conf.cc"
yy446:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 139 "../src/ast/lex_conf.re"
+#line 140 "../src/ast/lex_conf.re"
{ opts.set_yyctype (lex_conf_string ()); return; }
#line 2167 "src/ast/lex_conf.cc"
yy451:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 137 "../src/ast/lex_conf.re"
+#line 138 "../src/ast/lex_conf.re"
{ opts.set_yydebug (lex_conf_string ()); return; }
#line 2179 "src/ast/lex_conf.cc"
yy454:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 107 "../src/ast/lex_conf.re"
+#line 108 "../src/ast/lex_conf.re"
{ opts.set_yylimit (lex_conf_string ()); return; }
#line 2207 "src/ast/lex_conf.cc"
yy461:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 119 "../src/ast/lex_conf.re"
+#line 120 "../src/ast/lex_conf.re"
{ opts.set_yymtagn (lex_conf_string ()); return; }
#line 2219 "src/ast/lex_conf.cc"
yy464:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 120 "../src/ast/lex_conf.re"
+#line 121 "../src/ast/lex_conf.re"
{ opts.set_yymtagp (lex_conf_string ()); return; }
#line 2227 "src/ast/lex_conf.cc"
yy466:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 117 "../src/ast/lex_conf.re"
+#line 118 "../src/ast/lex_conf.re"
{ opts.set_yystagn (lex_conf_string ()); return; }
#line 2247 "src/ast/lex_conf.cc"
yy471:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 118 "../src/ast/lex_conf.re"
+#line 119 "../src/ast/lex_conf.re"
{ opts.set_yystagp (lex_conf_string ()); return; }
#line 2255 "src/ast/lex_conf.cc"
yy473:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 93 "../src/ast/lex_conf.re"
+#line 94 "../src/ast/lex_conf.re"
{
const int32_t n = lex_conf_number ();
if (n < 0)
{
- fatal ("configuration 'cgoto:threshold' must be nonnegative");
+ fatal_lc(l, c, "configuration 'cgoto:threshold' must be nonnegative");
}
opts.set_cGotoThreshold (static_cast<uint32_t> (n));
return;
}
}
yy501:
-#line 111 "../src/ast/lex_conf.re"
+#line 112 "../src/ast/lex_conf.re"
{ opts.set_yybackup (lex_conf_string ()); return; }
#line 2393 "src/ast/lex_conf.cc"
yy502:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 104 "../src/ast/lex_conf.re"
+#line 105 "../src/ast/lex_conf.re"
{ opts.set_yycursor (lex_conf_string ()); return; }
#line 2409 "src/ast/lex_conf.cc"
yy506:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 105 "../src/ast/lex_conf.re"
+#line 106 "../src/ast/lex_conf.re"
{ opts.set_yymarker (lex_conf_string ()); return; }
#line 2437 "src/ast/lex_conf.cc"
yy513:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 50 "../src/ast/lex_conf.re"
+#line 51 "../src/ast/lex_conf.re"
{ opts.set_lookahead(lex_conf_bool()); return; }
#line 2493 "src/ast/lex_conf.cc"
yy527:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 87 "../src/ast/lex_conf.re"
+#line 88 "../src/ast/lex_conf.re"
{ opts.set_bUseStateNext (lex_conf_bool()); return; }
#line 2525 "src/ast/lex_conf.cc"
yy535:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 123 "../src/ast/lex_conf.re"
+#line 124 "../src/ast/lex_conf.re"
{ opts.set_tags_expression(lex_conf_string ()); return; }
#line 2533 "src/ast/lex_conf.cc"
yy537:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 141 "../src/ast/lex_conf.re"
+#line 142 "../src/ast/lex_conf.re"
{ opts.set_yychConversion (lex_conf_bool()); return; }
#line 2557 "src/ast/lex_conf.cc"
yy543:
}
}
yy554:
-#line 113 "../src/ast/lex_conf.re"
+#line 114 "../src/ast/lex_conf.re"
{ opts.set_yyrestore (lex_conf_string ()); return; }
#line 2621 "src/ast/lex_conf.cc"
yy555:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 52 "../src/ast/lex_conf.re"
+#line 53 "../src/ast/lex_conf.re"
{ opts.set_eager_skip(lex_conf_bool()); return; }
#line 2661 "src/ast/lex_conf.cc"
yy565:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 147 "../src/ast/lex_conf.re"
+#line 148 "../src/ast/lex_conf.re"
{ opts.set_fill_arg_use (lex_conf_bool()); return; }
#line 2715 "src/ast/lex_conf.cc"
yy578:
++cur;
-#line 74 "../src/ast/lex_conf.re"
+#line 75 "../src/ast/lex_conf.re"
{ opts.set_condDividerParam (lex_conf_string ()); return; }
#line 2720 "src/ast/lex_conf.cc"
yy580:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 65 "../src/ast/lex_conf.re"
+#line 66 "../src/ast/lex_conf.re"
{ opts.set_yycondtype (lex_conf_string ()); return; }
#line 2732 "src/ast/lex_conf.cc"
yy583:
goto yy4;
yy585:
++cur;
-#line 146 "../src/ast/lex_conf.re"
+#line 147 "../src/ast/lex_conf.re"
{ opts.set_fill_arg (lex_conf_string ()); return; }
#line 2745 "src/ast/lex_conf.cc"
yy587:
}
}
yy589:
-#line 79 "../src/ast/lex_conf.re"
+#line 80 "../src/ast/lex_conf.re"
{ opts.set_state_get (lex_conf_string ()); return; }
#line 2771 "src/ast/lex_conf.cc"
yy590:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 116 "../src/ast/lex_conf.re"
+#line 117 "../src/ast/lex_conf.re"
{ opts.set_yylessthan (lex_conf_string ()); return; }
#line 2779 "src/ast/lex_conf.cc"
yy592:
}
}
yy596:
-#line 81 "../src/ast/lex_conf.re"
+#line 82 "../src/ast/lex_conf.re"
{ opts.set_state_set (lex_conf_string ()); return; }
#line 2814 "src/ast/lex_conf.cc"
yy597:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 62 "../src/ast/lex_conf.re"
+#line 63 "../src/ast/lex_conf.re"
{ lex_conf_empty_class(opts); return; }
#line 2848 "src/ast/lex_conf.cc"
yy605:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 84 "../src/ast/lex_conf.re"
+#line 85 "../src/ast/lex_conf.re"
{ opts.set_yyfilllabel (lex_conf_string ()); return; }
#line 2872 "src/ast/lex_conf.cc"
yy611:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 88 "../src/ast/lex_conf.re"
+#line 89 "../src/ast/lex_conf.re"
{ opts.set_yyaccept (lex_conf_string ()); return; }
#line 2880 "src/ast/lex_conf.cc"
yy613:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 77 "../src/ast/lex_conf.re"
+#line 78 "../src/ast/lex_conf.re"
{ opts.set_yyctable (lex_conf_string ()); return; }
#line 2888 "src/ast/lex_conf.cc"
yy615:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 158 "../src/ast/lex_conf.re"
+#line 159 "../src/ast/lex_conf.re"
{ lex_conf_string (); return; }
#line 2896 "src/ast/lex_conf.cc"
yy617:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 102 "../src/ast/lex_conf.re"
+#line 103 "../src/ast/lex_conf.re"
{ opts.set_yytarget (lex_conf_string ()); return; }
#line 2904 "src/ast/lex_conf.cc"
yy619:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 112 "../src/ast/lex_conf.re"
+#line 113 "../src/ast/lex_conf.re"
{ opts.set_yybackupctx (lex_conf_string ()); return; }
#line 2912 "src/ast/lex_conf.cc"
yy621:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 106 "../src/ast/lex_conf.re"
+#line 107 "../src/ast/lex_conf.re"
{ opts.set_yyctxmarker (lex_conf_string ()); return; }
#line 2920 "src/ast/lex_conf.cc"
yy623:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 148 "../src/ast/lex_conf.re"
+#line 149 "../src/ast/lex_conf.re"
{ opts.set_fill_naked (lex_conf_bool()); return; }
#line 2998 "src/ast/lex_conf.cc"
yy642:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 114 "../src/ast/lex_conf.re"
+#line 115 "../src/ast/lex_conf.re"
{ opts.set_yyrestorectx (lex_conf_string ()); return; }
#line 3014 "src/ast/lex_conf.cc"
yy646:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 115 "../src/ast/lex_conf.re"
+#line 116 "../src/ast/lex_conf.re"
{ opts.set_yyrestoretag (lex_conf_string ()); return; }
#line 3022 "src/ast/lex_conf.cc"
yy648:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 49 "../src/ast/lex_conf.re"
+#line 50 "../src/ast/lex_conf.re"
{ opts.set_bCaseInverted(lex_conf_bool()); return; }
#line 3046 "src/ast/lex_conf.cc"
yy654:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 51 "../src/ast/lex_conf.re"
+#line 52 "../src/ast/lex_conf.re"
{ opts.set_optimize_tags(lex_conf_bool()); return; }
#line 3072 "src/ast/lex_conf.cc"
yy660:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 47 "../src/ast/lex_conf.re"
+#line 48 "../src/ast/lex_conf.re"
{ opts.set_posix_captures(lex_conf_bool()); return; }
#line 3116 "src/ast/lex_conf.cc"
yy671:
}
}
yy672:
-#line 66 "../src/ast/lex_conf.re"
+#line 67 "../src/ast/lex_conf.re"
{ opts.set_cond_get (lex_conf_string ()); return; }
#line 3138 "src/ast/lex_conf.cc"
yy673:
}
}
yy675:
-#line 68 "../src/ast/lex_conf.re"
+#line 69 "../src/ast/lex_conf.re"
{ opts.set_cond_set (lex_conf_string ()); return; }
#line 3165 "src/ast/lex_conf.cc"
yy676:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 60 "../src/ast/lex_conf.re"
+#line 61 "../src/ast/lex_conf.re"
{ lex_conf_encoding_policy(opts); return; }
#line 3189 "src/ast/lex_conf.cc"
yy682:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 48 "../src/ast/lex_conf.re"
+#line 49 "../src/ast/lex_conf.re"
{ opts.set_bCaseInsensitive(lex_conf_bool()); return; }
#line 3221 "src/ast/lex_conf.cc"
yy690:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 63 "../src/ast/lex_conf.re"
+#line 64 "../src/ast/lex_conf.re"
{ lex_conf_dfa_minimization(opts); return; }
#line 3229 "src/ast/lex_conf.cc"
yy692:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 80 "../src/ast/lex_conf.re"
+#line 81 "../src/ast/lex_conf.re"
{ opts.set_state_get_naked (lex_conf_bool()); return; }
#line 3241 "src/ast/lex_conf.cc"
yy695:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 82 "../src/ast/lex_conf.re"
+#line 83 "../src/ast/lex_conf.re"
{ opts.set_state_set_naked (lex_conf_bool()); return; }
#line 3257 "src/ast/lex_conf.cc"
yy699:
++cur;
-#line 83 "../src/ast/lex_conf.re"
+#line 84 "../src/ast/lex_conf.re"
{ opts.set_state_set_arg (lex_conf_string ()); return; }
#line 3262 "src/ast/lex_conf.cc"
yy701:
goto yy4;
yy709:
++cur;
-#line 69 "../src/ast/lex_conf.re"
+#line 70 "../src/ast/lex_conf.re"
{ opts.set_cond_set_arg (lex_conf_string ()); return; }
#line 3299 "src/ast/lex_conf.cc"
yy711:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 67 "../src/ast/lex_conf.re"
+#line 68 "../src/ast/lex_conf.re"
{ opts.set_cond_get_naked (lex_conf_bool()); return; }
#line 3307 "src/ast/lex_conf.cc"
yy713:
if (yybm[0+yych] & 32) {
goto yy3;
}
-#line 70 "../src/ast/lex_conf.re"
+#line 71 "../src/ast/lex_conf.re"
{ opts.set_cond_set_naked (lex_conf_bool()); return; }
#line 3315 "src/ast/lex_conf.cc"
}
++cur;
yy718:
#line 172 "../src/ast/lex_conf.re"
- { fatal("bad configuration value"
- " (expected: 'ignore', 'substitute', 'fail')"); }
+ { fatal_lc(get_cline(), get_column(),
+ "bad configuration value (expected: 'ignore', 'substitute', 'fail')"); }
#line 3341 "src/ast/lex_conf.cc"
yy719:
yych = (unsigned char)*(mar = ++cur);
++cur;
yy746:
#line 186 "../src/ast/lex_conf.re"
- { fatal("bad configuration value"
- " (expected: 'default', 'custom')"); }
+ { fatal_lc(get_cline(), get_column(),
+ "bad configuration value (expected: 'default', 'custom')"); }
#line 3444 "src/ast/lex_conf.cc"
yy747:
yych = (unsigned char)*(mar = ++cur);
++cur;
yy766:
#line 199 "../src/ast/lex_conf.re"
- { fatal("bad configuration value"
- " (expected: 'match-empty', 'match-none', 'error')"); }
+ { fatal_lc(get_cline(), get_column(),
+ "bad configuration value (expected: 'match-empty', 'match-none', 'error')"); }
#line 3522 "src/ast/lex_conf.cc"
yy767:
yych = (unsigned char)*(mar = ++cur);
++cur;
yy794:
#line 213 "../src/ast/lex_conf.re"
- { fatal("bad configuration value"
- " (expected: 'table', 'moore')"); }
+ { fatal_lc(get_cline(), get_column(),
+ "bad configuration value (expected: 'table', 'moore')"); }
#line 3630 "src/ast/lex_conf.cc"
yy795:
yych = (unsigned char)*(mar = ++cur);
++cur;
yy811:
#line 234 "../src/ast/lex_conf.re"
- { fatal ("missing '=' in configuration"); }
+ { fatal_lc(get_cline(), get_column(), "missing '=' in configuration"); }
#line 3743 "src/ast/lex_conf.cc"
yy812:
yych = (unsigned char)*(mar = ++cur);
++cur;
yy822:
#line 242 "../src/ast/lex_conf.re"
- { fatal ("missing ending ';' in configuration"); }
+ { fatal_lc(get_cline(), get_column(), "missing ending ';' in configuration"); }
#line 3832 "src/ast/lex_conf.cc"
yy823:
yych = (unsigned char)*(mar = ++cur);
yy833:
++cur;
yy834:
-#line 258 "../src/ast/lex_conf.re"
+#line 257 "../src/ast/lex_conf.re"
{
int32_t n = 0;
- if (!s_to_i32_unsafe (tok, cur, n))
- {
- fatal ("configuration value overflow");
+ if (!s_to_i32_unsafe (tok, cur, n)) {
+ fatal_lc(get_cline(), get_column(), "configuration value overflow");
}
lex_conf_semicolon ();
return n;
}
-#line 3933 "src/ast/lex_conf.cc"
+#line 3932 "src/ast/lex_conf.cc"
yy835:
++cur;
if (lim <= cur) fill(1);
}
goto yy834;
}
-#line 267 "../src/ast/lex_conf.re"
+#line 265 "../src/ast/lex_conf.re"
}
std::string s;
tok = cur;
-#line 3953 "src/ast/lex_conf.cc"
+#line 3952 "src/ast/lex_conf.cc"
{
unsigned char yych;
static const unsigned char yybm[] = {
if (yych != ';') goto yy840;
}
}
-#line 294 "../src/ast/lex_conf.re"
+#line 293 "../src/ast/lex_conf.re"
{ goto end; }
-#line 4009 "src/ast/lex_conf.cc"
+#line 4008 "src/ast/lex_conf.cc"
yy840:
++cur;
if (lim <= cur) fill(1);
if (yybm[0+yych] & 128) {
goto yy840;
}
-#line 290 "../src/ast/lex_conf.re"
+#line 289 "../src/ast/lex_conf.re"
{
s = std::string(tok, tok_len());
goto end;
}
-#line 4022 "src/ast/lex_conf.cc"
+#line 4021 "src/ast/lex_conf.cc"
yy843:
++cur;
-#line 276 "../src/ast/lex_conf.re"
+#line 274 "../src/ast/lex_conf.re"
{
const char quote = tok[0];
for (bool end;;) {
goto end;
}
if (c > 0xFF) {
- fatalf ("multibyte character in configuration string: 0x%X", c);
+ fatal_lc(get_cline(), get_column(),
+ "multibyte character in configuration string: 0x%X", c);
} else {
s += static_cast<char>(c);
}
}
#line 4040 "src/ast/lex_conf.cc"
}
-#line 295 "../src/ast/lex_conf.re"
+#line 294 "../src/ast/lex_conf.re"
end:
lex_conf_semicolon ();
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] =
{
- 0, 67, 67, 69, 70, 71, 72, 76, 83, 88,
- 91, 95, 95, 98, 102, 106, 113, 120, 127, 133,
- 135, 141, 148, 149, 155, 161, 168, 170, 176, 180,
- 187, 191, 198, 202, 209, 210, 216, 221, 222, 226,
- 227, 228, 232, 233, 243
+ 0, 67, 67, 69, 70, 71, 72, 76, 83, 89,
+ 92, 96, 96, 99, 103, 107, 114, 121, 128, 134,
+ 136, 142, 149, 150, 156, 162, 169, 171, 177, 181,
+ 188, 192, 199, 203, 210, 211, 217, 222, 223, 227,
+ 228, 229, 233, 234, 244
};
#endif
{
if (!context.symtab.insert(std::make_pair(*(yyvsp[-2].str), (yyvsp[-1].regexp))).second) {
- context.input.fatal("sym already defined");
+ fatal_l(context.input.get_cline(), "sym already defined");
}
delete (yyvsp[-2].str);
}
case 8:
{
- context.input.fatal("trailing contexts are not allowed in named definitions");
+ fatal_l(context.input.get_cline(),
+ "trailing contexts are not allowed in named definitions");
}
break;
{
symtab_t::iterator i = context.symtab.find(*(yyvsp[0].str));
if (i == context.symtab.end()) {
- context.input.fatal("can't find symbol");
+ fatal_l(context.input.get_cline(), "can't find symbol");
}
(yyval.regexp) = i->second;
if (ast_need_wrap((yyval.regexp))) {
void yyerror(context_t &context, const char* s)
{
- context.input.fatal(s);
+ fatal_l(context.input.get_cline(), "%s", s);
}
int yylex(context_t &context)
// error if tags are not enabled, but we need them
if (!explicit_tags && maxtagver > 1) {
- error("line %u: overlapping trailing contexts need "
+ fatal_l(line, "overlapping trailing contexts need "
"multiple context markers, use '-t, --tags' "
- "option and '/*!stags:re2c ... */' directive",
- line);
- exit(1);
+ "option and '/*!stags:re2c ... */' directive");
}
}
#include <limits>
#include <string>
+#include "src/conf/msg.h"
#include "src/code/output.h"
#include "src/re/encoding/enc.h"
#include "src/ast/input.h"
{
uint32_t ignored = 0;
for (;;) {/*!re2c
- zero { fatal("expected end of block"); }
+ zero { fatal_lc(get_cline(), get_column(), "expected end of block"); }
* { continue; }
eol { ++ignored; continue; }
{
std::string fmt, sep;
for (;;) {/*!re2c
- * { fatal("unrecognized configuration"); }
+ * { fatal_lc(get_cline(), get_column(), "unrecognized configuration"); }
"format" { fmt = lex_conf_string(); continue; }
"separator" { sep = lex_conf_string(); continue; }
"{" [0-9]+ "}" {
if (!s_to_u32_unsafe (tok + 1, cur - 1, yylval.bounds.min))
{
- fatal ("repetition count overflow");
+ fatal_lc(get_cline(), get_column(), "repetition count overflow");
}
yylval.bounds.max = yylval.bounds.min;
return TOKEN_CLOSESIZE;
const char * p = strchr (tok, ',');
if (!s_to_u32_unsafe (tok + 1, p, yylval.bounds.min))
{
- fatal ("repetition lower bound overflow");
+ fatal_lc(get_cline(), get_column(), "repetition lower bound overflow");
}
if (!s_to_u32_unsafe (p + 1, cur - 1, yylval.bounds.max))
{
- fatal ("repetition upper bound overflow");
+ fatal_lc(get_cline(), get_column(), "repetition upper bound overflow");
}
return TOKEN_CLOSESIZE;
}
"{" [0-9]+ ",}" {
if (!s_to_u32_unsafe (tok + 1, cur - 2, yylval.bounds.min))
{
- fatal ("repetition lower bound overflow");
+ fatal_lc(get_cline(), get_column(), "repetition lower bound overflow");
}
yylval.bounds.max = std::numeric_limits<uint32_t>::max();
return TOKEN_CLOSESIZE;
}
"{" [0-9]* "," {
- fatal("illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers");
+ fatal_lc(get_cline(), get_column(), "illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers");
}
"{" name "}" {
if (!globopts->FFlag) {
- fatal("curly braces for names only allowed with -F switch");
+ fatal_lc(get_cline(), get_column(), "curly braces for names only allowed with -F switch");
}
yylval.str = new std::string (tok + 1, tok_len () - 2); // -2 to omit braces
return TOKEN_ID;
}
* {
- fatalf("unexpected character: '%c'", *tok);
+ fatal_lc(get_cline(), get_column(), "unexpected character: '%c'", *tok);
goto scan;
}
*/
"}" {
if (depth == 0)
{
- fatal("Curly braces are not allowed after ':='");
+ fatal_l(get_cline(), "Curly braces are not allowed after ':='");
}
else if (--depth == 0)
{
"{" {
if (depth == 0)
{
- fatal("Curly braces are not allowed after ':='");
+ fatal_l(get_cline(), "Curly braces are not allowed after ':='");
}
else
{
}
else if (cur == eof)
{
- fatal("missing '}'");
+ fatal_l(get_cline(), "missing '}'");
}
pos = cur;
cline++;
}
else if (cur == eof)
{
- fatal("missing '}'");
+ fatal_l(get_cline(), "missing '}'");
}
pos = cur;
cline++;
{
if (depth)
{
- fatal("missing '}'");
+ fatal_l(get_cline(), "missing '}'");
}
return 0;
}
comment:
/*!re2c
- "*/" {
+ "*" "/" {
if (--depth == 0)
{
goto scan;
goto comment;
}
}
- "/*" {
+ "/" "*" {
++depth;
- fatal("ambiguous /* found");
+ fatal_lc(get_cline(), get_column(), "ambiguous /* found");
goto comment;
}
"\n" space* "#" space* "line" space+ / lineinf {
uint32_t Scanner::lex_cls_chr()
{
tok = cur;
+ const uint32_t l = get_cline(), c = get_column();
/*!re2c
- * { fatal (get_column() - tchar, "syntax error"); }
- esc [xXuU] { fatal (get_column() - tchar, "syntax error in hexadecimal escape sequence"); }
- esc [0-7] { fatal (get_column() - tchar, "syntax error in octal escape sequence"); }
- esc { fatal (get_column() - tchar, "syntax error in escape sequence"); }
+ * { fatal_lc(l, c, "syntax error"); }
+ esc [xXuU] { fatal_lc(l, c, "syntax error in hexadecimal escape sequence"); }
+ esc [0-7] { fatal_lc(l, c, "syntax error in octal escape sequence"); }
+ esc { fatal_lc(l, c, "syntax error in escape sequence"); }
. \ esc { return static_cast<uint8_t>(tok[0]); }
esc_hex { return unesc_hex(tok, cur); }
{
end = false;
tok = cur;
+ const uint32_t l = get_cline(), c = get_column();
/*!re2c
- * { fatal (get_column() - tchar, "syntax error"); }
- esc [xXuU] { fatal (get_column() - tchar, "syntax error in hexadecimal escape sequence"); }
- esc [0-7] { fatal (get_column() - tchar, "syntax error in octal escape sequence"); }
- esc { fatal (get_column() - tchar, "syntax error in escape sequence"); }
+ * { fatal_lc(l, c, "syntax error"); }
+ esc [xXuU] { fatal_lc(l, c, "syntax error in hexadecimal escape sequence"); }
+ esc [0-7] { fatal_lc(l, c, "syntax error in octal escape sequence"); }
+ esc { fatal_lc(l, c, "syntax error in escape sequence"); }
. \ esc {
end = tok[0] == quote;
lineno {
if (!s_to_u32_unsafe (tok, cur, cline))
{
- fatal ("line number overflow");
+ fatal_lc(get_cline(), get_column(), "line number overflow");
}
goto sourceline;
}
void Scanner::lex_conf(Opt &opts)
{
tok = cur;
+ const uint32_t l = get_cline(), c = get_column();
/*!re2c
"flags:" ("b" | "bit-vectors") { opts.set_bFlag(lex_conf_bool()); return; }
"flags:" ("d" | "debug-output") { opts.set_dFlag(lex_conf_bool()); return; }
const int32_t n = lex_conf_number ();
if (n < 0)
{
- fatal ("configuration 'cgoto:threshold' must be nonnegative");
+ fatal_lc(l, c, "configuration 'cgoto:threshold' must be nonnegative");
}
opts.set_cGotoThreshold (static_cast<uint32_t> (n));
return;
const int32_t n = lex_conf_number ();
if (n < 0)
{
- fatal ("configuration 'indent:top' must be nonnegative");
+ fatal_lc(l, c, "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_error(cline, get_column(),
- "unrecognized configuration '%.*s'",
+ fatal_lc(l, c, "unrecognized configuration '%.*s'",
static_cast<int>(cur - tok), tok);
}
*/
{
lex_conf_assign ();
/*!re2c
- * { fatal("bad configuration value"
- " (expected: 'ignore', 'substitute', 'fail')"); }
+ * { fatal_lc(get_cline(), get_column(),
+ "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; }
"fail" { opts.set_encoding_policy(Enc::POLICY_FAIL); goto end; }
{
lex_conf_assign ();
/*!re2c
- * { fatal("bad configuration value"
- " (expected: 'default', 'custom')"); }
+ * { fatal_lc(get_cline(), get_column(),
+ "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("bad configuration value"
- " (expected: 'match-empty', 'match-none', 'error')"); }
+ * { fatal_lc(get_cline(), get_column(),
+ "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; }
"error" { opts.set_empty_class_policy(EMPTY_CLASS_ERROR); goto end; }
{
lex_conf_assign ();
/*!re2c
- * { fatal("bad configuration value"
- " (expected: 'table', 'moore')"); }
+ * { fatal_lc(get_cline(), get_column(),
+ "bad configuration value (expected: 'table', 'moore')"); }
"table" { opts.set_dfa_minimization(DFA_MINIMIZATION_TABLE); goto end; }
"moore" { opts.set_dfa_minimization(DFA_MINIMIZATION_MOORE); goto end; }
*/
void Scanner::lex_conf_assign ()
{
/*!re2c
- * { fatal ("missing '=' in configuration"); }
+ * { fatal_lc(get_cline(), get_column(), "missing '=' in configuration"); }
conf_assign { return; }
*/
}
void Scanner::lex_conf_semicolon ()
{
/*!re2c
- * { fatal ("missing ending ';' in configuration"); }
+ * { fatal_lc(get_cline(), get_column(), "missing ending ';' in configuration"); }
space* ";" { return; }
*/
}
lex_conf_assign ();
tok = cur;
/*!re2c
- number
- {
+ number {
int32_t n = 0;
- if (!s_to_i32_unsafe (tok, cur, n))
- {
- fatal ("configuration value overflow");
+ if (!s_to_i32_unsafe (tok, cur, n)) {
+ fatal_lc(get_cline(), get_column(), "configuration value overflow");
}
lex_conf_semicolon ();
return n;
goto end;
}
if (c > 0xFF) {
- fatalf ("multibyte character in configuration string: 0x%X", c);
+ fatal_lc(get_cline(), get_column(),
+ "multibyte character in configuration string: 0x%X", c);
} else {
s += static_cast<char>(c);
}
#include <set>
#include <string>
+#include "src/conf/msg.h"
#include "src/ast/ast.h"
#include "src/conf/opt.h"
#include "src/ast/scanner.h"
def
: name expr enddef {
if (!context.symtab.insert(std::make_pair(*$1, $2)).second) {
- context.input.fatal("sym already defined");
+ fatal_l(context.input.get_cline(), "sym already defined");
}
delete $1;
}
/* errors */
| name expr '/' {
- context.input.fatal("trailing contexts are not allowed in named definitions");
+ fatal_l(context.input.get_cline(),
+ "trailing contexts are not allowed in named definitions");
};
name
| TOKEN_ID {
symtab_t::iterator i = context.symtab.find(*$1);
if (i == context.symtab.end()) {
- context.input.fatal("can't find symbol");
+ fatal_l(context.input.get_cline(), "can't find symbol");
}
$$ = i->second;
if (ast_need_wrap($$)) {
void yyerror(context_t &context, const char* s)
{
- context.input.fatal(s);
+ fatal_l(context.input.get_cline(), "%s", s);
}
int yylex(context_t &context)
-#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <iostream>
#include <new>
+#include "src/conf/msg.h"
#include "src/code/label.h"
#include "src/code/output.h"
#include "src/ast/scanner.h"
}
}
-void Scanner::fatal_at(uint32_t line, ptrdiff_t ofs, const char *msg) const
-{
- std::cerr << "re2c: error: "
- << "line " << line << ", column " << (tchar + ofs + 1) << ": "
- << msg << std::endl;
- exit(1);
-}
-
-void Scanner::fatal(ptrdiff_t ofs, const char *msg) const
-{
- fatal_at(cline, ofs, msg);
-}
-
-void Scanner::fatalf_at(uint32_t line, const char* fmt, ...) const
-{
- char szBuf[4096];
-
- va_list args;
-
- va_start(args, fmt);
- vsnprintf(szBuf, sizeof(szBuf), fmt, args);
- va_end(args);
-
- szBuf[sizeof(szBuf)-1] = '0';
-
- fatal_at(line, 0, szBuf);
-}
-
-void Scanner::fatalf(const char *fmt, ...) const
-{
- char szBuf[4096];
-
- va_list args;
-
- va_start(args, fmt);
- vsnprintf(szBuf, sizeof(szBuf), fmt, args);
- va_end(args);
-
- szBuf[sizeof(szBuf)-1] = '0';
-
- fatal(szBuf);
-}
-
Scanner::~Scanner()
{
delete [] bot;
uint32_t get_cline() const;
uint32_t get_column() const;
const std::string & get_fname () const;
- void fatal_at(uint32_t line, ptrdiff_t ofs, const char *msg) const RE2C_GXX_ATTRIBUTE ((noreturn));
- void fatalf_at(uint32_t line, const char*, ...) const RE2C_GXX_ATTRIBUTE ((format (printf, 3, 4))) RE2C_GXX_ATTRIBUTE ((noreturn));
- void fatalf(const char*, ...) const RE2C_GXX_ATTRIBUTE ((format (printf, 2, 3))) RE2C_GXX_ATTRIBUTE ((noreturn));
- void fatal(const char*) const RE2C_GXX_ATTRIBUTE ((noreturn));
- void fatal(ptrdiff_t, const char*) const RE2C_GXX_ATTRIBUTE ((noreturn));
FORBID_COPY (Scanner);
};
return static_cast<uint32_t>(tok - pos);
}
-inline void Scanner::fatal(const char *msg) const
-{
- fatal(0, msg);
-}
-
} // end namespace re2c
#endif // _RE2C_AST_SCANNER_
void validate_mode(Scanner::ParseMode mode, bool rflag, bool rules, Scanner &input)
{
+ const uint32_t l = input.get_cline();
if (mode == Scanner::Rules) {
if (!rflag) {
- input.fatal("found 'rules:re2c' block without -r flag");
+ fatal_l(l, "found 'rules:re2c' block without -r flag");
} else if (rules) {
- input.fatal("cannot have a second 'rules:re2c' block");
+ fatal_l(l, "cannot have a second 'rules:re2c' block");
}
} else if (mode == Scanner::Reuse) {
if (!rflag) {
- input.fatal("found 'use:re2c' block without -r flag");
+ fatal_l(l, "found 'use:re2c' block without -r flag");
} else if (!rules) {
- input.fatal("got 'use:re2c' without 'rules:re2c'");
+ fatal_l(l, "got 'use:re2c' without 'rules:re2c'");
}
} else if (rflag) {
- input.fatal("found standard 're2c' block while using -r flag");
+ fatal_l(l, "found standard 're2c' block while using -r flag");
}
}
for (i = b; i != e; ++i) {
if (i->defs.size() > 1) {
- error("line %u: code to default rule %sis already defined at line %u",
- i->defs[1]->fline, incond(i->name).c_str(), i->defs[0]->fline);
- exit(1);
+ fatal_l(i->defs[1]->fline,
+ "code to default rule %sis already defined at line %u",
+ incond(i->name).c_str(), i->defs[0]->fline);
}
}
if (!cflag) {
for (i = b; i != e; ++i) {
if (i->name != "") {
- error("line %u: conditions are only allowed"
- " with '-c', '--conditions' option",
- i->rules[0].code->fline);
- exit(1);
+ fatal_l(i->rules[0].code->fline,
+ "conditions are only allowed with '-c', '--conditions' option");
}
}
} else {
for (i = b; i != e; ++i) {
if (i->name == "") {
- error("line %u: non-conditional rules are not allowed"
- " with '-c', '--conditions' option",
- i->rules[0].code->fline);
- exit(1);
+ fatal_l(i->rules[0].code->fline,
+ "non-conditional rules are not allowed"
+ " with '-c', '--conditions' option");
}
}
for (i = b; i != e; ++i) {
if (i->setup.size() > 1) {
- error("line %u: code to setup rule '%s' is already defined at line %u",
- i->setup[1]->fline, i->name.c_str(), i->setup[0]->fline);
- exit(1);
+ fatal_l(i->setup[1]->fline,
+ "code to setup rule '%s' is already defined at line %u",
+ i->name.c_str(), i->setup[0]->fline);
}
}
for (i = b; i != e; ++i) {
if (i->name != "*" && !i->setup.empty() && i->rules.empty()) {
- error("line %u: setup for non existing condition '%s' found",
- i->setup[0]->fline, i->name.c_str());
- exit(1);
+ fatal_l(i->setup[0]->fline,
+ "setup for non existing condition '%s' found",
+ i->name.c_str());
}
}
if (i == e) {
for (i = b; i != e; ++i) {
if (i->name == "*") {
- error("line %u: setup for all conditions '<!*>' is illegal "
- "if setup for each condition is defined explicitly",
- i->setup[0]->fline);
- exit(1);
+ fatal_l(i->setup[0]->fline,
+ "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) {
- error("line %u: startup code is already defined at line %u",
- i->rules[1].code->fline, i->rules[0].code->fline);
- exit(1);
+ fatal_l(i->rules[1].code->fline,
+ "startup code is already defined at line %u",
+ i->rules[0].code->fline);
}
}
}
fprintf (stderr, "\n");
}
-void fatal_error(uint32_t line, uint32_t column, const char *fmt, ...)
+void fatal(const char *fmt, ...)
+{
+ fprintf (stderr, "re2c: error: ");
+
+ va_list args;
+ va_start (args, fmt);
+ vfprintf (stderr, fmt, args);
+ va_end (args);
+
+ fprintf (stderr, "\n");
+ exit(1);
+}
+
+void fatal_l(uint32_t line, const char *fmt, ...)
+{
+ fprintf (stderr, "re2c: error: line %u: ", line);
+
+ va_list args;
+ va_start (args, fmt);
+ vfprintf (stderr, fmt, args);
+ va_end (args);
+
+ fprintf (stderr, "\n");
+ exit(1);
+}
+
+void fatal_lc(uint32_t line, uint32_t column, const char *fmt, ...)
{
fprintf (stderr, "re2c: error: line %u, column %u: ", line, column);
namespace re2c {
-void error (const char * fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 1, 2)));
-void fatal_error(uint32_t line, uint32_t column, const char *fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 3, 4)));
-void error_arg (const char * option);
+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_l(uint32_t line, const char *fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 2, 3), noreturn));
+void fatal_lc(uint32_t line, uint32_t column, const char *fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 3, 4), noreturn));
+void error_arg(const char *option);
void warning_start (uint32_t line, bool error);
void warning_end (const char * type, bool error);
void warning (const char * type, uint32_t line, bool error, const char * fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 4, 5)));
if (sx < sy) return true;
if (sx > sy) return false;
assert(false);
+ return false;
}
// Skip non-orbit start tags: their position is fixed on some higher-priority
e = ast->cls.ranges->end();
for (; i != e; ++i) {
Range *s = opts->encoding.encodeRange(i->lower, i->upper);
- if (!s) fatal_error(ast->line, i->column,
+ if (!s) fatal_lc(ast->line, i->column,
"bad code point range: '0x%X - 0x%X'", i->lower, i->upper);
r = Range::add(r, s);
}
case AST::DOT: {
uint32_t c = '\n';
if (!opts->encoding.encode(c)) {
- fatal_error(ast->line, ast->column, "bad code point: '0x%X'", c);
+ fatal_lc(ast->line, ast->column, "bad code point: '0x%X'", c);
}
return re_class(alc, ast->line, ast->column,
Range::sub(opts->encoding.fullRange(), Range::sym(c)), opts, warn);
RE *x = ast_to_re(spec, ast->diff.ast1, ncap);
RE *y = ast_to_re(spec, ast->diff.ast2, ncap);
if (x->type != RE::SYM || y->type != RE::SYM) {
- fatal_error(ast->line, ast->column, "can only difference char sets");
+ fatal_lc(ast->line, ast->column, "can only difference char sets");
}
return re_class(alc, ast->line, ast->column, Range::sub(x->sym, y->sym), opts, warn);
}
}
case AST::TAG: {
if (ast->tag.name && !opts->tags) {
- fatal_error(ast->line, ast->column,
+ fatal_lc(ast->line, ast->column,
"tags are only allowed with '-T, --tags' option");
}
if (opts->posix_captures) {
- fatal_error(ast->line, ast->column,
+ fatal_lc(ast->line, ast->column,
"simple tags are not allowed with '--posix-captures' option");
}
RE *t = re_tag(alc, tags.size(), false);
if (!opts->posix_captures) {
return ast_to_re(spec, ast->ref.ast, ncap);
}
- error("implicit grouping is forbidden with '--posix-captures'"
+ fatal_l(ast->line,
+ "implicit grouping is forbidden with '--posix-captures'"
" option, please wrap '%s' in capturing parenthesis",
ast->ref.name->c_str());
- exit(1);
+ return NULL;
case AST::ITER: {
const uint32_t
n = ast->iter.min,
RE *re_schar(RE::alc_t &alc, uint32_t line, uint32_t column, uint32_t c, const opt_t *opts)
{
if (!opts->encoding.encode(c)) {
- fatal_error(line, column, "bad code point: '0x%X'", c);
+ fatal_lc(line, column, "bad code point: '0x%X'", c);
}
switch (opts->encoding.type ()) {
case Enc::UTF16: return UTF16Symbol(alc, c);
warn.empty_class(line);
break;
case EMPTY_CLASS_ERROR:
- fatal_error(line, column, "empty character class");
+ fatal_lc(line, column, "empty character class");
break;
}
}
for (size_t t = rule.ltag; t < rule.htag; ++t) {
name = tags[t].name;
if (name && !names.insert(*name).second) {
- error("line %u: tag '%s' is used multiple times in the same rule",
- rule.code->fline, name->c_str());
- exit(1);
+ fatal_l(rule.code->fline,
+ "tag '%s' is used multiple times in the same rule",
+ name->c_str());
}
}
}
const std::string input_name = fname + "." + skel.name + ".input";
FILE *input = fopen(input_name.c_str(), "wb");
if (!input) {
- error("cannot open file: %s", input_name.c_str());
- exit(1);
+ fatal("cannot open file: %s", input_name.c_str());
}
const std::string keys_name = std::string(fname) + "." + skel.name + ".keys";
FILE *keys = fopen (keys_name.c_str(), "wb");
if (!keys) {
- error("cannot open file: %s", keys_name.c_str());
- exit(1);
+ fatal("cannot open file: %s", keys_name.c_str());
}
cover_t cover(input, keys, skel.nodes_count);
calc_dist(skel, loops, dists, 0);
const uint32_t maxlen = dists[0];
if (maxlen == DIST_MAX) {
- error("DFA path %sis too long", incond(skel.cond).c_str());
- exit(1);
+ fatal("DFA path %sis too long", incond(skel.cond).c_str());
}
return maxlen;
}
-re2c: error: line 5, column 9: missing '}'
+re2c: error: line 5: missing '}'
-re2c: error: line 2, column 6: syntax error in escape sequence
+re2c: error: line 2, column 5: syntax error in escape sequence
-re2c: error: line 2, column 6: syntax error
+re2c: error: line 2, column 5: syntax error
-re2c: error: line 3, column 4: syntax error
+re2c: error: line 3: syntax error
-re2c: error: line 3, column 5: syntax error
+re2c: error: line 3: syntax error
-re2c: error: line 3, column 4: syntax error
+re2c: error: line 3: syntax error
-re2c: error: line 18, column 5: illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers
+re2c: error: line 18, column 4: illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers
-re2c: error: line 2, column 2: syntax error in hexadecimal escape sequence
+re2c: error: line 2, column 1: syntax error in hexadecimal escape sequence
-re2c: error: line 3, column 17: trailing contexts are not allowed in named definitions
+re2c: error: line 3: trailing contexts are not allowed in named definitions
-re2c: error: line 18, column 5: illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers
+re2c: error: line 18, column 4: illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers
-re2c: error: line 18, column 5: unexpected character: ']'
+re2c: error: line 18, column 4: unexpected character: ']'
-re2c: error: line 2, column 2: syntax error in hexadecimal escape sequence
+re2c: error: line 2, column 1: syntax error in hexadecimal escape sequence
-re2c: error: line 2, column 2: syntax error in hexadecimal escape sequence
+re2c: error: line 2, column 1: syntax error in hexadecimal escape sequence
-re2c: error: line 2, column 2: syntax error in hexadecimal escape sequence
+re2c: error: line 2, column 1: syntax error in hexadecimal escape sequence
-re2c: error: line 2, column 2: syntax error in octal escape sequence
+re2c: error: line 2, column 1: syntax error in octal escape sequence
-re2c: error: line 2, column 2: syntax error in octal escape sequence
+re2c: error: line 2, column 1: syntax error in octal escape sequence
-re2c: error: line 2, column 2: syntax error in octal escape sequence
+re2c: error: line 2, column 1: syntax error in octal escape sequence
-re2c: error: line 6, column 1: curly braces for names only allowed with -F switch
+re2c: error: line 6, column 0: curly braces for names only allowed with -F switch
-re2c: error: line 2, column 8219: can't find symbol
+re2c: error: line 2: can't find symbol
-re2c: error: line 2, column 8219: can't find symbol
+re2c: error: line 2: can't find symbol
-re2c: error: implicit grouping is forbidden with '--posix-captures' option, please wrap 'x' in capturing parenthesis
+re2c: error: line 2: implicit grouping is forbidden with '--posix-captures' option, please wrap 'x' in capturing parenthesis
-re2c: error: line 5, column 1: found 'rules:re2c' block without -r flag
+re2c: error: line 5: found 'rules:re2c' block without -r flag
re2c: warning: line 18: control flow in condition 'r1' is undefined for strings that match '[\x0-\x30\x33-\x60\x63-\xFF]', use default rule '*' [-Wundefined-control-flow]
re2c: warning: line 18: control flow in condition 'r2' is undefined for strings that match '[\x0-\x30\x33-\x61\x63-\xFF]', use default rule '*' [-Wundefined-control-flow]
-re2c: error: line 20, column 1: cannot have a second 'rules:re2c' block
+re2c: error: line 20: cannot have a second 'rules:re2c' block
-re2c: error: line 7, column 1: found standard 're2c' block while using -r flag
+re2c: error: line 7: found standard 're2c' block while using -r flag
-re2c: error: line 2, column 5: repetition count overflow
+re2c: error: line 2, column 4: repetition count overflow