From: Brian Aker Date: Sun, 27 Mar 2011 03:03:19 +0000 (-0700) Subject: Merge in parser adjustment so that = now belongs to the actual parser. X-Git-Tag: 0.51~15^2~69 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=8ddd817cd74d85db3f945920fb02f4cc4daa8050;p=awesomized%2Flibmemcached Merge in parser adjustment so that = now belongs to the actual parser. --- diff --git a/libmemcached/options/parser.yy b/libmemcached/options/parser.yy index 31371c1b..6071a99b 100644 --- a/libmemcached/options/parser.yy +++ b/libmemcached/options/parser.yy @@ -203,19 +203,19 @@ statement: expression: - SERVER '=' server + SERVER server { - if ((context->rc= memcached_server_add_parsed(context->memc, $3.c_str, $3.length, $3.port, 0)) != MEMCACHED_SUCCESS) + if ((context->rc= memcached_server_add_parsed(context->memc, $2.c_str, $2.length, $2.port, 0)) != MEMCACHED_SUCCESS) { parser_abort(context, NULL); } } - | SERVERS_OPTION '=' server_list + | SERVERS_OPTION server_list { } - | CONFIGURE_FILE '=' string + | CONFIGURE_FILE string { - memcached_set_configuration_file(context->memc, $3.c_str, $3.length); + memcached_set_configuration_file(context->memc, $2.c_str, $2.length); } | behaviors ; @@ -249,9 +249,9 @@ behaviors: parser_abort(context, NULL);; } } - | behavior_number '=' NUMBER + | behavior_number NUMBER { - if ((context->rc= memcached_behavior_set(context->memc, $1, $3)) != MEMCACHED_SUCCESS) + if ((context->rc= memcached_behavior_set(context->memc, $1, $2)) != MEMCACHED_SUCCESS) { parser_abort(context, NULL);; } diff --git a/libmemcached/options/scanner.l b/libmemcached/options/scanner.l index 6e58f3f8..81b9acd8 100644 --- a/libmemcached/options/scanner.l +++ b/libmemcached/options/scanner.l @@ -85,8 +85,8 @@ static void get_lex_chars(char* buffer, int& result, int max_size, Context *cont return COMMENT; } -"--SERVER" { yyextra->begin= yytext; return SERVER; } -"--SERVERS" { yyextra->begin= yytext; return SERVERS_OPTION; } +"--SERVER=" { yyextra->begin= yytext; return SERVER; } +"--SERVERS=" { yyextra->begin= yytext; return SERVERS_OPTION; } "--VERIFY_KEY" { yyextra->begin= yytext; return VERIFY_KEY; } "--VERIFY-KEY" { yyextra->begin= yytext; return VERIFY_KEY; } @@ -98,45 +98,45 @@ static void get_lex_chars(char* buffer, int& result, int max_size, Context *cont "--BUFFER-REQUESTS" { yyextra->begin= yytext; return BUFFER_REQUESTS; } "--CACHE_LOOKUPS" { yyextra->begin= yytext; return CACHE_LOOKUPS; } "--CACHE-LOOKUPS" { yyextra->begin= yytext; return CACHE_LOOKUPS; } -"--CONFIGURE_FILE" { yyextra->begin= yytext; return CONFIGURE_FILE; } -"--CONFIGURE-FILE" { yyextra->begin= yytext; return CONFIGURE_FILE; } -"--CONNECT_TIMEOUT" { yyextra->begin= yytext; return CONNECT_TIMEOUT; } -"--CONNECT-TIMEOUT" { yyextra->begin= yytext; return CONNECT_TIMEOUT; } +"--CONFIGURE_FILE=" { yyextra->begin= yytext; return CONFIGURE_FILE; } +"--CONFIGURE-FILE=" { yyextra->begin= yytext; return CONFIGURE_FILE; } +"--CONNECT_TIMEOUT=" { yyextra->begin= yytext; return CONNECT_TIMEOUT; } +"--CONNECT-TIMEOUT=" { yyextra->begin= yytext; return CONNECT_TIMEOUT; } "--CORK" { yyextra->begin= yytext; return _CORK; } "--DISTRIBUTION=" { yyextra->begin= yytext; return DISTRIBUTION; } "--HASH=" { yyextra->begin= yytext; return HASH; } "--HASH_WITH_PREFIX_KEY" { yyextra->begin= yytext; return HASH_WITH_PREFIX_KEY; } "--HASH-WITH-PREFIX_KEY" { yyextra->begin= yytext; return HASH_WITH_PREFIX_KEY; } -"--IO_BYTES_WATERMARK" { yyextra->begin= yytext; return IO_BYTES_WATERMARK; } -"--IO-BYTES-WATERMARK" { yyextra->begin= yytext; return IO_BYTES_WATERMARK; } -"--IO_KEY_PREFETCH" { yyextra->begin= yytext; return IO_KEY_PREFETCH; } -"--IO-KEY-PREFETCH" { yyextra->begin= yytext; return IO_KEY_PREFETCH; } -"--IO_MSG_WATERMARK" { yyextra->begin= yytext; return IO_MSG_WATERMARK; } -"--IO-MSG-WATERMARK" { yyextra->begin= yytext; return IO_MSG_WATERMARK; } +"--IO_BYTES_WATERMARK=" { yyextra->begin= yytext; return IO_BYTES_WATERMARK; } +"--IO-BYTES-WATERMARK=" { yyextra->begin= yytext; return IO_BYTES_WATERMARK; } +"--IO_KEY_PREFETCH=" { yyextra->begin= yytext; return IO_KEY_PREFETCH; } +"--IO-KEY-PREFETCH=" { yyextra->begin= yytext; return IO_KEY_PREFETCH; } +"--IO_MSG_WATERMARK=" { yyextra->begin= yytext; return IO_MSG_WATERMARK; } +"--IO-MSG-WATERMARK=" { yyextra->begin= yytext; return IO_MSG_WATERMARK; } "--KETAMA" { yyextra->begin= yytext; return KETAMA; } "--KETAMA_HASH=" { yyextra->begin= yytext; return KETAMA_HASH; } "--KETAMA-HASH=" { yyextra->begin= yytext; return KETAMA_HASH; } "--KETAMA_WEIGHTED" { yyextra->begin= yytext; return KETAMA_WEIGHTED; } "--KETAMA-WEIGHTED" { yyextra->begin= yytext; return KETAMA_WEIGHTED; } "--NOREPLY" { yyextra->begin= yytext; return NOREPLY; } -"--NUMBER_OF_REPLICAS" { yyextra->begin= yytext; return NUMBER_OF_REPLICAS; } -"--NUMBER-OF-REPLICAS" { yyextra->begin= yytext; return NUMBER_OF_REPLICAS; } -"--POLL_TIMEOUT" { yyextra->begin= yytext; return POLL_TIMEOUT; } -"--POLL-TIMEOUT" { yyextra->begin= yytext; return POLL_TIMEOUT; } +"--NUMBER_OF_REPLICAS=" { yyextra->begin= yytext; return NUMBER_OF_REPLICAS; } +"--NUMBER-OF-REPLICAS=" { yyextra->begin= yytext; return NUMBER_OF_REPLICAS; } +"--POLL_TIMEOUT=" { yyextra->begin= yytext; return POLL_TIMEOUT; } +"--POLL-TIMEOUT=" { yyextra->begin= yytext; return POLL_TIMEOUT; } "--RANDOMIZE_REPLICA_READ" { yyextra->begin= yytext; return RANDOMIZE_REPLICA_READ; } "--RANDOMIZE-REPLICA-READ" { yyextra->begin= yytext; return RANDOMIZE_REPLICA_READ; } -"--RCV_TIMEOUT" { yyextra->begin= yytext; return RCV_TIMEOUT; } -"--RCV-TIMEOUT" { yyextra->begin= yytext; return RCV_TIMEOUT; } -"--RETRY_TIMEOUT" { yyextra->begin= yytext; return RETRY_TIMEOUT; } -"--RETRY-TIMEOUT" { yyextra->begin= yytext; return RETRY_TIMEOUT; } -"--SERVER_FAILURE_LIMIT" { yyextra->begin= yytext; return SERVER_FAILURE_LIMIT; } -"--SERVER-FAILURE-LIMIT" { yyextra->begin= yytext; return SERVER_FAILURE_LIMIT; } -"--SND_TIMEOUT" { yyextra->begin= yytext; return SND_TIMEOUT; } -"--SND-TIMEOUT" { yyextra->begin= yytext; return SND_TIMEOUT; } -"--SOCKET_RECV_SIZE" { yyextra->begin= yytext; return SOCKET_RECV_SIZE; } -"--SOCKET-RECV-SIZE" { yyextra->begin= yytext; return SOCKET_RECV_SIZE; } -"--SOCKET_SEND_SIZE" { yyextra->begin= yytext; return SOCKET_SEND_SIZE; } -"--SOCKET-SEND-SIZE" { yyextra->begin= yytext; return SOCKET_SEND_SIZE; } +"--RCV_TIMEOUT=" { yyextra->begin= yytext; return RCV_TIMEOUT; } +"--RCV-TIMEOUT=" { yyextra->begin= yytext; return RCV_TIMEOUT; } +"--RETRY_TIMEOUT=" { yyextra->begin= yytext; return RETRY_TIMEOUT; } +"--RETRY-TIMEOUT=" { yyextra->begin= yytext; return RETRY_TIMEOUT; } +"--SERVER_FAILURE_LIMIT=" { yyextra->begin= yytext; return SERVER_FAILURE_LIMIT; } +"--SERVER-FAILURE-LIMIT=" { yyextra->begin= yytext; return SERVER_FAILURE_LIMIT; } +"--SND_TIMEOUT=" { yyextra->begin= yytext; return SND_TIMEOUT; } +"--SND-TIMEOUT=" { yyextra->begin= yytext; return SND_TIMEOUT; } +"--SOCKET_RECV_SIZE=" { yyextra->begin= yytext; return SOCKET_RECV_SIZE; } +"--SOCKET-RECV-SIZE=" { yyextra->begin= yytext; return SOCKET_RECV_SIZE; } +"--SOCKET_SEND_SIZE=" { yyextra->begin= yytext; return SOCKET_SEND_SIZE; } +"--SOCKET-SEND-SIZE=" { yyextra->begin= yytext; return SOCKET_SEND_SIZE; } "--SORT_HOSTS" { yyextra->begin= yytext; return SORT_HOSTS; } "--SORT-HOSTS" { yyextra->begin= yytext; return SORT_HOSTS; } "--SUPPORT_CAS" { yyextra->begin= yytext; return SUPPORT_CAS; }