-/* Generated by re2c 0.14.3 on Fri Aug 14 12:58:19 2015 */
+/* Generated by re2c 0.14.3 on Sun Aug 16 11:25:05 2015 */
#line 1 "../src/parse/scanner_lex.re"
#include <stdlib.h>
#include <string.h>
#include "src/parse/parser.h"
#include "src/parse/scanner.h"
#include "y.tab.h"
+#include "src/util/s_to_n32_unsafe.h"
extern YYSTYPE yylval;
-#ifndef MAX
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#endif
-
#define YYCTYPE unsigned char
#define YYCURSOR cur
#define YYLIMIT lim
// source code is in ASCII: pointers have type 'char *'
// but re2c makes an implicit assumption that YYCTYPE is unsigned
// when it generates comparisons
-#line 34 "../src/parse/scanner_lex.re"
+#line 31 "../src/parse/scanner_lex.re"
-#line 56 "../src/parse/scanner_lex.re"
+#line 53 "../src/parse/scanner_lex.re"
Scanner::ParseMode Scanner::echo()
tok = cur;
echo:
-#line 54 "src/parse/scanner_lex.cc"
+#line 51 "src/parse/scanner_lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
}
}
++YYCURSOR;
-#line 199 "../src/parse/scanner_lex.re"
+#line 196 "../src/parse/scanner_lex.re"
{
if (!(ignore_eoc || DFlag || flag_skeleton))
{
return Stop;
}
}
-#line 125 "src/parse/scanner_lex.cc"
+#line 122 "src/parse/scanner_lex.cc"
yy4:
++YYCURSOR;
yy5:
-#line 210 "../src/parse/scanner_lex.re"
+#line 207 "../src/parse/scanner_lex.re"
{
goto echo;
}
-#line 133 "src/parse/scanner_lex.cc"
+#line 130 "src/parse/scanner_lex.cc"
yy6:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
if (yych == '#') goto yy91;
yy7:
-#line 186 "../src/parse/scanner_lex.re"
+#line 183 "../src/parse/scanner_lex.re"
{
if (ignore_eoc)
{
cline++;
goto echo;
}
-#line 156 "src/parse/scanner_lex.cc"
+#line 153 "src/parse/scanner_lex.cc"
yy8:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '{') goto yy32;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'c') goto yy12;
++YYCURSOR;
-#line 87 "../src/parse/scanner_lex.re"
+#line 84 "../src/parse/scanner_lex.re"
{
if (rFlag)
{
tok = cur;
return Rules;
}
-#line 253 "src/parse/scanner_lex.cc"
+#line 250 "src/parse/scanner_lex.cc"
yy31:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'c') goto yy12;
yy32:
++YYCURSOR;
-#line 72 "../src/parse/scanner_lex.re"
+#line 69 "../src/parse/scanner_lex.re"
{
if (rFlag)
{
tok = cur;
return Parse;
}
-#line 275 "src/parse/scanner_lex.cc"
+#line 272 "src/parse/scanner_lex.cc"
yy34:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'e') goto yy12;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'c') goto yy12;
++YYCURSOR;
-#line 99 "../src/parse/scanner_lex.re"
+#line 96 "../src/parse/scanner_lex.re"
{
if (!rFlag)
{
tok = cur;
return Reuse;
}
-#line 305 "src/parse/scanner_lex.cc"
+#line 302 "src/parse/scanner_lex.cc"
yy42:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'x') goto yy12;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'c') goto yy12;
++YYCURSOR;
-#line 113 "../src/parse/scanner_lex.re"
+#line 110 "../src/parse/scanner_lex.re"
{
if (!DFlag)
{
ignore_eoc = true;
goto echo;
}
-#line 330 "src/parse/scanner_lex.cc"
+#line 327 "src/parse/scanner_lex.cc"
yy50:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 't') goto yy12;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'c') goto yy12;
++YYCURSOR;
-#line 122 "../src/parse/scanner_lex.re"
+#line 119 "../src/parse/scanner_lex.re"
{
tok = pos = cur;
out.insert_state_goto (topIndent);
ignore_eoc = true;
goto echo;
}
-#line 362 "src/parse/scanner_lex.cc"
+#line 359 "src/parse/scanner_lex.cc"
yy63:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'n') goto yy12;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'c') goto yy12;
++YYCURSOR;
-#line 128 "../src/parse/scanner_lex.re"
+#line 125 "../src/parse/scanner_lex.re"
{
tok = pos = cur;
ignore_eoc = true;
goto echo;
}
-#line 389 "src/parse/scanner_lex.cc"
+#line 386 "src/parse/scanner_lex.cc"
yy74:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'p') goto yy12;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'c') goto yy12;
++YYCURSOR;
-#line 133 "../src/parse/scanner_lex.re"
+#line 130 "../src/parse/scanner_lex.re"
{
tok = pos = cur;
ignore_eoc = true;
}
goto echo;
}
-#line 422 "src/parse/scanner_lex.cc"
+#line 419 "src/parse/scanner_lex.cc"
yy84:
yyaccept = 2;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == '\n') goto yy87;
if (yych == '\r') goto yy86;
yy85:
-#line 164 "../src/parse/scanner_lex.re"
+#line 161 "../src/parse/scanner_lex.re"
{
if (ignore_eoc)
{
tok = pos = cur;
goto echo;
}
-#line 448 "src/parse/scanner_lex.cc"
+#line 445 "src/parse/scanner_lex.cc"
yy86:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != '\n') goto yy12;
yy87:
++YYCURSOR;
-#line 146 "../src/parse/scanner_lex.re"
+#line 143 "../src/parse/scanner_lex.re"
{
cline++;
if (ignore_eoc)
tok = pos = cur;
goto echo;
}
-#line 473 "src/parse/scanner_lex.cc"
+#line 470 "src/parse/scanner_lex.cc"
yy89:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yy103:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 182 "../src/parse/scanner_lex.re"
+#line 179 "../src/parse/scanner_lex.re"
{
set_sourceline ();
goto echo;
}
-#line 553 "src/parse/scanner_lex.cc"
+#line 550 "src/parse/scanner_lex.cc"
yy105:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy103;
if (yych == '\r') goto yy105;
goto yy12;
}
-#line 213 "../src/parse/scanner_lex.re"
+#line 210 "../src/parse/scanner_lex.re"
}
start:
-#line 600 "src/parse/scanner_lex.cc"
+#line 597 "src/parse/scanner_lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
yy112:
++YYCURSOR;
yy113:
-#line 431 "../src/parse/scanner_lex.re"
+#line 441 "../src/parse/scanner_lex.re"
{
fatalf("unexpected character: '%c'", *tok);
goto scan;
}
-#line 720 "src/parse/scanner_lex.cc"
+#line 717 "src/parse/scanner_lex.cc"
yy114:
++YYCURSOR;
yych = (YYCTYPE)*YYCURSOR;
goto yy248;
yy115:
-#line 415 "../src/parse/scanner_lex.re"
+#line 425 "../src/parse/scanner_lex.re"
{
goto scan;
}
-#line 730 "src/parse/scanner_lex.cc"
+#line 727 "src/parse/scanner_lex.cc"
yy116:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == '#') goto yy228;
}
yy117:
-#line 424 "../src/parse/scanner_lex.re"
+#line 434 "../src/parse/scanner_lex.re"
{
if (cur == eof) return 0;
pos = cur;
cline++;
goto scan;
}
-#line 748 "src/parse/scanner_lex.cc"
+#line 745 "src/parse/scanner_lex.cc"
yy118:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy225;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych != '\n') goto yy221;
yy120:
-#line 289 "../src/parse/scanner_lex.re"
+#line 286 "../src/parse/scanner_lex.re"
{
fatal("unterminated string constant (missing \")");
}
-#line 762 "src/parse/scanner_lex.cc"
+#line 759 "src/parse/scanner_lex.cc"
yy121:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '}') goto yy213;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych != '\n') goto yy216;
yy123:
-#line 292 "../src/parse/scanner_lex.re"
+#line 289 "../src/parse/scanner_lex.re"
{
fatal("unterminated string constant (missing ')");
}
-#line 776 "src/parse/scanner_lex.cc"
+#line 773 "src/parse/scanner_lex.cc"
yy124:
++YYCURSOR;
yy125:
-#line 318 "../src/parse/scanner_lex.re"
+#line 315 "../src/parse/scanner_lex.re"
{
return *tok;
}
-#line 784 "src/parse/scanner_lex.cc"
+#line 781 "src/parse/scanner_lex.cc"
yy126:
++YYCURSOR;
if ((yych = (YYCTYPE)*YYCURSOR) == '/') goto yy213;
-#line 322 "../src/parse/scanner_lex.re"
+#line 319 "../src/parse/scanner_lex.re"
{
yylval.op = *tok;
return STAR;
}
-#line 793 "src/parse/scanner_lex.cc"
+#line 790 "src/parse/scanner_lex.cc"
yy128:
++YYCURSOR;
-#line 326 "../src/parse/scanner_lex.re"
+#line 323 "../src/parse/scanner_lex.re"
{
yylval.op = *tok;
return CLOSE;
}
-#line 801 "src/parse/scanner_lex.cc"
+#line 798 "src/parse/scanner_lex.cc"
yy130:
++YYCURSOR;
-#line 410 "../src/parse/scanner_lex.re"
+#line 420 "../src/parse/scanner_lex.re"
{
yylval.regexp = mkDot();
return RANGE;
}
-#line 809 "src/parse/scanner_lex.cc"
+#line 806 "src/parse/scanner_lex.cc"
yy132:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '*') goto yy209;
if (yych == '^') goto yy188;
goto yy187;
yy137:
-#line 308 "../src/parse/scanner_lex.re"
+#line 305 "../src/parse/scanner_lex.re"
{
fatal("unterminated range (missing ])");
}
-#line 841 "src/parse/scanner_lex.cc"
+#line 838 "src/parse/scanner_lex.cc"
yy138:
YYCTXMARKER = YYCURSOR + 1;
yych = (YYCTYPE)*++YYCURSOR;
}
}
yy140:
-#line 234 "../src/parse/scanner_lex.re"
+#line 231 "../src/parse/scanner_lex.re"
{
depth = 1;
goto code;
}
-#line 872 "src/parse/scanner_lex.cc"
+#line 869 "src/parse/scanner_lex.cc"
yy141:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == ',') goto yy160;
yy147:
++YYCURSOR;
yy148:
-#line 354 "../src/parse/scanner_lex.re"
+#line 364 "../src/parse/scanner_lex.re"
{
fatal("illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers");
}
-#line 948 "src/parse/scanner_lex.cc"
+#line 945 "src/parse/scanner_lex.cc"
yy149:
++YYCURSOR;
-#line 358 "../src/parse/scanner_lex.re"
+#line 368 "../src/parse/scanner_lex.re"
{
if (!FFlag) {
fatal("curly braces for names only allowed with -F switch");
yylval.str = new std::string (tok + 1, tok_len () - 2); // -2 to omit braces
return ID;
}
-#line 959 "src/parse/scanner_lex.cc"
+#line 956 "src/parse/scanner_lex.cc"
yy151:
++YYCURSOR;
-#line 336 "../src/parse/scanner_lex.re"
+#line 333 "../src/parse/scanner_lex.re"
{
- yylval.extop.minsize = atoi((char *)tok+1);
- yylval.extop.maxsize = atoi((char *)tok+1);
+ if (!s_to_u32_unsafe (tok + 1, cur - 1, yylval.extop.min))
+ {
+ fatal ("repetition count overflow");
+ }
+ yylval.extop.max = yylval.extop.min;
return CLOSESIZE;
}
#line 968 "src/parse/scanner_lex.cc"
if (yych <= '9') goto yy156;
if (yych != '}') goto yy148;
++YYCURSOR;
-#line 348 "../src/parse/scanner_lex.re"
+#line 355 "../src/parse/scanner_lex.re"
{
- yylval.extop.minsize = atoi((char *)tok+1);
- yylval.extop.maxsize = -1;
+ if (!s_to_u32_unsafe (tok + 1, cur - 2, yylval.extop.min))
+ {
+ fatal ("repetition lower bound overflow");
+ }
+ yylval.extop.max = UINT32_MAX;
return CLOSESIZE;
}
-#line 982 "src/parse/scanner_lex.cc"
+#line 985 "src/parse/scanner_lex.cc"
yy156:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
++YYCURSOR;
#line 342 "../src/parse/scanner_lex.re"
{
- yylval.extop.minsize = atoi((char *)tok+1);
- yylval.extop.maxsize = MAX(yylval.extop.minsize,atoi(strchr((char *)tok, ',')+1));
+ const char * p = strchr (tok, ',');
+ if (!s_to_u32_unsafe (tok + 1, p, yylval.extop.min))
+ {
+ fatal ("repetition lower bound overflow");
+ }
+ if (!s_to_u32_unsafe (p + 1, cur - 1, yylval.extop.max))
+ {
+ fatal ("repetition upper bound overflow");
+ }
return CLOSESIZE;
}
-#line 997 "src/parse/scanner_lex.cc"
+#line 1007 "src/parse/scanner_lex.cc"
yy160:
yyaccept = 6;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= '9') goto yy156;
if (yych != '}') goto yy148;
++YYCURSOR;
-#line 331 "../src/parse/scanner_lex.re"
+#line 328 "../src/parse/scanner_lex.re"
{
yylval.op = '*';
return CLOSE;
}
-#line 1010 "src/parse/scanner_lex.cc"
+#line 1020 "src/parse/scanner_lex.cc"
yy163:
++YYCURSOR;
yy164:
YYCURSOR = YYCTXMARKER;
-#line 391 "../src/parse/scanner_lex.re"
+#line 401 "../src/parse/scanner_lex.re"
{
if (!FFlag) {
yylval.str = new std::string (tok, tok_len ());
return STRING;
}
}
-#line 1034 "src/parse/scanner_lex.cc"
+#line 1044 "src/parse/scanner_lex.cc"
yy165:
yych = (YYCTYPE)*++YYCURSOR;
goto yy184;
++YYCURSOR;
yy167:
YYCURSOR = YYCTXMARKER;
-#line 386 "../src/parse/scanner_lex.re"
+#line 396 "../src/parse/scanner_lex.re"
{
yylval.str = new std::string (tok, tok_len ());
return ID;
}
-#line 1047 "src/parse/scanner_lex.cc"
+#line 1057 "src/parse/scanner_lex.cc"
yy168:
YYCTXMARKER = YYCURSOR + 1;
++YYCURSOR;
}
}
yy176:
-#line 366 "../src/parse/scanner_lex.re"
+#line 376 "../src/parse/scanner_lex.re"
{
tok += 5; /* skip "re2c:" */
lexer_state = LEX_CONFIG;
yylval.str = new std::string (tok, tok_len ());
return CONFIG;
}
-#line 1133 "src/parse/scanner_lex.cc"
+#line 1143 "src/parse/scanner_lex.cc"
yy177:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 'Z') {
yy181:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 373 "../src/parse/scanner_lex.re"
+#line 383 "../src/parse/scanner_lex.re"
{
yylval.str = new std::string (tok, tok_len ());
if (FFlag)
return ID;
}
}
-#line 1205 "src/parse/scanner_lex.cc"
+#line 1215 "src/parse/scanner_lex.cc"
yy183:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
goto yy186;
yy191:
++YYCURSOR;
-#line 302 "../src/parse/scanner_lex.re"
+#line 299 "../src/parse/scanner_lex.re"
{
SubStr s (tok, tok_len ());
yylval.regexp = ranToRE (s);
return RANGE;
}
-#line 1257 "src/parse/scanner_lex.cc"
+#line 1267 "src/parse/scanner_lex.cc"
yy193:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
goto yy188;
yy194:
++YYCURSOR;
-#line 296 "../src/parse/scanner_lex.re"
+#line 293 "../src/parse/scanner_lex.re"
{
SubStr s (tok, tok_len ());
yylval.regexp = invToRE (s);
return RANGE;
}
-#line 1272 "src/parse/scanner_lex.cc"
+#line 1282 "src/parse/scanner_lex.cc"
yy196:
++YYCURSOR;
-#line 315 "../src/parse/scanner_lex.re"
+#line 312 "../src/parse/scanner_lex.re"
{
return SETUP;
}
-#line 1279 "src/parse/scanner_lex.cc"
+#line 1289 "src/parse/scanner_lex.cc"
yy198:
YYCTXMARKER = YYCURSOR + 1;
yych = (YYCTYPE)*++YYCURSOR;
yy201:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 312 "../src/parse/scanner_lex.re"
+#line 309 "../src/parse/scanner_lex.re"
{
return NOCOND;
}
-#line 1313 "src/parse/scanner_lex.cc"
+#line 1323 "src/parse/scanner_lex.cc"
yy203:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '>') goto yy201;
yy205:
++YYCURSOR;
if ((yych = (YYCTYPE)*YYCURSOR) == '>') goto yy207;
-#line 243 "../src/parse/scanner_lex.re"
+#line 240 "../src/parse/scanner_lex.re"
{
tok += 2; /* skip ":=" */
depth = 0;
goto code;
}
-#line 1331 "src/parse/scanner_lex.cc"
+#line 1341 "src/parse/scanner_lex.cc"
yy207:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 239 "../src/parse/scanner_lex.re"
+#line 236 "../src/parse/scanner_lex.re"
{
return *tok;
}
-#line 1339 "src/parse/scanner_lex.cc"
+#line 1349 "src/parse/scanner_lex.cc"
yy209:
++YYCURSOR;
-#line 252 "../src/parse/scanner_lex.re"
+#line 249 "../src/parse/scanner_lex.re"
{
depth = 1;
goto comment;
}
-#line 1347 "src/parse/scanner_lex.cc"
+#line 1357 "src/parse/scanner_lex.cc"
yy211:
++YYCURSOR;
-#line 249 "../src/parse/scanner_lex.re"
+#line 246 "../src/parse/scanner_lex.re"
{
goto nextLine;
}
-#line 1354 "src/parse/scanner_lex.cc"
+#line 1364 "src/parse/scanner_lex.cc"
yy213:
++YYCURSOR;
-#line 258 "../src/parse/scanner_lex.re"
+#line 255 "../src/parse/scanner_lex.re"
{
tok = cur;
return 0;
}
-#line 1362 "src/parse/scanner_lex.cc"
+#line 1372 "src/parse/scanner_lex.cc"
yy215:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
goto yy215;
yy218:
++YYCURSOR;
-#line 276 "../src/parse/scanner_lex.re"
+#line 273 "../src/parse/scanner_lex.re"
{
SubStr s (tok + 1, tok_len () - 2); // -2 to omit quotes
if (bCaseInverted)
}
return STRING;
}
-#line 1393 "src/parse/scanner_lex.cc"
+#line 1403 "src/parse/scanner_lex.cc"
yy220:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
goto yy220;
yy223:
++YYCURSOR;
-#line 263 "../src/parse/scanner_lex.re"
+#line 260 "../src/parse/scanner_lex.re"
{
SubStr s (tok + 1, tok_len () - 2); // -2 to omit quotes
if (bCaseInsensitive || bCaseInverted)
}
return STRING;
}
-#line 1424 "src/parse/scanner_lex.cc"
+#line 1434 "src/parse/scanner_lex.cc"
yy225:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
yy240:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 419 "../src/parse/scanner_lex.re"
+#line 429 "../src/parse/scanner_lex.re"
{
set_sourceline ();
goto scan;
}
-#line 1522 "src/parse/scanner_lex.cc"
+#line 1532 "src/parse/scanner_lex.cc"
yy242:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy240;
if (yych == ' ') goto yy247;
goto yy115;
}
-#line 435 "../src/parse/scanner_lex.re"
+#line 445 "../src/parse/scanner_lex.re"
flex_name:
-#line 1562 "src/parse/scanner_lex.cc"
+#line 1572 "src/parse/scanner_lex.cc"
{
YYCTYPE yych;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
if (yych == '\r') goto yy255;
++YYCURSOR;
yy252:
-#line 446 "../src/parse/scanner_lex.re"
+#line 456 "../src/parse/scanner_lex.re"
{
YYCURSOR = tok;
goto start;
}
-#line 1576 "src/parse/scanner_lex.cc"
+#line 1586 "src/parse/scanner_lex.cc"
yy253:
++YYCURSOR;
yy254:
-#line 440 "../src/parse/scanner_lex.re"
+#line 450 "../src/parse/scanner_lex.re"
{
YYCURSOR = tok;
lexer_state = LEX_NORMAL;
return FID_END;
}
-#line 1586 "src/parse/scanner_lex.cc"
+#line 1596 "src/parse/scanner_lex.cc"
yy255:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != '\n') goto yy252;
yych = (YYCTYPE)*YYCURSOR;
goto yy254;
}
-#line 450 "../src/parse/scanner_lex.re"
+#line 460 "../src/parse/scanner_lex.re"
code:
-#line 1599 "src/parse/scanner_lex.cc"
+#line 1609 "src/parse/scanner_lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
}
yy259:
++YYCURSOR;
-#line 513 "../src/parse/scanner_lex.re"
+#line 523 "../src/parse/scanner_lex.re"
{
if (cur == eof)
{
}
goto code;
}
-#line 1672 "src/parse/scanner_lex.cc"
+#line 1682 "src/parse/scanner_lex.cc"
yy261:
++YYCURSOR;
yy262:
-#line 527 "../src/parse/scanner_lex.re"
+#line 537 "../src/parse/scanner_lex.re"
{
goto code;
}
-#line 1680 "src/parse/scanner_lex.cc"
+#line 1690 "src/parse/scanner_lex.cc"
yy263:
YYCTXMARKER = YYCURSOR + 1;
yyaccept = 0;
}
}
yy264:
-#line 494 "../src/parse/scanner_lex.re"
+#line 504 "../src/parse/scanner_lex.re"
{
if (depth == 0)
{
cline++;
goto code;
}
-#line 1720 "src/parse/scanner_lex.cc"
+#line 1730 "src/parse/scanner_lex.cc"
yy265:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
goto yy272;
yy267:
++YYCURSOR;
-#line 466 "../src/parse/scanner_lex.re"
+#line 476 "../src/parse/scanner_lex.re"
{
if (depth == 0)
{
}
goto code;
}
-#line 1745 "src/parse/scanner_lex.cc"
+#line 1755 "src/parse/scanner_lex.cc"
yy269:
++YYCURSOR;
-#line 454 "../src/parse/scanner_lex.re"
+#line 464 "../src/parse/scanner_lex.re"
{
if (depth == 0)
{
}
goto code;
}
-#line 1761 "src/parse/scanner_lex.cc"
+#line 1771 "src/parse/scanner_lex.cc"
yy271:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
goto yy271;
yy275:
++YYCURSOR;
-#line 524 "../src/parse/scanner_lex.re"
+#line 534 "../src/parse/scanner_lex.re"
{
goto code;
}
-#line 1796 "src/parse/scanner_lex.cc"
+#line 1806 "src/parse/scanner_lex.cc"
yy277:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
}
yy281:
YYCURSOR = YYCTXMARKER;
-#line 481 "../src/parse/scanner_lex.re"
+#line 491 "../src/parse/scanner_lex.re"
{
if (depth == 0)
{
cline++;
goto code;
}
-#line 1837 "src/parse/scanner_lex.cc"
+#line 1847 "src/parse/scanner_lex.cc"
yy282:
yych = (YYCTYPE)*++YYCURSOR;
goto yy281;
yy295:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 477 "../src/parse/scanner_lex.re"
+#line 487 "../src/parse/scanner_lex.re"
{
set_sourceline ();
goto code;
}
-#line 1909 "src/parse/scanner_lex.cc"
+#line 1919 "src/parse/scanner_lex.cc"
yy297:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy295;
goto yy273;
}
}
-#line 530 "../src/parse/scanner_lex.re"
+#line 540 "../src/parse/scanner_lex.re"
comment:
-#line 1953 "src/parse/scanner_lex.cc"
+#line 1963 "src/parse/scanner_lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
}
++YYCURSOR;
yy307:
-#line 562 "../src/parse/scanner_lex.re"
+#line 572 "../src/parse/scanner_lex.re"
{
if (cur == eof)
{
}
goto comment;
}
-#line 2008 "src/parse/scanner_lex.cc"
+#line 2018 "src/parse/scanner_lex.cc"
yy308:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 32) {
}
if (yych == '#') goto yy319;
yy309:
-#line 553 "../src/parse/scanner_lex.re"
+#line 563 "../src/parse/scanner_lex.re"
{
if (cur == eof)
{
cline++;
goto comment;
}
-#line 2026 "src/parse/scanner_lex.cc"
+#line 2036 "src/parse/scanner_lex.cc"
yy310:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '/') goto yy314;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != '*') goto yy307;
++YYCURSOR;
-#line 544 "../src/parse/scanner_lex.re"
+#line 554 "../src/parse/scanner_lex.re"
{
++depth;
fatal("ambiguous /* found");
goto comment;
}
-#line 2041 "src/parse/scanner_lex.cc"
+#line 2051 "src/parse/scanner_lex.cc"
yy314:
++YYCURSOR;
-#line 534 "../src/parse/scanner_lex.re"
+#line 544 "../src/parse/scanner_lex.re"
{
if (--depth == 0)
{
goto comment;
}
}
-#line 2055 "src/parse/scanner_lex.cc"
+#line 2065 "src/parse/scanner_lex.cc"
yy316:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yy331:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 549 "../src/parse/scanner_lex.re"
+#line 559 "../src/parse/scanner_lex.re"
{
set_sourceline ();
goto comment;
}
-#line 2138 "src/parse/scanner_lex.cc"
+#line 2148 "src/parse/scanner_lex.cc"
yy333:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy331;
if (yych == '\r') goto yy333;
goto yy318;
}
-#line 569 "../src/parse/scanner_lex.re"
+#line 579 "../src/parse/scanner_lex.re"
nextLine:
-#line 2168 "src/parse/scanner_lex.cc"
+#line 2178 "src/parse/scanner_lex.cc"
{
YYCTYPE yych;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
if (yych == '\n') goto yy342;
++YYCURSOR;
-#line 580 "../src/parse/scanner_lex.re"
+#line 590 "../src/parse/scanner_lex.re"
{ if(cur == eof) {
return 0;
}
goto nextLine;
}
-#line 2181 "src/parse/scanner_lex.cc"
+#line 2191 "src/parse/scanner_lex.cc"
yy342:
++YYCURSOR;
-#line 573 "../src/parse/scanner_lex.re"
+#line 583 "../src/parse/scanner_lex.re"
{ if(cur == eof) {
return 0;
}
cline++;
goto scan;
}
-#line 2192 "src/parse/scanner_lex.cc"
+#line 2202 "src/parse/scanner_lex.cc"
}
-#line 585 "../src/parse/scanner_lex.re"
+#line 595 "../src/parse/scanner_lex.re"
config:
-#line 2199 "src/parse/scanner_lex.cc"
+#line 2209 "src/parse/scanner_lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
if (yych == '=') goto yy350;
}
++YYCURSOR;
-#line 596 "../src/parse/scanner_lex.re"
+#line 606 "../src/parse/scanner_lex.re"
{
fatal("missing '='");
}
-#line 2249 "src/parse/scanner_lex.cc"
+#line 2259 "src/parse/scanner_lex.cc"
yy348:
++YYCURSOR;
yych = (YYCTYPE)*YYCURSOR;
goto yy355;
yy349:
-#line 589 "../src/parse/scanner_lex.re"
+#line 599 "../src/parse/scanner_lex.re"
{
goto config;
}
-#line 2259 "src/parse/scanner_lex.cc"
+#line 2269 "src/parse/scanner_lex.cc"
yy350:
++YYCURSOR;
yych = (YYCTYPE)*YYCURSOR;
goto yy353;
yy351:
-#line 592 "../src/parse/scanner_lex.re"
+#line 602 "../src/parse/scanner_lex.re"
{
lexer_state = LEX_CONFIG_VALUE;
return '=';
}
-#line 2270 "src/parse/scanner_lex.cc"
+#line 2280 "src/parse/scanner_lex.cc"
yy352:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
if (yych == ' ') goto yy354;
goto yy349;
}
-#line 599 "../src/parse/scanner_lex.re"
+#line 609 "../src/parse/scanner_lex.re"
value:
-#line 2294 "src/parse/scanner_lex.cc"
+#line 2304 "src/parse/scanner_lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
}
}
yy358:
-#line 608 "../src/parse/scanner_lex.re"
+#line 621 "../src/parse/scanner_lex.re"
{
yylval.str = new std::string (tok, tok_len ());
lexer_state = LEX_NORMAL;
return VALUE;
}
-#line 2367 "src/parse/scanner_lex.cc"
+#line 2377 "src/parse/scanner_lex.cc"
yy359:
++YYCURSOR;
if (yybm[0+(yych = (YYCTYPE)*YYCURSOR)] & 8) {
goto yy364;
}
yy360:
-#line 603 "../src/parse/scanner_lex.re"
+#line 613 "../src/parse/scanner_lex.re"
{
- yylval.number = atoi(std::string (tok, tok_len ()).c_str());
+ if (!s_to_i32_unsafe (tok, cur, yylval.number))
+ {
+ fatal ("configuration value overflow");
+ }
lexer_state = LEX_NORMAL;
return NUMBER;
}
-#line 2380 "src/parse/scanner_lex.cc"
+#line 2393 "src/parse/scanner_lex.cc"
yy361:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '0') goto yy365;
if (yych == '\n') goto yy372;
goto yy376;
}
-#line 613 "../src/parse/scanner_lex.re"
+#line 626 "../src/parse/scanner_lex.re"
}
sourceline:
tok = cur;
-#line 2546 "src/parse/scanner_lex.cc"
+#line 2559 "src/parse/scanner_lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
yy382:
++YYCURSOR;
yy383:
-#line 655 "../src/parse/scanner_lex.re"
+#line 671 "../src/parse/scanner_lex.re"
{
goto sourceline;
}
-#line 2599 "src/parse/scanner_lex.cc"
+#line 2612 "src/parse/scanner_lex.cc"
yy384:
++YYCURSOR;
-#line 643 "../src/parse/scanner_lex.re"
+#line 659 "../src/parse/scanner_lex.re"
{
if (cur == eof)
{
tok = cur;
return;
}
-#line 2615 "src/parse/scanner_lex.cc"
+#line 2628 "src/parse/scanner_lex.cc"
yy386:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == '\n') goto yy383;
yych = (YYCTYPE)*YYCURSOR;
goto yy390;
yy388:
-#line 635 "../src/parse/scanner_lex.re"
+#line 648 "../src/parse/scanner_lex.re"
{
- cline = atoi(std::string (tok, tok_len ()).c_str());
+ if (!s_to_u32_unsafe (tok, cur, cline))
+ {
+ fatal ("line number overflow");
+ }
goto sourceline;
}
-#line 2630 "src/parse/scanner_lex.cc"
+#line 2646 "src/parse/scanner_lex.cc"
yy389:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
goto yy391;
yy395:
++YYCURSOR;
-#line 639 "../src/parse/scanner_lex.re"
+#line 655 "../src/parse/scanner_lex.re"
{
escape (in.file_name, std::string (tok + 1, tok_len () - 2)); // -2 to omit quotes
goto sourceline;
}
-#line 2667 "src/parse/scanner_lex.cc"
+#line 2683 "src/parse/scanner_lex.cc"
}
-#line 658 "../src/parse/scanner_lex.re"
+#line 674 "../src/parse/scanner_lex.re"
}