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
/* Line 264 of yacc.c */
-#line 227 "libmemcached/options/parser.cc"
+#line 220 "libmemcached/options/parser.cc"
#ifdef short
# undef short
/* 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
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;
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);
case 9:
/* Line 1464 of yacc.c */
-#line 186 "libmemcached/options/parser.yy"
+#line 179 "libmemcached/options/parser.yy"
{
memcached_reset(context->memc);
;}
case 10:
/* Line 1464 of yacc.c */
-#line 190 "libmemcached/options/parser.yy"
+#line 183 "libmemcached/options/parser.yy"
{
yydebug= 1;
;}
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)
{
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)
{
case 13:
/* Line 1464 of yacc.c */
-#line 212 "libmemcached/options/parser.yy"
+#line 205 "libmemcached/options/parser.yy"
{
;}
break;
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);
;}
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
case 22:
/* Line 1464 of yacc.c */
-#line 269 "libmemcached/options/parser.yy"
+#line 262 "libmemcached/options/parser.yy"
{
;}
break;
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
case 41:
/* Line 1464 of yacc.c */
-#line 350 "libmemcached/options/parser.yy"
+#line 343 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_NOREPLY;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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;
;}
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)
{
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)
{
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 :
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;
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;
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 :
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;
case 57:
/* Line 1464 of yacc.c */
-#line 439 "libmemcached/options/parser.yy"
+#line 432 "libmemcached/options/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_MD5;
;}
case 58:
/* Line 1464 of yacc.c */
-#line 443 "libmemcached/options/parser.yy"
+#line 436 "libmemcached/options/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_CRC;
;}
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;
;}
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;
;}
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;
;}
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;
;}
case 63:
/* Line 1464 of yacc.c */
-#line 463 "libmemcached/options/parser.yy"
+#line 456 "libmemcached/options/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_HSIEH;
;}
case 64:
/* Line 1464 of yacc.c */
-#line 467 "libmemcached/options/parser.yy"
+#line 460 "libmemcached/options/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_MURMUR;
;}
case 65:
/* Line 1464 of yacc.c */
-#line 471 "libmemcached/options/parser.yy"
+#line 464 "libmemcached/options/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_JENKINS;
;}
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);
;}
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
case 68:
/* Line 1464 of yacc.c */
-#line 490 "libmemcached/options/parser.yy"
+#line 483 "libmemcached/options/parser.yy"
{
(yyval.distribution)= MEMCACHED_DISTRIBUTION_CONSISTENT;
;}
case 69:
/* Line 1464 of yacc.c */
-#line 494 "libmemcached/options/parser.yy"
+#line 487 "libmemcached/options/parser.yy"
{
(yyval.distribution)= MEMCACHED_DISTRIBUTION_MODULA;
;}
case 70:
/* Line 1464 of yacc.c */
-#line 498 "libmemcached/options/parser.yy"
+#line 491 "libmemcached/options/parser.yy"
{
(yyval.distribution)= MEMCACHED_DISTRIBUTION_RANDOM;
;}
/* 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);
+/* Line 1684 of yacc.c */
+#line 496 "libmemcached/options/parser.yy"
+
+
+void Context::start()
+{
+ config_parse(this, (void **)scanner);
+}
+
+