X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Foptions%2Fparser.cc;h=8b7134a9cdb18e12793811db2f2acb4e38795b24;hb=81416ab2d4fe60d5c71ea11326a351993c539002;hp=a01e6c7f50044da3dc1556d11a25c307d991891c;hpb=2a34f4dcac48917e41a1b6aee37edbe886aa9f7b;p=awesomized%2Flibmemcached diff --git a/libmemcached/options/parser.cc b/libmemcached/options/parser.cc index a01e6c7f..8b7134a9 100644 --- a/libmemcached/options/parser.cc +++ b/libmemcached/options/parser.cc @@ -102,17 +102,10 @@ inline void config_error(Context *context, yyscan_t *scanner, const char *error) parser::abort_func(context, error); } -int config_parse(Context*, yyscan_t *); - -void Context::start() -{ - config_parse(this, scanner); -} - /* Line 189 of yacc.c */ -#line 116 "libmemcached/options/parser.cc" +#line 109 "libmemcached/options/parser.cc" /* Enabling traces. */ #ifndef YYDEBUG @@ -223,7 +216,7 @@ void Context::start() /* Line 264 of yacc.c */ -#line 227 "libmemcached/options/parser.cc" +#line 220 "libmemcached/options/parser.cc" #ifdef short # undef short @@ -533,14 +526,14 @@ static const yytype_int8 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 164, 164, 165, 169, 171, 173, 175, 180, 185, - 189, 193, 204, 211, 214, 218, 222, 229, 236, 247, - 254, 261, 268, 274, 278, 282, 286, 290, 294, 298, - 302, 306, 310, 314, 318, 325, 329, 333, 337, 341, - 345, 349, 353, 357, 361, 365, 369, 373, 377, 381, - 388, 395, 405, 411, 417, 423, 429, 438, 442, 446, - 450, 454, 458, 462, 466, 470, 477, 481, 489, 493, - 497 + 0, 157, 157, 158, 162, 164, 166, 168, 173, 178, + 182, 186, 197, 204, 207, 211, 215, 222, 229, 240, + 247, 254, 261, 267, 271, 275, 279, 283, 287, 291, + 295, 299, 303, 307, 311, 318, 322, 326, 330, 334, + 338, 342, 346, 350, 354, 358, 362, 366, 370, 374, + 381, 388, 398, 404, 410, 416, 422, 431, 435, 439, + 443, 447, 451, 455, 459, 463, 470, 474, 482, 486, + 490 }; #endif @@ -1535,28 +1528,28 @@ yyreduce: case 4: /* Line 1464 of yacc.c */ -#line 170 "libmemcached/options/parser.yy" +#line 163 "libmemcached/options/parser.yy" { ;} break; case 5: /* Line 1464 of yacc.c */ -#line 172 "libmemcached/options/parser.yy" +#line 165 "libmemcached/options/parser.yy" { ;} break; case 6: /* Line 1464 of yacc.c */ -#line 174 "libmemcached/options/parser.yy" +#line 167 "libmemcached/options/parser.yy" { ;} break; case 7: /* Line 1464 of yacc.c */ -#line 176 "libmemcached/options/parser.yy" +#line 169 "libmemcached/options/parser.yy" { context->set_end(); YYACCEPT; @@ -1566,7 +1559,7 @@ yyreduce: case 8: /* Line 1464 of yacc.c */ -#line 181 "libmemcached/options/parser.yy" +#line 174 "libmemcached/options/parser.yy" { context->rc= MEMCACHED_PARSE_USER_ERROR; parser_abort(context, NULL); @@ -1576,7 +1569,7 @@ yyreduce: case 9: /* Line 1464 of yacc.c */ -#line 186 "libmemcached/options/parser.yy" +#line 179 "libmemcached/options/parser.yy" { memcached_reset(context->memc); ;} @@ -1585,7 +1578,7 @@ yyreduce: case 10: /* Line 1464 of yacc.c */ -#line 190 "libmemcached/options/parser.yy" +#line 183 "libmemcached/options/parser.yy" { yydebug= 1; ;} @@ -1594,7 +1587,7 @@ yyreduce: case 11: /* Line 1464 of yacc.c */ -#line 194 "libmemcached/options/parser.yy" +#line 187 "libmemcached/options/parser.yy" { if ((context->rc= memcached_parse_configure_file(context->memc, (yyvsp[(3) - (3)].string).c_str, (yyvsp[(3) - (3)].string).length)) != MEMCACHED_SUCCESS) { @@ -1606,7 +1599,7 @@ yyreduce: case 12: /* Line 1464 of yacc.c */ -#line 205 "libmemcached/options/parser.yy" +#line 198 "libmemcached/options/parser.yy" { if ((context->rc= memcached_server_add_parsed(context->memc, (yyvsp[(2) - (2)].server).c_str, (yyvsp[(2) - (2)].server).length, (yyvsp[(2) - (2)].server).port, 0)) != MEMCACHED_SUCCESS) { @@ -1618,7 +1611,7 @@ yyreduce: case 13: /* Line 1464 of yacc.c */ -#line 212 "libmemcached/options/parser.yy" +#line 205 "libmemcached/options/parser.yy" { ;} break; @@ -1626,7 +1619,7 @@ yyreduce: case 14: /* Line 1464 of yacc.c */ -#line 215 "libmemcached/options/parser.yy" +#line 208 "libmemcached/options/parser.yy" { memcached_set_configuration_file(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).length); ;} @@ -1635,7 +1628,7 @@ yyreduce: case 16: /* Line 1464 of yacc.c */ -#line 223 "libmemcached/options/parser.yy" +#line 216 "libmemcached/options/parser.yy" { if ((context->rc= memcached_set_prefix_key(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).length)) != MEMCACHED_SUCCESS) { @@ -1647,7 +1640,7 @@ yyreduce: case 17: /* Line 1464 of yacc.c */ -#line 230 "libmemcached/options/parser.yy" +#line 223 "libmemcached/options/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (2)].distribution))) != MEMCACHED_SUCCESS) { @@ -1659,7 +1652,7 @@ yyreduce: case 18: /* Line 1464 of yacc.c */ -#line 237 "libmemcached/options/parser.yy" +#line 230 "libmemcached/options/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (4)].distribution))) != MEMCACHED_SUCCESS) { @@ -1675,7 +1668,7 @@ yyreduce: case 19: /* Line 1464 of yacc.c */ -#line 248 "libmemcached/options/parser.yy" +#line 241 "libmemcached/options/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_HASH, (yyvsp[(2) - (2)].hash))) != MEMCACHED_SUCCESS) { @@ -1687,7 +1680,7 @@ yyreduce: case 20: /* Line 1464 of yacc.c */ -#line 255 "libmemcached/options/parser.yy" +#line 248 "libmemcached/options/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (2)].behavior), (yyvsp[(2) - (2)].number))) != MEMCACHED_SUCCESS) { @@ -1699,7 +1692,7 @@ yyreduce: case 21: /* Line 1464 of yacc.c */ -#line 262 "libmemcached/options/parser.yy" +#line 255 "libmemcached/options/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (1)].behavior), true)) != MEMCACHED_SUCCESS) { @@ -1711,7 +1704,7 @@ yyreduce: case 22: /* Line 1464 of yacc.c */ -#line 269 "libmemcached/options/parser.yy" +#line 262 "libmemcached/options/parser.yy" { ;} break; @@ -1719,7 +1712,7 @@ yyreduce: case 23: /* Line 1464 of yacc.c */ -#line 275 "libmemcached/options/parser.yy" +#line 268 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT; ;} @@ -1728,7 +1721,7 @@ yyreduce: case 24: /* Line 1464 of yacc.c */ -#line 279 "libmemcached/options/parser.yy" +#line 272 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK; ;} @@ -1737,7 +1730,7 @@ yyreduce: case 25: /* Line 1464 of yacc.c */ -#line 283 "libmemcached/options/parser.yy" +#line 276 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK; ;} @@ -1746,7 +1739,7 @@ yyreduce: case 26: /* Line 1464 of yacc.c */ -#line 287 "libmemcached/options/parser.yy" +#line 280 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH; ;} @@ -1755,7 +1748,7 @@ yyreduce: case 27: /* Line 1464 of yacc.c */ -#line 291 "libmemcached/options/parser.yy" +#line 284 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS; ;} @@ -1764,7 +1757,7 @@ yyreduce: case 28: /* Line 1464 of yacc.c */ -#line 295 "libmemcached/options/parser.yy" +#line 288 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT; ;} @@ -1773,7 +1766,7 @@ yyreduce: case 29: /* Line 1464 of yacc.c */ -#line 299 "libmemcached/options/parser.yy" +#line 292 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT; ;} @@ -1782,7 +1775,7 @@ yyreduce: case 30: /* Line 1464 of yacc.c */ -#line 303 "libmemcached/options/parser.yy" +#line 296 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT; ;} @@ -1791,7 +1784,7 @@ yyreduce: case 31: /* Line 1464 of yacc.c */ -#line 307 "libmemcached/options/parser.yy" +#line 300 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT; ;} @@ -1800,7 +1793,7 @@ yyreduce: case 32: /* Line 1464 of yacc.c */ -#line 311 "libmemcached/options/parser.yy" +#line 304 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SND_TIMEOUT; ;} @@ -1809,7 +1802,7 @@ yyreduce: case 33: /* Line 1464 of yacc.c */ -#line 315 "libmemcached/options/parser.yy" +#line 308 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE; ;} @@ -1818,7 +1811,7 @@ yyreduce: case 34: /* Line 1464 of yacc.c */ -#line 319 "libmemcached/options/parser.yy" +#line 312 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE; ;} @@ -1827,7 +1820,7 @@ yyreduce: case 35: /* Line 1464 of yacc.c */ -#line 326 "libmemcached/options/parser.yy" +#line 319 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS; ;} @@ -1836,7 +1829,7 @@ yyreduce: case 36: /* Line 1464 of yacc.c */ -#line 330 "libmemcached/options/parser.yy" +#line 323 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL; ;} @@ -1845,7 +1838,7 @@ yyreduce: case 37: /* Line 1464 of yacc.c */ -#line 334 "libmemcached/options/parser.yy" +#line 327 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS; ;} @@ -1854,7 +1847,7 @@ yyreduce: case 38: /* Line 1464 of yacc.c */ -#line 338 "libmemcached/options/parser.yy" +#line 331 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_CACHE_LOOKUPS; ;} @@ -1863,7 +1856,7 @@ yyreduce: case 39: /* Line 1464 of yacc.c */ -#line 342 "libmemcached/options/parser.yy" +#line 335 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY; ;} @@ -1872,7 +1865,7 @@ yyreduce: case 40: /* Line 1464 of yacc.c */ -#line 346 "libmemcached/options/parser.yy" +#line 339 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED; ;} @@ -1881,7 +1874,7 @@ yyreduce: case 41: /* Line 1464 of yacc.c */ -#line 350 "libmemcached/options/parser.yy" +#line 343 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_NOREPLY; ;} @@ -1890,7 +1883,7 @@ yyreduce: case 42: /* Line 1464 of yacc.c */ -#line 354 "libmemcached/options/parser.yy" +#line 347 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ; ;} @@ -1899,7 +1892,7 @@ yyreduce: case 43: /* Line 1464 of yacc.c */ -#line 358 "libmemcached/options/parser.yy" +#line 351 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SORT_HOSTS; ;} @@ -1908,7 +1901,7 @@ yyreduce: case 44: /* Line 1464 of yacc.c */ -#line 362 "libmemcached/options/parser.yy" +#line 355 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SUPPORT_CAS; ;} @@ -1917,7 +1910,7 @@ yyreduce: case 45: /* Line 1464 of yacc.c */ -#line 366 "libmemcached/options/parser.yy" +#line 359 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_NODELAY; ;} @@ -1926,7 +1919,7 @@ yyreduce: case 46: /* Line 1464 of yacc.c */ -#line 370 "libmemcached/options/parser.yy" +#line 363 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE; ;} @@ -1935,7 +1928,7 @@ yyreduce: case 47: /* Line 1464 of yacc.c */ -#line 374 "libmemcached/options/parser.yy" +#line 367 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE; ;} @@ -1944,7 +1937,7 @@ yyreduce: case 48: /* Line 1464 of yacc.c */ -#line 378 "libmemcached/options/parser.yy" +#line 371 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_USE_UDP; ;} @@ -1953,7 +1946,7 @@ yyreduce: case 49: /* Line 1464 of yacc.c */ -#line 382 "libmemcached/options/parser.yy" +#line 375 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_VERIFY_KEY; ;} @@ -1962,7 +1955,7 @@ yyreduce: case 50: /* Line 1464 of yacc.c */ -#line 389 "libmemcached/options/parser.yy" +#line 382 "libmemcached/options/parser.yy" { if ((context->rc= memcached_server_add_parsed(context->memc, (yyvsp[(1) - (1)].server).c_str, (yyvsp[(1) - (1)].server).length, (yyvsp[(1) - (1)].server).port, 0)) != MEMCACHED_SUCCESS) { @@ -1974,7 +1967,7 @@ yyreduce: case 51: /* Line 1464 of yacc.c */ -#line 396 "libmemcached/options/parser.yy" +#line 389 "libmemcached/options/parser.yy" { if ((context->rc= memcached_server_add_parsed(context->memc, (yyvsp[(3) - (3)].server).c_str, (yyvsp[(3) - (3)].server).length, (yyvsp[(3) - (3)].server).port, 0)) != MEMCACHED_SUCCESS) { @@ -1986,7 +1979,7 @@ yyreduce: case 52: /* Line 1464 of yacc.c */ -#line 406 "libmemcached/options/parser.yy" +#line 399 "libmemcached/options/parser.yy" { (yyval.server).c_str= (yyvsp[(1) - (2)].string).c_str; (yyval.server).length= (yyvsp[(1) - (2)].string).length -1; // -1 to remove : @@ -1997,7 +1990,7 @@ yyreduce: case 53: /* Line 1464 of yacc.c */ -#line 412 "libmemcached/options/parser.yy" +#line 405 "libmemcached/options/parser.yy" { (yyval.server).c_str= (yyvsp[(1) - (1)].string).c_str; (yyval.server).length= (yyvsp[(1) - (1)].string).length; @@ -2008,7 +2001,7 @@ yyreduce: case 54: /* Line 1464 of yacc.c */ -#line 418 "libmemcached/options/parser.yy" +#line 411 "libmemcached/options/parser.yy" { (yyval.server).c_str= (yyvsp[(1) - (1)].string).c_str; (yyval.server).length= (yyvsp[(1) - (1)].string).length; @@ -2019,7 +2012,7 @@ yyreduce: case 55: /* Line 1464 of yacc.c */ -#line 424 "libmemcached/options/parser.yy" +#line 417 "libmemcached/options/parser.yy" { (yyval.server).c_str= (yyvsp[(1) - (2)].string).c_str; (yyval.server).length= (yyvsp[(1) - (2)].string).length -1; // -1 to remove : @@ -2030,7 +2023,7 @@ yyreduce: case 56: /* Line 1464 of yacc.c */ -#line 430 "libmemcached/options/parser.yy" +#line 423 "libmemcached/options/parser.yy" { (yyval.server).c_str= (yyvsp[(1) - (1)].string).c_str; (yyval.server).length= (yyvsp[(1) - (1)].string).length; @@ -2041,7 +2034,7 @@ yyreduce: case 57: /* Line 1464 of yacc.c */ -#line 439 "libmemcached/options/parser.yy" +#line 432 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_MD5; ;} @@ -2050,7 +2043,7 @@ yyreduce: case 58: /* Line 1464 of yacc.c */ -#line 443 "libmemcached/options/parser.yy" +#line 436 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_CRC; ;} @@ -2059,7 +2052,7 @@ yyreduce: case 59: /* Line 1464 of yacc.c */ -#line 447 "libmemcached/options/parser.yy" +#line 440 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1_64; ;} @@ -2068,7 +2061,7 @@ yyreduce: case 60: /* Line 1464 of yacc.c */ -#line 451 "libmemcached/options/parser.yy" +#line 444 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1A_64; ;} @@ -2077,7 +2070,7 @@ yyreduce: case 61: /* Line 1464 of yacc.c */ -#line 455 "libmemcached/options/parser.yy" +#line 448 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1_32; ;} @@ -2086,7 +2079,7 @@ yyreduce: case 62: /* Line 1464 of yacc.c */ -#line 459 "libmemcached/options/parser.yy" +#line 452 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1A_32; ;} @@ -2095,7 +2088,7 @@ yyreduce: case 63: /* Line 1464 of yacc.c */ -#line 463 "libmemcached/options/parser.yy" +#line 456 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_HSIEH; ;} @@ -2104,7 +2097,7 @@ yyreduce: case 64: /* Line 1464 of yacc.c */ -#line 467 "libmemcached/options/parser.yy" +#line 460 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_MURMUR; ;} @@ -2113,7 +2106,7 @@ yyreduce: case 65: /* Line 1464 of yacc.c */ -#line 471 "libmemcached/options/parser.yy" +#line 464 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_JENKINS; ;} @@ -2122,7 +2115,7 @@ yyreduce: case 66: /* Line 1464 of yacc.c */ -#line 478 "libmemcached/options/parser.yy" +#line 471 "libmemcached/options/parser.yy" { (yyval.string)= (yyvsp[(1) - (1)].string); ;} @@ -2131,7 +2124,7 @@ yyreduce: case 67: /* Line 1464 of yacc.c */ -#line 482 "libmemcached/options/parser.yy" +#line 475 "libmemcached/options/parser.yy" { (yyval.string).c_str= (yyvsp[(1) - (1)].string).c_str +1; // +1 to move use passed the initial quote (yyval.string).length= (yyvsp[(1) - (1)].string).length -1; // -1 removes the end quote @@ -2141,7 +2134,7 @@ yyreduce: case 68: /* Line 1464 of yacc.c */ -#line 490 "libmemcached/options/parser.yy" +#line 483 "libmemcached/options/parser.yy" { (yyval.distribution)= MEMCACHED_DISTRIBUTION_CONSISTENT; ;} @@ -2150,7 +2143,7 @@ yyreduce: case 69: /* Line 1464 of yacc.c */ -#line 494 "libmemcached/options/parser.yy" +#line 487 "libmemcached/options/parser.yy" { (yyval.distribution)= MEMCACHED_DISTRIBUTION_MODULA; ;} @@ -2159,7 +2152,7 @@ yyreduce: case 70: /* Line 1464 of yacc.c */ -#line 498 "libmemcached/options/parser.yy" +#line 491 "libmemcached/options/parser.yy" { (yyval.distribution)= MEMCACHED_DISTRIBUTION_RANDOM; ;} @@ -2168,7 +2161,7 @@ yyreduce: /* Line 1464 of yacc.c */ -#line 2172 "libmemcached/options/parser.cc" +#line 2165 "libmemcached/options/parser.cc" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2379,3 +2372,13 @@ yyreturn: +/* Line 1684 of yacc.c */ +#line 496 "libmemcached/options/parser.yy" + + +void Context::start() +{ + config_parse(this, (void **)scanner); +} + +