src/codegen/bitmap.h \
src/codegen/emit.h \
src/codegen/go.h \
- src/codegen/indent.h \
src/codegen/input_api.h \
src/codegen/label.h \
src/codegen/output.h \
-/* Generated by re2c 0.16 on Tue Oct 11 14:06:51 2016 */
+/* Generated by re2c 0.16 on Sun Dec 18 11:56:11 2016 */
#line 1 "../src/parse/lex.re"
#include "src/util/c99_stdint.h"
#include <stddef.h>
#include <string>
#include "src/codegen/output.h"
-#include "src/conf/opt.h"
#include "src/conf/warn.h"
#include "src/globals.h"
#include "src/ir/regexp/encoding/enc.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 41 "../src/parse/lex.re"
+#line 40 "../src/parse/lex.re"
-#line 62 "../src/parse/lex.re"
+#line 61 "../src/parse/lex.re"
Scanner::ParseMode Scanner::echo()
const char *start = cur;
-#line 60 "src/parse/lex.cc"
+#line 59 "src/parse/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
}
}
++YYCURSOR;
-#line 153 "../src/parse/lex.re"
+#line 152 "../src/parse/lex.re"
{
if (cur == eof) {
if (opts->target == opt_t::CODE) {
}
goto echo;
}
-#line 128 "src/parse/lex.cc"
+#line 127 "src/parse/lex.cc"
yy4:
++YYCURSOR;
yy5:
-#line 174 "../src/parse/lex.re"
+#line 173 "../src/parse/lex.re"
{ goto echo; }
-#line 134 "src/parse/lex.cc"
+#line 133 "src/parse/lex.cc"
yy6:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
}
if (yych == '#') goto yy14;
yy7:
-#line 168 "../src/parse/lex.re"
+#line 167 "../src/parse/lex.re"
{
cline++;
pos = cur;
goto echo;
}
-#line 149 "src/parse/lex.cc"
+#line 148 "src/parse/lex.cc"
yy8:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy6;
}
yy16:
++YYCURSOR;
-#line 76 "../src/parse/lex.re"
+#line 75 "../src/parse/lex.re"
{
if (opts->rFlag) {
fatal("found standard 're2c' block while using -r flag");
}
return Parse;
}
-#line 202 "src/parse/lex.cc"
+#line 201 "src/parse/lex.cc"
yy18:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '!') goto yy20;
yy66:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 163 "../src/parse/lex.re"
+#line 162 "../src/parse/lex.re"
{
set_sourceline();
goto echo;
}
-#line 435 "src/parse/lex.cc"
+#line 434 "src/parse/lex.cc"
yy68:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy66;
goto yy13;
yy89:
++YYCURSOR;
-#line 116 "../src/parse/lex.re"
+#line 115 "../src/parse/lex.re"
{
if (opts->target == opt_t::CODE) {
out.wraw(tok, start)
lex_end_of_comment();
goto echo;
}
-#line 536 "src/parse/lex.cc"
+#line 535 "src/parse/lex.cc"
yy91:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '2') goto yy98;
goto yy13;
yy94:
++YYCURSOR;
-#line 97 "../src/parse/lex.re"
+#line 96 "../src/parse/lex.re"
{
if (!opts->rFlag) {
fatal("found 'use:re2c' block without -r flag");
reuse();
return Reuse;
}
-#line 562 "src/parse/lex.cc"
+#line 561 "src/parse/lex.cc"
yy96:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy102;
goto yy13;
yy99:
++YYCURSOR;
-#line 145 "../src/parse/lex.re"
+#line 144 "../src/parse/lex.re"
{
if (opts->target == opt_t::CODE) {
out.wraw(tok, start);
lex_tags();
goto echo;
}
-#line 585 "src/parse/lex.cc"
+#line 584 "src/parse/lex.cc"
yy101:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'c') goto yy106;
goto yy13;
yy104:
++YYCURSOR;
-#line 86 "../src/parse/lex.re"
+#line 85 "../src/parse/lex.re"
{
if (!opts->rFlag) {
fatal("found 'rules:re2c' block without -r flag");
opts.reset_mapCodeName ();
return Rules;
}
-#line 611 "src/parse/lex.cc"
+#line 610 "src/parse/lex.cc"
yy106:
++YYCURSOR;
-#line 134 "../src/parse/lex.re"
+#line 133 "../src/parse/lex.re"
{
if (opts->target == opt_t::CODE) {
out.wraw(tok, start)
lex_end_of_comment();
goto echo;
}
-#line 625 "src/parse/lex.cc"
+#line 624 "src/parse/lex.cc"
yy108:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '2') goto yy111;
goto yy13;
yy109:
++YYCURSOR;
-#line 108 "../src/parse/lex.re"
+#line 107 "../src/parse/lex.re"
{
if (opts->target == opt_t::CODE) {
out.wraw(tok, start);
lex_end_of_comment();
goto echo;
}
-#line 640 "src/parse/lex.cc"
+#line 639 "src/parse/lex.cc"
yy111:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'c') goto yy13;
++YYCURSOR;
-#line 125 "../src/parse/lex.re"
+#line 124 "../src/parse/lex.re"
{
if (opts->target == opt_t::CODE) {
out.wraw(tok, start)
lex_end_of_comment();
goto echo;
}
-#line 654 "src/parse/lex.cc"
+#line 653 "src/parse/lex.cc"
}
-#line 175 "../src/parse/lex.re"
+#line 174 "../src/parse/lex.re"
}
{
uint32_t ignored = 0;
for (;;) {
-#line 664 "src/parse/lex.cc"
+#line 663 "src/parse/lex.cc"
{
YYCTYPE yych;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
}
yy116:
++YYCURSOR;
-#line 182 "../src/parse/lex.re"
+#line 181 "../src/parse/lex.re"
{ fatal("expected end of block"); }
-#line 682 "src/parse/lex.cc"
+#line 681 "src/parse/lex.cc"
yy118:
++YYCURSOR;
yy119:
-#line 184 "../src/parse/lex.re"
+#line 183 "../src/parse/lex.re"
{ continue; }
-#line 688 "src/parse/lex.cc"
+#line 687 "src/parse/lex.cc"
yy120:
++YYCURSOR;
-#line 185 "../src/parse/lex.re"
+#line 184 "../src/parse/lex.re"
{ ++ignored; continue; }
-#line 693 "src/parse/lex.cc"
+#line 692 "src/parse/lex.cc"
yy122:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy120;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != '/') goto yy119;
++YYCURSOR;
-#line 186 "../src/parse/lex.re"
+#line 185 "../src/parse/lex.re"
{
if (ignored > 0) {
cline += ignored;
tok = pos = cur;
return;
}
-#line 711 "src/parse/lex.cc"
+#line 710 "src/parse/lex.cc"
}
-#line 194 "../src/parse/lex.re"
+#line 193 "../src/parse/lex.re"
}
}
{
std::string fmt, sep;
for (;;) {
-#line 721 "src/parse/lex.cc"
+#line 720 "src/parse/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
}
++YYCURSOR;
yy129:
-#line 201 "../src/parse/lex.re"
+#line 200 "../src/parse/lex.re"
{ fatal("unrecognized configuration"); }
-#line 781 "src/parse/lex.cc"
+#line 780 "src/parse/lex.cc"
yy130:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
if (yybm[0+yych] & 128) {
goto yy130;
}
-#line 206 "../src/parse/lex.re"
+#line 205 "../src/parse/lex.re"
{ continue; }
-#line 791 "src/parse/lex.cc"
+#line 790 "src/parse/lex.cc"
yy133:
++YYCURSOR;
-#line 207 "../src/parse/lex.re"
+#line 206 "../src/parse/lex.re"
{ ++cline; continue; }
-#line 796 "src/parse/lex.cc"
+#line 795 "src/parse/lex.cc"
yy135:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy133;
goto yy129;
yy139:
++YYCURSOR;
-#line 208 "../src/parse/lex.re"
+#line 207 "../src/parse/lex.re"
{
if (opts->target == opt_t::CODE) {
out.wdelay_tags(opts->topIndent,
tok = pos = cur;
return;
}
-#line 824 "src/parse/lex.cc"
+#line 823 "src/parse/lex.cc"
yy141:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'r') goto yy144;
goto yy142;
yy150:
++YYCURSOR;
-#line 203 "../src/parse/lex.re"
+#line 202 "../src/parse/lex.re"
{ fmt = lex_conf_string(); continue; }
-#line 863 "src/parse/lex.cc"
+#line 862 "src/parse/lex.cc"
yy152:
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 't') goto yy142;
yych = (YYCTYPE)*++YYCURSOR;
if (yych != 'r') goto yy142;
++YYCURSOR;
-#line 204 "../src/parse/lex.re"
+#line 203 "../src/parse/lex.re"
{ sep = lex_conf_string(); continue; }
-#line 874 "src/parse/lex.cc"
+#line 873 "src/parse/lex.cc"
}
-#line 216 "../src/parse/lex.re"
+#line 215 "../src/parse/lex.re"
}
}
start:
-#line 896 "src/parse/lex.cc"
+#line 895 "src/parse/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
};
- if ((YYLIMIT - YYCURSOR) < 6) YYFILL(6);
+ if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
yych = (YYCTYPE)*YYCURSOR;
if (yybm[0+yych] & 16) {
goto yy161;
} else {
if (yych <= '\\') {
if (yych <= '>') {
- if (yych <= ':') goto yy182;
- if (yych == '<') goto yy183;
+ if (yych <= ':') goto yy183;
+ if (yych == '<') goto yy184;
goto yy172;
} else {
if (yych <= '@') {
if (yych <= '?') goto yy176;
- goto yy184;
+ goto yy185;
} else {
if (yych <= 'Z') goto yy181;
- if (yych <= '[') goto yy185;
+ if (yych <= '[') goto yy186;
goto yy172;
}
}
if (yych >= 'a') goto yy181;
} else {
if (yych <= 'z') {
- if (yych <= 'r') goto yy187;
+ if (yych <= 'r') goto yy188;
goto yy181;
} else {
- if (yych <= '{') goto yy188;
+ if (yych <= '{') goto yy189;
if (yych <= '|') goto yy172;
}
}
yy159:
++YYCURSOR;
yy160:
-#line 398 "../src/parse/lex.re"
+#line 397 "../src/parse/lex.re"
{
fatalf("unexpected character: '%c'", *tok);
goto scan;
}
-#line 1007 "src/parse/lex.cc"
+#line 1006 "src/parse/lex.cc"
yy161:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
if (yybm[0+yych] & 16) {
goto yy161;
}
-#line 382 "../src/parse/lex.re"
+#line 381 "../src/parse/lex.re"
{
goto scan;
}
-#line 1019 "src/parse/lex.cc"
+#line 1018 "src/parse/lex.cc"
yy164:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= 0x1F) {
- if (yych == '\t') goto yy190;
+ if (yych == '\t') goto yy191;
} else {
- if (yych <= ' ') goto yy190;
- if (yych == '#') goto yy193;
+ if (yych <= ' ') goto yy191;
+ if (yych == '#') goto yy194;
}
yy165:
-#line 391 "../src/parse/lex.re"
+#line 390 "../src/parse/lex.re"
{
if (cur == eof) return 0;
pos = cur;
cline++;
goto scan;
}
-#line 1037 "src/parse/lex.cc"
+#line 1036 "src/parse/lex.cc"
yy166:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '\n') goto yy164;
goto yy160;
yy167:
++YYCURSOR;
-#line 265 "../src/parse/lex.re"
+#line 264 "../src/parse/lex.re"
{ yylval.regexp = lex_str('"', opts->bCaseInsensitive || opts->bCaseInverted); return TOKEN_REGEXP; }
-#line 1046 "src/parse/lex.cc"
+#line 1045 "src/parse/lex.cc"
yy169:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == '}') goto yy195;
+ if (yych == '}') goto yy196;
goto yy160;
yy170:
++YYCURSOR;
-#line 264 "../src/parse/lex.re"
+#line 263 "../src/parse/lex.re"
{ yylval.regexp = lex_str('\'', opts->bCaseInsensitive || !opts->bCaseInverted); return TOKEN_REGEXP; }
-#line 1055 "src/parse/lex.cc"
+#line 1054 "src/parse/lex.cc"
yy172:
++YYCURSOR;
yy173:
-#line 285 "../src/parse/lex.re"
+#line 284 "../src/parse/lex.re"
{
return *tok;
}
-#line 1063 "src/parse/lex.cc"
+#line 1062 "src/parse/lex.cc"
yy174:
- ++YYCURSOR;
- if ((yych = (YYCTYPE)*YYCURSOR) == '/') goto yy195;
-#line 289 "../src/parse/lex.re"
+ yych = (YYCTYPE)*++YYCURSOR;
+ if (yych == '/') goto yy196;
+#line 288 "../src/parse/lex.re"
{
yylval.op = *tok;
return TOKEN_STAR;
}
-#line 1072 "src/parse/lex.cc"
+#line 1071 "src/parse/lex.cc"
yy176:
++YYCURSOR;
-#line 293 "../src/parse/lex.re"
+#line 292 "../src/parse/lex.re"
{
yylval.op = *tok;
return TOKEN_CLOSE;
}
-#line 1080 "src/parse/lex.cc"
+#line 1079 "src/parse/lex.cc"
yy178:
++YYCURSOR;
-#line 377 "../src/parse/lex.re"
+#line 376 "../src/parse/lex.re"
{
yylval.regexp = mkDot();
return TOKEN_REGEXP;
}
-#line 1088 "src/parse/lex.cc"
+#line 1087 "src/parse/lex.cc"
yy180:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == '*') goto yy197;
- if (yych == '/') goto yy199;
+ if (yych == '*') goto yy198;
+ if (yych == '/') goto yy200;
goto yy173;
yy181:
- yych = (YYCTYPE)*++YYCURSOR;
- goto yy207;
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = (YYCTYPE)*YYCURSOR;
yy182:
+ if (yybm[0+yych] & 32) {
+ goto yy181;
+ }
+ if (yych <= ' ') {
+ if (yych == '\t') {
+ YYCTXMARKER = YYCURSOR;
+ goto yy204;
+ }
+ if (yych <= 0x1F) goto yy202;
+ YYCTXMARKER = YYCURSOR;
+ goto yy204;
+ } else {
+ if (yych <= ',') {
+ if (yych <= '+') goto yy202;
+ YYCTXMARKER = YYCURSOR;
+ goto yy206;
+ } else {
+ if (yych <= '<') goto yy202;
+ if (yych <= '>') {
+ YYCTXMARKER = YYCURSOR;
+ goto yy206;
+ }
+ goto yy202;
+ }
+ }
+yy183:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == '=') goto yy208;
goto yy160;
-yy183:
+yy184:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych == '!') goto yy210;
if (yych == '>') goto yy212;
goto yy173;
-yy184:
+yy185:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= 'Z') {
if (yych <= '/') goto yy160;
goto yy160;
}
}
-yy185:
- ++YYCURSOR;
- if ((yych = (YYCTYPE)*YYCURSOR) == '^') goto yy216;
-#line 266 "../src/parse/lex.re"
+yy186:
+ yych = (YYCTYPE)*++YYCURSOR;
+ if (yych == '^') goto yy216;
+#line 265 "../src/parse/lex.re"
{ yylval.regexp = lex_cls(false); return TOKEN_REGEXP; }
-#line 1129 "src/parse/lex.cc"
-yy187:
+#line 1155 "src/parse/lex.cc"
+yy188:
yych = (YYCTYPE)*++YYCURSOR;
if (yych == 'e') goto yy218;
- goto yy207;
-yy188:
+ goto yy182;
+yy189:
yyaccept = 2;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 64) {
if (yych <= '_') {
if (yych >= '_') goto yy223;
} else {
- if (yych <= '`') goto yy189;
+ if (yych <= '`') goto yy190;
if (yych <= 'z') goto yy223;
}
}
-yy189:
-#line 235 "../src/parse/lex.re"
+yy190:
+#line 234 "../src/parse/lex.re"
{
depth = 1;
goto code;
}
-#line 1157 "src/parse/lex.cc"
-yy190:
+#line 1183 "src/parse/lex.cc"
+yy191:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
if (yych <= 0x1F) {
- if (yych == '\t') goto yy190;
+ if (yych == '\t') goto yy191;
} else {
- if (yych <= ' ') goto yy190;
- if (yych == '#') goto yy193;
+ if (yych <= ' ') goto yy191;
+ if (yych == '#') goto yy194;
}
-yy192:
+yy193:
YYCURSOR = YYMARKER;
if (yyaccept <= 1) {
if (yyaccept == 0) {
}
} else {
if (yyaccept == 2) {
- goto yy189;
+ goto yy190;
} else {
goto yy220;
}
}
-yy193:
+yy194:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
yych = (YYCTYPE)*YYCURSOR;
if (yych <= 0x1F) {
- if (yych == '\t') goto yy193;
- goto yy192;
+ if (yych == '\t') goto yy194;
+ goto yy193;
} else {
- if (yych <= ' ') goto yy193;
+ if (yych <= ' ') goto yy194;
if (yych == 'l') goto yy225;
- goto yy192;
+ goto yy193;
}
-yy195:
+yy196:
++YYCURSOR;
-#line 259 "../src/parse/lex.re"
+#line 258 "../src/parse/lex.re"
{
tok = cur;
return 0;
}
-#line 1202 "src/parse/lex.cc"
-yy197:
+#line 1228 "src/parse/lex.cc"
+yy198:
++YYCURSOR;
-#line 253 "../src/parse/lex.re"
+#line 252 "../src/parse/lex.re"
{
depth = 1;
goto comment;
}
-#line 1210 "src/parse/lex.cc"
-yy199:
+#line 1236 "src/parse/lex.cc"
+yy200:
++YYCURSOR;
-#line 250 "../src/parse/lex.re"
+#line 249 "../src/parse/lex.re"
{
goto nextLine;
}
-#line 1217 "src/parse/lex.cc"
-yy201:
+#line 1243 "src/parse/lex.cc"
+yy202:
++YYCURSOR;
YYCURSOR -= 1;
-#line 361 "../src/parse/lex.re"
+#line 360 "../src/parse/lex.re"
{
if (!opts->FFlag) {
yylval.str = new std::string (tok, tok_len());
return TOKEN_REGEXP;
}
}
-#line 1237 "src/parse/lex.cc"
-yy203:
- yych = (YYCTYPE)*++YYCURSOR;
- goto yy229;
+#line 1263 "src/parse/lex.cc"
yy204:
++YYCURSOR;
- YYCURSOR = YYCTXMARKER;
-#line 356 "../src/parse/lex.re"
- {
- yylval.str = new std::string (tok, tok_len ());
- return TOKEN_ID;
- }
-#line 1249 "src/parse/lex.cc"
-yy206:
- ++YYCURSOR;
- if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
-yy207:
- if (yybm[0+yych] & 32) {
- goto yy206;
- }
if (yych <= ' ') {
- if (yych == '\t') {
- YYCTXMARKER = YYCURSOR;
- goto yy203;
- }
- if (yych <= 0x1F) goto yy201;
- YYCTXMARKER = YYCURSOR;
- goto yy203;
+ if (yych == '\t') goto yy204;
+ if (yych <= 0x1F) goto yy226;
+ goto yy204;
} else {
if (yych <= ',') {
- if (yych <= '+') goto yy201;
- YYCTXMARKER = YYCURSOR;
- goto yy204;
+ if (yych <= '+') goto yy226;
} else {
- if (yych <= '<') goto yy201;
- if (yych <= '>') {
- YYCTXMARKER = YYCURSOR;
- goto yy204;
- }
- goto yy201;
+ if (yych <= '<') goto yy226;
+ if (yych >= '?') goto yy226;
}
}
-yy208:
+yy206:
++YYCURSOR;
- if ((yych = (YYCTYPE)*YYCURSOR) == '>') goto yy230;
-#line 244 "../src/parse/lex.re"
+ YYCURSOR = YYCTXMARKER;
+#line 355 "../src/parse/lex.re"
+ {
+ yylval.str = new std::string (tok, tok_len ());
+ return TOKEN_ID;
+ }
+#line 1288 "src/parse/lex.cc"
+yy208:
+ yych = (YYCTYPE)*++YYCURSOR;
+ if (yych == '>') goto yy228;
+#line 243 "../src/parse/lex.re"
{
tok += 2; /* skip ":=" */
depth = 0;
goto code;
}
-#line 1289 "src/parse/lex.cc"
+#line 1298 "src/parse/lex.cc"
yy210:
++YYCURSOR;
-#line 272 "../src/parse/lex.re"
+#line 271 "../src/parse/lex.re"
{
return TOKEN_SETUP;
}
-#line 1296 "src/parse/lex.cc"
+#line 1305 "src/parse/lex.cc"
yy212:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '9') {
if (yych <= '\t') {
- if (yych <= 0x08) goto yy192;
+ if (yych <= 0x08) goto yy193;
YYCTXMARKER = YYCURSOR;
- goto yy232;
+ goto yy230;
} else {
if (yych == ' ') {
YYCTXMARKER = YYCURSOR;
- goto yy232;
+ goto yy230;
}
- goto yy192;
+ goto yy193;
}
} else {
if (yych <= '=') {
if (yych <= ':') {
YYCTXMARKER = YYCURSOR;
- goto yy234;
+ goto yy232;
}
- if (yych <= '<') goto yy192;
+ if (yych <= '<') goto yy193;
YYCTXMARKER = YYCURSOR;
- goto yy235;
+ goto yy233;
} else {
if (yych == '{') {
YYCTXMARKER = YYCURSOR;
- goto yy236;
+ goto yy234;
}
- goto yy192;
+ goto yy193;
}
}
yy213:
}
}
yy215:
-#line 276 "../src/parse/lex.re"
+#line 275 "../src/parse/lex.re"
{
if (!opts->tags) {
fatal("tags are only allowed with '-T, --tags' option");
yylval.regexp = RegExp::make_tag(name);
return TOKEN_REGEXP;
}
-#line 1354 "src/parse/lex.cc"
+#line 1363 "src/parse/lex.cc"
yy216:
++YYCURSOR;
-#line 267 "../src/parse/lex.re"
+#line 266 "../src/parse/lex.re"
{ yylval.regexp = lex_cls(true); return TOKEN_REGEXP; }
-#line 1359 "src/parse/lex.cc"
+#line 1368 "src/parse/lex.cc"
yy218:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == '2') goto yy238;
- goto yy207;
+ if (yych == '2') goto yy236;
+ goto yy182;
yy219:
++YYCURSOR;
yy220:
-#line 329 "../src/parse/lex.re"
+#line 328 "../src/parse/lex.re"
{
fatal("illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers");
}
-#line 1371 "src/parse/lex.cc"
+#line 1380 "src/parse/lex.cc"
yy221:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
}
if (yych <= '^') {
if (yych <= ',') {
- if (yych <= '+') goto yy192;
- goto yy239;
+ if (yych <= '+') goto yy193;
+ goto yy237;
} else {
- if (yych <= '@') goto yy192;
- if (yych >= '[') goto yy192;
+ if (yych <= '@') goto yy193;
+ if (yych >= '[') goto yy193;
}
} else {
if (yych <= 'z') {
- if (yych == '`') goto yy192;
+ if (yych == '`') goto yy193;
} else {
- if (yych == '}') goto yy240;
- goto yy192;
+ if (yych == '}') goto yy238;
+ goto yy193;
}
}
yy223:
yych = (YYCTYPE)*YYCURSOR;
if (yych <= '^') {
if (yych <= '9') {
- if (yych <= '/') goto yy192;
+ if (yych <= '/') goto yy193;
goto yy223;
} else {
- if (yych <= '@') goto yy192;
+ if (yych <= '@') goto yy193;
if (yych <= 'Z') goto yy223;
- goto yy192;
+ goto yy193;
}
} else {
if (yych <= 'z') {
- if (yych == '`') goto yy192;
+ if (yych == '`') goto yy193;
goto yy223;
} else {
- if (yych == '}') goto yy242;
- goto yy192;
+ if (yych == '}') goto yy240;
+ goto yy193;
}
}
yy225:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == 'i') goto yy244;
- goto yy192;
+ if (yych == 'i') goto yy242;
+ goto yy193;
yy226:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 343 "../src/parse/lex.re"
+#line 342 "../src/parse/lex.re"
{
yylval.str = new std::string (tok, tok_len ());
if (opts->FFlag)
return TOKEN_ID;
}
}
-#line 1437 "src/parse/lex.cc"
+#line 1446 "src/parse/lex.cc"
yy228:
- ++YYCURSOR;
- if (YYLIMIT <= YYCURSOR) YYFILL(1);
- yych = (YYCTYPE)*YYCURSOR;
-yy229:
- if (yych <= ' ') {
- if (yych == '\t') goto yy228;
- if (yych <= 0x1F) goto yy226;
- goto yy228;
- } else {
- if (yych <= ',') {
- if (yych <= '+') goto yy226;
- goto yy204;
- } else {
- if (yych <= '<') goto yy226;
- if (yych <= '>') goto yy204;
- goto yy226;
- }
- }
-yy230:
++YYCURSOR;
YYCURSOR -= 2;
-#line 240 "../src/parse/lex.re"
+#line 239 "../src/parse/lex.re"
{
return *tok;
}
-#line 1464 "src/parse/lex.cc"
-yy232:
+#line 1454 "src/parse/lex.cc"
+yy230:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = (YYCTYPE)*YYCURSOR;
if (yych <= '9') {
if (yych <= '\t') {
- if (yych <= 0x08) goto yy192;
- goto yy232;
+ if (yych <= 0x08) goto yy193;
+ goto yy230;
} else {
- if (yych == ' ') goto yy232;
- goto yy192;
+ if (yych == ' ') goto yy230;
+ goto yy193;
}
} else {
if (yych <= '=') {
- if (yych <= ':') goto yy234;
- if (yych <= '<') goto yy192;
- goto yy235;
+ if (yych <= ':') goto yy232;
+ if (yych <= '<') goto yy193;
+ goto yy233;
} else {
- if (yych == '{') goto yy236;
- goto yy192;
+ if (yych == '{') goto yy234;
+ goto yy193;
}
}
-yy234:
+yy232:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == '=') goto yy236;
- goto yy192;
-yy235:
+ if (yych == '=') goto yy234;
+ goto yy193;
+yy233:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych != '>') goto yy192;
-yy236:
+ if (yych != '>') goto yy193;
+yy234:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 269 "../src/parse/lex.re"
+#line 268 "../src/parse/lex.re"
{
return TOKEN_NOCOND;
}
-#line 1501 "src/parse/lex.cc"
-yy238:
+#line 1491 "src/parse/lex.cc"
+yy236:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == 'c') goto yy245;
- goto yy207;
-yy239:
+ if (yych == 'c') goto yy243;
+ goto yy182;
+yy237:
yyaccept = 3;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= '/') goto yy220;
- if (yych <= '9') goto yy246;
- if (yych == '}') goto yy248;
+ if (yych <= '9') goto yy244;
+ if (yych == '}') goto yy246;
goto yy220;
-yy240:
+yy238:
++YYCURSOR;
-#line 298 "../src/parse/lex.re"
+#line 297 "../src/parse/lex.re"
{
if (!s_to_u32_unsafe (tok + 1, cur - 1, yylval.extop.min))
{
yylval.extop.max = yylval.extop.min;
return TOKEN_CLOSESIZE;
}
-#line 1524 "src/parse/lex.cc"
-yy242:
+#line 1514 "src/parse/lex.cc"
+yy240:
++YYCURSOR;
-#line 333 "../src/parse/lex.re"
+#line 332 "../src/parse/lex.re"
{
if (!opts->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 TOKEN_ID;
}
-#line 1535 "src/parse/lex.cc"
-yy244:
+#line 1525 "src/parse/lex.cc"
+yy242:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == 'n') goto yy250;
- goto yy192;
-yy245:
+ if (yych == 'n') goto yy248;
+ goto yy193;
+yy243:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == ':') goto yy251;
- goto yy207;
-yy246:
+ if (yych == ':') goto yy249;
+ goto yy182;
+yy244:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
- if (yych <= '/') goto yy192;
- if (yych <= '9') goto yy246;
- if (yych == '}') goto yy253;
- goto yy192;
-yy248:
+ if (yych <= '/') goto yy193;
+ if (yych <= '9') goto yy244;
+ if (yych == '}') goto yy251;
+ goto yy193;
+yy246:
++YYCURSOR;
-#line 320 "../src/parse/lex.re"
+#line 319 "../src/parse/lex.re"
{
if (!s_to_u32_unsafe (tok + 1, cur - 2, yylval.extop.min))
{
yylval.extop.max = std::numeric_limits<uint32_t>::max();
return TOKEN_CLOSESIZE;
}
-#line 1563 "src/parse/lex.cc"
-yy250:
+#line 1553 "src/parse/lex.cc"
+yy248:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == 'e') goto yy255;
- goto yy192;
-yy251:
+ if (yych == 'e') goto yy253;
+ goto yy193;
+yy249:
++YYCURSOR;
-#line 341 "../src/parse/lex.re"
+#line 340 "../src/parse/lex.re"
{ lex_conf (); return TOKEN_CONF; }
-#line 1572 "src/parse/lex.cc"
-yy253:
+#line 1562 "src/parse/lex.cc"
+yy251:
++YYCURSOR;
-#line 307 "../src/parse/lex.re"
+#line 306 "../src/parse/lex.re"
{
const char * p = strchr (tok, ',');
if (!s_to_u32_unsafe (tok + 1, p, yylval.extop.min))
}
return TOKEN_CLOSESIZE;
}
-#line 1588 "src/parse/lex.cc"
-yy255:
+#line 1578 "src/parse/lex.cc"
+yy253:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych <= '0') goto yy257;
- if (yych <= '9') goto yy192;
- goto yy257;
-yy256:
+ if (yych <= '0') goto yy255;
+ if (yych <= '9') goto yy193;
+ goto yy255;
+yy254:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
-yy257:
+yy255:
if (yych <= 0x1F) {
- if (yych == '\t') goto yy256;
- goto yy192;
+ if (yych == '\t') goto yy254;
+ goto yy193;
} else {
- if (yych <= ' ') goto yy256;
- if (yych <= '0') goto yy192;
- if (yych >= ':') goto yy192;
+ if (yych <= ' ') goto yy254;
+ if (yych <= '0') goto yy193;
+ if (yych >= ':') goto yy193;
YYCTXMARKER = YYCURSOR;
}
-yy258:
+yy256:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = (YYCTYPE)*YYCURSOR;
if (yych <= '\r') {
if (yych <= '\t') {
- if (yych <= 0x08) goto yy192;
+ if (yych <= 0x08) goto yy193;
} else {
- if (yych <= '\n') goto yy262;
- if (yych <= '\f') goto yy192;
- goto yy264;
+ if (yych <= '\n') goto yy260;
+ if (yych <= '\f') goto yy193;
+ goto yy262;
}
} else {
if (yych <= ' ') {
- if (yych <= 0x1F) goto yy192;
+ if (yych <= 0x1F) goto yy193;
} else {
- if (yych <= '/') goto yy192;
- if (yych <= '9') goto yy258;
- goto yy192;
+ if (yych <= '/') goto yy193;
+ if (yych <= '9') goto yy256;
+ goto yy193;
}
}
-yy260:
+yy258:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
if (yych <= 0x1F) {
- if (yych == '\t') goto yy260;
- goto yy192;
+ if (yych == '\t') goto yy258;
+ goto yy193;
} else {
- if (yych <= ' ') goto yy260;
- if (yych == '"') goto yy265;
- goto yy192;
+ if (yych <= ' ') goto yy258;
+ if (yych == '"') goto yy263;
+ goto yy193;
}
-yy262:
+yy260:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 386 "../src/parse/lex.re"
+#line 385 "../src/parse/lex.re"
{
set_sourceline ();
goto scan;
}
-#line 1649 "src/parse/lex.cc"
-yy264:
+#line 1639 "src/parse/lex.cc"
+yy262:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == '\n') goto yy262;
- goto yy192;
-yy265:
+ if (yych == '\n') goto yy260;
+ goto yy193;
+yy263:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
yych = (YYCTYPE)*YYCURSOR;
if (yybm[0+yych] & 128) {
- goto yy265;
+ goto yy263;
}
- if (yych <= '\n') goto yy192;
- if (yych >= '#') goto yy268;
+ if (yych <= '\n') goto yy193;
+ if (yych >= '#') goto yy266;
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == '\n') goto yy262;
- if (yych == '\r') goto yy264;
- goto yy192;
-yy268:
+ if (yych == '\n') goto yy260;
+ if (yych == '\r') goto yy262;
+ goto yy193;
+yy266:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
- if (yych == '\n') goto yy192;
- goto yy265;
+ if (yych == '\n') goto yy193;
+ goto yy263;
}
-#line 402 "../src/parse/lex.re"
+#line 401 "../src/parse/lex.re"
flex_name:
-#line 1679 "src/parse/lex.cc"
+#line 1669 "src/parse/lex.cc"
{
YYCTYPE yych;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = (YYCTYPE)*YYCURSOR;
- if (yych == '\n') goto yy273;
- if (yych == '\r') goto yy275;
+ if (yych == '\n') goto yy271;
+ if (yych == '\r') goto yy273;
++YYCURSOR;
-yy272:
-#line 413 "../src/parse/lex.re"
+yy270:
+#line 412 "../src/parse/lex.re"
{
YYCURSOR = tok;
goto start;
}
-#line 1693 "src/parse/lex.cc"
-yy273:
+#line 1683 "src/parse/lex.cc"
+yy271:
++YYCURSOR;
-#line 407 "../src/parse/lex.re"
+#line 406 "../src/parse/lex.re"
{
YYCURSOR = tok;
lexer_state = LEX_NORMAL;
return TOKEN_FID_END;
}
-#line 1702 "src/parse/lex.cc"
-yy275:
- ++YYCURSOR;
- if ((yych = (YYCTYPE)*YYCURSOR) == '\n') goto yy273;
- goto yy272;
+#line 1692 "src/parse/lex.cc"
+yy273:
+ yych = (YYCTYPE)*++YYCURSOR;
+ if (yych == '\n') goto yy271;
+ goto yy270;
}
-#line 417 "../src/parse/lex.re"
+#line 416 "../src/parse/lex.re"
code:
-#line 1713 "src/parse/lex.cc"
+#line 1703 "src/parse/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
yych = (YYCTYPE)*YYCURSOR;
if (yych <= '&') {
if (yych <= '\n') {
- if (yych <= 0x00) goto yy278;
- if (yych <= '\t') goto yy280;
- goto yy282;
- } else {
- if (yych == '"') goto yy284;
+ if (yych <= 0x00) goto yy276;
+ if (yych <= '\t') goto yy278;
goto yy280;
+ } else {
+ if (yych == '"') goto yy282;
+ goto yy278;
}
} else {
if (yych <= '{') {
- if (yych <= '\'') goto yy285;
- if (yych <= 'z') goto yy280;
- goto yy286;
+ if (yych <= '\'') goto yy283;
+ if (yych <= 'z') goto yy278;
+ goto yy284;
} else {
- if (yych == '}') goto yy288;
- goto yy280;
+ if (yych == '}') goto yy286;
+ goto yy278;
}
}
-yy278:
+yy276:
++YYCURSOR;
-#line 480 "../src/parse/lex.re"
+#line 479 "../src/parse/lex.re"
{
if (cur == eof)
{
}
goto code;
}
-#line 1786 "src/parse/lex.cc"
-yy280:
+#line 1776 "src/parse/lex.cc"
+yy278:
++YYCURSOR;
-yy281:
-#line 494 "../src/parse/lex.re"
+yy279:
+#line 493 "../src/parse/lex.re"
{
goto code;
}
-#line 1794 "src/parse/lex.cc"
-yy282:
+#line 1784 "src/parse/lex.cc"
+yy280:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= '\r') {
if (yych <= '\t') {
- if (yych >= '\t') goto yy290;
+ if (yych >= '\t') goto yy288;
} else {
- if (yych <= '\n') goto yy292;
- if (yych >= '\r') goto yy292;
+ if (yych <= '\n') goto yy290;
+ if (yych >= '\r') goto yy290;
}
} else {
if (yych <= ' ') {
- if (yych >= ' ') goto yy290;
+ if (yych >= ' ') goto yy288;
} else {
- if (yych == '#') goto yy293;
+ if (yych == '#') goto yy291;
}
}
-yy283:
-#line 461 "../src/parse/lex.re"
+yy281:
+#line 460 "../src/parse/lex.re"
{
if (depth == 0)
{
cline++;
goto code;
}
-#line 1833 "src/parse/lex.cc"
-yy284:
+#line 1823 "src/parse/lex.cc"
+yy282:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
- if (yych == '\n') goto yy281;
- goto yy297;
-yy285:
+ if (yych == '\n') goto yy279;
+ goto yy295;
+yy283:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
- if (yych == '\n') goto yy281;
- goto yy302;
-yy286:
+ if (yych == '\n') goto yy279;
+ goto yy300;
+yy284:
++YYCURSOR;
-#line 433 "../src/parse/lex.re"
+#line 432 "../src/parse/lex.re"
{
if (depth == 0)
{
}
goto code;
}
-#line 1858 "src/parse/lex.cc"
-yy288:
+#line 1848 "src/parse/lex.cc"
+yy286:
++YYCURSOR;
-#line 421 "../src/parse/lex.re"
+#line 420 "../src/parse/lex.re"
{
if (depth == 0)
{
}
goto code;
}
-#line 1874 "src/parse/lex.cc"
-yy290:
+#line 1864 "src/parse/lex.cc"
+yy288:
yyaccept = 2;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= 0x1F) {
- if (yych == '\t') goto yy304;
+ if (yych == '\t') goto yy302;
} else {
- if (yych <= ' ') goto yy304;
- if (yych == '#') goto yy293;
+ if (yych <= ' ') goto yy302;
+ if (yych == '#') goto yy291;
}
-yy291:
+yy289:
YYCURSOR -= 1;
-#line 448 "../src/parse/lex.re"
+#line 447 "../src/parse/lex.re"
{
if (depth == 0)
{
cline++;
goto code;
}
-#line 1900 "src/parse/lex.cc"
-yy292:
- yych = (YYCTYPE)*++YYCURSOR;
- goto yy291;
-yy293:
+#line 1890 "src/parse/lex.cc"
+yy290:
+ ++YYCURSOR;
+ goto yy289;
+yy291:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
yych = (YYCTYPE)*YYCURSOR;
if (yybm[0+yych] & 16) {
- goto yy293;
+ goto yy291;
}
- if (yych == 'l') goto yy306;
-yy295:
+ if (yych == 'l') goto yy304;
+yy293:
YYCURSOR = YYMARKER;
if (yyaccept <= 1) {
if (yyaccept == 0) {
- goto yy283;
- } else {
goto yy281;
+ } else {
+ goto yy279;
}
} else {
- goto yy291;
+ goto yy289;
}
-yy296:
+yy294:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
-yy297:
+yy295:
if (yybm[0+yych] & 32) {
- goto yy296;
+ goto yy294;
}
- if (yych <= '\n') goto yy295;
- if (yych >= '#') goto yy300;
-yy298:
+ if (yych <= '\n') goto yy293;
+ if (yych >= '#') goto yy298;
+yy296:
++YYCURSOR;
-#line 491 "../src/parse/lex.re"
+#line 490 "../src/parse/lex.re"
{
goto code;
}
-#line 1939 "src/parse/lex.cc"
-yy300:
+#line 1929 "src/parse/lex.cc"
+yy298:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
- if (yych == '\n') goto yy295;
- goto yy296;
-yy301:
+ if (yych == '\n') goto yy293;
+ goto yy294;
+yy299:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
-yy302:
+yy300:
if (yybm[0+yych] & 64) {
- goto yy301;
+ goto yy299;
}
- if (yych <= '\n') goto yy295;
- if (yych <= '\'') goto yy298;
+ if (yych <= '\n') goto yy293;
+ if (yych <= '\'') goto yy296;
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
- if (yych == '\n') goto yy295;
- goto yy301;
-yy304:
+ if (yych == '\n') goto yy293;
+ goto yy299;
+yy302:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
if (yych <= 0x1F) {
- if (yych == '\t') goto yy304;
- goto yy295;
+ if (yych == '\t') goto yy302;
+ goto yy293;
} else {
- if (yych <= ' ') goto yy304;
- if (yych == '#') goto yy293;
- goto yy295;
+ if (yych <= ' ') goto yy302;
+ if (yych == '#') goto yy291;
+ goto yy293;
}
-yy306:
+yy304:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych != 'i') goto yy295;
+ if (yych != 'i') goto yy293;
yych = (YYCTYPE)*++YYCURSOR;
- if (yych != 'n') goto yy295;
+ if (yych != 'n') goto yy293;
yych = (YYCTYPE)*++YYCURSOR;
- if (yych != 'e') goto yy295;
+ if (yych != 'e') goto yy293;
yych = (YYCTYPE)*++YYCURSOR;
- if (yych <= '0') goto yy311;
- if (yych <= '9') goto yy295;
- goto yy311;
-yy310:
+ if (yych <= '0') goto yy309;
+ if (yych <= '9') goto yy293;
+ goto yy309;
+yy308:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
-yy311:
+yy309:
if (yych <= 0x1F) {
- if (yych == '\t') goto yy310;
- goto yy295;
+ if (yych == '\t') goto yy308;
+ goto yy293;
} else {
- if (yych <= ' ') goto yy310;
- if (yych <= '0') goto yy295;
- if (yych >= ':') goto yy295;
+ if (yych <= ' ') goto yy308;
+ if (yych <= '0') goto yy293;
+ if (yych >= ':') goto yy293;
YYCTXMARKER = YYCURSOR;
}
-yy312:
+yy310:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = (YYCTYPE)*YYCURSOR;
if (yybm[0+yych] & 128) {
- goto yy312;
+ goto yy310;
}
if (yych <= '\f') {
- if (yych <= 0x08) goto yy295;
- if (yych <= '\t') goto yy314;
- if (yych <= '\n') goto yy316;
- goto yy295;
+ if (yych <= 0x08) goto yy293;
+ if (yych <= '\t') goto yy312;
+ if (yych <= '\n') goto yy314;
+ goto yy293;
} else {
- if (yych <= '\r') goto yy318;
- if (yych != ' ') goto yy295;
+ if (yych <= '\r') goto yy316;
+ if (yych != ' ') goto yy293;
}
-yy314:
+yy312:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
if (yych <= 0x1F) {
- if (yych == '\t') goto yy314;
- goto yy295;
+ if (yych == '\t') goto yy312;
+ goto yy293;
} else {
- if (yych <= ' ') goto yy314;
- if (yych == '"') goto yy319;
- goto yy295;
+ if (yych <= ' ') goto yy312;
+ if (yych == '"') goto yy317;
+ goto yy293;
}
-yy316:
+yy314:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 444 "../src/parse/lex.re"
+#line 443 "../src/parse/lex.re"
{
set_sourceline ();
goto code;
}
-#line 2034 "src/parse/lex.cc"
-yy318:
+#line 2024 "src/parse/lex.cc"
+yy316:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == '\n') goto yy316;
- goto yy295;
-yy319:
+ if (yych == '\n') goto yy314;
+ goto yy293;
+yy317:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
yych = (YYCTYPE)*YYCURSOR;
if (yych <= '!') {
- if (yych == '\n') goto yy295;
- goto yy319;
+ if (yych == '\n') goto yy293;
+ goto yy317;
} else {
- if (yych <= '"') goto yy321;
- if (yych == '\\') goto yy322;
- goto yy319;
+ if (yych <= '"') goto yy319;
+ if (yych == '\\') goto yy320;
+ goto yy317;
}
-yy321:
+yy319:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == '\n') goto yy316;
- if (yych == '\r') goto yy318;
- goto yy295;
-yy322:
+ if (yych == '\n') goto yy314;
+ if (yych == '\r') goto yy316;
+ goto yy293;
+yy320:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
- if (yych == '\n') goto yy295;
- goto yy319;
+ if (yych == '\n') goto yy293;
+ goto yy317;
}
-#line 497 "../src/parse/lex.re"
+#line 496 "../src/parse/lex.re"
comment:
-#line 2068 "src/parse/lex.cc"
+#line 2058 "src/parse/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = (YYCTYPE)*YYCURSOR;
if (yych <= ')') {
- if (yych == '\n') goto yy327;
+ if (yych == '\n') goto yy325;
} else {
- if (yych <= '*') goto yy329;
- if (yych == '/') goto yy330;
+ if (yych <= '*') goto yy327;
+ if (yych == '/') goto yy328;
}
++YYCURSOR;
-yy326:
-#line 529 "../src/parse/lex.re"
+yy324:
+#line 528 "../src/parse/lex.re"
{
if (cur == eof)
{
}
goto comment;
}
-#line 2123 "src/parse/lex.cc"
-yy327:
+#line 2113 "src/parse/lex.cc"
+yy325:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yybm[0+yych] & 32) {
- goto yy331;
+ goto yy329;
}
- if (yych == '#') goto yy334;
-yy328:
-#line 520 "../src/parse/lex.re"
+ if (yych == '#') goto yy332;
+yy326:
+#line 519 "../src/parse/lex.re"
{
if (cur == eof)
{
cline++;
goto comment;
}
-#line 2141 "src/parse/lex.cc"
-yy329:
+#line 2131 "src/parse/lex.cc"
+yy327:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == '/') goto yy336;
- goto yy326;
-yy330:
+ if (yych == '/') goto yy334;
+ goto yy324;
+yy328:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == '*') goto yy338;
- goto yy326;
-yy331:
+ if (yych == '*') goto yy336;
+ goto yy324;
+yy329:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
if (yybm[0+yych] & 32) {
- goto yy331;
+ goto yy329;
}
- if (yych == '#') goto yy334;
-yy333:
+ if (yych == '#') goto yy332;
+yy331:
YYCURSOR = YYMARKER;
- goto yy328;
-yy334:
+ goto yy326;
+yy332:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5);
yych = (YYCTYPE)*YYCURSOR;
if (yych <= 0x1F) {
- if (yych == '\t') goto yy334;
- goto yy333;
+ if (yych == '\t') goto yy332;
+ goto yy331;
} else {
- if (yych <= ' ') goto yy334;
- if (yych == 'l') goto yy340;
- goto yy333;
+ if (yych <= ' ') goto yy332;
+ if (yych == 'l') goto yy338;
+ goto yy331;
}
-yy336:
+yy334:
++YYCURSOR;
-#line 501 "../src/parse/lex.re"
+#line 500 "../src/parse/lex.re"
{
if (--depth == 0)
{
goto comment;
}
}
-#line 2186 "src/parse/lex.cc"
-yy338:
+#line 2176 "src/parse/lex.cc"
+yy336:
++YYCURSOR;
-#line 511 "../src/parse/lex.re"
+#line 510 "../src/parse/lex.re"
{
++depth;
fatal("ambiguous /* found");
goto comment;
}
-#line 2195 "src/parse/lex.cc"
-yy340:
+#line 2185 "src/parse/lex.cc"
+yy338:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych != 'i') goto yy333;
+ if (yych != 'i') goto yy331;
yych = (YYCTYPE)*++YYCURSOR;
- if (yych != 'n') goto yy333;
+ if (yych != 'n') goto yy331;
yych = (YYCTYPE)*++YYCURSOR;
- if (yych != 'e') goto yy333;
+ if (yych != 'e') goto yy331;
yych = (YYCTYPE)*++YYCURSOR;
- if (yych <= '0') goto yy345;
- if (yych <= '9') goto yy333;
- goto yy345;
-yy344:
+ if (yych <= '0') goto yy343;
+ if (yych <= '9') goto yy331;
+ goto yy343;
+yy342:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
-yy345:
+yy343:
if (yych <= 0x1F) {
- if (yych == '\t') goto yy344;
- goto yy333;
+ if (yych == '\t') goto yy342;
+ goto yy331;
} else {
- if (yych <= ' ') goto yy344;
- if (yych <= '0') goto yy333;
- if (yych >= ':') goto yy333;
+ if (yych <= ' ') goto yy342;
+ if (yych <= '0') goto yy331;
+ if (yych >= ':') goto yy331;
YYCTXMARKER = YYCURSOR;
}
-yy346:
+yy344:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = (YYCTYPE)*YYCURSOR;
if (yybm[0+yych] & 64) {
- goto yy346;
+ goto yy344;
}
if (yych <= '\f') {
- if (yych <= 0x08) goto yy333;
- if (yych <= '\t') goto yy348;
- if (yych <= '\n') goto yy350;
- goto yy333;
+ if (yych <= 0x08) goto yy331;
+ if (yych <= '\t') goto yy346;
+ if (yych <= '\n') goto yy348;
+ goto yy331;
} else {
- if (yych <= '\r') goto yy352;
- if (yych != ' ') goto yy333;
+ if (yych <= '\r') goto yy350;
+ if (yych != ' ') goto yy331;
}
-yy348:
+yy346:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
if (yych <= 0x1F) {
- if (yych == '\t') goto yy348;
- goto yy333;
+ if (yych == '\t') goto yy346;
+ goto yy331;
} else {
- if (yych <= ' ') goto yy348;
- if (yych == '"') goto yy353;
- goto yy333;
+ if (yych <= ' ') goto yy346;
+ if (yych == '"') goto yy351;
+ goto yy331;
}
-yy350:
+yy348:
++YYCURSOR;
YYCURSOR = YYCTXMARKER;
-#line 516 "../src/parse/lex.re"
+#line 515 "../src/parse/lex.re"
{
set_sourceline ();
goto comment;
}
-#line 2257 "src/parse/lex.cc"
-yy352:
+#line 2247 "src/parse/lex.cc"
+yy350:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == '\n') goto yy350;
- goto yy333;
-yy353:
+ if (yych == '\n') goto yy348;
+ goto yy331;
+yy351:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
yych = (YYCTYPE)*YYCURSOR;
if (yybm[0+yych] & 128) {
- goto yy353;
+ goto yy351;
}
- if (yych <= '\n') goto yy333;
- if (yych >= '#') goto yy356;
+ if (yych <= '\n') goto yy331;
+ if (yych >= '#') goto yy354;
yych = (YYCTYPE)*++YYCURSOR;
- if (yych == '\n') goto yy350;
- if (yych == '\r') goto yy352;
- goto yy333;
-yy356:
+ if (yych == '\n') goto yy348;
+ if (yych == '\r') goto yy350;
+ goto yy331;
+yy354:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
- if (yych == '\n') goto yy333;
- goto yy353;
+ if (yych == '\n') goto yy331;
+ goto yy351;
}
-#line 536 "../src/parse/lex.re"
+#line 535 "../src/parse/lex.re"
nextLine:
-#line 2287 "src/parse/lex.cc"
+#line 2277 "src/parse/lex.cc"
{
YYCTYPE yych;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
- if (yych == '\n') goto yy361;
+ if (yych == '\n') goto yy359;
++YYCURSOR;
-#line 547 "../src/parse/lex.re"
+#line 546 "../src/parse/lex.re"
{ if(cur == eof) {
return 0;
}
goto nextLine;
}
-#line 2300 "src/parse/lex.cc"
-yy361:
+#line 2290 "src/parse/lex.cc"
+yy359:
++YYCURSOR;
-#line 540 "../src/parse/lex.re"
+#line 539 "../src/parse/lex.re"
{ if(cur == eof) {
return 0;
}
cline++;
goto scan;
}
-#line 2311 "src/parse/lex.cc"
+#line 2301 "src/parse/lex.cc"
}
-#line 552 "../src/parse/lex.re"
+#line 551 "../src/parse/lex.re"
}
uint32_t u, l;
fst:
-#line 2337 "src/parse/lex.cc"
+#line 2327 "src/parse/lex.cc"
{
YYCTYPE yych;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
- if (yych == ']') goto yy366;
-#line 576 "../src/parse/lex.re"
+ if (yych == ']') goto yy364;
+#line 575 "../src/parse/lex.re"
{ l = lex_cls_chr(); goto snd; }
-#line 2345 "src/parse/lex.cc"
-yy366:
+#line 2335 "src/parse/lex.cc"
+yy364:
++YYCURSOR;
-#line 575 "../src/parse/lex.re"
+#line 574 "../src/parse/lex.re"
{ goto end; }
-#line 2350 "src/parse/lex.cc"
+#line 2340 "src/parse/lex.cc"
}
-#line 577 "../src/parse/lex.re"
+#line 576 "../src/parse/lex.re"
snd:
-#line 2356 "src/parse/lex.cc"
+#line 2346 "src/parse/lex.cc"
{
YYCTYPE yych;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = (YYCTYPE)*(YYMARKER = YYCURSOR);
- if (yych == '-') goto yy371;
-yy370:
-#line 580 "../src/parse/lex.re"
+ if (yych == '-') goto yy369;
+yy368:
+#line 579 "../src/parse/lex.re"
{ u = l; goto add; }
-#line 2365 "src/parse/lex.cc"
-yy371:
+#line 2355 "src/parse/lex.cc"
+yy369:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych != ']') goto yy373;
+ if (yych != ']') goto yy371;
YYCURSOR = YYMARKER;
- goto yy370;
-yy373:
+ goto yy368;
+yy371:
++YYCURSOR;
YYCURSOR -= 1;
-#line 581 "../src/parse/lex.re"
+#line 580 "../src/parse/lex.re"
{
u = lex_cls_chr();
if (l > u) {
}
goto add;
}
-#line 2383 "src/parse/lex.cc"
+#line 2373 "src/parse/lex.cc"
}
-#line 589 "../src/parse/lex.re"
+#line 588 "../src/parse/lex.re"
add:
if (!(s = opts->encoding.encodeRange(l, u))) {
{
tok = cur;
-#line 2404 "src/parse/lex.cc"
+#line 2394 "src/parse/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
if ((YYLIMIT - YYCURSOR) < 10) YYFILL(10);
yych = (YYCTYPE)*YYCURSOR;
- if (yych == '\n') goto yy379;
- if (yych == '\\') goto yy381;
+ if (yych == '\n') goto yy377;
+ if (yych == '\\') goto yy379;
++YYCURSOR;
-#line 612 "../src/parse/lex.re"
+#line 611 "../src/parse/lex.re"
{ return static_cast<uint8_t>(tok[0]); }
-#line 2415 "src/parse/lex.cc"
-yy379:
+#line 2405 "src/parse/lex.cc"
+yy377:
++YYCURSOR;
-#line 607 "../src/parse/lex.re"
+#line 606 "../src/parse/lex.re"
{ fatal ((tok - pos) - tchar, "syntax error"); }
-#line 2420 "src/parse/lex.cc"
-yy381:
- ++YYCURSOR;
- if ((yych = (YYCTYPE)*YYCURSOR) <= '`') {
+#line 2410 "src/parse/lex.cc"
+yy379:
+ yych = (YYCTYPE)*++YYCURSOR;
+ if (yych <= '`') {
if (yych <= '7') {
if (yych <= ',') {
- if (yych != '\n') goto yy383;
+ if (yych != '\n') goto yy381;
} else {
- if (yych <= '-') goto yy385;
- if (yych <= '/') goto yy383;
- if (yych <= '3') goto yy387;
- goto yy389;
+ if (yych <= '-') goto yy383;
+ if (yych <= '/') goto yy381;
+ if (yych <= '3') goto yy385;
+ goto yy387;
}
} else {
if (yych <= 'X') {
- if (yych == 'U') goto yy390;
- if (yych <= 'W') goto yy383;
- goto yy392;
+ if (yych == 'U') goto yy388;
+ if (yych <= 'W') goto yy381;
+ goto yy390;
} else {
- if (yych <= '[') goto yy383;
- if (yych <= '\\') goto yy393;
- if (yych <= ']') goto yy395;
- goto yy383;
+ if (yych <= '[') goto yy381;
+ if (yych <= '\\') goto yy391;
+ if (yych <= ']') goto yy393;
+ goto yy381;
}
}
} else {
if (yych <= 'q') {
if (yych <= 'e') {
- if (yych <= 'a') goto yy397;
- if (yych <= 'b') goto yy399;
- goto yy383;
+ if (yych <= 'a') goto yy395;
+ if (yych <= 'b') goto yy397;
+ goto yy381;
} else {
- if (yych <= 'f') goto yy401;
- if (yych == 'n') goto yy403;
- goto yy383;
+ if (yych <= 'f') goto yy399;
+ if (yych == 'n') goto yy401;
+ goto yy381;
}
} else {
if (yych <= 'u') {
- if (yych <= 'r') goto yy405;
- if (yych <= 's') goto yy383;
- if (yych <= 't') goto yy407;
- goto yy392;
+ if (yych <= 'r') goto yy403;
+ if (yych <= 's') goto yy381;
+ if (yych <= 't') goto yy405;
+ goto yy390;
} else {
- if (yych <= 'v') goto yy409;
- if (yych == 'x') goto yy411;
- goto yy383;
+ if (yych <= 'v') goto yy407;
+ if (yych == 'x') goto yy409;
+ goto yy381;
}
}
}
-#line 610 "../src/parse/lex.re"
+#line 609 "../src/parse/lex.re"
{ fatal ((tok - pos) - tchar, "syntax error in escape sequence"); }
-#line 2471 "src/parse/lex.cc"
-yy383:
+#line 2461 "src/parse/lex.cc"
+yy381:
++YYCURSOR;
-#line 625 "../src/parse/lex.re"
+#line 624 "../src/parse/lex.re"
{
warn.useless_escape(tline, tok - pos, tok[1]);
return static_cast<uint8_t>(tok[1]);
}
-#line 2479 "src/parse/lex.cc"
-yy385:
+#line 2469 "src/parse/lex.cc"
+yy383:
++YYCURSOR;
-#line 623 "../src/parse/lex.re"
+#line 622 "../src/parse/lex.re"
{ return static_cast<uint8_t>('-'); }
-#line 2484 "src/parse/lex.cc"
-yy387:
+#line 2474 "src/parse/lex.cc"
+yy385:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
- if (yych <= '/') goto yy388;
- if (yych <= '7') goto yy412;
-yy388:
-#line 609 "../src/parse/lex.re"
+ if (yych <= '/') goto yy386;
+ if (yych <= '7') goto yy410;
+yy386:
+#line 608 "../src/parse/lex.re"
{ fatal ((tok - pos) - tchar, "syntax error in octal escape sequence"); }
-#line 2493 "src/parse/lex.cc"
-yy389:
- yych = (YYCTYPE)*++YYCURSOR;
- goto yy388;
-yy390:
+#line 2483 "src/parse/lex.cc"
+yy387:
+ ++YYCURSOR;
+ goto yy386;
+yy388:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= '@') {
- if (yych <= '/') goto yy391;
- if (yych <= '9') goto yy414;
+ if (yych <= '/') goto yy389;
+ if (yych <= '9') goto yy412;
} else {
- if (yych <= 'F') goto yy414;
- if (yych <= '`') goto yy391;
- if (yych <= 'f') goto yy414;
+ if (yych <= 'F') goto yy412;
+ if (yych <= '`') goto yy389;
+ if (yych <= 'f') goto yy412;
}
-yy391:
-#line 608 "../src/parse/lex.re"
+yy389:
+#line 607 "../src/parse/lex.re"
{ fatal ((tok - pos) - tchar, "syntax error in hexadecimal escape sequence"); }
-#line 2511 "src/parse/lex.cc"
-yy392:
+#line 2501 "src/parse/lex.cc"
+yy390:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= '@') {
- if (yych <= '/') goto yy391;
- if (yych <= '9') goto yy415;
- goto yy391;
+ if (yych <= '/') goto yy389;
+ if (yych <= '9') goto yy413;
+ goto yy389;
} else {
- if (yych <= 'F') goto yy415;
- if (yych <= '`') goto yy391;
- if (yych <= 'f') goto yy415;
- goto yy391;
+ if (yych <= 'F') goto yy413;
+ if (yych <= '`') goto yy389;
+ if (yych <= 'f') goto yy413;
+ goto yy389;
}
-yy393:
+yy391:
++YYCURSOR;
-#line 622 "../src/parse/lex.re"
+#line 621 "../src/parse/lex.re"
{ return static_cast<uint8_t>('\\'); }
-#line 2529 "src/parse/lex.cc"
-yy395:
+#line 2519 "src/parse/lex.cc"
+yy393:
++YYCURSOR;
-#line 624 "../src/parse/lex.re"
+#line 623 "../src/parse/lex.re"
{ return static_cast<uint8_t>(']'); }
-#line 2534 "src/parse/lex.cc"
+#line 2524 "src/parse/lex.cc"
+yy395:
+ ++YYCURSOR;
+#line 614 "../src/parse/lex.re"
+ { return static_cast<uint8_t>('\a'); }
+#line 2529 "src/parse/lex.cc"
yy397:
++YYCURSOR;
#line 615 "../src/parse/lex.re"
- { return static_cast<uint8_t>('\a'); }
-#line 2539 "src/parse/lex.cc"
+ { return static_cast<uint8_t>('\b'); }
+#line 2534 "src/parse/lex.cc"
yy399:
++YYCURSOR;
#line 616 "../src/parse/lex.re"
- { return static_cast<uint8_t>('\b'); }
-#line 2544 "src/parse/lex.cc"
+ { return static_cast<uint8_t>('\f'); }
+#line 2539 "src/parse/lex.cc"
yy401:
++YYCURSOR;
#line 617 "../src/parse/lex.re"
- { return static_cast<uint8_t>('\f'); }
-#line 2549 "src/parse/lex.cc"
+ { return static_cast<uint8_t>('\n'); }
+#line 2544 "src/parse/lex.cc"
yy403:
++YYCURSOR;
#line 618 "../src/parse/lex.re"
- { return static_cast<uint8_t>('\n'); }
-#line 2554 "src/parse/lex.cc"
+ { return static_cast<uint8_t>('\r'); }
+#line 2549 "src/parse/lex.cc"
yy405:
++YYCURSOR;
#line 619 "../src/parse/lex.re"
- { return static_cast<uint8_t>('\r'); }
-#line 2559 "src/parse/lex.cc"
+ { return static_cast<uint8_t>('\t'); }
+#line 2554 "src/parse/lex.cc"
yy407:
++YYCURSOR;
#line 620 "../src/parse/lex.re"
- { return static_cast<uint8_t>('\t'); }
-#line 2564 "src/parse/lex.cc"
-yy409:
- ++YYCURSOR;
-#line 621 "../src/parse/lex.re"
{ return static_cast<uint8_t>('\v'); }
-#line 2569 "src/parse/lex.cc"
-yy411:
+#line 2559 "src/parse/lex.cc"
+yy409:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= '@') {
- if (yych <= '/') goto yy391;
- if (yych <= '9') goto yy416;
- goto yy391;
+ if (yych <= '/') goto yy389;
+ if (yych <= '9') goto yy414;
+ goto yy389;
} else {
- if (yych <= 'F') goto yy416;
- if (yych <= '`') goto yy391;
- if (yych <= 'f') goto yy416;
- goto yy391;
+ if (yych <= 'F') goto yy414;
+ if (yych <= '`') goto yy389;
+ if (yych <= 'f') goto yy414;
+ goto yy389;
}
-yy412:
+yy410:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych <= '/') goto yy413;
- if (yych <= '7') goto yy417;
-yy413:
+ if (yych <= '/') goto yy411;
+ if (yych <= '7') goto yy415;
+yy411:
YYCURSOR = YYMARKER;
if (yyaccept == 0) {
- goto yy388;
+ goto yy386;
} else {
- goto yy391;
+ goto yy389;
}
-yy414:
+yy412:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
- if (yych <= '/') goto yy413;
- if (yych <= '9') goto yy419;
- goto yy413;
+ if (yych <= '/') goto yy411;
+ if (yych <= '9') goto yy417;
+ goto yy411;
} else {
- if (yych <= 'F') goto yy419;
- if (yych <= '`') goto yy413;
- if (yych <= 'f') goto yy419;
- goto yy413;
+ if (yych <= 'F') goto yy417;
+ if (yych <= '`') goto yy411;
+ if (yych <= 'f') goto yy417;
+ goto yy411;
}
-yy415:
+yy413:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
- if (yych <= '/') goto yy413;
- if (yych <= '9') goto yy420;
- goto yy413;
+ if (yych <= '/') goto yy411;
+ if (yych <= '9') goto yy418;
+ goto yy411;
} else {
- if (yych <= 'F') goto yy420;
- if (yych <= '`') goto yy413;
- if (yych <= 'f') goto yy420;
- goto yy413;
+ if (yych <= 'F') goto yy418;
+ if (yych <= '`') goto yy411;
+ if (yych <= 'f') goto yy418;
+ goto yy411;
}
-yy416:
+yy414:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
- if (yych <= '/') goto yy413;
- if (yych <= '9') goto yy421;
- goto yy413;
+ if (yych <= '/') goto yy411;
+ if (yych <= '9') goto yy419;
+ goto yy411;
} else {
- if (yych <= 'F') goto yy421;
- if (yych <= '`') goto yy413;
- if (yych <= 'f') goto yy421;
- goto yy413;
+ if (yych <= 'F') goto yy419;
+ if (yych <= '`') goto yy411;
+ if (yych <= 'f') goto yy419;
+ goto yy411;
}
-yy417:
+yy415:
++YYCURSOR;
-#line 614 "../src/parse/lex.re"
+#line 613 "../src/parse/lex.re"
{ return unesc_oct(tok, cur); }
-#line 2634 "src/parse/lex.cc"
-yy419:
+#line 2624 "src/parse/lex.cc"
+yy417:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
- if (yych <= '/') goto yy413;
- if (yych <= '9') goto yy423;
- goto yy413;
+ if (yych <= '/') goto yy411;
+ if (yych <= '9') goto yy421;
+ goto yy411;
} else {
- if (yych <= 'F') goto yy423;
- if (yych <= '`') goto yy413;
- if (yych <= 'f') goto yy423;
- goto yy413;
+ if (yych <= 'F') goto yy421;
+ if (yych <= '`') goto yy411;
+ if (yych <= 'f') goto yy421;
+ goto yy411;
}
-yy420:
+yy418:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
- if (yych <= '/') goto yy413;
- if (yych <= '9') goto yy416;
- goto yy413;
+ if (yych <= '/') goto yy411;
+ if (yych <= '9') goto yy414;
+ goto yy411;
} else {
- if (yych <= 'F') goto yy416;
- if (yych <= '`') goto yy413;
- if (yych <= 'f') goto yy416;
- goto yy413;
+ if (yych <= 'F') goto yy414;
+ if (yych <= '`') goto yy411;
+ if (yych <= 'f') goto yy414;
+ goto yy411;
}
-yy421:
+yy419:
++YYCURSOR;
-#line 613 "../src/parse/lex.re"
+#line 612 "../src/parse/lex.re"
{ return unesc_hex(tok, cur); }
-#line 2663 "src/parse/lex.cc"
-yy423:
+#line 2653 "src/parse/lex.cc"
+yy421:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
- if (yych <= '/') goto yy413;
- if (yych >= ':') goto yy413;
+ if (yych <= '/') goto yy411;
+ if (yych >= ':') goto yy411;
} else {
- if (yych <= 'F') goto yy424;
- if (yych <= '`') goto yy413;
- if (yych >= 'g') goto yy413;
+ if (yych <= 'F') goto yy422;
+ if (yych <= '`') goto yy411;
+ if (yych >= 'g') goto yy411;
}
-yy424:
- ++YYCURSOR;
- if ((yych = (YYCTYPE)*YYCURSOR) <= '@') {
- if (yych <= '/') goto yy413;
- if (yych <= '9') goto yy415;
- goto yy413;
+yy422:
+ yych = (YYCTYPE)*++YYCURSOR;
+ if (yych <= '@') {
+ if (yych <= '/') goto yy411;
+ if (yych <= '9') goto yy413;
+ goto yy411;
} else {
- if (yych <= 'F') goto yy415;
- if (yych <= '`') goto yy413;
- if (yych <= 'f') goto yy415;
- goto yy413;
+ if (yych <= 'F') goto yy413;
+ if (yych <= '`') goto yy411;
+ if (yych <= 'f') goto yy413;
+ goto yy411;
}
}
-#line 629 "../src/parse/lex.re"
+#line 628 "../src/parse/lex.re"
}
end = false;
tok = cur;
-#line 2696 "src/parse/lex.cc"
+#line 2686 "src/parse/lex.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
if ((YYLIMIT - YYCURSOR) < 10) YYFILL(10);
yych = (YYCTYPE)*YYCURSOR;
- if (yych == '\n') goto yy429;
- if (yych == '\\') goto yy431;
+ if (yych == '\n') goto yy427;
+ if (yych == '\\') goto yy429;
++YYCURSOR;
-#line 642 "../src/parse/lex.re"
+#line 641 "../src/parse/lex.re"
{
end = tok[0] == quote;
return static_cast<uint8_t>(tok[0]);
}
-#line 2710 "src/parse/lex.cc"
-yy429:
+#line 2700 "src/parse/lex.cc"
+yy427:
++YYCURSOR;
-#line 637 "../src/parse/lex.re"
+#line 636 "../src/parse/lex.re"
{ fatal ((tok - pos) - tchar, "syntax error"); }
-#line 2715 "src/parse/lex.cc"
-yy431:
- ++YYCURSOR;
- if ((yych = (YYCTYPE)*YYCURSOR) <= 'a') {
+#line 2705 "src/parse/lex.cc"
+yy429:
+ yych = (YYCTYPE)*++YYCURSOR;
+ if (yych <= 'a') {
if (yych <= 'T') {
if (yych <= '/') {
- if (yych != '\n') goto yy433;
+ if (yych != '\n') goto yy431;
} else {
- if (yych <= '3') goto yy435;
- if (yych <= '7') goto yy437;
- goto yy433;
+ if (yych <= '3') goto yy433;
+ if (yych <= '7') goto yy435;
+ goto yy431;
}
} else {
if (yych <= 'X') {
- if (yych <= 'U') goto yy438;
- if (yych <= 'W') goto yy433;
- goto yy440;
+ if (yych <= 'U') goto yy436;
+ if (yych <= 'W') goto yy431;
+ goto yy438;
} else {
- if (yych == '\\') goto yy441;
- if (yych <= '`') goto yy433;
- goto yy443;
+ if (yych == '\\') goto yy439;
+ if (yych <= '`') goto yy431;
+ goto yy441;
}
}
} else {
if (yych <= 'r') {
if (yych <= 'f') {
- if (yych <= 'b') goto yy445;
- if (yych <= 'e') goto yy433;
- goto yy447;
+ if (yych <= 'b') goto yy443;
+ if (yych <= 'e') goto yy431;
+ goto yy445;
} else {
- if (yych == 'n') goto yy449;
- if (yych <= 'q') goto yy433;
- goto yy451;
+ if (yych == 'n') goto yy447;
+ if (yych <= 'q') goto yy431;
+ goto yy449;
}
} else {
if (yych <= 'u') {
- if (yych <= 's') goto yy433;
- if (yych <= 't') goto yy453;
- goto yy440;
+ if (yych <= 's') goto yy431;
+ if (yych <= 't') goto yy451;
+ goto yy438;
} else {
- if (yych <= 'v') goto yy455;
- if (yych == 'x') goto yy457;
- goto yy433;
+ if (yych <= 'v') goto yy453;
+ if (yych == 'x') goto yy455;
+ goto yy431;
}
}
}
-#line 640 "../src/parse/lex.re"
+#line 639 "../src/parse/lex.re"
{ fatal ((tok - pos) - tchar, "syntax error in escape sequence"); }
-#line 2763 "src/parse/lex.cc"
-yy433:
+#line 2753 "src/parse/lex.cc"
+yy431:
++YYCURSOR;
-#line 656 "../src/parse/lex.re"
+#line 655 "../src/parse/lex.re"
{
if (tok[1] != quote) {
warn.useless_escape(tline, tok - pos, tok[1]);
}
return static_cast<uint8_t>(tok[1]);
}
-#line 2773 "src/parse/lex.cc"
-yy435:
+#line 2763 "src/parse/lex.cc"
+yy433:
yyaccept = 0;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
- if (yych <= '/') goto yy436;
- if (yych <= '7') goto yy458;
-yy436:
-#line 639 "../src/parse/lex.re"
+ if (yych <= '/') goto yy434;
+ if (yych <= '7') goto yy456;
+yy434:
+#line 638 "../src/parse/lex.re"
{ fatal ((tok - pos) - tchar, "syntax error in octal escape sequence"); }
-#line 2782 "src/parse/lex.cc"
-yy437:
- yych = (YYCTYPE)*++YYCURSOR;
- goto yy436;
-yy438:
+#line 2772 "src/parse/lex.cc"
+yy435:
+ ++YYCURSOR;
+ goto yy434;
+yy436:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= '@') {
- if (yych <= '/') goto yy439;
- if (yych <= '9') goto yy460;
+ if (yych <= '/') goto yy437;
+ if (yych <= '9') goto yy458;
} else {
- if (yych <= 'F') goto yy460;
- if (yych <= '`') goto yy439;
- if (yych <= 'f') goto yy460;
+ if (yych <= 'F') goto yy458;
+ if (yych <= '`') goto yy437;
+ if (yych <= 'f') goto yy458;
}
-yy439:
-#line 638 "../src/parse/lex.re"
+yy437:
+#line 637 "../src/parse/lex.re"
{ fatal ((tok - pos) - tchar, "syntax error in hexadecimal escape sequence"); }
-#line 2800 "src/parse/lex.cc"
-yy440:
+#line 2790 "src/parse/lex.cc"
+yy438:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= '@') {
- if (yych <= '/') goto yy439;
- if (yych <= '9') goto yy461;
- goto yy439;
+ if (yych <= '/') goto yy437;
+ if (yych <= '9') goto yy459;
+ goto yy437;
} else {
- if (yych <= 'F') goto yy461;
- if (yych <= '`') goto yy439;
- if (yych <= 'f') goto yy461;
- goto yy439;
+ if (yych <= 'F') goto yy459;
+ if (yych <= '`') goto yy437;
+ if (yych <= 'f') goto yy459;
+ goto yy437;
}
-yy441:
+yy439:
++YYCURSOR;
-#line 655 "../src/parse/lex.re"
+#line 654 "../src/parse/lex.re"
{ return static_cast<uint8_t>('\\'); }
-#line 2818 "src/parse/lex.cc"
+#line 2808 "src/parse/lex.cc"
+yy441:
+ ++YYCURSOR;
+#line 647 "../src/parse/lex.re"
+ { return static_cast<uint8_t>('\a'); }
+#line 2813 "src/parse/lex.cc"
yy443:
++YYCURSOR;
#line 648 "../src/parse/lex.re"
- { return static_cast<uint8_t>('\a'); }
-#line 2823 "src/parse/lex.cc"
+ { return static_cast<uint8_t>('\b'); }
+#line 2818 "src/parse/lex.cc"
yy445:
++YYCURSOR;
#line 649 "../src/parse/lex.re"
- { return static_cast<uint8_t>('\b'); }
-#line 2828 "src/parse/lex.cc"
+ { return static_cast<uint8_t>('\f'); }
+#line 2823 "src/parse/lex.cc"
yy447:
++YYCURSOR;
#line 650 "../src/parse/lex.re"
- { return static_cast<uint8_t>('\f'); }
-#line 2833 "src/parse/lex.cc"
+ { return static_cast<uint8_t>('\n'); }
+#line 2828 "src/parse/lex.cc"
yy449:
++YYCURSOR;
#line 651 "../src/parse/lex.re"
- { return static_cast<uint8_t>('\n'); }
-#line 2838 "src/parse/lex.cc"
+ { return static_cast<uint8_t>('\r'); }
+#line 2833 "src/parse/lex.cc"
yy451:
++YYCURSOR;
#line 652 "../src/parse/lex.re"
- { return static_cast<uint8_t>('\r'); }
-#line 2843 "src/parse/lex.cc"
+ { return static_cast<uint8_t>('\t'); }
+#line 2838 "src/parse/lex.cc"
yy453:
++YYCURSOR;
#line 653 "../src/parse/lex.re"
- { return static_cast<uint8_t>('\t'); }
-#line 2848 "src/parse/lex.cc"
-yy455:
- ++YYCURSOR;
-#line 654 "../src/parse/lex.re"
{ return static_cast<uint8_t>('\v'); }
-#line 2853 "src/parse/lex.cc"
-yy457:
+#line 2843 "src/parse/lex.cc"
+yy455:
yyaccept = 1;
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
if (yych <= '@') {
- if (yych <= '/') goto yy439;
- if (yych <= '9') goto yy462;
- goto yy439;
+ if (yych <= '/') goto yy437;
+ if (yych <= '9') goto yy460;
+ goto yy437;
} else {
- if (yych <= 'F') goto yy462;
- if (yych <= '`') goto yy439;
- if (yych <= 'f') goto yy462;
- goto yy439;
+ if (yych <= 'F') goto yy460;
+ if (yych <= '`') goto yy437;
+ if (yych <= 'f') goto yy460;
+ goto yy437;
}
-yy458:
+yy456:
yych = (YYCTYPE)*++YYCURSOR;
- if (yych <= '/') goto yy459;
- if (yych <= '7') goto yy463;
-yy459:
+ if (yych <= '/') goto yy457;
+ if (yych <= '7') goto yy461;
+yy457:
YYCURSOR = YYMARKER;
if (yyaccept == 0) {
- goto yy436;
+ goto yy434;
} else {
- goto yy439;
+ goto yy437;
}
-yy460:
+yy458:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
- if (yych <= '/') goto yy459;
- if (yych <= '9') goto yy465;
- goto yy459;
+ if (yych <= '/') goto yy457;
+ if (yych <= '9') goto yy463;
+ goto yy457;
} else {
- if (yych <= 'F') goto yy465;
- if (yych <= '`') goto yy459;
- if (yych <= 'f') goto yy465;
- goto yy459;
+ if (yych <= 'F') goto yy463;
+ if (yych <= '`') goto yy457;
+ if (yych <= 'f') goto yy463;
+ goto yy457;
}
-yy461:
+yy459:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
- if (yych <= '/') goto yy459;
- if (yych <= '9') goto yy466;
- goto yy459;
+ if (yych <= '/') goto yy457;
+ if (yych <= '9') goto yy464;
+ goto yy457;
} else {
- if (yych <= 'F') goto yy466;
- if (yych <= '`') goto yy459;
- if (yych <= 'f') goto yy466;
- goto yy459;
+ if (yych <= 'F') goto yy464;
+ if (yych <= '`') goto yy457;
+ if (yych <= 'f') goto yy464;
+ goto yy457;
}
-yy462:
+yy460:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
- if (yych <= '/') goto yy459;
- if (yych <= '9') goto yy467;
- goto yy459;
+ if (yych <= '/') goto yy457;
+ if (yych <= '9') goto yy465;
+ goto yy457;
} else {
- if (yych <= 'F') goto yy467;
- if (yych <= '`') goto yy459;
- if (yych <= 'f') goto yy467;
- goto yy459;
+ if (yych <= 'F') goto yy465;
+ if (yych <= '`') goto yy457;
+ if (yych <= 'f') goto yy465;
+ goto yy457;
}
-yy463:
+yy461:
++YYCURSOR;
-#line 647 "../src/parse/lex.re"
+#line 646 "../src/parse/lex.re"
{ return unesc_oct(tok, cur); }
-#line 2918 "src/parse/lex.cc"
-yy465:
+#line 2908 "src/parse/lex.cc"
+yy463:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
- if (yych <= '/') goto yy459;
- if (yych <= '9') goto yy469;
- goto yy459;
+ if (yych <= '/') goto yy457;
+ if (yych <= '9') goto yy467;
+ goto yy457;
} else {
- if (yych <= 'F') goto yy469;
- if (yych <= '`') goto yy459;
- if (yych <= 'f') goto yy469;
- goto yy459;
+ if (yych <= 'F') goto yy467;
+ if (yych <= '`') goto yy457;
+ if (yych <= 'f') goto yy467;
+ goto yy457;
}
-yy466:
+yy464:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
- if (yych <= '/') goto yy459;
- if (yych <= '9') goto yy462;
- goto yy459;
+ if (yych <= '/') goto yy457;
+ if (yych <= '9') goto yy460;
+ goto yy457;
} else {
- if (yych <= 'F') goto yy462;
- if (yych <= '`') goto yy459;
- if (yych <= 'f') goto yy462;
- goto yy459;
+ if (yych <= 'F') goto yy460;
+ if (yych <= '`') goto yy457;
+ if (yych <= 'f') goto yy460;
+ goto yy457;
}
-yy467:
+yy465:
++YYCURSOR;
-#line 646 "../src/parse/lex.re"
+#line 645 "../src/parse/lex.re"
{ return unesc_hex(tok, cur); }
-#line 2947 "src/parse/lex.cc"
-yy469:
+#line 2937 "src/parse/lex.cc"
+yy467:
yych = (YYCTYPE)*++YYCURSOR;
if (yych <= '@') {
- if (yych <= '/') goto yy459;
- if (yych >= ':') goto yy459;
+ if (yych <= '/') goto yy457;
+ if (yych >= ':') goto yy457;
} else {
- if (yych <= 'F') goto yy470;
- if (yych <= '`') goto yy459;
- if (yych >= 'g') goto yy459;
+ if (yych <= 'F') goto yy468;
+ if (yych <= '`') goto yy457;
+ if (yych >= 'g') goto yy457;
}
-yy470:
- ++YYCURSOR;
- if ((yych = (YYCTYPE)*YYCURSOR) <= '@') {
- if (yych <= '/') goto yy459;
- if (yych <= '9') goto yy461;
- goto yy459;
+yy468:
+ yych = (YYCTYPE)*++YYCURSOR;
+ if (yych <= '@') {
+ if (yych <= '/') goto yy457;
+ if (yych <= '9') goto yy459;
+ goto yy457;
} else {
- if (yych <= 'F') goto yy461;
- if (yych <= '`') goto yy459;
- if (yych <= 'f') goto yy461;
- goto yy459;
+ if (yych <= 'F') goto yy459;
+ if (yych <= '`') goto yy457;
+ if (yych <= 'f') goto yy459;
+ goto yy457;
}
}
-#line 662 "../src/parse/lex.re"
+#line 661 "../src/parse/lex.re"
}
sourceline:
tok = cur;
-#line 2992 "src/parse/lex.cc"
+#line 2982 "src/parse/lex.cc"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = (YYCTYPE)*YYCURSOR;
if (yych <= '!') {
- if (yych == '\n') goto yy475;
+ if (yych == '\n') goto yy473;
} else {
- if (yych <= '"') goto yy477;
- if (yych <= '0') goto yy473;
- if (yych <= '9') goto yy478;
+ if (yych <= '"') goto yy475;
+ if (yych <= '0') goto yy471;
+ if (yych <= '9') goto yy476;
}
-yy473:
+yy471:
++YYCURSOR;
-yy474:
-#line 705 "../src/parse/lex.re"
+yy472:
+#line 704 "../src/parse/lex.re"
{
goto sourceline;
}
-#line 3045 "src/parse/lex.cc"
-yy475:
+#line 3035 "src/parse/lex.cc"
+yy473:
++YYCURSOR;
-#line 693 "../src/parse/lex.re"
+#line 692 "../src/parse/lex.re"
{
if (cur == eof)
{
tok = cur;
return;
}
-#line 3061 "src/parse/lex.cc"
-yy477:
+#line 3051 "src/parse/lex.cc"
+yy475:
yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR);
- if (yych == '\n') goto yy474;
- goto yy482;
-yy478:
+ if (yych == '\n') goto yy472;
+ goto yy480;
+yy476:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
if (yybm[0+yych] & 64) {
- goto yy478;
+ goto yy476;
}
-#line 682 "../src/parse/lex.re"
+#line 681 "../src/parse/lex.re"
{
if (!s_to_u32_unsafe (tok, cur, cline))
{
}
goto sourceline;
}
-#line 3081 "src/parse/lex.cc"
-yy481:
+#line 3071 "src/parse/lex.cc"
+yy479:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
-yy482:
+yy480:
if (yybm[0+yych] & 128) {
- goto yy481;
+ goto yy479;
}
- if (yych <= '\n') goto yy483;
- if (yych <= '"') goto yy484;
- goto yy486;
-yy483:
+ if (yych <= '\n') goto yy481;
+ if (yych <= '"') goto yy482;
+ goto yy484;
+yy481:
YYCURSOR = YYMARKER;
- goto yy474;
-yy484:
+ goto yy472;
+yy482:
++YYCURSOR;
-#line 689 "../src/parse/lex.re"
+#line 688 "../src/parse/lex.re"
{
escape (in.file_name, std::string (tok + 1, tok_len () - 2)); // -2 to omit quotes
goto sourceline;
}
-#line 3103 "src/parse/lex.cc"
-yy486:
+#line 3093 "src/parse/lex.cc"
+yy484:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = (YYCTYPE)*YYCURSOR;
- if (yych == '\n') goto yy483;
- goto yy481;
+ if (yych == '\n') goto yy481;
+ goto yy479;
}
-#line 708 "../src/parse/lex.re"
+#line 707 "../src/parse/lex.re"
}
-/* Generated by re2c 0.16 on Mon Dec 12 13:39:55 2016 */
+/* Generated by re2c 0.16 on Sun Dec 18 11:55:22 2016 */
#line 1 "../src/parse/lex_conf.re"
#include "src/util/c99_stdint.h"
#include <string>
#include "src/codegen/output.h"
-#include "src/conf/opt.h"
-#include "src/globals.h"
#include "src/ir/regexp/encoding/enc.h"
#include "src/parse/scanner.h"
#include "src/util/s_to_n32_unsafe.h"
{
// global re2c config (affects the whole file)
-#line 36 "../src/parse/lex_conf.re"
+#line 34 "../src/parse/lex_conf.re"
void Scanner::lex_conf ()
{
tok = cur;
-#line 25 "src/parse/lex_conf.cc"
+#line 23 "src/parse/lex_conf.cc"
{
unsigned char yych;
unsigned int yyaccept = 0;
yy2:
++cur;
yy3:
-#line 42 "../src/parse/lex_conf.re"
+#line 40 "../src/parse/lex_conf.re"
{ fatal ((tok - pos) - tchar, "unrecognized configuration"); }
-#line 82 "src/parse/lex_conf.cc"
+#line 80 "src/parse/lex_conf.cc"
yy4:
yyaccept = 0;
yych = (unsigned char)*(ptr = ++cur);
goto yy14;
yy90:
++cur;
-#line 67 "../src/parse/lex_conf.re"
+#line 65 "../src/parse/lex_conf.re"
{ lex_conf_enc(Enc::UTF8); return; }
-#line 571 "src/parse/lex_conf.cc"
+#line 569 "src/parse/lex_conf.cc"
yy92:
++cur;
-#line 44 "../src/parse/lex_conf.re"
+#line 42 "../src/parse/lex_conf.re"
{ opts.set_target(opt_t::DOT); lex_conf_semicolon(); return; }
-#line 576 "src/parse/lex_conf.cc"
+#line 574 "src/parse/lex_conf.cc"
yy94:
++cur;
-#line 51 "../src/parse/lex_conf.re"
+#line 49 "../src/parse/lex_conf.re"
{ opts.set_FFlag(lex_conf_bool()); return; }
-#line 581 "src/parse/lex_conf.cc"
+#line 579 "src/parse/lex_conf.cc"
yy96:
++cur;
-#line 45 "../src/parse/lex_conf.re"
+#line 43 "../src/parse/lex_conf.re"
{ opts.set_target(opt_t::SKELETON); lex_conf_semicolon(); return; }
-#line 586 "src/parse/lex_conf.cc"
+#line 584 "src/parse/lex_conf.cc"
yy98:
++cur;
-#line 56 "../src/parse/lex_conf.re"
+#line 54 "../src/parse/lex_conf.re"
{ opts.set_tags(lex_conf_bool()); return; }
-#line 591 "src/parse/lex_conf.cc"
+#line 589 "src/parse/lex_conf.cc"
yy100:
yyaccept = 1;
yych = (unsigned char)*(ptr = ++cur);
if (yych == 'i') goto yy149;
yy101:
-#line 47 "../src/parse/lex_conf.re"
+#line 45 "../src/parse/lex_conf.re"
{ opts.set_bFlag(lex_conf_bool()); return; }
-#line 599 "src/parse/lex_conf.cc"
+#line 597 "src/parse/lex_conf.cc"
yy102:
yyaccept = 2;
yych = (unsigned char)*(ptr = ++cur);
if (yych == 'a') goto yy150;
if (yych == 'o') goto yy151;
yy103:
-#line 48 "../src/parse/lex_conf.re"
+#line 46 "../src/parse/lex_conf.re"
{ opts.set_cFlag(lex_conf_bool()); return; }
-#line 608 "src/parse/lex_conf.cc"
+#line 606 "src/parse/lex_conf.cc"
yy104:
yyaccept = 3;
yych = (unsigned char)*(ptr = ++cur);
if (yych <= 'e') goto yy152;
if (yych <= 'f') goto yy153;
yy105:
-#line 49 "../src/parse/lex_conf.re"
+#line 47 "../src/parse/lex_conf.re"
{ opts.set_dFlag(lex_conf_bool()); return; }
-#line 618 "src/parse/lex_conf.cc"
+#line 616 "src/parse/lex_conf.cc"
yy106:
yyaccept = 4;
yych = (unsigned char)*(ptr = ++cur);
if (yych <= 'n') goto yy156;
}
yy107:
-#line 63 "../src/parse/lex_conf.re"
+#line 61 "../src/parse/lex_conf.re"
{ lex_conf_enc(Enc::EBCDIC); return; }
-#line 631 "src/parse/lex_conf.cc"
+#line 629 "src/parse/lex_conf.cc"
yy108:
yyaccept = 5;
yych = (unsigned char)*(ptr = ++cur);
if (yych == 'l') goto yy157;
yy109:
-#line 50 "../src/parse/lex_conf.re"
+#line 48 "../src/parse/lex_conf.re"
{ opts.set_fFlag(lex_conf_bool()); return; }
-#line 639 "src/parse/lex_conf.cc"
+#line 637 "src/parse/lex_conf.cc"
yy110:
++cur;
-#line 52 "../src/parse/lex_conf.re"
+#line 50 "../src/parse/lex_conf.re"
{ opts.set_gFlag(lex_conf_bool()); return; }
-#line 644 "src/parse/lex_conf.cc"
+#line 642 "src/parse/lex_conf.cc"
yy112:
yyaccept = 6;
yych = (unsigned char)*(ptr = ++cur);
if (yych == 'n') goto yy158;
yy113:
-#line 53 "../src/parse/lex_conf.re"
+#line 51 "../src/parse/lex_conf.re"
{ opts.set_iFlag(lex_conf_bool()); return; }
-#line 652 "src/parse/lex_conf.cc"
+#line 650 "src/parse/lex_conf.cc"
yy114:
yych = (unsigned char)*++cur;
if (yych == 'e') goto yy159;
yych = (unsigned char)*(ptr = ++cur);
if (yych == 'u') goto yy161;
yy116:
-#line 69 "../src/parse/lex_conf.re"
+#line 67 "../src/parse/lex_conf.re"
{ opts.set_output_file(lex_conf_string()); return; }
-#line 665 "src/parse/lex_conf.cc"
+#line 663 "src/parse/lex_conf.cc"
yy117:
yyaccept = 8;
yych = (unsigned char)*(ptr = ++cur);
if (yych == 'e') goto yy162;
yy118:
-#line 54 "../src/parse/lex_conf.re"
+#line 52 "../src/parse/lex_conf.re"
{ opts.set_rFlag(lex_conf_bool()); return; }
-#line 673 "src/parse/lex_conf.cc"
+#line 671 "src/parse/lex_conf.cc"
yy119:
yyaccept = 9;
yych = (unsigned char)*(ptr = ++cur);
if (yych == 'k') goto yy163;
if (yych == 't') goto yy164;
yy120:
-#line 55 "../src/parse/lex_conf.re"
+#line 53 "../src/parse/lex_conf.re"
{ opts.set_sFlag(lex_conf_bool()); return; }
-#line 682 "src/parse/lex_conf.cc"
+#line 680 "src/parse/lex_conf.cc"
yy121:
yyaccept = 10;
yych = (unsigned char)*(ptr = ++cur);
if (yych == 'a') goto yy165;
if (yych == 'y') goto yy166;
yy122:
-#line 70 "../src/parse/lex_conf.re"
+#line 68 "../src/parse/lex_conf.re"
{ opts.set_header_file(lex_conf_string()); return; }
-#line 691 "src/parse/lex_conf.cc"
+#line 689 "src/parse/lex_conf.cc"
yy123:
yyaccept = 11;
yych = (unsigned char)*(ptr = ++cur);
if (yych == 'n') goto yy167;
if (yych == 't') goto yy168;
yy124:
-#line 64 "../src/parse/lex_conf.re"
+#line 62 "../src/parse/lex_conf.re"
{ lex_conf_enc(Enc::UTF32); return; }
-#line 700 "src/parse/lex_conf.cc"
+#line 698 "src/parse/lex_conf.cc"
yy125:
yyaccept = 12;
yych = (unsigned char)*(ptr = ++cur);
if (yych == 'i') goto yy169;
yy126:
-#line 65 "../src/parse/lex_conf.re"
+#line 63 "../src/parse/lex_conf.re"
{ lex_conf_enc(Enc::UCS2); return; }
-#line 708 "src/parse/lex_conf.cc"
+#line 706 "src/parse/lex_conf.cc"
yy127:
++cur;
-#line 66 "../src/parse/lex_conf.re"
+#line 64 "../src/parse/lex_conf.re"
{ lex_conf_enc(Enc::UTF16); return; }
-#line 713 "src/parse/lex_conf.cc"
+#line 711 "src/parse/lex_conf.cc"
yy129:
yych = (unsigned char)*++cur;
if (yych <= 'r') goto yy14;
goto yy14;
yy181:
++cur;
-#line 103 "../src/parse/lex_conf.re"
+#line 101 "../src/parse/lex_conf.re"
{ opts.set_yybmHexTable (lex_conf_bool()); return; }
-#line 938 "src/parse/lex_conf.cc"
+#line 936 "src/parse/lex_conf.cc"
yy183:
yych = (unsigned char)*++cur;
if (yych == 'v') goto yy231;
yych = (unsigned char)*(ptr = ++cur);
if (yych == '@') goto yy239;
yy191:
-#line 87 "../src/parse/lex_conf.re"
+#line 85 "../src/parse/lex_conf.re"
{ opts.set_condGoto (lex_conf_string ()); return; }
-#line 974 "src/parse/lex_conf.cc"
+#line 972 "src/parse/lex_conf.cc"
yy192:
yych = (unsigned char)*++cur;
if (yych == 'r') goto yy240;
if (yych == '-') goto yy257;
goto yy14;
yy200:
- yych = (unsigned char)*++cur;
+ ++cur;
goto yy107;
yy201:
yych = (unsigned char)*++cur;
goto yy14;
yy232:
++cur;
-#line 153 "../src/parse/lex_conf.re"
+#line 151 "../src/parse/lex_conf.re"
{ opts.set_bEmitYYCh (lex_conf_bool()); return; }
-#line 1155 "src/parse/lex_conf.cc"
+#line 1153 "src/parse/lex_conf.cc"
yy234:
yych = (unsigned char)*++cur;
if (yych == 'e') goto yy292;
goto yy14;
yy241:
++cur;
-#line 83 "../src/parse/lex_conf.re"
+#line 81 "../src/parse/lex_conf.re"
{ opts.set_condPrefix (lex_conf_string ()); return; }
-#line 1188 "src/parse/lex_conf.cc"
+#line 1186 "src/parse/lex_conf.cc"
yy243:
yych = (unsigned char)*++cur;
if (yych == 'A') goto yy299;
goto yy14;
yy278:
++cur;
-#line 138 "../src/parse/lex_conf.re"
+#line 136 "../src/parse/lex_conf.re"
{
const int32_t n = lex_conf_number ();
if (n < 0)
opts.set_topIndent (static_cast<uint32_t> (n));
return;
}
-#line 1350 "src/parse/lex_conf.cc"
+#line 1348 "src/parse/lex_conf.cc"
yy280:
yych = (unsigned char)*++cur;
if (yych == 'l') goto yy339;
}
}
yy284:
-#line 166 "../src/parse/lex_conf.re"
+#line 164 "../src/parse/lex_conf.re"
{ out.block().user_start_label = lex_conf_string(); return; }
-#line 1384 "src/parse/lex_conf.cc"
+#line 1382 "src/parse/lex_conf.cc"
yy285:
yych = (unsigned char)*++cur;
if (yych == 't') goto yy347;
goto yy14;
yy322:
++cur;
-#line 73 "../src/parse/lex_conf.re"
+#line 71 "../src/parse/lex_conf.re"
{ lex_conf_input(); return; }
-#line 1540 "src/parse/lex_conf.cc"
+#line 1538 "src/parse/lex_conf.cc"
yy324:
yych = (unsigned char)*++cur;
if (yych == 'd') goto yy389;
goto yy14;
yy341:
++cur;
-#line 162 "../src/parse/lex_conf.re"
+#line 160 "../src/parse/lex_conf.re"
{ opts.set_labelPrefix (lex_conf_string ()); return; }
-#line 1613 "src/parse/lex_conf.cc"
+#line 1611 "src/parse/lex_conf.cc"
yy343:
++cur;
if (lim <= cur) fill(1);
}
yy347:
++cur;
-#line 98 "../src/parse/lex_conf.re"
+#line 96 "../src/parse/lex_conf.re"
{ opts.set_bUseStateAbort (lex_conf_bool()); return; }
-#line 1648 "src/parse/lex_conf.cc"
+#line 1646 "src/parse/lex_conf.cc"
yy349:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy411;
goto yy14;
yy352:
++cur;
-#line 133 "../src/parse/lex_conf.re"
+#line 131 "../src/parse/lex_conf.re"
{ opts.set_tags_prefix (lex_conf_string ()); return; }
-#line 1665 "src/parse/lex_conf.cc"
+#line 1663 "src/parse/lex_conf.cc"
yy354:
yych = (unsigned char)*++cur;
if (yych <= 'c') {
yych = (unsigned char)*(ptr = ++cur);
if (yych == '@') goto yy426;
yy361:
-#line 85 "../src/parse/lex_conf.re"
+#line 83 "../src/parse/lex_conf.re"
{ opts.set_condDivider (lex_conf_string ()); return; }
-#line 1706 "src/parse/lex_conf.cc"
+#line 1704 "src/parse/lex_conf.cc"
yy362:
yych = (unsigned char)*++cur;
if (yych == 'n') goto yy427;
if (yych == 'j') goto yy463;
goto yy14;
yy394:
- yych = (unsigned char)*++cur;
+ ++cur;
goto yy116;
yy395:
yych = (unsigned char)*++cur;
goto yy14;
yy404:
++cur;
-#line 97 "../src/parse/lex_conf.re"
+#line 95 "../src/parse/lex_conf.re"
{ opts.set_yynext (lex_conf_string ()); return; }
-#line 1880 "src/parse/lex_conf.cc"
+#line 1878 "src/parse/lex_conf.cc"
yy406:
yych = (unsigned char)*++cur;
if (yych <= '0') goto yy14;
++cur;
yy408:
cur = ctx;
-#line 165 "../src/parse/lex_conf.re"
+#line 163 "../src/parse/lex_conf.re"
{ out.block().force_start_label = lex_conf_bool(); return; }
-#line 1892 "src/parse/lex_conf.cc"
+#line 1890 "src/parse/lex_conf.cc"
yy409:
++cur;
if (lim <= cur) fill(1);
goto yy14;
yy412:
++cur;
-#line 132 "../src/parse/lex_conf.re"
+#line 130 "../src/parse/lex_conf.re"
{ opts.set_tags_default (lex_conf_string ()); return; }
-#line 1909 "src/parse/lex_conf.cc"
+#line 1907 "src/parse/lex_conf.cc"
yy414:
yych = (unsigned char)*++cur;
if (yych == 'i') goto yy475;
goto yy14;
yy421:
++cur;
-#line 160 "../src/parse/lex_conf.re"
+#line 158 "../src/parse/lex_conf.re"
{ opts.set_fill_check (lex_conf_bool()); return; }
-#line 1943 "src/parse/lex_conf.cc"
+#line 1941 "src/parse/lex_conf.cc"
yy423:
yych = (unsigned char)*++cur;
if (yych == 'e') goto yy485;
if (yych == ':') goto yy503;
if (yych == '@') goto yy504;
yy437:
-#line 155 "../src/parse/lex_conf.re"
+#line 153 "../src/parse/lex_conf.re"
{ opts.set_fill (lex_conf_string ()); return; }
-#line 2004 "src/parse/lex_conf.cc"
+#line 2002 "src/parse/lex_conf.cc"
yy438:
yych = (unsigned char)*++cur;
if (yych == 'O') goto yy505;
goto yy14;
yy443:
++cur;
-#line 121 "../src/parse/lex_conf.re"
+#line 119 "../src/parse/lex_conf.re"
{ opts.set_yypeek (lex_conf_string ()); return; }
-#line 2029 "src/parse/lex_conf.cc"
+#line 2027 "src/parse/lex_conf.cc"
yy445:
yych = (unsigned char)*++cur;
if (yych == 'O') goto yy511;
goto yy14;
yy448:
++cur;
-#line 122 "../src/parse/lex_conf.re"
+#line 120 "../src/parse/lex_conf.re"
{ opts.set_yyskip (lex_conf_string ()); return; }
-#line 2046 "src/parse/lex_conf.cc"
+#line 2044 "src/parse/lex_conf.cc"
yy450:
yych = (unsigned char)*++cur;
if (yych == 't') goto yy514;
if (yych == 'a') goto yy531;
goto yy14;
yy469:
- yych = (unsigned char)*++cur;
+ ++cur;
goto yy124;
yy470:
yych = (unsigned char)*++cur;
goto yy14;
yy471:
++cur;
-#line 136 "../src/parse/lex_conf.re"
+#line 134 "../src/parse/lex_conf.re"
{ opts.set_indString (lex_conf_string ()); return; }
-#line 2135 "src/parse/lex_conf.cc"
+#line 2133 "src/parse/lex_conf.cc"
yy473:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy533;
goto yy14;
yy477:
++cur;
-#line 102 "../src/parse/lex_conf.re"
+#line 100 "../src/parse/lex_conf.re"
{ opts.set_yybm (lex_conf_string ()); return; }
-#line 2156 "src/parse/lex_conf.cc"
+#line 2154 "src/parse/lex_conf.cc"
yy479:
++cur;
-#line 151 "../src/parse/lex_conf.re"
+#line 149 "../src/parse/lex_conf.re"
{ opts.set_yych (lex_conf_string ()); return; }
-#line 2161 "src/parse/lex_conf.cc"
+#line 2159 "src/parse/lex_conf.cc"
yy481:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy537;
goto yy14;
yy485:
++cur;
-#line 156 "../src/parse/lex_conf.re"
+#line 154 "../src/parse/lex_conf.re"
{ opts.set_fill_use (lex_conf_bool()); return; }
-#line 2182 "src/parse/lex_conf.cc"
+#line 2180 "src/parse/lex_conf.cc"
yy487:
yych = (unsigned char)*++cur;
if (yych == 't') goto yy541;
goto yy14;
yy490:
++cur;
-#line 88 "../src/parse/lex_conf.re"
+#line 86 "../src/parse/lex_conf.re"
{ opts.set_condGotoParam (lex_conf_string ()); return; }
-#line 2199 "src/parse/lex_conf.cc"
+#line 2197 "src/parse/lex_conf.cc"
yy492:
++cur;
-#line 84 "../src/parse/lex_conf.re"
+#line 82 "../src/parse/lex_conf.re"
{ opts.set_condEnumPrefix (lex_conf_string ()); return; }
-#line 2204 "src/parse/lex_conf.cc"
+#line 2202 "src/parse/lex_conf.cc"
yy494:
yych = (unsigned char)*++cur;
if (yych == 'P') goto yy545;
goto yy14;
yy498:
++cur;
-#line 150 "../src/parse/lex_conf.re"
+#line 148 "../src/parse/lex_conf.re"
{ opts.set_yyctype (lex_conf_string ()); return; }
-#line 2225 "src/parse/lex_conf.cc"
+#line 2223 "src/parse/lex_conf.cc"
yy500:
yych = (unsigned char)*++cur;
if (yych == 'R') goto yy550;
goto yy14;
yy501:
++cur;
-#line 148 "../src/parse/lex_conf.re"
+#line 146 "../src/parse/lex_conf.re"
{ opts.set_yydebug (lex_conf_string ()); return; }
-#line 2234 "src/parse/lex_conf.cc"
+#line 2232 "src/parse/lex_conf.cc"
yy503:
yych = (unsigned char)*++cur;
if (yych == 'n') goto yy552;
goto yy14;
yy508:
++cur;
-#line 119 "../src/parse/lex_conf.re"
+#line 117 "../src/parse/lex_conf.re"
{ opts.set_yylimit (lex_conf_string ()); return; }
-#line 2259 "src/parse/lex_conf.cc"
+#line 2257 "src/parse/lex_conf.cc"
yy510:
yych = (unsigned char)*++cur;
if (yych == 'R') goto yy557;
if (yych == 'c') goto yy575;
goto yy14;
yy528:
- yych = (unsigned char)*++cur;
+ ++cur;
goto yy118;
yy529:
yych = (unsigned char)*++cur;
goto yy14;
yy542:
++cur;
-#line 105 "../src/parse/lex_conf.re"
+#line 103 "../src/parse/lex_conf.re"
{
const int32_t n = lex_conf_number ();
if (n < 0)
opts.set_cGotoThreshold (static_cast<uint32_t> (n));
return;
}
-#line 2399 "src/parse/lex_conf.cc"
+#line 2397 "src/parse/lex_conf.cc"
yy544:
yych = (unsigned char)*++cur;
if (yych == 'n') goto yy592;
if (yych == 'C') goto yy593;
if (yych == 'T') goto yy594;
yy546:
-#line 123 "../src/parse/lex_conf.re"
+#line 121 "../src/parse/lex_conf.re"
{ opts.set_yybackup (lex_conf_string ()); return; }
-#line 2412 "src/parse/lex_conf.cc"
+#line 2410 "src/parse/lex_conf.cc"
yy547:
yych = (unsigned char)*++cur;
if (yych == 'P') goto yy595;
goto yy14;
yy550:
++cur;
-#line 116 "../src/parse/lex_conf.re"
+#line 114 "../src/parse/lex_conf.re"
{ opts.set_yycursor (lex_conf_string ()); return; }
-#line 2429 "src/parse/lex_conf.cc"
+#line 2427 "src/parse/lex_conf.cc"
yy552:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy599;
goto yy14;
yy557:
++cur;
-#line 117 "../src/parse/lex_conf.re"
+#line 115 "../src/parse/lex_conf.re"
{ opts.set_yymarker (lex_conf_string ()); return; }
-#line 2454 "src/parse/lex_conf.cc"
+#line 2452 "src/parse/lex_conf.cc"
yy559:
yych = (unsigned char)*++cur;
if (yych == 'E') goto yy604;
goto yy14;
yy581:
++cur;
-#line 99 "../src/parse/lex_conf.re"
+#line 97 "../src/parse/lex_conf.re"
{ opts.set_bUseStateNext (lex_conf_bool()); return; }
-#line 2547 "src/parse/lex_conf.cc"
+#line 2545 "src/parse/lex_conf.cc"
yy583:
++cur;
-#line 134 "../src/parse/lex_conf.re"
+#line 132 "../src/parse/lex_conf.re"
{ opts.set_tags_expression(lex_conf_string ()); return; }
-#line 2552 "src/parse/lex_conf.cc"
+#line 2550 "src/parse/lex_conf.cc"
yy585:
yych = (unsigned char)*++cur;
if (yych == 'p') goto yy628;
goto yy14;
yy589:
++cur;
-#line 152 "../src/parse/lex_conf.re"
+#line 150 "../src/parse/lex_conf.re"
{ opts.set_yychConversion (lex_conf_bool()); return; }
-#line 2573 "src/parse/lex_conf.cc"
+#line 2571 "src/parse/lex_conf.cc"
yy591:
yych = (unsigned char)*++cur;
if (yych == 'r') goto yy632;
goto yy14;
yy596:
++cur;
-#line 129 "../src/parse/lex_conf.re"
+#line 127 "../src/parse/lex_conf.re"
{ opts.set_yycopytag (lex_conf_string ()); return; }
-#line 2598 "src/parse/lex_conf.cc"
+#line 2596 "src/parse/lex_conf.cc"
yy598:
yych = (unsigned char)*++cur;
if (yych == 'E') goto yy640;
if (yych == 'C') goto yy649;
if (yych == 'T') goto yy650;
yy605:
-#line 126 "../src/parse/lex_conf.re"
+#line 124 "../src/parse/lex_conf.re"
{ opts.set_yyrestore (lex_conf_string ()); return; }
-#line 2631 "src/parse/lex_conf.cc"
+#line 2629 "src/parse/lex_conf.cc"
yy606:
yych = (unsigned char)*++cur;
if (yych == 'I') goto yy651;
if (yych == 'x') goto yy94;
goto yy14;
yy617:
- yych = (unsigned char)*++cur;
+ ++cur;
goto yy120;
yy618:
yych = (unsigned char)*++cur;
goto yy14;
yy620:
++cur;
-#line 58 "../src/parse/lex_conf.re"
+#line 56 "../src/parse/lex_conf.re"
{ opts.set_version(!lex_conf_bool()); return; }
-#line 2691 "src/parse/lex_conf.cc"
+#line 2689 "src/parse/lex_conf.cc"
yy622:
yych = (unsigned char)*++cur;
if (yych == 'i') goto yy665;
if (yych == 'r') goto yy668;
goto yy14;
yy626:
- yych = (unsigned char)*++cur;
+ ++cur;
goto yy126;
yy627:
yych = (unsigned char)*++cur;
goto yy14;
yy632:
++cur;
-#line 158 "../src/parse/lex_conf.re"
+#line 156 "../src/parse/lex_conf.re"
{ opts.set_fill_arg_use (lex_conf_bool()); return; }
-#line 2735 "src/parse/lex_conf.cc"
+#line 2733 "src/parse/lex_conf.cc"
yy634:
++cur;
-#line 86 "../src/parse/lex_conf.re"
+#line 84 "../src/parse/lex_conf.re"
{ opts.set_condDividerParam (lex_conf_string ()); return; }
-#line 2740 "src/parse/lex_conf.cc"
+#line 2738 "src/parse/lex_conf.cc"
yy636:
yych = (unsigned char)*++cur;
if (yych == 'X') goto yy679;
goto yy14;
yy638:
++cur;
-#line 77 "../src/parse/lex_conf.re"
+#line 75 "../src/parse/lex_conf.re"
{ opts.set_yycondtype (lex_conf_string ()); return; }
-#line 2753 "src/parse/lex_conf.cc"
+#line 2751 "src/parse/lex_conf.cc"
yy640:
yych = (unsigned char)*++cur;
if (yych == 'R') goto yy683;
goto yy14;
yy642:
++cur;
-#line 157 "../src/parse/lex_conf.re"
+#line 155 "../src/parse/lex_conf.re"
{ opts.set_fill_arg (lex_conf_string ()); return; }
-#line 2766 "src/parse/lex_conf.cc"
+#line 2764 "src/parse/lex_conf.cc"
yy644:
yych = (unsigned char)*++cur;
if (yych == 'T') goto yy686;
yych = (unsigned char)*(ptr = ++cur);
if (yych == ':') goto yy687;
yy646:
-#line 91 "../src/parse/lex_conf.re"
+#line 89 "../src/parse/lex_conf.re"
{ opts.set_state_get (lex_conf_string ()); return; }
-#line 2778 "src/parse/lex_conf.cc"
+#line 2776 "src/parse/lex_conf.cc"
yy647:
++cur;
-#line 130 "../src/parse/lex_conf.re"
+#line 128 "../src/parse/lex_conf.re"
{ opts.set_yylessthan (lex_conf_string ()); return; }
-#line 2783 "src/parse/lex_conf.cc"
+#line 2781 "src/parse/lex_conf.cc"
yy649:
yych = (unsigned char)*++cur;
if (yych == 'T') goto yy688;
if (yych == ':') goto yy691;
if (yych == '@') goto yy692;
yy653:
-#line 93 "../src/parse/lex_conf.re"
+#line 91 "../src/parse/lex_conf.re"
{ opts.set_state_set (lex_conf_string ()); return; }
-#line 2804 "src/parse/lex_conf.cc"
+#line 2802 "src/parse/lex_conf.cc"
yy654:
- yych = (unsigned char)*++cur;
+ ++cur;
goto yy101;
yy655:
yych = (unsigned char)*++cur;
goto yy14;
yy660:
++cur;
-#line 74 "../src/parse/lex_conf.re"
+#line 72 "../src/parse/lex_conf.re"
{ lex_conf_empty_class(); return; }
-#line 2832 "src/parse/lex_conf.cc"
+#line 2830 "src/parse/lex_conf.cc"
yy662:
yych = (unsigned char)*++cur;
if (yych == 'l') goto yy698;
if (yych == 'a') goto yy703;
goto yy14;
yy668:
- yych = (unsigned char)*++cur;
+ ++cur;
goto yy122;
yy669:
++cur;
-#line 96 "../src/parse/lex_conf.re"
+#line 94 "../src/parse/lex_conf.re"
{ opts.set_yyfilllabel (lex_conf_string ()); return; }
-#line 2864 "src/parse/lex_conf.cc"
+#line 2862 "src/parse/lex_conf.cc"
yy671:
++cur;
-#line 100 "../src/parse/lex_conf.re"
+#line 98 "../src/parse/lex_conf.re"
{ opts.set_yyaccept (lex_conf_string ()); return; }
-#line 2869 "src/parse/lex_conf.cc"
+#line 2867 "src/parse/lex_conf.cc"
yy673:
++cur;
-#line 89 "../src/parse/lex_conf.re"
+#line 87 "../src/parse/lex_conf.re"
{ opts.set_yyctable (lex_conf_string ()); return; }
-#line 2874 "src/parse/lex_conf.cc"
+#line 2872 "src/parse/lex_conf.cc"
yy675:
++cur;
-#line 169 "../src/parse/lex_conf.re"
+#line 167 "../src/parse/lex_conf.re"
{ lex_conf_string (); return; }
-#line 2879 "src/parse/lex_conf.cc"
+#line 2877 "src/parse/lex_conf.cc"
yy677:
++cur;
-#line 114 "../src/parse/lex_conf.re"
+#line 112 "../src/parse/lex_conf.re"
{ opts.set_yytarget (lex_conf_string ()); return; }
-#line 2884 "src/parse/lex_conf.cc"
+#line 2882 "src/parse/lex_conf.cc"
yy679:
++cur;
-#line 124 "../src/parse/lex_conf.re"
+#line 122 "../src/parse/lex_conf.re"
{ opts.set_yybackupctx (lex_conf_string ()); return; }
-#line 2889 "src/parse/lex_conf.cc"
+#line 2887 "src/parse/lex_conf.cc"
yy681:
++cur;
-#line 125 "../src/parse/lex_conf.re"
+#line 123 "../src/parse/lex_conf.re"
{ opts.set_yybackuptag (lex_conf_string ()); return; }
-#line 2894 "src/parse/lex_conf.cc"
+#line 2892 "src/parse/lex_conf.cc"
yy683:
++cur;
-#line 118 "../src/parse/lex_conf.re"
+#line 116 "../src/parse/lex_conf.re"
{ opts.set_yyctxmarker (lex_conf_string ()); return; }
-#line 2899 "src/parse/lex_conf.cc"
+#line 2897 "src/parse/lex_conf.cc"
yy685:
yych = (unsigned char)*++cur;
if (yych == 'd') goto yy704;
if (yych == 'o') goto yy718;
goto yy14;
yy696:
- yych = (unsigned char)*++cur;
+ ++cur;
goto yy105;
yy697:
yych = (unsigned char)*++cur;
goto yy14;
yy704:
++cur;
-#line 159 "../src/parse/lex_conf.re"
+#line 157 "../src/parse/lex_conf.re"
{ opts.set_fill_naked (lex_conf_bool()); return; }
-#line 2979 "src/parse/lex_conf.cc"
+#line 2977 "src/parse/lex_conf.cc"
yy706:
yych = (unsigned char)*++cur;
if (yych == 'O') goto yy726;
goto yy14;
yy708:
++cur;
-#line 127 "../src/parse/lex_conf.re"
+#line 125 "../src/parse/lex_conf.re"
{ opts.set_yyrestorectx (lex_conf_string ()); return; }
-#line 2992 "src/parse/lex_conf.cc"
+#line 2990 "src/parse/lex_conf.cc"
yy710:
++cur;
-#line 128 "../src/parse/lex_conf.re"
+#line 126 "../src/parse/lex_conf.re"
{ opts.set_yyrestoretag (lex_conf_string ()); return; }
-#line 2997 "src/parse/lex_conf.cc"
+#line 2995 "src/parse/lex_conf.cc"
yy712:
yych = (unsigned char)*++cur;
if (yych == 'O') goto yy728;
goto yy14;
yy716:
++cur;
-#line 60 "../src/parse/lex_conf.re"
+#line 58 "../src/parse/lex_conf.re"
{ opts.set_bCaseInverted(lex_conf_bool()); return; }
-#line 3018 "src/parse/lex_conf.cc"
+#line 3016 "src/parse/lex_conf.cc"
yy718:
yych = (unsigned char)*++cur;
if (yych == 's') goto yy110;
if (yych == 'c') goto yy733;
goto yy14;
yy721:
- yych = (unsigned char)*++cur;
+ ++cur;
goto yy113;
yy722:
yych = (unsigned char)*++cur;
if (yych == 'n') goto yy751;
goto yy14;
yy737:
- yych = (unsigned char)*++cur;
+ ++cur;
goto yy109;
yy738:
yyaccept = 21;
yych = (unsigned char)*(ptr = ++cur);
if (yych == ':') goto yy752;
yy739:
-#line 78 "../src/parse/lex_conf.re"
+#line 76 "../src/parse/lex_conf.re"
{ opts.set_cond_get (lex_conf_string ()); return; }
-#line 3104 "src/parse/lex_conf.cc"
+#line 3102 "src/parse/lex_conf.cc"
yy740:
yych = (unsigned char)*++cur;
if (yych == 'e') goto yy753;
if (yych == ':') goto yy754;
if (yych == '@') goto yy755;
yy742:
-#line 80 "../src/parse/lex_conf.re"
+#line 78 "../src/parse/lex_conf.re"
{ opts.set_cond_set (lex_conf_string ()); return; }
-#line 3117 "src/parse/lex_conf.cc"
+#line 3115 "src/parse/lex_conf.cc"
yy743:
yych = (unsigned char)*++cur;
if (yych == 'e') goto yy756;
goto yy14;
yy747:
++cur;
-#line 72 "../src/parse/lex_conf.re"
+#line 70 "../src/parse/lex_conf.re"
{ lex_conf_encoding_policy(); return; }
-#line 3138 "src/parse/lex_conf.cc"
+#line 3136 "src/parse/lex_conf.cc"
yy749:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy762;
goto yy14;
yy758:
++cur;
-#line 59 "../src/parse/lex_conf.re"
+#line 57 "../src/parse/lex_conf.re"
{ opts.set_bCaseInsensitive(lex_conf_bool()); return; }
-#line 3179 "src/parse/lex_conf.cc"
+#line 3177 "src/parse/lex_conf.cc"
yy760:
++cur;
-#line 75 "../src/parse/lex_conf.re"
+#line 73 "../src/parse/lex_conf.re"
{ lex_conf_dfa_minimization(); return; }
-#line 3184 "src/parse/lex_conf.cc"
+#line 3182 "src/parse/lex_conf.cc"
yy762:
yych = (unsigned char)*++cur;
if (yych == 't') goto yy774;
if (yych == 'p') goto yy775;
goto yy14;
yy764:
- yych = (unsigned char)*++cur;
+ ++cur;
goto yy103;
yy765:
yych = (unsigned char)*++cur;
goto yy14;
yy766:
++cur;
-#line 92 "../src/parse/lex_conf.re"
+#line 90 "../src/parse/lex_conf.re"
{ opts.set_state_get_naked (lex_conf_bool()); return; }
-#line 3204 "src/parse/lex_conf.cc"
+#line 3202 "src/parse/lex_conf.cc"
yy768:
yych = (unsigned char)*++cur;
if (yych == 'a') goto yy777;
goto yy14;
yy770:
++cur;
-#line 94 "../src/parse/lex_conf.re"
+#line 92 "../src/parse/lex_conf.re"
{ opts.set_state_set_naked (lex_conf_bool()); return; }
-#line 3217 "src/parse/lex_conf.cc"
+#line 3215 "src/parse/lex_conf.cc"
yy772:
++cur;
-#line 95 "../src/parse/lex_conf.re"
+#line 93 "../src/parse/lex_conf.re"
{ opts.set_state_set_arg (lex_conf_string ()); return; }
-#line 3222 "src/parse/lex_conf.cc"
+#line 3220 "src/parse/lex_conf.cc"
yy774:
yych = (unsigned char)*++cur;
if (yych == 'e') goto yy779;
goto yy14;
yy779:
++cur;
-#line 57 "../src/parse/lex_conf.re"
+#line 55 "../src/parse/lex_conf.re"
{ opts.set_bNoGenerationDate(lex_conf_bool()); return; }
-#line 3247 "src/parse/lex_conf.cc"
+#line 3245 "src/parse/lex_conf.cc"
yy781:
yych = (unsigned char)*++cur;
if (yych == 'i') goto yy785;
goto yy14;
yy788:
++cur;
-#line 81 "../src/parse/lex_conf.re"
+#line 79 "../src/parse/lex_conf.re"
{ opts.set_cond_set_arg (lex_conf_string ()); return; }
-#line 3280 "src/parse/lex_conf.cc"
+#line 3278 "src/parse/lex_conf.cc"
yy790:
yych = (unsigned char)*++cur;
if (yych == 'g') goto yy795;
goto yy14;
yy791:
++cur;
-#line 79 "../src/parse/lex_conf.re"
+#line 77 "../src/parse/lex_conf.re"
{ opts.set_cond_get_naked (lex_conf_bool()); return; }
-#line 3289 "src/parse/lex_conf.cc"
+#line 3287 "src/parse/lex_conf.cc"
yy793:
++cur;
-#line 82 "../src/parse/lex_conf.re"
+#line 80 "../src/parse/lex_conf.re"
{ opts.set_cond_set_naked (lex_conf_bool()); return; }
-#line 3294 "src/parse/lex_conf.cc"
+#line 3292 "src/parse/lex_conf.cc"
yy795:
++cur;
-#line 61 "../src/parse/lex_conf.re"
+#line 59 "../src/parse/lex_conf.re"
{ opts.set_bijective_mapping(!lex_conf_bool()); return; }
-#line 3299 "src/parse/lex_conf.cc"
+#line 3297 "src/parse/lex_conf.cc"
}
-#line 170 "../src/parse/lex_conf.re"
+#line 168 "../src/parse/lex_conf.re"
}
{
lex_conf_assign ();
-#line 3309 "src/parse/lex_conf.cc"
+#line 3307 "src/parse/lex_conf.cc"
{
unsigned char yych;
if ((lim - cur) < 10) fill(10);
}
++cur;
yy800:
-#line 177 "../src/parse/lex_conf.re"
+#line 175 "../src/parse/lex_conf.re"
{ fatal("bad configuration value"
" (expected: 'ignore', 'substitute', 'fail')"); }
-#line 3325 "src/parse/lex_conf.cc"
+#line 3323 "src/parse/lex_conf.cc"
yy801:
yych = (unsigned char)*(ptr = ++cur);
if (yych == 'a') goto yy804;
goto yy805;
yy811:
++cur;
-#line 181 "../src/parse/lex_conf.re"
+#line 179 "../src/parse/lex_conf.re"
{ opts.set_encoding_policy(Enc::POLICY_FAIL); goto end; }
-#line 3368 "src/parse/lex_conf.cc"
+#line 3366 "src/parse/lex_conf.cc"
yy813:
yych = (unsigned char)*++cur;
if (yych == 'r') goto yy815;
goto yy805;
yy817:
++cur;
-#line 179 "../src/parse/lex_conf.re"
+#line 177 "../src/parse/lex_conf.re"
{ opts.set_encoding_policy(Enc::POLICY_IGNORE); goto end; }
-#line 3389 "src/parse/lex_conf.cc"
+#line 3387 "src/parse/lex_conf.cc"
yy819:
yych = (unsigned char)*++cur;
if (yych != 't') goto yy805;
yych = (unsigned char)*++cur;
if (yych != 'e') goto yy805;
++cur;
-#line 180 "../src/parse/lex_conf.re"
+#line 178 "../src/parse/lex_conf.re"
{ opts.set_encoding_policy(Enc::POLICY_SUBSTITUTE); goto end; }
-#line 3402 "src/parse/lex_conf.cc"
+#line 3400 "src/parse/lex_conf.cc"
}
-#line 182 "../src/parse/lex_conf.re"
+#line 180 "../src/parse/lex_conf.re"
end:
lex_conf_semicolon();
{
lex_conf_assign ();
-#line 3414 "src/parse/lex_conf.cc"
+#line 3412 "src/parse/lex_conf.cc"
{
unsigned char yych;
if ((lim - cur) < 7) fill(7);
yy827:
++cur;
yy828:
-#line 191 "../src/parse/lex_conf.re"
+#line 189 "../src/parse/lex_conf.re"
{ fatal("bad configuration value"
" (expected: 'default', 'custom')"); }
-#line 3428 "src/parse/lex_conf.cc"
+#line 3426 "src/parse/lex_conf.cc"
yy829:
yych = (unsigned char)*(ptr = ++cur);
if (yych == 'u') goto yy831;
goto yy832;
yy840:
++cur;
-#line 194 "../src/parse/lex_conf.re"
+#line 192 "../src/parse/lex_conf.re"
{ opts.set_input_api(InputAPI::CUSTOM); goto end; }
-#line 3475 "src/parse/lex_conf.cc"
+#line 3473 "src/parse/lex_conf.cc"
yy842:
yych = (unsigned char)*++cur;
if (yych != 't') goto yy832;
++cur;
-#line 193 "../src/parse/lex_conf.re"
+#line 191 "../src/parse/lex_conf.re"
{ opts.set_input_api(InputAPI::DEFAULT); goto end; }
-#line 3482 "src/parse/lex_conf.cc"
+#line 3480 "src/parse/lex_conf.cc"
}
-#line 195 "../src/parse/lex_conf.re"
+#line 193 "../src/parse/lex_conf.re"
end:
lex_conf_semicolon();
{
lex_conf_assign ();
-#line 3494 "src/parse/lex_conf.cc"
+#line 3492 "src/parse/lex_conf.cc"
{
unsigned char yych;
if ((lim - cur) < 11) fill(11);
if (yych == 'm') goto yy850;
++cur;
yy848:
-#line 204 "../src/parse/lex_conf.re"
+#line 202 "../src/parse/lex_conf.re"
{ fatal("bad configuration value"
" (expected: 'match-empty', 'match-none', 'error')"); }
-#line 3506 "src/parse/lex_conf.cc"
+#line 3504 "src/parse/lex_conf.cc"
yy849:
yych = (unsigned char)*(ptr = ++cur);
if (yych == 'r') goto yy851;
goto yy852;
yy858:
++cur;
-#line 208 "../src/parse/lex_conf.re"
+#line 206 "../src/parse/lex_conf.re"
{ opts.set_empty_class_policy(EMPTY_CLASS_ERROR); goto end; }
-#line 3545 "src/parse/lex_conf.cc"
+#line 3543 "src/parse/lex_conf.cc"
yy860:
yych = (unsigned char)*++cur;
if (yych != '-') goto yy852;
goto yy852;
yy869:
++cur;
-#line 207 "../src/parse/lex_conf.re"
+#line 205 "../src/parse/lex_conf.re"
{ opts.set_empty_class_policy(EMPTY_CLASS_MATCH_NONE); goto end; }
-#line 3585 "src/parse/lex_conf.cc"
+#line 3583 "src/parse/lex_conf.cc"
yy871:
++cur;
-#line 206 "../src/parse/lex_conf.re"
+#line 204 "../src/parse/lex_conf.re"
{ opts.set_empty_class_policy(EMPTY_CLASS_MATCH_EMPTY); goto end; }
-#line 3590 "src/parse/lex_conf.cc"
+#line 3588 "src/parse/lex_conf.cc"
}
-#line 209 "../src/parse/lex_conf.re"
+#line 207 "../src/parse/lex_conf.re"
end:
lex_conf_semicolon();
{
lex_conf_assign ();
-#line 3602 "src/parse/lex_conf.cc"
+#line 3600 "src/parse/lex_conf.cc"
{
unsigned char yych;
if ((lim - cur) < 5) fill(5);
if (yych == 't') goto yy878;
++cur;
yy876:
-#line 218 "../src/parse/lex_conf.re"
+#line 216 "../src/parse/lex_conf.re"
{ fatal("bad configuration value"
" (expected: 'table', 'moore')"); }
-#line 3614 "src/parse/lex_conf.cc"
+#line 3612 "src/parse/lex_conf.cc"
yy877:
yych = (unsigned char)*(ptr = ++cur);
if (yych == 'o') goto yy879;
goto yy880;
yy886:
++cur;
-#line 221 "../src/parse/lex_conf.re"
+#line 219 "../src/parse/lex_conf.re"
{ opts.set_dfa_minimization(DFA_MINIMIZATION_MOORE); goto end; }
-#line 3653 "src/parse/lex_conf.cc"
+#line 3651 "src/parse/lex_conf.cc"
yy888:
++cur;
-#line 220 "../src/parse/lex_conf.re"
+#line 218 "../src/parse/lex_conf.re"
{ opts.set_dfa_minimization(DFA_MINIMIZATION_TABLE); goto end; }
-#line 3658 "src/parse/lex_conf.cc"
+#line 3656 "src/parse/lex_conf.cc"
}
-#line 222 "../src/parse/lex_conf.re"
+#line 220 "../src/parse/lex_conf.re"
end:
lex_conf_semicolon();
void Scanner::lex_conf_assign ()
{
-#line 3681 "src/parse/lex_conf.cc"
+#line 3679 "src/parse/lex_conf.cc"
{
unsigned char yych;
static const unsigned char yybm[] = {
}
++cur;
yy893:
-#line 242 "../src/parse/lex_conf.re"
+#line 240 "../src/parse/lex_conf.re"
{ fatal ("missing '=' in configuration"); }
-#line 3730 "src/parse/lex_conf.cc"
+#line 3728 "src/parse/lex_conf.cc"
yy894:
yych = (unsigned char)*(ptr = ++cur);
if (yych <= 0x1F) {
if (yybm[0+yych] & 128) {
goto yy895;
}
-#line 243 "../src/parse/lex_conf.re"
+#line 241 "../src/parse/lex_conf.re"
{ return; }
-#line 3749 "src/parse/lex_conf.cc"
+#line 3747 "src/parse/lex_conf.cc"
yy898:
++cur;
if (lim <= cur) fill(1);
cur = ptr;
goto yy893;
}
-#line 244 "../src/parse/lex_conf.re"
+#line 242 "../src/parse/lex_conf.re"
}
void Scanner::lex_conf_semicolon ()
{
-#line 3770 "src/parse/lex_conf.cc"
+#line 3768 "src/parse/lex_conf.cc"
{
unsigned char yych;
static const unsigned char yybm[] = {
}
++cur;
yy904:
-#line 250 "../src/parse/lex_conf.re"
+#line 248 "../src/parse/lex_conf.re"
{ fatal ("missing ending ';' in configuration"); }
-#line 3819 "src/parse/lex_conf.cc"
+#line 3817 "src/parse/lex_conf.cc"
yy905:
yych = (unsigned char)*(ptr = ++cur);
if (yybm[0+yych] & 128) {
if (yych != ';') goto yy904;
yy906:
++cur;
-#line 251 "../src/parse/lex_conf.re"
+#line 249 "../src/parse/lex_conf.re"
{ return; }
-#line 3830 "src/parse/lex_conf.cc"
+#line 3828 "src/parse/lex_conf.cc"
yy908:
++cur;
if (lim <= cur) fill(1);
cur = ptr;
goto yy904;
}
-#line 252 "../src/parse/lex_conf.re"
+#line 250 "../src/parse/lex_conf.re"
}
lex_conf_assign ();
tok = cur;
-#line 3856 "src/parse/lex_conf.cc"
+#line 3854 "src/parse/lex_conf.cc"
{
unsigned char yych;
static const unsigned char yybm[] = {
yy915:
++cur;
yy916:
-#line 266 "../src/parse/lex_conf.re"
+#line 264 "../src/parse/lex_conf.re"
{
int32_t n = 0;
if (!s_to_i32_unsafe (tok, cur, n))
lex_conf_semicolon ();
return n;
}
-#line 3920 "src/parse/lex_conf.cc"
+#line 3918 "src/parse/lex_conf.cc"
yy917:
++cur;
if (lim <= cur) fill(1);
}
goto yy916;
}
-#line 275 "../src/parse/lex_conf.re"
+#line 273 "../src/parse/lex_conf.re"
}
std::string s;
tok = cur;
-#line 3940 "src/parse/lex_conf.cc"
+#line 3938 "src/parse/lex_conf.cc"
{
unsigned char yych;
static const unsigned char yybm[] = {
if (yych != ';') goto yy922;
}
}
-#line 302 "../src/parse/lex_conf.re"
+#line 300 "../src/parse/lex_conf.re"
{ goto end; }
-#line 3996 "src/parse/lex_conf.cc"
+#line 3994 "src/parse/lex_conf.cc"
yy922:
++cur;
if (lim <= cur) fill(1);
if (yybm[0+yych] & 128) {
goto yy922;
}
-#line 298 "../src/parse/lex_conf.re"
+#line 296 "../src/parse/lex_conf.re"
{
s = std::string(tok, tok_len());
goto end;
}
-#line 4009 "src/parse/lex_conf.cc"
+#line 4007 "src/parse/lex_conf.cc"
yy925:
++cur;
-#line 284 "../src/parse/lex_conf.re"
+#line 282 "../src/parse/lex_conf.re"
{
const char quote = tok[0];
for (bool end;;) {
}
}
}
-#line 4027 "src/parse/lex_conf.cc"
+#line 4025 "src/parse/lex_conf.cc"
}
-#line 303 "../src/parse/lex_conf.re"
+#line 301 "../src/parse/lex_conf.re"
end:
lex_conf_semicolon ();
#include <vector>
#include "src/codegen/output.h"
-#include "src/conf/opt.h"
#include "src/globals.h"
#include "src/ir/compile.h"
#include "src/ir/adfa/adfa.h"
void context_check(CondList *clist)
{
- if (!opts->cFlag)
+ if (!in->opts->cFlag)
{
delete clist;
in->fatal("conditions are only allowed when using -c switch");
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 157, 157, 159, 160, 161, 166, 173, 178, 181,
- 185, 185, 188, 197, 208, 212, 218, 224, 231, 240,
- 248, 258, 269, 275, 281, 284, 291, 297, 307, 310,
- 317, 321, 327, 331, 338, 342, 349, 353, 360, 364,
- 381, 400, 404, 408, 412, 419, 429, 433
+ 0, 156, 156, 158, 159, 160, 165, 172, 177, 180,
+ 184, 184, 187, 196, 207, 211, 217, 223, 230, 239,
+ 247, 257, 268, 274, 280, 283, 290, 296, 306, 309,
+ 316, 320, 326, 330, 337, 341, 348, 352, 359, 363,
+ 380, 399, 403, 407, 411, 418, 428, 432
};
#endif
case 12:
{
- if (opts->cFlag) {
+ if (in->opts->cFlag) {
in->fatal("condition or '<*>' required when using -c switch");
}
(yyvsp[(1) - (2)].rule)->info = new RuleInfo((yyvsp[(2) - (2)].code)->loc, (yyvsp[(2) - (2)].code), NULL);
case 13:
{
- if (opts->cFlag) {
+ if (in->opts->cFlag) {
in->fatal("condition or '<*>' required when using -c switch");
}
RegExpRule *def = new RegExpRule(in->mkDefault());
{
std::map<std::string, smart_ptr<DFA> > dfa_map;
ScannerState rules_state;
+ Opt &opts = i.opts;
in = &i;
#include "src/codegen/bitmap.h"
#include "src/codegen/go.h"
#include "src/codegen/output.h"
-#include "src/conf/opt.h"
#include "src/globals.h"
namespace re2c
void BitMap::gen(OutputFile & o, uint32_t ind, uint32_t lb, uint32_t ub)
{
+ Opt &opts = o.opts;
if (first && bUsedYYBitmap)
{
o.wind(ind).ws("static const unsigned char ").wstring(opts->yybm).ws("[] = {");
void gen_goto_plain(OutputFile &o, uint32_t ind, const State *to, const DFA &dfa, tcid_t tcid);
void gen_goto_case(OutputFile &o, uint32_t ind, const State *to, const DFA &dfa, tcid_t tcid);
void gen_goto_if(OutputFile &o, uint32_t ind, const State *to, const DFA &dfa, tcid_t tcid);
-void gen_settags(code_lines_t &code, const DFA &dfa, tcid_t tcid);
-std::string vartag_name(tagver_t ver);
-std::string vartag_expr(tagver_t ver);
+void gen_settags(code_lines_t &code, const DFA &dfa, tcid_t tcid, Opt &opts);
+std::string vartag_name(tagver_t ver, const std::string &prefix);
+std::string vartag_expr(tagver_t ver, const std::string &prefix, const std::string &expression);
+
+inline std::string indent(uint32_t n, const std::string s)
+{
+ std::string ind;
+ for (; n --> 0; ind += s);
+ return ind;
+}
} // namespace re2c
#include "src/codegen/emit.h"
#include "src/codegen/input_api.h"
#include "src/codegen/output.h"
-#include "src/conf/opt.h"
#include "src/globals.h"
#include "src/ir/adfa/action.h"
#include "src/ir/adfa/adfa.h"
static void emit_accept_binary(OutputFile &o, uint32_t ind, const DFA &dfa, const State *s, size_t l, size_t r);
static void emit_accept(OutputFile &o, uint32_t ind, const DFA &dfa, const State *s);
static void emit_rule(OutputFile &o, uint32_t ind, const DFA &dfa, size_t rule_idx);
-static void gen_goto(code_lines_t &code, const State *to, const DFA &dfa, tcid_t tcid);
+static void gen_goto(code_lines_t &code, const State *to, const DFA &dfa, tcid_t tcid, Opt &opts);
static void gen_fintags(OutputFile &o, uint32_t ind, const DFA &dfa, const Rule &rule);
static bool endstate(const State *s);
void emit_match(OutputFile &o, uint32_t ind, const State *s)
{
+ Opt &opts = o.opts;
if (s->fill != 0) {
- o.wstring(opts->input_api.stmt_skip(ind));
+ o.wstring(opts->input_api.stmt_skip(ind, opts));
need(o, ind, s->fill);
- o.wstring(opts->input_api.stmt_peek(ind));
+ o.wstring(opts->input_api.stmt_peek(ind, opts));
} else if (endstate(s)) {
- o.wstring(opts->input_api.stmt_skip(ind));
+ o.wstring(opts->input_api.stmt_skip(ind, opts));
} else {
- o.wstring(opts->input_api.stmt_skip_peek(ind));
+ o.wstring(opts->input_api.stmt_skip_peek(ind, opts));
}
}
void emit_initial(OutputFile &o, uint32_t ind, const State *s,
const std::set<label_t> &used_labels, bool save_yyaccept)
{
+ Opt &opts = o.opts;
const Initial &init = *s->action.info.initial;
const label_t label = init.label;
const size_t save = init.save;
o.wind(ind).wstring(opts->yyaccept).ws(" = ")
.wu64(save).ws(";\n");
}
- o.wstring(opts->input_api.stmt_skip(ind));
+ o.wstring(opts->input_api.stmt_skip(ind, opts));
}
if (used_labels.count(label)) {
need(o, ind, s->fill);
if (backup) {
- o.wstring(opts->input_api.stmt_backup_peek(ind));
+ o.wstring(opts->input_api.stmt_backup_peek(ind, opts));
} else {
- o.wstring(opts->input_api.stmt_peek(ind));
+ o.wstring(opts->input_api.stmt_peek(ind, opts));
}
}
void emit_save(OutputFile &o, uint32_t ind, const State *const s,
bool save_yyaccept)
{
+ Opt &opts = o.opts;
+
if (save_yyaccept) {
o.wind(ind).wstring(opts->yyaccept).ws(" = ")
.wu64(s->action.info.save).ws(";\n");
}
if (s->fill != 0) {
- o.wstring(opts->input_api.stmt_skip_backup(ind));
+ o.wstring(opts->input_api.stmt_skip_backup(ind, opts));
need(o, ind, s->fill);
- o.wstring(opts->input_api.stmt_peek(ind));
+ o.wstring(opts->input_api.stmt_peek(ind, opts));
} else {
- o.wstring(opts->input_api.stmt_skip_backup_peek(ind));
+ o.wstring(opts->input_api.stmt_skip_backup_peek(ind, opts));
}
}
void emit_accept_binary(OutputFile &o, uint32_t ind, const DFA &dfa,
const State *s, size_t l, size_t r)
{
+ Opt &opts = o.opts;
if (l < r) {
const size_t m = (l + r) >> 1;
o.wind(ind).ws("if (").wstring(opts->yyaccept)
void emit_accept(OutputFile &o, uint32_t ind, const DFA &dfa, const State *s)
{
+ Opt &opts = o.opts;
const accept_t &acc = *s->action.info.accepts;
const size_t nacc = acc.size();
return;
}
- o.wstring(opts->input_api.stmt_restore(ind));
+ o.wstring(opts->input_api.stmt_restore(ind, opts));
// only one possible 'yyaccept' value: unconditional jump
if (nacc == 1) {
void emit_rule(OutputFile &o, uint32_t ind, const DFA &dfa, size_t rule_idx)
{
+ Opt &opts = o.opts;
const Rule &rule = dfa.rules[rule_idx];
const std::string &cond = rule.info->newcond;
const Code *code = rule.info->code;
{
assert(some > 0);
+ Opt &opts = o.opts;
std::string s;
if (opts->fFlag) {
if (opts->fill_use) {
o.wind(ind);
if (opts->fill_check) {
- o.ws("if (").wstring(opts->input_api.expr_lessthan(some)).ws(") ");
+ o.ws("if (").wstring(opts->input_api.expr_lessthan(some, opts)).ws(") ");
}
strrreplace(s = opts->fill, opts->fill_arg, some);
o.wstring(s);
const DFA &dfa, tcid_t tcid)
{
code_lines_t code;
- gen_goto(code, to, dfa, tcid);
+ gen_goto(code, to, dfa, tcid, o.opts);
const size_t lines = code.size();
if (lines == 1) {
const DFA &dfa, tcid_t tcid)
{
code_lines_t code;
- gen_goto(code, to, dfa, tcid);
+ gen_goto(code, to, dfa, tcid, o.opts);
const size_t lines = code.size();
if (lines == 1) {
const DFA &dfa, tcid_t tcid)
{
code_lines_t code;
- gen_goto(code, to, dfa, tcid);
+ gen_goto(code, to, dfa, tcid, o.opts);
const size_t lines = code.size();
for (size_t i = 0; i < lines; ++i) {
}
void gen_goto(code_lines_t &code, const State *to, const DFA &dfa,
- tcid_t tcid)
+ tcid_t tcid, Opt &opts)
{
- gen_settags(code, dfa, tcid);
+ gen_settags(code, dfa, tcid, opts);
if (to) {
code.push_back("goto " + opts->labelPrefix
+ to_string(to->label) + ";\n");
}
}
-void gen_settags(code_lines_t &code, const DFA &dfa, tcid_t tcid)
+void gen_settags(code_lines_t &code, const DFA &dfa, tcid_t tcid, Opt &opts)
{
const bool generic = opts->input_api.type() == InputAPI::CUSTOM;
+ const std::string
+ &prefix = opts->tags_prefix,
+ &expression = opts->tags_expression;
const tccmd_t &cmd = dfa.tcpool[tcid];
const tagsave_t *tsave = cmd.save;
const tagcopy_t *tcopy = cmd.copy;
// copy commands
for (const tagcopy_t *p = tcopy; p; p = p->next) {
const std::string
- l = vartag_expr(p->lhs),
- r = vartag_expr(p->rhs),
+ l = vartag_expr(p->lhs, prefix, expression),
+ r = vartag_expr(p->rhs, prefix, expression),
s = generic
? opts->yycopytag + " (" + l + ", " + r + ");\n"
: l + " = " + r + ";\n";
if (generic) {
for (const tagsave_t *p = tsave; p; p = p->next) {
const std::string
- v = vartag_expr(p->ver),
+ v = vartag_expr(p->ver, prefix, expression),
s = p->bottom
? opts->yycopytag + " (" + v + ", " + opts->tags_default + ");\n"
: opts->yybackuptag + " (" + v + ");\n";
} else if (tsave) {
std::string s1 = "", s2 = "";
for (const tagsave_t *p = tsave; p; p = p->next) {
- const std::string v = vartag_expr(p->ver);
+ const std::string v = vartag_expr(p->ver, prefix, expression);
if (p->bottom) {
s1 += v + " = ";
} else {
void gen_fintags(OutputFile &o, uint32_t ind, const DFA &dfa, const Rule &rule)
{
+ Opt &opts = o.opts;
const bool generic = opts->input_api.type() == InputAPI::CUSTOM;
+ const std::string
+ &prefix = opts->tags_prefix,
+ &expression = opts->tags_expression;
const std::vector<VarTag> &vartags = dfa.vartags;
const std::vector<FixTag> &fixtags = dfa.fixtags;
const tagver_t *fins = dfa.finvers;
if (tag.name) {
const std::string
name = *tag.name,
- expr = vartag_expr(fins[t]);
+ expr = vartag_expr(fins[t], prefix, expression);
if (generic) {
o.wstring(opts->yycopytag).ws(" (").wstring(name)
.ws(", ").wstring(expr).ws(")");
o.wstring(opts->yycursor).ws(" = ").wstring(opts->yyctxmarker);
}
} else {
- const std::string expr = vartag_expr(fins[t]);
+ const std::string expr = vartag_expr(fins[t], prefix, expression);
if (generic) {
o.wstring(opts->yyrestoretag).ws(" (").wstring(expr).ws(")");
} else {
// to '(YYCURSOR - tag)'
o.wstring(opts->yycursor).ws(" - ").wu64(tag.dist);
} else {
- o.wstring(vartag_expr(fins[tag.base])).ws(" - ").wu64(tag.dist);
+ o.wstring(vartag_expr(fins[tag.base], prefix, expression))
+ .ws(" - ").wu64(tag.dist);
}
} else {
o.wstring(opts->yycursor).ws(" -= ").wu64(tag.dist);
#include "src/codegen/input_api.h"
#include "src/codegen/label.h"
#include "src/codegen/output.h"
-#include "src/conf/opt.h"
#include "src/globals.h"
#include "src/ir/adfa/action.h"
#include "src/ir/adfa/adfa.h"
namespace re2c
{
-static std::string genGetCondition ();
+static std::string genGetCondition (Opt &opts);
static void genCondGotoSub (OutputFile & o, uint32_t ind, const std::vector<std::string> & condnames, uint32_t cMin, uint32_t cMax);
static void genCondTable (OutputFile & o, uint32_t ind, const std::vector<std::string> & condnames);
static void genCondGoto (OutputFile & o, uint32_t ind, const std::vector<std::string> & condnames);
static void emit_state (OutputFile & o, uint32_t ind, const State * s, bool used_label);
-std::string genGetCondition()
+std::string genGetCondition(Opt &opts)
{
return opts->cond_get_naked
? opts->cond_get
void emit_state (OutputFile & o, uint32_t ind, const State * s, bool used_label)
{
+ Opt &opts = o.opts;
if (used_label)
{
o.wstring(opts->labelPrefix).wlabel(s->label).ws(":\n");
}
if (opts->dFlag && (s->action.type != Action::INITIAL))
{
- o.wind(ind).wstring(opts->yydebug).ws("(").wlabel(s->label).ws(", ").wstring(opts->input_api.expr_peek ()).ws(");\n");
+ o.wind(ind).wstring(opts->yydebug).ws("(").wlabel(s->label).ws(", ").wstring(opts->input_api.expr_peek(opts)).ws(");\n");
}
}
-void DFA::count_used_labels (std::set<label_t> & used, label_t start, label_t initial, bool force_start) const
+void DFA::count_used_labels (std::set<label_t> & used, label_t start,
+ label_t initial, bool force_start, bool fFlag) const
{
// In '-f' mode, default state is always state 0
- if (opts->fFlag)
+ if (fFlag)
{
used.insert (label_t::first ());
}
// has a piece of code that advances input position. Wee must
// skip it when entering DFA.
if (used_labels.count(head->label)) {
- o.wind(ind).ws("goto ").wstring(opts->labelPrefix)
+ o.wind(ind).ws("goto ").wstring(o.opts->labelPrefix)
.wlabel(initial).ws(";\n");
}
bool last_cond,
const std::vector<std::string> &conds) const
{
+ Opt &opts = o.opts;
if (!opts->cFlag || !bWroteCondCheck) {
o.ws("digraph re2c {\n");
}
{
OutputFile &o = output.source;
OutputBlock &ob = o.block();
-
+ Opt &opts = o.opts;
std::set<std::string> tagnames, tagvars;
if (!oldstyle_ctxmarker) {
for (size_t i = 0; i < vartags.size(); ++i) {
}
}
for (tagver_t v = 1; v <= maxtagver; ++v) {
- tagnames.insert(vartag_name(v));
+ tagnames.insert(vartag_name(v, opts->tags_prefix));
}
ob.tags.insert(tagnames.begin(), tagnames.end());
}
s->label = o.label_counter.next ();
}
std::set<label_t> used_labels;
- count_used_labels (used_labels, start_label, initial_label, ob.force_start_label);
+ count_used_labels (used_labels, start_label, initial_label, ob.force_start_label, opts->fFlag);
head->action.set_initial(initial_label);
void genCondTable(OutputFile & o, uint32_t ind, const std::vector<std::string> & condnames)
{
+ Opt &opts = o.opts;
const size_t conds = condnames.size ();
o.wind(ind++).ws("static void *").wstring(opts->yyctable).ws("[").wu64(conds).ws("] = {\n");
for (size_t i = 0; i < conds; ++i)
void genCondGotoSub(OutputFile & o, uint32_t ind, const std::vector<std::string> & condnames, uint32_t cMin, uint32_t cMax)
{
+ Opt &opts = o.opts;
if (cMin == cMax)
{
o.wind(ind).ws("goto ").wstring(opts->condPrefix).wstring(condnames[cMin]).ws(";\n");
{
uint32_t cMid = cMin + ((cMax - cMin + 1) / 2);
- o.wind(ind).ws("if (").wstring(genGetCondition()).ws(" < ").wu32(cMid).ws(") {\n");
+ o.wind(ind).ws("if (").wstring(genGetCondition(opts)).ws(" < ").wu32(cMid).ws(") {\n");
genCondGotoSub(o, ind + 1, condnames, cMin, cMid - 1);
o.wind(ind).ws("} else {\n");
genCondGotoSub(o, ind + 1, condnames, cMid, cMax);
*/
void genCondGoto(OutputFile & o, uint32_t ind, const std::vector<std::string> & condnames)
{
+ Opt &opts = o.opts;
const size_t conds = condnames.size ();
if (opts->gFlag)
{
- o.wind(ind).ws("goto *").wstring(opts->yyctable).ws("[").wstring(genGetCondition()).ws("];\n");
+ o.wind(ind).ws("goto *").wstring(opts->yyctable).ws("[").wstring(genGetCondition(opts)).ws("];\n");
}
else if (opts->sFlag)
{
else
{
o.warn_condition_order = false; // see note [condition order]
- o.wind(ind).ws("switch (").wstring(genGetCondition()).ws(") {\n");
+ o.wind(ind).ws("switch (").wstring(genGetCondition(opts)).ws(") {\n");
for (size_t i = 0; i < conds; ++i)
{
const std::string & cond = condnames[i];
bWroteCondCheck = true;
}
-std::string vartag_name(tagver_t ver)
+std::string vartag_name(tagver_t ver, const std::string &prefix)
{
std::ostringstream s;
- s << opts->tags_prefix << ver;
+ s << prefix << ver;
return s.str();
}
-std::string vartag_expr(tagver_t ver)
+std::string vartag_expr(tagver_t ver, const std::string &prefix, const std::string &expression)
{
- const std::string s = vartag_name(ver);
- std::string e = opts->tags_expression;
+ const std::string s = vartag_name(ver, prefix);
+ std::string e = expression;
strrreplace(e, "@@", s);
return e;
}
Cases * cases;
If * ifs;
} info;
- SwitchIf (const Span * sp, uint32_t nsp, const State * next);
+ SwitchIf (const Span * sp, uint32_t nsp, const State * next, bool sflag);
~SwitchIf ();
void emit (OutputFile & o, uint32_t ind, const DFA &dfa);
void used_labels (std::set<label_t> & used);
const State * bitmap_state;
SwitchIf * hgo;
SwitchIf * lgo;
- GoBitmap (const Span * span, uint32_t nSpans, const Span * hspan, uint32_t hSpans, const BitMap * bm, const State * bm_state, const State * next);
+ GoBitmap (const Span * span, uint32_t nSpans, const Span * hspan,
+ uint32_t hSpans, const BitMap * bm, const State * bm_state,
+ const State * next, bool sflag);
~GoBitmap ();
void emit (OutputFile & o, uint32_t ind, const DFA &dfa);
void used_labels (std::set<label_t> & used);
{
SwitchIf * hgo;
CpgotoTable * table;
- Cpgoto (const Span * span, uint32_t nSpans, const Span * hspan, uint32_t hSpans, const State * next);
+ Cpgoto (const Span * span, uint32_t nSpans, const Span * hspan,
+ uint32_t hSpans, const State * next, bool sflag);
~Cpgoto ();
void emit (OutputFile & o, uint32_t ind, const DFA &dfa);
void used_labels (std::set<label_t> & used);
Go ();
~Go ();
- void init (const State * from);
+ void init (const State * from, Opt &opts);
void emit (OutputFile & o, uint32_t ind, const DFA &dfa);
void used_labels (std::set<label_t> & used);
#include "src/codegen/bitmap.h"
#include "src/codegen/go.h"
-#include "src/conf/opt.h"
#include "src/globals.h"
#include "src/ir/adfa/adfa.h"
#include "src/util/allocate.h"
}
}
-SwitchIf::SwitchIf (const Span * sp, uint32_t nsp, const State * next)
+SwitchIf::SwitchIf (const Span * sp, uint32_t nsp, const State * next, bool sflag)
: type (IF)
, info ()
{
- if ((!opts->sFlag && nsp > 2) || (nsp > 8 && (sp[nsp - 2].ub - sp[0].ub <= 3 * (nsp - 2))))
+ if ((!sflag && nsp > 2) || (nsp > 8 && (sp[nsp - 2].ub - sp[0].ub <= 3 * (nsp - 2))))
{
type = SWITCH;
info.cases = new Cases (sp, nsp);
}
}
-GoBitmap::GoBitmap (const Span * span, uint32_t nSpans, const Span * hspan, uint32_t hSpans, const BitMap * bm, const State * bm_state, const State * next)
+GoBitmap::GoBitmap (const Span * span, uint32_t nSpans, const Span * hspan,
+ uint32_t hSpans, const BitMap * bm, const State * bm_state,
+ const State * next, bool sflag)
: bitmap (bm)
, bitmap_state (bm_state)
, hgo (NULL)
uint32_t bSpans = unmap (bspan, span, nSpans, bm_state);
lgo = bSpans == 0
? NULL
- : new SwitchIf (bspan, bSpans, next);
+ : new SwitchIf (bspan, bSpans, next, sflag);
// if there are any low spans, then next state for high spans
// must be NULL to trigger explicit goto generation in linear 'if'
hgo = hSpans == 0
? NULL
- : new SwitchIf (hspan, hSpans, lgo ? NULL : next);
+ : new SwitchIf (hspan, hSpans, lgo ? NULL : next, sflag);
operator delete (bspan);
}
}
}
-Cpgoto::Cpgoto (const Span * span, uint32_t nSpans, const Span * hspan, uint32_t hSpans, const State * next)
- : hgo (hSpans == 0 ? NULL : new SwitchIf (hspan, hSpans, next))
+Cpgoto::Cpgoto (const Span * span, uint32_t nSpans, const Span * hspan,
+ uint32_t hSpans, const State * next, bool sflag)
+ : hgo (hSpans == 0 ? NULL : new SwitchIf (hspan, hSpans, next, sflag))
, table (new CpgotoTable (span, nSpans))
{}
, info ()
{}
-void Go::init (const State * from)
+void Go::init (const State * from, Opt &opts)
{
if (nSpans == 0)
{
else if (opts->gFlag && (dSpans >= opts->cGotoThreshold) && !low_spans_have_tags)
{
type = CPGOTO;
- info.cpgoto = new Cpgoto (span, nSpans, hspan, hSpans, from->next);
+ info.cpgoto = new Cpgoto (span, nSpans, hspan, hSpans, from->next, opts->sFlag);
}
else if (opts->bFlag && (nBitmaps > 0))
{
type = BITMAP;
- info.bitmap = new GoBitmap (span, nSpans, hspan, hSpans, bitmap, bitmap_state, from->next);
+ info.bitmap = new GoBitmap (span, nSpans, hspan, hSpans, bitmap, bitmap_state, from->next, opts->sFlag);
bUsedYYBitmap = true;
}
else
{
type = SWITCH_IF;
- info.switchif = new SwitchIf (span, nSpans, from->next);
+ info.switchif = new SwitchIf (span, nSpans, from->next, opts->sFlag);
}
}
#include "src/codegen/label.h"
#include "src/codegen/output.h"
#include "src/codegen/print.h"
-#include "src/conf/opt.h"
-#include "src/globals.h"
#include "src/ir/adfa/adfa.h"
#include "src/ir/regexp/encoding/enc.h"
void output_if (OutputFile & o, uint32_t ind, const std::string & compare, uint32_t value)
{
- o.wind(ind).ws("if (").wstring(opts->yych).ws(" ").wstring(compare).ws(" ").wc_hex (value).ws(") ");
+ o.wind(ind).ws("if (").wstring(o.opts->yych).ws(" ").wstring(compare).ws(" ").wc_hex (value).ws(") ");
}
std::string output_hgo (OutputFile & o, uint32_t ind, const DFA &dfa, SwitchIf * hgo)
{
+ Opt &opts = o.opts;
std::string yych = opts->yych;
if (hgo != NULL)
{
void Case::emit (OutputFile & o, uint32_t ind) const
{
+ Opt &opts = o.opts;
for (uint32_t i = 0; i < ranges.size (); ++i)
{
for (uint32_t b = ranges[i].first; b < ranges[i].second; ++b)
void Cases::emit(OutputFile &o, uint32_t ind, const DFA &dfa) const
{
- o.wind(ind).ws("switch (").wstring(opts->yych).ws(") {\n");
+ o.wind(ind).ws("switch (").wstring(o.opts->yych).ws(") {\n");
for (uint32_t i = 1; i < cases_size; ++i) {
const Case &c = cases[i];
void GoBitmap::emit (OutputFile & o, uint32_t ind, const DFA &dfa)
{
+ Opt &opts = o.opts;
std::string yych = output_hgo (o, ind, dfa, hgo);
o.ws("if (").wstring(opts->yybm).ws("[").wu32(bitmap->i).ws("+").wstring(yych).ws("] & ");
if (opts->yybmHexTable)
void CpgotoTable::emit (OutputFile & o, uint32_t ind)
{
+ Opt &opts = o.opts;
o.wind(ind).ws("static void *").wstring(opts->yytarget).ws("[256] = {\n");
o.wind(++ind);
const uint32_t max_digits = max_label ().width ();
std::string yych = output_hgo (o, ind, dfa, hgo);
o.ws("{\n");
table->emit (o, ++ind);
- o.wind(ind).ws("goto *").wstring(opts->yytarget).ws("[").wstring(yych).ws("];\n");
+ o.wind(ind).ws("goto *").wstring(o.opts->yytarget).ws("[").wstring(yych).ws("];\n");
o.wind(--ind).ws("}\n");
}
void Dot::emit(OutputFile &o, const DFA &dfa)
{
+ const std::string &prefix = o.opts->tags_prefix;
const uint32_t n = cases->cases_size;
if (n == 1) {
o.wlabel(from->label).ws(" -> ").wlabel(cases->cases[0].to->label).ws("\n");
}
const tccmd_t &cmd = dfa.tcpool[c.tags];
for (const tagsave_t *p = cmd.save; p; p = p->next) {
- o.ws("<").wstring(vartag_name(p->ver)).ws(">");
+ o.ws("<").wstring(vartag_name(p->ver, prefix)).ws(">");
}
for (const tagcopy_t *p = cmd.copy; p; p = p->next) {
- o.ws("<").wstring(vartag_name(p->lhs)).ws("~")
- .wstring(vartag_name(p->rhs)).ws(">");
+ o.ws("<").wstring(vartag_name(p->lhs, prefix)).ws("~")
+ .wstring(vartag_name(p->rhs, prefix)).ws(">");
}
o.ws("\"]\n");
}
void Go::emit (OutputFile & o, uint32_t ind, const DFA &dfa)
{
code_lines_t code;
- gen_settags(code, dfa, tags);
+ gen_settags(code, dfa, tags, o.opts);
for (size_t i = 0; i < code.size(); ++i) {
o.wind(ind).wstring(code[i]);
}
+++ /dev/null
-#ifndef _RE2C_CODEGEN_INDENT_
-#define _RE2C_CODEGEN_INDENT_
-
-#include <string>
-
-#include "src/globals.h"
-
-namespace re2c
-{
-
-inline std::string indent(uint32_t ind)
-{
- std::string str;
- while (ind-- > 0) {
- str += opts->indString;
- }
- return str;
-}
-
-} // end namespace re2c
-
-#endif // _RE2C_CODEGEN_INDENT_
#include "src/codegen/emit.h"
#include "src/codegen/input_api.h"
-#include "src/codegen/indent.h"
-#include "src/conf/opt.h"
-#include "src/globals.h"
namespace re2c
{
type_ = t;
}
-std::string InputAPI::expr_peek () const
+std::string InputAPI::expr_peek(Opt &opts) const
{
std::string s;
switch (type_)
return s;
}
-std::string InputAPI::stmt_peek (uint32_t ind) const
+std::string InputAPI::stmt_peek(uint32_t ind, Opt &opts) const
{
- return indent(ind) + opts->yych + " = " + opts.yychConversion()
- + expr_peek() + ";\n";
+ return indent(ind, opts->indString) + opts->yych + " = " + opts.yychConversion()
+ + expr_peek(opts) + ";\n";
}
-std::string InputAPI::stmt_skip (uint32_t ind) const
+std::string InputAPI::stmt_skip(uint32_t ind, Opt &opts) const
{
std::string s;
switch (type_)
s = opts->yyskip + " ()";
break;
}
- return indent (ind) + s + ";\n";
+ return indent(ind, opts->indString) + s + ";\n";
}
-std::string InputAPI::stmt_backup (uint32_t ind) const
+std::string InputAPI::stmt_backup(uint32_t ind, Opt &opts) const
{
std::string s;
switch (type_)
s = opts->yybackup + " ()";
break;
}
- return indent (ind) + s + ";\n";
+ return indent(ind, opts->indString) + s + ";\n";
}
-std::string InputAPI::stmt_restore (uint32_t ind) const
+std::string InputAPI::stmt_restore(uint32_t ind, Opt &opts) const
{
std::string s;
switch (type_)
s = opts->yyrestore + " ()";
break;
}
- return indent (ind) + s + ";\n";
+ return indent(ind, opts->indString) + s + ";\n";
}
-std::string InputAPI::stmt_skip_peek (uint32_t ind) const
+std::string InputAPI::stmt_skip_peek(uint32_t ind, Opt &opts) const
{
return type_ == DEFAULT
- ? indent (ind) + opts->yych + " = " + opts.yychConversion () + "*++" + opts->yycursor + ";\n"
- : stmt_skip (ind) + stmt_peek (ind);
+ ? indent(ind, opts->indString) + opts->yych + " = " + opts.yychConversion() + "*++" + opts->yycursor + ";\n"
+ : stmt_skip(ind, opts) + stmt_peek(ind, opts);
}
-std::string InputAPI::stmt_skip_backup (uint32_t ind) const
+std::string InputAPI::stmt_skip_backup(uint32_t ind, Opt &opts) const
{
return type_ == DEFAULT
- ? indent (ind) + opts->yymarker + " = ++" + opts->yycursor + ";\n"
- : stmt_skip (ind) + stmt_backup (ind);
+ ? indent(ind, opts->indString) + opts->yymarker + " = ++" + opts->yycursor + ";\n"
+ : stmt_skip(ind, opts) + stmt_backup(ind, opts);
}
-std::string InputAPI::stmt_backup_peek (uint32_t ind) const
+std::string InputAPI::stmt_backup_peek(uint32_t ind, Opt &opts) const
{
return type_ == DEFAULT
- ? indent (ind) + opts->yych + " = " + opts.yychConversion () + "*(" + opts->yymarker + " = " + opts->yycursor + ");\n"
- : stmt_backup (ind) + stmt_peek (ind);
+ ? indent(ind, opts->indString) + opts->yych + " = " + opts.yychConversion() + "*(" + opts->yymarker + " = " + opts->yycursor + ");\n"
+ : stmt_backup(ind, opts) + stmt_peek(ind, opts);
}
-std::string InputAPI::stmt_skip_backup_peek (uint32_t ind) const
+std::string InputAPI::stmt_skip_backup_peek(uint32_t ind, Opt &opts) const
{
return type_ == DEFAULT
- ? indent (ind) + opts->yych + " = " + opts.yychConversion () + "*(" + opts->yymarker + " = ++" + opts->yycursor + ");\n"
- : stmt_skip (ind) + stmt_backup (ind) + stmt_peek (ind);
+ ? indent(ind, opts->indString) + opts->yych + " = " + opts.yychConversion() + "*(" + opts->yymarker + " = ++" + opts->yycursor + ");\n"
+ : stmt_skip(ind, opts) + stmt_backup(ind, opts) + stmt_peek(ind, opts);
}
-std::string InputAPI::expr_lessthan(size_t n) const
+std::string InputAPI::expr_lessthan(size_t n, Opt &opts) const
{
std::ostringstream s;
if (type_ == CUSTOM) {
#define _RE2C_CODEGEN_INPUT_API_
#include "src/util/c99_stdint.h"
-#include <set>
#include <string>
-#include <valarray>
-
-#include "src/ir/tag.h"
namespace re2c
{
+struct Opt;
+
class InputAPI
{
public:
InputAPI ();
type_t type () const;
void set (type_t t);
- std::string expr_peek () const;
- std::string stmt_peek (uint32_t ind) const;
- std::string stmt_skip (uint32_t ind) const;
- std::string stmt_backup (uint32_t ind) const;
- std::string stmt_restore (uint32_t ind) const;
- std::string stmt_skip_peek (uint32_t ind) const;
- std::string stmt_skip_backup (uint32_t ind) const;
- std::string stmt_backup_peek (uint32_t ind) const;
- std::string stmt_skip_backup_peek (uint32_t ind) const;
- std::string expr_lessthan (size_t n) const;
+ std::string expr_peek (Opt &opts) const;
+ std::string stmt_peek (uint32_t ind, Opt &opts) const;
+ std::string stmt_skip (uint32_t ind, Opt &opts) const;
+ std::string stmt_backup (uint32_t ind, Opt &opts) const;
+ std::string stmt_restore (uint32_t ind, Opt &opts) const;
+ std::string stmt_skip_peek (uint32_t ind, Opt &opts) const;
+ std::string stmt_skip_backup (uint32_t ind, Opt &opts) const;
+ std::string stmt_backup_peek (uint32_t ind, Opt &opts) const;
+ std::string stmt_skip_backup_peek (uint32_t ind, Opt &opts) const;
+ std::string expr_lessthan (size_t n, Opt &opts) const;
};
} // end namespace re2c
#include <time.h>
#include <iomanip>
-#include "src/codegen/indent.h"
+#include "src/codegen/emit.h"
#include "src/codegen/output.h"
#include "src/codegen/print.h"
#include "src/conf/msg.h"
-#include "src/conf/opt.h"
#include "src/conf/warn.h"
#include "src/util/string_utils.h"
#include "src/globals.h"
}
}
-OutputFile::OutputFile()
+OutputFile::OutputFile(Opt &o)
: blocks ()
, label_counter ()
- , warn_condition_order (!opts->tFlag) // see note [condition order]
+ , warn_condition_order (!o->tFlag) // see note [condition order]
+ , opts(o)
{
new_block ();
}
OutputFile & OutputFile::wu32_hex (uint32_t n)
{
- prtHex (stream (), n);
+ prtHex(stream(), n, opts->encoding.szCodeUnit());
return *this;
}
OutputFile & OutputFile::wc_hex (uint32_t n)
{
- prtChOrHex (stream (), n);
+ const Enc &e = opts->encoding;
+ prtChOrHex(stream(), n, e.szCodeUnit(), e.type() == Enc::EBCDIC, opts->target == opt_t::DOT);
return *this;
}
OutputFile & OutputFile::wrange (uint32_t l, uint32_t u)
{
- printSpan (stream (), l, u);
+ const Enc &e = opts->encoding;
+ printSpan(stream(), l, u, e.szCodeUnit(), e.type() == Enc::EBCDIC, opts->target == opt_t::DOT);
return *this;
}
OutputFile & OutputFile::wline_info (uint32_t l, const char * fn)
{
- output_line_info (stream (), l, fn);
+ output_line_info (stream (), l, fn, opts);
return *this;
}
OutputFile & OutputFile::wversion_time ()
{
- output_version_time (stream ());
+ output_version_time (stream (), opts);
return *this;
}
OutputFile & OutputFile::wind (uint32_t ind)
{
- stream () << indent(ind);
+ stream () << indent(ind, opts->indString);
return *this;
}
switch (f.type) {
case OutputFragment::CODE: break;
case OutputFragment::LINE_INFO:
- output_line_info(f.stream, line_count + 1, filename);
+ output_line_info(f.stream, line_count + 1, filename, opts);
break;
case OutputFragment::STATE_GOTO:
- output_state_goto(f.stream, f.indent, 0);
+ output_state_goto(f.stream, f.indent, 0, opts);
break;
case OutputFragment::TAGS:
output_tags(f.stream, *f.tags, global_tags);
break;
case OutputFragment::TYPES:
- output_types(f.stream, f.indent, global_types);
+ output_types(f.stream, f.indent, global_types, opts);
break;
case OutputFragment::WARN_CONDITION_ORDER:
if (warn_condition_order) {// see note [condition order]
}
break;
case OutputFragment::YYACCEPT_INIT:
- output_yyaccept_init(f.stream, f.indent, b.used_yyaccept);
+ output_yyaccept_init(f.stream, f.indent, b.used_yyaccept, opts);
break;
case OutputFragment::YYMAXFILL:
output_yymaxfill(f.stream, max_fill);
return true;
}
-bool HeaderFile::emit(const uniq_vector_t<std::string> &types)
+bool HeaderFile::emit(const uniq_vector_t<std::string> &types, Opt &opts)
{
if (!opts->tFlag) {
return true;
}
}
- output_version_time(stream);
- output_line_info(stream, 3, filename);
+ output_version_time(stream, opts);
+ output_line_info(stream, 3, filename, opts);
stream << "\n";
- output_types(stream, 0, types);
+ output_types(stream, 0, types, opts);
std::string content = stream.str();
fwrite(content.c_str(), 1, content.size(), file);
return true;
}
-Output::Output()
- : source()
+Output::Output(Opt &o)
+ : source(o)
, header()
, skeletons()
, max_fill(1)
source.global_lists(types, tags);
return source.emit(types, tags, max_fill)
- && header.emit(types);
+ && header.emit(types, source.opts);
}
void output_tags(std::ostream &o, const ConfTags &conf,
}
}
-void output_state_goto (std::ostream & o, uint32_t ind, uint32_t start_label)
+void output_state_goto (std::ostream & o, uint32_t ind, uint32_t start_label, Opt &opts)
{
- o << indent(ind) << "switch (" << output_get_state() << ") {\n";
+ const std::string indstr = indent(ind, opts->indString);
+ o << indstr << "switch (" << output_get_state(opts) << ") {\n";
if (opts->bUseStateAbort)
{
- o << indent(ind) << "default: abort();\n";
- o << indent(ind) << "case -1: goto " << opts->labelPrefix << start_label << ";\n";
+ o << indstr << "default: abort();\n";
+ o << indstr << "case -1: goto " << opts->labelPrefix << start_label << ";\n";
}
else
{
- o << indent(ind) << "default: goto " << opts->labelPrefix << start_label << ";\n";
+ o << indstr << "default: goto " << opts->labelPrefix << start_label << ";\n";
}
for (uint32_t i = 0; i < last_fill_index; ++i)
{
- o << indent(ind) << "case " << i << ": goto " << opts->yyfilllabel << i << ";\n";
+ o << indstr << "case " << i << ": goto " << opts->yyfilllabel << i << ";\n";
}
- o << indent(ind) << "}\n";
+ o << indstr << "}\n";
if (opts->bUseStateNext)
{
o << opts->yynext << ":\n";
}
}
-void output_yyaccept_init (std::ostream & o, uint32_t ind, bool used_yyaccept)
+void output_yyaccept_init (std::ostream & o, uint32_t ind, bool used_yyaccept, Opt &opts)
{
if (used_yyaccept)
{
- o << indent (ind) << "unsigned int " << opts->yyaccept << " = 0;\n";
+ o << indent(ind, opts->indString) << "unsigned int " << opts->yyaccept << " = 0;\n";
}
}
o << "#define YYMAXFILL " << max_fill << "\n";
}
-void output_line_info (std::ostream & o, uint32_t line_number, const std::string &file_name)
+void output_line_info (std::ostream & o, uint32_t line_number, const std::string &file_name, Opt &opts)
{
if (!opts->iFlag)
{
void output_types(
std::ostream &o,
uint32_t ind,
- const uniq_vector_t<std::string> &types)
+ const uniq_vector_t<std::string> &types, Opt &opts)
{
- o << indent(ind++) << "enum " << opts->yycondtype << " {\n";
+ const std::string indstr = opts->indString;
+ o << indent(ind++, indstr) << "enum " << opts->yycondtype << " {\n";
for (size_t i = 0; i < types.size(); ++i) {
- o << indent(ind) << opts->condEnumPrefix << types[i] << ",\n";
+ o << indent(ind, indstr) << opts->condEnumPrefix << types[i] << ",\n";
}
- o << indent(--ind) << "};\n";
+ o << indent(--ind, indstr) << "};\n";
}
-void output_version_time (std::ostream & o)
+void output_version_time (std::ostream & o, Opt &opts)
{
o << "/* Generated by re2c";
if (opts->version)
o << " */" << "\n";
}
-std::string output_get_state ()
+std::string output_get_state (Opt &opts)
{
return opts->state_get_naked
? opts->state_get
#include <vector>
#include "src/codegen/label.h"
+#include "src/conf/opt.h"
#include "src/util/counter.h"
#include "src/util/forbid_copy.h"
#include "src/util/uniq_vector.h"
public:
counter_t<label_t> label_counter;
bool warn_condition_order;
+ Opt &opts;
- OutputFile();
+ explicit OutputFile(Opt &o);
~OutputFile();
std::ostream & stream ();
public:
HeaderFile(): stream() {}
- bool emit(const uniq_vector_t<std::string> &types);
+ bool emit(const uniq_vector_t<std::string> &types, Opt &opts);
FORBID_COPY (HeaderFile);
};
std::set<std::string> skeletons;
size_t max_fill;
- Output();
+ explicit Output(Opt &o);
bool emit();
};
void output_tags(std::ostream &o, const ConfTags &conf, const std::set<std::string> &tags);
-void output_line_info (std::ostream &, uint32_t, const std::string&);
-void output_state_goto (std::ostream &, uint32_t, uint32_t);
-void output_types(std::ostream &o, uint32_t, const uniq_vector_t<std::string> &types);
-void output_version_time (std::ostream &);
-void output_yyaccept_init (std::ostream &, uint32_t, bool);
+void output_line_info (std::ostream &, uint32_t, const std::string&, Opt &opts);
+void output_state_goto (std::ostream &, uint32_t, uint32_t, Opt &opts);
+void output_types(std::ostream &o, uint32_t, const uniq_vector_t<std::string> &types, Opt &opts);
+void output_version_time (std::ostream &, Opt &opts);
+void output_yyaccept_init (std::ostream &, uint32_t, bool, Opt &opts);
void output_yymaxfill (std::ostream &, size_t);
// helpers
-std::string output_get_state ();
+std::string output_get_state (Opt &opts);
} // namespace re2c
#include <iostream>
#include "src/codegen/print.h"
-#include "src/conf/opt.h"
-#include "src/globals.h"
-#include "src/ir/regexp/encoding/enc.h"
namespace re2c
{
-bool is_print (uint32_t c)
+static bool is_space(uint32_t c)
{
- return c >= 0x20 && c < 0x7F;
-}
-
-bool is_space (uint32_t c)
-{
- switch (c)
- {
- case '\t':
- case '\f':
- case '\v':
- case '\n':
- case '\r':
- case ' ':
- return true;
- default:
- return false;
+ switch (c) {
+ case '\t':
+ case '\f':
+ case '\v':
+ case '\n':
+ case '\r':
+ case ' ': return true;
+ default: return false;
}
}
-char hexCh(uint32_t c)
+static inline char hex(uint32_t c)
{
static const char * sHex = "0123456789ABCDEF";
return sHex[c & 0x0F];
}
-void prtChOrHex(std::ostream& o, uint32_t c)
+static void prtCh(std::ostream& o, uint32_t c, bool dot)
{
- if (opts->encoding.type () != Enc::EBCDIC
- && (is_print (c) || is_space (c)))
- {
- o << '\'';
- prtCh(o, c);
- o << '\'';
- }
- else
- {
- prtHex(o, c);
+ switch (c) {
+ case '\'': o << (dot ? "'" : "\\'"); break;
+ case '"': o << (dot ? "\\\"" : "\""); break;
+ case '\n': o << (dot ? "\\\\n" : "\\n"); break;
+ case '\t': o << (dot ? "\\\\t" : "\\t"); break;
+ case '\v': o << (dot ? "\\\\v" : "\\v"); break;
+ case '\b': o << (dot ? "\\\\b" : "\\b"); break;
+ case '\r': o << (dot ? "\\\\r" : "\\r"); break;
+ case '\f': o << (dot ? "\\\\f" : "\\f"); break;
+ case '\a': o << (dot ? "\\\\a" : "\\a"); break;
+ case '\\': o << "\\\\"; break; // both .dot and C/C++ code expect "\\"
+ default: o << static_cast<char> (c); break;
}
}
-void prtHex(std::ostream& o, uint32_t c)
+bool is_print(uint32_t c)
{
- o << "0x";
- const uint32_t cunit_size = opts->encoding.szCodeUnit ();
- if (cunit_size >= 4)
- {
- o << hexCh (c >> 28u)
- << hexCh (c >> 24u)
- << hexCh (c >> 20u)
- << hexCh (c >> 16u);
- }
- if (cunit_size >= 2)
- {
- o << hexCh (c >> 12u)
- << hexCh (c >> 8u);
- }
- o << hexCh (c >> 4u)
- << hexCh (c);
+ return c >= 0x20 && c < 0x7F;
}
-void prtCh(std::ostream& o, uint32_t c)
+void prtHex(std::ostream& o, uint32_t c, uint32_t szcunit)
{
- const bool dot = opts->target == opt_t::DOT;
-
- switch (c)
- {
- case '\'':
- o << (dot ? "'" : "\\'");
- break;
-
- case '"':
- o << (dot ? "\\\"" : "\"");
- break;
-
- case '\n':
- o << (dot ? "\\\\n" : "\\n");
- break;
-
- case '\t':
- o << (dot ? "\\\\t" : "\\t");
- break;
-
- case '\v':
- o << (dot ? "\\\\v" : "\\v");
- break;
-
- case '\b':
- o << (dot ? "\\\\b" : "\\b");
- break;
-
- case '\r':
- o << (dot ? "\\\\r" : "\\r");
- break;
+ o << "0x";
- case '\f':
- o << (dot ? "\\\\f" : "\\f");
- break;
+ if (szcunit >= 4) {
+ o << hex(c >> 28u) << hex(c >> 24u) << hex(c >> 20u) << hex(c >> 16u);
+ }
- case '\a':
- o << (dot ? "\\\\a" :"\\a");
- break;
+ if (szcunit >= 2) {
+ o << hex(c >> 12u) << hex(c >> 8u);
+ }
- case '\\':
- o << "\\\\"; // both .dot and C/C++ code expect "\\"
- break;
+ o << hex(c >> 4u) << hex(c);
+}
- default:
- o << static_cast<char> (c);
- break;
+void prtChOrHex(std::ostream& o, uint32_t c, uint32_t szcunit, bool ebcdic, bool dot)
+{
+ if (!ebcdic && (is_print(c) || is_space(c))) {
+ o << '\'';
+ prtCh(o, c, dot);
+ o << '\'';
+ } else {
+ prtHex(o, c, szcunit);
}
}
-void prtChOrHexForSpan(std::ostream& o, uint32_t c)
+void prtChOrHexForSpan(std::ostream& o, uint32_t c, uint32_t szcunit, bool ebcdic, bool dot)
{
- if (opts->encoding.type () != Enc::EBCDIC
- && is_print (c)
- && (c != ']'))
- {
- prtCh(o, c);
- }
- else
- {
- prtHex(o, c);
+ if (!ebcdic && c != ']' && is_print(c)) {
+ prtCh(o, c, dot);
+ } else {
+ prtHex(o, c, szcunit);
}
}
-void printSpan(std::ostream& o, uint32_t lb, uint32_t ub)
+void printSpan(std::ostream& o, uint32_t lb, uint32_t ub, uint32_t szcunit, bool ebcdic, bool dot)
{
o << "[";
- if ((ub - lb) == 1)
- {
- prtChOrHexForSpan(o, lb);
- }
- else
- {
- prtChOrHexForSpan(o, lb);
+ prtChOrHexForSpan(o, lb, szcunit, ebcdic, dot);
+ if (ub - lb > 1) {
o << "-";
- prtChOrHexForSpan(o, ub - 1);
+ prtChOrHexForSpan(o, ub - 1, szcunit, ebcdic, dot);
}
o << "]";
}
namespace re2c
{
-bool is_print (uint32_t c);
-bool is_space (uint32_t c);
-char hexCh(uint32_t c);
-void prtCh(std::ostream&, uint32_t);
-void prtHex(std::ostream&, uint32_t);
-void prtChOrHex(std::ostream&, uint32_t);
-void printSpan(std::ostream&, uint32_t, uint32_t);
+bool is_print (uint32_t c);
+void prtHex (std::ostream &o, uint32_t c, uint32_t szcunit);
+void prtChOrHex (std::ostream &o, uint32_t c, uint32_t szcunit, bool ebcdic, bool dot);
+void printSpan (std::ostream &o, uint32_t l, uint32_t u, uint32_t szcunit, bool ebcdic, bool dot);
} // end namespace re2c
namespace re2c
{
-Opt opts;
-
opt_t::opt_t ()
#define OPT1(type, name, value) : name (value)
#define OPT(type, name, value) , name (value)
#include <string>
-#include "src/conf/opt.h"
#include "src/conf/warn.h"
#include "src/util/c99_stdint.h"
extern uint32_t last_fill_index;
extern std::string yySetupRule;
-extern Opt opts;
extern Warn warn;
} // end namespace re2c
#include <vector>
#include <utility>
-#include "src/conf/opt.h"
#include "src/codegen/go.h"
#include "src/ir/adfa/adfa.h"
#include "src/ir/dfa/dfa.h"
#include "src/ir/skeleton/skeleton.h"
#include "src/util/allocate.h"
-#include "src/globals.h"
namespace re2c
{
);
~DFA ();
void reorder();
- void prepare();
- void calc_stats(uint32_t line);
+ void prepare(Opt &opts);
+ void calc_stats(uint32_t line, bool explicit_tags);
void emit (Output &, uint32_t &, bool, bool &);
private:
void split (State *);
void findBaseState ();
void hoist_tags();
- void count_used_labels (std::set<label_t> & used, label_t prolog, label_t start, bool force_start) const;
+ void count_used_labels (std::set<label_t> & used, label_t prolog, label_t start, bool force_start, bool fFlag) const;
void emit_body (OutputFile &, uint32_t &, const std::set<label_t> & used_labels, label_t initial) const;
void emit_dot(OutputFile &o, bool last_cond, const std::vector<std::string> &conds) const;
operator delete (span);
}
-void DFA::prepare ()
+void DFA::prepare (Opt &opts)
{
bUsedYYBitmap = false;
for (State * s = head; s; s = s->next)
{
- s->go.init (s);
+ s->go.init (s, opts);
}
}
-void DFA::calc_stats(uint32_t line)
+void DFA::calc_stats(uint32_t line, bool explicit_tags)
{
// calculate 'YYMAXFILL'
max_fill = 0;
// re2c should use old-style YYCTXMARKER for backwards compatibility.
// Note that with generic API fixed-length contexts are forbidden,
// which may cause additional overlaps.
- oldstyle_ctxmarker = maxtagver == 1 && !opts->tags;
+ oldstyle_ctxmarker = !explicit_tags && maxtagver == 1;
// error if tags are not enabled, but we need them
- if (!opts->tags && maxtagver > 1) {
+ if (!explicit_tags && maxtagver > 1) {
error("line %u: overlapping trailing contexts need "
"multiple context markers, use '-t, --tags' "
"option and '/*!tags:re2c ... */' directive",
#include <set>
#include "src/codegen/output.h"
-#include "src/conf/opt.h"
#include "src/ir/compile.h"
#include "src/ir/adfa/adfa.h"
#include "src/ir/adfa/dump.h"
#include "src/ir/regexp/regexp.h"
#include "src/ir/skeleton/skeleton.h"
#include "src/parse/spec.h"
-#include "src/globals.h"
namespace re2c {
{
const uint32_t line = output.source.block().line;
const std::string name = make_name(cond, line);
+ Opt &opts = output.source.opts;
warn_nullable(rules, cond);
cs.push_back(*i);
}
- nfa_t nfa(rules);
+ nfa_t nfa(rules, opts->input_api.type());
- dfa_t dfa(nfa, cs, cond);
+ dfa_t dfa(nfa, cs, cond, opts->bijective_mapping, opts->dump_dfa_raw);
if (opts->dump_dfa_det) dump_dfa(dfa);
// skeleton must be constructed after DFA construction
Skeleton skeleton(dfa, cs, defrule, name, cond, line);
warn_undefined_control_flow(skeleton);
if (opts->target == opt_t::SKELETON) {
- emit_data(skeleton);
+ emit_data(skeleton, opts->output_file, opts->encoding.szCodeUnit());
}
cutoff_dead_rules(dfa, defrule, cond);
optimize_tags(dfa);
if (opts->dump_dfa_tagopt) dump_dfa(dfa);
- minimization(dfa);
+ minimization(dfa, opts->dfa_minimization);
if (opts->dump_dfa_min) dump_dfa(dfa);
// find YYFILL states and calculate argument to YYFILL
adfa->reorder();
// skeleton is constructed, do further DFA transformations
- adfa->prepare();
+ adfa->prepare(opts);
if (opts->dump_adfa) dump_adfa(*adfa);
// finally gather overall DFA statistics
- adfa->calc_stats(line);
+ adfa->calc_stats(line, opts->tags);
// accumulate global statistics from this particular DFA
output.max_fill = std::max (output.max_fill, adfa->max_fill);
#include <string.h>
-#include "src/conf/opt.h"
#include "src/ir/dfa/dfa.h"
#include "src/util/forbid_copy.h"
#include "src/globals.h"
}
}
-dfa_t::dfa_t(const nfa_t &nfa,
- const charset_t &charset,
- const std::string &cond)
+dfa_t::dfa_t(const nfa_t &nfa, const charset_t &charset,
+ const std::string &cond, bool bijection, bool debug)
: states()
, nchars(charset.size() - 1) // (n + 1) bounds for n ranges
, rules(nfa.rules)
{
const size_t ntag = vartags.size();
Tagpool tagpool(ntag);
- kernels_t kernels(tagpool);
+ kernels_t kernels(tagpool, bijection);
closure_t clos1, clos2;
- dump_dfa_t dump(*this, tagpool, nfa);
+ dump_dfa_t dump(*this, tagpool, nfa, debug);
// all-zero tag configuration must have static number zero
assert(ZERO_TAGS == tagpool.insert_const(TAGVER_ZERO));
tagver_t maxtagver;
dfa_t(const nfa_t &nfa, const charset_t &charset,
- const std::string &cond);
+ const std::string &cond, bool bijection, bool debug);
~dfa_t();
FORBID_COPY(dfa_t);
DFA_MINIMIZATION_MOORE
};
-void minimization(dfa_t &dfa);
+void minimization(dfa_t &dfa, dfa_minimization_t type);
void fillpoints(const dfa_t &dfa, std::vector<size_t> &fill);
void cutoff_dead_rules(dfa_t &dfa, size_t defrule, const std::string &cond);
void insert_fallback_tags(dfa_t &dfa);
#include <stdio.h>
-#include "src/conf/opt.h"
#include "src/ir/dfa/dump.h"
-#include "src/globals.h"
namespace re2c
{
static const char *tagname(const VarTag &t);
static void dump_tags(const Tagpool &tagpool, size_t ttran, size_t tvers);
-dump_dfa_t::dump_dfa_t(const dfa_t &d, const Tagpool &pool, const nfa_t &n)
- : debug(opts->dump_dfa_raw)
+dump_dfa_t::dump_dfa_t(const dfa_t &d, const Tagpool &pool, const nfa_t &n, bool dbg)
+ : debug(dbg)
, dfa(d)
, tagpool(pool)
, uniqidx(0)
uint32_t uniqidx;
const nfa_state_t *base;
- dump_dfa_t(const dfa_t &d, const Tagpool &pool, const nfa_t &n);
+ dump_dfa_t(const dfa_t &d, const Tagpool &pool, const nfa_t &n, bool dbg);
~dump_dfa_t();
void closure(const closure_t &clos, uint32_t state, bool isnew);
void state0(const closure_t &clos);
#include <string.h>
-#include "src/conf/opt.h"
#include "src/ir/dfa/find_state.h"
#include "src/util/hash32.h"
-#include "src/globals.h"
namespace re2c
{
}
};
-mapping_t::mapping_t(Tagpool &pool)
+mapping_t::mapping_t(Tagpool &pool, bool bijection)
: tagpool(pool)
, cap(0)
, mem(NULL)
, x2t(NULL)
, x2y(NULL)
, y2x(NULL)
- , bijective(opts->bijective_mapping)
+ , bijective(bijection)
, max(0)
, x2t_backup(NULL)
, x2y_backup(NULL)
return true;
}
-kernels_t::kernels_t(Tagpool &tagpool)
+kernels_t::kernels_t(Tagpool &tagpool, bool bijection)
: lookup()
- , mapping(tagpool)
+ , mapping(tagpool, bijection)
, maxsize(256) // usually ranges from one to some twenty
, buffer(new kernel_t(maxsize))
{}
tagver_t *x2y_backup;
uint32_t *indeg;
- explicit mapping_t(Tagpool &pool);
+ mapping_t(Tagpool &pool, bool bijection);
~mapping_t();
void init(tagver_t v);
bool better() const;
kernel_t *buffer;
public:
- explicit kernels_t(Tagpool &tagpool);
+ kernels_t(Tagpool &tagpool, bool bijection);
~kernels_t();
size_t size() const;
const kernel_t* operator[](size_t idx) const;
#include <utility>
#include <vector>
-#include "src/conf/opt.h"
#include "src/ir/dfa/dfa.h"
-#include "src/globals.h"
namespace re2c
{
* Tail "c" can be deduplicated in the 1st case, but not in the 2nd.
*/
-void minimization(dfa_t &dfa)
+void minimization(dfa_t &dfa, dfa_minimization_t type)
{
const size_t count = dfa.states.size();
size_t *part = new size_t[count];
- switch (opts->dfa_minimization)
- {
- case DFA_MINIMIZATION_TABLE:
- minimization_table(part, dfa.states, dfa.nchars);
- break;
- case DFA_MINIMIZATION_MOORE:
- minimization_moore(part, dfa.states, dfa.nchars);
- break;
+ switch (type) {
+ case DFA_MINIMIZATION_TABLE:
+ minimization_table(part, dfa.states, dfa.nchars); break;
+ case DFA_MINIMIZATION_MOORE:
+ minimization_moore(part, dfa.states, dfa.nchars); break;
}
size_t *compact = new size_t[count];
namespace re2c {
-nfa_t::nfa_t(const std::vector<const RegExpRule*> ®exps)
+nfa_t::nfa_t(const std::vector<const RegExpRule*> ®exps, InputAPI::type_t input)
: max_size(0)
, size(0)
, states(NULL)
max_size = counters(regexps, ntags);
states = new nfa_state_t[max_size];
- regexps2nfa(regexps, *this);
+ regexps2nfa(regexps, *this, input);
init_rules(regexps, rules, vartags, fixtags);
}
#include <valarray>
#include <vector>
+#include "src/codegen/input_api.h"
#include "src/ir/regexp/regexp.h"
#include "src/ir/rule.h"
#include "src/ir/tag.h"
std::vector<FixTag> &fixtags;
nfa_state_t *root;
- nfa_t(const std::vector<const RegExpRule*> &rs);
+ nfa_t(const std::vector<const RegExpRule*> &rs, InputAPI::type_t input);
~nfa_t();
FORBID_COPY(nfa_t);
};
size_t counters(const std::vector<const RegExpRule*> ®exps, size_t &ntags);
-void regexps2nfa(const std::vector<const RegExpRule*> ®exps, nfa_t &nfa);
+void regexps2nfa(const std::vector<const RegExpRule*> ®exps, nfa_t &nfa, InputAPI::type_t input);
bool nullable_rule(const RegExpRule *rule);
void init_rules(const std::vector<const RegExpRule*> ®exps, std::valarray<Rule> &rules,
const std::vector<VarTag> &vartags, const std::vector<FixTag> &fixtags);
+#include <limits>
+
#include "src/ir/nfa/nfa.h"
#include "src/globals.h"
return s;
}
-static nfa_state_t *regexp2nfa_rule(nfa_t &nfa, size_t nrule, const RegExpRule *rule)
+static nfa_state_t *regexp2nfa_rule(nfa_t &nfa, size_t nrule,
+ const RegExpRule *rule, InputAPI::type_t input)
{
- const bool generic = opts->input_api.type() == InputAPI::CUSTOM;
+ const bool generic = input == InputAPI::CUSTOM;
size_t base = FixTag::RIGHTMOST, dist = 0;
nfa_state_t *s = &nfa.states[nfa.size++];
return regexp2nfa(nfa, nrule, dist, base, !generic, rule->re, s);
}
-void regexps2nfa(const std::vector<const RegExpRule*> ®exps, nfa_t &nfa)
+void regexps2nfa(const std::vector<const RegExpRule*> ®exps,
+ nfa_t &nfa, InputAPI::type_t input)
{
const size_t nregexps = regexps.size();
return;
}
- nfa_state_t *s = regexp2nfa_rule(nfa, 0, regexps[0]);
+ nfa_state_t *s = regexp2nfa_rule(nfa, 0, regexps[0], input);
for (size_t i = 1; i < nregexps; ++i) {
nfa_state_t *t = &nfa.states[nfa.size++];
- t->make_alt(i, s, regexp2nfa_rule(nfa, i, regexps[i]));
+ t->make_alt(i, s, regexp2nfa_rule(nfa, i, regexps[i], input));
s = t;
}
nfa.root = s;
-#include "src/conf/opt.h"
#include "src/ir/regexp/regexp.h"
#include "src/globals.h"
#include <limits>
#include <stddef.h>
-#include "src/conf/opt.h"
#include "src/conf/warn.h"
#include "src/globals.h"
#include "src/ir/regexp/empty_class_policy.h"
#include <string>
#include "src/codegen/bitmap.h"
-#include "src/codegen/indent.h"
+#include "src/codegen/emit.h"
#include "src/codegen/output.h"
-#include "src/conf/opt.h"
-#include "src/globals.h"
#include "src/ir/regexp/encoding/enc.h"
#include "src/ir/adfa/adfa.h"
#include "src/ir/skeleton/skeleton.h"
size_t sizeof_key, size_t def, bool backup, bool accept, bool oldstyle_ctxmarker,
const std::set<std::string> &tagnames, const std::set<std::string> &tagvars)
{
+ Opt &opts = o.opts;
const size_t sizeof_cunit = opts->encoding.szCodeUnit();
const size_t norule = rule2key(Rule::NONE, sizeof_key, def);
std::string filename = opts->output_file;
}
// autogenerated tag variables
- ConfTags conf("\n" + indent(2) + "const YYCTYPE *@@ = NULL;", "");
+ ConfTags conf("\n" + indent(2, opts->indString) + "const YYCTYPE *@@ = NULL;", "");
output_tags(o.stream(), conf, tagnames);
// user-defined tag variables
o.ws("\n#undef YYBACKUPCTX");
o.ws("\n#undef YYRESTORECTX");
}
- if (opts->tags) {
+ if (o.opts->tags) {
o.ws("\n#undef YYBACKUPTAG");
o.ws("\n#undef YYRESTORETAG");
o.ws("\n#undef YYCOPYTAG");
#include <vector>
#include "src/conf/msg.h"
-#include "src/conf/opt.h"
-#include "src/globals.h"
#include "src/ir/regexp/encoding/enc.h"
#include "src/ir/skeleton/path.h"
#include "src/ir/skeleton/skeleton.h"
}
}
-static void generate_paths(const Skeleton &skel, cover_t &cover)
+static void generate_paths(const Skeleton &skel, cover_t &cover, size_t cunit_size)
{
- switch (opts->encoding.szCodeUnit()) {
+ switch (cunit_size) {
case 4: generate_paths_cunit<uint32_t>(skel, cover); break;
case 2: generate_paths_cunit<uint16_t>(skel, cover); break;
case 1: generate_paths_cunit<uint8_t>(skel, cover); break;
}
}
-void emit_data(const Skeleton &skel)
+void emit_data(const Skeleton &skel, std::string fname, size_t cunit_size)
{
- std::string fname = opts->output_file;
if (fname.empty()) {
fname = "<stdout>";
}
}
cover_t cover(input, keys, skel.nodes_count);
- generate_paths(skel, cover);
+ generate_paths(skel, cover, cunit_size);
fclose(input);
fclose(keys);
uint32_t maxpath(const Skeleton &skel);
void warn_undefined_control_flow(const Skeleton &skel);
void fprint_default_path(FILE *f, const Skeleton &skel, const path_t &p);
-void emit_data(const Skeleton &skel);
+void emit_data(const Skeleton &skel, std::string fname, size_t cunit_size);
void emit_prolog(OutputFile & o);
void emit_start(OutputFile &o, size_t maxfill, const std::string &name,
size_t sizeof_key, size_t def, bool backup, bool accept, bool oldstyle_ctxmarker,
int main(int, char *argv[])
{
+ Opt opts;
+
switch (parse_opts (argv, opts))
{
case OK: break;
}
// set up the output streams
- re2c::Output output;
+ re2c::Output output(opts);
Scanner scanner (input, output.source);
parse (scanner, output);
#include <string>
#include "src/codegen/output.h"
-#include "src/conf/opt.h"
#include "src/conf/warn.h"
#include "src/globals.h"
#include "src/ir/regexp/encoding/enc.h"
#include <string>
#include "src/codegen/output.h"
-#include "src/conf/opt.h"
-#include "src/globals.h"
#include "src/ir/regexp/encoding/enc.h"
#include "src/parse/scanner.h"
#include "src/util/s_to_n32_unsafe.h"
#include <vector>
#include "src/codegen/output.h"
-#include "src/conf/opt.h"
#include "src/globals.h"
#include "src/ir/compile.h"
#include "src/ir/adfa/adfa.h"
void context_check(CondList *clist)
{
- if (!opts->cFlag)
+ if (!in->opts->cFlag)
{
delete clist;
in->fatal("conditions are only allowed when using -c switch");
rule
: trailexpr TOKEN_CODE {
- if (opts->cFlag) {
+ if (in->opts->cFlag) {
in->fatal("condition or '<*>' required when using -c switch");
}
$1->info = new RuleInfo($2->loc, $2, NULL);
/* default rule */
| TOKEN_STAR TOKEN_CODE {
- if (opts->cFlag) {
+ if (in->opts->cFlag) {
in->fatal("condition or '<*>' required when using -c switch");
}
RegExpRule *def = new RegExpRule(in->mkDefault());
{
std::map<std::string, smart_ptr<DFA> > dfa_map;
ScannerState rules_state;
+ Opt &opts = i.opts;
in = &i;
#include "src/codegen/label.h"
#include "src/codegen/output.h"
-#include "src/conf/opt.h"
#include "src/globals.h"
#include "src/parse/scanner.h"
#include "src/util/counter.h"
: ScannerState ()
, in (i)
, out (o)
+ , opts (o.opts)
{}
void Scanner::fill (uint32_t need)
#include <stddef.h>
#include <string>
+#include "src/conf/opt.h"
#include "src/parse/input.h"
#include "src/util/attribute.h"
#include "src/util/forbid_copy.h"
Input & in;
public:
OutputFile & out;
+ Opt &opts;
private:
void fill (uint32_t);