1 /* A Bison parser, made by GNU Bison 2.4.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6 2009, 2010 Free Software Foundation, Inc.
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
44 /* Identify Bison output. */
48 #define YYBISON_VERSION "2.4.3"
51 #define YYSKELETON_NAME "yacc.c"
62 /* Using locations. */
63 #define YYLSP_NEEDED 0
65 /* Substitute the variable and function names. */
66 #define yyparse config_parse
67 #define yylex config_lex
68 #define yyerror config_error
69 #define yylval config_lval
70 #define yychar config_char
71 #define yydebug config_debug
72 #define yynerrs config_nerrs
75 /* Copy the first part of user declarations. */
77 /* Line 189 of yacc.c */
78 #line 36 "libmemcached/options/parser.yy"
85 #include <libmemcached/common.h>
86 #include <libmemcached/options.hpp>
88 #include <libmemcached/options/context.h>
89 #include <libmemcached/options/symbol.h>
90 #include <libmemcached/options/scanner.h>
94 #pragma GCC diagnostic ignored "-Wold-style-cast"
96 int conf_lex(YYSTYPE
* lvalp
, void* scanner
);
98 #define parser_abort(A, B) do { (A)->abort((B)); YYABORT; } while (0)
100 inline void config_error(Context
*context
, yyscan_t
*scanner
, const char *error
)
102 if (not context
->end())
103 context
->abort(error
);
108 /* Line 189 of yacc.c */
109 #line 110 "libmemcached/options/parser.cc"
111 /* Enabling traces. */
116 /* Enabling verbose error messages. */
117 #ifdef YYERROR_VERBOSE
118 # undef YYERROR_VERBOSE
119 # define YYERROR_VERBOSE 1
121 # define YYERROR_VERBOSE 1
124 /* Enabling the token table. */
125 #ifndef YYTOKEN_TABLE
126 # define YYTOKEN_TABLE 0
133 /* Put the tokens into the symbol table, so that GDB and other debuggers
142 CONFIGURE_FILE
= 264,
147 SERVERS_OPTION
= 269,
148 UNKNOWN_OPTION
= 270,
150 BINARY_PROTOCOL
= 272,
151 BUFFER_REQUESTS
= 273,
152 CONNECT_TIMEOUT
= 274,
155 HASH_WITH_NAMESPACE
= 277,
156 IO_BYTES_WATERMARK
= 278,
157 IO_KEY_PREFETCH
= 279,
158 IO_MSG_WATERMARK
= 280,
160 KETAMA_WEIGHTED
= 282,
162 NUMBER_OF_REPLICAS
= 284,
164 RANDOMIZE_REPLICA_READ
= 286,
166 REMOVE_FAILED_SERVERS
= 288,
169 SOCKET_RECV_SIZE
= 291,
170 SOCKET_SEND_SIZE
= 292,
176 _TCP_KEEPALIVE
= 298,
210 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
212 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
213 # define YYSTYPE_IS_DECLARED 1
217 /* Copy the second part of user declarations. */
220 /* Line 264 of yacc.c */
221 #line 222 "libmemcached/options/parser.cc"
228 typedef YYTYPE_UINT8 yytype_uint8
;
230 typedef unsigned char yytype_uint8
;
234 typedef YYTYPE_INT8 yytype_int8
;
235 #elif (defined __STDC__ || defined __C99__FUNC__ \
236 || defined __cplusplus || defined _MSC_VER)
237 typedef signed char yytype_int8
;
239 typedef short int yytype_int8
;
243 typedef YYTYPE_UINT16 yytype_uint16
;
245 typedef unsigned short int yytype_uint16
;
249 typedef YYTYPE_INT16 yytype_int16
;
251 typedef short int yytype_int16
;
255 # ifdef __SIZE_TYPE__
256 # define YYSIZE_T __SIZE_TYPE__
257 # elif defined size_t
258 # define YYSIZE_T size_t
259 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
260 || defined __cplusplus || defined _MSC_VER)
261 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
262 # define YYSIZE_T size_t
264 # define YYSIZE_T unsigned int
268 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
271 # if defined YYENABLE_NLS && YYENABLE_NLS
273 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
274 # define YY_(msgid) dgettext ("bison-runtime", msgid)
278 # define YY_(msgid) msgid
282 /* Suppress unused-variable warnings by "using" E. */
283 #if ! defined lint || defined __GNUC__
284 # define YYUSE(e) ((void) (e))
286 # define YYUSE(e) /* empty */
289 /* Identity function, used to suppress warnings about constant conditions. */
293 #if (defined __STDC__ || defined __C99__FUNC__ \
294 || defined __cplusplus || defined _MSC_VER)
307 #if ! defined yyoverflow || YYERROR_VERBOSE
309 /* The parser invokes alloca or malloc; define the necessary symbols. */
311 # ifdef YYSTACK_USE_ALLOCA
312 # if YYSTACK_USE_ALLOCA
314 # define YYSTACK_ALLOC __builtin_alloca
315 # elif defined __BUILTIN_VA_ARG_INCR
316 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
318 # define YYSTACK_ALLOC __alloca
319 # elif defined _MSC_VER
320 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
321 # define alloca _alloca
323 # define YYSTACK_ALLOC alloca
324 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
325 || defined __cplusplus || defined _MSC_VER)
326 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
335 # ifdef YYSTACK_ALLOC
336 /* Pacify GCC's `empty if-body' warning. */
337 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
338 # ifndef YYSTACK_ALLOC_MAXIMUM
339 /* The OS might guarantee only one guard page at the bottom of the stack,
340 and a page size can be as small as 4096 bytes. So we cannot safely
341 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
342 to allow for a few compiler-allocated temporary stack slots. */
343 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
346 # define YYSTACK_ALLOC YYMALLOC
347 # define YYSTACK_FREE YYFREE
348 # ifndef YYSTACK_ALLOC_MAXIMUM
349 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
351 # if (defined __cplusplus && ! defined _STDLIB_H \
352 && ! ((defined YYMALLOC || defined malloc) \
353 && (defined YYFREE || defined free)))
354 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
360 # define YYMALLOC malloc
361 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
362 || defined __cplusplus || defined _MSC_VER)
363 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
368 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
369 || defined __cplusplus || defined _MSC_VER)
370 void free (void *); /* INFRINGES ON USER NAME SPACE */
374 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
377 #if (! defined yyoverflow \
378 && (! defined __cplusplus \
379 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
381 /* A type that is properly aligned for any stack member. */
384 yytype_int16 yyss_alloc
;
388 /* The size of the maximum gap between one aligned stack and the next. */
389 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
391 /* The size of an array large to enough to hold all stacks, each with
393 # define YYSTACK_BYTES(N) \
394 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
395 + YYSTACK_GAP_MAXIMUM)
397 /* Copy COUNT objects from FROM to TO. The source and destination do
400 # if defined __GNUC__ && 1 < __GNUC__
401 # define YYCOPY(To, From, Count) \
402 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
404 # define YYCOPY(To, From, Count) \
408 for (yyi = 0; yyi < (Count); yyi++) \
409 (To)[yyi] = (From)[yyi]; \
415 /* Relocate STACK from its old location to the new one. The
416 local variables YYSIZE and YYSTACKSIZE give the old and new number of
417 elements in the stack, and YYPTR gives the new location of the
418 stack. Advance YYPTR to a properly aligned location for the next
420 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
423 YYSIZE_T yynewbytes; \
424 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
425 Stack = &yyptr->Stack_alloc; \
426 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
427 yyptr += yynewbytes / sizeof (*yyptr); \
433 /* YYFINAL -- State number of the termination state. */
435 /* YYLAST -- Last index in YYTABLE. */
438 /* YYNTOKENS -- Number of terminals. */
440 /* YYNNTS -- Number of nonterminals. */
442 /* YYNRULES -- Number of rules. */
444 /* YYNRULES -- Number of states. */
447 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
449 #define YYMAXUTOK 326
451 #define YYTRANSLATE(YYX) \
452 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
454 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
455 static const yytype_uint8 yytranslate
[] =
457 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 74, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 63, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 64, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
481 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
482 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
483 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
484 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
485 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
486 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
487 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
488 55, 56, 57, 58, 59, 60, 61, 62, 65, 66,
489 67, 68, 69, 70, 71, 72, 73
493 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
495 static const yytype_uint8 yyprhs
[] =
497 0, 0, 3, 5, 9, 11, 13, 15, 17, 19,
498 21, 23, 27, 32, 37, 40, 43, 46, 49, 51,
499 54, 57, 62, 65, 68, 70, 72, 74, 76, 78,
500 80, 82, 84, 86, 88, 90, 92, 94, 96, 98,
501 100, 102, 104, 106, 108, 110, 112, 114, 116, 118,
502 120, 121, 123, 124, 126, 128, 130, 132, 134, 136,
503 138, 140, 142, 144, 146, 148, 150, 152
506 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
507 static const yytype_int8 yyrhs
[] =
509 76, 0, -1, 77, -1, 76, 74, 77, -1, 78,
510 -1, 3, -1, 10, -1, 4, -1, 5, -1, 6,
511 -1, 7, -1, 8, 74, 85, -1, 11, 70, 82,
512 83, -1, 11, 69, 82, 83, -1, 12, 85, -1,
513 9, 85, -1, 47, 66, -1, 48, 66, -1, 79,
514 -1, 46, 85, -1, 20, 86, -1, 20, 86, 63,
515 84, -1, 21, 84, -1, 80, 66, -1, 81, -1,
516 40, -1, 33, -1, 19, -1, 25, -1, 23, -1,
517 24, -1, 29, -1, 30, -1, 32, -1, 34, -1,
518 35, -1, 36, -1, 37, -1, 17, -1, 18, -1,
519 22, -1, 28, -1, 31, -1, 38, -1, 39, -1,
520 45, -1, 43, -1, 44, -1, 41, -1, 42, -1,
521 -1, 67, -1, -1, 68, -1, 49, -1, 50, -1,
522 51, -1, 52, -1, 53, -1, 54, -1, 55, -1,
523 56, -1, 57, -1, 71, -1, 72, -1, 58, -1,
527 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
528 static const yytype_uint16 yyrline
[] =
530 0, 162, 162, 163, 167, 169, 171, 173, 178, 183,
531 187, 191, 202, 210, 218, 225, 229, 233, 237, 241,
532 248, 255, 266, 273, 280, 287, 293, 297, 301, 305,
533 309, 313, 317, 321, 325, 329, 333, 337, 344, 348,
534 352, 356, 360, 364, 368, 372, 376, 380, 384, 388,
535 395, 396, 401, 402, 407, 411, 415, 419, 423, 427,
536 431, 435, 439, 446, 450, 458, 462, 466
540 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
541 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
542 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
543 static const char *const yytname
[] =
545 "$end", "error", "$undefined", "COMMENT", "END", "ERROR", "RESET",
546 "PARSER_DEBUG", "INCLUDE", "CONFIGURE_FILE", "EMPTY_LINE", "SERVER",
547 "SOCKET", "SERVERS", "SERVERS_OPTION", "UNKNOWN_OPTION", "UNKNOWN",
548 "BINARY_PROTOCOL", "BUFFER_REQUESTS", "CONNECT_TIMEOUT", "DISTRIBUTION",
549 "HASH", "HASH_WITH_NAMESPACE", "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH",
550 "IO_MSG_WATERMARK", "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY",
551 "NUMBER_OF_REPLICAS", "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ",
552 "RCV_TIMEOUT", "REMOVE_FAILED_SERVERS", "RETRY_TIMEOUT", "SND_TIMEOUT",
553 "SOCKET_RECV_SIZE", "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS",
554 "USER_DATA", "USE_UDP", "VERIFY_KEY", "_TCP_KEEPALIVE", "_TCP_KEEPIDLE",
555 "_TCP_NODELAY", "NAMESPACE", "POOL_MIN", "POOL_MAX", "MD5", "CRC",
556 "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32", "HSIEH", "MURMUR",
557 "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE", "FALSE", "','",
558 "'='", "FLOAT", "NUMBER", "PORT", "WEIGHT_START", "IPADDRESS",
559 "HOSTNAME", "STRING", "QUOTED_STRING", "FILE_PATH", "' '", "$accept",
560 "begin", "statement", "expression", "behaviors", "behavior_number",
561 "behavior_boolean", "optional_port", "optional_weight", "hash", "string",
567 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
569 static const yytype_uint16 yytoknum
[] =
571 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
572 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
573 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
574 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
575 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
576 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
577 315, 316, 317, 44, 61, 318, 319, 320, 321, 322,
578 323, 324, 325, 326, 32
582 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
583 static const yytype_uint8 yyr1
[] =
585 0, 75, 76, 76, 77, 77, 77, 77, 77, 77,
586 77, 77, 78, 78, 78, 78, 78, 78, 78, 79,
587 79, 79, 79, 79, 79, 79, 80, 80, 80, 80,
588 80, 80, 80, 80, 80, 80, 80, 80, 81, 81,
589 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
590 82, 82, 83, 83, 84, 84, 84, 84, 84, 84,
591 84, 84, 84, 85, 85, 86, 86, 86
594 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
595 static const yytype_uint8 yyr2
[] =
597 0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
598 1, 3, 4, 4, 2, 2, 2, 2, 1, 2,
599 2, 4, 2, 2, 1, 1, 1, 1, 1, 1,
600 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
601 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
602 0, 1, 0, 1, 1, 1, 1, 1, 1, 1,
603 1, 1, 1, 1, 1, 1, 1, 1
606 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
607 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
608 means the default is an error. */
609 static const yytype_uint8 yydefact
[] =
611 0, 5, 7, 8, 9, 10, 0, 0, 6, 0,
612 0, 38, 39, 27, 0, 0, 40, 29, 30, 28,
613 41, 31, 32, 42, 33, 26, 34, 35, 36, 37,
614 43, 44, 25, 48, 49, 46, 47, 45, 0, 0,
615 0, 0, 2, 4, 18, 0, 24, 0, 63, 64,
616 15, 50, 50, 14, 65, 66, 67, 20, 54, 55,
617 56, 57, 58, 59, 60, 61, 62, 22, 19, 16,
618 17, 1, 0, 23, 11, 51, 52, 52, 0, 3,
622 /* YYDEFGOTO[NTERM-NUM]. */
623 static const yytype_int8 yydefgoto
[] =
625 -1, 41, 42, 43, 44, 45, 46, 76, 81, 67,
629 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
631 #define YYPACT_NINF -61
632 static const yytype_int8 yypact
[] =
634 -2, -61, -61, -61, -61, -61, -60, -24, -61, -20,
635 -24, -61, -61, -61, -47, 13, -61, -61, -61, -61,
636 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
637 -61, -61, -61, -61, -61, -61, -61, -61, -24, -41,
638 -15, 0, -61, -61, -61, -13, -61, -24, -61, -61,
639 -61, -12, -12, -61, -61, -61, -61, -9, -61, -61,
640 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
641 -61, -61, -2, -61, -61, -61, -11, -11, 13, -61,
645 /* YYPGOTO[NTERM-NUM]. */
646 static const yytype_int8 yypgoto
[] =
648 -61, -61, -16, -61, -61, -61, -61, 6, -18, -7,
652 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
653 positive, shift that token. If negative, reduce the rule which
654 number is the opposite. If zero, do what YYDEFACT says.
655 If YYTABLE_NINF, syntax error. */
656 #define YYTABLE_NINF -1
657 static const yytype_uint8 yytable
[] =
659 71, 1, 2, 3, 4, 5, 6, 7, 8, 9,
660 10, 54, 55, 56, 47, 11, 12, 13, 14, 15,
661 16, 17, 18, 19, 53, 69, 20, 21, 22, 23,
662 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
663 34, 35, 36, 37, 38, 39, 40, 48, 49, 51,
664 52, 70, 68, 73, 78, 75, 79, 80, 77, 82,
665 0, 74, 58, 59, 60, 61, 62, 63, 64, 65,
669 static const yytype_int8 yycheck
[] =
671 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
672 12, 58, 59, 60, 74, 17, 18, 19, 20, 21,
673 22, 23, 24, 25, 10, 66, 28, 29, 30, 31,
674 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
675 42, 43, 44, 45, 46, 47, 48, 71, 72, 69,
676 70, 66, 38, 66, 63, 67, 72, 68, 52, 77,
677 -1, 47, 49, 50, 51, 52, 53, 54, 55, 56,
681 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
682 symbol of state STATE-NUM. */
683 static const yytype_uint8 yystos
[] =
685 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
686 12, 17, 18, 19, 20, 21, 22, 23, 24, 25,
687 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
688 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
689 48, 76, 77, 78, 79, 80, 81, 74, 71, 72,
690 85, 69, 70, 85, 58, 59, 60, 86, 49, 50,
691 51, 52, 53, 54, 55, 56, 57, 84, 85, 66,
692 66, 0, 74, 66, 85, 67, 82, 82, 63, 77,
696 #define yyerrok (yyerrstatus = 0)
697 #define yyclearin (yychar = YYEMPTY)
701 #define YYACCEPT goto yyacceptlab
702 #define YYABORT goto yyabortlab
703 #define YYERROR goto yyerrorlab
706 /* Like YYERROR except do call yyerror. This remains here temporarily
707 to ease the transition to the new meaning of YYERROR, for GCC.
708 Once GCC version 2 has supplanted version 1, this can go. However,
709 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
710 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
713 #define YYFAIL goto yyerrlab
715 /* This is here to suppress warnings from the GCC cpp's
716 -Wunused-macros. Normally we don't worry about that warning, but
717 some users do, and we want to make it easy for users to remove
718 YYFAIL uses, which will produce warnings from Bison 2.5. */
721 #define YYRECOVERING() (!!yyerrstatus)
723 #define YYBACKUP(Token, Value) \
725 if (yychar == YYEMPTY && yylen == 1) \
729 yytoken = YYTRANSLATE (yychar); \
735 yyerror (context, scanner, YY_("syntax error: cannot back up")); \
742 #define YYERRCODE 256
745 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
746 If N is 0, then set CURRENT to the empty location which ends
747 the previous symbol: RHS[0] (always defined). */
749 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
750 #ifndef YYLLOC_DEFAULT
751 # define YYLLOC_DEFAULT(Current, Rhs, N) \
755 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
756 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
757 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
758 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
762 (Current).first_line = (Current).last_line = \
763 YYRHSLOC (Rhs, 0).last_line; \
764 (Current).first_column = (Current).last_column = \
765 YYRHSLOC (Rhs, 0).last_column; \
771 /* YY_LOCATION_PRINT -- Print the location on the stream.
772 This macro was not mandated originally: define only if we know
773 we won't break user code: when these are the locations we know. */
775 #ifndef YY_LOCATION_PRINT
776 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
777 # define YY_LOCATION_PRINT(File, Loc) \
778 fprintf (File, "%d.%d-%d.%d", \
779 (Loc).first_line, (Loc).first_column, \
780 (Loc).last_line, (Loc).last_column)
782 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
787 /* YYLEX -- calling `yylex' with the right arguments. */
790 # define YYLEX yylex (&yylval, YYLEX_PARAM)
792 # define YYLEX yylex (&yylval, scanner)
795 /* Enable debugging if requested. */
799 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
800 # define YYFPRINTF fprintf
803 # define YYDPRINTF(Args) \
809 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
813 YYFPRINTF (stderr, "%s ", Title); \
814 yy_symbol_print (stderr, \
815 Type, Value, context, scanner); \
816 YYFPRINTF (stderr, "\n"); \
821 /*--------------------------------.
822 | Print this symbol on YYOUTPUT. |
823 `--------------------------------*/
826 #if (defined __STDC__ || defined __C99__FUNC__ \
827 || defined __cplusplus || defined _MSC_VER)
829 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
832 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
835 YYSTYPE
const * const yyvaluep
;
845 if (yytype
< YYNTOKENS
)
846 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
858 /*--------------------------------.
859 | Print this symbol on YYOUTPUT. |
860 `--------------------------------*/
862 #if (defined __STDC__ || defined __C99__FUNC__ \
863 || defined __cplusplus || defined _MSC_VER)
865 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
868 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
871 YYSTYPE
const * const yyvaluep
;
876 if (yytype
< YYNTOKENS
)
877 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
879 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
881 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
);
882 YYFPRINTF (yyoutput
, ")");
885 /*------------------------------------------------------------------.
886 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
888 `------------------------------------------------------------------*/
890 #if (defined __STDC__ || defined __C99__FUNC__ \
891 || defined __cplusplus || defined _MSC_VER)
893 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
896 yy_stack_print (yybottom
, yytop
)
897 yytype_int16
*yybottom
;
901 YYFPRINTF (stderr
, "Stack now");
902 for (; yybottom
<= yytop
; yybottom
++)
904 int yybot
= *yybottom
;
905 YYFPRINTF (stderr
, " %d", yybot
);
907 YYFPRINTF (stderr
, "\n");
910 # define YY_STACK_PRINT(Bottom, Top) \
913 yy_stack_print ((Bottom), (Top)); \
917 /*------------------------------------------------.
918 | Report that the YYRULE is going to be reduced. |
919 `------------------------------------------------*/
921 #if (defined __STDC__ || defined __C99__FUNC__ \
922 || defined __cplusplus || defined _MSC_VER)
924 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
, Context
*context
, yyscan_t
*scanner
)
927 yy_reduce_print (yyvsp
, yyrule
, context
, scanner
)
934 int yynrhs
= yyr2
[yyrule
];
936 unsigned long int yylno
= yyrline
[yyrule
];
937 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
939 /* The symbols being reduced. */
940 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
942 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
943 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
944 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
946 YYFPRINTF (stderr
, "\n");
950 # define YY_REDUCE_PRINT(Rule) \
953 yy_reduce_print (yyvsp, Rule, context, scanner); \
956 /* Nonzero means print parse trace. It is left uninitialized so that
957 multiple parsers can coexist. */
960 # define YYDPRINTF(Args)
961 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
962 # define YY_STACK_PRINT(Bottom, Top)
963 # define YY_REDUCE_PRINT(Rule)
964 #endif /* !YYDEBUG */
967 /* YYINITDEPTH -- initial size of the parser's stacks. */
969 # define YYINITDEPTH 200
972 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
973 if the built-in stack extension method is used).
975 Do not make this value too large; the results are undefined if
976 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
977 evaluated with infinite-precision integer arithmetic. */
980 # define YYMAXDEPTH 10000
988 # if defined __GLIBC__ && defined _STRING_H
989 # define yystrlen strlen
991 /* Return the length of YYSTR. */
992 #if (defined __STDC__ || defined __C99__FUNC__ \
993 || defined __cplusplus || defined _MSC_VER)
995 yystrlen (const char *yystr
)
1003 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1011 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1012 # define yystpcpy stpcpy
1014 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1016 #if (defined __STDC__ || defined __C99__FUNC__ \
1017 || defined __cplusplus || defined _MSC_VER)
1019 yystpcpy (char *yydest
, const char *yysrc
)
1022 yystpcpy (yydest
, yysrc
)
1028 const char *yys
= yysrc
;
1030 while ((*yyd
++ = *yys
++) != '\0')
1039 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1040 quotes and backslashes, so that it's suitable for yyerror. The
1041 heuristic is that double-quoting is unnecessary unless the string
1042 contains an apostrophe, a comma, or backslash (other than
1043 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1044 null, do not copy; instead, return the length of what the result
1047 yytnamerr (char *yyres
, const char *yystr
)
1052 char const *yyp
= yystr
;
1059 goto do_not_strip_quotes
;
1063 goto do_not_strip_quotes
;
1076 do_not_strip_quotes
: ;
1080 return yystrlen (yystr
);
1082 return yystpcpy (yyres
, yystr
) - yyres
;
1086 /* Copy into YYRESULT an error message about the unexpected token
1087 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1088 including the terminating null byte. If YYRESULT is null, do not
1089 copy anything; just return the number of bytes that would be
1090 copied. As a special case, return 0 if an ordinary "syntax error"
1091 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1092 size calculation. */
1094 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1096 int yyn
= yypact
[yystate
];
1098 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1102 int yytype
= YYTRANSLATE (yychar
);
1103 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1104 YYSIZE_T yysize
= yysize0
;
1106 int yysize_overflow
= 0;
1107 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1108 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1112 /* This is so xgettext sees the translatable formats that are
1113 constructed on the fly. */
1114 YY_("syntax error, unexpected %s");
1115 YY_("syntax error, unexpected %s, expecting %s");
1116 YY_("syntax error, unexpected %s, expecting %s or %s");
1117 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1118 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1122 static char const yyunexpected
[] = "syntax error, unexpected %s";
1123 static char const yyexpecting
[] = ", expecting %s";
1124 static char const yyor
[] = " or %s";
1125 char yyformat
[sizeof yyunexpected
1126 + sizeof yyexpecting
- 1
1127 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1128 * (sizeof yyor
- 1))];
1129 char const *yyprefix
= yyexpecting
;
1131 /* Start YYX at -YYN if negative to avoid negative indexes in
1133 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1135 /* Stay within bounds of both yycheck and yytname. */
1136 int yychecklim
= YYLAST
- yyn
+ 1;
1137 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1140 yyarg
[0] = yytname
[yytype
];
1141 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1143 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1144 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1146 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1150 yyformat
[sizeof yyunexpected
- 1] = '\0';
1153 yyarg
[yycount
++] = yytname
[yyx
];
1154 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1155 yysize_overflow
|= (yysize1
< yysize
);
1157 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1161 yyf
= YY_(yyformat
);
1162 yysize1
= yysize
+ yystrlen (yyf
);
1163 yysize_overflow
|= (yysize1
< yysize
);
1166 if (yysize_overflow
)
1167 return YYSIZE_MAXIMUM
;
1171 /* Avoid sprintf, as that infringes on the user's name space.
1172 Don't have undefined behavior even if the translation
1173 produced a string with the wrong number of "%s"s. */
1174 char *yyp
= yyresult
;
1176 while ((*yyp
= *yyf
) != '\0')
1178 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1180 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1193 #endif /* YYERROR_VERBOSE */
1196 /*-----------------------------------------------.
1197 | Release the memory associated to this symbol. |
1198 `-----------------------------------------------*/
1201 #if (defined __STDC__ || defined __C99__FUNC__ \
1202 || defined __cplusplus || defined _MSC_VER)
1204 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, Context
*context
, yyscan_t
*scanner
)
1207 yydestruct (yymsg
, yytype
, yyvaluep
, context
, scanner
)
1221 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1231 /* Prevent warnings from -Wmissing-prototypes. */
1232 #ifdef YYPARSE_PARAM
1233 #if defined __STDC__ || defined __cplusplus
1234 int yyparse (void *YYPARSE_PARAM
);
1238 #else /* ! YYPARSE_PARAM */
1239 #if defined __STDC__ || defined __cplusplus
1240 int yyparse (Context
*context
, yyscan_t
*scanner
);
1244 #endif /* ! YYPARSE_PARAM */
1250 /*-------------------------.
1251 | yyparse or yypush_parse. |
1252 `-------------------------*/
1254 #ifdef YYPARSE_PARAM
1255 #if (defined __STDC__ || defined __C99__FUNC__ \
1256 || defined __cplusplus || defined _MSC_VER)
1258 yyparse (void *YYPARSE_PARAM
)
1261 yyparse (YYPARSE_PARAM
)
1262 void *YYPARSE_PARAM
;
1264 #else /* ! YYPARSE_PARAM */
1265 #if (defined __STDC__ || defined __C99__FUNC__ \
1266 || defined __cplusplus || defined _MSC_VER)
1268 yyparse (Context
*context
, yyscan_t
*scanner
)
1271 yyparse (context
, scanner
)
1277 /* The lookahead symbol. */
1280 /* The semantic value of the lookahead symbol. */
1283 /* Number of syntax errors so far. */
1287 /* Number of tokens to shift before error messages enabled. */
1290 /* The stacks and their tools:
1291 `yyss': related to states.
1292 `yyvs': related to semantic values.
1294 Refer to the stacks thru separate pointers, to allow yyoverflow
1295 to reallocate them elsewhere. */
1297 /* The state stack. */
1298 yytype_int16 yyssa
[YYINITDEPTH
];
1300 yytype_int16
*yyssp
;
1302 /* The semantic value stack. */
1303 YYSTYPE yyvsa
[YYINITDEPTH
];
1307 YYSIZE_T yystacksize
;
1311 /* Lookahead token as an internal (translated) token number. */
1313 /* The variables used to return semantic value and location from the
1318 /* Buffer for error messages, and its allocated size. */
1320 char *yymsg
= yymsgbuf
;
1321 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1324 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1326 /* The number of symbols on the RHS of the reduced rule.
1327 Keep to zero when no symbol should be popped. */
1333 yystacksize
= YYINITDEPTH
;
1335 YYDPRINTF ((stderr
, "Starting parse\n"));
1340 yychar
= YYEMPTY
; /* Cause a token to be read. */
1342 /* Initialize stack pointers.
1343 Waste one element of value and location stack
1344 so that they stay on the same level as the state stack.
1345 The wasted elements are never initialized. */
1351 /*------------------------------------------------------------.
1352 | yynewstate -- Push a new state, which is found in yystate. |
1353 `------------------------------------------------------------*/
1355 /* In all cases, when you get here, the value and location stacks
1356 have just been pushed. So pushing a state here evens the stacks. */
1362 if (yyss
+ yystacksize
- 1 <= yyssp
)
1364 /* Get the current used size of the three stacks, in elements. */
1365 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1369 /* Give user a chance to reallocate the stack. Use copies of
1370 these so that the &'s don't force the real ones into
1372 YYSTYPE
*yyvs1
= yyvs
;
1373 yytype_int16
*yyss1
= yyss
;
1375 /* Each stack pointer address is followed by the size of the
1376 data in use in that stack, in bytes. This used to be a
1377 conditional around just the two extra args, but that might
1378 be undefined if yyoverflow is a macro. */
1379 yyoverflow (YY_("memory exhausted"),
1380 &yyss1
, yysize
* sizeof (*yyssp
),
1381 &yyvs1
, yysize
* sizeof (*yyvsp
),
1387 #else /* no yyoverflow */
1388 # ifndef YYSTACK_RELOCATE
1389 goto yyexhaustedlab
;
1391 /* Extend the stack our own way. */
1392 if (YYMAXDEPTH
<= yystacksize
)
1393 goto yyexhaustedlab
;
1395 if (YYMAXDEPTH
< yystacksize
)
1396 yystacksize
= YYMAXDEPTH
;
1399 yytype_int16
*yyss1
= yyss
;
1400 union yyalloc
*yyptr
=
1401 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1403 goto yyexhaustedlab
;
1404 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1405 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1406 # undef YYSTACK_RELOCATE
1408 YYSTACK_FREE (yyss1
);
1411 #endif /* no yyoverflow */
1413 yyssp
= yyss
+ yysize
- 1;
1414 yyvsp
= yyvs
+ yysize
- 1;
1416 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1417 (unsigned long int) yystacksize
));
1419 if (yyss
+ yystacksize
- 1 <= yyssp
)
1423 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1425 if (yystate
== YYFINAL
)
1435 /* Do appropriate processing given the current state. Read a
1436 lookahead token if we need one and don't already have one. */
1438 /* First try to decide what to do without reference to lookahead token. */
1439 yyn
= yypact
[yystate
];
1440 if (yyn
== YYPACT_NINF
)
1443 /* Not known => get a lookahead token if don't already have one. */
1445 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1446 if (yychar
== YYEMPTY
)
1448 YYDPRINTF ((stderr
, "Reading a token: "));
1452 if (yychar
<= YYEOF
)
1454 yychar
= yytoken
= YYEOF
;
1455 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1459 yytoken
= YYTRANSLATE (yychar
);
1460 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1463 /* If the proper action on seeing token YYTOKEN is to reduce or to
1464 detect an error, take that action. */
1466 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1471 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1477 /* Count tokens shifted since error; after three, turn off error
1482 /* Shift the lookahead token. */
1483 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1485 /* Discard the shifted token. */
1494 /*-----------------------------------------------------------.
1495 | yydefault -- do the default action for the current state. |
1496 `-----------------------------------------------------------*/
1498 yyn
= yydefact
[yystate
];
1504 /*-----------------------------.
1505 | yyreduce -- Do a reduction. |
1506 `-----------------------------*/
1508 /* yyn is the number of a rule to reduce with. */
1511 /* If YYLEN is nonzero, implement the default value of the action:
1514 Otherwise, the following line sets YYVAL to garbage.
1515 This behavior is undocumented and Bison
1516 users should not rely upon it. Assigning to YYVAL
1517 unconditionally makes the parser a bit smaller, and it avoids a
1518 GCC warning that YYVAL may be used uninitialized. */
1519 yyval
= yyvsp
[1-yylen
];
1522 YY_REDUCE_PRINT (yyn
);
1527 /* Line 1464 of yacc.c */
1528 #line 168 "libmemcached/options/parser.yy"
1534 /* Line 1464 of yacc.c */
1535 #line 170 "libmemcached/options/parser.yy"
1541 /* Line 1464 of yacc.c */
1542 #line 172 "libmemcached/options/parser.yy"
1548 /* Line 1464 of yacc.c */
1549 #line 174 "libmemcached/options/parser.yy"
1558 /* Line 1464 of yacc.c */
1559 #line 179 "libmemcached/options/parser.yy"
1561 context
->rc
= MEMCACHED_PARSE_USER_ERROR
;
1562 parser_abort(context
, NULL
);
1568 /* Line 1464 of yacc.c */
1569 #line 184 "libmemcached/options/parser.yy"
1571 memcached_reset(context
->memc
);
1577 /* Line 1464 of yacc.c */
1578 #line 188 "libmemcached/options/parser.yy"
1586 /* Line 1464 of yacc.c */
1587 #line 192 "libmemcached/options/parser.yy"
1589 if ((context
->rc
= memcached_parse_configure_file(*context
->memc
, (yyvsp
[(3) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].string
).size
)) != MEMCACHED_SUCCESS
)
1591 parser_abort(context
, NULL
);
1598 /* Line 1464 of yacc.c */
1599 #line 203 "libmemcached/options/parser.yy"
1601 if (memcached_failed(context
->rc
= memcached_server_add_with_weight(context
->memc
, (yyvsp
[(2) - (4)].server
).c_str
, (yyvsp
[(3) - (4)].number
), (yyvsp
[(4) - (4)].number
))))
1603 parser_abort(context
, NULL
);
1605 context
->unset_server();
1611 /* Line 1464 of yacc.c */
1612 #line 211 "libmemcached/options/parser.yy"
1614 if (memcached_failed(context
->rc
= memcached_server_add_with_weight(context
->memc
, (yyvsp
[(2) - (4)].server
).c_str
, (yyvsp
[(3) - (4)].number
), (yyvsp
[(4) - (4)].number
))))
1616 parser_abort(context
, NULL
);
1618 context
->unset_server();
1624 /* Line 1464 of yacc.c */
1625 #line 219 "libmemcached/options/parser.yy"
1627 if (memcached_failed(context
->rc
= memcached_server_add_unix_socket(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
)))
1629 parser_abort(context
, NULL
);
1636 /* Line 1464 of yacc.c */
1637 #line 226 "libmemcached/options/parser.yy"
1639 memcached_set_configuration_file(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
);
1645 /* Line 1464 of yacc.c */
1646 #line 230 "libmemcached/options/parser.yy"
1648 context
->memc
->configure
.initial_pool_size
= (yyvsp
[(2) - (2)].number
);
1654 /* Line 1464 of yacc.c */
1655 #line 234 "libmemcached/options/parser.yy"
1657 context
->memc
->configure
.max_pool_size
= (yyvsp
[(2) - (2)].number
);
1663 /* Line 1464 of yacc.c */
1664 #line 242 "libmemcached/options/parser.yy"
1666 if ((context
->rc
= memcached_set_namespace(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
)) != MEMCACHED_SUCCESS
)
1668 parser_abort(context
, NULL
);;
1675 /* Line 1464 of yacc.c */
1676 #line 249 "libmemcached/options/parser.yy"
1678 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1680 parser_abort(context
, NULL
);;
1687 /* Line 1464 of yacc.c */
1688 #line 256 "libmemcached/options/parser.yy"
1690 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (4)].distribution
))) != MEMCACHED_SUCCESS
)
1692 parser_abort(context
, NULL
);;
1694 if ((context
->rc
= memcached_behavior_set_distribution_hash(context
->memc
, (yyvsp
[(4) - (4)].hash
))) != MEMCACHED_SUCCESS
)
1696 parser_abort(context
, NULL
);;
1703 /* Line 1464 of yacc.c */
1704 #line 267 "libmemcached/options/parser.yy"
1706 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_HASH
, (yyvsp
[(2) - (2)].hash
))) != MEMCACHED_SUCCESS
)
1708 parser_abort(context
, NULL
);;
1715 /* Line 1464 of yacc.c */
1716 #line 274 "libmemcached/options/parser.yy"
1718 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (2)].behavior
), (yyvsp
[(2) - (2)].number
))) != MEMCACHED_SUCCESS
)
1720 parser_abort(context
, NULL
);;
1727 /* Line 1464 of yacc.c */
1728 #line 281 "libmemcached/options/parser.yy"
1730 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (1)].behavior
), true)) != MEMCACHED_SUCCESS
)
1732 parser_abort(context
, NULL
);;
1739 /* Line 1464 of yacc.c */
1740 #line 288 "libmemcached/options/parser.yy"
1747 /* Line 1464 of yacc.c */
1748 #line 294 "libmemcached/options/parser.yy"
1750 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS
;
1756 /* Line 1464 of yacc.c */
1757 #line 298 "libmemcached/options/parser.yy"
1759 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
;
1765 /* Line 1464 of yacc.c */
1766 #line 302 "libmemcached/options/parser.yy"
1768 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
;
1774 /* Line 1464 of yacc.c */
1775 #line 306 "libmemcached/options/parser.yy"
1777 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
;
1783 /* Line 1464 of yacc.c */
1784 #line 310 "libmemcached/options/parser.yy"
1786 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
;
1792 /* Line 1464 of yacc.c */
1793 #line 314 "libmemcached/options/parser.yy"
1795 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
;
1801 /* Line 1464 of yacc.c */
1802 #line 318 "libmemcached/options/parser.yy"
1804 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT
;
1810 /* Line 1464 of yacc.c */
1811 #line 322 "libmemcached/options/parser.yy"
1813 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT
;
1819 /* Line 1464 of yacc.c */
1820 #line 326 "libmemcached/options/parser.yy"
1822 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
;
1828 /* Line 1464 of yacc.c */
1829 #line 330 "libmemcached/options/parser.yy"
1831 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SND_TIMEOUT
;
1837 /* Line 1464 of yacc.c */
1838 #line 334 "libmemcached/options/parser.yy"
1840 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
;
1846 /* Line 1464 of yacc.c */
1847 #line 338 "libmemcached/options/parser.yy"
1849 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
;
1855 /* Line 1464 of yacc.c */
1856 #line 345 "libmemcached/options/parser.yy"
1858 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
;
1864 /* Line 1464 of yacc.c */
1865 #line 349 "libmemcached/options/parser.yy"
1867 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
;
1873 /* Line 1464 of yacc.c */
1874 #line 353 "libmemcached/options/parser.yy"
1876 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
;
1882 /* Line 1464 of yacc.c */
1883 #line 357 "libmemcached/options/parser.yy"
1885 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NOREPLY
;
1891 /* Line 1464 of yacc.c */
1892 #line 361 "libmemcached/options/parser.yy"
1894 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
;
1900 /* Line 1464 of yacc.c */
1901 #line 365 "libmemcached/options/parser.yy"
1903 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SORT_HOSTS
;
1909 /* Line 1464 of yacc.c */
1910 #line 369 "libmemcached/options/parser.yy"
1912 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SUPPORT_CAS
;
1918 /* Line 1464 of yacc.c */
1919 #line 373 "libmemcached/options/parser.yy"
1921 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_NODELAY
;
1927 /* Line 1464 of yacc.c */
1928 #line 377 "libmemcached/options/parser.yy"
1930 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
;
1936 /* Line 1464 of yacc.c */
1937 #line 381 "libmemcached/options/parser.yy"
1939 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE
;
1945 /* Line 1464 of yacc.c */
1946 #line 385 "libmemcached/options/parser.yy"
1948 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_USE_UDP
;
1954 /* Line 1464 of yacc.c */
1955 #line 389 "libmemcached/options/parser.yy"
1957 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_VERIFY_KEY
;
1963 /* Line 1464 of yacc.c */
1964 #line 395 "libmemcached/options/parser.yy"
1965 { (yyval
.number
)= MEMCACHED_DEFAULT_PORT
;;}
1970 /* Line 1464 of yacc.c */
1971 #line 397 "libmemcached/options/parser.yy"
1977 /* Line 1464 of yacc.c */
1978 #line 401 "libmemcached/options/parser.yy"
1979 { (yyval
.number
)= 1; ;}
1984 /* Line 1464 of yacc.c */
1985 #line 403 "libmemcached/options/parser.yy"
1991 /* Line 1464 of yacc.c */
1992 #line 408 "libmemcached/options/parser.yy"
1994 (yyval
.hash
)= MEMCACHED_HASH_MD5
;
2000 /* Line 1464 of yacc.c */
2001 #line 412 "libmemcached/options/parser.yy"
2003 (yyval
.hash
)= MEMCACHED_HASH_CRC
;
2009 /* Line 1464 of yacc.c */
2010 #line 416 "libmemcached/options/parser.yy"
2012 (yyval
.hash
)= MEMCACHED_HASH_FNV1_64
;
2018 /* Line 1464 of yacc.c */
2019 #line 420 "libmemcached/options/parser.yy"
2021 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_64
;
2027 /* Line 1464 of yacc.c */
2028 #line 424 "libmemcached/options/parser.yy"
2030 (yyval
.hash
)= MEMCACHED_HASH_FNV1_32
;
2036 /* Line 1464 of yacc.c */
2037 #line 428 "libmemcached/options/parser.yy"
2039 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_32
;
2045 /* Line 1464 of yacc.c */
2046 #line 432 "libmemcached/options/parser.yy"
2048 (yyval
.hash
)= MEMCACHED_HASH_HSIEH
;
2054 /* Line 1464 of yacc.c */
2055 #line 436 "libmemcached/options/parser.yy"
2057 (yyval
.hash
)= MEMCACHED_HASH_MURMUR
;
2063 /* Line 1464 of yacc.c */
2064 #line 440 "libmemcached/options/parser.yy"
2066 (yyval
.hash
)= MEMCACHED_HASH_JENKINS
;
2072 /* Line 1464 of yacc.c */
2073 #line 447 "libmemcached/options/parser.yy"
2075 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2081 /* Line 1464 of yacc.c */
2082 #line 451 "libmemcached/options/parser.yy"
2084 (yyval
.string
).c_str
= (yyvsp
[(1) - (1)].string
).c_str
+1; // +1 to move use passed the initial quote
2085 (yyval
.string
).size
= (yyvsp
[(1) - (1)].string
).size
-2; // -2 removes the begin and end quote
2091 /* Line 1464 of yacc.c */
2092 #line 459 "libmemcached/options/parser.yy"
2094 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_CONSISTENT
;
2100 /* Line 1464 of yacc.c */
2101 #line 463 "libmemcached/options/parser.yy"
2103 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_MODULA
;
2109 /* Line 1464 of yacc.c */
2110 #line 467 "libmemcached/options/parser.yy"
2112 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_RANDOM
;
2118 /* Line 1464 of yacc.c */
2119 #line 2120 "libmemcached/options/parser.cc"
2122 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2126 YY_STACK_PRINT (yyss
, yyssp
);
2130 /* Now `shift' the result of the reduction. Determine what state
2131 that goes to, based on the state we popped back to and the rule
2132 number reduced by. */
2136 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2137 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2138 yystate
= yytable
[yystate
];
2140 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2145 /*------------------------------------.
2146 | yyerrlab -- here on detecting error |
2147 `------------------------------------*/
2149 /* If not already recovering from an error, report this error. */
2153 #if ! YYERROR_VERBOSE
2154 yyerror (context
, scanner
, YY_("syntax error"));
2157 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2158 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2160 YYSIZE_T yyalloc
= 2 * yysize
;
2161 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2162 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2163 if (yymsg
!= yymsgbuf
)
2164 YYSTACK_FREE (yymsg
);
2165 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2167 yymsg_alloc
= yyalloc
;
2171 yymsg_alloc
= sizeof yymsgbuf
;
2175 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2177 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2178 yyerror (context
, scanner
, yymsg
);
2182 yyerror (context
, scanner
, YY_("syntax error"));
2184 goto yyexhaustedlab
;
2192 if (yyerrstatus
== 3)
2194 /* If just tried and failed to reuse lookahead token after an
2195 error, discard it. */
2197 if (yychar
<= YYEOF
)
2199 /* Return failure if at end of input. */
2200 if (yychar
== YYEOF
)
2205 yydestruct ("Error: discarding",
2206 yytoken
, &yylval
, context
, scanner
);
2211 /* Else will try to reuse lookahead token after shifting the error
2216 /*---------------------------------------------------.
2217 | yyerrorlab -- error raised explicitly by YYERROR. |
2218 `---------------------------------------------------*/
2221 /* Pacify compilers like GCC when the user code never invokes
2222 YYERROR and the label yyerrorlab therefore never appears in user
2224 if (/*CONSTCOND*/ 0)
2227 /* Do not reclaim the symbols of the rule which action triggered
2231 YY_STACK_PRINT (yyss
, yyssp
);
2236 /*-------------------------------------------------------------.
2237 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2238 `-------------------------------------------------------------*/
2240 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2244 yyn
= yypact
[yystate
];
2245 if (yyn
!= YYPACT_NINF
)
2248 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2256 /* Pop the current state because it cannot handle the error token. */
2261 yydestruct ("Error: popping",
2262 yystos
[yystate
], yyvsp
, context
, scanner
);
2265 YY_STACK_PRINT (yyss
, yyssp
);
2271 /* Shift the error token. */
2272 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2278 /*-------------------------------------.
2279 | yyacceptlab -- YYACCEPT comes here. |
2280 `-------------------------------------*/
2285 /*-----------------------------------.
2286 | yyabortlab -- YYABORT comes here. |
2287 `-----------------------------------*/
2292 #if !defined(yyoverflow) || YYERROR_VERBOSE
2293 /*-------------------------------------------------.
2294 | yyexhaustedlab -- memory exhaustion comes here. |
2295 `-------------------------------------------------*/
2297 yyerror (context
, scanner
, YY_("memory exhausted"));
2303 if (yychar
!= YYEMPTY
)
2304 yydestruct ("Cleanup: discarding lookahead",
2305 yytoken
, &yylval
, context
, scanner
);
2306 /* Do not reclaim the symbols of the rule which action triggered
2307 this YYABORT or YYACCEPT. */
2309 YY_STACK_PRINT (yyss
, yyssp
);
2310 while (yyssp
!= yyss
)
2312 yydestruct ("Cleanup: popping",
2313 yystos
[*yyssp
], yyvsp
, context
, scanner
);
2318 YYSTACK_FREE (yyss
);
2321 if (yymsg
!= yymsgbuf
)
2322 YYSTACK_FREE (yymsg
);
2324 /* Make sure YYID is used. */
2325 return YYID (yyresult
);
2330 /* Line 1684 of yacc.c */
2331 #line 472 "libmemcached/options/parser.yy"
2334 void Context::start()
2336 config_parse(this, (void **)scanner
);