Merge in parser adjustment so that = now belongs to the actual parser.
authorBrian Aker <brian@tangent.org>
Sun, 27 Mar 2011 03:03:19 +0000 (20:03 -0700)
committerBrian Aker <brian@tangent.org>
Sun, 27 Mar 2011 03:03:19 +0000 (20:03 -0700)
libmemcached/options/parser.yy
libmemcached/options/scanner.l

index 31371c1b6e388f3975d925e73b86c3499c7f74ed..6071a99bd02c83087c3259b94870a69d6c090646 100644 (file)
@@ -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);;
             }
index 6e58f3f84fcfd1a0570375e647304557c9e20641..81b9acd8c4afba47b54edea102cbaaa00d8cecb7 100644 (file)
@@ -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; }