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"
81 #include <libmemcached/common.h>
82 #include <libmemcached/options.hpp>
84 #include <libmemcached/options/context.h>
85 #include <libmemcached/options/symbol.h>
86 #include <libmemcached/options/scanner.h>
90 #pragma GCC diagnostic ignored "-Wold-style-cast"
92 int conf_lex(YYSTYPE
* lvalp
, void* scanner
);
94 #define parser_abort(A, B) do { (A)->abort((B)); YYABORT; } while (0)
96 inline void config_error(Context
*context
, yyscan_t
*scanner
, const char *error
)
98 if (not context
->end())
99 context
->abort(error
);
104 /* Line 189 of yacc.c */
105 #line 106 "libmemcached/options/parser.cc"
107 /* Enabling traces. */
112 /* Enabling verbose error messages. */
113 #ifdef YYERROR_VERBOSE
114 # undef YYERROR_VERBOSE
115 # define YYERROR_VERBOSE 1
117 # define YYERROR_VERBOSE 1
120 /* Enabling the token table. */
121 #ifndef YYTOKEN_TABLE
122 # define YYTOKEN_TABLE 0
129 /* Put the tokens into the symbol table, so that GDB and other debuggers
138 CONFIGURE_FILE
= 264,
143 SERVERS_OPTION
= 269,
144 UNKNOWN_OPTION
= 270,
146 BINARY_PROTOCOL
= 272,
147 BUFFER_REQUESTS
= 273,
148 CONNECT_TIMEOUT
= 274,
151 HASH_WITH_NAMESPACE
= 277,
152 IO_BYTES_WATERMARK
= 278,
153 IO_KEY_PREFETCH
= 279,
154 IO_MSG_WATERMARK
= 280,
156 KETAMA_WEIGHTED
= 282,
158 NUMBER_OF_REPLICAS
= 284,
160 RANDOMIZE_REPLICA_READ
= 286,
162 REMOVE_FAILED_SERVERS
= 288,
165 SOCKET_RECV_SIZE
= 291,
166 SOCKET_SEND_SIZE
= 292,
172 _TCP_KEEPALIVE
= 298,
206 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
208 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
209 # define YYSTYPE_IS_DECLARED 1
213 /* Copy the second part of user declarations. */
216 /* Line 264 of yacc.c */
217 #line 218 "libmemcached/options/parser.cc"
224 typedef YYTYPE_UINT8 yytype_uint8
;
226 typedef unsigned char yytype_uint8
;
230 typedef YYTYPE_INT8 yytype_int8
;
231 #elif (defined __STDC__ || defined __C99__FUNC__ \
232 || defined __cplusplus || defined _MSC_VER)
233 typedef signed char yytype_int8
;
235 typedef short int yytype_int8
;
239 typedef YYTYPE_UINT16 yytype_uint16
;
241 typedef unsigned short int yytype_uint16
;
245 typedef YYTYPE_INT16 yytype_int16
;
247 typedef short int yytype_int16
;
251 # ifdef __SIZE_TYPE__
252 # define YYSIZE_T __SIZE_TYPE__
253 # elif defined size_t
254 # define YYSIZE_T size_t
255 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
256 || defined __cplusplus || defined _MSC_VER)
257 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
258 # define YYSIZE_T size_t
260 # define YYSIZE_T unsigned int
264 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
267 # if defined YYENABLE_NLS && YYENABLE_NLS
269 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
270 # define YY_(msgid) dgettext ("bison-runtime", msgid)
274 # define YY_(msgid) msgid
278 /* Suppress unused-variable warnings by "using" E. */
279 #if ! defined lint || defined __GNUC__
280 # define YYUSE(e) ((void) (e))
282 # define YYUSE(e) /* empty */
285 /* Identity function, used to suppress warnings about constant conditions. */
289 #if (defined __STDC__ || defined __C99__FUNC__ \
290 || defined __cplusplus || defined _MSC_VER)
303 #if ! defined yyoverflow || YYERROR_VERBOSE
305 /* The parser invokes alloca or malloc; define the necessary symbols. */
307 # ifdef YYSTACK_USE_ALLOCA
308 # if YYSTACK_USE_ALLOCA
310 # define YYSTACK_ALLOC __builtin_alloca
311 # elif defined __BUILTIN_VA_ARG_INCR
312 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
314 # define YYSTACK_ALLOC __alloca
315 # elif defined _MSC_VER
316 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
317 # define alloca _alloca
319 # define YYSTACK_ALLOC alloca
320 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
321 || defined __cplusplus || defined _MSC_VER)
322 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
331 # ifdef YYSTACK_ALLOC
332 /* Pacify GCC's `empty if-body' warning. */
333 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
334 # ifndef YYSTACK_ALLOC_MAXIMUM
335 /* The OS might guarantee only one guard page at the bottom of the stack,
336 and a page size can be as small as 4096 bytes. So we cannot safely
337 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
338 to allow for a few compiler-allocated temporary stack slots. */
339 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
342 # define YYSTACK_ALLOC YYMALLOC
343 # define YYSTACK_FREE YYFREE
344 # ifndef YYSTACK_ALLOC_MAXIMUM
345 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
347 # if (defined __cplusplus && ! defined _STDLIB_H \
348 && ! ((defined YYMALLOC || defined malloc) \
349 && (defined YYFREE || defined free)))
350 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
356 # define YYMALLOC malloc
357 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
358 || defined __cplusplus || defined _MSC_VER)
359 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
364 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
365 || defined __cplusplus || defined _MSC_VER)
366 void free (void *); /* INFRINGES ON USER NAME SPACE */
370 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
373 #if (! defined yyoverflow \
374 && (! defined __cplusplus \
375 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
377 /* A type that is properly aligned for any stack member. */
380 yytype_int16 yyss_alloc
;
384 /* The size of the maximum gap between one aligned stack and the next. */
385 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
387 /* The size of an array large to enough to hold all stacks, each with
389 # define YYSTACK_BYTES(N) \
390 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
391 + YYSTACK_GAP_MAXIMUM)
393 /* Copy COUNT objects from FROM to TO. The source and destination do
396 # if defined __GNUC__ && 1 < __GNUC__
397 # define YYCOPY(To, From, Count) \
398 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
400 # define YYCOPY(To, From, Count) \
404 for (yyi = 0; yyi < (Count); yyi++) \
405 (To)[yyi] = (From)[yyi]; \
411 /* Relocate STACK from its old location to the new one. The
412 local variables YYSIZE and YYSTACKSIZE give the old and new number of
413 elements in the stack, and YYPTR gives the new location of the
414 stack. Advance YYPTR to a properly aligned location for the next
416 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
419 YYSIZE_T yynewbytes; \
420 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
421 Stack = &yyptr->Stack_alloc; \
422 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
423 yyptr += yynewbytes / sizeof (*yyptr); \
429 /* YYFINAL -- State number of the termination state. */
431 /* YYLAST -- Last index in YYTABLE. */
434 /* YYNTOKENS -- Number of terminals. */
436 /* YYNNTS -- Number of nonterminals. */
438 /* YYNRULES -- Number of rules. */
440 /* YYNRULES -- Number of states. */
443 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
445 #define YYMAXUTOK 326
447 #define YYTRANSLATE(YYX) \
448 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
450 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
451 static const yytype_uint8 yytranslate
[] =
453 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 74, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 63, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 64, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 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, 1, 2, 3, 4,
479 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
480 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
481 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
482 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
483 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
484 55, 56, 57, 58, 59, 60, 61, 62, 65, 66,
485 67, 68, 69, 70, 71, 72, 73
489 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
491 static const yytype_uint8 yyprhs
[] =
493 0, 0, 3, 5, 9, 11, 13, 15, 17, 19,
494 21, 23, 27, 32, 37, 41, 44, 47, 50, 52,
495 55, 58, 63, 66, 69, 71, 73, 75, 77, 79,
496 81, 83, 85, 87, 89, 91, 93, 95, 97, 99,
497 101, 103, 105, 107, 109, 111, 113, 115, 117, 119,
498 121, 122, 124, 125, 127, 129, 131, 133, 135, 137,
499 139, 141, 143, 145, 147, 149, 151, 153
502 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
503 static const yytype_int8 yyrhs
[] =
505 76, 0, -1, 77, -1, 76, 74, 77, -1, 78,
506 -1, 3, -1, 10, -1, 4, -1, 5, -1, 6,
507 -1, 7, -1, 8, 74, 85, -1, 11, 70, 82,
508 83, -1, 11, 69, 82, 83, -1, 12, 85, 83,
509 -1, 9, 85, -1, 47, 66, -1, 48, 66, -1,
510 79, -1, 46, 85, -1, 20, 86, -1, 20, 86,
511 63, 84, -1, 21, 84, -1, 80, 66, -1, 81,
512 -1, 40, -1, 33, -1, 19, -1, 25, -1, 23,
513 -1, 24, -1, 29, -1, 30, -1, 32, -1, 34,
514 -1, 35, -1, 36, -1, 37, -1, 17, -1, 18,
515 -1, 22, -1, 28, -1, 31, -1, 38, -1, 39,
516 -1, 45, -1, 43, -1, 44, -1, 41, -1, 42,
517 -1, -1, 67, -1, -1, 68, -1, 49, -1, 50,
518 -1, 51, -1, 52, -1, 53, -1, 54, -1, 55,
519 -1, 56, -1, 57, -1, 71, -1, 72, -1, 58,
523 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
524 static const yytype_uint16 yyrline
[] =
526 0, 158, 158, 159, 163, 165, 167, 169, 174, 179,
527 183, 187, 198, 206, 214, 221, 225, 229, 233, 237,
528 244, 251, 262, 269, 276, 283, 289, 293, 297, 301,
529 305, 309, 313, 317, 321, 325, 329, 333, 340, 344,
530 348, 352, 356, 360, 364, 368, 372, 376, 380, 384,
531 391, 392, 397, 398, 403, 407, 411, 415, 419, 423,
532 427, 431, 435, 442, 446, 457, 461, 465
536 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
537 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
538 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
539 static const char *const yytname
[] =
541 "$end", "error", "$undefined", "COMMENT", "END", "ERROR", "RESET",
542 "PARSER_DEBUG", "INCLUDE", "CONFIGURE_FILE", "EMPTY_LINE", "SERVER",
543 "SOCKET", "SERVERS", "SERVERS_OPTION", "UNKNOWN_OPTION", "UNKNOWN",
544 "BINARY_PROTOCOL", "BUFFER_REQUESTS", "CONNECT_TIMEOUT", "DISTRIBUTION",
545 "HASH", "HASH_WITH_NAMESPACE", "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH",
546 "IO_MSG_WATERMARK", "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY",
547 "NUMBER_OF_REPLICAS", "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ",
548 "RCV_TIMEOUT", "REMOVE_FAILED_SERVERS", "RETRY_TIMEOUT", "SND_TIMEOUT",
549 "SOCKET_RECV_SIZE", "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS",
550 "USER_DATA", "USE_UDP", "VERIFY_KEY", "_TCP_KEEPALIVE", "_TCP_KEEPIDLE",
551 "_TCP_NODELAY", "NAMESPACE", "POOL_MIN", "POOL_MAX", "MD5", "CRC",
552 "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32", "HSIEH", "MURMUR",
553 "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE", "FALSE", "','",
554 "'='", "FLOAT", "NUMBER", "PORT", "WEIGHT_START", "IPADDRESS",
555 "HOSTNAME", "STRING", "QUOTED_STRING", "FILE_PATH", "' '", "$accept",
556 "begin", "statement", "expression", "behaviors", "behavior_number",
557 "behavior_boolean", "optional_port", "optional_weight", "hash", "string",
563 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
565 static const yytype_uint16 yytoknum
[] =
567 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
568 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
569 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
570 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
571 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
572 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
573 315, 316, 317, 44, 61, 318, 319, 320, 321, 322,
574 323, 324, 325, 326, 32
578 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
579 static const yytype_uint8 yyr1
[] =
581 0, 75, 76, 76, 77, 77, 77, 77, 77, 77,
582 77, 77, 78, 78, 78, 78, 78, 78, 78, 79,
583 79, 79, 79, 79, 79, 79, 80, 80, 80, 80,
584 80, 80, 80, 80, 80, 80, 80, 80, 81, 81,
585 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
586 82, 82, 83, 83, 84, 84, 84, 84, 84, 84,
587 84, 84, 84, 85, 85, 86, 86, 86
590 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
591 static const yytype_uint8 yyr2
[] =
593 0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
594 1, 3, 4, 4, 3, 2, 2, 2, 1, 2,
595 2, 4, 2, 2, 1, 1, 1, 1, 1, 1,
596 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
597 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
598 0, 1, 0, 1, 1, 1, 1, 1, 1, 1,
599 1, 1, 1, 1, 1, 1, 1, 1
602 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
603 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
604 means the default is an error. */
605 static const yytype_uint8 yydefact
[] =
607 0, 5, 7, 8, 9, 10, 0, 0, 6, 0,
608 0, 38, 39, 27, 0, 0, 40, 29, 30, 28,
609 41, 31, 32, 42, 33, 26, 34, 35, 36, 37,
610 43, 44, 25, 48, 49, 46, 47, 45, 0, 0,
611 0, 0, 2, 4, 18, 0, 24, 0, 63, 64,
612 15, 50, 50, 52, 65, 66, 67, 20, 54, 55,
613 56, 57, 58, 59, 60, 61, 62, 22, 19, 16,
614 17, 1, 0, 23, 11, 51, 52, 52, 53, 14,
618 /* YYDEFGOTO[NTERM-NUM]. */
619 static const yytype_int8 yydefgoto
[] =
621 -1, 41, 42, 43, 44, 45, 46, 76, 79, 67,
625 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
627 #define YYPACT_NINF -61
628 static const yytype_int8 yypact
[] =
630 -2, -61, -61, -61, -61, -61, -60, -24, -61, -20,
631 -24, -61, -61, -61, -47, 13, -61, -61, -61, -61,
632 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
633 -61, -61, -61, -61, -61, -61, -61, -61, -24, -41,
634 -15, 0, -61, -61, -61, -11, -61, -24, -61, -61,
635 -61, -10, -10, -12, -61, -61, -61, -5, -61, -61,
636 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
637 -61, -61, -2, -61, -61, -61, -12, -12, -61, -61,
638 13, -61, -61, -61, -61
641 /* YYPGOTO[NTERM-NUM]. */
642 static const yytype_int8 yypgoto
[] =
644 -61, -61, -13, -61, -61, -61, -61, 8, -23, -9,
648 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
649 positive, shift that token. If negative, reduce the rule which
650 number is the opposite. If zero, do what YYDEFACT says.
651 If YYTABLE_NINF, syntax error. */
652 #define YYTABLE_NINF -1
653 static const yytype_uint8 yytable
[] =
655 71, 1, 2, 3, 4, 5, 6, 7, 8, 9,
656 10, 54, 55, 56, 47, 11, 12, 13, 14, 15,
657 16, 17, 18, 19, 53, 69, 20, 21, 22, 23,
658 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
659 34, 35, 36, 37, 38, 39, 40, 48, 49, 51,
660 52, 70, 68, 82, 83, 73, 78, 75, 80, 81,
661 77, 74, 58, 59, 60, 61, 62, 63, 64, 65,
665 static const yytype_int8 yycheck
[] =
667 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
668 12, 58, 59, 60, 74, 17, 18, 19, 20, 21,
669 22, 23, 24, 25, 10, 66, 28, 29, 30, 31,
670 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
671 42, 43, 44, 45, 46, 47, 48, 71, 72, 69,
672 70, 66, 38, 76, 77, 66, 68, 67, 63, 72,
673 52, 47, 49, 50, 51, 52, 53, 54, 55, 56,
677 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
678 symbol of state STATE-NUM. */
679 static const yytype_uint8 yystos
[] =
681 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
682 12, 17, 18, 19, 20, 21, 22, 23, 24, 25,
683 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
684 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
685 48, 76, 77, 78, 79, 80, 81, 74, 71, 72,
686 85, 69, 70, 85, 58, 59, 60, 86, 49, 50,
687 51, 52, 53, 54, 55, 56, 57, 84, 85, 66,
688 66, 0, 74, 66, 85, 67, 82, 82, 68, 83,
692 #define yyerrok (yyerrstatus = 0)
693 #define yyclearin (yychar = YYEMPTY)
697 #define YYACCEPT goto yyacceptlab
698 #define YYABORT goto yyabortlab
699 #define YYERROR goto yyerrorlab
702 /* Like YYERROR except do call yyerror. This remains here temporarily
703 to ease the transition to the new meaning of YYERROR, for GCC.
704 Once GCC version 2 has supplanted version 1, this can go. However,
705 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
706 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
709 #define YYFAIL goto yyerrlab
711 /* This is here to suppress warnings from the GCC cpp's
712 -Wunused-macros. Normally we don't worry about that warning, but
713 some users do, and we want to make it easy for users to remove
714 YYFAIL uses, which will produce warnings from Bison 2.5. */
717 #define YYRECOVERING() (!!yyerrstatus)
719 #define YYBACKUP(Token, Value) \
721 if (yychar == YYEMPTY && yylen == 1) \
725 yytoken = YYTRANSLATE (yychar); \
731 yyerror (context, scanner, YY_("syntax error: cannot back up")); \
738 #define YYERRCODE 256
741 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
742 If N is 0, then set CURRENT to the empty location which ends
743 the previous symbol: RHS[0] (always defined). */
745 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
746 #ifndef YYLLOC_DEFAULT
747 # define YYLLOC_DEFAULT(Current, Rhs, N) \
751 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
752 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
753 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
754 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
758 (Current).first_line = (Current).last_line = \
759 YYRHSLOC (Rhs, 0).last_line; \
760 (Current).first_column = (Current).last_column = \
761 YYRHSLOC (Rhs, 0).last_column; \
767 /* YY_LOCATION_PRINT -- Print the location on the stream.
768 This macro was not mandated originally: define only if we know
769 we won't break user code: when these are the locations we know. */
771 #ifndef YY_LOCATION_PRINT
772 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
773 # define YY_LOCATION_PRINT(File, Loc) \
774 fprintf (File, "%d.%d-%d.%d", \
775 (Loc).first_line, (Loc).first_column, \
776 (Loc).last_line, (Loc).last_column)
778 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
783 /* YYLEX -- calling `yylex' with the right arguments. */
786 # define YYLEX yylex (&yylval, YYLEX_PARAM)
788 # define YYLEX yylex (&yylval, scanner)
791 /* Enable debugging if requested. */
795 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
796 # define YYFPRINTF fprintf
799 # define YYDPRINTF(Args) \
805 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
809 YYFPRINTF (stderr, "%s ", Title); \
810 yy_symbol_print (stderr, \
811 Type, Value, context, scanner); \
812 YYFPRINTF (stderr, "\n"); \
817 /*--------------------------------.
818 | Print this symbol on YYOUTPUT. |
819 `--------------------------------*/
822 #if (defined __STDC__ || defined __C99__FUNC__ \
823 || defined __cplusplus || defined _MSC_VER)
825 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
828 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
831 YYSTYPE
const * const yyvaluep
;
841 if (yytype
< YYNTOKENS
)
842 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
854 /*--------------------------------.
855 | Print this symbol on YYOUTPUT. |
856 `--------------------------------*/
858 #if (defined __STDC__ || defined __C99__FUNC__ \
859 || defined __cplusplus || defined _MSC_VER)
861 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
864 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
867 YYSTYPE
const * const yyvaluep
;
872 if (yytype
< YYNTOKENS
)
873 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
875 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
877 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
);
878 YYFPRINTF (yyoutput
, ")");
881 /*------------------------------------------------------------------.
882 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
884 `------------------------------------------------------------------*/
886 #if (defined __STDC__ || defined __C99__FUNC__ \
887 || defined __cplusplus || defined _MSC_VER)
889 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
892 yy_stack_print (yybottom
, yytop
)
893 yytype_int16
*yybottom
;
897 YYFPRINTF (stderr
, "Stack now");
898 for (; yybottom
<= yytop
; yybottom
++)
900 int yybot
= *yybottom
;
901 YYFPRINTF (stderr
, " %d", yybot
);
903 YYFPRINTF (stderr
, "\n");
906 # define YY_STACK_PRINT(Bottom, Top) \
909 yy_stack_print ((Bottom), (Top)); \
913 /*------------------------------------------------.
914 | Report that the YYRULE is going to be reduced. |
915 `------------------------------------------------*/
917 #if (defined __STDC__ || defined __C99__FUNC__ \
918 || defined __cplusplus || defined _MSC_VER)
920 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
, Context
*context
, yyscan_t
*scanner
)
923 yy_reduce_print (yyvsp
, yyrule
, context
, scanner
)
930 int yynrhs
= yyr2
[yyrule
];
932 unsigned long int yylno
= yyrline
[yyrule
];
933 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
935 /* The symbols being reduced. */
936 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
938 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
939 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
940 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
942 YYFPRINTF (stderr
, "\n");
946 # define YY_REDUCE_PRINT(Rule) \
949 yy_reduce_print (yyvsp, Rule, context, scanner); \
952 /* Nonzero means print parse trace. It is left uninitialized so that
953 multiple parsers can coexist. */
956 # define YYDPRINTF(Args)
957 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
958 # define YY_STACK_PRINT(Bottom, Top)
959 # define YY_REDUCE_PRINT(Rule)
960 #endif /* !YYDEBUG */
963 /* YYINITDEPTH -- initial size of the parser's stacks. */
965 # define YYINITDEPTH 200
968 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
969 if the built-in stack extension method is used).
971 Do not make this value too large; the results are undefined if
972 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
973 evaluated with infinite-precision integer arithmetic. */
976 # define YYMAXDEPTH 10000
984 # if defined __GLIBC__ && defined _STRING_H
985 # define yystrlen strlen
987 /* Return the length of YYSTR. */
988 #if (defined __STDC__ || defined __C99__FUNC__ \
989 || defined __cplusplus || defined _MSC_VER)
991 yystrlen (const char *yystr
)
999 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1007 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1008 # define yystpcpy stpcpy
1010 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1012 #if (defined __STDC__ || defined __C99__FUNC__ \
1013 || defined __cplusplus || defined _MSC_VER)
1015 yystpcpy (char *yydest
, const char *yysrc
)
1018 yystpcpy (yydest
, yysrc
)
1024 const char *yys
= yysrc
;
1026 while ((*yyd
++ = *yys
++) != '\0')
1035 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1036 quotes and backslashes, so that it's suitable for yyerror. The
1037 heuristic is that double-quoting is unnecessary unless the string
1038 contains an apostrophe, a comma, or backslash (other than
1039 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1040 null, do not copy; instead, return the length of what the result
1043 yytnamerr (char *yyres
, const char *yystr
)
1048 char const *yyp
= yystr
;
1055 goto do_not_strip_quotes
;
1059 goto do_not_strip_quotes
;
1072 do_not_strip_quotes
: ;
1076 return yystrlen (yystr
);
1078 return yystpcpy (yyres
, yystr
) - yyres
;
1082 /* Copy into YYRESULT an error message about the unexpected token
1083 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1084 including the terminating null byte. If YYRESULT is null, do not
1085 copy anything; just return the number of bytes that would be
1086 copied. As a special case, return 0 if an ordinary "syntax error"
1087 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1088 size calculation. */
1090 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1092 int yyn
= yypact
[yystate
];
1094 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1098 int yytype
= YYTRANSLATE (yychar
);
1099 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1100 YYSIZE_T yysize
= yysize0
;
1102 int yysize_overflow
= 0;
1103 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1104 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1108 /* This is so xgettext sees the translatable formats that are
1109 constructed on the fly. */
1110 YY_("syntax error, unexpected %s");
1111 YY_("syntax error, unexpected %s, expecting %s");
1112 YY_("syntax error, unexpected %s, expecting %s or %s");
1113 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1114 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1118 static char const yyunexpected
[] = "syntax error, unexpected %s";
1119 static char const yyexpecting
[] = ", expecting %s";
1120 static char const yyor
[] = " or %s";
1121 char yyformat
[sizeof yyunexpected
1122 + sizeof yyexpecting
- 1
1123 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1124 * (sizeof yyor
- 1))];
1125 char const *yyprefix
= yyexpecting
;
1127 /* Start YYX at -YYN if negative to avoid negative indexes in
1129 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1131 /* Stay within bounds of both yycheck and yytname. */
1132 int yychecklim
= YYLAST
- yyn
+ 1;
1133 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1136 yyarg
[0] = yytname
[yytype
];
1137 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1139 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1140 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1142 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1146 yyformat
[sizeof yyunexpected
- 1] = '\0';
1149 yyarg
[yycount
++] = yytname
[yyx
];
1150 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1151 yysize_overflow
|= (yysize1
< yysize
);
1153 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1157 yyf
= YY_(yyformat
);
1158 yysize1
= yysize
+ yystrlen (yyf
);
1159 yysize_overflow
|= (yysize1
< yysize
);
1162 if (yysize_overflow
)
1163 return YYSIZE_MAXIMUM
;
1167 /* Avoid sprintf, as that infringes on the user's name space.
1168 Don't have undefined behavior even if the translation
1169 produced a string with the wrong number of "%s"s. */
1170 char *yyp
= yyresult
;
1172 while ((*yyp
= *yyf
) != '\0')
1174 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1176 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1189 #endif /* YYERROR_VERBOSE */
1192 /*-----------------------------------------------.
1193 | Release the memory associated to this symbol. |
1194 `-----------------------------------------------*/
1197 #if (defined __STDC__ || defined __C99__FUNC__ \
1198 || defined __cplusplus || defined _MSC_VER)
1200 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, Context
*context
, yyscan_t
*scanner
)
1203 yydestruct (yymsg
, yytype
, yyvaluep
, context
, scanner
)
1217 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1227 /* Prevent warnings from -Wmissing-prototypes. */
1228 #ifdef YYPARSE_PARAM
1229 #if defined __STDC__ || defined __cplusplus
1230 int yyparse (void *YYPARSE_PARAM
);
1234 #else /* ! YYPARSE_PARAM */
1235 #if defined __STDC__ || defined __cplusplus
1236 int yyparse (Context
*context
, yyscan_t
*scanner
);
1240 #endif /* ! YYPARSE_PARAM */
1246 /*-------------------------.
1247 | yyparse or yypush_parse. |
1248 `-------------------------*/
1250 #ifdef YYPARSE_PARAM
1251 #if (defined __STDC__ || defined __C99__FUNC__ \
1252 || defined __cplusplus || defined _MSC_VER)
1254 yyparse (void *YYPARSE_PARAM
)
1257 yyparse (YYPARSE_PARAM
)
1258 void *YYPARSE_PARAM
;
1260 #else /* ! YYPARSE_PARAM */
1261 #if (defined __STDC__ || defined __C99__FUNC__ \
1262 || defined __cplusplus || defined _MSC_VER)
1264 yyparse (Context
*context
, yyscan_t
*scanner
)
1267 yyparse (context
, scanner
)
1273 /* The lookahead symbol. */
1276 /* The semantic value of the lookahead symbol. */
1279 /* Number of syntax errors so far. */
1283 /* Number of tokens to shift before error messages enabled. */
1286 /* The stacks and their tools:
1287 `yyss': related to states.
1288 `yyvs': related to semantic values.
1290 Refer to the stacks thru separate pointers, to allow yyoverflow
1291 to reallocate them elsewhere. */
1293 /* The state stack. */
1294 yytype_int16 yyssa
[YYINITDEPTH
];
1296 yytype_int16
*yyssp
;
1298 /* The semantic value stack. */
1299 YYSTYPE yyvsa
[YYINITDEPTH
];
1303 YYSIZE_T yystacksize
;
1307 /* Lookahead token as an internal (translated) token number. */
1309 /* The variables used to return semantic value and location from the
1314 /* Buffer for error messages, and its allocated size. */
1316 char *yymsg
= yymsgbuf
;
1317 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1320 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1322 /* The number of symbols on the RHS of the reduced rule.
1323 Keep to zero when no symbol should be popped. */
1329 yystacksize
= YYINITDEPTH
;
1331 YYDPRINTF ((stderr
, "Starting parse\n"));
1336 yychar
= YYEMPTY
; /* Cause a token to be read. */
1338 /* Initialize stack pointers.
1339 Waste one element of value and location stack
1340 so that they stay on the same level as the state stack.
1341 The wasted elements are never initialized. */
1347 /*------------------------------------------------------------.
1348 | yynewstate -- Push a new state, which is found in yystate. |
1349 `------------------------------------------------------------*/
1351 /* In all cases, when you get here, the value and location stacks
1352 have just been pushed. So pushing a state here evens the stacks. */
1358 if (yyss
+ yystacksize
- 1 <= yyssp
)
1360 /* Get the current used size of the three stacks, in elements. */
1361 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1365 /* Give user a chance to reallocate the stack. Use copies of
1366 these so that the &'s don't force the real ones into
1368 YYSTYPE
*yyvs1
= yyvs
;
1369 yytype_int16
*yyss1
= yyss
;
1371 /* Each stack pointer address is followed by the size of the
1372 data in use in that stack, in bytes. This used to be a
1373 conditional around just the two extra args, but that might
1374 be undefined if yyoverflow is a macro. */
1375 yyoverflow (YY_("memory exhausted"),
1376 &yyss1
, yysize
* sizeof (*yyssp
),
1377 &yyvs1
, yysize
* sizeof (*yyvsp
),
1383 #else /* no yyoverflow */
1384 # ifndef YYSTACK_RELOCATE
1385 goto yyexhaustedlab
;
1387 /* Extend the stack our own way. */
1388 if (YYMAXDEPTH
<= yystacksize
)
1389 goto yyexhaustedlab
;
1391 if (YYMAXDEPTH
< yystacksize
)
1392 yystacksize
= YYMAXDEPTH
;
1395 yytype_int16
*yyss1
= yyss
;
1396 union yyalloc
*yyptr
=
1397 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1399 goto yyexhaustedlab
;
1400 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1401 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1402 # undef YYSTACK_RELOCATE
1404 YYSTACK_FREE (yyss1
);
1407 #endif /* no yyoverflow */
1409 yyssp
= yyss
+ yysize
- 1;
1410 yyvsp
= yyvs
+ yysize
- 1;
1412 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1413 (unsigned long int) yystacksize
));
1415 if (yyss
+ yystacksize
- 1 <= yyssp
)
1419 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1421 if (yystate
== YYFINAL
)
1431 /* Do appropriate processing given the current state. Read a
1432 lookahead token if we need one and don't already have one. */
1434 /* First try to decide what to do without reference to lookahead token. */
1435 yyn
= yypact
[yystate
];
1436 if (yyn
== YYPACT_NINF
)
1439 /* Not known => get a lookahead token if don't already have one. */
1441 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1442 if (yychar
== YYEMPTY
)
1444 YYDPRINTF ((stderr
, "Reading a token: "));
1448 if (yychar
<= YYEOF
)
1450 yychar
= yytoken
= YYEOF
;
1451 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1455 yytoken
= YYTRANSLATE (yychar
);
1456 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1459 /* If the proper action on seeing token YYTOKEN is to reduce or to
1460 detect an error, take that action. */
1462 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1467 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1473 /* Count tokens shifted since error; after three, turn off error
1478 /* Shift the lookahead token. */
1479 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1481 /* Discard the shifted token. */
1490 /*-----------------------------------------------------------.
1491 | yydefault -- do the default action for the current state. |
1492 `-----------------------------------------------------------*/
1494 yyn
= yydefact
[yystate
];
1500 /*-----------------------------.
1501 | yyreduce -- Do a reduction. |
1502 `-----------------------------*/
1504 /* yyn is the number of a rule to reduce with. */
1507 /* If YYLEN is nonzero, implement the default value of the action:
1510 Otherwise, the following line sets YYVAL to garbage.
1511 This behavior is undocumented and Bison
1512 users should not rely upon it. Assigning to YYVAL
1513 unconditionally makes the parser a bit smaller, and it avoids a
1514 GCC warning that YYVAL may be used uninitialized. */
1515 yyval
= yyvsp
[1-yylen
];
1518 YY_REDUCE_PRINT (yyn
);
1523 /* Line 1464 of yacc.c */
1524 #line 164 "libmemcached/options/parser.yy"
1530 /* Line 1464 of yacc.c */
1531 #line 166 "libmemcached/options/parser.yy"
1537 /* Line 1464 of yacc.c */
1538 #line 168 "libmemcached/options/parser.yy"
1544 /* Line 1464 of yacc.c */
1545 #line 170 "libmemcached/options/parser.yy"
1554 /* Line 1464 of yacc.c */
1555 #line 175 "libmemcached/options/parser.yy"
1557 context
->rc
= MEMCACHED_PARSE_USER_ERROR
;
1558 parser_abort(context
, NULL
);
1564 /* Line 1464 of yacc.c */
1565 #line 180 "libmemcached/options/parser.yy"
1567 memcached_reset(context
->memc
);
1573 /* Line 1464 of yacc.c */
1574 #line 184 "libmemcached/options/parser.yy"
1582 /* Line 1464 of yacc.c */
1583 #line 188 "libmemcached/options/parser.yy"
1585 if ((context
->rc
= memcached_parse_configure_file(*context
->memc
, (yyvsp
[(3) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].string
).size
)) != MEMCACHED_SUCCESS
)
1587 parser_abort(context
, NULL
);
1594 /* Line 1464 of yacc.c */
1595 #line 199 "libmemcached/options/parser.yy"
1597 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
))))
1599 parser_abort(context
, NULL
);
1601 context
->unset_server();
1607 /* Line 1464 of yacc.c */
1608 #line 207 "libmemcached/options/parser.yy"
1610 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
))))
1612 parser_abort(context
, NULL
);
1614 context
->unset_server();
1620 /* Line 1464 of yacc.c */
1621 #line 215 "libmemcached/options/parser.yy"
1623 if (memcached_failed(context
->rc
= memcached_server_add_unix_socket_with_weight(context
->memc
, (yyvsp
[(2) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].number
))))
1625 parser_abort(context
, NULL
);
1632 /* Line 1464 of yacc.c */
1633 #line 222 "libmemcached/options/parser.yy"
1635 memcached_set_configuration_file(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
);
1641 /* Line 1464 of yacc.c */
1642 #line 226 "libmemcached/options/parser.yy"
1644 context
->memc
->configure
.initial_pool_size
= (yyvsp
[(2) - (2)].number
);
1650 /* Line 1464 of yacc.c */
1651 #line 230 "libmemcached/options/parser.yy"
1653 context
->memc
->configure
.max_pool_size
= (yyvsp
[(2) - (2)].number
);
1659 /* Line 1464 of yacc.c */
1660 #line 238 "libmemcached/options/parser.yy"
1662 if ((context
->rc
= memcached_set_namespace(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
)) != MEMCACHED_SUCCESS
)
1664 parser_abort(context
, NULL
);;
1671 /* Line 1464 of yacc.c */
1672 #line 245 "libmemcached/options/parser.yy"
1674 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1676 parser_abort(context
, NULL
);;
1683 /* Line 1464 of yacc.c */
1684 #line 252 "libmemcached/options/parser.yy"
1686 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (4)].distribution
))) != MEMCACHED_SUCCESS
)
1688 parser_abort(context
, NULL
);;
1690 if ((context
->rc
= memcached_behavior_set_distribution_hash(context
->memc
, (yyvsp
[(4) - (4)].hash
))) != MEMCACHED_SUCCESS
)
1692 parser_abort(context
, NULL
);;
1699 /* Line 1464 of yacc.c */
1700 #line 263 "libmemcached/options/parser.yy"
1702 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_HASH
, (yyvsp
[(2) - (2)].hash
))) != MEMCACHED_SUCCESS
)
1704 parser_abort(context
, NULL
);;
1711 /* Line 1464 of yacc.c */
1712 #line 270 "libmemcached/options/parser.yy"
1714 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (2)].behavior
), (yyvsp
[(2) - (2)].number
))) != MEMCACHED_SUCCESS
)
1716 parser_abort(context
, NULL
);;
1723 /* Line 1464 of yacc.c */
1724 #line 277 "libmemcached/options/parser.yy"
1726 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (1)].behavior
), true)) != MEMCACHED_SUCCESS
)
1728 parser_abort(context
, NULL
);;
1735 /* Line 1464 of yacc.c */
1736 #line 284 "libmemcached/options/parser.yy"
1743 /* Line 1464 of yacc.c */
1744 #line 290 "libmemcached/options/parser.yy"
1746 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS
;
1752 /* Line 1464 of yacc.c */
1753 #line 294 "libmemcached/options/parser.yy"
1755 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
;
1761 /* Line 1464 of yacc.c */
1762 #line 298 "libmemcached/options/parser.yy"
1764 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
;
1770 /* Line 1464 of yacc.c */
1771 #line 302 "libmemcached/options/parser.yy"
1773 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
;
1779 /* Line 1464 of yacc.c */
1780 #line 306 "libmemcached/options/parser.yy"
1782 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
;
1788 /* Line 1464 of yacc.c */
1789 #line 310 "libmemcached/options/parser.yy"
1791 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
;
1797 /* Line 1464 of yacc.c */
1798 #line 314 "libmemcached/options/parser.yy"
1800 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT
;
1806 /* Line 1464 of yacc.c */
1807 #line 318 "libmemcached/options/parser.yy"
1809 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT
;
1815 /* Line 1464 of yacc.c */
1816 #line 322 "libmemcached/options/parser.yy"
1818 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
;
1824 /* Line 1464 of yacc.c */
1825 #line 326 "libmemcached/options/parser.yy"
1827 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SND_TIMEOUT
;
1833 /* Line 1464 of yacc.c */
1834 #line 330 "libmemcached/options/parser.yy"
1836 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
;
1842 /* Line 1464 of yacc.c */
1843 #line 334 "libmemcached/options/parser.yy"
1845 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
;
1851 /* Line 1464 of yacc.c */
1852 #line 341 "libmemcached/options/parser.yy"
1854 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
;
1860 /* Line 1464 of yacc.c */
1861 #line 345 "libmemcached/options/parser.yy"
1863 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
;
1869 /* Line 1464 of yacc.c */
1870 #line 349 "libmemcached/options/parser.yy"
1872 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
;
1878 /* Line 1464 of yacc.c */
1879 #line 353 "libmemcached/options/parser.yy"
1881 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NOREPLY
;
1887 /* Line 1464 of yacc.c */
1888 #line 357 "libmemcached/options/parser.yy"
1890 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
;
1896 /* Line 1464 of yacc.c */
1897 #line 361 "libmemcached/options/parser.yy"
1899 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SORT_HOSTS
;
1905 /* Line 1464 of yacc.c */
1906 #line 365 "libmemcached/options/parser.yy"
1908 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SUPPORT_CAS
;
1914 /* Line 1464 of yacc.c */
1915 #line 369 "libmemcached/options/parser.yy"
1917 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_NODELAY
;
1923 /* Line 1464 of yacc.c */
1924 #line 373 "libmemcached/options/parser.yy"
1926 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
;
1932 /* Line 1464 of yacc.c */
1933 #line 377 "libmemcached/options/parser.yy"
1935 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE
;
1941 /* Line 1464 of yacc.c */
1942 #line 381 "libmemcached/options/parser.yy"
1944 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_USE_UDP
;
1950 /* Line 1464 of yacc.c */
1951 #line 385 "libmemcached/options/parser.yy"
1953 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_VERIFY_KEY
;
1959 /* Line 1464 of yacc.c */
1960 #line 391 "libmemcached/options/parser.yy"
1961 { (yyval
.number
)= MEMCACHED_DEFAULT_PORT
;;}
1966 /* Line 1464 of yacc.c */
1967 #line 393 "libmemcached/options/parser.yy"
1973 /* Line 1464 of yacc.c */
1974 #line 397 "libmemcached/options/parser.yy"
1975 { (yyval
.number
)= 1; ;}
1980 /* Line 1464 of yacc.c */
1981 #line 399 "libmemcached/options/parser.yy"
1987 /* Line 1464 of yacc.c */
1988 #line 404 "libmemcached/options/parser.yy"
1990 (yyval
.hash
)= MEMCACHED_HASH_MD5
;
1996 /* Line 1464 of yacc.c */
1997 #line 408 "libmemcached/options/parser.yy"
1999 (yyval
.hash
)= MEMCACHED_HASH_CRC
;
2005 /* Line 1464 of yacc.c */
2006 #line 412 "libmemcached/options/parser.yy"
2008 (yyval
.hash
)= MEMCACHED_HASH_FNV1_64
;
2014 /* Line 1464 of yacc.c */
2015 #line 416 "libmemcached/options/parser.yy"
2017 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_64
;
2023 /* Line 1464 of yacc.c */
2024 #line 420 "libmemcached/options/parser.yy"
2026 (yyval
.hash
)= MEMCACHED_HASH_FNV1_32
;
2032 /* Line 1464 of yacc.c */
2033 #line 424 "libmemcached/options/parser.yy"
2035 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_32
;
2041 /* Line 1464 of yacc.c */
2042 #line 428 "libmemcached/options/parser.yy"
2044 (yyval
.hash
)= MEMCACHED_HASH_HSIEH
;
2050 /* Line 1464 of yacc.c */
2051 #line 432 "libmemcached/options/parser.yy"
2053 (yyval
.hash
)= MEMCACHED_HASH_MURMUR
;
2059 /* Line 1464 of yacc.c */
2060 #line 436 "libmemcached/options/parser.yy"
2062 (yyval
.hash
)= MEMCACHED_HASH_JENKINS
;
2068 /* Line 1464 of yacc.c */
2069 #line 443 "libmemcached/options/parser.yy"
2071 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2077 /* Line 1464 of yacc.c */
2078 #line 447 "libmemcached/options/parser.yy"
2080 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2082 (yyval
.string
).c_str
= (yyvsp
[(1) - (1)].string
).c_str
+1; // +1 to move use passed the initial quote
2083 (yyval
.string
).size
= (yyvsp
[(1) - (1)].string
).size
-2; // -2 removes the begin and end quote
2090 /* Line 1464 of yacc.c */
2091 #line 458 "libmemcached/options/parser.yy"
2093 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_CONSISTENT
;
2099 /* Line 1464 of yacc.c */
2100 #line 462 "libmemcached/options/parser.yy"
2102 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_MODULA
;
2108 /* Line 1464 of yacc.c */
2109 #line 466 "libmemcached/options/parser.yy"
2111 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_RANDOM
;
2117 /* Line 1464 of yacc.c */
2118 #line 2119 "libmemcached/options/parser.cc"
2121 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2125 YY_STACK_PRINT (yyss
, yyssp
);
2129 /* Now `shift' the result of the reduction. Determine what state
2130 that goes to, based on the state we popped back to and the rule
2131 number reduced by. */
2135 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2136 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2137 yystate
= yytable
[yystate
];
2139 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2144 /*------------------------------------.
2145 | yyerrlab -- here on detecting error |
2146 `------------------------------------*/
2148 /* If not already recovering from an error, report this error. */
2152 #if ! YYERROR_VERBOSE
2153 yyerror (context
, scanner
, YY_("syntax error"));
2156 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2157 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2159 YYSIZE_T yyalloc
= 2 * yysize
;
2160 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2161 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2162 if (yymsg
!= yymsgbuf
)
2163 YYSTACK_FREE (yymsg
);
2164 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2166 yymsg_alloc
= yyalloc
;
2170 yymsg_alloc
= sizeof yymsgbuf
;
2174 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2176 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2177 yyerror (context
, scanner
, yymsg
);
2181 yyerror (context
, scanner
, YY_("syntax error"));
2183 goto yyexhaustedlab
;
2191 if (yyerrstatus
== 3)
2193 /* If just tried and failed to reuse lookahead token after an
2194 error, discard it. */
2196 if (yychar
<= YYEOF
)
2198 /* Return failure if at end of input. */
2199 if (yychar
== YYEOF
)
2204 yydestruct ("Error: discarding",
2205 yytoken
, &yylval
, context
, scanner
);
2210 /* Else will try to reuse lookahead token after shifting the error
2215 /*---------------------------------------------------.
2216 | yyerrorlab -- error raised explicitly by YYERROR. |
2217 `---------------------------------------------------*/
2220 /* Pacify compilers like GCC when the user code never invokes
2221 YYERROR and the label yyerrorlab therefore never appears in user
2223 if (/*CONSTCOND*/ 0)
2226 /* Do not reclaim the symbols of the rule which action triggered
2230 YY_STACK_PRINT (yyss
, yyssp
);
2235 /*-------------------------------------------------------------.
2236 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2237 `-------------------------------------------------------------*/
2239 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2243 yyn
= yypact
[yystate
];
2244 if (yyn
!= YYPACT_NINF
)
2247 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2255 /* Pop the current state because it cannot handle the error token. */
2260 yydestruct ("Error: popping",
2261 yystos
[yystate
], yyvsp
, context
, scanner
);
2264 YY_STACK_PRINT (yyss
, yyssp
);
2270 /* Shift the error token. */
2271 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2277 /*-------------------------------------.
2278 | yyacceptlab -- YYACCEPT comes here. |
2279 `-------------------------------------*/
2284 /*-----------------------------------.
2285 | yyabortlab -- YYABORT comes here. |
2286 `-----------------------------------*/
2291 #if !defined(yyoverflow) || YYERROR_VERBOSE
2292 /*-------------------------------------------------.
2293 | yyexhaustedlab -- memory exhaustion comes here. |
2294 `-------------------------------------------------*/
2296 yyerror (context
, scanner
, YY_("memory exhausted"));
2302 if (yychar
!= YYEMPTY
)
2303 yydestruct ("Cleanup: discarding lookahead",
2304 yytoken
, &yylval
, context
, scanner
);
2305 /* Do not reclaim the symbols of the rule which action triggered
2306 this YYABORT or YYACCEPT. */
2308 YY_STACK_PRINT (yyss
, yyssp
);
2309 while (yyssp
!= yyss
)
2311 yydestruct ("Cleanup: popping",
2312 yystos
[*yyssp
], yyvsp
, context
, scanner
);
2317 YYSTACK_FREE (yyss
);
2320 if (yymsg
!= yymsgbuf
)
2321 YYSTACK_FREE (yymsg
);
2323 /* Make sure YYID is used. */
2324 return YYID (yyresult
);
2329 /* Line 1684 of yacc.c */
2330 #line 471 "libmemcached/options/parser.yy"
2333 void Context::start()
2335 config_parse(this, (void **)scanner
);