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/options/context.h>
86 #include <libmemcached/options/build.h>
87 #include <libmemcached/options/string.h>
88 #include <libmemcached/options/symbol.h>
89 #include <libmemcached/visibility.h>
90 #include <libmemcached/prefix_key.h>
92 #pragma GCC diagnostic ignored "-Wold-style-cast"
93 #include <libmemcached/options/scanner.h>
95 int conf_lex(YYSTYPE
* lvalp
, void* scanner
);
97 #define parser_abort(A, B) do { parser::abort_func((A), (B)); YYABORT; } while (0)
99 inline void config_error(Context
*context
, yyscan_t
*scanner
, const char *error
)
101 if (not context
->end())
102 parser::abort_func(context
, error
);
105 int config_parse(Context
*, yyscan_t
*);
107 void Context::start()
109 config_parse(this, scanner
);
114 /* Line 189 of yacc.c */
115 #line 116 "libmemcached/options/parser.cc"
117 /* Enabling traces. */
122 /* Enabling verbose error messages. */
123 #ifdef YYERROR_VERBOSE
124 # undef YYERROR_VERBOSE
125 # define YYERROR_VERBOSE 1
127 # define YYERROR_VERBOSE 1
130 /* Enabling the token table. */
131 #ifndef YYTOKEN_TABLE
132 # define YYTOKEN_TABLE 0
139 /* Put the tokens into the symbol table, so that GDB and other debuggers
148 CONFIGURE_FILE
= 264,
152 SERVERS_OPTION
= 268,
153 UNKNOWN_OPTION
= 269,
155 AUTO_EJECT_HOSTS
= 271,
156 BINARY_PROTOCOL
= 272,
157 BUFFER_REQUESTS
= 273,
159 CONNECT_TIMEOUT
= 275,
163 HASH_WITH_PREFIX_KEY
= 279,
164 IO_BYTES_WATERMARK
= 280,
165 IO_KEY_PREFETCH
= 281,
166 IO_MSG_WATERMARK
= 282,
169 KETAMA_WEIGHTED
= 285,
171 NUMBER_OF_REPLICAS
= 287,
173 RANDOMIZE_REPLICA_READ
= 289,
176 SERVER_FAILURE_LIMIT
= 292,
178 SOCKET_RECV_SIZE
= 294,
179 SOCKET_SEND_SIZE
= 295,
183 _TCP_KEEPALIVE
= 299,
206 HOSTNAME_WITH_PORT
= 322,
208 IPADDRESS_WITH_PORT
= 324,
217 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
219 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
220 # define YYSTYPE_IS_DECLARED 1
224 /* Copy the second part of user declarations. */
227 /* Line 264 of yacc.c */
228 #line 229 "libmemcached/options/parser.cc"
235 typedef YYTYPE_UINT8 yytype_uint8
;
237 typedef unsigned char yytype_uint8
;
241 typedef YYTYPE_INT8 yytype_int8
;
242 #elif (defined __STDC__ || defined __C99__FUNC__ \
243 || defined __cplusplus || defined _MSC_VER)
244 typedef signed char yytype_int8
;
246 typedef short int yytype_int8
;
250 typedef YYTYPE_UINT16 yytype_uint16
;
252 typedef unsigned short int yytype_uint16
;
256 typedef YYTYPE_INT16 yytype_int16
;
258 typedef short int yytype_int16
;
262 # ifdef __SIZE_TYPE__
263 # define YYSIZE_T __SIZE_TYPE__
264 # elif defined size_t
265 # define YYSIZE_T size_t
266 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
267 || defined __cplusplus || defined _MSC_VER)
268 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
269 # define YYSIZE_T size_t
271 # define YYSIZE_T unsigned int
275 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
278 # if defined YYENABLE_NLS && YYENABLE_NLS
280 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
281 # define YY_(msgid) dgettext ("bison-runtime", msgid)
285 # define YY_(msgid) msgid
289 /* Suppress unused-variable warnings by "using" E. */
290 #if ! defined lint || defined __GNUC__
291 # define YYUSE(e) ((void) (e))
293 # define YYUSE(e) /* empty */
296 /* Identity function, used to suppress warnings about constant conditions. */
300 #if (defined __STDC__ || defined __C99__FUNC__ \
301 || defined __cplusplus || defined _MSC_VER)
314 #if ! defined yyoverflow || YYERROR_VERBOSE
316 /* The parser invokes alloca or malloc; define the necessary symbols. */
318 # ifdef YYSTACK_USE_ALLOCA
319 # if YYSTACK_USE_ALLOCA
321 # define YYSTACK_ALLOC __builtin_alloca
322 # elif defined __BUILTIN_VA_ARG_INCR
323 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
325 # define YYSTACK_ALLOC __alloca
326 # elif defined _MSC_VER
327 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
328 # define alloca _alloca
330 # define YYSTACK_ALLOC alloca
331 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
332 || defined __cplusplus || defined _MSC_VER)
333 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
342 # ifdef YYSTACK_ALLOC
343 /* Pacify GCC's `empty if-body' warning. */
344 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
345 # ifndef YYSTACK_ALLOC_MAXIMUM
346 /* The OS might guarantee only one guard page at the bottom of the stack,
347 and a page size can be as small as 4096 bytes. So we cannot safely
348 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
349 to allow for a few compiler-allocated temporary stack slots. */
350 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
353 # define YYSTACK_ALLOC YYMALLOC
354 # define YYSTACK_FREE YYFREE
355 # ifndef YYSTACK_ALLOC_MAXIMUM
356 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
358 # if (defined __cplusplus && ! defined _STDLIB_H \
359 && ! ((defined YYMALLOC || defined malloc) \
360 && (defined YYFREE || defined free)))
361 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
367 # define YYMALLOC malloc
368 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
369 || defined __cplusplus || defined _MSC_VER)
370 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
375 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
376 || defined __cplusplus || defined _MSC_VER)
377 void free (void *); /* INFRINGES ON USER NAME SPACE */
381 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
384 #if (! defined yyoverflow \
385 && (! defined __cplusplus \
386 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
388 /* A type that is properly aligned for any stack member. */
391 yytype_int16 yyss_alloc
;
395 /* The size of the maximum gap between one aligned stack and the next. */
396 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
398 /* The size of an array large to enough to hold all stacks, each with
400 # define YYSTACK_BYTES(N) \
401 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
402 + YYSTACK_GAP_MAXIMUM)
404 /* Copy COUNT objects from FROM to TO. The source and destination do
407 # if defined __GNUC__ && 1 < __GNUC__
408 # define YYCOPY(To, From, Count) \
409 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
411 # define YYCOPY(To, From, Count) \
415 for (yyi = 0; yyi < (Count); yyi++) \
416 (To)[yyi] = (From)[yyi]; \
422 /* Relocate STACK from its old location to the new one. The
423 local variables YYSIZE and YYSTACKSIZE give the old and new number of
424 elements in the stack, and YYPTR gives the new location of the
425 stack. Advance YYPTR to a properly aligned location for the next
427 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
430 YYSIZE_T yynewbytes; \
431 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
432 Stack = &yyptr->Stack_alloc; \
433 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
434 yyptr += yynewbytes / sizeof (*yyptr); \
440 /* YYFINAL -- State number of the termination state. */
442 /* YYLAST -- Last index in YYTABLE. */
445 /* YYNTOKENS -- Number of terminals. */
447 /* YYNNTS -- Number of nonterminals. */
449 /* YYNRULES -- Number of rules. */
451 /* YYNRULES -- Number of states. */
454 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
456 #define YYMAXUTOK 327
458 #define YYTRANSLATE(YYX) \
459 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
461 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
462 static const yytype_uint8 yytranslate
[] =
464 0, 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, 75, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 64, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 65, 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, 2, 2, 2, 2,
483 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
486 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
487 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
488 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
489 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
490 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
491 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
492 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
493 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
494 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
495 55, 56, 57, 58, 59, 60, 61, 62, 63, 66,
496 67, 68, 69, 70, 71, 72, 73, 74
500 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
502 static const yytype_uint8 yyprhs
[] =
504 0, 0, 3, 5, 9, 11, 13, 15, 17, 19,
505 21, 23, 27, 30, 33, 36, 38, 41, 44, 47,
506 50, 53, 55, 57, 59, 61, 63, 65, 67, 69,
507 71, 73, 75, 77, 79, 81, 83, 85, 87, 89,
508 91, 93, 95, 97, 99, 101, 103, 105, 107, 109,
509 111, 113, 115, 117, 121, 124, 126, 128, 131, 133,
510 135, 137, 139, 141, 143, 145, 147, 149, 151, 153,
514 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
515 static const yytype_int8 yyrhs
[] =
517 77, 0, -1, 78, -1, 77, 75, 78, -1, 79,
518 -1, 3, -1, 10, -1, 4, -1, 5, -1, 6,
519 -1, 7, -1, 8, 75, 86, -1, 11, 84, -1,
520 13, 83, -1, 9, 86, -1, 80, -1, 49, 86,
521 -1, 22, 87, -1, 23, 85, -1, 29, 85, -1,
522 81, 66, -1, 82, -1, 46, -1, 20, -1, 27,
523 -1, 25, -1, 26, -1, 32, -1, 33, -1, 35,
524 -1, 36, -1, 37, -1, 38, -1, 39, -1, 40,
525 -1, 16, -1, 17, -1, 18, -1, 19, -1, 21,
526 -1, 24, -1, 28, -1, 30, -1, 31, -1, 34,
527 -1, 41, -1, 42, -1, 43, -1, 44, -1, 45,
528 -1, 47, -1, 48, -1, 84, -1, 83, 64, 84,
529 -1, 69, 66, -1, 68, -1, 72, -1, 71, 66,
530 -1, 70, -1, 50, -1, 51, -1, 52, -1, 53,
531 -1, 54, -1, 55, -1, 56, -1, 57, -1, 58,
532 -1, 72, -1, 73, -1, 59, -1, 60, -1, 61,
536 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
537 static const yytype_uint16 yyrline
[] =
539 0, 166, 166, 167, 171, 173, 175, 177, 182, 187,
540 191, 195, 206, 213, 216, 220, 224, 231, 238, 245,
541 252, 259, 266, 272, 276, 280, 284, 288, 292, 296,
542 300, 304, 308, 312, 316, 323, 327, 331, 335, 339,
543 343, 347, 351, 355, 359, 363, 367, 371, 375, 379,
544 383, 387, 394, 401, 411, 417, 423, 429, 435, 444,
545 448, 452, 456, 460, 464, 468, 472, 476, 483, 487,
550 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
551 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
552 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
553 static const char *const yytname
[] =
555 "$end", "error", "$undefined", "COMMENT", "END", "ERROR", "RESET",
556 "PARSER_DEBUG", "INCLUDE", "CONFIGURE_FILE", "EMPTY_LINE", "SERVER",
557 "SERVERS", "SERVERS_OPTION", "UNKNOWN_OPTION", "UNKNOWN",
558 "AUTO_EJECT_HOSTS", "BINARY_PROTOCOL", "BUFFER_REQUESTS",
559 "CACHE_LOOKUPS", "CONNECT_TIMEOUT", "_CORK", "DISTRIBUTION", "HASH",
560 "HASH_WITH_PREFIX_KEY", "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH",
561 "IO_MSG_WATERMARK", "KETAMA", "KETAMA_HASH", "KETAMA_WEIGHTED",
562 "NOREPLY", "NUMBER_OF_REPLICAS", "POLL_TIMEOUT",
563 "RANDOMIZE_REPLICA_READ", "RCV_TIMEOUT", "RETRY_TIMEOUT",
564 "SERVER_FAILURE_LIMIT", "SND_TIMEOUT", "SOCKET_RECV_SIZE",
565 "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS", "_TCP_NODELAY",
566 "_TCP_KEEPALIVE", "_TCP_KEEPIDLE", "USER_DATA", "USE_UDP", "VERIFY_KEY",
567 "PREFIX_KEY", "MD5", "CRC", "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32",
568 "HSIEH", "MURMUR", "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE",
569 "FALSE", "','", "'='", "NUMBER", "FLOAT", "HOSTNAME",
570 "HOSTNAME_WITH_PORT", "IPADDRESS", "IPADDRESS_WITH_PORT", "STRING",
571 "QUOTED_STRING", "FILE_PATH", "' '", "$accept", "begin", "statement",
572 "expression", "behaviors", "behavior_number", "behavior_boolean",
573 "server_list", "server", "hash", "string", "distribution", 0
578 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
580 static const yytype_uint16 yytoknum
[] =
582 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
583 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
584 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
585 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
586 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
587 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
588 315, 316, 317, 318, 44, 61, 319, 320, 321, 322,
589 323, 324, 325, 326, 327, 32
593 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
594 static const yytype_uint8 yyr1
[] =
596 0, 76, 77, 77, 78, 78, 78, 78, 78, 78,
597 78, 78, 79, 79, 79, 79, 80, 80, 80, 80,
598 80, 80, 80, 81, 81, 81, 81, 81, 81, 81,
599 81, 81, 81, 81, 81, 82, 82, 82, 82, 82,
600 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
601 82, 82, 83, 83, 84, 84, 84, 84, 84, 85,
602 85, 85, 85, 85, 85, 85, 85, 85, 86, 86,
606 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
607 static const yytype_uint8 yyr2
[] =
609 0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
610 1, 3, 2, 2, 2, 1, 2, 2, 2, 2,
611 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
612 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
613 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
614 1, 1, 1, 3, 2, 1, 1, 2, 1, 1,
615 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
619 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
620 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
621 means the default is an error. */
622 static const yytype_uint8 yydefact
[] =
624 0, 5, 7, 8, 9, 10, 0, 0, 6, 0,
625 0, 35, 36, 37, 38, 23, 39, 0, 0, 40,
626 25, 26, 24, 41, 0, 42, 43, 27, 28, 44,
627 29, 30, 31, 32, 33, 34, 45, 46, 47, 48,
628 49, 22, 50, 51, 0, 0, 2, 4, 15, 0,
629 21, 0, 68, 69, 14, 55, 0, 58, 0, 56,
630 12, 13, 52, 70, 71, 72, 17, 59, 60, 61,
631 62, 63, 64, 65, 66, 67, 18, 19, 16, 1,
632 0, 20, 11, 54, 57, 0, 3, 53
635 /* YYDEFGOTO[NTERM-NUM]. */
636 static const yytype_int8 yydefgoto
[] =
638 -1, 45, 46, 47, 48, 49, 50, 61, 60, 76,
642 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
644 #define YYPACT_NINF -65
645 static const yytype_int8 yypact
[] =
647 -1, -65, -65, -65, -65, -65, -64, -59, -65, -7,
648 -7, -65, -65, -65, -65, -65, -65, 9, 1, -65,
649 -65, -65, -65, -65, 1, -65, -65, -65, -65, -65,
650 -65, -65, -65, -65, -65, -65, -65, -65, -65, -65,
651 -65, -65, -65, -65, -59, 0, -65, -65, -65, -17,
652 -65, -59, -65, -65, -65, -65, -16, -65, 5, -65,
653 -65, 2, -65, -65, -65, -65, -65, -65, -65, -65,
654 -65, -65, -65, -65, -65, -65, -65, -65, -65, -65,
655 -1, -65, -65, -65, -65, -7, -65, -65
658 /* YYPGOTO[NTERM-NUM]. */
659 static const yytype_int8 yypgoto
[] =
661 -65, -65, -8, -65, -65, -65, -65, -65, -9, 49,
665 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
666 positive, shift that token. If negative, reduce the rule which
667 number is the opposite. If zero, do what YYDEFACT says.
668 If YYTABLE_NINF, syntax error. */
669 #define YYTABLE_NINF -1
670 static const yytype_uint8 yytable
[] =
672 79, 62, 1, 2, 3, 4, 5, 6, 7, 8,
673 9, 51, 10, 52, 53, 11, 12, 13, 14, 15,
674 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
675 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
676 36, 37, 38, 39, 40, 41, 42, 43, 44, 81,
677 83, 67, 68, 69, 70, 71, 72, 73, 74, 75,
678 78, 55, 56, 57, 58, 59, 85, 82, 63, 64,
679 65, 84, 86, 77, 0, 80, 87
682 static const yytype_int8 yycheck
[] =
684 0, 10, 3, 4, 5, 6, 7, 8, 9, 10,
685 11, 75, 13, 72, 73, 16, 17, 18, 19, 20,
686 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
687 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
688 41, 42, 43, 44, 45, 46, 47, 48, 49, 66,
689 66, 50, 51, 52, 53, 54, 55, 56, 57, 58,
690 44, 68, 69, 70, 71, 72, 64, 51, 59, 60,
691 61, 66, 80, 24, -1, 75, 85
694 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
695 symbol of state STATE-NUM. */
696 static const yytype_uint8 yystos
[] =
698 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
699 13, 16, 17, 18, 19, 20, 21, 22, 23, 24,
700 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
701 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
702 45, 46, 47, 48, 49, 77, 78, 79, 80, 81,
703 82, 75, 72, 73, 86, 68, 69, 70, 71, 72,
704 84, 83, 84, 59, 60, 61, 87, 50, 51, 52,
705 53, 54, 55, 56, 57, 58, 85, 85, 86, 0,
706 75, 66, 86, 66, 66, 64, 78, 84
709 #define yyerrok (yyerrstatus = 0)
710 #define yyclearin (yychar = YYEMPTY)
714 #define YYACCEPT goto yyacceptlab
715 #define YYABORT goto yyabortlab
716 #define YYERROR goto yyerrorlab
719 /* Like YYERROR except do call yyerror. This remains here temporarily
720 to ease the transition to the new meaning of YYERROR, for GCC.
721 Once GCC version 2 has supplanted version 1, this can go. However,
722 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
723 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
726 #define YYFAIL goto yyerrlab
728 /* This is here to suppress warnings from the GCC cpp's
729 -Wunused-macros. Normally we don't worry about that warning, but
730 some users do, and we want to make it easy for users to remove
731 YYFAIL uses, which will produce warnings from Bison 2.5. */
734 #define YYRECOVERING() (!!yyerrstatus)
736 #define YYBACKUP(Token, Value) \
738 if (yychar == YYEMPTY && yylen == 1) \
742 yytoken = YYTRANSLATE (yychar); \
748 yyerror (context, scanner, YY_("syntax error: cannot back up")); \
755 #define YYERRCODE 256
758 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
759 If N is 0, then set CURRENT to the empty location which ends
760 the previous symbol: RHS[0] (always defined). */
762 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
763 #ifndef YYLLOC_DEFAULT
764 # define YYLLOC_DEFAULT(Current, Rhs, N) \
768 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
769 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
770 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
771 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
775 (Current).first_line = (Current).last_line = \
776 YYRHSLOC (Rhs, 0).last_line; \
777 (Current).first_column = (Current).last_column = \
778 YYRHSLOC (Rhs, 0).last_column; \
784 /* YY_LOCATION_PRINT -- Print the location on the stream.
785 This macro was not mandated originally: define only if we know
786 we won't break user code: when these are the locations we know. */
788 #ifndef YY_LOCATION_PRINT
789 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
790 # define YY_LOCATION_PRINT(File, Loc) \
791 fprintf (File, "%d.%d-%d.%d", \
792 (Loc).first_line, (Loc).first_column, \
793 (Loc).last_line, (Loc).last_column)
795 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
800 /* YYLEX -- calling `yylex' with the right arguments. */
803 # define YYLEX yylex (&yylval, YYLEX_PARAM)
805 # define YYLEX yylex (&yylval, scanner)
808 /* Enable debugging if requested. */
812 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
813 # define YYFPRINTF fprintf
816 # define YYDPRINTF(Args) \
822 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
826 YYFPRINTF (stderr, "%s ", Title); \
827 yy_symbol_print (stderr, \
828 Type, Value, context, scanner); \
829 YYFPRINTF (stderr, "\n"); \
834 /*--------------------------------.
835 | Print this symbol on YYOUTPUT. |
836 `--------------------------------*/
839 #if (defined __STDC__ || defined __C99__FUNC__ \
840 || defined __cplusplus || defined _MSC_VER)
842 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
845 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
848 YYSTYPE
const * const yyvaluep
;
858 if (yytype
< YYNTOKENS
)
859 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
871 /*--------------------------------.
872 | Print this symbol on YYOUTPUT. |
873 `--------------------------------*/
875 #if (defined __STDC__ || defined __C99__FUNC__ \
876 || defined __cplusplus || defined _MSC_VER)
878 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
881 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
884 YYSTYPE
const * const yyvaluep
;
889 if (yytype
< YYNTOKENS
)
890 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
892 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
894 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
);
895 YYFPRINTF (yyoutput
, ")");
898 /*------------------------------------------------------------------.
899 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
901 `------------------------------------------------------------------*/
903 #if (defined __STDC__ || defined __C99__FUNC__ \
904 || defined __cplusplus || defined _MSC_VER)
906 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
909 yy_stack_print (yybottom
, yytop
)
910 yytype_int16
*yybottom
;
914 YYFPRINTF (stderr
, "Stack now");
915 for (; yybottom
<= yytop
; yybottom
++)
917 int yybot
= *yybottom
;
918 YYFPRINTF (stderr
, " %d", yybot
);
920 YYFPRINTF (stderr
, "\n");
923 # define YY_STACK_PRINT(Bottom, Top) \
926 yy_stack_print ((Bottom), (Top)); \
930 /*------------------------------------------------.
931 | Report that the YYRULE is going to be reduced. |
932 `------------------------------------------------*/
934 #if (defined __STDC__ || defined __C99__FUNC__ \
935 || defined __cplusplus || defined _MSC_VER)
937 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
, Context
*context
, yyscan_t
*scanner
)
940 yy_reduce_print (yyvsp
, yyrule
, context
, scanner
)
947 int yynrhs
= yyr2
[yyrule
];
949 unsigned long int yylno
= yyrline
[yyrule
];
950 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
952 /* The symbols being reduced. */
953 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
955 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
956 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
957 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
959 YYFPRINTF (stderr
, "\n");
963 # define YY_REDUCE_PRINT(Rule) \
966 yy_reduce_print (yyvsp, Rule, context, scanner); \
969 /* Nonzero means print parse trace. It is left uninitialized so that
970 multiple parsers can coexist. */
973 # define YYDPRINTF(Args)
974 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
975 # define YY_STACK_PRINT(Bottom, Top)
976 # define YY_REDUCE_PRINT(Rule)
977 #endif /* !YYDEBUG */
980 /* YYINITDEPTH -- initial size of the parser's stacks. */
982 # define YYINITDEPTH 200
985 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
986 if the built-in stack extension method is used).
988 Do not make this value too large; the results are undefined if
989 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
990 evaluated with infinite-precision integer arithmetic. */
993 # define YYMAXDEPTH 10000
1001 # if defined __GLIBC__ && defined _STRING_H
1002 # define yystrlen strlen
1004 /* Return the length of YYSTR. */
1005 #if (defined __STDC__ || defined __C99__FUNC__ \
1006 || defined __cplusplus || defined _MSC_VER)
1008 yystrlen (const char *yystr
)
1016 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1024 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1025 # define yystpcpy stpcpy
1027 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1029 #if (defined __STDC__ || defined __C99__FUNC__ \
1030 || defined __cplusplus || defined _MSC_VER)
1032 yystpcpy (char *yydest
, const char *yysrc
)
1035 yystpcpy (yydest
, yysrc
)
1041 const char *yys
= yysrc
;
1043 while ((*yyd
++ = *yys
++) != '\0')
1052 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1053 quotes and backslashes, so that it's suitable for yyerror. The
1054 heuristic is that double-quoting is unnecessary unless the string
1055 contains an apostrophe, a comma, or backslash (other than
1056 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1057 null, do not copy; instead, return the length of what the result
1060 yytnamerr (char *yyres
, const char *yystr
)
1065 char const *yyp
= yystr
;
1072 goto do_not_strip_quotes
;
1076 goto do_not_strip_quotes
;
1089 do_not_strip_quotes
: ;
1093 return yystrlen (yystr
);
1095 return yystpcpy (yyres
, yystr
) - yyres
;
1099 /* Copy into YYRESULT an error message about the unexpected token
1100 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1101 including the terminating null byte. If YYRESULT is null, do not
1102 copy anything; just return the number of bytes that would be
1103 copied. As a special case, return 0 if an ordinary "syntax error"
1104 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1105 size calculation. */
1107 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1109 int yyn
= yypact
[yystate
];
1111 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1115 int yytype
= YYTRANSLATE (yychar
);
1116 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1117 YYSIZE_T yysize
= yysize0
;
1119 int yysize_overflow
= 0;
1120 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1121 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1125 /* This is so xgettext sees the translatable formats that are
1126 constructed on the fly. */
1127 YY_("syntax error, unexpected %s");
1128 YY_("syntax error, unexpected %s, expecting %s");
1129 YY_("syntax error, unexpected %s, expecting %s or %s");
1130 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1131 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1135 static char const yyunexpected
[] = "syntax error, unexpected %s";
1136 static char const yyexpecting
[] = ", expecting %s";
1137 static char const yyor
[] = " or %s";
1138 char yyformat
[sizeof yyunexpected
1139 + sizeof yyexpecting
- 1
1140 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1141 * (sizeof yyor
- 1))];
1142 char const *yyprefix
= yyexpecting
;
1144 /* Start YYX at -YYN if negative to avoid negative indexes in
1146 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1148 /* Stay within bounds of both yycheck and yytname. */
1149 int yychecklim
= YYLAST
- yyn
+ 1;
1150 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1153 yyarg
[0] = yytname
[yytype
];
1154 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1156 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1157 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1159 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1163 yyformat
[sizeof yyunexpected
- 1] = '\0';
1166 yyarg
[yycount
++] = yytname
[yyx
];
1167 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1168 yysize_overflow
|= (yysize1
< yysize
);
1170 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1174 yyf
= YY_(yyformat
);
1175 yysize1
= yysize
+ yystrlen (yyf
);
1176 yysize_overflow
|= (yysize1
< yysize
);
1179 if (yysize_overflow
)
1180 return YYSIZE_MAXIMUM
;
1184 /* Avoid sprintf, as that infringes on the user's name space.
1185 Don't have undefined behavior even if the translation
1186 produced a string with the wrong number of "%s"s. */
1187 char *yyp
= yyresult
;
1189 while ((*yyp
= *yyf
) != '\0')
1191 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1193 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1206 #endif /* YYERROR_VERBOSE */
1209 /*-----------------------------------------------.
1210 | Release the memory associated to this symbol. |
1211 `-----------------------------------------------*/
1214 #if (defined __STDC__ || defined __C99__FUNC__ \
1215 || defined __cplusplus || defined _MSC_VER)
1217 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, Context
*context
, yyscan_t
*scanner
)
1220 yydestruct (yymsg
, yytype
, yyvaluep
, context
, scanner
)
1234 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1244 /* Prevent warnings from -Wmissing-prototypes. */
1245 #ifdef YYPARSE_PARAM
1246 #if defined __STDC__ || defined __cplusplus
1247 int yyparse (void *YYPARSE_PARAM
);
1251 #else /* ! YYPARSE_PARAM */
1252 #if defined __STDC__ || defined __cplusplus
1253 int yyparse (Context
*context
, yyscan_t
*scanner
);
1257 #endif /* ! YYPARSE_PARAM */
1263 /*-------------------------.
1264 | yyparse or yypush_parse. |
1265 `-------------------------*/
1267 #ifdef YYPARSE_PARAM
1268 #if (defined __STDC__ || defined __C99__FUNC__ \
1269 || defined __cplusplus || defined _MSC_VER)
1271 yyparse (void *YYPARSE_PARAM
)
1274 yyparse (YYPARSE_PARAM
)
1275 void *YYPARSE_PARAM
;
1277 #else /* ! YYPARSE_PARAM */
1278 #if (defined __STDC__ || defined __C99__FUNC__ \
1279 || defined __cplusplus || defined _MSC_VER)
1281 yyparse (Context
*context
, yyscan_t
*scanner
)
1284 yyparse (context
, scanner
)
1290 /* The lookahead symbol. */
1293 /* The semantic value of the lookahead symbol. */
1296 /* Number of syntax errors so far. */
1300 /* Number of tokens to shift before error messages enabled. */
1303 /* The stacks and their tools:
1304 `yyss': related to states.
1305 `yyvs': related to semantic values.
1307 Refer to the stacks thru separate pointers, to allow yyoverflow
1308 to reallocate them elsewhere. */
1310 /* The state stack. */
1311 yytype_int16 yyssa
[YYINITDEPTH
];
1313 yytype_int16
*yyssp
;
1315 /* The semantic value stack. */
1316 YYSTYPE yyvsa
[YYINITDEPTH
];
1320 YYSIZE_T yystacksize
;
1324 /* Lookahead token as an internal (translated) token number. */
1326 /* The variables used to return semantic value and location from the
1331 /* Buffer for error messages, and its allocated size. */
1333 char *yymsg
= yymsgbuf
;
1334 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1337 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1339 /* The number of symbols on the RHS of the reduced rule.
1340 Keep to zero when no symbol should be popped. */
1346 yystacksize
= YYINITDEPTH
;
1348 YYDPRINTF ((stderr
, "Starting parse\n"));
1353 yychar
= YYEMPTY
; /* Cause a token to be read. */
1355 /* Initialize stack pointers.
1356 Waste one element of value and location stack
1357 so that they stay on the same level as the state stack.
1358 The wasted elements are never initialized. */
1364 /*------------------------------------------------------------.
1365 | yynewstate -- Push a new state, which is found in yystate. |
1366 `------------------------------------------------------------*/
1368 /* In all cases, when you get here, the value and location stacks
1369 have just been pushed. So pushing a state here evens the stacks. */
1375 if (yyss
+ yystacksize
- 1 <= yyssp
)
1377 /* Get the current used size of the three stacks, in elements. */
1378 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1382 /* Give user a chance to reallocate the stack. Use copies of
1383 these so that the &'s don't force the real ones into
1385 YYSTYPE
*yyvs1
= yyvs
;
1386 yytype_int16
*yyss1
= yyss
;
1388 /* Each stack pointer address is followed by the size of the
1389 data in use in that stack, in bytes. This used to be a
1390 conditional around just the two extra args, but that might
1391 be undefined if yyoverflow is a macro. */
1392 yyoverflow (YY_("memory exhausted"),
1393 &yyss1
, yysize
* sizeof (*yyssp
),
1394 &yyvs1
, yysize
* sizeof (*yyvsp
),
1400 #else /* no yyoverflow */
1401 # ifndef YYSTACK_RELOCATE
1402 goto yyexhaustedlab
;
1404 /* Extend the stack our own way. */
1405 if (YYMAXDEPTH
<= yystacksize
)
1406 goto yyexhaustedlab
;
1408 if (YYMAXDEPTH
< yystacksize
)
1409 yystacksize
= YYMAXDEPTH
;
1412 yytype_int16
*yyss1
= yyss
;
1413 union yyalloc
*yyptr
=
1414 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1416 goto yyexhaustedlab
;
1417 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1418 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1419 # undef YYSTACK_RELOCATE
1421 YYSTACK_FREE (yyss1
);
1424 #endif /* no yyoverflow */
1426 yyssp
= yyss
+ yysize
- 1;
1427 yyvsp
= yyvs
+ yysize
- 1;
1429 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1430 (unsigned long int) yystacksize
));
1432 if (yyss
+ yystacksize
- 1 <= yyssp
)
1436 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1438 if (yystate
== YYFINAL
)
1448 /* Do appropriate processing given the current state. Read a
1449 lookahead token if we need one and don't already have one. */
1451 /* First try to decide what to do without reference to lookahead token. */
1452 yyn
= yypact
[yystate
];
1453 if (yyn
== YYPACT_NINF
)
1456 /* Not known => get a lookahead token if don't already have one. */
1458 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1459 if (yychar
== YYEMPTY
)
1461 YYDPRINTF ((stderr
, "Reading a token: "));
1465 if (yychar
<= YYEOF
)
1467 yychar
= yytoken
= YYEOF
;
1468 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1472 yytoken
= YYTRANSLATE (yychar
);
1473 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1476 /* If the proper action on seeing token YYTOKEN is to reduce or to
1477 detect an error, take that action. */
1479 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1484 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1490 /* Count tokens shifted since error; after three, turn off error
1495 /* Shift the lookahead token. */
1496 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1498 /* Discard the shifted token. */
1507 /*-----------------------------------------------------------.
1508 | yydefault -- do the default action for the current state. |
1509 `-----------------------------------------------------------*/
1511 yyn
= yydefact
[yystate
];
1517 /*-----------------------------.
1518 | yyreduce -- Do a reduction. |
1519 `-----------------------------*/
1521 /* yyn is the number of a rule to reduce with. */
1524 /* If YYLEN is nonzero, implement the default value of the action:
1527 Otherwise, the following line sets YYVAL to garbage.
1528 This behavior is undocumented and Bison
1529 users should not rely upon it. Assigning to YYVAL
1530 unconditionally makes the parser a bit smaller, and it avoids a
1531 GCC warning that YYVAL may be used uninitialized. */
1532 yyval
= yyvsp
[1-yylen
];
1535 YY_REDUCE_PRINT (yyn
);
1540 /* Line 1464 of yacc.c */
1541 #line 172 "libmemcached/options/parser.yy"
1547 /* Line 1464 of yacc.c */
1548 #line 174 "libmemcached/options/parser.yy"
1554 /* Line 1464 of yacc.c */
1555 #line 176 "libmemcached/options/parser.yy"
1561 /* Line 1464 of yacc.c */
1562 #line 178 "libmemcached/options/parser.yy"
1571 /* Line 1464 of yacc.c */
1572 #line 183 "libmemcached/options/parser.yy"
1574 context
->rc
= MEMCACHED_PARSE_USER_ERROR
;
1575 parser_abort(context
, NULL
);
1581 /* Line 1464 of yacc.c */
1582 #line 188 "libmemcached/options/parser.yy"
1584 memcached_reset(context
->memc
);
1590 /* Line 1464 of yacc.c */
1591 #line 192 "libmemcached/options/parser.yy"
1599 /* Line 1464 of yacc.c */
1600 #line 196 "libmemcached/options/parser.yy"
1602 if ((context
->rc
= memcached_parse_configure_file(context
->memc
, (yyvsp
[(3) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].string
).length
)) != MEMCACHED_SUCCESS
)
1604 parser_abort(context
, NULL
);
1611 /* Line 1464 of yacc.c */
1612 #line 207 "libmemcached/options/parser.yy"
1614 if ((context
->rc
= memcached_server_add_parsed(context
->memc
, (yyvsp
[(2) - (2)].server
).c_str
, (yyvsp
[(2) - (2)].server
).length
, (yyvsp
[(2) - (2)].server
).port
, 0)) != MEMCACHED_SUCCESS
)
1616 parser_abort(context
, NULL
);
1623 /* Line 1464 of yacc.c */
1624 #line 214 "libmemcached/options/parser.yy"
1631 /* Line 1464 of yacc.c */
1632 #line 217 "libmemcached/options/parser.yy"
1634 memcached_set_configuration_file(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).length
);
1640 /* Line 1464 of yacc.c */
1641 #line 225 "libmemcached/options/parser.yy"
1643 if ((context
->rc
= memcached_set_prefix_key(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).length
)) != MEMCACHED_SUCCESS
)
1645 parser_abort(context
, NULL
);;
1652 /* Line 1464 of yacc.c */
1653 #line 232 "libmemcached/options/parser.yy"
1655 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1657 parser_abort(context
, NULL
);;
1664 /* Line 1464 of yacc.c */
1665 #line 239 "libmemcached/options/parser.yy"
1667 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_HASH
, (yyvsp
[(2) - (2)].hash
))) != MEMCACHED_SUCCESS
)
1669 parser_abort(context
, NULL
);;
1676 /* Line 1464 of yacc.c */
1677 #line 246 "libmemcached/options/parser.yy"
1679 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_KETAMA_HASH
, (yyvsp
[(2) - (2)].hash
))) != MEMCACHED_SUCCESS
)
1681 parser_abort(context
, NULL
);;
1688 /* Line 1464 of yacc.c */
1689 #line 253 "libmemcached/options/parser.yy"
1691 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (2)].behavior
), (yyvsp
[(2) - (2)].number
))) != MEMCACHED_SUCCESS
)
1693 parser_abort(context
, NULL
);;
1700 /* Line 1464 of yacc.c */
1701 #line 260 "libmemcached/options/parser.yy"
1703 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (1)].behavior
), true)) != MEMCACHED_SUCCESS
)
1705 parser_abort(context
, NULL
);;
1712 /* Line 1464 of yacc.c */
1713 #line 267 "libmemcached/options/parser.yy"
1720 /* Line 1464 of yacc.c */
1721 #line 273 "libmemcached/options/parser.yy"
1723 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
;
1729 /* Line 1464 of yacc.c */
1730 #line 277 "libmemcached/options/parser.yy"
1732 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
;
1738 /* Line 1464 of yacc.c */
1739 #line 281 "libmemcached/options/parser.yy"
1741 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
;
1747 /* Line 1464 of yacc.c */
1748 #line 285 "libmemcached/options/parser.yy"
1750 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
;
1756 /* Line 1464 of yacc.c */
1757 #line 289 "libmemcached/options/parser.yy"
1759 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
;
1765 /* Line 1464 of yacc.c */
1766 #line 293 "libmemcached/options/parser.yy"
1768 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT
;
1774 /* Line 1464 of yacc.c */
1775 #line 297 "libmemcached/options/parser.yy"
1777 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT
;
1783 /* Line 1464 of yacc.c */
1784 #line 301 "libmemcached/options/parser.yy"
1786 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
;
1792 /* Line 1464 of yacc.c */
1793 #line 305 "libmemcached/options/parser.yy"
1795 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
;
1801 /* Line 1464 of yacc.c */
1802 #line 309 "libmemcached/options/parser.yy"
1804 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SND_TIMEOUT
;
1810 /* Line 1464 of yacc.c */
1811 #line 313 "libmemcached/options/parser.yy"
1813 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
;
1819 /* Line 1464 of yacc.c */
1820 #line 317 "libmemcached/options/parser.yy"
1822 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
;
1828 /* Line 1464 of yacc.c */
1829 #line 324 "libmemcached/options/parser.yy"
1831 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS
;
1837 /* Line 1464 of yacc.c */
1838 #line 328 "libmemcached/options/parser.yy"
1840 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
;
1846 /* Line 1464 of yacc.c */
1847 #line 332 "libmemcached/options/parser.yy"
1849 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
;
1855 /* Line 1464 of yacc.c */
1856 #line 336 "libmemcached/options/parser.yy"
1858 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CACHE_LOOKUPS
;
1864 /* Line 1464 of yacc.c */
1865 #line 340 "libmemcached/options/parser.yy"
1867 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CORK
;
1873 /* Line 1464 of yacc.c */
1874 #line 344 "libmemcached/options/parser.yy"
1876 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
;
1882 /* Line 1464 of yacc.c */
1883 #line 348 "libmemcached/options/parser.yy"
1885 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_KETAMA
;
1891 /* Line 1464 of yacc.c */
1892 #line 352 "libmemcached/options/parser.yy"
1894 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED
;
1900 /* Line 1464 of yacc.c */
1901 #line 356 "libmemcached/options/parser.yy"
1903 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NOREPLY
;
1909 /* Line 1464 of yacc.c */
1910 #line 360 "libmemcached/options/parser.yy"
1912 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
;
1918 /* Line 1464 of yacc.c */
1919 #line 364 "libmemcached/options/parser.yy"
1921 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SORT_HOSTS
;
1927 /* Line 1464 of yacc.c */
1928 #line 368 "libmemcached/options/parser.yy"
1930 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SUPPORT_CAS
;
1936 /* Line 1464 of yacc.c */
1937 #line 372 "libmemcached/options/parser.yy"
1939 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_NODELAY
;
1945 /* Line 1464 of yacc.c */
1946 #line 376 "libmemcached/options/parser.yy"
1948 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
;
1954 /* Line 1464 of yacc.c */
1955 #line 380 "libmemcached/options/parser.yy"
1957 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE
;
1963 /* Line 1464 of yacc.c */
1964 #line 384 "libmemcached/options/parser.yy"
1966 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_USE_UDP
;
1972 /* Line 1464 of yacc.c */
1973 #line 388 "libmemcached/options/parser.yy"
1975 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_VERIFY_KEY
;
1981 /* Line 1464 of yacc.c */
1982 #line 395 "libmemcached/options/parser.yy"
1984 if ((context
->rc
= memcached_server_add_parsed(context
->memc
, (yyvsp
[(1) - (1)].server
).c_str
, (yyvsp
[(1) - (1)].server
).length
, (yyvsp
[(1) - (1)].server
).port
, 0)) != MEMCACHED_SUCCESS
)
1986 parser_abort(context
, NULL
);;
1993 /* Line 1464 of yacc.c */
1994 #line 402 "libmemcached/options/parser.yy"
1996 if ((context
->rc
= memcached_server_add_parsed(context
->memc
, (yyvsp
[(3) - (3)].server
).c_str
, (yyvsp
[(3) - (3)].server
).length
, (yyvsp
[(3) - (3)].server
).port
, 0)) != MEMCACHED_SUCCESS
)
1998 parser_abort(context
, NULL
);;
2005 /* Line 1464 of yacc.c */
2006 #line 412 "libmemcached/options/parser.yy"
2008 (yyval
.server
).c_str
= (yyvsp
[(1) - (2)].string
).c_str
;
2009 (yyval
.server
).length
= (yyvsp
[(1) - (2)].string
).length
-1; // -1 to remove :
2010 (yyval
.server
).port
= (yyvsp
[(2) - (2)].number
);
2016 /* Line 1464 of yacc.c */
2017 #line 418 "libmemcached/options/parser.yy"
2019 (yyval
.server
).c_str
= (yyvsp
[(1) - (1)].string
).c_str
;
2020 (yyval
.server
).length
= (yyvsp
[(1) - (1)].string
).length
;
2021 (yyval
.server
).port
= MEMCACHED_DEFAULT_PORT
;
2027 /* Line 1464 of yacc.c */
2028 #line 424 "libmemcached/options/parser.yy"
2030 (yyval
.server
).c_str
= (yyvsp
[(1) - (1)].string
).c_str
;
2031 (yyval
.server
).length
= (yyvsp
[(1) - (1)].string
).length
;
2032 (yyval
.server
).port
= MEMCACHED_DEFAULT_PORT
;
2038 /* Line 1464 of yacc.c */
2039 #line 430 "libmemcached/options/parser.yy"
2041 (yyval
.server
).c_str
= (yyvsp
[(1) - (2)].string
).c_str
;
2042 (yyval
.server
).length
= (yyvsp
[(1) - (2)].string
).length
-1; // -1 to remove :
2043 (yyval
.server
).port
= (yyvsp
[(2) - (2)].number
);
2049 /* Line 1464 of yacc.c */
2050 #line 436 "libmemcached/options/parser.yy"
2052 (yyval
.server
).c_str
= (yyvsp
[(1) - (1)].string
).c_str
;
2053 (yyval
.server
).length
= (yyvsp
[(1) - (1)].string
).length
;
2054 (yyval
.server
).port
= MEMCACHED_DEFAULT_PORT
;
2060 /* Line 1464 of yacc.c */
2061 #line 445 "libmemcached/options/parser.yy"
2063 (yyval
.hash
)= MEMCACHED_HASH_MD5
;
2069 /* Line 1464 of yacc.c */
2070 #line 449 "libmemcached/options/parser.yy"
2072 (yyval
.hash
)= MEMCACHED_HASH_CRC
;
2078 /* Line 1464 of yacc.c */
2079 #line 453 "libmemcached/options/parser.yy"
2081 (yyval
.hash
)= MEMCACHED_HASH_FNV1_64
;
2087 /* Line 1464 of yacc.c */
2088 #line 457 "libmemcached/options/parser.yy"
2090 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_64
;
2096 /* Line 1464 of yacc.c */
2097 #line 461 "libmemcached/options/parser.yy"
2099 (yyval
.hash
)= MEMCACHED_HASH_FNV1_32
;
2105 /* Line 1464 of yacc.c */
2106 #line 465 "libmemcached/options/parser.yy"
2108 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_32
;
2114 /* Line 1464 of yacc.c */
2115 #line 469 "libmemcached/options/parser.yy"
2117 (yyval
.hash
)= MEMCACHED_HASH_HSIEH
;
2123 /* Line 1464 of yacc.c */
2124 #line 473 "libmemcached/options/parser.yy"
2126 (yyval
.hash
)= MEMCACHED_HASH_MURMUR
;
2132 /* Line 1464 of yacc.c */
2133 #line 477 "libmemcached/options/parser.yy"
2135 (yyval
.hash
)= MEMCACHED_HASH_JENKINS
;
2141 /* Line 1464 of yacc.c */
2142 #line 484 "libmemcached/options/parser.yy"
2144 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2150 /* Line 1464 of yacc.c */
2151 #line 488 "libmemcached/options/parser.yy"
2153 (yyval
.string
).c_str
= (yyvsp
[(1) - (1)].string
).c_str
+1; // +1 to move use passed the initial quote
2154 (yyval
.string
).length
= (yyvsp
[(1) - (1)].string
).length
-1; // -1 removes the end quote
2160 /* Line 1464 of yacc.c */
2161 #line 496 "libmemcached/options/parser.yy"
2163 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_CONSISTENT
;
2169 /* Line 1464 of yacc.c */
2170 #line 500 "libmemcached/options/parser.yy"
2172 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_MODULA
;
2178 /* Line 1464 of yacc.c */
2179 #line 504 "libmemcached/options/parser.yy"
2181 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_RANDOM
;
2187 /* Line 1464 of yacc.c */
2188 #line 2189 "libmemcached/options/parser.cc"
2191 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2195 YY_STACK_PRINT (yyss
, yyssp
);
2199 /* Now `shift' the result of the reduction. Determine what state
2200 that goes to, based on the state we popped back to and the rule
2201 number reduced by. */
2205 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2206 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2207 yystate
= yytable
[yystate
];
2209 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2214 /*------------------------------------.
2215 | yyerrlab -- here on detecting error |
2216 `------------------------------------*/
2218 /* If not already recovering from an error, report this error. */
2222 #if ! YYERROR_VERBOSE
2223 yyerror (context
, scanner
, YY_("syntax error"));
2226 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2227 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2229 YYSIZE_T yyalloc
= 2 * yysize
;
2230 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2231 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2232 if (yymsg
!= yymsgbuf
)
2233 YYSTACK_FREE (yymsg
);
2234 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2236 yymsg_alloc
= yyalloc
;
2240 yymsg_alloc
= sizeof yymsgbuf
;
2244 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2246 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2247 yyerror (context
, scanner
, yymsg
);
2251 yyerror (context
, scanner
, YY_("syntax error"));
2253 goto yyexhaustedlab
;
2261 if (yyerrstatus
== 3)
2263 /* If just tried and failed to reuse lookahead token after an
2264 error, discard it. */
2266 if (yychar
<= YYEOF
)
2268 /* Return failure if at end of input. */
2269 if (yychar
== YYEOF
)
2274 yydestruct ("Error: discarding",
2275 yytoken
, &yylval
, context
, scanner
);
2280 /* Else will try to reuse lookahead token after shifting the error
2285 /*---------------------------------------------------.
2286 | yyerrorlab -- error raised explicitly by YYERROR. |
2287 `---------------------------------------------------*/
2290 /* Pacify compilers like GCC when the user code never invokes
2291 YYERROR and the label yyerrorlab therefore never appears in user
2293 if (/*CONSTCOND*/ 0)
2296 /* Do not reclaim the symbols of the rule which action triggered
2300 YY_STACK_PRINT (yyss
, yyssp
);
2305 /*-------------------------------------------------------------.
2306 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2307 `-------------------------------------------------------------*/
2309 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2313 yyn
= yypact
[yystate
];
2314 if (yyn
!= YYPACT_NINF
)
2317 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2325 /* Pop the current state because it cannot handle the error token. */
2330 yydestruct ("Error: popping",
2331 yystos
[yystate
], yyvsp
, context
, scanner
);
2334 YY_STACK_PRINT (yyss
, yyssp
);
2340 /* Shift the error token. */
2341 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2347 /*-------------------------------------.
2348 | yyacceptlab -- YYACCEPT comes here. |
2349 `-------------------------------------*/
2354 /*-----------------------------------.
2355 | yyabortlab -- YYABORT comes here. |
2356 `-----------------------------------*/
2361 #if !defined(yyoverflow) || YYERROR_VERBOSE
2362 /*-------------------------------------------------.
2363 | yyexhaustedlab -- memory exhaustion comes here. |
2364 `-------------------------------------------------*/
2366 yyerror (context
, scanner
, YY_("memory exhausted"));
2372 if (yychar
!= YYEMPTY
)
2373 yydestruct ("Cleanup: discarding lookahead",
2374 yytoken
, &yylval
, context
, scanner
);
2375 /* Do not reclaim the symbols of the rule which action triggered
2376 this YYABORT or YYACCEPT. */
2378 YY_STACK_PRINT (yyss
, yyssp
);
2379 while (yyssp
!= yyss
)
2381 yydestruct ("Cleanup: popping",
2382 yystos
[*yyssp
], yyvsp
, context
, scanner
);
2387 YYSTACK_FREE (yyss
);
2390 if (yymsg
!= yymsgbuf
)
2391 YYSTACK_FREE (yymsg
);
2393 /* Make sure YYID is used. */
2394 return YYID (yyresult
);