1 /* A Bison parser, made by GNU Bison 2.4.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6 2009, 2010 Free Software Foundation, Inc.
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
44 /* Identify Bison output. */
48 #define YYBISON_VERSION "2.4.3"
51 #define YYSKELETON_NAME "yacc.c"
62 /* Using locations. */
63 #define YYLSP_NEEDED 0
65 /* Substitute the variable and function names. */
66 #define yyparse config_parse
67 #define yylex config_lex
68 #define yyerror config_error
69 #define yylval config_lval
70 #define yychar config_char
71 #define yydebug config_debug
72 #define yynerrs config_nerrs
75 /* Copy the first part of user declarations. */
77 /* Line 189 of yacc.c */
78 #line 36 "libmemcached/options/parser.yy"
85 #include <libmemcached/common.h>
86 #include <libmemcached/options/context.h>
87 #include <libmemcached/options/symbol.h>
88 #include <libmemcached/options/scanner.h>
90 #pragma GCC diagnostic ignored "-Wold-style-cast"
92 int conf_lex(YYSTYPE
* lvalp
, void* scanner
);
94 #define parser_abort(A, B) do { (A)->abort((B)); YYABORT; } while (0)
96 inline void config_error(Context
*context
, yyscan_t
*scanner
, const char *error
)
98 if (not context
->end())
99 context
->abort(error
);
104 /* Line 189 of yacc.c */
105 #line 106 "libmemcached/options/parser.cc"
107 /* Enabling traces. */
112 /* Enabling verbose error messages. */
113 #ifdef YYERROR_VERBOSE
114 # undef YYERROR_VERBOSE
115 # define YYERROR_VERBOSE 1
117 # define YYERROR_VERBOSE 1
120 /* Enabling the token table. */
121 #ifndef YYTOKEN_TABLE
122 # define YYTOKEN_TABLE 0
129 /* Put the tokens into the symbol table, so that GDB and other debuggers
138 CONFIGURE_FILE
= 264,
142 SERVERS_OPTION
= 268,
143 UNKNOWN_OPTION
= 269,
145 BINARY_PROTOCOL
= 271,
146 BUFFER_REQUESTS
= 272,
147 CONNECT_TIMEOUT
= 273,
150 HASH_WITH_NAMESPACE
= 276,
151 IO_BYTES_WATERMARK
= 277,
152 IO_KEY_PREFETCH
= 278,
153 IO_MSG_WATERMARK
= 279,
155 KETAMA_WEIGHTED
= 281,
157 NUMBER_OF_REPLICAS
= 283,
159 RANDOMIZE_REPLICA_READ
= 285,
161 REMOVE_FAILED_SERVERS
= 287,
164 SOCKET_RECV_SIZE
= 290,
165 SOCKET_SEND_SIZE
= 291,
171 _TCP_KEEPALIVE
= 297,
205 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
207 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
208 # define YYSTYPE_IS_DECLARED 1
212 /* Copy the second part of user declarations. */
215 /* Line 264 of yacc.c */
216 #line 217 "libmemcached/options/parser.cc"
223 typedef YYTYPE_UINT8 yytype_uint8
;
225 typedef unsigned char yytype_uint8
;
229 typedef YYTYPE_INT8 yytype_int8
;
230 #elif (defined __STDC__ || defined __C99__FUNC__ \
231 || defined __cplusplus || defined _MSC_VER)
232 typedef signed char yytype_int8
;
234 typedef short int yytype_int8
;
238 typedef YYTYPE_UINT16 yytype_uint16
;
240 typedef unsigned short int yytype_uint16
;
244 typedef YYTYPE_INT16 yytype_int16
;
246 typedef short int yytype_int16
;
250 # ifdef __SIZE_TYPE__
251 # define YYSIZE_T __SIZE_TYPE__
252 # elif defined size_t
253 # define YYSIZE_T size_t
254 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
255 || defined __cplusplus || defined _MSC_VER)
256 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
257 # define YYSIZE_T size_t
259 # define YYSIZE_T unsigned int
263 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
266 # if defined YYENABLE_NLS && YYENABLE_NLS
268 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
269 # define YY_(msgid) dgettext ("bison-runtime", msgid)
273 # define YY_(msgid) msgid
277 /* Suppress unused-variable warnings by "using" E. */
278 #if ! defined lint || defined __GNUC__
279 # define YYUSE(e) ((void) (e))
281 # define YYUSE(e) /* empty */
284 /* Identity function, used to suppress warnings about constant conditions. */
288 #if (defined __STDC__ || defined __C99__FUNC__ \
289 || defined __cplusplus || defined _MSC_VER)
302 #if ! defined yyoverflow || YYERROR_VERBOSE
304 /* The parser invokes alloca or malloc; define the necessary symbols. */
306 # ifdef YYSTACK_USE_ALLOCA
307 # if YYSTACK_USE_ALLOCA
309 # define YYSTACK_ALLOC __builtin_alloca
310 # elif defined __BUILTIN_VA_ARG_INCR
311 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
313 # define YYSTACK_ALLOC __alloca
314 # elif defined _MSC_VER
315 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
316 # define alloca _alloca
318 # define YYSTACK_ALLOC alloca
319 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
320 || defined __cplusplus || defined _MSC_VER)
321 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
330 # ifdef YYSTACK_ALLOC
331 /* Pacify GCC's `empty if-body' warning. */
332 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
333 # ifndef YYSTACK_ALLOC_MAXIMUM
334 /* The OS might guarantee only one guard page at the bottom of the stack,
335 and a page size can be as small as 4096 bytes. So we cannot safely
336 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
337 to allow for a few compiler-allocated temporary stack slots. */
338 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
341 # define YYSTACK_ALLOC YYMALLOC
342 # define YYSTACK_FREE YYFREE
343 # ifndef YYSTACK_ALLOC_MAXIMUM
344 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
346 # if (defined __cplusplus && ! defined _STDLIB_H \
347 && ! ((defined YYMALLOC || defined malloc) \
348 && (defined YYFREE || defined free)))
349 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
355 # define YYMALLOC malloc
356 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
357 || defined __cplusplus || defined _MSC_VER)
358 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
363 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
364 || defined __cplusplus || defined _MSC_VER)
365 void free (void *); /* INFRINGES ON USER NAME SPACE */
369 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
372 #if (! defined yyoverflow \
373 && (! defined __cplusplus \
374 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
376 /* A type that is properly aligned for any stack member. */
379 yytype_int16 yyss_alloc
;
383 /* The size of the maximum gap between one aligned stack and the next. */
384 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
386 /* The size of an array large to enough to hold all stacks, each with
388 # define YYSTACK_BYTES(N) \
389 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
390 + YYSTACK_GAP_MAXIMUM)
392 /* Copy COUNT objects from FROM to TO. The source and destination do
395 # if defined __GNUC__ && 1 < __GNUC__
396 # define YYCOPY(To, From, Count) \
397 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
399 # define YYCOPY(To, From, Count) \
403 for (yyi = 0; yyi < (Count); yyi++) \
404 (To)[yyi] = (From)[yyi]; \
410 /* Relocate STACK from its old location to the new one. The
411 local variables YYSIZE and YYSTACKSIZE give the old and new number of
412 elements in the stack, and YYPTR gives the new location of the
413 stack. Advance YYPTR to a properly aligned location for the next
415 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
418 YYSIZE_T yynewbytes; \
419 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
420 Stack = &yyptr->Stack_alloc; \
421 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
422 yyptr += yynewbytes / sizeof (*yyptr); \
428 /* YYFINAL -- State number of the termination state. */
430 /* YYLAST -- Last index in YYTABLE. */
433 /* YYNTOKENS -- Number of terminals. */
435 /* YYNNTS -- Number of nonterminals. */
437 /* YYNRULES -- Number of rules. */
439 /* YYNRULES -- Number of states. */
442 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
444 #define YYMAXUTOK 325
446 #define YYTRANSLATE(YYX) \
447 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
449 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
450 static const yytype_uint8 yytranslate
[] =
452 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 73, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 62, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 63, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
478 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
479 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
480 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
481 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
482 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
483 55, 56, 57, 58, 59, 60, 61, 64, 65, 66,
484 67, 68, 69, 70, 71, 72
488 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
490 static const yytype_uint8 yyprhs
[] =
492 0, 0, 3, 5, 9, 11, 13, 15, 17, 19,
493 21, 23, 27, 32, 37, 40, 43, 46, 48, 51,
494 54, 59, 62, 65, 67, 69, 71, 73, 75, 77,
495 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
496 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
497 118, 120, 121, 123, 125, 127, 129, 131, 133, 135,
498 137, 139, 141, 143, 145, 147, 149
501 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
502 static const yytype_int8 yyrhs
[] =
504 75, 0, -1, 76, -1, 75, 73, 76, -1, 77,
505 -1, 3, -1, 10, -1, 4, -1, 5, -1, 6,
506 -1, 7, -1, 8, 73, 84, -1, 11, 69, 81,
507 82, -1, 11, 68, 81, 82, -1, 9, 84, -1,
508 46, 65, -1, 47, 65, -1, 78, -1, 45, 84,
509 -1, 19, 85, -1, 19, 85, 62, 83, -1, 20,
510 83, -1, 79, 65, -1, 80, -1, 39, -1, 32,
511 -1, 18, -1, 24, -1, 22, -1, 23, -1, 28,
512 -1, 29, -1, 31, -1, 33, -1, 34, -1, 35,
513 -1, 36, -1, 16, -1, 17, -1, 21, -1, 27,
514 -1, 30, -1, 37, -1, 38, -1, 44, -1, 42,
515 -1, 43, -1, 40, -1, 41, -1, -1, 66, -1,
516 -1, 67, -1, 48, -1, 49, -1, 50, -1, 51,
517 -1, 52, -1, 53, -1, 54, -1, 55, -1, 56,
518 -1, 70, -1, 71, -1, 57, -1, 58, -1, 59,
522 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
523 static const yytype_uint16 yyrline
[] =
525 0, 157, 157, 158, 162, 164, 166, 168, 173, 178,
526 182, 186, 197, 205, 213, 217, 221, 225, 229, 236,
527 243, 254, 261, 268, 275, 281, 285, 289, 293, 297,
528 301, 305, 309, 313, 317, 321, 325, 332, 336, 340,
529 344, 348, 352, 356, 360, 364, 368, 372, 376, 383,
530 384, 389, 390, 395, 399, 403, 407, 411, 415, 419,
531 423, 427, 434, 438, 446, 450, 454
535 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
536 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
537 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
538 static const char *const yytname
[] =
540 "$end", "error", "$undefined", "COMMENT", "END", "ERROR", "RESET",
541 "PARSER_DEBUG", "INCLUDE", "CONFIGURE_FILE", "EMPTY_LINE", "SERVER",
542 "SERVERS", "SERVERS_OPTION", "UNKNOWN_OPTION", "UNKNOWN",
543 "BINARY_PROTOCOL", "BUFFER_REQUESTS", "CONNECT_TIMEOUT", "DISTRIBUTION",
544 "HASH", "HASH_WITH_NAMESPACE", "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH",
545 "IO_MSG_WATERMARK", "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY",
546 "NUMBER_OF_REPLICAS", "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ",
547 "RCV_TIMEOUT", "REMOVE_FAILED_SERVERS", "RETRY_TIMEOUT", "SND_TIMEOUT",
548 "SOCKET_RECV_SIZE", "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS",
549 "USER_DATA", "USE_UDP", "VERIFY_KEY", "_TCP_KEEPALIVE", "_TCP_KEEPIDLE",
550 "_TCP_NODELAY", "NAMESPACE", "POOL_MIN", "POOL_MAX", "MD5", "CRC",
551 "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32", "HSIEH", "MURMUR",
552 "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE", "FALSE", "','",
553 "'='", "FLOAT", "NUMBER", "PORT", "WEIGHT_START", "IPADDRESS",
554 "HOSTNAME", "STRING", "QUOTED_STRING", "FILE_PATH", "' '", "$accept",
555 "begin", "statement", "expression", "behaviors", "behavior_number",
556 "behavior_boolean", "optional_port", "optional_weight", "hash", "string",
562 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
564 static const yytype_uint16 yytoknum
[] =
566 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
567 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
568 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
569 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
570 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
571 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
572 315, 316, 44, 61, 317, 318, 319, 320, 321, 322,
577 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
578 static const yytype_uint8 yyr1
[] =
580 0, 74, 75, 75, 76, 76, 76, 76, 76, 76,
581 76, 76, 77, 77, 77, 77, 77, 77, 78, 78,
582 78, 78, 78, 78, 78, 79, 79, 79, 79, 79,
583 79, 79, 79, 79, 79, 79, 79, 80, 80, 80,
584 80, 80, 80, 80, 80, 80, 80, 80, 80, 81,
585 81, 82, 82, 83, 83, 83, 83, 83, 83, 83,
586 83, 83, 84, 84, 85, 85, 85
589 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
590 static const yytype_uint8 yyr2
[] =
592 0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
593 1, 3, 4, 4, 2, 2, 2, 1, 2, 2,
594 4, 2, 2, 1, 1, 1, 1, 1, 1, 1,
595 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
596 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
597 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
601 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
602 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
603 means the default is an error. */
604 static const yytype_uint8 yydefact
[] =
606 0, 5, 7, 8, 9, 10, 0, 0, 6, 0,
607 37, 38, 26, 0, 0, 39, 28, 29, 27, 40,
608 30, 31, 41, 32, 25, 33, 34, 35, 36, 42,
609 43, 24, 47, 48, 45, 46, 44, 0, 0, 0,
610 0, 2, 4, 17, 0, 23, 0, 62, 63, 14,
611 49, 49, 64, 65, 66, 19, 53, 54, 55, 56,
612 57, 58, 59, 60, 61, 21, 18, 15, 16, 1,
613 0, 22, 11, 50, 51, 51, 0, 3, 52, 13,
617 /* YYDEFGOTO[NTERM-NUM]. */
618 static const yytype_int8 yydefgoto
[] =
620 -1, 40, 41, 42, 43, 44, 45, 74, 79, 65,
624 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
626 #define YYPACT_NINF -61
627 static const yytype_int8 yypact
[] =
629 -2, -61, -61, -61, -61, -61, -60, -23, -61, -45,
630 -61, -61, -61, -47, 8, -61, -61, -61, -61, -61,
631 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
632 -61, -61, -61, -61, -61, -61, -61, -23, -16, -15,
633 0, -61, -61, -61, -14, -61, -23, -61, -61, -61,
634 -13, -13, -61, -61, -61, -10, -61, -61, -61, -61,
635 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
636 -2, -61, -61, -61, -1, -1, 8, -61, -61, -61,
640 /* YYPGOTO[NTERM-NUM]. */
641 static const yytype_int8 yypgoto
[] =
643 -61, -61, -5, -61, -61, -61, -61, 3, -8, -7,
647 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
648 positive, shift that token. If negative, reduce the rule which
649 number is the opposite. If zero, do what YYDEFACT says.
650 If YYTABLE_NINF, syntax error. */
651 #define YYTABLE_NINF -1
652 static const yytype_uint8 yytable
[] =
654 69, 1, 2, 3, 4, 5, 6, 7, 8, 9,
655 52, 53, 54, 46, 10, 11, 12, 13, 14, 15,
656 16, 17, 18, 50, 51, 19, 20, 21, 22, 23,
657 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
658 34, 35, 36, 37, 38, 39, 66, 47, 48, 67,
659 68, 71, 76, 73, 75, 72, 56, 57, 58, 59,
660 60, 61, 62, 63, 64, 77, 78, 80, 0, 81,
664 static const yytype_int8 yycheck
[] =
666 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
667 57, 58, 59, 73, 16, 17, 18, 19, 20, 21,
668 22, 23, 24, 68, 69, 27, 28, 29, 30, 31,
669 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
670 42, 43, 44, 45, 46, 47, 37, 70, 71, 65,
671 65, 65, 62, 66, 51, 46, 48, 49, 50, 51,
672 52, 53, 54, 55, 56, 70, 67, 75, -1, 76,
676 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
677 symbol of state STATE-NUM. */
678 static const yytype_uint8 yystos
[] =
680 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
681 16, 17, 18, 19, 20, 21, 22, 23, 24, 27,
682 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
683 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
684 75, 76, 77, 78, 79, 80, 73, 70, 71, 84,
685 68, 69, 57, 58, 59, 85, 48, 49, 50, 51,
686 52, 53, 54, 55, 56, 83, 84, 65, 65, 0,
687 73, 65, 84, 66, 81, 81, 62, 76, 67, 82,
691 #define yyerrok (yyerrstatus = 0)
692 #define yyclearin (yychar = YYEMPTY)
696 #define YYACCEPT goto yyacceptlab
697 #define YYABORT goto yyabortlab
698 #define YYERROR goto yyerrorlab
701 /* Like YYERROR except do call yyerror. This remains here temporarily
702 to ease the transition to the new meaning of YYERROR, for GCC.
703 Once GCC version 2 has supplanted version 1, this can go. However,
704 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
705 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
708 #define YYFAIL goto yyerrlab
710 /* This is here to suppress warnings from the GCC cpp's
711 -Wunused-macros. Normally we don't worry about that warning, but
712 some users do, and we want to make it easy for users to remove
713 YYFAIL uses, which will produce warnings from Bison 2.5. */
716 #define YYRECOVERING() (!!yyerrstatus)
718 #define YYBACKUP(Token, Value) \
720 if (yychar == YYEMPTY && yylen == 1) \
724 yytoken = YYTRANSLATE (yychar); \
730 yyerror (context, scanner, YY_("syntax error: cannot back up")); \
737 #define YYERRCODE 256
740 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
741 If N is 0, then set CURRENT to the empty location which ends
742 the previous symbol: RHS[0] (always defined). */
744 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
745 #ifndef YYLLOC_DEFAULT
746 # define YYLLOC_DEFAULT(Current, Rhs, N) \
750 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
751 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
752 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
753 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
757 (Current).first_line = (Current).last_line = \
758 YYRHSLOC (Rhs, 0).last_line; \
759 (Current).first_column = (Current).last_column = \
760 YYRHSLOC (Rhs, 0).last_column; \
766 /* YY_LOCATION_PRINT -- Print the location on the stream.
767 This macro was not mandated originally: define only if we know
768 we won't break user code: when these are the locations we know. */
770 #ifndef YY_LOCATION_PRINT
771 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
772 # define YY_LOCATION_PRINT(File, Loc) \
773 fprintf (File, "%d.%d-%d.%d", \
774 (Loc).first_line, (Loc).first_column, \
775 (Loc).last_line, (Loc).last_column)
777 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
782 /* YYLEX -- calling `yylex' with the right arguments. */
785 # define YYLEX yylex (&yylval, YYLEX_PARAM)
787 # define YYLEX yylex (&yylval, scanner)
790 /* Enable debugging if requested. */
794 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
795 # define YYFPRINTF fprintf
798 # define YYDPRINTF(Args) \
804 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
808 YYFPRINTF (stderr, "%s ", Title); \
809 yy_symbol_print (stderr, \
810 Type, Value, context, scanner); \
811 YYFPRINTF (stderr, "\n"); \
816 /*--------------------------------.
817 | Print this symbol on YYOUTPUT. |
818 `--------------------------------*/
821 #if (defined __STDC__ || defined __C99__FUNC__ \
822 || defined __cplusplus || defined _MSC_VER)
824 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
827 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
830 YYSTYPE
const * const yyvaluep
;
840 if (yytype
< YYNTOKENS
)
841 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
853 /*--------------------------------.
854 | Print this symbol on YYOUTPUT. |
855 `--------------------------------*/
857 #if (defined __STDC__ || defined __C99__FUNC__ \
858 || defined __cplusplus || defined _MSC_VER)
860 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
863 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
866 YYSTYPE
const * const yyvaluep
;
871 if (yytype
< YYNTOKENS
)
872 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
874 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
876 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
);
877 YYFPRINTF (yyoutput
, ")");
880 /*------------------------------------------------------------------.
881 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
883 `------------------------------------------------------------------*/
885 #if (defined __STDC__ || defined __C99__FUNC__ \
886 || defined __cplusplus || defined _MSC_VER)
888 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
891 yy_stack_print (yybottom
, yytop
)
892 yytype_int16
*yybottom
;
896 YYFPRINTF (stderr
, "Stack now");
897 for (; yybottom
<= yytop
; yybottom
++)
899 int yybot
= *yybottom
;
900 YYFPRINTF (stderr
, " %d", yybot
);
902 YYFPRINTF (stderr
, "\n");
905 # define YY_STACK_PRINT(Bottom, Top) \
908 yy_stack_print ((Bottom), (Top)); \
912 /*------------------------------------------------.
913 | Report that the YYRULE is going to be reduced. |
914 `------------------------------------------------*/
916 #if (defined __STDC__ || defined __C99__FUNC__ \
917 || defined __cplusplus || defined _MSC_VER)
919 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
, Context
*context
, yyscan_t
*scanner
)
922 yy_reduce_print (yyvsp
, yyrule
, context
, scanner
)
929 int yynrhs
= yyr2
[yyrule
];
931 unsigned long int yylno
= yyrline
[yyrule
];
932 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
934 /* The symbols being reduced. */
935 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
937 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
938 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
939 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
941 YYFPRINTF (stderr
, "\n");
945 # define YY_REDUCE_PRINT(Rule) \
948 yy_reduce_print (yyvsp, Rule, context, scanner); \
951 /* Nonzero means print parse trace. It is left uninitialized so that
952 multiple parsers can coexist. */
955 # define YYDPRINTF(Args)
956 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
957 # define YY_STACK_PRINT(Bottom, Top)
958 # define YY_REDUCE_PRINT(Rule)
959 #endif /* !YYDEBUG */
962 /* YYINITDEPTH -- initial size of the parser's stacks. */
964 # define YYINITDEPTH 200
967 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
968 if the built-in stack extension method is used).
970 Do not make this value too large; the results are undefined if
971 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
972 evaluated with infinite-precision integer arithmetic. */
975 # define YYMAXDEPTH 10000
983 # if defined __GLIBC__ && defined _STRING_H
984 # define yystrlen strlen
986 /* Return the length of YYSTR. */
987 #if (defined __STDC__ || defined __C99__FUNC__ \
988 || defined __cplusplus || defined _MSC_VER)
990 yystrlen (const char *yystr
)
998 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1006 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1007 # define yystpcpy stpcpy
1009 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1011 #if (defined __STDC__ || defined __C99__FUNC__ \
1012 || defined __cplusplus || defined _MSC_VER)
1014 yystpcpy (char *yydest
, const char *yysrc
)
1017 yystpcpy (yydest
, yysrc
)
1023 const char *yys
= yysrc
;
1025 while ((*yyd
++ = *yys
++) != '\0')
1034 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1035 quotes and backslashes, so that it's suitable for yyerror. The
1036 heuristic is that double-quoting is unnecessary unless the string
1037 contains an apostrophe, a comma, or backslash (other than
1038 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1039 null, do not copy; instead, return the length of what the result
1042 yytnamerr (char *yyres
, const char *yystr
)
1047 char const *yyp
= yystr
;
1054 goto do_not_strip_quotes
;
1058 goto do_not_strip_quotes
;
1071 do_not_strip_quotes
: ;
1075 return yystrlen (yystr
);
1077 return yystpcpy (yyres
, yystr
) - yyres
;
1081 /* Copy into YYRESULT an error message about the unexpected token
1082 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1083 including the terminating null byte. If YYRESULT is null, do not
1084 copy anything; just return the number of bytes that would be
1085 copied. As a special case, return 0 if an ordinary "syntax error"
1086 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1087 size calculation. */
1089 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1091 int yyn
= yypact
[yystate
];
1093 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1097 int yytype
= YYTRANSLATE (yychar
);
1098 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1099 YYSIZE_T yysize
= yysize0
;
1101 int yysize_overflow
= 0;
1102 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1103 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1107 /* This is so xgettext sees the translatable formats that are
1108 constructed on the fly. */
1109 YY_("syntax error, unexpected %s");
1110 YY_("syntax error, unexpected %s, expecting %s");
1111 YY_("syntax error, unexpected %s, expecting %s or %s");
1112 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1113 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1117 static char const yyunexpected
[] = "syntax error, unexpected %s";
1118 static char const yyexpecting
[] = ", expecting %s";
1119 static char const yyor
[] = " or %s";
1120 char yyformat
[sizeof yyunexpected
1121 + sizeof yyexpecting
- 1
1122 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1123 * (sizeof yyor
- 1))];
1124 char const *yyprefix
= yyexpecting
;
1126 /* Start YYX at -YYN if negative to avoid negative indexes in
1128 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1130 /* Stay within bounds of both yycheck and yytname. */
1131 int yychecklim
= YYLAST
- yyn
+ 1;
1132 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1135 yyarg
[0] = yytname
[yytype
];
1136 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1138 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1139 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1141 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1145 yyformat
[sizeof yyunexpected
- 1] = '\0';
1148 yyarg
[yycount
++] = yytname
[yyx
];
1149 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1150 yysize_overflow
|= (yysize1
< yysize
);
1152 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1156 yyf
= YY_(yyformat
);
1157 yysize1
= yysize
+ yystrlen (yyf
);
1158 yysize_overflow
|= (yysize1
< yysize
);
1161 if (yysize_overflow
)
1162 return YYSIZE_MAXIMUM
;
1166 /* Avoid sprintf, as that infringes on the user's name space.
1167 Don't have undefined behavior even if the translation
1168 produced a string with the wrong number of "%s"s. */
1169 char *yyp
= yyresult
;
1171 while ((*yyp
= *yyf
) != '\0')
1173 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1175 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1188 #endif /* YYERROR_VERBOSE */
1191 /*-----------------------------------------------.
1192 | Release the memory associated to this symbol. |
1193 `-----------------------------------------------*/
1196 #if (defined __STDC__ || defined __C99__FUNC__ \
1197 || defined __cplusplus || defined _MSC_VER)
1199 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, Context
*context
, yyscan_t
*scanner
)
1202 yydestruct (yymsg
, yytype
, yyvaluep
, context
, scanner
)
1216 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1226 /* Prevent warnings from -Wmissing-prototypes. */
1227 #ifdef YYPARSE_PARAM
1228 #if defined __STDC__ || defined __cplusplus
1229 int yyparse (void *YYPARSE_PARAM
);
1233 #else /* ! YYPARSE_PARAM */
1234 #if defined __STDC__ || defined __cplusplus
1235 int yyparse (Context
*context
, yyscan_t
*scanner
);
1239 #endif /* ! YYPARSE_PARAM */
1245 /*-------------------------.
1246 | yyparse or yypush_parse. |
1247 `-------------------------*/
1249 #ifdef YYPARSE_PARAM
1250 #if (defined __STDC__ || defined __C99__FUNC__ \
1251 || defined __cplusplus || defined _MSC_VER)
1253 yyparse (void *YYPARSE_PARAM
)
1256 yyparse (YYPARSE_PARAM
)
1257 void *YYPARSE_PARAM
;
1259 #else /* ! YYPARSE_PARAM */
1260 #if (defined __STDC__ || defined __C99__FUNC__ \
1261 || defined __cplusplus || defined _MSC_VER)
1263 yyparse (Context
*context
, yyscan_t
*scanner
)
1266 yyparse (context
, scanner
)
1272 /* The lookahead symbol. */
1275 /* The semantic value of the lookahead symbol. */
1278 /* Number of syntax errors so far. */
1282 /* Number of tokens to shift before error messages enabled. */
1285 /* The stacks and their tools:
1286 `yyss': related to states.
1287 `yyvs': related to semantic values.
1289 Refer to the stacks thru separate pointers, to allow yyoverflow
1290 to reallocate them elsewhere. */
1292 /* The state stack. */
1293 yytype_int16 yyssa
[YYINITDEPTH
];
1295 yytype_int16
*yyssp
;
1297 /* The semantic value stack. */
1298 YYSTYPE yyvsa
[YYINITDEPTH
];
1302 YYSIZE_T yystacksize
;
1306 /* Lookahead token as an internal (translated) token number. */
1308 /* The variables used to return semantic value and location from the
1313 /* Buffer for error messages, and its allocated size. */
1315 char *yymsg
= yymsgbuf
;
1316 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1319 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1321 /* The number of symbols on the RHS of the reduced rule.
1322 Keep to zero when no symbol should be popped. */
1328 yystacksize
= YYINITDEPTH
;
1330 YYDPRINTF ((stderr
, "Starting parse\n"));
1335 yychar
= YYEMPTY
; /* Cause a token to be read. */
1337 /* Initialize stack pointers.
1338 Waste one element of value and location stack
1339 so that they stay on the same level as the state stack.
1340 The wasted elements are never initialized. */
1346 /*------------------------------------------------------------.
1347 | yynewstate -- Push a new state, which is found in yystate. |
1348 `------------------------------------------------------------*/
1350 /* In all cases, when you get here, the value and location stacks
1351 have just been pushed. So pushing a state here evens the stacks. */
1357 if (yyss
+ yystacksize
- 1 <= yyssp
)
1359 /* Get the current used size of the three stacks, in elements. */
1360 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1364 /* Give user a chance to reallocate the stack. Use copies of
1365 these so that the &'s don't force the real ones into
1367 YYSTYPE
*yyvs1
= yyvs
;
1368 yytype_int16
*yyss1
= yyss
;
1370 /* Each stack pointer address is followed by the size of the
1371 data in use in that stack, in bytes. This used to be a
1372 conditional around just the two extra args, but that might
1373 be undefined if yyoverflow is a macro. */
1374 yyoverflow (YY_("memory exhausted"),
1375 &yyss1
, yysize
* sizeof (*yyssp
),
1376 &yyvs1
, yysize
* sizeof (*yyvsp
),
1382 #else /* no yyoverflow */
1383 # ifndef YYSTACK_RELOCATE
1384 goto yyexhaustedlab
;
1386 /* Extend the stack our own way. */
1387 if (YYMAXDEPTH
<= yystacksize
)
1388 goto yyexhaustedlab
;
1390 if (YYMAXDEPTH
< yystacksize
)
1391 yystacksize
= YYMAXDEPTH
;
1394 yytype_int16
*yyss1
= yyss
;
1395 union yyalloc
*yyptr
=
1396 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1398 goto yyexhaustedlab
;
1399 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1400 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1401 # undef YYSTACK_RELOCATE
1403 YYSTACK_FREE (yyss1
);
1406 #endif /* no yyoverflow */
1408 yyssp
= yyss
+ yysize
- 1;
1409 yyvsp
= yyvs
+ yysize
- 1;
1411 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1412 (unsigned long int) yystacksize
));
1414 if (yyss
+ yystacksize
- 1 <= yyssp
)
1418 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1420 if (yystate
== YYFINAL
)
1430 /* Do appropriate processing given the current state. Read a
1431 lookahead token if we need one and don't already have one. */
1433 /* First try to decide what to do without reference to lookahead token. */
1434 yyn
= yypact
[yystate
];
1435 if (yyn
== YYPACT_NINF
)
1438 /* Not known => get a lookahead token if don't already have one. */
1440 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1441 if (yychar
== YYEMPTY
)
1443 YYDPRINTF ((stderr
, "Reading a token: "));
1447 if (yychar
<= YYEOF
)
1449 yychar
= yytoken
= YYEOF
;
1450 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1454 yytoken
= YYTRANSLATE (yychar
);
1455 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1458 /* If the proper action on seeing token YYTOKEN is to reduce or to
1459 detect an error, take that action. */
1461 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1466 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1472 /* Count tokens shifted since error; after three, turn off error
1477 /* Shift the lookahead token. */
1478 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1480 /* Discard the shifted token. */
1489 /*-----------------------------------------------------------.
1490 | yydefault -- do the default action for the current state. |
1491 `-----------------------------------------------------------*/
1493 yyn
= yydefact
[yystate
];
1499 /*-----------------------------.
1500 | yyreduce -- Do a reduction. |
1501 `-----------------------------*/
1503 /* yyn is the number of a rule to reduce with. */
1506 /* If YYLEN is nonzero, implement the default value of the action:
1509 Otherwise, the following line sets YYVAL to garbage.
1510 This behavior is undocumented and Bison
1511 users should not rely upon it. Assigning to YYVAL
1512 unconditionally makes the parser a bit smaller, and it avoids a
1513 GCC warning that YYVAL may be used uninitialized. */
1514 yyval
= yyvsp
[1-yylen
];
1517 YY_REDUCE_PRINT (yyn
);
1522 /* Line 1464 of yacc.c */
1523 #line 163 "libmemcached/options/parser.yy"
1529 /* Line 1464 of yacc.c */
1530 #line 165 "libmemcached/options/parser.yy"
1536 /* Line 1464 of yacc.c */
1537 #line 167 "libmemcached/options/parser.yy"
1543 /* Line 1464 of yacc.c */
1544 #line 169 "libmemcached/options/parser.yy"
1553 /* Line 1464 of yacc.c */
1554 #line 174 "libmemcached/options/parser.yy"
1556 context
->rc
= MEMCACHED_PARSE_USER_ERROR
;
1557 parser_abort(context
, NULL
);
1563 /* Line 1464 of yacc.c */
1564 #line 179 "libmemcached/options/parser.yy"
1566 memcached_reset(context
->memc
);
1572 /* Line 1464 of yacc.c */
1573 #line 183 "libmemcached/options/parser.yy"
1581 /* Line 1464 of yacc.c */
1582 #line 187 "libmemcached/options/parser.yy"
1584 if ((context
->rc
= memcached_parse_configure_file(context
->memc
, (yyvsp
[(3) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].string
).size
)) != MEMCACHED_SUCCESS
)
1586 parser_abort(context
, NULL
);
1593 /* Line 1464 of yacc.c */
1594 #line 198 "libmemcached/options/parser.yy"
1596 if (memcached_failed(context
->rc
= memcached_server_add_with_weight(context
->memc
, (yyvsp
[(2) - (4)].server
).c_str
, (yyvsp
[(3) - (4)].number
), (yyvsp
[(4) - (4)].number
))))
1598 parser_abort(context
, NULL
);
1600 context
->unset_server();
1606 /* Line 1464 of yacc.c */
1607 #line 206 "libmemcached/options/parser.yy"
1609 if (memcached_failed(context
->rc
= memcached_server_add_with_weight(context
->memc
, (yyvsp
[(2) - (4)].server
).c_str
, (yyvsp
[(3) - (4)].number
), (yyvsp
[(4) - (4)].number
))))
1611 parser_abort(context
, NULL
);
1613 context
->unset_server();
1619 /* Line 1464 of yacc.c */
1620 #line 214 "libmemcached/options/parser.yy"
1622 memcached_set_configuration_file(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
);
1628 /* Line 1464 of yacc.c */
1629 #line 218 "libmemcached/options/parser.yy"
1631 context
->memc
->configure
.initial_pool_size
= (yyvsp
[(2) - (2)].number
);
1637 /* Line 1464 of yacc.c */
1638 #line 222 "libmemcached/options/parser.yy"
1640 context
->memc
->configure
.max_pool_size
= (yyvsp
[(2) - (2)].number
);
1646 /* Line 1464 of yacc.c */
1647 #line 230 "libmemcached/options/parser.yy"
1649 if ((context
->rc
= memcached_set_prefix_key(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
)) != MEMCACHED_SUCCESS
)
1651 parser_abort(context
, NULL
);;
1658 /* Line 1464 of yacc.c */
1659 #line 237 "libmemcached/options/parser.yy"
1661 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1663 parser_abort(context
, NULL
);;
1670 /* Line 1464 of yacc.c */
1671 #line 244 "libmemcached/options/parser.yy"
1673 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (4)].distribution
))) != MEMCACHED_SUCCESS
)
1675 parser_abort(context
, NULL
);;
1677 if ((context
->rc
= memcached_behavior_set_distribution_hash(context
->memc
, (yyvsp
[(4) - (4)].hash
))) != MEMCACHED_SUCCESS
)
1679 parser_abort(context
, NULL
);;
1686 /* Line 1464 of yacc.c */
1687 #line 255 "libmemcached/options/parser.yy"
1689 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_HASH
, (yyvsp
[(2) - (2)].hash
))) != MEMCACHED_SUCCESS
)
1691 parser_abort(context
, NULL
);;
1698 /* Line 1464 of yacc.c */
1699 #line 262 "libmemcached/options/parser.yy"
1701 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (2)].behavior
), (yyvsp
[(2) - (2)].number
))) != MEMCACHED_SUCCESS
)
1703 parser_abort(context
, NULL
);;
1710 /* Line 1464 of yacc.c */
1711 #line 269 "libmemcached/options/parser.yy"
1713 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (1)].behavior
), true)) != MEMCACHED_SUCCESS
)
1715 parser_abort(context
, NULL
);;
1722 /* Line 1464 of yacc.c */
1723 #line 276 "libmemcached/options/parser.yy"
1730 /* Line 1464 of yacc.c */
1731 #line 282 "libmemcached/options/parser.yy"
1733 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS
;
1739 /* Line 1464 of yacc.c */
1740 #line 286 "libmemcached/options/parser.yy"
1742 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
;
1748 /* Line 1464 of yacc.c */
1749 #line 290 "libmemcached/options/parser.yy"
1751 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
;
1757 /* Line 1464 of yacc.c */
1758 #line 294 "libmemcached/options/parser.yy"
1760 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
;
1766 /* Line 1464 of yacc.c */
1767 #line 298 "libmemcached/options/parser.yy"
1769 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
;
1775 /* Line 1464 of yacc.c */
1776 #line 302 "libmemcached/options/parser.yy"
1778 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
;
1784 /* Line 1464 of yacc.c */
1785 #line 306 "libmemcached/options/parser.yy"
1787 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT
;
1793 /* Line 1464 of yacc.c */
1794 #line 310 "libmemcached/options/parser.yy"
1796 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT
;
1802 /* Line 1464 of yacc.c */
1803 #line 314 "libmemcached/options/parser.yy"
1805 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
;
1811 /* Line 1464 of yacc.c */
1812 #line 318 "libmemcached/options/parser.yy"
1814 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SND_TIMEOUT
;
1820 /* Line 1464 of yacc.c */
1821 #line 322 "libmemcached/options/parser.yy"
1823 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
;
1829 /* Line 1464 of yacc.c */
1830 #line 326 "libmemcached/options/parser.yy"
1832 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
;
1838 /* Line 1464 of yacc.c */
1839 #line 333 "libmemcached/options/parser.yy"
1841 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
;
1847 /* Line 1464 of yacc.c */
1848 #line 337 "libmemcached/options/parser.yy"
1850 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
;
1856 /* Line 1464 of yacc.c */
1857 #line 341 "libmemcached/options/parser.yy"
1859 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
;
1865 /* Line 1464 of yacc.c */
1866 #line 345 "libmemcached/options/parser.yy"
1868 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NOREPLY
;
1874 /* Line 1464 of yacc.c */
1875 #line 349 "libmemcached/options/parser.yy"
1877 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
;
1883 /* Line 1464 of yacc.c */
1884 #line 353 "libmemcached/options/parser.yy"
1886 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SORT_HOSTS
;
1892 /* Line 1464 of yacc.c */
1893 #line 357 "libmemcached/options/parser.yy"
1895 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SUPPORT_CAS
;
1901 /* Line 1464 of yacc.c */
1902 #line 361 "libmemcached/options/parser.yy"
1904 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_NODELAY
;
1910 /* Line 1464 of yacc.c */
1911 #line 365 "libmemcached/options/parser.yy"
1913 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
;
1919 /* Line 1464 of yacc.c */
1920 #line 369 "libmemcached/options/parser.yy"
1922 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE
;
1928 /* Line 1464 of yacc.c */
1929 #line 373 "libmemcached/options/parser.yy"
1931 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_USE_UDP
;
1937 /* Line 1464 of yacc.c */
1938 #line 377 "libmemcached/options/parser.yy"
1940 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_VERIFY_KEY
;
1946 /* Line 1464 of yacc.c */
1947 #line 383 "libmemcached/options/parser.yy"
1948 { (yyval
.number
)= MEMCACHED_DEFAULT_PORT
;;}
1953 /* Line 1464 of yacc.c */
1954 #line 385 "libmemcached/options/parser.yy"
1960 /* Line 1464 of yacc.c */
1961 #line 389 "libmemcached/options/parser.yy"
1962 { (yyval
.number
)= 1; ;}
1967 /* Line 1464 of yacc.c */
1968 #line 391 "libmemcached/options/parser.yy"
1974 /* Line 1464 of yacc.c */
1975 #line 396 "libmemcached/options/parser.yy"
1977 (yyval
.hash
)= MEMCACHED_HASH_MD5
;
1983 /* Line 1464 of yacc.c */
1984 #line 400 "libmemcached/options/parser.yy"
1986 (yyval
.hash
)= MEMCACHED_HASH_CRC
;
1992 /* Line 1464 of yacc.c */
1993 #line 404 "libmemcached/options/parser.yy"
1995 (yyval
.hash
)= MEMCACHED_HASH_FNV1_64
;
2001 /* Line 1464 of yacc.c */
2002 #line 408 "libmemcached/options/parser.yy"
2004 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_64
;
2010 /* Line 1464 of yacc.c */
2011 #line 412 "libmemcached/options/parser.yy"
2013 (yyval
.hash
)= MEMCACHED_HASH_FNV1_32
;
2019 /* Line 1464 of yacc.c */
2020 #line 416 "libmemcached/options/parser.yy"
2022 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_32
;
2028 /* Line 1464 of yacc.c */
2029 #line 420 "libmemcached/options/parser.yy"
2031 (yyval
.hash
)= MEMCACHED_HASH_HSIEH
;
2037 /* Line 1464 of yacc.c */
2038 #line 424 "libmemcached/options/parser.yy"
2040 (yyval
.hash
)= MEMCACHED_HASH_MURMUR
;
2046 /* Line 1464 of yacc.c */
2047 #line 428 "libmemcached/options/parser.yy"
2049 (yyval
.hash
)= MEMCACHED_HASH_JENKINS
;
2055 /* Line 1464 of yacc.c */
2056 #line 435 "libmemcached/options/parser.yy"
2058 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2064 /* Line 1464 of yacc.c */
2065 #line 439 "libmemcached/options/parser.yy"
2067 (yyval
.string
).c_str
= (yyvsp
[(1) - (1)].string
).c_str
+1; // +1 to move use passed the initial quote
2068 (yyval
.string
).size
= (yyvsp
[(1) - (1)].string
).size
-2; // -2 removes the begin and end quote
2074 /* Line 1464 of yacc.c */
2075 #line 447 "libmemcached/options/parser.yy"
2077 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_CONSISTENT
;
2083 /* Line 1464 of yacc.c */
2084 #line 451 "libmemcached/options/parser.yy"
2086 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_MODULA
;
2092 /* Line 1464 of yacc.c */
2093 #line 455 "libmemcached/options/parser.yy"
2095 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_RANDOM
;
2101 /* Line 1464 of yacc.c */
2102 #line 2103 "libmemcached/options/parser.cc"
2105 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2109 YY_STACK_PRINT (yyss
, yyssp
);
2113 /* Now `shift' the result of the reduction. Determine what state
2114 that goes to, based on the state we popped back to and the rule
2115 number reduced by. */
2119 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2120 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2121 yystate
= yytable
[yystate
];
2123 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2128 /*------------------------------------.
2129 | yyerrlab -- here on detecting error |
2130 `------------------------------------*/
2132 /* If not already recovering from an error, report this error. */
2136 #if ! YYERROR_VERBOSE
2137 yyerror (context
, scanner
, YY_("syntax error"));
2140 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2141 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2143 YYSIZE_T yyalloc
= 2 * yysize
;
2144 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2145 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2146 if (yymsg
!= yymsgbuf
)
2147 YYSTACK_FREE (yymsg
);
2148 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2150 yymsg_alloc
= yyalloc
;
2154 yymsg_alloc
= sizeof yymsgbuf
;
2158 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2160 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2161 yyerror (context
, scanner
, yymsg
);
2165 yyerror (context
, scanner
, YY_("syntax error"));
2167 goto yyexhaustedlab
;
2175 if (yyerrstatus
== 3)
2177 /* If just tried and failed to reuse lookahead token after an
2178 error, discard it. */
2180 if (yychar
<= YYEOF
)
2182 /* Return failure if at end of input. */
2183 if (yychar
== YYEOF
)
2188 yydestruct ("Error: discarding",
2189 yytoken
, &yylval
, context
, scanner
);
2194 /* Else will try to reuse lookahead token after shifting the error
2199 /*---------------------------------------------------.
2200 | yyerrorlab -- error raised explicitly by YYERROR. |
2201 `---------------------------------------------------*/
2204 /* Pacify compilers like GCC when the user code never invokes
2205 YYERROR and the label yyerrorlab therefore never appears in user
2207 if (/*CONSTCOND*/ 0)
2210 /* Do not reclaim the symbols of the rule which action triggered
2214 YY_STACK_PRINT (yyss
, yyssp
);
2219 /*-------------------------------------------------------------.
2220 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2221 `-------------------------------------------------------------*/
2223 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2227 yyn
= yypact
[yystate
];
2228 if (yyn
!= YYPACT_NINF
)
2231 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2239 /* Pop the current state because it cannot handle the error token. */
2244 yydestruct ("Error: popping",
2245 yystos
[yystate
], yyvsp
, context
, scanner
);
2248 YY_STACK_PRINT (yyss
, yyssp
);
2254 /* Shift the error token. */
2255 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2261 /*-------------------------------------.
2262 | yyacceptlab -- YYACCEPT comes here. |
2263 `-------------------------------------*/
2268 /*-----------------------------------.
2269 | yyabortlab -- YYABORT comes here. |
2270 `-----------------------------------*/
2275 #if !defined(yyoverflow) || YYERROR_VERBOSE
2276 /*-------------------------------------------------.
2277 | yyexhaustedlab -- memory exhaustion comes here. |
2278 `-------------------------------------------------*/
2280 yyerror (context
, scanner
, YY_("memory exhausted"));
2286 if (yychar
!= YYEMPTY
)
2287 yydestruct ("Cleanup: discarding lookahead",
2288 yytoken
, &yylval
, context
, scanner
);
2289 /* Do not reclaim the symbols of the rule which action triggered
2290 this YYABORT or YYACCEPT. */
2292 YY_STACK_PRINT (yyss
, yyssp
);
2293 while (yyssp
!= yyss
)
2295 yydestruct ("Cleanup: popping",
2296 yystos
[*yyssp
], yyvsp
, context
, scanner
);
2301 YYSTACK_FREE (yyss
);
2304 if (yymsg
!= yymsgbuf
)
2305 YYSTACK_FREE (yymsg
);
2307 /* Make sure YYID is used. */
2308 return YYID (yyresult
);
2313 /* Line 1684 of yacc.c */
2314 #line 460 "libmemcached/options/parser.yy"
2317 void Context::start()
2319 config_parse(this, (void **)scanner
);