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
);
107 /* Line 189 of yacc.c */
108 #line 109 "libmemcached/options/parser.cc"
110 /* Enabling traces. */
115 /* Enabling verbose error messages. */
116 #ifdef YYERROR_VERBOSE
117 # undef YYERROR_VERBOSE
118 # define YYERROR_VERBOSE 1
120 # define YYERROR_VERBOSE 1
123 /* Enabling the token table. */
124 #ifndef YYTOKEN_TABLE
125 # define YYTOKEN_TABLE 0
132 /* Put the tokens into the symbol table, so that GDB and other debuggers
141 CONFIGURE_FILE
= 264,
145 SERVERS_OPTION
= 268,
146 UNKNOWN_OPTION
= 269,
148 AUTO_EJECT_HOSTS
= 271,
149 BINARY_PROTOCOL
= 272,
150 BUFFER_REQUESTS
= 273,
152 CONNECT_TIMEOUT
= 275,
155 HASH_WITH_PREFIX_KEY
= 278,
156 IO_BYTES_WATERMARK
= 279,
157 IO_KEY_PREFETCH
= 280,
158 IO_MSG_WATERMARK
= 281,
160 KETAMA_WEIGHTED
= 283,
162 NUMBER_OF_REPLICAS
= 285,
164 RANDOMIZE_REPLICA_READ
= 287,
167 SERVER_FAILURE_LIMIT
= 290,
169 SOCKET_RECV_SIZE
= 292,
170 SOCKET_SEND_SIZE
= 293,
174 _TCP_KEEPALIVE
= 297,
197 HOSTNAME_WITH_PORT
= 320,
199 IPADDRESS_WITH_PORT
= 322,
208 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
210 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
211 # define YYSTYPE_IS_DECLARED 1
215 /* Copy the second part of user declarations. */
218 /* Line 264 of yacc.c */
219 #line 220 "libmemcached/options/parser.cc"
226 typedef YYTYPE_UINT8 yytype_uint8
;
228 typedef unsigned char yytype_uint8
;
232 typedef YYTYPE_INT8 yytype_int8
;
233 #elif (defined __STDC__ || defined __C99__FUNC__ \
234 || defined __cplusplus || defined _MSC_VER)
235 typedef signed char yytype_int8
;
237 typedef short int yytype_int8
;
241 typedef YYTYPE_UINT16 yytype_uint16
;
243 typedef unsigned short int yytype_uint16
;
247 typedef YYTYPE_INT16 yytype_int16
;
249 typedef short int yytype_int16
;
253 # ifdef __SIZE_TYPE__
254 # define YYSIZE_T __SIZE_TYPE__
255 # elif defined size_t
256 # define YYSIZE_T size_t
257 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
258 || defined __cplusplus || defined _MSC_VER)
259 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
260 # define YYSIZE_T size_t
262 # define YYSIZE_T unsigned int
266 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
269 # if defined YYENABLE_NLS && YYENABLE_NLS
271 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
272 # define YY_(msgid) dgettext ("bison-runtime", msgid)
276 # define YY_(msgid) msgid
280 /* Suppress unused-variable warnings by "using" E. */
281 #if ! defined lint || defined __GNUC__
282 # define YYUSE(e) ((void) (e))
284 # define YYUSE(e) /* empty */
287 /* Identity function, used to suppress warnings about constant conditions. */
291 #if (defined __STDC__ || defined __C99__FUNC__ \
292 || defined __cplusplus || defined _MSC_VER)
305 #if ! defined yyoverflow || YYERROR_VERBOSE
307 /* The parser invokes alloca or malloc; define the necessary symbols. */
309 # ifdef YYSTACK_USE_ALLOCA
310 # if YYSTACK_USE_ALLOCA
312 # define YYSTACK_ALLOC __builtin_alloca
313 # elif defined __BUILTIN_VA_ARG_INCR
314 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
316 # define YYSTACK_ALLOC __alloca
317 # elif defined _MSC_VER
318 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
319 # define alloca _alloca
321 # define YYSTACK_ALLOC alloca
322 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
323 || defined __cplusplus || defined _MSC_VER)
324 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
333 # ifdef YYSTACK_ALLOC
334 /* Pacify GCC's `empty if-body' warning. */
335 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
336 # ifndef YYSTACK_ALLOC_MAXIMUM
337 /* The OS might guarantee only one guard page at the bottom of the stack,
338 and a page size can be as small as 4096 bytes. So we cannot safely
339 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
340 to allow for a few compiler-allocated temporary stack slots. */
341 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
344 # define YYSTACK_ALLOC YYMALLOC
345 # define YYSTACK_FREE YYFREE
346 # ifndef YYSTACK_ALLOC_MAXIMUM
347 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
349 # if (defined __cplusplus && ! defined _STDLIB_H \
350 && ! ((defined YYMALLOC || defined malloc) \
351 && (defined YYFREE || defined free)))
352 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
358 # define YYMALLOC malloc
359 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
360 || defined __cplusplus || defined _MSC_VER)
361 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
366 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
367 || defined __cplusplus || defined _MSC_VER)
368 void free (void *); /* INFRINGES ON USER NAME SPACE */
372 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
375 #if (! defined yyoverflow \
376 && (! defined __cplusplus \
377 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
379 /* A type that is properly aligned for any stack member. */
382 yytype_int16 yyss_alloc
;
386 /* The size of the maximum gap between one aligned stack and the next. */
387 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
389 /* The size of an array large to enough to hold all stacks, each with
391 # define YYSTACK_BYTES(N) \
392 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
393 + YYSTACK_GAP_MAXIMUM)
395 /* Copy COUNT objects from FROM to TO. The source and destination do
398 # if defined __GNUC__ && 1 < __GNUC__
399 # define YYCOPY(To, From, Count) \
400 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
402 # define YYCOPY(To, From, Count) \
406 for (yyi = 0; yyi < (Count); yyi++) \
407 (To)[yyi] = (From)[yyi]; \
413 /* Relocate STACK from its old location to the new one. The
414 local variables YYSIZE and YYSTACKSIZE give the old and new number of
415 elements in the stack, and YYPTR gives the new location of the
416 stack. Advance YYPTR to a properly aligned location for the next
418 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
421 YYSIZE_T yynewbytes; \
422 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
423 Stack = &yyptr->Stack_alloc; \
424 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
425 yyptr += yynewbytes / sizeof (*yyptr); \
431 /* YYFINAL -- State number of the termination state. */
433 /* YYLAST -- Last index in YYTABLE. */
436 /* YYNTOKENS -- Number of terminals. */
438 /* YYNNTS -- Number of nonterminals. */
440 /* YYNRULES -- Number of rules. */
442 /* YYNRULES -- Number of states. */
445 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
447 #define YYMAXUTOK 325
449 #define YYTRANSLATE(YYX) \
450 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
452 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
453 static const yytype_uint8 yytranslate
[] =
455 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 73, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 62, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 63, 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, 2, 2, 2, 2,
479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
481 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
482 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
483 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
484 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
485 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
486 55, 56, 57, 58, 59, 60, 61, 64, 65, 66,
487 67, 68, 69, 70, 71, 72
491 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
493 static const yytype_uint8 yyprhs
[] =
495 0, 0, 3, 5, 9, 11, 13, 15, 17, 19,
496 21, 23, 27, 30, 33, 36, 38, 41, 44, 49,
497 52, 55, 57, 59, 61, 63, 65, 67, 69, 71,
498 73, 75, 77, 79, 81, 83, 85, 87, 89, 91,
499 93, 95, 97, 99, 101, 103, 105, 107, 109, 111,
500 113, 115, 119, 122, 124, 126, 129, 131, 133, 135,
501 137, 139, 141, 143, 145, 147, 149, 151, 153, 155,
505 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
506 static const yytype_int8 yyrhs
[] =
508 75, 0, -1, 76, -1, 75, 73, 76, -1, 77,
509 -1, 3, -1, 10, -1, 4, -1, 5, -1, 6,
510 -1, 7, -1, 8, 73, 84, -1, 11, 82, -1,
511 13, 81, -1, 9, 84, -1, 78, -1, 47, 84,
512 -1, 21, 85, -1, 21, 85, 62, 83, -1, 22,
513 83, -1, 79, 64, -1, 80, -1, 44, -1, 20,
514 -1, 26, -1, 24, -1, 25, -1, 30, -1, 31,
515 -1, 33, -1, 34, -1, 35, -1, 36, -1, 37,
516 -1, 38, -1, 16, -1, 17, -1, 18, -1, 19,
517 -1, 23, -1, 28, -1, 29, -1, 32, -1, 39,
518 -1, 40, -1, 41, -1, 42, -1, 43, -1, 45,
519 -1, 46, -1, 82, -1, 81, 62, 82, -1, 67,
520 64, -1, 66, -1, 70, -1, 69, 64, -1, 68,
521 -1, 48, -1, 49, -1, 50, -1, 51, -1, 52,
522 -1, 53, -1, 54, -1, 55, -1, 56, -1, 70,
523 -1, 71, -1, 57, -1, 58, -1, 59, -1
526 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
527 static const yytype_uint16 yyrline
[] =
529 0, 157, 157, 158, 162, 164, 166, 168, 173, 178,
530 182, 186, 197, 204, 207, 211, 215, 222, 229, 240,
531 247, 254, 261, 267, 271, 275, 279, 283, 287, 291,
532 295, 299, 303, 307, 311, 318, 322, 326, 330, 334,
533 338, 342, 346, 350, 354, 358, 362, 366, 370, 374,
534 381, 388, 398, 404, 410, 416, 422, 431, 435, 439,
535 443, 447, 451, 455, 459, 463, 470, 474, 482, 486,
540 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
541 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
542 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
543 static const char *const yytname
[] =
545 "$end", "error", "$undefined", "COMMENT", "END", "ERROR", "RESET",
546 "PARSER_DEBUG", "INCLUDE", "CONFIGURE_FILE", "EMPTY_LINE", "SERVER",
547 "SERVERS", "SERVERS_OPTION", "UNKNOWN_OPTION", "UNKNOWN",
548 "AUTO_EJECT_HOSTS", "BINARY_PROTOCOL", "BUFFER_REQUESTS",
549 "CACHE_LOOKUPS", "CONNECT_TIMEOUT", "DISTRIBUTION", "HASH",
550 "HASH_WITH_PREFIX_KEY", "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH",
551 "IO_MSG_WATERMARK", "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY",
552 "NUMBER_OF_REPLICAS", "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ",
553 "RCV_TIMEOUT", "RETRY_TIMEOUT", "SERVER_FAILURE_LIMIT", "SND_TIMEOUT",
554 "SOCKET_RECV_SIZE", "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS",
555 "_TCP_NODELAY", "_TCP_KEEPALIVE", "_TCP_KEEPIDLE", "USER_DATA",
556 "USE_UDP", "VERIFY_KEY", "PREFIX_KEY", "MD5", "CRC", "FNV1_64",
557 "FNV1A_64", "FNV1_32", "FNV1A_32", "HSIEH", "MURMUR", "JENKINS",
558 "CONSISTENT", "MODULA", "RANDOM", "TRUE", "FALSE", "','", "'='",
559 "NUMBER", "FLOAT", "HOSTNAME", "HOSTNAME_WITH_PORT", "IPADDRESS",
560 "IPADDRESS_WITH_PORT", "STRING", "QUOTED_STRING", "FILE_PATH", "' '",
561 "$accept", "begin", "statement", "expression", "behaviors",
562 "behavior_number", "behavior_boolean", "server_list", "server", "hash",
563 "string", "distribution", 0
568 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
570 static const yytype_uint16 yytoknum
[] =
572 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
573 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
574 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
575 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
576 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
577 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
578 315, 316, 44, 61, 317, 318, 319, 320, 321, 322,
583 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
584 static const yytype_uint8 yyr1
[] =
586 0, 74, 75, 75, 76, 76, 76, 76, 76, 76,
587 76, 76, 77, 77, 77, 77, 78, 78, 78, 78,
588 78, 78, 78, 79, 79, 79, 79, 79, 79, 79,
589 79, 79, 79, 79, 79, 80, 80, 80, 80, 80,
590 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
591 81, 81, 82, 82, 82, 82, 82, 83, 83, 83,
592 83, 83, 83, 83, 83, 83, 84, 84, 85, 85,
596 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
597 static const yytype_uint8 yyr2
[] =
599 0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
600 1, 3, 2, 2, 2, 1, 2, 2, 4, 2,
601 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
602 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
603 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
604 1, 3, 2, 1, 1, 2, 1, 1, 1, 1,
605 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
609 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
610 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
611 means the default is an error. */
612 static const yytype_uint8 yydefact
[] =
614 0, 5, 7, 8, 9, 10, 0, 0, 6, 0,
615 0, 35, 36, 37, 38, 23, 0, 0, 39, 25,
616 26, 24, 40, 41, 27, 28, 42, 29, 30, 31,
617 32, 33, 34, 43, 44, 45, 46, 47, 22, 48,
618 49, 0, 0, 2, 4, 15, 0, 21, 0, 66,
619 67, 14, 53, 0, 56, 0, 54, 12, 13, 50,
620 68, 69, 70, 17, 57, 58, 59, 60, 61, 62,
621 63, 64, 65, 19, 16, 1, 0, 20, 11, 52,
625 /* YYDEFGOTO[NTERM-NUM]. */
626 static const yytype_int8 yydefgoto
[] =
628 -1, 42, 43, 44, 45, 46, 47, 58, 57, 73,
632 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
634 #define YYPACT_NINF -63
635 static const yytype_int8 yypact
[] =
637 -1, -63, -63, -63, -63, -63, -62, -57, -63, -7,
638 -7, -63, -63, -63, -63, -63, 9, 1, -63, -63,
639 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
640 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
641 -63, -57, 0, -63, -63, -63, -38, -63, -57, -63,
642 -63, -63, -63, -17, -63, -16, -63, -63, 2, -63,
643 -63, -63, -63, 7, -63, -63, -63, -63, -63, -63,
644 -63, -63, -63, -63, -63, -63, -1, -63, -63, -63,
645 -63, -7, 1, -63, -63, -63
648 /* YYPGOTO[NTERM-NUM]. */
649 static const yytype_int8 yypgoto
[] =
651 -63, -63, -6, -63, -63, -63, -63, -63, -9, -11,
655 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
656 positive, shift that token. If negative, reduce the rule which
657 number is the opposite. If zero, do what YYDEFACT says.
658 If YYTABLE_NINF, syntax error. */
659 #define YYTABLE_NINF -1
660 static const yytype_uint8 yytable
[] =
662 75, 59, 1, 2, 3, 4, 5, 6, 7, 8,
663 9, 48, 10, 49, 50, 11, 12, 13, 14, 15,
664 16, 17, 18, 19, 20, 21, 77, 22, 23, 24,
665 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
666 35, 36, 37, 38, 39, 40, 41, 79, 80, 64,
667 65, 66, 67, 68, 69, 70, 71, 72, 74, 52,
668 53, 54, 55, 56, 81, 78, 60, 61, 62, 82,
672 static const yytype_uint8 yycheck
[] =
674 0, 10, 3, 4, 5, 6, 7, 8, 9, 10,
675 11, 73, 13, 70, 71, 16, 17, 18, 19, 20,
676 21, 22, 23, 24, 25, 26, 64, 28, 29, 30,
677 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
678 41, 42, 43, 44, 45, 46, 47, 64, 64, 48,
679 49, 50, 51, 52, 53, 54, 55, 56, 41, 66,
680 67, 68, 69, 70, 62, 48, 57, 58, 59, 62,
684 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
685 symbol of state STATE-NUM. */
686 static const yytype_uint8 yystos
[] =
688 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
689 13, 16, 17, 18, 19, 20, 21, 22, 23, 24,
690 25, 26, 28, 29, 30, 31, 32, 33, 34, 35,
691 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
692 46, 47, 75, 76, 77, 78, 79, 80, 73, 70,
693 71, 84, 66, 67, 68, 69, 70, 82, 81, 82,
694 57, 58, 59, 85, 48, 49, 50, 51, 52, 53,
695 54, 55, 56, 83, 84, 0, 73, 64, 84, 64,
696 64, 62, 62, 76, 82, 83
699 #define yyerrok (yyerrstatus = 0)
700 #define yyclearin (yychar = YYEMPTY)
704 #define YYACCEPT goto yyacceptlab
705 #define YYABORT goto yyabortlab
706 #define YYERROR goto yyerrorlab
709 /* Like YYERROR except do call yyerror. This remains here temporarily
710 to ease the transition to the new meaning of YYERROR, for GCC.
711 Once GCC version 2 has supplanted version 1, this can go. However,
712 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
713 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
716 #define YYFAIL goto yyerrlab
718 /* This is here to suppress warnings from the GCC cpp's
719 -Wunused-macros. Normally we don't worry about that warning, but
720 some users do, and we want to make it easy for users to remove
721 YYFAIL uses, which will produce warnings from Bison 2.5. */
724 #define YYRECOVERING() (!!yyerrstatus)
726 #define YYBACKUP(Token, Value) \
728 if (yychar == YYEMPTY && yylen == 1) \
732 yytoken = YYTRANSLATE (yychar); \
738 yyerror (context, scanner, YY_("syntax error: cannot back up")); \
745 #define YYERRCODE 256
748 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
749 If N is 0, then set CURRENT to the empty location which ends
750 the previous symbol: RHS[0] (always defined). */
752 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
753 #ifndef YYLLOC_DEFAULT
754 # define YYLLOC_DEFAULT(Current, Rhs, N) \
758 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
759 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
760 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
761 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
765 (Current).first_line = (Current).last_line = \
766 YYRHSLOC (Rhs, 0).last_line; \
767 (Current).first_column = (Current).last_column = \
768 YYRHSLOC (Rhs, 0).last_column; \
774 /* YY_LOCATION_PRINT -- Print the location on the stream.
775 This macro was not mandated originally: define only if we know
776 we won't break user code: when these are the locations we know. */
778 #ifndef YY_LOCATION_PRINT
779 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
780 # define YY_LOCATION_PRINT(File, Loc) \
781 fprintf (File, "%d.%d-%d.%d", \
782 (Loc).first_line, (Loc).first_column, \
783 (Loc).last_line, (Loc).last_column)
785 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
790 /* YYLEX -- calling `yylex' with the right arguments. */
793 # define YYLEX yylex (&yylval, YYLEX_PARAM)
795 # define YYLEX yylex (&yylval, scanner)
798 /* Enable debugging if requested. */
802 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
803 # define YYFPRINTF fprintf
806 # define YYDPRINTF(Args) \
812 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
816 YYFPRINTF (stderr, "%s ", Title); \
817 yy_symbol_print (stderr, \
818 Type, Value, context, scanner); \
819 YYFPRINTF (stderr, "\n"); \
824 /*--------------------------------.
825 | Print this symbol on YYOUTPUT. |
826 `--------------------------------*/
829 #if (defined __STDC__ || defined __C99__FUNC__ \
830 || defined __cplusplus || defined _MSC_VER)
832 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
835 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
838 YYSTYPE
const * const yyvaluep
;
848 if (yytype
< YYNTOKENS
)
849 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
861 /*--------------------------------.
862 | Print this symbol on YYOUTPUT. |
863 `--------------------------------*/
865 #if (defined __STDC__ || defined __C99__FUNC__ \
866 || defined __cplusplus || defined _MSC_VER)
868 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
871 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
874 YYSTYPE
const * const yyvaluep
;
879 if (yytype
< YYNTOKENS
)
880 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
882 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
884 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
);
885 YYFPRINTF (yyoutput
, ")");
888 /*------------------------------------------------------------------.
889 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
891 `------------------------------------------------------------------*/
893 #if (defined __STDC__ || defined __C99__FUNC__ \
894 || defined __cplusplus || defined _MSC_VER)
896 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
899 yy_stack_print (yybottom
, yytop
)
900 yytype_int16
*yybottom
;
904 YYFPRINTF (stderr
, "Stack now");
905 for (; yybottom
<= yytop
; yybottom
++)
907 int yybot
= *yybottom
;
908 YYFPRINTF (stderr
, " %d", yybot
);
910 YYFPRINTF (stderr
, "\n");
913 # define YY_STACK_PRINT(Bottom, Top) \
916 yy_stack_print ((Bottom), (Top)); \
920 /*------------------------------------------------.
921 | Report that the YYRULE is going to be reduced. |
922 `------------------------------------------------*/
924 #if (defined __STDC__ || defined __C99__FUNC__ \
925 || defined __cplusplus || defined _MSC_VER)
927 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
, Context
*context
, yyscan_t
*scanner
)
930 yy_reduce_print (yyvsp
, yyrule
, context
, scanner
)
937 int yynrhs
= yyr2
[yyrule
];
939 unsigned long int yylno
= yyrline
[yyrule
];
940 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
942 /* The symbols being reduced. */
943 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
945 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
946 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
947 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
949 YYFPRINTF (stderr
, "\n");
953 # define YY_REDUCE_PRINT(Rule) \
956 yy_reduce_print (yyvsp, Rule, context, scanner); \
959 /* Nonzero means print parse trace. It is left uninitialized so that
960 multiple parsers can coexist. */
963 # define YYDPRINTF(Args)
964 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
965 # define YY_STACK_PRINT(Bottom, Top)
966 # define YY_REDUCE_PRINT(Rule)
967 #endif /* !YYDEBUG */
970 /* YYINITDEPTH -- initial size of the parser's stacks. */
972 # define YYINITDEPTH 200
975 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
976 if the built-in stack extension method is used).
978 Do not make this value too large; the results are undefined if
979 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
980 evaluated with infinite-precision integer arithmetic. */
983 # define YYMAXDEPTH 10000
991 # if defined __GLIBC__ && defined _STRING_H
992 # define yystrlen strlen
994 /* Return the length of YYSTR. */
995 #if (defined __STDC__ || defined __C99__FUNC__ \
996 || defined __cplusplus || defined _MSC_VER)
998 yystrlen (const char *yystr
)
1006 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1014 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1015 # define yystpcpy stpcpy
1017 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1019 #if (defined __STDC__ || defined __C99__FUNC__ \
1020 || defined __cplusplus || defined _MSC_VER)
1022 yystpcpy (char *yydest
, const char *yysrc
)
1025 yystpcpy (yydest
, yysrc
)
1031 const char *yys
= yysrc
;
1033 while ((*yyd
++ = *yys
++) != '\0')
1042 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1043 quotes and backslashes, so that it's suitable for yyerror. The
1044 heuristic is that double-quoting is unnecessary unless the string
1045 contains an apostrophe, a comma, or backslash (other than
1046 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1047 null, do not copy; instead, return the length of what the result
1050 yytnamerr (char *yyres
, const char *yystr
)
1055 char const *yyp
= yystr
;
1062 goto do_not_strip_quotes
;
1066 goto do_not_strip_quotes
;
1079 do_not_strip_quotes
: ;
1083 return yystrlen (yystr
);
1085 return yystpcpy (yyres
, yystr
) - yyres
;
1089 /* Copy into YYRESULT an error message about the unexpected token
1090 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1091 including the terminating null byte. If YYRESULT is null, do not
1092 copy anything; just return the number of bytes that would be
1093 copied. As a special case, return 0 if an ordinary "syntax error"
1094 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1095 size calculation. */
1097 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1099 int yyn
= yypact
[yystate
];
1101 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1105 int yytype
= YYTRANSLATE (yychar
);
1106 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1107 YYSIZE_T yysize
= yysize0
;
1109 int yysize_overflow
= 0;
1110 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1111 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1115 /* This is so xgettext sees the translatable formats that are
1116 constructed on the fly. */
1117 YY_("syntax error, unexpected %s");
1118 YY_("syntax error, unexpected %s, expecting %s");
1119 YY_("syntax error, unexpected %s, expecting %s or %s");
1120 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1121 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1125 static char const yyunexpected
[] = "syntax error, unexpected %s";
1126 static char const yyexpecting
[] = ", expecting %s";
1127 static char const yyor
[] = " or %s";
1128 char yyformat
[sizeof yyunexpected
1129 + sizeof yyexpecting
- 1
1130 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1131 * (sizeof yyor
- 1))];
1132 char const *yyprefix
= yyexpecting
;
1134 /* Start YYX at -YYN if negative to avoid negative indexes in
1136 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1138 /* Stay within bounds of both yycheck and yytname. */
1139 int yychecklim
= YYLAST
- yyn
+ 1;
1140 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1143 yyarg
[0] = yytname
[yytype
];
1144 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1146 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1147 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1149 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1153 yyformat
[sizeof yyunexpected
- 1] = '\0';
1156 yyarg
[yycount
++] = yytname
[yyx
];
1157 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1158 yysize_overflow
|= (yysize1
< yysize
);
1160 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1164 yyf
= YY_(yyformat
);
1165 yysize1
= yysize
+ yystrlen (yyf
);
1166 yysize_overflow
|= (yysize1
< yysize
);
1169 if (yysize_overflow
)
1170 return YYSIZE_MAXIMUM
;
1174 /* Avoid sprintf, as that infringes on the user's name space.
1175 Don't have undefined behavior even if the translation
1176 produced a string with the wrong number of "%s"s. */
1177 char *yyp
= yyresult
;
1179 while ((*yyp
= *yyf
) != '\0')
1181 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1183 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1196 #endif /* YYERROR_VERBOSE */
1199 /*-----------------------------------------------.
1200 | Release the memory associated to this symbol. |
1201 `-----------------------------------------------*/
1204 #if (defined __STDC__ || defined __C99__FUNC__ \
1205 || defined __cplusplus || defined _MSC_VER)
1207 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, Context
*context
, yyscan_t
*scanner
)
1210 yydestruct (yymsg
, yytype
, yyvaluep
, context
, scanner
)
1224 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1234 /* Prevent warnings from -Wmissing-prototypes. */
1235 #ifdef YYPARSE_PARAM
1236 #if defined __STDC__ || defined __cplusplus
1237 int yyparse (void *YYPARSE_PARAM
);
1241 #else /* ! YYPARSE_PARAM */
1242 #if defined __STDC__ || defined __cplusplus
1243 int yyparse (Context
*context
, yyscan_t
*scanner
);
1247 #endif /* ! YYPARSE_PARAM */
1253 /*-------------------------.
1254 | yyparse or yypush_parse. |
1255 `-------------------------*/
1257 #ifdef YYPARSE_PARAM
1258 #if (defined __STDC__ || defined __C99__FUNC__ \
1259 || defined __cplusplus || defined _MSC_VER)
1261 yyparse (void *YYPARSE_PARAM
)
1264 yyparse (YYPARSE_PARAM
)
1265 void *YYPARSE_PARAM
;
1267 #else /* ! YYPARSE_PARAM */
1268 #if (defined __STDC__ || defined __C99__FUNC__ \
1269 || defined __cplusplus || defined _MSC_VER)
1271 yyparse (Context
*context
, yyscan_t
*scanner
)
1274 yyparse (context
, scanner
)
1280 /* The lookahead symbol. */
1283 /* The semantic value of the lookahead symbol. */
1286 /* Number of syntax errors so far. */
1290 /* Number of tokens to shift before error messages enabled. */
1293 /* The stacks and their tools:
1294 `yyss': related to states.
1295 `yyvs': related to semantic values.
1297 Refer to the stacks thru separate pointers, to allow yyoverflow
1298 to reallocate them elsewhere. */
1300 /* The state stack. */
1301 yytype_int16 yyssa
[YYINITDEPTH
];
1303 yytype_int16
*yyssp
;
1305 /* The semantic value stack. */
1306 YYSTYPE yyvsa
[YYINITDEPTH
];
1310 YYSIZE_T yystacksize
;
1314 /* Lookahead token as an internal (translated) token number. */
1316 /* The variables used to return semantic value and location from the
1321 /* Buffer for error messages, and its allocated size. */
1323 char *yymsg
= yymsgbuf
;
1324 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1327 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1329 /* The number of symbols on the RHS of the reduced rule.
1330 Keep to zero when no symbol should be popped. */
1336 yystacksize
= YYINITDEPTH
;
1338 YYDPRINTF ((stderr
, "Starting parse\n"));
1343 yychar
= YYEMPTY
; /* Cause a token to be read. */
1345 /* Initialize stack pointers.
1346 Waste one element of value and location stack
1347 so that they stay on the same level as the state stack.
1348 The wasted elements are never initialized. */
1354 /*------------------------------------------------------------.
1355 | yynewstate -- Push a new state, which is found in yystate. |
1356 `------------------------------------------------------------*/
1358 /* In all cases, when you get here, the value and location stacks
1359 have just been pushed. So pushing a state here evens the stacks. */
1365 if (yyss
+ yystacksize
- 1 <= yyssp
)
1367 /* Get the current used size of the three stacks, in elements. */
1368 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1372 /* Give user a chance to reallocate the stack. Use copies of
1373 these so that the &'s don't force the real ones into
1375 YYSTYPE
*yyvs1
= yyvs
;
1376 yytype_int16
*yyss1
= yyss
;
1378 /* Each stack pointer address is followed by the size of the
1379 data in use in that stack, in bytes. This used to be a
1380 conditional around just the two extra args, but that might
1381 be undefined if yyoverflow is a macro. */
1382 yyoverflow (YY_("memory exhausted"),
1383 &yyss1
, yysize
* sizeof (*yyssp
),
1384 &yyvs1
, yysize
* sizeof (*yyvsp
),
1390 #else /* no yyoverflow */
1391 # ifndef YYSTACK_RELOCATE
1392 goto yyexhaustedlab
;
1394 /* Extend the stack our own way. */
1395 if (YYMAXDEPTH
<= yystacksize
)
1396 goto yyexhaustedlab
;
1398 if (YYMAXDEPTH
< yystacksize
)
1399 yystacksize
= YYMAXDEPTH
;
1402 yytype_int16
*yyss1
= yyss
;
1403 union yyalloc
*yyptr
=
1404 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1406 goto yyexhaustedlab
;
1407 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1408 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1409 # undef YYSTACK_RELOCATE
1411 YYSTACK_FREE (yyss1
);
1414 #endif /* no yyoverflow */
1416 yyssp
= yyss
+ yysize
- 1;
1417 yyvsp
= yyvs
+ yysize
- 1;
1419 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1420 (unsigned long int) yystacksize
));
1422 if (yyss
+ yystacksize
- 1 <= yyssp
)
1426 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1428 if (yystate
== YYFINAL
)
1438 /* Do appropriate processing given the current state. Read a
1439 lookahead token if we need one and don't already have one. */
1441 /* First try to decide what to do without reference to lookahead token. */
1442 yyn
= yypact
[yystate
];
1443 if (yyn
== YYPACT_NINF
)
1446 /* Not known => get a lookahead token if don't already have one. */
1448 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1449 if (yychar
== YYEMPTY
)
1451 YYDPRINTF ((stderr
, "Reading a token: "));
1455 if (yychar
<= YYEOF
)
1457 yychar
= yytoken
= YYEOF
;
1458 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1462 yytoken
= YYTRANSLATE (yychar
);
1463 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1466 /* If the proper action on seeing token YYTOKEN is to reduce or to
1467 detect an error, take that action. */
1469 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1474 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1480 /* Count tokens shifted since error; after three, turn off error
1485 /* Shift the lookahead token. */
1486 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1488 /* Discard the shifted token. */
1497 /*-----------------------------------------------------------.
1498 | yydefault -- do the default action for the current state. |
1499 `-----------------------------------------------------------*/
1501 yyn
= yydefact
[yystate
];
1507 /*-----------------------------.
1508 | yyreduce -- Do a reduction. |
1509 `-----------------------------*/
1511 /* yyn is the number of a rule to reduce with. */
1514 /* If YYLEN is nonzero, implement the default value of the action:
1517 Otherwise, the following line sets YYVAL to garbage.
1518 This behavior is undocumented and Bison
1519 users should not rely upon it. Assigning to YYVAL
1520 unconditionally makes the parser a bit smaller, and it avoids a
1521 GCC warning that YYVAL may be used uninitialized. */
1522 yyval
= yyvsp
[1-yylen
];
1525 YY_REDUCE_PRINT (yyn
);
1530 /* Line 1464 of yacc.c */
1531 #line 163 "libmemcached/options/parser.yy"
1537 /* Line 1464 of yacc.c */
1538 #line 165 "libmemcached/options/parser.yy"
1544 /* Line 1464 of yacc.c */
1545 #line 167 "libmemcached/options/parser.yy"
1551 /* Line 1464 of yacc.c */
1552 #line 169 "libmemcached/options/parser.yy"
1561 /* Line 1464 of yacc.c */
1562 #line 174 "libmemcached/options/parser.yy"
1564 context
->rc
= MEMCACHED_PARSE_USER_ERROR
;
1565 parser_abort(context
, NULL
);
1571 /* Line 1464 of yacc.c */
1572 #line 179 "libmemcached/options/parser.yy"
1574 memcached_reset(context
->memc
);
1580 /* Line 1464 of yacc.c */
1581 #line 183 "libmemcached/options/parser.yy"
1589 /* Line 1464 of yacc.c */
1590 #line 187 "libmemcached/options/parser.yy"
1592 if ((context
->rc
= memcached_parse_configure_file(context
->memc
, (yyvsp
[(3) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].string
).length
)) != MEMCACHED_SUCCESS
)
1594 parser_abort(context
, NULL
);
1601 /* Line 1464 of yacc.c */
1602 #line 198 "libmemcached/options/parser.yy"
1604 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
)
1606 parser_abort(context
, NULL
);
1613 /* Line 1464 of yacc.c */
1614 #line 205 "libmemcached/options/parser.yy"
1621 /* Line 1464 of yacc.c */
1622 #line 208 "libmemcached/options/parser.yy"
1624 memcached_set_configuration_file(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).length
);
1630 /* Line 1464 of yacc.c */
1631 #line 216 "libmemcached/options/parser.yy"
1633 if ((context
->rc
= memcached_set_prefix_key(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).length
)) != MEMCACHED_SUCCESS
)
1635 parser_abort(context
, NULL
);;
1642 /* Line 1464 of yacc.c */
1643 #line 223 "libmemcached/options/parser.yy"
1645 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1647 parser_abort(context
, NULL
);;
1654 /* Line 1464 of yacc.c */
1655 #line 230 "libmemcached/options/parser.yy"
1657 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (4)].distribution
))) != MEMCACHED_SUCCESS
)
1659 parser_abort(context
, NULL
);;
1661 if ((context
->rc
= memcached_behavior_set_distribution_hash(context
->memc
, (yyvsp
[(4) - (4)].hash
))) != MEMCACHED_SUCCESS
)
1663 parser_abort(context
, NULL
);;
1670 /* Line 1464 of yacc.c */
1671 #line 241 "libmemcached/options/parser.yy"
1673 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_HASH
, (yyvsp
[(2) - (2)].hash
))) != MEMCACHED_SUCCESS
)
1675 parser_abort(context
, NULL
);;
1682 /* Line 1464 of yacc.c */
1683 #line 248 "libmemcached/options/parser.yy"
1685 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (2)].behavior
), (yyvsp
[(2) - (2)].number
))) != MEMCACHED_SUCCESS
)
1687 parser_abort(context
, NULL
);;
1694 /* Line 1464 of yacc.c */
1695 #line 255 "libmemcached/options/parser.yy"
1697 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (1)].behavior
), true)) != MEMCACHED_SUCCESS
)
1699 parser_abort(context
, NULL
);;
1706 /* Line 1464 of yacc.c */
1707 #line 262 "libmemcached/options/parser.yy"
1714 /* Line 1464 of yacc.c */
1715 #line 268 "libmemcached/options/parser.yy"
1717 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
;
1723 /* Line 1464 of yacc.c */
1724 #line 272 "libmemcached/options/parser.yy"
1726 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
;
1732 /* Line 1464 of yacc.c */
1733 #line 276 "libmemcached/options/parser.yy"
1735 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
;
1741 /* Line 1464 of yacc.c */
1742 #line 280 "libmemcached/options/parser.yy"
1744 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
;
1750 /* Line 1464 of yacc.c */
1751 #line 284 "libmemcached/options/parser.yy"
1753 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
;
1759 /* Line 1464 of yacc.c */
1760 #line 288 "libmemcached/options/parser.yy"
1762 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT
;
1768 /* Line 1464 of yacc.c */
1769 #line 292 "libmemcached/options/parser.yy"
1771 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT
;
1777 /* Line 1464 of yacc.c */
1778 #line 296 "libmemcached/options/parser.yy"
1780 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
;
1786 /* Line 1464 of yacc.c */
1787 #line 300 "libmemcached/options/parser.yy"
1789 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
;
1795 /* Line 1464 of yacc.c */
1796 #line 304 "libmemcached/options/parser.yy"
1798 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SND_TIMEOUT
;
1804 /* Line 1464 of yacc.c */
1805 #line 308 "libmemcached/options/parser.yy"
1807 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
;
1813 /* Line 1464 of yacc.c */
1814 #line 312 "libmemcached/options/parser.yy"
1816 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
;
1822 /* Line 1464 of yacc.c */
1823 #line 319 "libmemcached/options/parser.yy"
1825 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS
;
1831 /* Line 1464 of yacc.c */
1832 #line 323 "libmemcached/options/parser.yy"
1834 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
;
1840 /* Line 1464 of yacc.c */
1841 #line 327 "libmemcached/options/parser.yy"
1843 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
;
1849 /* Line 1464 of yacc.c */
1850 #line 331 "libmemcached/options/parser.yy"
1852 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CACHE_LOOKUPS
;
1858 /* Line 1464 of yacc.c */
1859 #line 335 "libmemcached/options/parser.yy"
1861 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
;
1867 /* Line 1464 of yacc.c */
1868 #line 339 "libmemcached/options/parser.yy"
1870 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED
;
1876 /* Line 1464 of yacc.c */
1877 #line 343 "libmemcached/options/parser.yy"
1879 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NOREPLY
;
1885 /* Line 1464 of yacc.c */
1886 #line 347 "libmemcached/options/parser.yy"
1888 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
;
1894 /* Line 1464 of yacc.c */
1895 #line 351 "libmemcached/options/parser.yy"
1897 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SORT_HOSTS
;
1903 /* Line 1464 of yacc.c */
1904 #line 355 "libmemcached/options/parser.yy"
1906 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SUPPORT_CAS
;
1912 /* Line 1464 of yacc.c */
1913 #line 359 "libmemcached/options/parser.yy"
1915 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_NODELAY
;
1921 /* Line 1464 of yacc.c */
1922 #line 363 "libmemcached/options/parser.yy"
1924 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
;
1930 /* Line 1464 of yacc.c */
1931 #line 367 "libmemcached/options/parser.yy"
1933 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE
;
1939 /* Line 1464 of yacc.c */
1940 #line 371 "libmemcached/options/parser.yy"
1942 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_USE_UDP
;
1948 /* Line 1464 of yacc.c */
1949 #line 375 "libmemcached/options/parser.yy"
1951 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_VERIFY_KEY
;
1957 /* Line 1464 of yacc.c */
1958 #line 382 "libmemcached/options/parser.yy"
1960 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
)
1962 parser_abort(context
, NULL
);;
1969 /* Line 1464 of yacc.c */
1970 #line 389 "libmemcached/options/parser.yy"
1972 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
)
1974 parser_abort(context
, NULL
);;
1981 /* Line 1464 of yacc.c */
1982 #line 399 "libmemcached/options/parser.yy"
1984 (yyval
.server
).c_str
= (yyvsp
[(1) - (2)].string
).c_str
;
1985 (yyval
.server
).length
= (yyvsp
[(1) - (2)].string
).length
-1; // -1 to remove :
1986 (yyval
.server
).port
= (yyvsp
[(2) - (2)].number
);
1992 /* Line 1464 of yacc.c */
1993 #line 405 "libmemcached/options/parser.yy"
1995 (yyval
.server
).c_str
= (yyvsp
[(1) - (1)].string
).c_str
;
1996 (yyval
.server
).length
= (yyvsp
[(1) - (1)].string
).length
;
1997 (yyval
.server
).port
= MEMCACHED_DEFAULT_PORT
;
2003 /* Line 1464 of yacc.c */
2004 #line 411 "libmemcached/options/parser.yy"
2006 (yyval
.server
).c_str
= (yyvsp
[(1) - (1)].string
).c_str
;
2007 (yyval
.server
).length
= (yyvsp
[(1) - (1)].string
).length
;
2008 (yyval
.server
).port
= MEMCACHED_DEFAULT_PORT
;
2014 /* Line 1464 of yacc.c */
2015 #line 417 "libmemcached/options/parser.yy"
2017 (yyval
.server
).c_str
= (yyvsp
[(1) - (2)].string
).c_str
;
2018 (yyval
.server
).length
= (yyvsp
[(1) - (2)].string
).length
-1; // -1 to remove :
2019 (yyval
.server
).port
= (yyvsp
[(2) - (2)].number
);
2025 /* Line 1464 of yacc.c */
2026 #line 423 "libmemcached/options/parser.yy"
2028 (yyval
.server
).c_str
= (yyvsp
[(1) - (1)].string
).c_str
;
2029 (yyval
.server
).length
= (yyvsp
[(1) - (1)].string
).length
;
2030 (yyval
.server
).port
= MEMCACHED_DEFAULT_PORT
;
2036 /* Line 1464 of yacc.c */
2037 #line 432 "libmemcached/options/parser.yy"
2039 (yyval
.hash
)= MEMCACHED_HASH_MD5
;
2045 /* Line 1464 of yacc.c */
2046 #line 436 "libmemcached/options/parser.yy"
2048 (yyval
.hash
)= MEMCACHED_HASH_CRC
;
2054 /* Line 1464 of yacc.c */
2055 #line 440 "libmemcached/options/parser.yy"
2057 (yyval
.hash
)= MEMCACHED_HASH_FNV1_64
;
2063 /* Line 1464 of yacc.c */
2064 #line 444 "libmemcached/options/parser.yy"
2066 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_64
;
2072 /* Line 1464 of yacc.c */
2073 #line 448 "libmemcached/options/parser.yy"
2075 (yyval
.hash
)= MEMCACHED_HASH_FNV1_32
;
2081 /* Line 1464 of yacc.c */
2082 #line 452 "libmemcached/options/parser.yy"
2084 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_32
;
2090 /* Line 1464 of yacc.c */
2091 #line 456 "libmemcached/options/parser.yy"
2093 (yyval
.hash
)= MEMCACHED_HASH_HSIEH
;
2099 /* Line 1464 of yacc.c */
2100 #line 460 "libmemcached/options/parser.yy"
2102 (yyval
.hash
)= MEMCACHED_HASH_MURMUR
;
2108 /* Line 1464 of yacc.c */
2109 #line 464 "libmemcached/options/parser.yy"
2111 (yyval
.hash
)= MEMCACHED_HASH_JENKINS
;
2117 /* Line 1464 of yacc.c */
2118 #line 471 "libmemcached/options/parser.yy"
2120 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2126 /* Line 1464 of yacc.c */
2127 #line 475 "libmemcached/options/parser.yy"
2129 (yyval
.string
).c_str
= (yyvsp
[(1) - (1)].string
).c_str
+1; // +1 to move use passed the initial quote
2130 (yyval
.string
).length
= (yyvsp
[(1) - (1)].string
).length
-1; // -1 removes the end quote
2136 /* Line 1464 of yacc.c */
2137 #line 483 "libmemcached/options/parser.yy"
2139 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_CONSISTENT
;
2145 /* Line 1464 of yacc.c */
2146 #line 487 "libmemcached/options/parser.yy"
2148 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_MODULA
;
2154 /* Line 1464 of yacc.c */
2155 #line 491 "libmemcached/options/parser.yy"
2157 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_RANDOM
;
2163 /* Line 1464 of yacc.c */
2164 #line 2165 "libmemcached/options/parser.cc"
2167 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2171 YY_STACK_PRINT (yyss
, yyssp
);
2175 /* Now `shift' the result of the reduction. Determine what state
2176 that goes to, based on the state we popped back to and the rule
2177 number reduced by. */
2181 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2182 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2183 yystate
= yytable
[yystate
];
2185 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2190 /*------------------------------------.
2191 | yyerrlab -- here on detecting error |
2192 `------------------------------------*/
2194 /* If not already recovering from an error, report this error. */
2198 #if ! YYERROR_VERBOSE
2199 yyerror (context
, scanner
, YY_("syntax error"));
2202 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2203 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2205 YYSIZE_T yyalloc
= 2 * yysize
;
2206 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2207 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2208 if (yymsg
!= yymsgbuf
)
2209 YYSTACK_FREE (yymsg
);
2210 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2212 yymsg_alloc
= yyalloc
;
2216 yymsg_alloc
= sizeof yymsgbuf
;
2220 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2222 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2223 yyerror (context
, scanner
, yymsg
);
2227 yyerror (context
, scanner
, YY_("syntax error"));
2229 goto yyexhaustedlab
;
2237 if (yyerrstatus
== 3)
2239 /* If just tried and failed to reuse lookahead token after an
2240 error, discard it. */
2242 if (yychar
<= YYEOF
)
2244 /* Return failure if at end of input. */
2245 if (yychar
== YYEOF
)
2250 yydestruct ("Error: discarding",
2251 yytoken
, &yylval
, context
, scanner
);
2256 /* Else will try to reuse lookahead token after shifting the error
2261 /*---------------------------------------------------.
2262 | yyerrorlab -- error raised explicitly by YYERROR. |
2263 `---------------------------------------------------*/
2266 /* Pacify compilers like GCC when the user code never invokes
2267 YYERROR and the label yyerrorlab therefore never appears in user
2269 if (/*CONSTCOND*/ 0)
2272 /* Do not reclaim the symbols of the rule which action triggered
2276 YY_STACK_PRINT (yyss
, yyssp
);
2281 /*-------------------------------------------------------------.
2282 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2283 `-------------------------------------------------------------*/
2285 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2289 yyn
= yypact
[yystate
];
2290 if (yyn
!= YYPACT_NINF
)
2293 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2301 /* Pop the current state because it cannot handle the error token. */
2306 yydestruct ("Error: popping",
2307 yystos
[yystate
], yyvsp
, context
, scanner
);
2310 YY_STACK_PRINT (yyss
, yyssp
);
2316 /* Shift the error token. */
2317 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2323 /*-------------------------------------.
2324 | yyacceptlab -- YYACCEPT comes here. |
2325 `-------------------------------------*/
2330 /*-----------------------------------.
2331 | yyabortlab -- YYABORT comes here. |
2332 `-----------------------------------*/
2337 #if !defined(yyoverflow) || YYERROR_VERBOSE
2338 /*-------------------------------------------------.
2339 | yyexhaustedlab -- memory exhaustion comes here. |
2340 `-------------------------------------------------*/
2342 yyerror (context
, scanner
, YY_("memory exhausted"));
2348 if (yychar
!= YYEMPTY
)
2349 yydestruct ("Cleanup: discarding lookahead",
2350 yytoken
, &yylval
, context
, scanner
);
2351 /* Do not reclaim the symbols of the rule which action triggered
2352 this YYABORT or YYACCEPT. */
2354 YY_STACK_PRINT (yyss
, yyssp
);
2355 while (yyssp
!= yyss
)
2357 yydestruct ("Cleanup: popping",
2358 yystos
[*yyssp
], yyvsp
, context
, scanner
);
2363 YYSTACK_FREE (yyss
);
2366 if (yymsg
!= yymsgbuf
)
2367 YYSTACK_FREE (yymsg
);
2369 /* Make sure YYID is used. */
2370 return YYID (yyresult
);
2375 /* Line 1684 of yacc.c */
2376 #line 496 "libmemcached/options/parser.yy"
2379 void Context::start()
2381 config_parse(this, (void **)scanner
);