From 15bfced93641ae86f16cc9e1c792da5aa720f543 Mon Sep 17 00:00:00 2001 From: Ulya Trofimovich Date: Mon, 12 Oct 2015 13:32:45 +0100 Subject: [PATCH] Parse inplace configurations in lexer; don't pass them to parser. This removes a lot of copy-pasting. The change of error location in test is insignificant: the reported location was incorrect and it still remains imprecise. --- re2c/bootstrap/src/parse/parser.cc | 1009 ++--------- re2c/bootstrap/src/parse/scanner_lex.cc | 2029 ++++++++++++++--------- re2c/bootstrap/src/parse/y.tab.h | 74 +- re2c/src/ir/regexp/regexp.cc | 19 - re2c/src/parse/parser.ypp | 345 +--- re2c/src/parse/scanner.h | 5 +- re2c/src/parse/scanner_lex.re | 224 ++- re2c/test/repeat-07_error.gir.c | 2 +- 8 files changed, 1569 insertions(+), 2138 deletions(-) diff --git a/re2c/bootstrap/src/parse/parser.cc b/re2c/bootstrap/src/parse/parser.cc index dca125c9..700172ae 100644 --- a/re2c/bootstrap/src/parse/parser.cc +++ b/re2c/bootstrap/src/parse/parser.cc @@ -243,70 +243,14 @@ void default_rule(CondList *clist, const Code * code) CLOSE = 258, CLOSESIZE = 259, CODE = 260, - CONF_CONDPREFIX = 261, - CONF_CONDENUMPREFIX = 262, - CONF_COND_DIVIDER = 263, - CONF_COND_DIVIDER_COND = 264, - CONF_COND_GOTO = 265, - CONF_COND_GOTO_COND = 266, - CONF_CGOTO_THRESHOLD = 267, - CONF_DEFINE_YYBACKUP = 268, - CONF_DEFINE_YYBACKUPCTX = 269, - CONF_DEFINE_YYCONDTYPE = 270, - CONF_DEFINE_YYCTXMARKER = 271, - CONF_DEFINE_YYCTYPE = 272, - CONF_DEFINE_YYCURSOR = 273, - CONF_DEFINE_YYDEBUG = 274, - CONF_DEFINE_YYFILL = 275, - CONF_DEFINE_YYFILL_NAKED = 276, - CONF_DEFINE_YYFILL_LEN = 277, - CONF_DEFINE_YYGETCONDITION = 278, - CONF_DEFINE_YYGETCONDITION_NAKED = 279, - CONF_DEFINE_YYGETSTATE = 280, - CONF_DEFINE_YYGETSTATE_NAKED = 281, - CONF_DEFINE_YYLESSTHAN = 282, - CONF_DEFINE_YYLIMIT = 283, - CONF_DEFINE_YYMARKER = 284, - CONF_DEFINE_YYPEEK = 285, - CONF_DEFINE_YYRESTORE = 286, - CONF_DEFINE_YYRESTORECTX = 287, - CONF_DEFINE_YYSETCONDITION = 288, - CONF_DEFINE_YYSETCONDITION_COND = 289, - CONF_DEFINE_YYSETCONDITION_NAKED = 290, - CONF_DEFINE_YYSETSTATE = 291, - CONF_DEFINE_YYSETSTATE_NAKED = 292, - CONF_DEFINE_YYSETSTATE_STATE = 293, - CONF_DEFINE_YYSKIP = 294, - CONF_FLAGS = 295, - CONF_INDENT_STRING = 296, - CONF_INDENT_TOP = 297, - CONF_LABEL_YYFILLLABEL = 298, - CONF_LABEL_YYNEXT = 299, - CONF_LABELPREFIX = 300, - CONF_STARTLABEL = 301, - CONF_STATE_ABORT = 302, - CONF_STATE_NEXTLABEL = 303, - CONF_VARIABLE_YYACCEPT = 304, - CONF_VARIABLE_YYBM = 305, - CONF_VARIABLE_YYCH = 306, - CONF_VARIABLE_YYCTABLE = 307, - CONF_VARIABLE_YYSTABLE = 308, - CONF_VARIABLE_YYTARGET = 309, - CONF_YYBM_HEX = 310, - CONF_YYCH_CONVERSION = 311, - CONF_YYCH_EMIT = 312, - CONF_YYFILL_CHECK = 313, - CONF_YYFILL_ENABLE = 314, - CONF_YYFILL_PARAMETER = 315, - ID = 316, - FID = 317, - FID_END = 318, - NOCOND = 319, - NUM = 320, - REGEXP = 321, - SETUP = 322, - STAR = 323, - STRING = 324 + CONF = 261, + ID = 262, + FID = 263, + FID_END = 264, + NOCOND = 265, + REGEXP = 266, + SETUP = 267, + STAR = 268 }; #endif @@ -320,11 +264,9 @@ typedef union YYSTYPE re2c::RegExp * regexp; const re2c::Code * code; char op; - int32_t num; re2c::ExtOp extop; std::string * str; re2c::CondList * clist; - re2c::Enc::type_t enc; @@ -552,20 +494,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 336 +#define YYLAST 104 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 81 +#define YYNTOKENS 25 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 14 /* YYNRULES -- Number of rules. */ -#define YYNRULES 104 +#define YYNRULES 49 /* YYNRULES -- Number of states. */ -#define YYNSTATES 258 +#define YYNSTATES 92 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 324 +#define YYMAXUTOK 268 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -577,15 +519,15 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 79, 80, 2, 2, 76, 2, 2, 72, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 75, 71, - 73, 70, 74, 2, 2, 2, 2, 2, 2, 2, + 23, 24, 2, 2, 20, 2, 2, 16, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 19, 15, + 17, 14, 18, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 78, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 22, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 77, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 21, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -599,93 +541,53 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69 + 5, 6, 7, 8, 9, 10, 11, 12, 13 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const yytype_uint16 yyprhs[] = +static const yytype_uint8 yyprhs[] = { 0, 0, 3, 4, 7, 10, 15, 19, 24, 28, - 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, - 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, - 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, - 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, - 192, 196, 200, 204, 208, 212, 216, 220, 224, 228, - 232, 236, 240, 244, 248, 252, 256, 259, 267, 275, - 282, 289, 295, 303, 311, 318, 325, 331, 335, 339, - 344, 349, 350, 352, 354, 358, 359, 363, 364, 367, - 369, 373, 375, 379, 381, 384, 386, 389, 392, 394, - 396, 399, 402, 404, 406 + 30, 34, 37, 45, 53, 60, 67, 73, 81, 89, + 96, 103, 109, 113, 117, 122, 127, 128, 130, 132, + 136, 137, 141, 142, 145, 147, 151, 153, 157, 159, + 162, 164, 167, 170, 172, 174, 177, 180, 182, 184 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 82, 0, -1, -1, 82, 84, -1, 82, 83, -1, - 61, 70, 89, 71, -1, 62, 89, 63, -1, 61, - 70, 89, 72, -1, 62, 89, 72, -1, 6, 69, - 71, -1, 7, 69, 71, -1, 8, 69, 71, -1, - 9, 69, 71, -1, 10, 69, 71, -1, 11, 69, - 71, -1, 12, 65, 71, -1, 13, 69, 71, -1, - 14, 69, 71, -1, 15, 69, 71, -1, 16, 69, - 71, -1, 17, 69, 71, -1, 18, 69, 71, -1, - 19, 69, 71, -1, 20, 69, 71, -1, 23, 69, - 71, -1, 25, 69, 71, -1, 27, 69, 71, -1, - 28, 69, 71, -1, 29, 69, 71, -1, 30, 69, - 71, -1, 31, 69, 71, -1, 32, 69, 71, -1, - 33, 69, 71, -1, 35, 65, 71, -1, 36, 69, - 71, -1, 39, 69, 71, -1, 21, 65, 71, -1, - 22, 69, 71, -1, 24, 65, 71, -1, 26, 65, - 71, -1, 34, 69, 71, -1, 37, 65, 71, -1, - 38, 69, 71, -1, 40, 65, 71, -1, 41, 69, - 71, -1, 42, 65, 71, -1, 43, 69, 71, -1, - 44, 69, 71, -1, 45, 69, 71, -1, 46, 65, - 71, -1, 46, 69, 71, -1, 47, 65, 71, -1, - 48, 65, 71, -1, 49, 69, 71, -1, 50, 69, - 71, -1, 51, 69, 71, -1, 52, 69, 71, -1, - 53, 69, 71, -1, 54, 69, 71, -1, 55, 65, - 71, -1, 56, 65, 71, -1, 57, 65, 71, -1, - 58, 65, 71, -1, 59, 65, 71, -1, 60, 65, - 71, -1, 89, 88, 5, -1, 68, 5, -1, 73, - 85, 74, 89, 88, 87, 5, -1, 73, 85, 74, - 89, 88, 75, 87, -1, 73, 85, 74, 88, 87, - 5, -1, 73, 85, 74, 88, 75, 87, -1, 73, - 85, 74, 68, 5, -1, 73, 68, 74, 89, 88, - 87, 5, -1, 73, 68, 74, 89, 88, 75, 87, - -1, 73, 68, 74, 88, 87, 5, -1, 73, 68, - 74, 88, 75, 87, -1, 73, 68, 74, 68, 5, - -1, 64, 87, 5, -1, 64, 75, 87, -1, 67, - 68, 74, 5, -1, 67, 85, 74, 5, -1, -1, - 86, -1, 61, -1, 86, 76, 61, -1, -1, 70, - 74, 61, -1, -1, 72, 89, -1, 90, -1, 89, - 77, 90, -1, 91, -1, 90, 78, 91, -1, 92, - -1, 91, 92, -1, 94, -1, 94, 93, -1, 94, - 4, -1, 3, -1, 68, -1, 93, 3, -1, 93, - 68, -1, 61, -1, 66, -1, 79, 89, 80, -1 + 26, 0, -1, -1, 26, 28, -1, 26, 27, -1, + 7, 14, 33, 15, -1, 8, 33, 9, -1, 7, + 14, 33, 16, -1, 8, 33, 16, -1, 6, -1, + 33, 32, 5, -1, 13, 5, -1, 17, 29, 18, + 33, 32, 31, 5, -1, 17, 29, 18, 33, 32, + 19, 31, -1, 17, 29, 18, 32, 31, 5, -1, + 17, 29, 18, 32, 19, 31, -1, 17, 29, 18, + 13, 5, -1, 17, 13, 18, 33, 32, 31, 5, + -1, 17, 13, 18, 33, 32, 19, 31, -1, 17, + 13, 18, 32, 31, 5, -1, 17, 13, 18, 32, + 19, 31, -1, 17, 13, 18, 13, 5, -1, 10, + 31, 5, -1, 10, 19, 31, -1, 12, 13, 18, + 5, -1, 12, 29, 18, 5, -1, -1, 30, -1, + 7, -1, 30, 20, 7, -1, -1, 14, 18, 7, + -1, -1, 16, 33, -1, 34, -1, 33, 21, 34, + -1, 35, -1, 34, 22, 35, -1, 36, -1, 35, + 36, -1, 38, -1, 38, 37, -1, 38, 4, -1, + 3, -1, 13, -1, 37, 3, -1, 37, 13, -1, + 7, -1, 11, -1, 23, 33, 24, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 243, 243, 245, 249, 253, 262, 271, 275, 279, - 284, 289, 294, 299, 304, 309, 317, 322, 327, 332, - 337, 342, 347, 352, 357, 362, 367, 372, 377, 382, - 387, 392, 397, 402, 406, 411, 416, 420, 425, 429, - 433, 438, 442, 447, 460, 465, 473, 478, 483, 488, - 492, 497, 501, 505, 510, 515, 520, 525, 530, 535, - 539, 543, 547, 551, 555, 562, 579, 597, 601, 607, - 612, 618, 622, 637, 654, 659, 665, 681, 699, 719, - 725, 733, 736, 743, 749, 759, 762, 770, 773, 780, - 784, 791, 795, 802, 806, 813, 817, 832, 852, 856, - 860, 864, 871, 881, 885 + 0, 183, 183, 185, 189, 193, 202, 211, 215, 219, + 223, 240, 258, 262, 268, 273, 279, 283, 298, 315, + 320, 326, 342, 360, 380, 386, 394, 397, 404, 410, + 420, 423, 431, 434, 441, 445, 452, 456, 463, 467, + 474, 478, 493, 513, 517, 521, 525, 532, 542, 546 }; #endif @@ -694,33 +596,11 @@ static const yytype_uint16 yyrline[] = First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "CLOSE", "CLOSESIZE", "CODE", - "CONF_CONDPREFIX", "CONF_CONDENUMPREFIX", "CONF_COND_DIVIDER", - "CONF_COND_DIVIDER_COND", "CONF_COND_GOTO", "CONF_COND_GOTO_COND", - "CONF_CGOTO_THRESHOLD", "CONF_DEFINE_YYBACKUP", - "CONF_DEFINE_YYBACKUPCTX", "CONF_DEFINE_YYCONDTYPE", - "CONF_DEFINE_YYCTXMARKER", "CONF_DEFINE_YYCTYPE", "CONF_DEFINE_YYCURSOR", - "CONF_DEFINE_YYDEBUG", "CONF_DEFINE_YYFILL", "CONF_DEFINE_YYFILL_NAKED", - "CONF_DEFINE_YYFILL_LEN", "CONF_DEFINE_YYGETCONDITION", - "CONF_DEFINE_YYGETCONDITION_NAKED", "CONF_DEFINE_YYGETSTATE", - "CONF_DEFINE_YYGETSTATE_NAKED", "CONF_DEFINE_YYLESSTHAN", - "CONF_DEFINE_YYLIMIT", "CONF_DEFINE_YYMARKER", "CONF_DEFINE_YYPEEK", - "CONF_DEFINE_YYRESTORE", "CONF_DEFINE_YYRESTORECTX", - "CONF_DEFINE_YYSETCONDITION", "CONF_DEFINE_YYSETCONDITION_COND", - "CONF_DEFINE_YYSETCONDITION_NAKED", "CONF_DEFINE_YYSETSTATE", - "CONF_DEFINE_YYSETSTATE_NAKED", "CONF_DEFINE_YYSETSTATE_STATE", - "CONF_DEFINE_YYSKIP", "CONF_FLAGS", "CONF_INDENT_STRING", - "CONF_INDENT_TOP", "CONF_LABEL_YYFILLLABEL", "CONF_LABEL_YYNEXT", - "CONF_LABELPREFIX", "CONF_STARTLABEL", "CONF_STATE_ABORT", - "CONF_STATE_NEXTLABEL", "CONF_VARIABLE_YYACCEPT", "CONF_VARIABLE_YYBM", - "CONF_VARIABLE_YYCH", "CONF_VARIABLE_YYCTABLE", "CONF_VARIABLE_YYSTABLE", - "CONF_VARIABLE_YYTARGET", "CONF_YYBM_HEX", "CONF_YYCH_CONVERSION", - "CONF_YYCH_EMIT", "CONF_YYFILL_CHECK", "CONF_YYFILL_ENABLE", - "CONF_YYFILL_PARAMETER", "ID", "FID", "FID_END", "NOCOND", "NUM", - "REGEXP", "SETUP", "STAR", "STRING", "'='", "';'", "'/'", "'<'", "'>'", - "':'", "','", "'|'", "'\\\\'", "'('", "')'", "$accept", "spec", "decl", - "rule", "cond", "clist", "newcond", "look", "expr", "diff", "term", - "factor", "close", "primary", 0 + "$end", "error", "$undefined", "CLOSE", "CLOSESIZE", "CODE", "CONF", + "ID", "FID", "FID_END", "NOCOND", "REGEXP", "SETUP", "STAR", "'='", + "';'", "'/'", "'<'", "'>'", "':'", "','", "'|'", "'\\\\'", "'('", "')'", + "$accept", "spec", "decl", "rule", "cond", "clist", "newcond", "look", + "expr", "diff", "term", "factor", "close", "primary", 0 }; #endif @@ -730,47 +610,29 @@ static const char *const yytname[] = static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 61, 59, 47, 60, 62, 58, 44, 124, 92, 40, - 41 + 265, 266, 267, 268, 61, 59, 47, 60, 62, 58, + 44, 124, 92, 40, 41 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 81, 82, 82, 82, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 85, 85, 86, 86, 87, 87, 88, 88, 89, - 89, 90, 90, 91, 91, 92, 92, 92, 93, 93, - 93, 93, 94, 94, 94 + 0, 25, 26, 26, 26, 27, 27, 27, 27, 27, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 29, 29, 30, 30, + 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, + 36, 36, 36, 37, 37, 37, 37, 38, 38, 38 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { - 0, 2, 0, 2, 2, 4, 3, 4, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 2, 7, 7, 6, - 6, 5, 7, 7, 6, 6, 5, 3, 3, 4, - 4, 0, 1, 1, 3, 0, 3, 0, 2, 1, - 3, 1, 3, 1, 2, 1, 2, 2, 1, 1, - 2, 2, 1, 1, 3 + 0, 2, 0, 2, 2, 4, 3, 4, 3, 1, + 3, 2, 7, 7, 6, 6, 5, 7, 7, 6, + 6, 5, 3, 3, 4, 4, 0, 1, 1, 3, + 0, 3, 0, 2, 1, 3, 1, 3, 1, 2, + 1, 2, 2, 1, 1, 2, 2, 1, 1, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -778,79 +640,47 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 102, 0, - 85, 103, 81, 0, 81, 0, 4, 3, 87, 89, - 91, 93, 95, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 102, 0, 0, 85, 0, 83, 0, 0, 82, 66, - 0, 0, 0, 0, 0, 0, 0, 94, 98, 97, - 99, 96, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 36, 37, 24, - 38, 25, 39, 26, 27, 28, 29, 30, 31, 32, - 40, 33, 34, 41, 42, 35, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 0, 6, - 8, 0, 78, 77, 0, 0, 0, 87, 87, 104, - 88, 90, 65, 92, 100, 101, 5, 7, 86, 79, - 80, 84, 0, 85, 87, 0, 85, 87, 76, 85, - 0, 85, 71, 85, 0, 85, 75, 74, 85, 0, - 70, 69, 85, 0, 73, 72, 68, 67 + 2, 0, 1, 9, 47, 0, 30, 48, 26, 0, + 26, 0, 4, 3, 32, 34, 36, 38, 40, 0, + 47, 0, 0, 30, 0, 28, 0, 0, 27, 11, + 0, 0, 0, 0, 0, 0, 0, 39, 43, 42, + 44, 41, 0, 6, 8, 0, 23, 22, 0, 0, + 0, 32, 32, 49, 33, 35, 10, 37, 45, 46, + 5, 7, 31, 24, 25, 29, 0, 30, 32, 0, + 30, 32, 21, 30, 0, 30, 16, 30, 0, 30, + 20, 19, 30, 0, 15, 14, 30, 0, 18, 17, + 13, 12 }; /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = +static const yytype_int8 yydefgoto[] = { - -1, 1, 66, 67, 137, 138, 134, 145, 68, 69, - 70, 71, 151, 72 + -1, 1, 12, 13, 27, 28, 24, 35, 14, 15, + 16, 17, 41, 18 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -141 -static const yytype_int16 yypact[] = +#define YYPACT_NINF -43 +static const yytype_int8 yypact[] = { - -141, 7, -141, 10, 12, 38, 44, 57, 62, 51, - 63, 65, 66, 67, 70, 71, 72, 73, 78, 75, - 76, 81, 79, 82, 80, 83, 84, 86, 87, 88, - 91, 92, 85, 93, 98, 95, 96, 101, 99, 102, - 100, 103, 104, 64, 105, 106, 107, 108, 109, 110, - 111, 112, 117, 118, 119, 120, 121, 122, 29, 22, - -66, -141, -58, 133, 30, 22, -141, -141, 34, 97, - 22, -141, 8, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 22, - -141, 32, 77, 181, 183, -141, 115, 116, 180, -141, - 184, 185, -72, 22, 22, 186, 22, -141, -141, -141, - -141, 69, -141, -141, -141, -141, -141, -141, -141, -141, - -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, - -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, - -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, - -141, -141, -141, -141, -141, -141, -141, -141, -141, -141, - -141, -141, -141, -141, -141, -141, -141, -141, 47, -141, - -141, 113, -141, -141, 187, 188, 191, 21, 24, -141, - 189, 97, -141, 22, -141, -141, -141, -141, -141, -141, - -141, -141, 199, 45, 34, 248, 52, 34, -141, 181, - 249, 53, -141, 181, 250, 55, -141, -141, 181, 252, - -141, -141, 181, 255, -141, -141, -141, -141 + -43, 11, -43, -43, -11, 30, 47, -43, 25, 10, + 33, 30, -43, -43, 48, 17, 30, -43, 1, 30, + -43, 4, 40, 60, 70, -43, 61, 63, 42, -43, + 64, 66, 59, 30, 30, 73, 30, -43, -43, -43, + -43, 32, -9, -43, -43, 78, -43, -43, 81, 82, + 83, 20, 44, -43, 67, 17, -43, 30, -43, -43, + -43, -43, -43, -43, -43, -43, 84, 51, 48, 86, + 54, 48, -43, 60, 87, 57, -43, 60, 88, 58, + -43, -43, 60, 89, -43, -43, 60, 90, -43, -43, + -43, -43 }; /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = +static const yytype_int8 yypgoto[] = { - -141, -141, -141, -141, 197, -141, -131, -140, -59, 182, - 190, -69, -141, -141 + -43, -43, -43, -43, 91, -43, -23, -42, -3, 62, + 68, -15, -43, -43 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -858,112 +688,50 @@ static const yytype_int16 yypgoto[] = number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 -static const yytype_uint16 yytable[] = +static const yytype_uint8 yytable[] = { - 131, 147, 212, 135, 132, 144, 142, 2, 219, 133, - 136, 148, 149, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 208, 60, 224, 61, 62, 63, 150, 233, 236, 73, - 64, 74, 130, 130, 220, 130, 65, 61, 61, 232, - 61, 135, 235, 143, 241, 209, 143, 245, 140, 129, - 65, 65, 240, 65, 210, 244, 143, 75, 246, 144, - 249, 144, 250, 76, 253, 132, 79, 254, 226, 227, - 239, 256, 132, 132, 144, 132, 77, 243, 248, 113, - 252, 78, 80, 114, 81, 82, 83, 225, 139, 84, - 85, 86, 87, 88, 89, 90, 91, 93, 92, 94, - 102, 211, 95, 96, 147, 97, 98, 99, 234, 237, - 100, 101, 103, 104, 105, 106, 107, 109, 108, 110, - 115, 116, 111, 112, 228, 146, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 213, 214, - 215, 222, 229, 230, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 238, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 132, 231, 242, 247, 251, 216, 255, 217, 218, - 257, 141, 0, 0, 0, 0, 144, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 221, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 223 + 46, 37, 21, 19, 38, 39, 60, 61, 32, 67, + 70, 2, 34, 43, 40, 29, 42, 3, 4, 5, + 44, 6, 7, 8, 9, 34, 75, 20, 10, 79, + 54, 7, 25, 66, 11, 58, 33, 20, 26, 36, + 25, 7, 37, 11, 74, 59, 30, 78, 68, 71, + 80, 20, 83, 11, 84, 7, 87, 69, 45, 88, + 33, 22, 50, 90, 33, 22, 23, 11, 22, 34, + 73, 22, 22, 77, 22, 47, 82, 86, 56, 48, + 34, 49, 51, 53, 52, 62, 63, 64, 34, 72, + 65, 76, 81, 85, 89, 91, 55, 0, 0, 0, + 0, 31, 0, 0, 57 }; -static const yytype_int16 yycheck[] = +static const yytype_int8 yycheck[] = { - 59, 70, 133, 61, 70, 77, 65, 0, 80, 75, - 68, 3, 4, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 129, 64, 3, 66, 67, 68, 68, 217, 218, 69, - 73, 69, 61, 61, 143, 61, 79, 66, 66, 68, - 66, 61, 68, 72, 234, 63, 72, 237, 68, 70, - 79, 79, 233, 79, 72, 236, 72, 69, 239, 77, - 241, 77, 243, 69, 245, 70, 65, 248, 71, 72, - 75, 252, 70, 70, 77, 70, 69, 75, 75, 65, - 75, 69, 69, 69, 69, 69, 69, 68, 5, 69, - 69, 69, 69, 65, 69, 69, 65, 65, 69, 69, - 65, 74, 69, 69, 223, 69, 69, 69, 217, 218, - 69, 69, 69, 65, 69, 69, 65, 65, 69, 69, - 65, 65, 69, 69, 61, 78, 69, 69, 69, 69, - 69, 69, 65, 65, 65, 65, 65, 65, 5, 74, - 74, 5, 5, 5, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 5, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 70, 61, 5, 5, 5, 76, 5, 74, 74, - 5, 64, -1, -1, -1, -1, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 144, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 146 + 23, 16, 5, 14, 3, 4, 15, 16, 11, 51, + 52, 0, 21, 9, 13, 5, 19, 6, 7, 8, + 16, 10, 11, 12, 13, 21, 68, 7, 17, 71, + 33, 11, 7, 13, 23, 3, 16, 7, 13, 22, + 7, 11, 57, 23, 67, 13, 13, 70, 51, 52, + 73, 7, 75, 23, 77, 11, 79, 13, 18, 82, + 16, 14, 20, 86, 16, 14, 19, 23, 14, 21, + 19, 14, 14, 19, 14, 5, 19, 19, 5, 18, + 21, 18, 18, 24, 18, 7, 5, 5, 21, 5, + 7, 5, 5, 5, 5, 5, 34, -1, -1, -1, + -1, 10, -1, -1, 36 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 82, 0, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 64, 66, 67, 68, 73, 79, 83, 84, 89, 90, - 91, 92, 94, 69, 69, 69, 69, 69, 69, 65, - 69, 69, 69, 69, 69, 69, 69, 69, 65, 69, - 69, 65, 69, 65, 69, 69, 69, 69, 69, 69, - 69, 69, 65, 69, 65, 69, 69, 65, 69, 65, - 69, 69, 69, 65, 69, 65, 65, 69, 69, 69, - 69, 69, 69, 65, 65, 65, 65, 65, 65, 70, - 61, 89, 70, 75, 87, 61, 68, 85, 86, 5, - 68, 85, 89, 72, 77, 88, 78, 92, 3, 4, - 68, 93, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 89, 63, - 72, 74, 87, 5, 74, 74, 76, 74, 74, 80, - 89, 90, 5, 91, 3, 68, 71, 72, 61, 5, - 5, 61, 68, 88, 89, 68, 88, 89, 5, 75, - 87, 88, 5, 75, 87, 88, 87, 5, 75, 87, - 87, 5, 75, 87, 87, 5, 87, 5 + 0, 26, 0, 6, 7, 8, 10, 11, 12, 13, + 17, 23, 27, 28, 33, 34, 35, 36, 38, 14, + 7, 33, 14, 19, 31, 7, 13, 29, 30, 5, + 13, 29, 33, 16, 21, 32, 22, 36, 3, 4, + 13, 37, 33, 9, 16, 18, 31, 5, 18, 18, + 20, 18, 18, 24, 33, 34, 5, 35, 3, 13, + 15, 16, 7, 5, 5, 7, 13, 32, 33, 13, + 32, 33, 5, 19, 31, 32, 5, 19, 31, 32, + 31, 5, 19, 31, 31, 5, 19, 31, 31, 5, + 31, 5 }; #define yyerrok (yyerrstatus = 0) @@ -1836,454 +1604,11 @@ yyreduce: case 9: - { - opts.set_condPrefix (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} + {;} break; case 10: - { - opts.set_condEnumPrefix (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 11: - - { - opts.set_condDivider (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 12: - - { - opts.set_condDividerParam (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 13: - - { - opts.set_condGoto (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 14: - - { - opts.set_condGotoParam (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 15: - - { - if ((yyvsp[(2) - (3)].num) < 0) - { - in->fatal ("configuration 'cgoto:threshold' must be nonnegative"); - } - opts.set_cGotoThreshold (static_cast ((yyvsp[(2) - (3)].num))); - ;} - break; - - case 16: - - { - opts.set_yybackup (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 17: - - { - opts.set_yybackupctx (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 18: - - { - opts.set_yycondtype (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 19: - - { - opts.set_yyctxmarker (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 20: - - { - opts.set_yyctype (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 21: - - { - opts.set_yycursor (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 22: - - { - opts.set_yydebug (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 23: - - { - opts.set_fill (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 24: - - { - opts.set_cond_get (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 25: - - { - opts.set_state_get (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 26: - - { - opts.set_yylessthan (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 27: - - { - opts.set_yylimit (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 28: - - { - opts.set_yymarker (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 29: - - { - opts.set_yypeek (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 30: - - { - opts.set_yyrestore (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 31: - - { - opts.set_yyrestorectx (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 32: - - { - opts.set_cond_set (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 33: - - { - opts.set_cond_set_naked ((yyvsp[(2) - (3)].num) != 0); - ;} - break; - - case 34: - - { - opts.set_state_set (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 35: - - { - opts.set_yyskip (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 36: - - { - opts.set_fill_naked ((yyvsp[(2) - (3)].num) != 0); - ;} - break; - - case 37: - - { - opts.set_fill_arg (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 38: - - { - opts.set_cond_get_naked ((yyvsp[(2) - (3)].num) != 0); - ;} - break; - - case 39: - - { - opts.set_state_get_naked ((yyvsp[(2) - (3)].num) != 0); - ;} - break; - - case 40: - - { - opts.set_cond_set_arg (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 41: - - { - opts.set_state_set_naked ((yyvsp[(2) - (3)].num) != 0); - ;} - break; - - case 42: - - { - opts.set_state_set_arg (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 43: - - { - if ((yyvsp[(2) - (3)].num) == 0) - { - opts.unset_encoding ((yyvsp[(1) - (3)].enc)); - } - else if (!opts.set_encoding ((yyvsp[(1) - (3)].enc))) - { - in->fatalf ("Cannot set %s encoding: please reset %s encoding first" - , Enc::name ((yyvsp[(1) - (3)].enc)) - , Enc::name (opts->encoding.type ())); - } - ;} - break; - - case 44: - - { - opts.set_indString (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 45: - - { - if ((yyvsp[(2) - (3)].num) < 0) - { - in->fatal ("configuration 'indent:top' must be nonnegative"); - } - opts.set_topIndent (static_cast ((yyvsp[(2) - (3)].num))); - ;} - break; - - case 46: - - { - opts.set_yyfilllabel (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 47: - - { - opts.set_yynext (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 48: - - { - opts.set_labelPrefix (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 49: - - { - in->out.set_force_start_label ((yyvsp[(2) - (3)].num) != 0); - ;} - break; - - case 50: - - { - in->out.set_user_start_label (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 51: - - { - opts.set_bUseStateAbort ((yyvsp[(2) - (3)].num) != 0); - ;} - break; - - case 52: - - { - opts.set_bUseStateNext ((yyvsp[(2) - (3)].num) != 0); - ;} - break; - - case 53: - - { - opts.set_yyaccept (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 54: - - { - opts.set_yybm (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 55: - - { - opts.set_yych (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 56: - - { - opts.set_yyctable (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 57: - - { - // deprecated - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 58: - - { - opts.set_yytarget (*(yyvsp[(2) - (3)].str)); - delete (yyvsp[(2) - (3)].str); - ;} - break; - - case 59: - - { - opts.set_yybmHexTable ((yyvsp[(2) - (3)].num) != 0); - ;} - break; - - case 60: - - { - opts.set_yychConversion ((yyvsp[(2) - (3)].num) != 0); - ;} - break; - - case 61: - - { - opts.set_bEmitYYCh ((yyvsp[(2) - (3)].num) != 0); - ;} - break; - - case 62: - - { - opts.set_fill_check ((yyvsp[(2) - (3)].num) != 0); - ;} - break; - - case 63: - - { - opts.set_fill_use ((yyvsp[(2) - (3)].num) != 0); - ;} - break; - - case 64: - - { - opts.set_fill_arg_use ((yyvsp[(2) - (3)].num) != 0); - ;} - break; - - case 65: - { if (opts->cFlag) { @@ -2302,7 +1627,7 @@ yyreduce: ;} break; - case 66: + case 11: { if (opts->cFlag) @@ -2323,14 +1648,14 @@ yyreduce: ;} break; - case 67: + case 12: { context_rule ((yyvsp[(2) - (7)].clist), (yyvsp[(7) - (7)].code)->loc, (yyvsp[(4) - (7)].regexp), (yyvsp[(5) - (7)].regexp), (yyvsp[(7) - (7)].code), (yyvsp[(6) - (7)].str)); ;} break; - case 68: + case 13: { assert((yyvsp[(7) - (7)].str)); @@ -2339,7 +1664,7 @@ yyreduce: ;} break; - case 69: + case 14: { context_none((yyvsp[(2) - (6)].clist)); @@ -2347,7 +1672,7 @@ yyreduce: ;} break; - case 70: + case 15: { assert((yyvsp[(6) - (6)].str)); @@ -2356,14 +1681,14 @@ yyreduce: ;} break; - case 71: + case 16: { default_rule((yyvsp[(2) - (5)].clist), (yyvsp[(5) - (5)].code)); ;} break; - case 72: + case 17: { context_check(NULL); @@ -2381,7 +1706,7 @@ yyreduce: ;} break; - case 73: + case 18: { assert((yyvsp[(7) - (7)].str)); @@ -2401,7 +1726,7 @@ yyreduce: ;} break; - case 74: + case 19: { context_none(NULL); @@ -2409,7 +1734,7 @@ yyreduce: ;} break; - case 75: + case 20: { assert((yyvsp[(6) - (6)].str)); @@ -2418,7 +1743,7 @@ yyreduce: ;} break; - case 76: + case 21: { if (star_default) @@ -2437,7 +1762,7 @@ yyreduce: ;} break; - case 77: + case 22: { context_check(NULL); @@ -2458,7 +1783,7 @@ yyreduce: ;} break; - case 78: + case 23: { assert((yyvsp[(3) - (3)].str)); @@ -2481,7 +1806,7 @@ yyreduce: ;} break; - case 79: + case 24: { CondList *clist = new CondList(); @@ -2490,28 +1815,28 @@ yyreduce: ;} break; - case 80: + case 25: { setup_rule((yyvsp[(2) - (4)].clist), (yyvsp[(4) - (4)].code)); ;} break; - case 81: + case 26: { in->fatal("unnamed condition not supported"); ;} break; - case 82: + case 27: { (yyval.clist) = (yyvsp[(1) - (1)].clist); ;} break; - case 83: + case 28: { (yyval.clist) = new CondList(); @@ -2520,7 +1845,7 @@ yyreduce: ;} break; - case 84: + case 29: { (yyvsp[(1) - (3)].clist)->insert(* (yyvsp[(3) - (3)].str)); @@ -2529,84 +1854,84 @@ yyreduce: ;} break; - case 85: + case 30: { (yyval.str) = NULL; ;} break; - case 86: + case 31: { (yyval.str) = (yyvsp[(3) - (3)].str); ;} break; - case 87: + case 32: { (yyval.regexp) = new NullOp; ;} break; - case 88: + case 33: { (yyval.regexp) = (yyvsp[(2) - (2)].regexp); ;} break; - case 89: + case 34: { (yyval.regexp) = (yyvsp[(1) - (1)].regexp); ;} break; - case 90: + case 35: { (yyval.regexp) = mkAlt((yyvsp[(1) - (3)].regexp), (yyvsp[(3) - (3)].regexp)); ;} break; - case 91: + case 36: { (yyval.regexp) = (yyvsp[(1) - (1)].regexp); ;} break; - case 92: + case 37: { (yyval.regexp) = in->mkDiff((yyvsp[(1) - (3)].regexp), (yyvsp[(3) - (3)].regexp)); ;} break; - case 93: + case 38: { (yyval.regexp) = (yyvsp[(1) - (1)].regexp); ;} break; - case 94: + case 39: { (yyval.regexp) = new CatOp((yyvsp[(1) - (2)].regexp), (yyvsp[(2) - (2)].regexp)); ;} break; - case 95: + case 40: { (yyval.regexp) = (yyvsp[(1) - (1)].regexp); ;} break; - case 96: + case 41: { switch((yyvsp[(2) - (2)].op)) @@ -2624,7 +1949,7 @@ yyreduce: ;} break; - case 97: + case 42: { (yyvsp[(1) - (2)].regexp)->ins_access = RegExp::PRIVATE; @@ -2644,35 +1969,35 @@ yyreduce: ;} break; - case 98: + case 43: { (yyval.op) = (yyvsp[(1) - (1)].op); ;} break; - case 99: + case 44: { (yyval.op) = (yyvsp[(1) - (1)].op); ;} break; - case 100: + case 45: { (yyval.op) = ((yyvsp[(1) - (2)].op) == (yyvsp[(2) - (2)].op)) ? (yyvsp[(1) - (2)].op) : '*'; ;} break; - case 101: + case 46: { (yyval.op) = ((yyvsp[(1) - (2)].op) == (yyvsp[(2) - (2)].op)) ? (yyvsp[(1) - (2)].op) : '*'; ;} break; - case 102: + case 47: { symbol_table_t::iterator i = symbol_table.find (* (yyvsp[(1) - (1)].str)); @@ -2685,14 +2010,14 @@ yyreduce: ;} break; - case 103: + case 48: { (yyval.regexp) = (yyvsp[(1) - (1)].regexp); ;} break; - case 104: + case 49: { (yyval.regexp) = (yyvsp[(2) - (3)].regexp); diff --git a/re2c/bootstrap/src/parse/scanner_lex.cc b/re2c/bootstrap/src/parse/scanner_lex.cc index 7952d4ae..4aaa0b8d 100644 --- a/re2c/bootstrap/src/parse/scanner_lex.cc +++ b/re2c/bootstrap/src/parse/scanner_lex.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 0.14.3 on Fri Sep 25 22:44:26 2015 */ +/* Generated by re2c 0.14.3 on Mon Oct 12 13:53:59 2015 */ #line 1 "../src/parse/scanner_lex.re" #include #include @@ -32,7 +32,7 @@ namespace re2c #line 32 "../src/parse/scanner_lex.re" -#line 56 "../src/parse/scanner_lex.re" +#line 58 "../src/parse/scanner_lex.re" Scanner::ParseMode Scanner::echo() @@ -107,7 +107,7 @@ echo: } } ++YYCURSOR; -#line 199 "../src/parse/scanner_lex.re" +#line 201 "../src/parse/scanner_lex.re" { if (!ignore_eoc && opts->target == opt_t::CODE) { @@ -123,7 +123,7 @@ echo: yy4: ++YYCURSOR; yy5: -#line 210 "../src/parse/scanner_lex.re" +#line 212 "../src/parse/scanner_lex.re" { goto echo; } @@ -136,7 +136,7 @@ yy6: } if (yych == '#') goto yy91; yy7: -#line 186 "../src/parse/scanner_lex.re" +#line 188 "../src/parse/scanner_lex.re" { if (ignore_eoc) { @@ -234,7 +234,7 @@ yy21: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy12; ++YYCURSOR; -#line 87 "../src/parse/scanner_lex.re" +#line 89 "../src/parse/scanner_lex.re" { if (opts->rFlag) { @@ -253,7 +253,7 @@ yy31: if (yych != 'c') goto yy12; yy32: ++YYCURSOR; -#line 72 "../src/parse/scanner_lex.re" +#line 74 "../src/parse/scanner_lex.re" { if (opts->rFlag) { @@ -284,7 +284,7 @@ yy34: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy12; ++YYCURSOR; -#line 99 "../src/parse/scanner_lex.re" +#line 101 "../src/parse/scanner_lex.re" { if (!opts->rFlag) { @@ -314,7 +314,7 @@ yy42: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy12; ++YYCURSOR; -#line 113 "../src/parse/scanner_lex.re" +#line 115 "../src/parse/scanner_lex.re" { if (opts->target != opt_t::DOT) { @@ -349,7 +349,7 @@ yy50: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy12; ++YYCURSOR; -#line 122 "../src/parse/scanner_lex.re" +#line 124 "../src/parse/scanner_lex.re" { tok = pos = cur; out.insert_state_goto (opts->topIndent); @@ -377,7 +377,7 @@ yy63: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy12; ++YYCURSOR; -#line 128 "../src/parse/scanner_lex.re" +#line 130 "../src/parse/scanner_lex.re" { tok = pos = cur; ignore_eoc = true; @@ -402,7 +402,7 @@ yy74: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy12; ++YYCURSOR; -#line 133 "../src/parse/scanner_lex.re" +#line 135 "../src/parse/scanner_lex.re" { tok = pos = cur; ignore_eoc = true; @@ -423,7 +423,7 @@ yy84: if (yych == '\n') goto yy87; if (yych == '\r') goto yy86; yy85: -#line 164 "../src/parse/scanner_lex.re" +#line 166 "../src/parse/scanner_lex.re" { if (ignore_eoc) { @@ -448,7 +448,7 @@ yy86: if (yych != '\n') goto yy12; yy87: ++YYCURSOR; -#line 146 "../src/parse/scanner_lex.re" +#line 148 "../src/parse/scanner_lex.re" { cline++; if (ignore_eoc) @@ -542,7 +542,7 @@ yy101: yy103: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 182 "../src/parse/scanner_lex.re" +#line 184 "../src/parse/scanner_lex.re" { set_sourceline (); goto echo; @@ -572,7 +572,7 @@ yy109: if (yych == '\r') goto yy105; goto yy12; } -#line 213 "../src/parse/scanner_lex.re" +#line 215 "../src/parse/scanner_lex.re" } @@ -587,13 +587,12 @@ scan: switch (lexer_state) { case LEX_NORMAL: goto start; - case LEX_CONF: goto conf_eq; case LEX_FLEX_NAME: goto flex_name; } start: -#line 597 "src/parse/scanner_lex.cc" +#line 596 "src/parse/scanner_lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -708,22 +707,22 @@ start: yy112: ++YYCURSOR; yy113: -#line 409 "../src/parse/scanner_lex.re" +#line 410 "../src/parse/scanner_lex.re" { fatalf("unexpected character: '%c'", *tok); goto scan; } -#line 717 "src/parse/scanner_lex.cc" +#line 716 "src/parse/scanner_lex.cc" yy114: ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; goto yy220; yy115: -#line 393 "../src/parse/scanner_lex.re" +#line 394 "../src/parse/scanner_lex.re" { goto scan; } -#line 727 "src/parse/scanner_lex.cc" +#line 726 "src/parse/scanner_lex.cc" yy116: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -734,75 +733,75 @@ yy116: if (yych == '#') goto yy200; } yy117: -#line 402 "../src/parse/scanner_lex.re" +#line 403 "../src/parse/scanner_lex.re" { if (cur == eof) return 0; pos = cur; cline++; goto scan; } -#line 745 "src/parse/scanner_lex.cc" +#line 744 "src/parse/scanner_lex.cc" yy118: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy197; goto yy113; yy119: ++YYCURSOR; -#line 270 "../src/parse/scanner_lex.re" +#line 271 "../src/parse/scanner_lex.re" { std::vector cpoints; lex_cpoints ('"', cpoints); yylval.regexp = cpoint_string (cpoints, opts->bCaseInsensitive || opts->bCaseInverted); return REGEXP; } -#line 759 "src/parse/scanner_lex.cc" +#line 758 "src/parse/scanner_lex.cc" yy121: yych = (YYCTYPE)*++YYCURSOR; if (yych == '}') goto yy195; goto yy113; yy122: ++YYCURSOR; -#line 263 "../src/parse/scanner_lex.re" +#line 264 "../src/parse/scanner_lex.re" { std::vector cpoints; lex_cpoints ('\'', cpoints); yylval.regexp = cpoint_string (cpoints, opts->bCaseInsensitive || !opts->bCaseInverted); return REGEXP; } -#line 773 "src/parse/scanner_lex.cc" +#line 772 "src/parse/scanner_lex.cc" yy124: ++YYCURSOR; yy125: -#line 297 "../src/parse/scanner_lex.re" +#line 298 "../src/parse/scanner_lex.re" { return *tok; } -#line 781 "src/parse/scanner_lex.cc" +#line 780 "src/parse/scanner_lex.cc" yy126: ++YYCURSOR; if ((yych = (YYCTYPE)*YYCURSOR) == '/') goto yy195; -#line 301 "../src/parse/scanner_lex.re" +#line 302 "../src/parse/scanner_lex.re" { yylval.op = *tok; return STAR; } -#line 790 "src/parse/scanner_lex.cc" +#line 789 "src/parse/scanner_lex.cc" yy128: ++YYCURSOR; -#line 305 "../src/parse/scanner_lex.re" +#line 306 "../src/parse/scanner_lex.re" { yylval.op = *tok; return CLOSE; } -#line 798 "src/parse/scanner_lex.cc" +#line 797 "src/parse/scanner_lex.cc" yy130: ++YYCURSOR; -#line 388 "../src/parse/scanner_lex.re" +#line 389 "../src/parse/scanner_lex.re" { yylval.regexp = mkDot(); return REGEXP; } -#line 806 "src/parse/scanner_lex.cc" +#line 805 "src/parse/scanner_lex.cc" yy132: yych = (YYCTYPE)*++YYCURSOR; if (yych == '*') goto yy191; @@ -826,14 +825,14 @@ yy135: yy136: ++YYCURSOR; if ((yych = (YYCTYPE)*YYCURSOR) == '^') goto yy176; -#line 277 "../src/parse/scanner_lex.re" +#line 278 "../src/parse/scanner_lex.re" { std::vector cpoints; lex_cpoints (']', cpoints); yylval.regexp = cpoint_class (cpoints, false); return REGEXP; } -#line 837 "src/parse/scanner_lex.cc" +#line 836 "src/parse/scanner_lex.cc" yy138: YYCTXMARKER = YYCURSOR + 1; yych = (YYCTYPE)*++YYCURSOR; @@ -857,12 +856,12 @@ yy139: } } yy140: -#line 233 "../src/parse/scanner_lex.re" +#line 234 "../src/parse/scanner_lex.re" { depth = 1; goto code; } -#line 866 "src/parse/scanner_lex.cc" +#line 865 "src/parse/scanner_lex.cc" yy141: ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -911,14 +910,14 @@ yy144: yy146: ++YYCURSOR; yy147: -#line 341 "../src/parse/scanner_lex.re" +#line 342 "../src/parse/scanner_lex.re" { fatal("illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers"); } -#line 919 "src/parse/scanner_lex.cc" +#line 918 "src/parse/scanner_lex.cc" yy148: ++YYCURSOR; -#line 345 "../src/parse/scanner_lex.re" +#line 346 "../src/parse/scanner_lex.re" { if (!opts->FFlag) { fatal("curly braces for names only allowed with -F switch"); @@ -926,10 +925,10 @@ yy148: yylval.str = new std::string (tok + 1, tok_len () - 2); // -2 to omit braces return ID; } -#line 930 "src/parse/scanner_lex.cc" +#line 929 "src/parse/scanner_lex.cc" yy150: ++YYCURSOR; -#line 310 "../src/parse/scanner_lex.re" +#line 311 "../src/parse/scanner_lex.re" { if (!s_to_u32_unsafe (tok + 1, cur - 1, yylval.extop.min)) { @@ -938,7 +937,7 @@ yy150: yylval.extop.max = yylval.extop.min; return CLOSESIZE; } -#line 942 "src/parse/scanner_lex.cc" +#line 941 "src/parse/scanner_lex.cc" yy152: yyaccept = 3; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -946,7 +945,7 @@ yy152: if (yych <= '9') goto yy155; if (yych != '}') goto yy147; ++YYCURSOR; -#line 332 "../src/parse/scanner_lex.re" +#line 333 "../src/parse/scanner_lex.re" { if (!s_to_u32_unsafe (tok + 1, cur - 2, yylval.extop.min)) { @@ -955,7 +954,7 @@ yy152: yylval.extop.max = UINT32_MAX; return CLOSESIZE; } -#line 959 "src/parse/scanner_lex.cc" +#line 958 "src/parse/scanner_lex.cc" yy155: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -964,7 +963,7 @@ yy155: if (yych <= '9') goto yy155; if (yych != '}') goto yy143; ++YYCURSOR; -#line 319 "../src/parse/scanner_lex.re" +#line 320 "../src/parse/scanner_lex.re" { const char * p = strchr (tok, ','); if (!s_to_u32_unsafe (tok + 1, p, yylval.extop.min)) @@ -977,11 +976,11 @@ yy155: } return CLOSESIZE; } -#line 981 "src/parse/scanner_lex.cc" +#line 980 "src/parse/scanner_lex.cc" yy159: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 373 "../src/parse/scanner_lex.re" +#line 374 "../src/parse/scanner_lex.re" { if (!opts->FFlag) { yylval.str = new std::string (tok, tok_len ()); @@ -996,7 +995,7 @@ yy159: return REGEXP; } } -#line 1000 "src/parse/scanner_lex.cc" +#line 999 "src/parse/scanner_lex.cc" yy161: yych = (YYCTYPE)*++YYCURSOR; goto yy174; @@ -1004,12 +1003,12 @@ yy162: ++YYCURSOR; yy163: YYCURSOR = YYCTXMARKER; -#line 368 "../src/parse/scanner_lex.re" +#line 369 "../src/parse/scanner_lex.re" { yylval.str = new std::string (tok, tok_len ()); return ID; } -#line 1013 "src/parse/scanner_lex.cc" +#line 1012 "src/parse/scanner_lex.cc" yy164: YYCTXMARKER = YYCURSOR + 1; ++YYCURSOR; @@ -1054,13 +1053,13 @@ yy166: yych = (YYCTYPE)*++YYCURSOR; if (yych != ':') goto yy165; ++YYCURSOR; -#line 353 "../src/parse/scanner_lex.re" +#line 354 "../src/parse/scanner_lex.re" { goto conf; } -#line 1060 "src/parse/scanner_lex.cc" +#line 1059 "src/parse/scanner_lex.cc" yy171: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 355 "../src/parse/scanner_lex.re" +#line 356 "../src/parse/scanner_lex.re" { yylval.str = new std::string (tok, tok_len ()); if (opts->FFlag) @@ -1073,7 +1072,7 @@ yy171: return ID; } } -#line 1077 "src/parse/scanner_lex.cc" +#line 1076 "src/parse/scanner_lex.cc" yy173: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -1090,21 +1089,21 @@ yy175: goto yy163; yy176: ++YYCURSOR; -#line 284 "../src/parse/scanner_lex.re" +#line 285 "../src/parse/scanner_lex.re" { std::vector cpoints; lex_cpoints (']', cpoints); yylval.regexp = cpoint_class (cpoints, true); return REGEXP; } -#line 1101 "src/parse/scanner_lex.cc" +#line 1100 "src/parse/scanner_lex.cc" yy178: ++YYCURSOR; -#line 294 "../src/parse/scanner_lex.re" +#line 295 "../src/parse/scanner_lex.re" { return SETUP; } -#line 1108 "src/parse/scanner_lex.cc" +#line 1107 "src/parse/scanner_lex.cc" yy180: YYCTXMARKER = YYCURSOR + 1; yych = (YYCTYPE)*++YYCURSOR; @@ -1134,11 +1133,11 @@ yy182: yy183: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 291 "../src/parse/scanner_lex.re" +#line 292 "../src/parse/scanner_lex.re" { return NOCOND; } -#line 1142 "src/parse/scanner_lex.cc" +#line 1141 "src/parse/scanner_lex.cc" yy185: yych = (YYCTYPE)*++YYCURSOR; if (yych == '>') goto yy183; @@ -1150,44 +1149,44 @@ yy186: yy187: ++YYCURSOR; if ((yych = (YYCTYPE)*YYCURSOR) == '>') goto yy189; -#line 242 "../src/parse/scanner_lex.re" +#line 243 "../src/parse/scanner_lex.re" { tok += 2; /* skip ":=" */ depth = 0; goto code; } -#line 1160 "src/parse/scanner_lex.cc" +#line 1159 "src/parse/scanner_lex.cc" yy189: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 238 "../src/parse/scanner_lex.re" +#line 239 "../src/parse/scanner_lex.re" { return *tok; } -#line 1168 "src/parse/scanner_lex.cc" +#line 1167 "src/parse/scanner_lex.cc" yy191: ++YYCURSOR; -#line 251 "../src/parse/scanner_lex.re" +#line 252 "../src/parse/scanner_lex.re" { depth = 1; goto comment; } -#line 1176 "src/parse/scanner_lex.cc" +#line 1175 "src/parse/scanner_lex.cc" yy193: ++YYCURSOR; -#line 248 "../src/parse/scanner_lex.re" +#line 249 "../src/parse/scanner_lex.re" { goto nextLine; } -#line 1183 "src/parse/scanner_lex.cc" +#line 1182 "src/parse/scanner_lex.cc" yy195: ++YYCURSOR; -#line 257 "../src/parse/scanner_lex.re" +#line 258 "../src/parse/scanner_lex.re" { tok = cur; return 0; } -#line 1191 "src/parse/scanner_lex.cc" +#line 1190 "src/parse/scanner_lex.cc" yy197: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -1280,12 +1279,12 @@ yy210: yy212: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 397 "../src/parse/scanner_lex.re" +#line 398 "../src/parse/scanner_lex.re" { set_sourceline (); goto scan; } -#line 1289 "src/parse/scanner_lex.cc" +#line 1288 "src/parse/scanner_lex.cc" yy214: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy212; @@ -1318,12 +1317,12 @@ yy220: if (yych == ' ') goto yy219; goto yy115; } -#line 413 "../src/parse/scanner_lex.re" +#line 414 "../src/parse/scanner_lex.re" flex_name: -#line 1327 "src/parse/scanner_lex.cc" +#line 1326 "src/parse/scanner_lex.cc" { YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); @@ -1332,22 +1331,22 @@ flex_name: if (yych == '\r') goto yy227; ++YYCURSOR; yy224: -#line 424 "../src/parse/scanner_lex.re" +#line 425 "../src/parse/scanner_lex.re" { YYCURSOR = tok; goto start; } -#line 1341 "src/parse/scanner_lex.cc" +#line 1340 "src/parse/scanner_lex.cc" yy225: ++YYCURSOR; yy226: -#line 418 "../src/parse/scanner_lex.re" +#line 419 "../src/parse/scanner_lex.re" { YYCURSOR = tok; lexer_state = LEX_NORMAL; return FID_END; } -#line 1351 "src/parse/scanner_lex.cc" +#line 1350 "src/parse/scanner_lex.cc" yy227: yych = (YYCTYPE)*++YYCURSOR; if (yych != '\n') goto yy224; @@ -1355,12 +1354,12 @@ yy227: yych = (YYCTYPE)*YYCURSOR; goto yy226; } -#line 428 "../src/parse/scanner_lex.re" +#line 429 "../src/parse/scanner_lex.re" code: -#line 1364 "src/parse/scanner_lex.cc" +#line 1363 "src/parse/scanner_lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -1421,7 +1420,7 @@ code: } yy231: ++YYCURSOR; -#line 491 "../src/parse/scanner_lex.re" +#line 492 "../src/parse/scanner_lex.re" { if (cur == eof) { @@ -1433,15 +1432,15 @@ yy231: } goto code; } -#line 1437 "src/parse/scanner_lex.cc" +#line 1436 "src/parse/scanner_lex.cc" yy233: ++YYCURSOR; yy234: -#line 505 "../src/parse/scanner_lex.re" +#line 506 "../src/parse/scanner_lex.re" { goto code; } -#line 1445 "src/parse/scanner_lex.cc" +#line 1444 "src/parse/scanner_lex.cc" yy235: YYCTXMARKER = YYCURSOR + 1; yyaccept = 0; @@ -1461,7 +1460,7 @@ yy235: } } yy236: -#line 472 "../src/parse/scanner_lex.re" +#line 473 "../src/parse/scanner_lex.re" { if (depth == 0) { @@ -1481,7 +1480,7 @@ yy236: cline++; goto code; } -#line 1485 "src/parse/scanner_lex.cc" +#line 1484 "src/parse/scanner_lex.cc" yy237: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); @@ -1494,7 +1493,7 @@ yy238: goto yy244; yy239: ++YYCURSOR; -#line 444 "../src/parse/scanner_lex.re" +#line 445 "../src/parse/scanner_lex.re" { if (depth == 0) { @@ -1506,10 +1505,10 @@ yy239: } goto code; } -#line 1510 "src/parse/scanner_lex.cc" +#line 1509 "src/parse/scanner_lex.cc" yy241: ++YYCURSOR; -#line 432 "../src/parse/scanner_lex.re" +#line 433 "../src/parse/scanner_lex.re" { if (depth == 0) { @@ -1522,7 +1521,7 @@ yy241: } goto code; } -#line 1526 "src/parse/scanner_lex.cc" +#line 1525 "src/parse/scanner_lex.cc" yy243: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -1553,11 +1552,11 @@ yy246: goto yy243; yy247: ++YYCURSOR; -#line 502 "../src/parse/scanner_lex.re" +#line 503 "../src/parse/scanner_lex.re" { goto code; } -#line 1561 "src/parse/scanner_lex.cc" +#line 1560 "src/parse/scanner_lex.cc" yy249: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -1584,7 +1583,7 @@ yy252: } yy253: YYCURSOR = YYCTXMARKER; -#line 459 "../src/parse/scanner_lex.re" +#line 460 "../src/parse/scanner_lex.re" { if (depth == 0) { @@ -1598,7 +1597,7 @@ yy253: cline++; goto code; } -#line 1602 "src/parse/scanner_lex.cc" +#line 1601 "src/parse/scanner_lex.cc" yy254: yych = (YYCTYPE)*++YYCURSOR; goto yy253; @@ -1665,12 +1664,12 @@ yy265: yy267: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 455 "../src/parse/scanner_lex.re" +#line 456 "../src/parse/scanner_lex.re" { set_sourceline (); goto code; } -#line 1674 "src/parse/scanner_lex.cc" +#line 1673 "src/parse/scanner_lex.cc" yy269: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy267; @@ -1709,12 +1708,12 @@ yy274: goto yy245; } } -#line 508 "../src/parse/scanner_lex.re" +#line 509 "../src/parse/scanner_lex.re" comment: -#line 1718 "src/parse/scanner_lex.cc" +#line 1717 "src/parse/scanner_lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -1761,7 +1760,7 @@ comment: } ++YYCURSOR; yy279: -#line 540 "../src/parse/scanner_lex.re" +#line 541 "../src/parse/scanner_lex.re" { if (cur == eof) { @@ -1769,7 +1768,7 @@ yy279: } goto comment; } -#line 1773 "src/parse/scanner_lex.cc" +#line 1772 "src/parse/scanner_lex.cc" yy280: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 32) { @@ -1777,7 +1776,7 @@ yy280: } if (yych == '#') goto yy291; yy281: -#line 531 "../src/parse/scanner_lex.re" +#line 532 "../src/parse/scanner_lex.re" { if (cur == eof) { @@ -1787,7 +1786,7 @@ yy281: cline++; goto comment; } -#line 1791 "src/parse/scanner_lex.cc" +#line 1790 "src/parse/scanner_lex.cc" yy282: yych = (YYCTYPE)*++YYCURSOR; if (yych == '/') goto yy286; @@ -1796,16 +1795,16 @@ yy283: yych = (YYCTYPE)*++YYCURSOR; if (yych != '*') goto yy279; ++YYCURSOR; -#line 522 "../src/parse/scanner_lex.re" +#line 523 "../src/parse/scanner_lex.re" { ++depth; fatal("ambiguous /* found"); goto comment; } -#line 1806 "src/parse/scanner_lex.cc" +#line 1805 "src/parse/scanner_lex.cc" yy286: ++YYCURSOR; -#line 512 "../src/parse/scanner_lex.re" +#line 513 "../src/parse/scanner_lex.re" { if (--depth == 0) { @@ -1816,7 +1815,7 @@ yy286: goto comment; } } -#line 1820 "src/parse/scanner_lex.cc" +#line 1819 "src/parse/scanner_lex.cc" yy288: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -1894,12 +1893,12 @@ yy301: yy303: ++YYCURSOR; YYCURSOR = YYCTXMARKER; -#line 527 "../src/parse/scanner_lex.re" +#line 528 "../src/parse/scanner_lex.re" { set_sourceline (); goto comment; } -#line 1903 "src/parse/scanner_lex.cc" +#line 1902 "src/parse/scanner_lex.cc" yy305: yych = (YYCTYPE)*++YYCURSOR; if (yych == '\n') goto yy303; @@ -1924,28 +1923,28 @@ yy309: if (yych == '\r') goto yy305; goto yy290; } -#line 547 "../src/parse/scanner_lex.re" +#line 548 "../src/parse/scanner_lex.re" nextLine: -#line 1933 "src/parse/scanner_lex.cc" +#line 1932 "src/parse/scanner_lex.cc" { YYCTYPE yych; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych == '\n') goto yy314; ++YYCURSOR; -#line 558 "../src/parse/scanner_lex.re" +#line 559 "../src/parse/scanner_lex.re" { if(cur == eof) { return 0; } goto nextLine; } -#line 1946 "src/parse/scanner_lex.cc" +#line 1945 "src/parse/scanner_lex.cc" yy314: ++YYCURSOR; -#line 551 "../src/parse/scanner_lex.re" +#line 552 "../src/parse/scanner_lex.re" { if(cur == eof) { return 0; } @@ -1953,19 +1952,52 @@ yy314: cline++; goto scan; } -#line 1957 "src/parse/scanner_lex.cc" +#line 1956 "src/parse/scanner_lex.cc" } -#line 563 "../src/parse/scanner_lex.re" +#line 564 "../src/parse/scanner_lex.re" conf: tok = cur; - lexer_state = LEX_CONF; -#line 1966 "src/parse/scanner_lex.cc" +#line 1964 "src/parse/scanner_lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; + static const unsigned char yybm[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 64, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; if ((YYLIMIT - YYCURSOR) < 27) YYFILL(27); yych = (YYCTYPE)*YYCURSOR; switch (yych) { @@ -1984,32 +2016,32 @@ yy318: yy319: #line 569 "../src/parse/scanner_lex.re" { fatal ((tok - pos) - tchar, "unrecognized configuration"); } -#line 1988 "src/parse/scanner_lex.cc" +#line 2020 "src/parse/scanner_lex.cc" yy320: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'g') goto yy700; - if (yych == 'o') goto yy701; + if (yych == 'g') goto yy709; + if (yych == 'o') goto yy710; goto yy319; yy321: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'e') goto yy509; + if (yych == 'e') goto yy518; goto yy319; yy322: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'l') goto yy502; + if (yych == 'l') goto yy511; goto yy319; yy323: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'n') goto yy485; + if (yych == 'n') goto yy494; goto yy319; yy324: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'a') goto yy456; + if (yych == 'a') goto yy465; goto yy319; yy325: yyaccept = 0; @@ -2035,40 +2067,44 @@ yy327: } yy329: YYCURSOR = YYMARKER; - if (yyaccept <= 4) { + if (yyaccept <= 5) { if (yyaccept <= 2) { if (yyaccept <= 1) { if (yyaccept == 0) { goto yy319; } else { - goto yy532; + goto yy455; } } else { - goto yy572; + goto yy541; } } else { - if (yyaccept == 3) { - goto yy593; + if (yyaccept <= 4) { + if (yyaccept == 3) { + goto yy581; + } else { + goto yy602; + } } else { - goto yy609; + goto yy618; } } } else { - if (yyaccept <= 7) { - if (yyaccept <= 6) { - if (yyaccept == 5) { - goto yy646; + if (yyaccept <= 8) { + if (yyaccept <= 7) { + if (yyaccept == 6) { + goto yy655; } else { - goto yy663; + goto yy672; } } else { - goto yy686; + goto yy695; } } else { - if (yyaccept == 8) { - goto yy715; + if (yyaccept == 9) { + goto yy724; } else { - goto yy725; + goto yy734; } } } @@ -2114,9 +2150,9 @@ yy339: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'k') goto yy329; ++YYCURSOR; -#line 634 "../src/parse/scanner_lex.re" - { return CONF_YYFILL_CHECK; } -#line 2120 "src/parse/scanner_lex.cc" +#line 663 "../src/parse/scanner_lex.re" + { opts.set_fill_check (lex_conf_number () != 0); return CONF; } +#line 2156 "src/parse/scanner_lex.cc" yy345: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'a') goto yy329; @@ -2127,9 +2163,9 @@ yy345: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'e') goto yy329; ++YYCURSOR; -#line 635 "../src/parse/scanner_lex.re" - { return CONF_YYFILL_ENABLE; } -#line 2133 "src/parse/scanner_lex.cc" +#line 664 "../src/parse/scanner_lex.re" + { opts.set_fill_use (lex_conf_number () != 0); return CONF; } +#line 2169 "src/parse/scanner_lex.cc" yy351: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'r') goto yy329; @@ -2146,9 +2182,9 @@ yy351: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'r') goto yy329; ++YYCURSOR; -#line 636 "../src/parse/scanner_lex.re" - { return CONF_YYFILL_PARAMETER; } -#line 2152 "src/parse/scanner_lex.cc" +#line 665 "../src/parse/scanner_lex.re" + { opts.set_fill_arg_use (lex_conf_number () != 0); return CONF; } +#line 2188 "src/parse/scanner_lex.cc" yy360: yych = (YYCTYPE)*++YYCURSOR; if (yych != ':') goto yy329; @@ -2178,18 +2214,18 @@ yy363: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'n') goto yy329; ++YYCURSOR; -#line 632 "../src/parse/scanner_lex.re" - { return CONF_YYCH_CONVERSION; } -#line 2184 "src/parse/scanner_lex.cc" +#line 661 "../src/parse/scanner_lex.re" + { opts.set_yychConversion (lex_conf_number () != 0); return CONF; } +#line 2220 "src/parse/scanner_lex.cc" yy374: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'i') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 't') goto yy329; ++YYCURSOR; -#line 633 "../src/parse/scanner_lex.re" - { return CONF_YYCH_EMIT; } -#line 2193 "src/parse/scanner_lex.cc" +#line 662 "../src/parse/scanner_lex.re" + { opts.set_bEmitYYCh (lex_conf_number () != 0); return CONF; } +#line 2229 "src/parse/scanner_lex.cc" yy378: yych = (YYCTYPE)*++YYCURSOR; if (yych != ':') goto yy329; @@ -2200,9 +2236,9 @@ yy378: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'x') goto yy329; ++YYCURSOR; -#line 631 "../src/parse/scanner_lex.re" - { return CONF_YYBM_HEX; } -#line 2206 "src/parse/scanner_lex.cc" +#line 660 "../src/parse/scanner_lex.re" + { opts.set_yybmHexTable (lex_conf_number () != 0); return CONF; } +#line 2242 "src/parse/scanner_lex.cc" yy384: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'r') goto yy329; @@ -2261,19 +2297,19 @@ yy398: yych = (YYCTYPE)*++YYCURSOR; if (yych != 't') goto yy329; ++YYCURSOR; -#line 625 "../src/parse/scanner_lex.re" - { return CONF_VARIABLE_YYACCEPT; } -#line 2267 "src/parse/scanner_lex.cc" +#line 654 "../src/parse/scanner_lex.re" + { opts.set_yyaccept (lex_conf_string ()); return CONF; } +#line 2303 "src/parse/scanner_lex.cc" yy405: ++YYCURSOR; -#line 626 "../src/parse/scanner_lex.re" - { return CONF_VARIABLE_YYBM; } -#line 2272 "src/parse/scanner_lex.cc" +#line 655 "../src/parse/scanner_lex.re" + { opts.set_yybm (lex_conf_string ()); return CONF; } +#line 2308 "src/parse/scanner_lex.cc" yy407: ++YYCURSOR; -#line 627 "../src/parse/scanner_lex.re" - { return CONF_VARIABLE_YYCH; } -#line 2277 "src/parse/scanner_lex.cc" +#line 656 "../src/parse/scanner_lex.re" + { opts.set_yych (lex_conf_string ()); return CONF; } +#line 2313 "src/parse/scanner_lex.cc" yy409: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'a') goto yy329; @@ -2284,9 +2320,9 @@ yy409: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'e') goto yy329; ++YYCURSOR; -#line 628 "../src/parse/scanner_lex.re" - { return CONF_VARIABLE_YYCTABLE; } -#line 2290 "src/parse/scanner_lex.cc" +#line 657 "../src/parse/scanner_lex.re" + { opts.set_yyctable (lex_conf_string ()); return CONF; } +#line 2326 "src/parse/scanner_lex.cc" yy415: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'a') goto yy329; @@ -2297,9 +2333,9 @@ yy415: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'e') goto yy329; ++YYCURSOR; -#line 629 "../src/parse/scanner_lex.re" - { return CONF_VARIABLE_YYSTABLE; } -#line 2303 "src/parse/scanner_lex.cc" +#line 658 "../src/parse/scanner_lex.re" + { lex_conf_string (); return CONF; } +#line 2339 "src/parse/scanner_lex.cc" yy421: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'r') goto yy329; @@ -2310,47 +2346,34 @@ yy421: yych = (YYCTYPE)*++YYCURSOR; if (yych != 't') goto yy329; ++YYCURSOR; -#line 630 "../src/parse/scanner_lex.re" - { return CONF_VARIABLE_YYTARGET; } -#line 2316 "src/parse/scanner_lex.cc" +#line 659 "../src/parse/scanner_lex.re" + { opts.set_yytarget (lex_conf_string ()); return CONF; } +#line 2352 "src/parse/scanner_lex.cc" yy427: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'a') goto yy329; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy430; - if (yych != 't') goto yy329; + if (yych == 'r') goto yy429; + if (yych == 't') goto yy430; + goto yy329; +yy429: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'e') goto yy438; + if (yych == 't') goto yy449; goto yy329; yy430: - yych = (YYCTYPE)*++YYCURSOR; - if (yych != 't') goto yy329; - yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy329; - yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'a') goto yy329; - yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'b') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'e') goto yy329; - yych = (YYCTYPE)*++YYCURSOR; - if (yych != 'l') goto yy329; - ++YYCURSOR; -#line 622 "../src/parse/scanner_lex.re" - { return CONF_STARTLABEL; } -#line 2342 "src/parse/scanner_lex.cc" -yy438: yych = (YYCTYPE)*++YYCURSOR; if (yych != ':') goto yy329; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'a') goto yy440; - if (yych == 'n') goto yy441; + if (yych == 'a') goto yy433; + if (yych == 'n') goto yy434; goto yy329; -yy440: +yy433: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'b') goto yy451; + if (yych == 'b') goto yy444; goto yy329; -yy441: +yy434: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'e') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2368,10 +2391,10 @@ yy441: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'l') goto yy329; ++YYCURSOR; -#line 624 "../src/parse/scanner_lex.re" - { return CONF_STATE_NEXTLABEL; } -#line 2374 "src/parse/scanner_lex.cc" -yy451: +#line 653 "../src/parse/scanner_lex.re" + { opts.set_bUseStateNext (lex_conf_number () != 0); return CONF; } +#line 2397 "src/parse/scanner_lex.cc" +yy444: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'o') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2379,10 +2402,81 @@ yy451: yych = (YYCTYPE)*++YYCURSOR; if (yych != 't') goto yy329; ++YYCURSOR; -#line 623 "../src/parse/scanner_lex.re" - { return CONF_STATE_ABORT; } -#line 2385 "src/parse/scanner_lex.cc" +#line 652 "../src/parse/scanner_lex.re" + { opts.set_bUseStateAbort (lex_conf_number () != 0); return CONF; } +#line 2408 "src/parse/scanner_lex.cc" +yy449: + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy329; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'a') goto yy329; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'b') goto yy329; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'e') goto yy329; + yych = (YYCTYPE)*++YYCURSOR; + if (yych != 'l') goto yy329; + YYCTXMARKER = YYCURSOR + 1; + yyaccept = 1; + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yybm[0+yych] & 64) { + goto yy456; + } + if (yych == '=') goto yy458; +yy455: +#line 669 "../src/parse/scanner_lex.re" + { out.set_user_start_label (lex_conf_string ()); return CONF; } +#line 2430 "src/parse/scanner_lex.cc" yy456: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 64) { + goto yy456; + } + if (yych != '=') goto yy329; +yy458: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= ',') { + if (yych <= '\t') { + if (yych <= 0x08) goto yy329; + goto yy458; + } else { + if (yych == ' ') goto yy458; + goto yy329; + } + } else { + if (yych <= '/') { + if (yych <= '-') goto yy462; + goto yy329; + } else { + if (yych <= '0') goto yy460; + if (yych <= '9') goto yy463; + goto yy329; + } + } +yy460: + ++YYCURSOR; +yy461: + YYCURSOR = YYCTXMARKER; +#line 668 "../src/parse/scanner_lex.re" + { out.set_force_start_label (lex_conf_number () != 0); return CONF; } +#line 2467 "src/parse/scanner_lex.cc" +yy462: + yych = (YYCTYPE)*++YYCURSOR; + if (yych <= '0') goto yy329; + if (yych >= ':') goto yy329; +yy463: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy463; + } + goto yy461; +yy465: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'b') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2390,25 +2484,25 @@ yy456: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'l') goto yy329; yych = (YYCTYPE)*++YYCURSOR; - if (yych == ':') goto yy461; + if (yych == ':') goto yy470; if (yych != 'p') goto yy329; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy479; + if (yych == 'r') goto yy488; goto yy329; -yy461: +yy470: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'y') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'y') goto yy329; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'F') goto yy464; - if (yych == 'N') goto yy465; + if (yych == 'F') goto yy473; + if (yych == 'N') goto yy474; goto yy329; -yy464: +yy473: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'i') goto yy470; + if (yych == 'i') goto yy479; goto yy329; -yy465: +yy474: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'e') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2416,10 +2510,10 @@ yy465: yych = (YYCTYPE)*++YYCURSOR; if (yych != 't') goto yy329; ++YYCURSOR; -#line 620 "../src/parse/scanner_lex.re" - { return CONF_LABEL_YYNEXT; } -#line 2422 "src/parse/scanner_lex.cc" -yy470: +#line 650 "../src/parse/scanner_lex.re" + { opts.set_yynext (lex_conf_string ()); return CONF; } +#line 2516 "src/parse/scanner_lex.cc" +yy479: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'l') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2435,10 +2529,10 @@ yy470: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'l') goto yy329; ++YYCURSOR; -#line 619 "../src/parse/scanner_lex.re" - { return CONF_LABEL_YYFILLLABEL; } -#line 2441 "src/parse/scanner_lex.cc" -yy479: +#line 649 "../src/parse/scanner_lex.re" + { opts.set_yyfilllabel (lex_conf_string ()); return CONF; } +#line 2535 "src/parse/scanner_lex.cc" +yy488: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'e') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2448,10 +2542,10 @@ yy479: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'x') goto yy329; ++YYCURSOR; -#line 621 "../src/parse/scanner_lex.re" - { return CONF_LABELPREFIX; } -#line 2454 "src/parse/scanner_lex.cc" -yy485: +#line 651 "../src/parse/scanner_lex.re" + { opts.set_labelPrefix (lex_conf_string ()); return CONF; } +#line 2548 "src/parse/scanner_lex.cc" +yy494: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'd') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2464,12 +2558,12 @@ yy485: if (yych != ':') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych <= 'r') goto yy329; - if (yych <= 's') goto yy492; + if (yych <= 's') goto yy501; if (yych >= 'u') goto yy329; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy499; + if (yych == 'o') goto yy508; goto yy329; -yy492: +yy501: yych = (YYCTYPE)*++YYCURSOR; if (yych != 't') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2481,17 +2575,25 @@ yy492: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'g') goto yy329; ++YYCURSOR; -#line 617 "../src/parse/scanner_lex.re" - { return CONF_INDENT_STRING; } -#line 2487 "src/parse/scanner_lex.cc" -yy499: +#line 638 "../src/parse/scanner_lex.re" + { opts.set_indString (lex_conf_string ()); return CONF; } +#line 2581 "src/parse/scanner_lex.cc" +yy508: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'p') goto yy329; ++YYCURSOR; -#line 618 "../src/parse/scanner_lex.re" - { return CONF_INDENT_TOP; } -#line 2494 "src/parse/scanner_lex.cc" -yy502: +#line 640 "../src/parse/scanner_lex.re" + { + const int32_t n = lex_conf_number (); + if (n < 0) + { + fatal ("configuration 'indent:top' must be nonnegative"); + } + opts.set_topIndent (static_cast (n)); + return CONF; + } +#line 2596 "src/parse/scanner_lex.cc" +yy511: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'a') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2502,7 +2604,7 @@ yy502: if (yych != ':') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych <= 'e') { - if (yych == '8') goto yy507; + if (yych == '8') goto yy516; if (yych <= 'd') goto yy329; } else { if (yych <= 'u') { @@ -2512,22 +2614,34 @@ yy502: if (yych >= 'y') goto yy329; } } -yy507: +yy516: ++YYCURSOR; -#line 606 "../src/parse/scanner_lex.re" +#line 615 "../src/parse/scanner_lex.re" { + Enc::type_t enc = Enc::ASCII; switch (YYCURSOR[-1]) { - case 'e': yylval.enc = Enc::EBCDIC; break; - case 'w': yylval.enc = Enc::UCS2; break; - case 'x': yylval.enc = Enc::UTF16; break; - case 'u': yylval.enc = Enc::UTF32; break; - case '8': yylval.enc = Enc::UTF8; break; + case 'e': enc = Enc::EBCDIC; break; + case 'w': enc = Enc::UCS2; break; + case 'x': enc = Enc::UTF16; break; + case 'u': enc = Enc::UTF32; break; + case '8': enc = Enc::UTF8; break; + } + const int32_t n = lex_conf_number (); + if (n == 0) + { + opts.unset_encoding (enc); + } + else if (!opts.set_encoding (enc)) + { + fatalf ("Cannot set %s encoding: please reset %s encoding first" + , Enc::name (enc) + , Enc::name (opts->encoding.type ())); } - return CONF_FLAGS; + return CONF; } -#line 2530 "src/parse/scanner_lex.cc" -yy509: +#line 2644 "src/parse/scanner_lex.cc" +yy518: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'f') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2544,63 +2658,63 @@ yy509: if (yych != 'Y') goto yy329; yych = (YYCTYPE)*++YYCURSOR; switch (yych) { - case 'B': goto yy526; - case 'C': goto yy525; - case 'D': goto yy524; - case 'F': goto yy523; - case 'G': goto yy522; - case 'L': goto yy521; - case 'M': goto yy520; - case 'P': goto yy519; - case 'R': goto yy518; - case 'S': goto yy517; + case 'B': goto yy535; + case 'C': goto yy534; + case 'D': goto yy533; + case 'F': goto yy532; + case 'G': goto yy531; + case 'L': goto yy530; + case 'M': goto yy529; + case 'P': goto yy528; + case 'R': goto yy527; + case 'S': goto yy526; default: goto yy329; } -yy517: +yy526: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'E') goto yy651; - if (yych == 'K') goto yy652; + if (yych == 'E') goto yy660; + if (yych == 'K') goto yy661; goto yy329; -yy518: +yy527: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'E') goto yy640; + if (yych == 'E') goto yy649; goto yy329; -yy519: +yy528: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'E') goto yy636; + if (yych == 'E') goto yy645; goto yy329; -yy520: +yy529: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'A') goto yy630; + if (yych == 'A') goto yy639; goto yy329; -yy521: +yy530: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'E') goto yy617; - if (yych == 'I') goto yy618; + if (yych == 'E') goto yy626; + if (yych == 'I') goto yy627; goto yy329; -yy522: +yy531: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'E') goto yy585; + if (yych == 'E') goto yy594; goto yy329; -yy523: +yy532: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'I') goto yy569; + if (yych == 'I') goto yy578; goto yy329; -yy524: +yy533: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'E') goto yy564; + if (yych == 'E') goto yy573; goto yy329; -yy525: +yy534: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 'S') { - if (yych == 'O') goto yy537; + if (yych == 'O') goto yy546; goto yy329; } else { - if (yych <= 'T') goto yy538; - if (yych <= 'U') goto yy539; + if (yych <= 'T') goto yy547; + if (yych <= 'U') goto yy548; goto yy329; } -yy526: +yy535: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'A') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2611,33 +2725,33 @@ yy526: if (yych != 'U') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'P') goto yy329; - yyaccept = 1; + yyaccept = 2; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'C') goto yy533; -yy532: -#line 578 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYBACKUP; } -#line 2621 "src/parse/scanner_lex.cc" -yy533: + if (yych == 'C') goto yy542; +yy541: +#line 587 "../src/parse/scanner_lex.re" + { opts.set_yybackup (lex_conf_string ()); return CONF; } +#line 2735 "src/parse/scanner_lex.cc" +yy542: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'T') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'X') goto yy329; ++YYCURSOR; -#line 579 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYBACKUPCTX; } -#line 2630 "src/parse/scanner_lex.cc" -yy537: +#line 588 "../src/parse/scanner_lex.re" + { opts.set_yybackupctx (lex_conf_string ()); return CONF; } +#line 2744 "src/parse/scanner_lex.cc" +yy546: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'N') goto yy557; + if (yych == 'N') goto yy566; goto yy329; -yy538: +yy547: yych = (YYCTYPE)*++YYCURSOR; if (yych <= 'W') goto yy329; - if (yych <= 'X') goto yy546; - if (yych <= 'Y') goto yy545; + if (yych <= 'X') goto yy555; + if (yych <= 'Y') goto yy554; goto yy329; -yy539: +yy548: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'R') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2647,14 +2761,14 @@ yy539: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'R') goto yy329; ++YYCURSOR; -#line 583 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYCURSOR; } -#line 2653 "src/parse/scanner_lex.cc" -yy545: +#line 592 "../src/parse/scanner_lex.re" + { opts.set_yycursor (lex_conf_string ()); return CONF; } +#line 2767 "src/parse/scanner_lex.cc" +yy554: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'P') goto yy554; + if (yych == 'P') goto yy563; goto yy329; -yy546: +yy555: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'M') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2668,17 +2782,17 @@ yy546: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'R') goto yy329; ++YYCURSOR; -#line 581 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYCTXMARKER; } -#line 2674 "src/parse/scanner_lex.cc" -yy554: +#line 590 "../src/parse/scanner_lex.re" + { opts.set_yyctxmarker (lex_conf_string ()); return CONF; } +#line 2788 "src/parse/scanner_lex.cc" +yy563: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'E') goto yy329; ++YYCURSOR; -#line 582 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYCTYPE; } -#line 2681 "src/parse/scanner_lex.cc" -yy557: +#line 591 "../src/parse/scanner_lex.re" + { opts.set_yyctype (lex_conf_string ()); return CONF; } +#line 2795 "src/parse/scanner_lex.cc" +yy566: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'D') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2690,10 +2804,10 @@ yy557: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'E') goto yy329; ++YYCURSOR; -#line 580 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYCONDTYPE; } -#line 2696 "src/parse/scanner_lex.cc" -yy564: +#line 589 "../src/parse/scanner_lex.re" + { opts.set_yycondtype (lex_conf_string ()); return CONF; } +#line 2810 "src/parse/scanner_lex.cc" +yy573: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'B') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2701,27 +2815,27 @@ yy564: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'G') goto yy329; ++YYCURSOR; -#line 584 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYDEBUG; } -#line 2707 "src/parse/scanner_lex.cc" -yy569: +#line 593 "../src/parse/scanner_lex.re" + { opts.set_yydebug (lex_conf_string ()); return CONF; } +#line 2821 "src/parse/scanner_lex.cc" +yy578: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'L') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'L') goto yy329; - yyaccept = 2; + yyaccept = 3; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy574; - if (yych == '@') goto yy573; -yy572: -#line 585 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYFILL; } -#line 2720 "src/parse/scanner_lex.cc" -yy573: + if (yych == ':') goto yy583; + if (yych == '@') goto yy582; +yy581: +#line 594 "../src/parse/scanner_lex.re" + { opts.set_fill (lex_conf_string ()); return CONF; } +#line 2834 "src/parse/scanner_lex.cc" +yy582: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'l') goto yy581; + if (yych == 'l') goto yy590; goto yy329; -yy574: +yy583: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'n') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2733,30 +2847,30 @@ yy574: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'd') goto yy329; ++YYCURSOR; -#line 586 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYFILL_NAKED; } -#line 2739 "src/parse/scanner_lex.cc" -yy581: +#line 595 "../src/parse/scanner_lex.re" + { opts.set_fill_naked (lex_conf_number () != 0); return CONF; } +#line 2853 "src/parse/scanner_lex.cc" +yy590: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'e') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'n') goto yy329; ++YYCURSOR; -#line 587 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYFILL_LEN; } -#line 2748 "src/parse/scanner_lex.cc" -yy585: +#line 596 "../src/parse/scanner_lex.re" + { opts.set_fill_arg (lex_conf_string ()); return CONF; } +#line 2862 "src/parse/scanner_lex.cc" +yy594: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'T') goto yy329; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'C') goto yy587; - if (yych == 'S') goto yy588; + if (yych == 'C') goto yy596; + if (yych == 'S') goto yy597; goto yy329; -yy587: +yy596: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'O') goto yy601; + if (yych == 'O') goto yy610; goto yy329; -yy588: +yy597: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'T') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2765,14 +2879,14 @@ yy588: if (yych != 'T') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'E') goto yy329; - yyaccept = 3; + yyaccept = 4; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy594; -yy593: -#line 590 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYGETSTATE; } -#line 2775 "src/parse/scanner_lex.cc" -yy594: + if (yych == ':') goto yy603; +yy602: +#line 599 "../src/parse/scanner_lex.re" + { opts.set_state_get (lex_conf_string ()); return CONF; } +#line 2889 "src/parse/scanner_lex.cc" +yy603: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'n') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2784,10 +2898,10 @@ yy594: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'd') goto yy329; ++YYCURSOR; -#line 591 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYGETSTATE_NAKED; } -#line 2790 "src/parse/scanner_lex.cc" -yy601: +#line 600 "../src/parse/scanner_lex.re" + { opts.set_state_get_naked (lex_conf_number () != 0); return CONF; } +#line 2904 "src/parse/scanner_lex.cc" +yy610: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'N') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2802,14 +2916,14 @@ yy601: if (yych != 'O') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'N') goto yy329; - yyaccept = 4; + yyaccept = 5; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy610; -yy609: -#line 588 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYGETCONDITION; } -#line 2812 "src/parse/scanner_lex.cc" -yy610: + if (yych == ':') goto yy619; +yy618: +#line 597 "../src/parse/scanner_lex.re" + { opts.set_cond_get (lex_conf_string ()); return CONF; } +#line 2926 "src/parse/scanner_lex.cc" +yy619: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'n') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2821,14 +2935,14 @@ yy610: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'd') goto yy329; ++YYCURSOR; -#line 589 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYGETCONDITION_NAKED; } -#line 2827 "src/parse/scanner_lex.cc" -yy617: +#line 598 "../src/parse/scanner_lex.re" + { opts.set_cond_get_naked (lex_conf_number () != 0); return CONF; } +#line 2941 "src/parse/scanner_lex.cc" +yy626: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'S') goto yy623; + if (yych == 'S') goto yy632; goto yy329; -yy618: +yy627: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'M') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2836,10 +2950,10 @@ yy618: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'T') goto yy329; ++YYCURSOR; -#line 593 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYLIMIT; } -#line 2842 "src/parse/scanner_lex.cc" -yy623: +#line 602 "../src/parse/scanner_lex.re" + { opts.set_yylimit (lex_conf_string ()); return CONF; } +#line 2956 "src/parse/scanner_lex.cc" +yy632: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'S') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2851,10 +2965,10 @@ yy623: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'N') goto yy329; ++YYCURSOR; -#line 592 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYLESSTHAN; } -#line 2857 "src/parse/scanner_lex.cc" -yy630: +#line 601 "../src/parse/scanner_lex.re" + { opts.set_yylessthan (lex_conf_string ()); return CONF; } +#line 2971 "src/parse/scanner_lex.cc" +yy639: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'R') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2864,19 +2978,19 @@ yy630: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'R') goto yy329; ++YYCURSOR; -#line 594 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYMARKER; } -#line 2870 "src/parse/scanner_lex.cc" -yy636: +#line 603 "../src/parse/scanner_lex.re" + { opts.set_yymarker (lex_conf_string ()); return CONF; } +#line 2984 "src/parse/scanner_lex.cc" +yy645: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'E') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'K') goto yy329; ++YYCURSOR; -#line 595 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYPEEK; } -#line 2879 "src/parse/scanner_lex.cc" -yy640: +#line 604 "../src/parse/scanner_lex.re" + { opts.set_yypeek (lex_conf_string ()); return CONF; } +#line 2993 "src/parse/scanner_lex.cc" +yy649: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'S') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2887,45 +3001,45 @@ yy640: if (yych != 'R') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'E') goto yy329; - yyaccept = 5; + yyaccept = 6; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == 'C') goto yy647; -yy646: -#line 596 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYRESTORE; } -#line 2897 "src/parse/scanner_lex.cc" -yy647: + if (yych == 'C') goto yy656; +yy655: +#line 605 "../src/parse/scanner_lex.re" + { opts.set_yyrestore (lex_conf_string ()); return CONF; } +#line 3011 "src/parse/scanner_lex.cc" +yy656: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'T') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'X') goto yy329; ++YYCURSOR; -#line 597 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYRESTORECTX; } -#line 2906 "src/parse/scanner_lex.cc" -yy651: +#line 606 "../src/parse/scanner_lex.re" + { opts.set_yyrestorectx (lex_conf_string ()); return CONF; } +#line 3020 "src/parse/scanner_lex.cc" +yy660: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'T') goto yy656; + if (yych == 'T') goto yy665; goto yy329; -yy652: +yy661: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'I') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'P') goto yy329; ++YYCURSOR; -#line 604 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYSKIP; } -#line 2919 "src/parse/scanner_lex.cc" -yy656: +#line 613 "../src/parse/scanner_lex.re" + { opts.set_yyskip (lex_conf_string ()); return CONF; } +#line 3033 "src/parse/scanner_lex.cc" +yy665: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'C') goto yy657; - if (yych == 'S') goto yy658; + if (yych == 'C') goto yy666; + if (yych == 'S') goto yy667; goto yy329; -yy657: +yy666: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'O') goto yy678; + if (yych == 'O') goto yy687; goto yy329; -yy658: +yy667: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'T') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2934,19 +3048,19 @@ yy658: if (yych != 'T') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'E') goto yy329; - yyaccept = 6; + yyaccept = 7; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy665; - if (yych == '@') goto yy664; -yy663: -#line 601 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYSETSTATE; } -#line 2945 "src/parse/scanner_lex.cc" -yy664: + if (yych == ':') goto yy674; + if (yych == '@') goto yy673; +yy672: +#line 610 "../src/parse/scanner_lex.re" + { opts.set_state_set (lex_conf_string ()); return CONF; } +#line 3059 "src/parse/scanner_lex.cc" +yy673: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 's') goto yy672; + if (yych == 's') goto yy681; goto yy329; -yy665: +yy674: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'n') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2958,10 +3072,10 @@ yy665: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'd') goto yy329; ++YYCURSOR; -#line 602 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYSETSTATE_NAKED; } -#line 2964 "src/parse/scanner_lex.cc" -yy672: +#line 611 "../src/parse/scanner_lex.re" + { opts.set_state_set_naked (lex_conf_number () != 0); return CONF; } +#line 3078 "src/parse/scanner_lex.cc" +yy681: yych = (YYCTYPE)*++YYCURSOR; if (yych != 't') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2971,10 +3085,10 @@ yy672: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'e') goto yy329; ++YYCURSOR; -#line 603 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYSETSTATE_STATE; } -#line 2977 "src/parse/scanner_lex.cc" -yy678: +#line 612 "../src/parse/scanner_lex.re" + { opts.set_state_set_arg (lex_conf_string ()); return CONF; } +#line 3091 "src/parse/scanner_lex.cc" +yy687: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'N') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -2989,19 +3103,19 @@ yy678: if (yych != 'O') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'N') goto yy329; - yyaccept = 7; + yyaccept = 8; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy687; - if (yych == '@') goto yy688; -yy686: -#line 598 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYSETCONDITION; } -#line 3000 "src/parse/scanner_lex.cc" -yy687: - yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy694; + if (yych == ':') goto yy696; + if (yych == '@') goto yy697; +yy695: +#line 607 "../src/parse/scanner_lex.re" + { opts.set_cond_set (lex_conf_string ()); return CONF; } +#line 3114 "src/parse/scanner_lex.cc" +yy696: + yych = (YYCTYPE)*++YYCURSOR; + if (yych == 'n') goto yy703; goto yy329; -yy688: +yy697: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -3011,10 +3125,10 @@ yy688: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'd') goto yy329; ++YYCURSOR; -#line 599 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYSETCONDITION_COND; } -#line 3017 "src/parse/scanner_lex.cc" -yy694: +#line 608 "../src/parse/scanner_lex.re" + { opts.set_cond_set_arg (lex_conf_string ()); return CONF; } +#line 3131 "src/parse/scanner_lex.cc" +yy703: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'a') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -3024,41 +3138,41 @@ yy694: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'd') goto yy329; ++YYCURSOR; -#line 600 "../src/parse/scanner_lex.re" - { return CONF_DEFINE_YYSETCONDITION_NAKED; } -#line 3030 "src/parse/scanner_lex.cc" -yy700: +#line 609 "../src/parse/scanner_lex.re" + { opts.set_cond_set_naked (lex_conf_number () != 0); return CONF; } +#line 3144 "src/parse/scanner_lex.cc" +yy709: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy748; + if (yych == 'o') goto yy757; goto yy329; -yy701: +yy710: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'n') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'd') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych <= 'd') { - if (yych == ':') goto yy706; + if (yych == ':') goto yy715; goto yy329; } else { - if (yych <= 'e') goto yy705; + if (yych <= 'e') goto yy714; if (yych != 'p') goto yy329; } yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'r') goto yy742; + if (yych == 'r') goto yy751; goto yy329; -yy705: +yy714: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'n') goto yy732; + if (yych == 'n') goto yy741; goto yy329; -yy706: +yy715: yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'd') goto yy708; + if (yych == 'd') goto yy717; if (yych != 'g') goto yy329; yych = (YYCTYPE)*++YYCURSOR; - if (yych == 'o') goto yy722; + if (yych == 'o') goto yy731; goto yy329; -yy708: +yy717: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'i') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -3071,14 +3185,14 @@ yy708: if (yych != 'e') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'r') goto yy329; - yyaccept = 8; + yyaccept = 9; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == '@') goto yy716; -yy715: + if (yych == '@') goto yy725; +yy724: #line 573 "../src/parse/scanner_lex.re" - { return CONF_COND_DIVIDER; } -#line 3081 "src/parse/scanner_lex.cc" -yy716: + { opts.set_condDivider (lex_conf_string ()); return CONF; } +#line 3195 "src/parse/scanner_lex.cc" +yy725: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -3089,21 +3203,21 @@ yy716: if (yych != 'd') goto yy329; ++YYCURSOR; #line 574 "../src/parse/scanner_lex.re" - { return CONF_COND_DIVIDER_COND; } -#line 3094 "src/parse/scanner_lex.cc" -yy722: + { opts.set_condDividerParam (lex_conf_string ()); return CONF; } +#line 3208 "src/parse/scanner_lex.cc" +yy731: yych = (YYCTYPE)*++YYCURSOR; if (yych != 't') goto yy329; yych = (YYCTYPE)*++YYCURSOR; if (yych != 'o') goto yy329; - yyaccept = 9; + yyaccept = 10; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == '@') goto yy726; -yy725: + if (yych == '@') goto yy735; +yy734: #line 575 "../src/parse/scanner_lex.re" - { return CONF_COND_GOTO; } -#line 3106 "src/parse/scanner_lex.cc" -yy726: + { opts.set_condGoto (lex_conf_string ()); return CONF; } +#line 3220 "src/parse/scanner_lex.cc" +yy735: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'c') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -3114,9 +3228,9 @@ yy726: if (yych != 'd') goto yy329; ++YYCURSOR; #line 576 "../src/parse/scanner_lex.re" - { return CONF_COND_GOTO_COND; } -#line 3119 "src/parse/scanner_lex.cc" -yy732: + { opts.set_condGotoParam (lex_conf_string ()); return CONF; } +#line 3233 "src/parse/scanner_lex.cc" +yy741: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'u') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -3135,9 +3249,9 @@ yy732: if (yych != 'x') goto yy329; ++YYCURSOR; #line 572 "../src/parse/scanner_lex.re" - { return CONF_CONDENUMPREFIX; } -#line 3140 "src/parse/scanner_lex.cc" -yy742: + { opts.set_condEnumPrefix (lex_conf_string ()); return CONF; } +#line 3254 "src/parse/scanner_lex.cc" +yy751: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'e') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -3148,9 +3262,9 @@ yy742: if (yych != 'x') goto yy329; ++YYCURSOR; #line 571 "../src/parse/scanner_lex.re" - { return CONF_CONDPREFIX; } -#line 3153 "src/parse/scanner_lex.cc" -yy748: + { opts.set_condPrefix (lex_conf_string ()); return CONF; } +#line 3267 "src/parse/scanner_lex.cc" +yy757: yych = (YYCTYPE)*++YYCURSOR; if (yych != 't') goto yy329; yych = (YYCTYPE)*++YYCURSOR; @@ -3176,16 +3290,27 @@ yy748: yych = (YYCTYPE)*++YYCURSOR; if (yych != 'd') goto yy329; ++YYCURSOR; -#line 577 "../src/parse/scanner_lex.re" - { return CONF_CGOTO_THRESHOLD; } -#line 3182 "src/parse/scanner_lex.cc" +#line 578 "../src/parse/scanner_lex.re" + { + const int32_t n = lex_conf_number (); + if (n < 0) + { + fatal ("configuration 'cgoto:threshold' must be nonnegative"); + } + opts.set_cGotoThreshold (static_cast (n)); + return CONF; + } +#line 3304 "src/parse/scanner_lex.cc" } -#line 637 "../src/parse/scanner_lex.re" +#line 670 "../src/parse/scanner_lex.re" +} -conf_eq: +int32_t Scanner::lex_conf_number () +{ + int32_t num = 0; -#line 3189 "src/parse/scanner_lex.cc" +#line 3314 "src/parse/scanner_lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -3225,186 +3350,502 @@ conf_eq: if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy766; + if (yych == '\t') goto yy775; } else { - if (yych <= ' ') goto yy766; - if (yych == '=') goto yy767; + if (yych <= ' ') goto yy775; + if (yych == '=') goto yy776; } ++YYCURSOR; -yy765: -#line 641 "../src/parse/scanner_lex.re" +yy774: +#line 677 "../src/parse/scanner_lex.re" { fatal ("missing '=' in configuration"); } -#line 3238 "src/parse/scanner_lex.cc" -yy766: +#line 3363 "src/parse/scanner_lex.cc" +yy775: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= 0x1F) { - if (yych == '\t') goto yy771; - goto yy765; + if (yych == '\t') goto yy780; + goto yy774; } else { - if (yych <= ' ') goto yy771; - if (yych == '=') goto yy769; - goto yy765; + if (yych <= ' ') goto yy780; + if (yych == '=') goto yy778; + goto yy774; } -yy767: +yy776: ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; - goto yy770; -yy768: -#line 642 "../src/parse/scanner_lex.re" + goto yy779; +yy777: +#line 678 "../src/parse/scanner_lex.re" { goto conf_val; } -#line 3256 "src/parse/scanner_lex.cc" -yy769: +#line 3381 "src/parse/scanner_lex.cc" +yy778: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy770: +yy779: if (yybm[0+yych] & 128) { - goto yy769; + goto yy778; } - goto yy768; -yy771: + goto yy777; +yy780: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych == '\t') goto yy771; + if (yych == '\t') goto yy780; } else { - if (yych <= ' ') goto yy771; - if (yych == '=') goto yy769; + if (yych <= ' ') goto yy780; + if (yych == '=') goto yy778; } YYCURSOR = YYMARKER; - goto yy765; + goto yy774; } -#line 643 "../src/parse/scanner_lex.re" - +#line 679 "../src/parse/scanner_lex.re" conf_val: tok = cur; - lexer_state = LEX_NORMAL; -#line 3286 "src/parse/scanner_lex.cc" +#line 3409 "src/parse/scanner_lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 0, 0, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 192, 192, 192, 192, 192, 192, 192, 192, - 192, 192, 128, 0, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - }; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = (YYCTYPE)*YYCURSOR; - if (yych <= '\'') { - if (yych <= ' ') { - if (yych <= 0x08) goto yy784; - if (yych <= '\n') goto yy776; - if (yych <= 0x1F) goto yy784; - } else { - if (yych == '"') goto yy782; - if (yych <= '&') goto yy784; - goto yy782; - } - } else { - if (yych <= '0') { - if (yych == '-') goto yy779; - if (yych <= '/') goto yy784; - goto yy777; - } else { - if (yych <= '9') goto yy780; - if (yych != ';') goto yy784; - } - } -yy776: -#line 665 "../src/parse/scanner_lex.re" - { - yylval.str = new std::string (tok, tok_len ()); - return STRING; + 128, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= '/') { + if (yych == '-') goto yy788; + } else { + if (yych <= '0') goto yy786; + if (yych <= '9') goto yy789; } -#line 3351 "src/parse/scanner_lex.cc" -yy777: +yy785: +yy786: ++YYCURSOR; - if (yybm[0+(yych = (YYCTYPE)*YYCURSOR)] & 128) { - goto yy784; - } -yy778: -#line 650 "../src/parse/scanner_lex.re" +yy787: +#line 684 "../src/parse/scanner_lex.re" { - if (!s_to_i32_unsafe (tok, cur, yylval.num)) + if (!s_to_i32_unsafe (tok, cur, num)) { fatal ("configuration value overflow"); } - return NUM; + goto conf_semicolon; } -#line 3366 "src/parse/scanner_lex.cc" -yy779: +#line 3466 "src/parse/scanner_lex.cc" +yy788: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '0') goto yy785; if (yych >= ':') goto yy785; -yy780: +yy789: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yybm[0+yych] & 64) { - goto yy780; + if (yybm[0+yych] & 128) { + goto yy789; } + goto yy787; +} +#line 691 "../src/parse/scanner_lex.re" + +conf_semicolon: + +#line 3484 "src/parse/scanner_lex.cc" +{ + YYCTYPE yych; + static const unsigned char yybm[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = (YYCTYPE)*YYCURSOR; if (yych <= 0x1F) { - if (yych <= 0x08) goto yy784; - if (yych <= '\n') goto yy778; - goto yy784; + if (yych == '\t') goto yy795; } else { - if (yych <= ' ') goto yy778; - if (yych == ';') goto yy778; - goto yy784; + if (yych <= ' ') goto yy795; + if (yych == ';') goto yy796; } -yy782: ++YYCURSOR; -#line 658 "../src/parse/scanner_lex.re" +yy794: +#line 694 "../src/parse/scanner_lex.re" + { fatal ("missing ending ';' in configuration"); } +#line 3533 "src/parse/scanner_lex.cc" +yy795: + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yybm[0+yych] & 128) { + goto yy799; + } + if (yych == ';') goto yy798; + goto yy794; +yy796: + ++YYCURSOR; +yy797: +#line 695 "../src/parse/scanner_lex.re" + { goto end; } +#line 3546 "src/parse/scanner_lex.cc" +yy798: + yych = (YYCTYPE)*++YYCURSOR; + goto yy797; +yy799: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy799; + } + if (yych == ';') goto yy798; + YYCURSOR = YYMARKER; + goto yy794; +} +#line 696 "../src/parse/scanner_lex.re" + +end: + return num; +} + +std::string Scanner::lex_conf_string () +{ + +#line 3570 "src/parse/scanner_lex.cc" +{ + YYCTYPE yych; + static const unsigned char yybm[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= 0x1F) { + if (yych == '\t') goto yy806; + } else { + if (yych <= ' ') goto yy806; + if (yych == '=') goto yy807; + } + ++YYCURSOR; +yy805: +#line 704 "../src/parse/scanner_lex.re" + { fatal ("missing '=' in configuration"); } +#line 3619 "src/parse/scanner_lex.cc" +yy806: + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yych <= 0x1F) { + if (yych == '\t') goto yy811; + goto yy805; + } else { + if (yych <= ' ') goto yy811; + if (yych == '=') goto yy809; + goto yy805; + } +yy807: + ++YYCURSOR; + yych = (YYCTYPE)*YYCURSOR; + goto yy810; +yy808: +#line 705 "../src/parse/scanner_lex.re" + { goto conf_val; } +#line 3637 "src/parse/scanner_lex.cc" +yy809: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; +yy810: + if (yybm[0+yych] & 128) { + goto yy809; + } + goto yy808; +yy811: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= 0x1F) { + if (yych == '\t') goto yy811; + } else { + if (yych <= ' ') goto yy811; + if (yych == '=') goto yy809; + } + YYCURSOR = YYMARKER; + goto yy805; +} +#line 706 "../src/parse/scanner_lex.re" + +conf_val: + std::string s; + tok = cur; + +#line 3666 "src/parse/scanner_lex.cc" +{ + YYCTYPE yych; + static const unsigned char yybm[] = { + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 0, 0, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 0, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 0, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + }; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= '!') { + if (yych <= '\n') { + if (yych <= 0x08) goto yy819; + } else { + if (yych != ' ') goto yy819; + } + } else { + if (yych <= '\'') { + if (yych <= '"') goto yy817; + if (yych <= '&') goto yy819; + goto yy817; + } else { + if (yych != ';') goto yy819; + } + } +yy816: +#line 719 "../src/parse/scanner_lex.re" + { + s = std::string (tok, tok_len ()); + goto conf_semicolon; + } +#line 3726 "src/parse/scanner_lex.cc" +yy817: + ++YYCURSOR; +#line 712 "../src/parse/scanner_lex.re" { std::vector cpoints; lex_cpoints (tok[0], cpoints); - yylval.str = cpoint_conf (cpoints); - return STRING; + s = cpoint_conf (cpoints); + goto conf_semicolon; } -#line 3396 "src/parse/scanner_lex.cc" -yy784: +#line 3736 "src/parse/scanner_lex.cc" +yy819: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy785: if (yybm[0+yych] & 128) { - goto yy784; + goto yy819; } - goto yy776; + goto yy816; } -#line 669 "../src/parse/scanner_lex.re" +#line 723 "../src/parse/scanner_lex.re" + +conf_semicolon: + +#line 3750 "src/parse/scanner_lex.cc" +{ + YYCTYPE yych; + static const unsigned char yybm[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + }; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = (YYCTYPE)*YYCURSOR; + if (yych <= 0x1F) { + if (yych == '\t') goto yy825; + } else { + if (yych <= ' ') goto yy825; + if (yych == ';') goto yy826; + } + ++YYCURSOR; +yy824: +#line 726 "../src/parse/scanner_lex.re" + { fatal ("missing ending ';' in configuration"); } +#line 3799 "src/parse/scanner_lex.cc" +yy825: + yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); + if (yybm[0+yych] & 128) { + goto yy829; + } + if (yych == ';') goto yy828; + goto yy824; +yy826: + ++YYCURSOR; +yy827: +#line 727 "../src/parse/scanner_lex.re" + { goto end; } +#line 3812 "src/parse/scanner_lex.cc" +yy828: + yych = (YYCTYPE)*++YYCURSOR; + goto yy827; +yy829: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = (YYCTYPE)*YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy829; + } + if (yych == ';') goto yy828; + YYCURSOR = YYMARKER; + goto yy824; +} +#line 728 "../src/parse/scanner_lex.re" +end: + return s; +} + +std::string Scanner::cpoint_conf (const std::vector & cs) const +{ + const size_t n = cs.size (); + std::string s; + for (size_t i = 0; i < n; ++i) + { + const uint32_t c = cs[i]; + if (c > 0xFF) + { + fatalf ("multibyte character in configuration string: 0x%X", c); + } + else + { + s += static_cast (c); + } + } + return s; } static void escape (std::string & dest, const std::string & src) @@ -3427,16 +3868,16 @@ void Scanner::lex_cpoints (char quote, std::vector & cs) { tok = cur; -#line 3431 "src/parse/scanner_lex.cc" +#line 3872 "src/parse/scanner_lex.cc" { YYCTYPE yych; unsigned int yyaccept = 0; if ((YYLIMIT - YYCURSOR) < 10) YYFILL(10); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy790; - if (yych == '\\') goto yy792; + if (yych == '\n') goto yy836; + if (yych == '\\') goto yy838; ++YYCURSOR; -#line 711 "../src/parse/scanner_lex.re" +#line 791 "../src/parse/scanner_lex.re" { const char c = tok[0]; if (c == quote) @@ -3449,62 +3890,62 @@ void Scanner::lex_cpoints (char quote, std::vector & cs) continue; } } -#line 3453 "src/parse/scanner_lex.cc" -yy790: +#line 3894 "src/parse/scanner_lex.cc" +yy836: ++YYCURSOR; -#line 692 "../src/parse/scanner_lex.re" +#line 772 "../src/parse/scanner_lex.re" { fatal ((tok - pos) - tchar, "syntax error"); } -#line 3458 "src/parse/scanner_lex.cc" -yy792: +#line 3899 "src/parse/scanner_lex.cc" +yy838: ++YYCURSOR; if ((yych = (YYCTYPE)*YYCURSOR) <= 'b') { if (yych <= 'T') { if (yych <= '/') { - if (yych != '\n') goto yy794; + if (yych != '\n') goto yy840; } else { - if (yych <= '3') goto yy796; - if (yych <= '7') goto yy798; - goto yy794; + if (yych <= '3') goto yy842; + if (yych <= '7') goto yy844; + goto yy840; } } else { if (yych <= 'X') { - if (yych <= 'U') goto yy799; - if (yych <= 'W') goto yy794; - goto yy801; + if (yych <= 'U') goto yy845; + if (yych <= 'W') goto yy840; + goto yy847; } else { - if (yych == '\\') goto yy802; - if (yych <= '`') goto yy794; - goto yy802; + if (yych == '\\') goto yy848; + if (yych <= '`') goto yy840; + goto yy848; } } } else { if (yych <= 'r') { if (yych <= 'm') { - if (yych == 'f') goto yy802; - goto yy794; + if (yych == 'f') goto yy848; + goto yy840; } else { - if (yych <= 'n') goto yy802; - if (yych <= 'q') goto yy794; - goto yy802; + if (yych <= 'n') goto yy848; + if (yych <= 'q') goto yy840; + goto yy848; } } else { if (yych <= 'u') { - if (yych <= 's') goto yy794; - if (yych <= 't') goto yy802; - goto yy801; + if (yych <= 's') goto yy840; + if (yych <= 't') goto yy848; + goto yy847; } else { - if (yych <= 'v') goto yy802; - if (yych == 'x') goto yy804; - goto yy794; + if (yych <= 'v') goto yy848; + if (yych == 'x') goto yy850; + goto yy840; } } } -#line 695 "../src/parse/scanner_lex.re" +#line 775 "../src/parse/scanner_lex.re" { fatal ((tok - pos) - tchar, "syntax error in escape sequence"); } -#line 3505 "src/parse/scanner_lex.cc" -yy794: +#line 3946 "src/parse/scanner_lex.cc" +yy840: ++YYCURSOR; -#line 701 "../src/parse/scanner_lex.re" +#line 781 "../src/parse/scanner_lex.re" { const char c = tok[1]; if (c != quote) @@ -3514,199 +3955,199 @@ yy794: cs.push_back (static_cast (c)); continue; } -#line 3518 "src/parse/scanner_lex.cc" -yy796: +#line 3959 "src/parse/scanner_lex.cc" +yy842: yyaccept = 0; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych <= '/') goto yy797; - if (yych <= '7') goto yy819; -yy797: -#line 694 "../src/parse/scanner_lex.re" + if (yych <= '/') goto yy843; + if (yych <= '7') goto yy865; +yy843: +#line 774 "../src/parse/scanner_lex.re" { fatal ((tok - pos) - tchar, "syntax error in octal escape sequence"); } -#line 3527 "src/parse/scanner_lex.cc" -yy798: +#line 3968 "src/parse/scanner_lex.cc" +yy844: yych = (YYCTYPE)*++YYCURSOR; - goto yy797; -yy799: + goto yy843; +yy845: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy800; - if (yych <= '9') goto yy812; + if (yych <= '/') goto yy846; + if (yych <= '9') goto yy858; } else { - if (yych <= 'F') goto yy812; - if (yych <= '`') goto yy800; - if (yych <= 'f') goto yy812; + if (yych <= 'F') goto yy858; + if (yych <= '`') goto yy846; + if (yych <= 'f') goto yy858; } -yy800: -#line 693 "../src/parse/scanner_lex.re" +yy846: +#line 773 "../src/parse/scanner_lex.re" { fatal ((tok - pos) - tchar, "syntax error in hexadecimal escape sequence"); } -#line 3545 "src/parse/scanner_lex.cc" -yy801: +#line 3986 "src/parse/scanner_lex.cc" +yy847: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy800; - if (yych <= '9') goto yy809; - goto yy800; + if (yych <= '/') goto yy846; + if (yych <= '9') goto yy855; + goto yy846; } else { - if (yych <= 'F') goto yy809; - if (yych <= '`') goto yy800; - if (yych <= 'f') goto yy809; - goto yy800; + if (yych <= 'F') goto yy855; + if (yych <= '`') goto yy846; + if (yych <= 'f') goto yy855; + goto yy846; } -yy802: +yy848: ++YYCURSOR; -#line 699 "../src/parse/scanner_lex.re" +#line 779 "../src/parse/scanner_lex.re" { cs.push_back (unesc_simple (tok)); continue; } -#line 3563 "src/parse/scanner_lex.cc" -yy804: +#line 4004 "src/parse/scanner_lex.cc" +yy850: yyaccept = 1; yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); if (yych <= '@') { - if (yych <= '/') goto yy800; - if (yych >= ':') goto yy800; + if (yych <= '/') goto yy846; + if (yych >= ':') goto yy846; } else { - if (yych <= 'F') goto yy805; - if (yych <= '`') goto yy800; - if (yych >= 'g') goto yy800; + if (yych <= 'F') goto yy851; + if (yych <= '`') goto yy846; + if (yych >= 'g') goto yy846; } -yy805: +yy851: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy806; - if (yych <= '9') goto yy807; + if (yych <= '/') goto yy852; + if (yych <= '9') goto yy853; } else { - if (yych <= 'F') goto yy807; - if (yych <= '`') goto yy806; - if (yych <= 'f') goto yy807; + if (yych <= 'F') goto yy853; + if (yych <= '`') goto yy852; + if (yych <= 'f') goto yy853; } -yy806: +yy852: YYCURSOR = YYMARKER; if (yyaccept == 0) { - goto yy797; + goto yy843; } else { - goto yy800; + goto yy846; } -yy807: +yy853: ++YYCURSOR; -#line 697 "../src/parse/scanner_lex.re" +#line 777 "../src/parse/scanner_lex.re" { cs.push_back (unesc_hex (tok, cur)); continue; } -#line 3596 "src/parse/scanner_lex.cc" -yy809: +#line 4037 "src/parse/scanner_lex.cc" +yy855: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy806; - if (yych >= ':') goto yy806; + if (yych <= '/') goto yy852; + if (yych >= ':') goto yy852; } else { - if (yych <= 'F') goto yy810; - if (yych <= '`') goto yy806; - if (yych >= 'g') goto yy806; + if (yych <= 'F') goto yy856; + if (yych <= '`') goto yy852; + if (yych >= 'g') goto yy852; } -yy810: +yy856: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy806; - if (yych >= ':') goto yy806; + if (yych <= '/') goto yy852; + if (yych >= ':') goto yy852; } else { - if (yych <= 'F') goto yy811; - if (yych <= '`') goto yy806; - if (yych >= 'g') goto yy806; + if (yych <= 'F') goto yy857; + if (yych <= '`') goto yy852; + if (yych >= 'g') goto yy852; } -yy811: +yy857: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy806; - if (yych <= '9') goto yy807; - goto yy806; + if (yych <= '/') goto yy852; + if (yych <= '9') goto yy853; + goto yy852; } else { - if (yych <= 'F') goto yy807; - if (yych <= '`') goto yy806; - if (yych <= 'f') goto yy807; - goto yy806; + if (yych <= 'F') goto yy853; + if (yych <= '`') goto yy852; + if (yych <= 'f') goto yy853; + goto yy852; } -yy812: +yy858: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy806; - if (yych >= ':') goto yy806; + if (yych <= '/') goto yy852; + if (yych >= ':') goto yy852; } else { - if (yych <= 'F') goto yy813; - if (yych <= '`') goto yy806; - if (yych >= 'g') goto yy806; + if (yych <= 'F') goto yy859; + if (yych <= '`') goto yy852; + if (yych >= 'g') goto yy852; } -yy813: +yy859: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy806; - if (yych >= ':') goto yy806; + if (yych <= '/') goto yy852; + if (yych >= ':') goto yy852; } else { - if (yych <= 'F') goto yy814; - if (yych <= '`') goto yy806; - if (yych >= 'g') goto yy806; + if (yych <= 'F') goto yy860; + if (yych <= '`') goto yy852; + if (yych >= 'g') goto yy852; } -yy814: +yy860: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy806; - if (yych >= ':') goto yy806; + if (yych <= '/') goto yy852; + if (yych >= ':') goto yy852; } else { - if (yych <= 'F') goto yy815; - if (yych <= '`') goto yy806; - if (yych >= 'g') goto yy806; + if (yych <= 'F') goto yy861; + if (yych <= '`') goto yy852; + if (yych >= 'g') goto yy852; } -yy815: +yy861: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy806; - if (yych >= ':') goto yy806; + if (yych <= '/') goto yy852; + if (yych >= ':') goto yy852; } else { - if (yych <= 'F') goto yy816; - if (yych <= '`') goto yy806; - if (yych >= 'g') goto yy806; + if (yych <= 'F') goto yy862; + if (yych <= '`') goto yy852; + if (yych >= 'g') goto yy852; } -yy816: +yy862: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy806; - if (yych >= ':') goto yy806; + if (yych <= '/') goto yy852; + if (yych >= ':') goto yy852; } else { - if (yych <= 'F') goto yy817; - if (yych <= '`') goto yy806; - if (yych >= 'g') goto yy806; + if (yych <= 'F') goto yy863; + if (yych <= '`') goto yy852; + if (yych >= 'g') goto yy852; } -yy817: +yy863: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy806; - if (yych >= ':') goto yy806; + if (yych <= '/') goto yy852; + if (yych >= ':') goto yy852; } else { - if (yych <= 'F') goto yy818; - if (yych <= '`') goto yy806; - if (yych >= 'g') goto yy806; + if (yych <= 'F') goto yy864; + if (yych <= '`') goto yy852; + if (yych >= 'g') goto yy852; } -yy818: +yy864: yych = (YYCTYPE)*++YYCURSOR; if (yych <= '@') { - if (yych <= '/') goto yy806; - if (yych <= '9') goto yy807; - goto yy806; + if (yych <= '/') goto yy852; + if (yych <= '9') goto yy853; + goto yy852; } else { - if (yych <= 'F') goto yy807; - if (yych <= '`') goto yy806; - if (yych <= 'f') goto yy807; - goto yy806; + if (yych <= 'F') goto yy853; + if (yych <= '`') goto yy852; + if (yych <= 'f') goto yy853; + goto yy852; } -yy819: +yy865: yych = (YYCTYPE)*++YYCURSOR; - if (yych <= '/') goto yy806; - if (yych >= '8') goto yy806; + if (yych <= '/') goto yy852; + if (yych >= '8') goto yy852; ++YYCURSOR; -#line 698 "../src/parse/scanner_lex.re" +#line 778 "../src/parse/scanner_lex.re" { cs.push_back (unesc_oct (tok, cur)); continue; } -#line 3708 "src/parse/scanner_lex.cc" +#line 4149 "src/parse/scanner_lex.cc" } -#line 723 "../src/parse/scanner_lex.re" +#line 803 "../src/parse/scanner_lex.re" } } @@ -3716,7 +4157,7 @@ void Scanner::set_sourceline () sourceline: tok = cur; -#line 3720 "src/parse/scanner_lex.cc" +#line 4161 "src/parse/scanner_lex.cc" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -3756,23 +4197,23 @@ sourceline: if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = (YYCTYPE)*YYCURSOR; if (yych <= '!') { - if (yych == '\n') goto yy826; + if (yych == '\n') goto yy872; } else { - if (yych <= '"') goto yy828; - if (yych <= '0') goto yy824; - if (yych <= '9') goto yy829; + if (yych <= '"') goto yy874; + if (yych <= '0') goto yy870; + if (yych <= '9') goto yy875; } -yy824: +yy870: ++YYCURSOR; -yy825: -#line 755 "../src/parse/scanner_lex.re" +yy871: +#line 835 "../src/parse/scanner_lex.re" { goto sourceline; } -#line 3773 "src/parse/scanner_lex.cc" -yy826: +#line 4214 "src/parse/scanner_lex.cc" +yy872: ++YYCURSOR; -#line 743 "../src/parse/scanner_lex.re" +#line 823 "../src/parse/scanner_lex.re" { if (cur == eof) { @@ -3785,17 +4226,17 @@ yy826: tok = cur; return; } -#line 3789 "src/parse/scanner_lex.cc" -yy828: +#line 4230 "src/parse/scanner_lex.cc" +yy874: yych = (YYCTYPE)*(YYMARKER = ++YYCURSOR); - if (yych == '\n') goto yy825; - goto yy834; -yy829: + if (yych == '\n') goto yy871; + goto yy880; +yy875: ++YYCURSOR; yych = (YYCTYPE)*YYCURSOR; - goto yy832; -yy830: -#line 732 "../src/parse/scanner_lex.re" + goto yy878; +yy876: +#line 812 "../src/parse/scanner_lex.re" { if (!s_to_u32_unsafe (tok, cur, cline)) { @@ -3803,46 +4244,46 @@ yy830: } goto sourceline; } -#line 3807 "src/parse/scanner_lex.cc" -yy831: +#line 4248 "src/parse/scanner_lex.cc" +yy877: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy832: +yy878: if (yybm[0+yych] & 64) { - goto yy831; + goto yy877; } - goto yy830; -yy833: + goto yy876; +yy879: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; -yy834: +yy880: if (yybm[0+yych] & 128) { - goto yy833; + goto yy879; } - if (yych <= '\n') goto yy835; - if (yych <= '"') goto yy837; - goto yy836; -yy835: + if (yych <= '\n') goto yy881; + if (yych <= '"') goto yy883; + goto yy882; +yy881: YYCURSOR = YYMARKER; - goto yy825; -yy836: + goto yy871; +yy882: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = (YYCTYPE)*YYCURSOR; - if (yych == '\n') goto yy835; - goto yy833; -yy837: + if (yych == '\n') goto yy881; + goto yy879; +yy883: ++YYCURSOR; -#line 739 "../src/parse/scanner_lex.re" +#line 819 "../src/parse/scanner_lex.re" { escape (in.file_name, std::string (tok + 1, tok_len () - 2)); // -2 to omit quotes goto sourceline; } -#line 3844 "src/parse/scanner_lex.cc" +#line 4285 "src/parse/scanner_lex.cc" } -#line 758 "../src/parse/scanner_lex.re" +#line 838 "../src/parse/scanner_lex.re" } diff --git a/re2c/bootstrap/src/parse/y.tab.h b/re2c/bootstrap/src/parse/y.tab.h index 1ad5df59..afb75933 100644 --- a/re2c/bootstrap/src/parse/y.tab.h +++ b/re2c/bootstrap/src/parse/y.tab.h @@ -41,70 +41,14 @@ CLOSE = 258, CLOSESIZE = 259, CODE = 260, - CONF_CONDPREFIX = 261, - CONF_CONDENUMPREFIX = 262, - CONF_COND_DIVIDER = 263, - CONF_COND_DIVIDER_COND = 264, - CONF_COND_GOTO = 265, - CONF_COND_GOTO_COND = 266, - CONF_CGOTO_THRESHOLD = 267, - CONF_DEFINE_YYBACKUP = 268, - CONF_DEFINE_YYBACKUPCTX = 269, - CONF_DEFINE_YYCONDTYPE = 270, - CONF_DEFINE_YYCTXMARKER = 271, - CONF_DEFINE_YYCTYPE = 272, - CONF_DEFINE_YYCURSOR = 273, - CONF_DEFINE_YYDEBUG = 274, - CONF_DEFINE_YYFILL = 275, - CONF_DEFINE_YYFILL_NAKED = 276, - CONF_DEFINE_YYFILL_LEN = 277, - CONF_DEFINE_YYGETCONDITION = 278, - CONF_DEFINE_YYGETCONDITION_NAKED = 279, - CONF_DEFINE_YYGETSTATE = 280, - CONF_DEFINE_YYGETSTATE_NAKED = 281, - CONF_DEFINE_YYLESSTHAN = 282, - CONF_DEFINE_YYLIMIT = 283, - CONF_DEFINE_YYMARKER = 284, - CONF_DEFINE_YYPEEK = 285, - CONF_DEFINE_YYRESTORE = 286, - CONF_DEFINE_YYRESTORECTX = 287, - CONF_DEFINE_YYSETCONDITION = 288, - CONF_DEFINE_YYSETCONDITION_COND = 289, - CONF_DEFINE_YYSETCONDITION_NAKED = 290, - CONF_DEFINE_YYSETSTATE = 291, - CONF_DEFINE_YYSETSTATE_NAKED = 292, - CONF_DEFINE_YYSETSTATE_STATE = 293, - CONF_DEFINE_YYSKIP = 294, - CONF_FLAGS = 295, - CONF_INDENT_STRING = 296, - CONF_INDENT_TOP = 297, - CONF_LABEL_YYFILLLABEL = 298, - CONF_LABEL_YYNEXT = 299, - CONF_LABELPREFIX = 300, - CONF_STARTLABEL = 301, - CONF_STATE_ABORT = 302, - CONF_STATE_NEXTLABEL = 303, - CONF_VARIABLE_YYACCEPT = 304, - CONF_VARIABLE_YYBM = 305, - CONF_VARIABLE_YYCH = 306, - CONF_VARIABLE_YYCTABLE = 307, - CONF_VARIABLE_YYSTABLE = 308, - CONF_VARIABLE_YYTARGET = 309, - CONF_YYBM_HEX = 310, - CONF_YYCH_CONVERSION = 311, - CONF_YYCH_EMIT = 312, - CONF_YYFILL_CHECK = 313, - CONF_YYFILL_ENABLE = 314, - CONF_YYFILL_PARAMETER = 315, - ID = 316, - FID = 317, - FID_END = 318, - NOCOND = 319, - NUM = 320, - REGEXP = 321, - SETUP = 322, - STAR = 323, - STRING = 324 + CONF = 261, + ID = 262, + FID = 263, + FID_END = 264, + NOCOND = 265, + REGEXP = 266, + SETUP = 267, + STAR = 268 }; #endif @@ -118,11 +62,9 @@ typedef union YYSTYPE re2c::RegExp * regexp; const re2c::Code * code; char op; - int32_t num; re2c::ExtOp extop; std::string * str; re2c::CondList * clist; - re2c::Enc::type_t enc; diff --git a/re2c/src/ir/regexp/regexp.cc b/re2c/src/ir/regexp/regexp.cc index fd18e706..6197f0cb 100644 --- a/re2c/src/ir/regexp/regexp.cc +++ b/re2c/src/ir/regexp/regexp.cc @@ -199,25 +199,6 @@ RegExp * Scanner::cpoint_class (const std::vector & cs, bool neg) cons return matchSymbolRange (r); } -std::string * Scanner::cpoint_conf (const std::vector & cs) const -{ - const size_t n = cs.size (); - std::string * s = new std::string; - for (size_t i = 0; i < n; ++i) - { - const uint32_t c = cs[i]; - if (c > 0xFF) - { - fatalf ("multibyte character in configuration string: 0x%X", c); - } - else - { - *s += static_cast (c); - } - } - return s; -} - RegExp * Scanner::mkDiff (RegExp * e1, RegExp * e2) const { MatchOp * m1 = dynamic_cast (e1); diff --git a/re2c/src/parse/parser.ypp b/re2c/src/parse/parser.ypp index 325d325e..1c476953 100644 --- a/re2c/src/parse/parser.ypp +++ b/re2c/src/parse/parser.ypp @@ -152,89 +152,29 @@ void default_rule(CondList *clist, const Code * code) re2c::RegExp * regexp; const re2c::Code * code; char op; - int32_t num; re2c::ExtOp extop; std::string * str; re2c::CondList * clist; - re2c::Enc::type_t enc; }; %token CLOSE %token CLOSESIZE %token CODE -%token CONF_CONDPREFIX -%token CONF_CONDENUMPREFIX -%token CONF_COND_DIVIDER -%token CONF_COND_DIVIDER_COND -%token CONF_COND_GOTO -%token CONF_COND_GOTO_COND -%token CONF_CGOTO_THRESHOLD -%token CONF_DEFINE_YYBACKUP -%token CONF_DEFINE_YYBACKUPCTX -%token CONF_DEFINE_YYCONDTYPE -%token CONF_DEFINE_YYCTXMARKER -%token CONF_DEFINE_YYCTYPE -%token CONF_DEFINE_YYCURSOR -%token CONF_DEFINE_YYDEBUG -%token CONF_DEFINE_YYFILL -%token CONF_DEFINE_YYFILL_NAKED -%token CONF_DEFINE_YYFILL_LEN -%token CONF_DEFINE_YYGETCONDITION -%token CONF_DEFINE_YYGETCONDITION_NAKED -%token CONF_DEFINE_YYGETSTATE -%token CONF_DEFINE_YYGETSTATE_NAKED -%token CONF_DEFINE_YYLESSTHAN -%token CONF_DEFINE_YYLIMIT -%token CONF_DEFINE_YYMARKER -%token CONF_DEFINE_YYPEEK -%token CONF_DEFINE_YYRESTORE -%token CONF_DEFINE_YYRESTORECTX -%token CONF_DEFINE_YYSETCONDITION -%token CONF_DEFINE_YYSETCONDITION_COND -%token CONF_DEFINE_YYSETCONDITION_NAKED -%token CONF_DEFINE_YYSETSTATE -%token CONF_DEFINE_YYSETSTATE_NAKED -%token CONF_DEFINE_YYSETSTATE_STATE -%token CONF_DEFINE_YYSKIP -%token CONF_FLAGS -%token CONF_INDENT_STRING -%token CONF_INDENT_TOP -%token CONF_LABEL_YYFILLLABEL -%token CONF_LABEL_YYNEXT -%token CONF_LABELPREFIX -%token CONF_STARTLABEL -%token CONF_STATE_ABORT -%token CONF_STATE_NEXTLABEL -%token CONF_VARIABLE_YYACCEPT -%token CONF_VARIABLE_YYBM -%token CONF_VARIABLE_YYCH -%token CONF_VARIABLE_YYCTABLE -%token CONF_VARIABLE_YYSTABLE -%token CONF_VARIABLE_YYTARGET -%token CONF_YYBM_HEX -%token CONF_YYCH_CONVERSION -%token CONF_YYCH_EMIT -%token CONF_YYFILL_CHECK -%token CONF_YYFILL_ENABLE -%token CONF_YYFILL_PARAMETER +%token CONF %token ID %token FID %token FID_END %token NOCOND -%token NUM %token REGEXP %token SETUP %token STAR -%token STRING %type CLOSE STAR SETUP close %type CLOSESIZE %type CODE %type REGEXP rule look expr diff term factor primary -%type ID FID STRING newcond +%type ID FID newcond %type cond clist -%type NUM -%type CONF_FLAGS %% @@ -276,286 +216,7 @@ decl: { in->fatal("trailing contexts are not allowed in named definitions"); } - | CONF_CONDPREFIX STRING ';' - { - opts.set_condPrefix (*$2); - delete $2; - } - | CONF_CONDENUMPREFIX STRING ';' - { - opts.set_condEnumPrefix (*$2); - delete $2; - } - | CONF_COND_DIVIDER STRING ';' - { - opts.set_condDivider (*$2); - delete $2; - } - | CONF_COND_DIVIDER_COND STRING ';' - { - opts.set_condDividerParam (*$2); - delete $2; - } - | CONF_COND_GOTO STRING ';' - { - opts.set_condGoto (*$2); - delete $2; - } - | CONF_COND_GOTO_COND STRING ';' - { - opts.set_condGotoParam (*$2); - delete $2; - } - | CONF_CGOTO_THRESHOLD NUM ';' - { - if ($2 < 0) - { - in->fatal ("configuration 'cgoto:threshold' must be nonnegative"); - } - opts.set_cGotoThreshold (static_cast ($2)); - } - | CONF_DEFINE_YYBACKUP STRING ';' - { - opts.set_yybackup (*$2); - delete $2; - } - | CONF_DEFINE_YYBACKUPCTX STRING ';' - { - opts.set_yybackupctx (*$2); - delete $2; - } - | CONF_DEFINE_YYCONDTYPE STRING ';' - { - opts.set_yycondtype (*$2); - delete $2; - } - | CONF_DEFINE_YYCTXMARKER STRING ';' - { - opts.set_yyctxmarker (*$2); - delete $2; - } - | CONF_DEFINE_YYCTYPE STRING ';' - { - opts.set_yyctype (*$2); - delete $2; - } - | CONF_DEFINE_YYCURSOR STRING ';' - { - opts.set_yycursor (*$2); - delete $2; - } - | CONF_DEFINE_YYDEBUG STRING ';' - { - opts.set_yydebug (*$2); - delete $2; - } - | CONF_DEFINE_YYFILL STRING ';' - { - opts.set_fill (*$2); - delete $2; - } - | CONF_DEFINE_YYGETCONDITION STRING ';' - { - opts.set_cond_get (*$2); - delete $2; - } - | CONF_DEFINE_YYGETSTATE STRING ';' - { - opts.set_state_get (*$2); - delete $2; - } - | CONF_DEFINE_YYLESSTHAN STRING ';' - { - opts.set_yylessthan (*$2); - delete $2; - } - | CONF_DEFINE_YYLIMIT STRING ';' - { - opts.set_yylimit (*$2); - delete $2; - } - | CONF_DEFINE_YYMARKER STRING ';' - { - opts.set_yymarker (*$2); - delete $2; - } - | CONF_DEFINE_YYPEEK STRING ';' - { - opts.set_yypeek (*$2); - delete $2; - } - | CONF_DEFINE_YYRESTORE STRING ';' - { - opts.set_yyrestore (*$2); - delete $2; - } - | CONF_DEFINE_YYRESTORECTX STRING ';' - { - opts.set_yyrestorectx (*$2); - delete $2; - } - | CONF_DEFINE_YYSETCONDITION STRING ';' - { - opts.set_cond_set (*$2); - delete $2; - } - | CONF_DEFINE_YYSETCONDITION_NAKED NUM ';' - { - opts.set_cond_set_naked ($2 != 0); - } - | CONF_DEFINE_YYSETSTATE STRING ';' - { - opts.set_state_set (*$2); - delete $2; - } - | CONF_DEFINE_YYSKIP STRING ';' - { - opts.set_yyskip (*$2); - delete $2; - } - | CONF_DEFINE_YYFILL_NAKED NUM ';' - { - opts.set_fill_naked ($2 != 0); - } - | CONF_DEFINE_YYFILL_LEN STRING ';' - { - opts.set_fill_arg (*$2); - delete $2; - } - | CONF_DEFINE_YYGETCONDITION_NAKED NUM ';' - { - opts.set_cond_get_naked ($2 != 0); - } - | CONF_DEFINE_YYGETSTATE_NAKED NUM ';' - { - opts.set_state_get_naked ($2 != 0); - } - | CONF_DEFINE_YYSETCONDITION_COND STRING ';' - { - opts.set_cond_set_arg (*$2); - delete $2; - } - | CONF_DEFINE_YYSETSTATE_NAKED NUM ';' - { - opts.set_state_set_naked ($2 != 0); - } - | CONF_DEFINE_YYSETSTATE_STATE STRING ';' - { - opts.set_state_set_arg (*$2); - delete $2; - } - | CONF_FLAGS NUM ';' - { - if ($2 == 0) - { - opts.unset_encoding ($1); - } - else if (!opts.set_encoding ($1)) - { - in->fatalf ("Cannot set %s encoding: please reset %s encoding first" - , Enc::name ($1) - , Enc::name (opts->encoding.type ())); - } - } - | CONF_INDENT_STRING STRING ';' - { - opts.set_indString (*$2); - delete $2; - } - | CONF_INDENT_TOP NUM ';' - { - if ($2 < 0) - { - in->fatal ("configuration 'indent:top' must be nonnegative"); - } - opts.set_topIndent (static_cast ($2)); - } - | CONF_LABEL_YYFILLLABEL STRING ';' - { - opts.set_yyfilllabel (*$2); - delete $2; - } - | CONF_LABEL_YYNEXT STRING ';' - { - opts.set_yynext (*$2); - delete $2; - } - | CONF_LABELPREFIX STRING ';' - { - opts.set_labelPrefix (*$2); - delete $2; - } - | CONF_STARTLABEL NUM ';' - { - in->out.set_force_start_label ($2 != 0); - } - | CONF_STARTLABEL STRING ';' - { - in->out.set_user_start_label (*$2); - delete $2; - } - | CONF_STATE_ABORT NUM ';' - { - opts.set_bUseStateAbort ($2 != 0); - } - | CONF_STATE_NEXTLABEL NUM ';' - { - opts.set_bUseStateNext ($2 != 0); - } - | CONF_VARIABLE_YYACCEPT STRING ';' - { - opts.set_yyaccept (*$2); - delete $2; - } - | CONF_VARIABLE_YYBM STRING ';' - { - opts.set_yybm (*$2); - delete $2; - } - | CONF_VARIABLE_YYCH STRING ';' - { - opts.set_yych (*$2); - delete $2; - } - | CONF_VARIABLE_YYCTABLE STRING ';' - { - opts.set_yyctable (*$2); - delete $2; - } - | CONF_VARIABLE_YYSTABLE STRING ';' - { - // deprecated - delete $2; - } - | CONF_VARIABLE_YYTARGET STRING ';' - { - opts.set_yytarget (*$2); - delete $2; - } - | CONF_YYBM_HEX NUM ';' - { - opts.set_yybmHexTable ($2 != 0); - } - | CONF_YYCH_CONVERSION NUM ';' - { - opts.set_yychConversion ($2 != 0); - } - | CONF_YYCH_EMIT NUM ';' - { - opts.set_bEmitYYCh ($2 != 0); - } - | CONF_YYFILL_CHECK NUM ';' - { - opts.set_fill_check ($2 != 0); - } - | CONF_YYFILL_ENABLE NUM ';' - { - opts.set_fill_use ($2 != 0); - } - | CONF_YYFILL_PARAMETER NUM ';' - { - opts.set_fill_arg_use ($2 != 0); - } + | CONF {} ; rule: diff --git a/re2c/src/parse/scanner.h b/re2c/src/parse/scanner.h index 41475b71..03292837 100644 --- a/re2c/src/parse/scanner.h +++ b/re2c/src/parse/scanner.h @@ -19,7 +19,6 @@ struct ScannerState enum lexer_state_t { LEX_NORMAL, - LEX_CONF, LEX_FLEX_NAME }; @@ -60,6 +59,9 @@ private: void fill (uint32_t); void set_sourceline (); void lex_cpoints (char quote, std::vector & cs); + int32_t lex_conf_number (); + std::string lex_conf_string (); + std::string cpoint_conf (const std::vector & cs) const; size_t tok_len () const; public: @@ -97,7 +99,6 @@ public: RegExp * mkDefault () const; RegExp * cpoint_string (const std::vector & cs, bool case_sensitive) const; RegExp * cpoint_class (const std::vector & cs, bool neg) const; - std::string * cpoint_conf (const std::vector & cs) const; FORBID_COPY (Scanner); }; diff --git a/re2c/src/parse/scanner_lex.re b/re2c/src/parse/scanner_lex.re index 98eb17df..98caeab8 100644 --- a/re2c/src/parse/scanner_lex.re +++ b/re2c/src/parse/scanner_lex.re @@ -53,6 +53,8 @@ lineinf = lineno (space+ dstring)? eol; naked_char = . \ (space | [;]); naked = "" | (naked_char \ ['"]) naked_char*; + + conf_assign = space* "=" space*; */ Scanner::ParseMode Scanner::echo() @@ -224,7 +226,6 @@ scan: switch (lexer_state) { case LEX_NORMAL: goto start; - case LEX_CONF: goto conf_eq; case LEX_FLEX_NAME: goto flex_name; } @@ -564,109 +565,188 @@ nextLine: conf: tok = cur; - lexer_state = LEX_CONF; /*!re2c * { fatal ((tok - pos) - tchar, "unrecognized configuration"); } - "condprefix" { return CONF_CONDPREFIX; } - "condenumprefix" { return CONF_CONDENUMPREFIX; } - "cond:divider" { return CONF_COND_DIVIDER; } - "cond:divider@cond" { return CONF_COND_DIVIDER_COND; } - "cond:goto" { return CONF_COND_GOTO; } - "cond:goto@cond" { return CONF_COND_GOTO_COND; } - "cgoto:threshold" { return CONF_CGOTO_THRESHOLD; } - "define:YYBACKUP" { return CONF_DEFINE_YYBACKUP; } - "define:YYBACKUPCTX" { return CONF_DEFINE_YYBACKUPCTX; } - "define:YYCONDTYPE" { return CONF_DEFINE_YYCONDTYPE; } - "define:YYCTXMARKER" { return CONF_DEFINE_YYCTXMARKER; } - "define:YYCTYPE" { return CONF_DEFINE_YYCTYPE; } - "define:YYCURSOR" { return CONF_DEFINE_YYCURSOR; } - "define:YYDEBUG" { return CONF_DEFINE_YYDEBUG; } - "define:YYFILL" { return CONF_DEFINE_YYFILL; } - "define:YYFILL:naked" { return CONF_DEFINE_YYFILL_NAKED; } - "define:YYFILL@len" { return CONF_DEFINE_YYFILL_LEN; } - "define:YYGETCONDITION" { return CONF_DEFINE_YYGETCONDITION; } - "define:YYGETCONDITION:naked" { return CONF_DEFINE_YYGETCONDITION_NAKED; } - "define:YYGETSTATE" { return CONF_DEFINE_YYGETSTATE; } - "define:YYGETSTATE:naked" { return CONF_DEFINE_YYGETSTATE_NAKED; } - "define:YYLESSTHAN" { return CONF_DEFINE_YYLESSTHAN; } - "define:YYLIMIT" { return CONF_DEFINE_YYLIMIT; } - "define:YYMARKER" { return CONF_DEFINE_YYMARKER; } - "define:YYPEEK" { return CONF_DEFINE_YYPEEK; } - "define:YYRESTORE" { return CONF_DEFINE_YYRESTORE; } - "define:YYRESTORECTX" { return CONF_DEFINE_YYRESTORECTX; } - "define:YYSETCONDITION" { return CONF_DEFINE_YYSETCONDITION; } - "define:YYSETCONDITION@cond" { return CONF_DEFINE_YYSETCONDITION_COND; } - "define:YYSETCONDITION:naked" { return CONF_DEFINE_YYSETCONDITION_NAKED; } - "define:YYSETSTATE" { return CONF_DEFINE_YYSETSTATE; } - "define:YYSETSTATE:naked" { return CONF_DEFINE_YYSETSTATE_NAKED; } - "define:YYSETSTATE@state" { return CONF_DEFINE_YYSETSTATE_STATE; } - "define:YYSKIP" { return CONF_DEFINE_YYSKIP; } + "condprefix" { opts.set_condPrefix (lex_conf_string ()); return CONF; } + "condenumprefix" { opts.set_condEnumPrefix (lex_conf_string ()); return CONF; } + "cond:divider" { opts.set_condDivider (lex_conf_string ()); return CONF; } + "cond:divider@cond" { opts.set_condDividerParam (lex_conf_string ()); return CONF; } + "cond:goto" { opts.set_condGoto (lex_conf_string ()); return CONF; } + "cond:goto@cond" { opts.set_condGotoParam (lex_conf_string ()); return CONF; } + "cgoto:threshold" + { + const int32_t n = lex_conf_number (); + if (n < 0) + { + fatal ("configuration 'cgoto:threshold' must be nonnegative"); + } + opts.set_cGotoThreshold (static_cast (n)); + return CONF; + } + "define:YYBACKUP" { opts.set_yybackup (lex_conf_string ()); return CONF; } + "define:YYBACKUPCTX" { opts.set_yybackupctx (lex_conf_string ()); return CONF; } + "define:YYCONDTYPE" { opts.set_yycondtype (lex_conf_string ()); return CONF; } + "define:YYCTXMARKER" { opts.set_yyctxmarker (lex_conf_string ()); return CONF; } + "define:YYCTYPE" { opts.set_yyctype (lex_conf_string ()); return CONF; } + "define:YYCURSOR" { opts.set_yycursor (lex_conf_string ()); return CONF; } + "define:YYDEBUG" { opts.set_yydebug (lex_conf_string ()); return CONF; } + "define:YYFILL" { opts.set_fill (lex_conf_string ()); return CONF; } + "define:YYFILL:naked" { opts.set_fill_naked (lex_conf_number () != 0); return CONF; } + "define:YYFILL@len" { opts.set_fill_arg (lex_conf_string ()); return CONF; } + "define:YYGETCONDITION" { opts.set_cond_get (lex_conf_string ()); return CONF; } + "define:YYGETCONDITION:naked" { opts.set_cond_get_naked (lex_conf_number () != 0); return CONF; } + "define:YYGETSTATE" { opts.set_state_get (lex_conf_string ()); return CONF; } + "define:YYGETSTATE:naked" { opts.set_state_get_naked (lex_conf_number () != 0); return CONF; } + "define:YYLESSTHAN" { opts.set_yylessthan (lex_conf_string ()); return CONF; } + "define:YYLIMIT" { opts.set_yylimit (lex_conf_string ()); return CONF; } + "define:YYMARKER" { opts.set_yymarker (lex_conf_string ()); return CONF; } + "define:YYPEEK" { opts.set_yypeek (lex_conf_string ()); return CONF; } + "define:YYRESTORE" { opts.set_yyrestore (lex_conf_string ()); return CONF; } + "define:YYRESTORECTX" { opts.set_yyrestorectx (lex_conf_string ()); return CONF; } + "define:YYSETCONDITION" { opts.set_cond_set (lex_conf_string ()); return CONF; } + "define:YYSETCONDITION@cond" { opts.set_cond_set_arg (lex_conf_string ()); return CONF; } + "define:YYSETCONDITION:naked" { opts.set_cond_set_naked (lex_conf_number () != 0); return CONF; } + "define:YYSETSTATE" { opts.set_state_set (lex_conf_string ()); return CONF; } + "define:YYSETSTATE:naked" { opts.set_state_set_naked (lex_conf_number () != 0); return CONF; } + "define:YYSETSTATE@state" { opts.set_state_set_arg (lex_conf_string ()); return CONF; } + "define:YYSKIP" { opts.set_yyskip (lex_conf_string ()); return CONF; } "flags:" [ewxu8] { + Enc::type_t enc = Enc::ASCII; switch (YYCURSOR[-1]) { - case 'e': yylval.enc = Enc::EBCDIC; break; - case 'w': yylval.enc = Enc::UCS2; break; - case 'x': yylval.enc = Enc::UTF16; break; - case 'u': yylval.enc = Enc::UTF32; break; - case '8': yylval.enc = Enc::UTF8; break; + case 'e': enc = Enc::EBCDIC; break; + case 'w': enc = Enc::UCS2; break; + case 'x': enc = Enc::UTF16; break; + case 'u': enc = Enc::UTF32; break; + case '8': enc = Enc::UTF8; break; + } + const int32_t n = lex_conf_number (); + if (n == 0) + { + opts.unset_encoding (enc); + } + else if (!opts.set_encoding (enc)) + { + fatalf ("Cannot set %s encoding: please reset %s encoding first" + , Enc::name (enc) + , Enc::name (opts->encoding.type ())); + } + return CONF; + } + "indent:string" { opts.set_indString (lex_conf_string ()); return CONF; } + "indent:top" + { + const int32_t n = lex_conf_number (); + if (n < 0) + { + fatal ("configuration 'indent:top' must be nonnegative"); } - return CONF_FLAGS; + opts.set_topIndent (static_cast (n)); + return CONF; } - "indent:string" { return CONF_INDENT_STRING; } - "indent:top" { return CONF_INDENT_TOP; } - "label:yyFillLabel" { return CONF_LABEL_YYFILLLABEL; } - "label:yyNext" { return CONF_LABEL_YYNEXT; } - "labelprefix" { return CONF_LABELPREFIX; } - "startlabel" { return CONF_STARTLABEL; } - "state:abort" { return CONF_STATE_ABORT; } - "state:nextlabel" { return CONF_STATE_NEXTLABEL; } - "variable:yyaccept" { return CONF_VARIABLE_YYACCEPT; } - "variable:yybm" { return CONF_VARIABLE_YYBM; } - "variable:yych" { return CONF_VARIABLE_YYCH; } - "variable:yyctable" { return CONF_VARIABLE_YYCTABLE; } - "variable:yystable" { return CONF_VARIABLE_YYSTABLE; } - "variable:yytarget" { return CONF_VARIABLE_YYTARGET; } - "yybm:hex" { return CONF_YYBM_HEX; } - "yych:conversion" { return CONF_YYCH_CONVERSION; } - "yych:emit" { return CONF_YYCH_EMIT; } - "yyfill:check" { return CONF_YYFILL_CHECK; } - "yyfill:enable" { return CONF_YYFILL_ENABLE; } - "yyfill:parameter" { return CONF_YYFILL_PARAMETER; } + "label:yyFillLabel" { opts.set_yyfilllabel (lex_conf_string ()); return CONF; } + "label:yyNext" { opts.set_yynext (lex_conf_string ()); return CONF; } + "labelprefix" { opts.set_labelPrefix (lex_conf_string ()); return CONF; } + "state:abort" { opts.set_bUseStateAbort (lex_conf_number () != 0); return CONF; } + "state:nextlabel" { opts.set_bUseStateNext (lex_conf_number () != 0); return CONF; } + "variable:yyaccept" { opts.set_yyaccept (lex_conf_string ()); return CONF; } + "variable:yybm" { opts.set_yybm (lex_conf_string ()); return CONF; } + "variable:yych" { opts.set_yych (lex_conf_string ()); return CONF; } + "variable:yyctable" { opts.set_yyctable (lex_conf_string ()); return CONF; } + "variable:yystable" { lex_conf_string (); return CONF; } // deprecated + "variable:yytarget" { opts.set_yytarget (lex_conf_string ()); return CONF; } + "yybm:hex" { opts.set_yybmHexTable (lex_conf_number () != 0); return CONF; } + "yych:conversion" { opts.set_yychConversion (lex_conf_number () != 0); return CONF; } + "yych:emit" { opts.set_bEmitYYCh (lex_conf_number () != 0); return CONF; } + "yyfill:check" { opts.set_fill_check (lex_conf_number () != 0); return CONF; } + "yyfill:enable" { opts.set_fill_use (lex_conf_number () != 0); return CONF; } + "yyfill:parameter" { opts.set_fill_arg_use (lex_conf_number () != 0); return CONF; } + + // try to lex number first, otherwize it would be lexed as a naked string + "startlabel" / conf_assign number { out.set_force_start_label (lex_conf_number () != 0); return CONF; } + "startlabel" { out.set_user_start_label (lex_conf_string ()); return CONF; } */ +} -conf_eq: +int32_t Scanner::lex_conf_number () +{ + int32_t num = 0; /*!re2c * { fatal ("missing '=' in configuration"); } - space* "=" space* { goto conf_val; } + conf_assign { goto conf_val; } */ - conf_val: tok = cur; - lexer_state = LEX_NORMAL; /*!re2c number { - if (!s_to_i32_unsafe (tok, cur, yylval.num)) + if (!s_to_i32_unsafe (tok, cur, num)) { fatal ("configuration value overflow"); } - return NUM; + goto conf_semicolon; } +*/ +conf_semicolon: +/*!re2c + * { fatal ("missing ending ';' in configuration"); } + space* ";" { goto end; } +*/ +end: + return num; +} + +std::string Scanner::lex_conf_string () +{ +/*!re2c + * { fatal ("missing '=' in configuration"); } + conf_assign { goto conf_val; } +*/ +conf_val: + std::string s; + tok = cur; +/*!re2c ['"] { std::vector cpoints; lex_cpoints (tok[0], cpoints); - yylval.str = cpoint_conf (cpoints); - return STRING; + s = cpoint_conf (cpoints); + goto conf_semicolon; } naked { - yylval.str = new std::string (tok, tok_len ()); - return STRING; + s = std::string (tok, tok_len ()); + goto conf_semicolon; } */ +conf_semicolon: +/*!re2c + * { fatal ("missing ending ';' in configuration"); } + space* ";" { goto end; } +*/ +end: + return s; +} + +std::string Scanner::cpoint_conf (const std::vector & cs) const +{ + const size_t n = cs.size (); + std::string s; + for (size_t i = 0; i < n; ++i) + { + const uint32_t c = cs[i]; + if (c > 0xFF) + { + fatalf ("multibyte character in configuration string: 0x%X", c); + } + else + { + s += static_cast (c); + } + } + return s; } static void escape (std::string & dest, const std::string & src) diff --git a/re2c/test/repeat-07_error.gir.c b/re2c/test/repeat-07_error.gir.c index b91feac1..f90a68be 100644 --- a/re2c/test/repeat-07_error.gir.c +++ b/re2c/test/repeat-07_error.gir.c @@ -1,3 +1,3 @@ re2c: warning: line 27: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] re2c: warning: line 45: control flow is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow] -re2c: error: line 52, column 17: Cannot set UTF32 encoding: please reset USC2 encoding first +re2c: error: line 52, column 1: Cannot set UTF32 encoding: please reset USC2 encoding first -- 2.40.0