X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fcsl%2Fparser.cc;h=0ff94b776926ae828b9d3b850d97e738f5c62adf;hb=9b13e23dc5a1c11b93cefc9f188cf459af68bede;hp=855b6fdd8b2c50bbf9f387de2c341ea59c078aa1;hpb=1825425e12755baebb754a9c4a4df69e3cea0bc9;p=awesomized%2Flibmemcached diff --git a/libmemcached/csl/parser.cc b/libmemcached/csl/parser.cc index 855b6fdd..0ff94b77 100644 --- a/libmemcached/csl/parser.cc +++ b/libmemcached/csl/parser.cc @@ -74,7 +74,7 @@ /* Copy the first part of user declarations. */ /* Line 268 of yacc.c */ -#line 36 "libmemcached/csl/parser.yy" +#line 52 "libmemcached/csl/parser.yy" #include @@ -88,6 +88,12 @@ #pragma GCC diagnostic ignored "-Wold-style-cast" #endif +#ifndef __INTEL_COMPILER +#ifndef __clang__ +#pragma GCC diagnostic ignored "-Wlogical-op" +#endif +#endif + int conf_lex(YYSTYPE* lvalp, void* scanner); #define select_yychar(__context) yychar == UNKNOWN ? ( (__context)->previous_token == END ? UNKNOWN : (__context)->previous_token ) : yychar @@ -115,7 +121,7 @@ inline void __config_error(Context *context, yyscan_t *scanner, const char *erro /* Line 268 of yacc.c */ -#line 119 "libmemcached/csl/parser.cc" +#line 125 "libmemcached/csl/parser.cc" /* Enabling traces. */ #ifndef YYDEBUG @@ -185,32 +191,33 @@ inline void __config_error(Context *context, yyscan_t *scanner, const char *erro _TCP_KEEPALIVE = 298, _TCP_KEEPIDLE = 299, _TCP_NODELAY = 300, - NAMESPACE = 301, - POOL_MIN = 302, - POOL_MAX = 303, - MD5 = 304, - CRC = 305, - FNV1_64 = 306, - FNV1A_64 = 307, - FNV1_32 = 308, - FNV1A_32 = 309, - HSIEH = 310, - MURMUR = 311, - JENKINS = 312, - CONSISTENT = 313, - MODULA = 314, - RANDOM = 315, - TRUE = 316, - FALSE = 317, - FLOAT = 318, - NUMBER = 319, - PORT = 320, - WEIGHT_START = 321, - IPADDRESS = 322, - HOSTNAME = 323, - STRING = 324, - QUOTED_STRING = 325, - FILE_PATH = 326 + FETCH_VERSION = 301, + NAMESPACE = 302, + POOL_MIN = 303, + POOL_MAX = 304, + MD5 = 305, + CRC = 306, + FNV1_64 = 307, + FNV1A_64 = 308, + FNV1_32 = 309, + FNV1A_32 = 310, + HSIEH = 311, + MURMUR = 312, + JENKINS = 313, + CONSISTENT = 314, + MODULA = 315, + RANDOM = 316, + TRUE = 317, + FALSE = 318, + FLOAT = 319, + NUMBER = 320, + PORT = 321, + WEIGHT_START = 322, + IPADDRESS = 323, + HOSTNAME = 324, + STRING = 325, + QUOTED_STRING = 326, + FILE_PATH = 327 }; #endif @@ -227,7 +234,7 @@ inline void __config_error(Context *context, yyscan_t *scanner, const char *erro /* Line 343 of yacc.c */ -#line 231 "libmemcached/csl/parser.cc" +#line 238 "libmemcached/csl/parser.cc" #ifdef short # undef short @@ -444,22 +451,22 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 71 +#define YYFINAL 72 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 74 +#define YYLAST 75 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 75 +#define YYNTOKENS 76 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 12 /* YYNRULES -- Number of rules. */ -#define YYNRULES 67 +#define YYNRULES 68 /* YYNRULES -- Number of states. */ -#define YYNSTATES 85 +#define YYNSTATES 86 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 326 +#define YYMAXUTOK 327 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -470,10 +477,10 @@ static const yytype_uint8 yytranslate[] = 0, 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, 74, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 63, 2, 2, 2, 2, 2, + 2, 2, 75, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 64, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 64, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 65, 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, 2, 2, 2, @@ -498,8 +505,8 @@ static const yytype_uint8 yytranslate[] = 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, 65, 66, - 67, 68, 69, 70, 71, 72, 73 + 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, + 67, 68, 69, 70, 71, 72, 73, 74 }; #if YYDEBUG @@ -509,44 +516,44 @@ static const yytype_uint8 yyprhs[] = { 0, 0, 3, 5, 9, 11, 13, 15, 17, 19, 21, 23, 27, 32, 37, 41, 44, 47, 50, 52, - 55, 58, 63, 66, 69, 71, 73, 75, 77, 79, + 55, 57, 60, 65, 68, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, - 121, 122, 124, 125, 127, 129, 131, 133, 135, 137, - 139, 141, 143, 145, 147, 149, 151, 153 + 121, 123, 124, 126, 127, 129, 131, 133, 135, 137, + 139, 141, 143, 145, 147, 149, 151, 153, 155 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 76, 0, -1, 77, -1, 76, 74, 77, -1, 78, + 77, 0, -1, 78, -1, 77, 75, 78, -1, 79, -1, 3, -1, 10, -1, 4, -1, 5, -1, 6, - -1, 7, -1, 8, 74, 85, -1, 11, 70, 82, - 83, -1, 11, 69, 82, 83, -1, 12, 85, 83, - -1, 9, 85, -1, 47, 66, -1, 48, 66, -1, - 79, -1, 46, 85, -1, 20, 86, -1, 20, 86, - 63, 84, -1, 21, 84, -1, 80, 66, -1, 81, - -1, 40, -1, 33, -1, 19, -1, 25, -1, 23, - -1, 24, -1, 29, -1, 30, -1, 32, -1, 34, - -1, 35, -1, 36, -1, 37, -1, 17, -1, 18, - -1, 22, -1, 28, -1, 31, -1, 38, -1, 39, - -1, 45, -1, 43, -1, 44, -1, 41, -1, 42, - -1, -1, 67, -1, -1, 68, -1, 49, -1, 50, + -1, 7, -1, 8, 75, 86, -1, 11, 71, 83, + 84, -1, 11, 70, 83, 84, -1, 12, 86, 84, + -1, 9, 86, -1, 48, 67, -1, 49, 67, -1, + 80, -1, 47, 86, -1, 46, -1, 20, 87, -1, + 20, 87, 64, 85, -1, 21, 85, -1, 81, 67, + -1, 82, -1, 40, -1, 33, -1, 19, -1, 25, + -1, 23, -1, 24, -1, 29, -1, 30, -1, 32, + -1, 34, -1, 35, -1, 36, -1, 37, -1, 17, + -1, 18, -1, 22, -1, 28, -1, 31, -1, 38, + -1, 39, -1, 45, -1, 43, -1, 44, -1, 41, + -1, 42, -1, -1, 68, -1, -1, 69, -1, 50, -1, 51, -1, 52, -1, 53, -1, 54, -1, 55, - -1, 56, -1, 57, -1, 71, -1, 72, -1, 58, - -1, 59, -1, 60, -1 + -1, 56, -1, 57, -1, 58, -1, 72, -1, 73, + -1, 59, -1, 60, -1, 61, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 172, 172, 173, 177, 179, 181, 183, 188, 193, - 197, 201, 212, 220, 228, 235, 239, 243, 247, 251, - 263, 270, 281, 288, 295, 302, 308, 312, 316, 320, - 324, 328, 332, 336, 340, 344, 348, 352, 359, 363, - 367, 371, 375, 379, 383, 387, 391, 395, 399, 403, - 410, 411, 416, 417, 422, 426, 430, 434, 438, 442, - 446, 450, 454, 461, 465, 472, 476, 480 + 0, 195, 195, 196, 200, 202, 204, 206, 211, 216, + 220, 224, 235, 245, 255, 264, 268, 272, 276, 280, + 292, 296, 309, 322, 329, 336, 345, 351, 355, 359, + 363, 367, 371, 375, 379, 383, 387, 391, 395, 402, + 406, 410, 414, 418, 422, 426, 430, 434, 438, 442, + 446, 453, 454, 459, 460, 465, 469, 473, 477, 481, + 485, 489, 493, 497, 504, 508, 515, 519, 523 }; #endif @@ -565,10 +572,10 @@ static const char *const yytname[] = "RCV_TIMEOUT", "REMOVE_FAILED_SERVERS", "RETRY_TIMEOUT", "SND_TIMEOUT", "SOCKET_RECV_SIZE", "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS", "USER_DATA", "USE_UDP", "VERIFY_KEY", "_TCP_KEEPALIVE", "_TCP_KEEPIDLE", - "_TCP_NODELAY", "NAMESPACE", "POOL_MIN", "POOL_MAX", "MD5", "CRC", - "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32", "HSIEH", "MURMUR", - "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE", "FALSE", "','", - "'='", "FLOAT", "NUMBER", "PORT", "WEIGHT_START", "IPADDRESS", + "_TCP_NODELAY", "FETCH_VERSION", "NAMESPACE", "POOL_MIN", "POOL_MAX", + "MD5", "CRC", "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32", "HSIEH", + "MURMUR", "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE", "FALSE", + "','", "'='", "FLOAT", "NUMBER", "PORT", "WEIGHT_START", "IPADDRESS", "HOSTNAME", "STRING", "QUOTED_STRING", "FILE_PATH", "' '", "$accept", "begin", "statement", "expression", "behaviors", "behavior_number", "behavior_boolean", "optional_port", "optional_weight", "hash", "string", @@ -587,21 +594,21 @@ static const yytype_uint16 yytoknum[] = 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, 44, 61, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 32 + 315, 316, 317, 318, 44, 61, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 32 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 75, 76, 76, 77, 77, 77, 77, 77, 77, - 77, 77, 78, 78, 78, 78, 78, 78, 78, 79, - 79, 79, 79, 79, 79, 79, 80, 80, 80, 80, - 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 82, 82, 83, 83, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 85, 85, 86, 86, 86 + 0, 76, 77, 77, 78, 78, 78, 78, 78, 78, + 78, 78, 79, 79, 79, 79, 79, 79, 79, 80, + 80, 80, 80, 80, 80, 80, 80, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 82, + 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, + 82, 83, 83, 84, 84, 85, 85, 85, 85, 85, + 85, 85, 85, 85, 86, 86, 87, 87, 87 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -609,11 +616,11 @@ static const yytype_uint8 yyr2[] = { 0, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 4, 4, 3, 2, 2, 2, 1, 2, - 2, 4, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 2, 2, 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, - 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1 + 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. @@ -622,44 +629,44 @@ static const yytype_uint8 yyr2[] = static const yytype_uint8 yydefact[] = { 0, 5, 7, 8, 9, 10, 0, 0, 6, 0, - 0, 38, 39, 27, 0, 0, 40, 29, 30, 28, - 41, 31, 32, 42, 33, 26, 34, 35, 36, 37, - 43, 44, 25, 48, 49, 46, 47, 45, 0, 0, - 0, 0, 2, 4, 18, 0, 24, 0, 63, 64, - 15, 50, 50, 52, 65, 66, 67, 20, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 22, 19, 16, - 17, 1, 0, 23, 11, 51, 52, 52, 53, 14, - 0, 3, 13, 12, 21 + 0, 39, 40, 28, 0, 0, 41, 30, 31, 29, + 42, 32, 33, 43, 34, 27, 35, 36, 37, 38, + 44, 45, 26, 49, 50, 47, 48, 46, 20, 0, + 0, 0, 0, 2, 4, 18, 0, 25, 0, 64, + 65, 15, 51, 51, 53, 66, 67, 68, 21, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 23, 19, + 16, 17, 1, 0, 24, 11, 52, 53, 53, 54, + 14, 0, 3, 13, 12, 22 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 41, 42, 43, 44, 45, 46, 76, 79, 67, - 50, 57 + -1, 42, 43, 44, 45, 46, 47, 77, 80, 68, + 51, 58 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -61 +#define YYPACT_NINF -62 static const yytype_int8 yypact[] = { - -2, -61, -61, -61, -61, -61, -60, -24, -61, -20, - -24, -61, -61, -61, -47, 13, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -24, -41, - -15, 0, -61, -61, -61, -11, -61, -24, -61, -61, - -61, -10, -10, -12, -61, -61, -61, -5, -61, -61, - -61, -61, -61, -61, -61, -61, -61, -61, -61, -61, - -61, -61, -2, -61, -61, -61, -12, -12, -61, -61, - 13, -61, -61, -61, -61 + -2, -62, -62, -62, -62, -62, -61, -24, -62, -20, + -24, -62, -62, -62, -48, 13, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -24, + -42, -15, 0, -62, -62, -62, -11, -62, -24, -62, + -62, -62, -10, -10, -12, -62, -62, -62, -5, -62, + -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, + -62, -62, -62, -2, -62, -62, -62, -12, -12, -62, + -62, 13, -62, -62, -62, -62 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -61, -61, -13, -61, -61, -61, -61, 8, -23, -9, - 14, -61 + -62, -62, -13, -62, -62, -62, -62, 8, -23, -9, + 14, -62 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -668,18 +675,18 @@ static const yytype_int8 yypgoto[] = #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 71, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 54, 55, 56, 47, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 53, 69, 20, 21, 22, 23, + 72, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 55, 56, 57, 48, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 54, 70, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 48, 49, 51, - 52, 70, 68, 82, 83, 73, 78, 75, 80, 81, - 77, 74, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 84, 0, 0, 72 + 34, 35, 36, 37, 38, 39, 40, 41, 49, 50, + 52, 53, 71, 69, 83, 84, 74, 79, 76, 81, + 82, 78, 75, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 85, 0, 0, 73 }; #define yypact_value_is_default(yystate) \ - ((yystate) == (-61)) + ((yystate) == (-62)) #define yytable_value_is_error(yytable_value) \ YYID (0) @@ -687,13 +694,13 @@ static const yytype_uint8 yytable[] = static const yytype_int8 yycheck[] = { 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 58, 59, 60, 74, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 10, 66, 28, 29, 30, 31, + 12, 59, 60, 61, 75, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 10, 67, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 71, 72, 69, - 70, 66, 38, 76, 77, 66, 68, 67, 63, 72, - 52, 47, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 80, -1, -1, 74 + 42, 43, 44, 45, 46, 47, 48, 49, 72, 73, + 70, 71, 67, 39, 77, 78, 67, 69, 68, 64, + 73, 53, 48, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 81, -1, -1, 75 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -704,11 +711,11 @@ static const yytype_uint8 yystos[] = 12, 17, 18, 19, 20, 21, 22, 23, 24, 25, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 76, 77, 78, 79, 80, 81, 74, 71, 72, - 85, 69, 70, 85, 58, 59, 60, 86, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 84, 85, 66, - 66, 0, 74, 66, 85, 67, 82, 82, 68, 83, - 63, 77, 83, 83, 84 + 48, 49, 77, 78, 79, 80, 81, 82, 75, 72, + 73, 86, 70, 71, 86, 59, 60, 61, 87, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 85, 86, + 67, 67, 0, 75, 67, 86, 68, 83, 83, 69, + 84, 64, 78, 84, 84, 85 }; #define yyerrok (yyerrstatus = 0) @@ -1556,29 +1563,29 @@ yyreduce: { case 4: -/* Line 1806 of yacc.c */ -#line 178 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 201 "libmemcached/csl/parser.yy" { } break; case 5: -/* Line 1806 of yacc.c */ -#line 180 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 203 "libmemcached/csl/parser.yy" { } break; case 6: -/* Line 1806 of yacc.c */ -#line 182 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 205 "libmemcached/csl/parser.yy" { } break; case 7: -/* Line 1806 of yacc.c */ -#line 184 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 207 "libmemcached/csl/parser.yy" { context->set_end(); YYACCEPT; @@ -1587,18 +1594,18 @@ yyreduce: case 8: -/* Line 1806 of yacc.c */ -#line 189 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 212 "libmemcached/csl/parser.yy" { context->rc= MEMCACHED_PARSE_USER_ERROR; - parser_abort(context, NULL); + parser_abort(context, "ERROR called directly"); } break; case 9: -/* Line 1806 of yacc.c */ -#line 194 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 217 "libmemcached/csl/parser.yy" { memcached_reset(context->memc); } @@ -1606,8 +1613,8 @@ yyreduce: case 10: -/* Line 1806 of yacc.c */ -#line 198 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 221 "libmemcached/csl/parser.yy" { yydebug= 1; } @@ -1615,24 +1622,26 @@ yyreduce: case 11: -/* Line 1806 of yacc.c */ -#line 202 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 225 "libmemcached/csl/parser.yy" { if ((context->rc= memcached_parse_configure_file(*context->memc, (yyvsp[(3) - (3)].string).c_str, (yyvsp[(3) - (3)].string).size)) != MEMCACHED_SUCCESS) { - parser_abort(context, NULL); + parser_abort(context, "Failed to parse configuration file"); } } break; case 12: -/* Line 1806 of yacc.c */ -#line 213 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 236 "libmemcached/csl/parser.yy" { - if (memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(3) - (4)].number), (yyvsp[(4) - (4)].number)))) + if (memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(3) - (4)].number), uint32_t((yyvsp[(4) - (4)].number))))) { - parser_abort(context, NULL); + char buffer[1024]; + snprintf(buffer, sizeof(buffer), "Failed to add server: %s:%u", (yyvsp[(2) - (4)].server).c_str, uint32_t((yyvsp[(3) - (4)].number))); + parser_abort(context, buffer); } context->unset_server(); } @@ -1640,12 +1649,14 @@ yyreduce: case 13: -/* Line 1806 of yacc.c */ -#line 221 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 246 "libmemcached/csl/parser.yy" { - if (memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(3) - (4)].number), (yyvsp[(4) - (4)].number)))) + if (memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(3) - (4)].number), uint32_t((yyvsp[(4) - (4)].number))))) { - parser_abort(context, NULL); + char buffer[1024]; + snprintf(buffer, sizeof(buffer), "Failed to add server: %s:%u", (yyvsp[(2) - (4)].server).c_str, uint32_t((yyvsp[(3) - (4)].number))); + parser_abort(context, buffer); } context->unset_server(); } @@ -1653,20 +1664,22 @@ yyreduce: case 14: -/* Line 1806 of yacc.c */ -#line 229 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 256 "libmemcached/csl/parser.yy" { - if (memcached_failed(context->rc= memcached_server_add_unix_socket_with_weight(context->memc, (yyvsp[(2) - (3)].string).c_str, (yyvsp[(3) - (3)].number)))) + if (memcached_failed(context->rc= memcached_server_add_unix_socket_with_weight(context->memc, (yyvsp[(2) - (3)].string).c_str, uint32_t((yyvsp[(3) - (3)].number))))) { - parser_abort(context, NULL); + char buffer[1024]; + snprintf(buffer, sizeof(buffer), "Failed to add socket: %s", (yyvsp[(2) - (3)].string).c_str); + parser_abort(context, buffer); } } break; case 15: -/* Line 1806 of yacc.c */ -#line 236 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 265 "libmemcached/csl/parser.yy" { memcached_set_configuration_file(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).size); } @@ -1674,26 +1687,26 @@ yyreduce: case 16: -/* Line 1806 of yacc.c */ -#line 240 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 269 "libmemcached/csl/parser.yy" { - context->memc->configure.initial_pool_size= (yyvsp[(2) - (2)].number); + context->memc->configure.initial_pool_size= uint32_t((yyvsp[(2) - (2)].number)); } break; case 17: -/* Line 1806 of yacc.c */ -#line 244 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 273 "libmemcached/csl/parser.yy" { - context->memc->configure.max_pool_size= (yyvsp[(2) - (2)].number); + context->memc->configure.max_pool_size= uint32_t((yyvsp[(2) - (2)].number)); } break; case 19: -/* Line 1806 of yacc.c */ -#line 252 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 281 "libmemcached/csl/parser.yy" { if (memcached_callback_get(context->memc, MEMCACHED_CALLBACK_PREFIX_KEY, NULL)) { @@ -1709,9 +1722,24 @@ yyreduce: case 20: -/* Line 1806 of yacc.c */ -#line 264 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 293 "libmemcached/csl/parser.yy" + { + memcached_flag(*context->memc, MEMCACHED_FLAG_IS_FETCHING_VERSION, true); + } + break; + + case 21: + +/* Line 1821 of yacc.c */ +#line 297 "libmemcached/csl/parser.yy" { + // Check to see if DISTRIBUTION has already been set + if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (2)].distribution))) != MEMCACHED_SUCCESS) + { + parser_abort(context, "--DISTRIBUTION can only be called once"); + } + if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (2)].distribution))) != MEMCACHED_SUCCESS) { parser_abort(context, memcached_last_error_message(context->memc));; @@ -1719,431 +1747,435 @@ yyreduce: } break; - case 21: + case 22: -/* Line 1806 of yacc.c */ -#line 271 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 310 "libmemcached/csl/parser.yy" { + // Check to see if DISTRIBUTION has already been set if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (4)].distribution))) != MEMCACHED_SUCCESS) { - parser_abort(context, NULL); + parser_abort(context, "--DISTRIBUTION can only be called once"); } + if ((context->rc= memcached_behavior_set_distribution_hash(context->memc, (yyvsp[(4) - (4)].hash))) != MEMCACHED_SUCCESS) { - parser_abort(context, NULL); + parser_abort(context, "Unable to set the hash for the DISTRIBUTION requested"); } } break; - case 22: + case 23: -/* Line 1806 of yacc.c */ -#line 282 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 323 "libmemcached/csl/parser.yy" { - if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_HASH, (yyvsp[(2) - (2)].hash))) != MEMCACHED_SUCCESS) + if (context->set_hash((yyvsp[(2) - (2)].hash)) == false) { - parser_abort(context, NULL); + parser_abort(context, "--HASH can only be set once"); } } break; - case 23: + case 24: -/* Line 1806 of yacc.c */ -#line 289 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 330 "libmemcached/csl/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (2)].behavior), (yyvsp[(2) - (2)].number))) != MEMCACHED_SUCCESS) { - parser_abort(context, NULL); + parser_abort(context, "Unable to set behavior"); } } break; - case 24: + case 25: -/* Line 1806 of yacc.c */ -#line 296 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 337 "libmemcached/csl/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (1)].behavior), true)) != MEMCACHED_SUCCESS) { - parser_abort(context, NULL); + char buffer[1024]; + snprintf(buffer, sizeof(buffer), "Could not set: %s", libmemcached_string_behavior((yyvsp[(1) - (1)].behavior))); + parser_abort(context, buffer); } } break; - case 25: + case 26: -/* Line 1806 of yacc.c */ -#line 303 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 346 "libmemcached/csl/parser.yy" { } break; - case 26: + case 27: -/* Line 1806 of yacc.c */ -#line 309 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 352 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS; } break; - case 27: + case 28: -/* Line 1806 of yacc.c */ -#line 313 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 356 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT; } break; - case 28: + case 29: -/* Line 1806 of yacc.c */ -#line 317 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 360 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK; } break; - case 29: + case 30: -/* Line 1806 of yacc.c */ -#line 321 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 364 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK; } break; - case 30: + case 31: -/* Line 1806 of yacc.c */ -#line 325 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 368 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH; } break; - case 31: + case 32: -/* Line 1806 of yacc.c */ -#line 329 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 372 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS; } break; - case 32: + case 33: -/* Line 1806 of yacc.c */ -#line 333 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 376 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT; } break; - case 33: + case 34: -/* Line 1806 of yacc.c */ -#line 337 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 380 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT; } break; - case 34: + case 35: -/* Line 1806 of yacc.c */ -#line 341 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 384 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT; } break; - case 35: + case 36: -/* Line 1806 of yacc.c */ -#line 345 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 388 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SND_TIMEOUT; } break; - case 36: + case 37: -/* Line 1806 of yacc.c */ -#line 349 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 392 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE; } break; - case 37: + case 38: -/* Line 1806 of yacc.c */ -#line 353 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 396 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE; } break; - case 38: + case 39: -/* Line 1806 of yacc.c */ -#line 360 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 403 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL; } break; - case 39: + case 40: -/* Line 1806 of yacc.c */ -#line 364 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 407 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS; } break; - case 40: + case 41: -/* Line 1806 of yacc.c */ -#line 368 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 411 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY; } break; - case 41: + case 42: -/* Line 1806 of yacc.c */ -#line 372 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 415 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_NOREPLY; } break; - case 42: + case 43: -/* Line 1806 of yacc.c */ -#line 376 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 419 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ; } break; - case 43: + case 44: -/* Line 1806 of yacc.c */ -#line 380 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 423 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SORT_HOSTS; } break; - case 44: + case 45: -/* Line 1806 of yacc.c */ -#line 384 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 427 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SUPPORT_CAS; } break; - case 45: + case 46: -/* Line 1806 of yacc.c */ -#line 388 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 431 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_NODELAY; } break; - case 46: + case 47: -/* Line 1806 of yacc.c */ -#line 392 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 435 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE; } break; - case 47: + case 48: -/* Line 1806 of yacc.c */ -#line 396 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 439 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE; } break; - case 48: + case 49: -/* Line 1806 of yacc.c */ -#line 400 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 443 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_USE_UDP; } break; - case 49: + case 50: -/* Line 1806 of yacc.c */ -#line 404 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 447 "libmemcached/csl/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_VERIFY_KEY; } break; - case 50: + case 51: -/* Line 1806 of yacc.c */ -#line 410 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 453 "libmemcached/csl/parser.yy" { (yyval.number)= MEMCACHED_DEFAULT_PORT;} break; - case 51: + case 52: -/* Line 1806 of yacc.c */ -#line 412 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 455 "libmemcached/csl/parser.yy" { } break; - case 52: + case 53: -/* Line 1806 of yacc.c */ -#line 416 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 459 "libmemcached/csl/parser.yy" { (yyval.number)= 1; } break; - case 53: + case 54: -/* Line 1806 of yacc.c */ -#line 418 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 461 "libmemcached/csl/parser.yy" { } break; - case 54: + case 55: -/* Line 1806 of yacc.c */ -#line 423 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 466 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_MD5; } break; - case 55: + case 56: -/* Line 1806 of yacc.c */ -#line 427 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 470 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_CRC; } break; - case 56: + case 57: -/* Line 1806 of yacc.c */ -#line 431 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 474 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1_64; } break; - case 57: + case 58: -/* Line 1806 of yacc.c */ -#line 435 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 478 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1A_64; } break; - case 58: + case 59: -/* Line 1806 of yacc.c */ -#line 439 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 482 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1_32; } break; - case 59: + case 60: -/* Line 1806 of yacc.c */ -#line 443 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 486 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1A_32; } break; - case 60: + case 61: -/* Line 1806 of yacc.c */ -#line 447 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 490 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_HSIEH; } break; - case 61: + case 62: -/* Line 1806 of yacc.c */ -#line 451 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 494 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_MURMUR; } break; - case 62: + case 63: -/* Line 1806 of yacc.c */ -#line 455 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 498 "libmemcached/csl/parser.yy" { (yyval.hash)= MEMCACHED_HASH_JENKINS; } break; - case 63: + case 64: -/* Line 1806 of yacc.c */ -#line 462 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 505 "libmemcached/csl/parser.yy" { (yyval.string)= (yyvsp[(1) - (1)].string); } break; - case 64: + case 65: -/* Line 1806 of yacc.c */ -#line 466 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 509 "libmemcached/csl/parser.yy" { (yyval.string)= (yyvsp[(1) - (1)].string); } break; - case 65: + case 66: -/* Line 1806 of yacc.c */ -#line 473 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 516 "libmemcached/csl/parser.yy" { (yyval.distribution)= MEMCACHED_DISTRIBUTION_CONSISTENT; } break; - case 66: + case 67: -/* Line 1806 of yacc.c */ -#line 477 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 520 "libmemcached/csl/parser.yy" { (yyval.distribution)= MEMCACHED_DISTRIBUTION_MODULA; } break; - case 67: + case 68: -/* Line 1806 of yacc.c */ -#line 481 "libmemcached/csl/parser.yy" +/* Line 1821 of yacc.c */ +#line 524 "libmemcached/csl/parser.yy" { (yyval.distribution)= MEMCACHED_DISTRIBUTION_RANDOM; } @@ -2151,8 +2183,8 @@ yyreduce: -/* Line 1806 of yacc.c */ -#line 2156 "libmemcached/csl/parser.cc" +/* Line 1821 of yacc.c */ +#line 2188 "libmemcached/csl/parser.cc" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2383,7 +2415,7 @@ yyreturn: /* Line 2067 of yacc.c */ -#line 486 "libmemcached/csl/parser.yy" +#line 529 "libmemcached/csl/parser.yy" void Context::start()