+ | SERVER IPADDRESS optional_port optional_weight
+ {
+ if (memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, $2.c_str, $3, $4)))
+ {
+ parser_abort(context, NULL);
+ }
+ context->unset_server();
+ }
+ | CONFIGURE_FILE string
+ {
+ memcached_set_configuration_file(context->memc, $2.c_str, $2.size);
+ }
+ | POOL_MIN NUMBER
+ {
+ context->memc->configure.initial_pool_size= $2;
+ }
+ | POOL_MAX NUMBER
+ {
+ context->memc->configure.max_pool_size= $2;
+ }
+ | behaviors
+ ;
+
+behaviors:
+ NAMESPACE string
+ {
+ if ((context->rc= memcached_set_prefix_key(context->memc, $2.c_str, $2.size)) != MEMCACHED_SUCCESS)
+ {
+ parser_abort(context, NULL);;
+ }
+ }
+ | DISTRIBUTION distribution
+ {
+ if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, $2)) != MEMCACHED_SUCCESS)
+ {
+ parser_abort(context, NULL);;
+ }
+ }
+ | DISTRIBUTION distribution ',' hash
+ {
+ if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, $2)) != MEMCACHED_SUCCESS)
+ {
+ parser_abort(context, NULL);;
+ }
+ if ((context->rc= memcached_behavior_set_distribution_hash(context->memc, $4)) != MEMCACHED_SUCCESS)
+ {
+ parser_abort(context, NULL);;
+ }
+ }
+ | HASH hash
+ {
+ if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_HASH, $2)) != MEMCACHED_SUCCESS)
+ {
+ parser_abort(context, NULL);;
+ }
+ }
+ | behavior_number NUMBER
+ {
+ if ((context->rc= memcached_behavior_set(context->memc, $1, $2)) != MEMCACHED_SUCCESS)
+ {
+ parser_abort(context, NULL);;
+ }
+ }
+ | behavior_boolean