1 /* A Bison parser, made by GNU Bison 2.4.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6 2009, 2010 Free Software Foundation, Inc.
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
44 /* Identify Bison output. */
48 #define YYBISON_VERSION "2.4.3"
51 #define YYSKELETON_NAME "yacc.c"
62 /* Using locations. */
63 #define YYLSP_NEEDED 0
65 /* Substitute the variable and function names. */
66 #define yyparse config_parse
67 #define yylex config_lex
68 #define yyerror config_error
69 #define yylval config_lval
70 #define yychar config_char
71 #define yydebug config_debug
72 #define yynerrs config_nerrs
75 /* Copy the first part of user declarations. */
77 /* Line 189 of yacc.c */
78 #line 36 "libmemcached/options/parser.yy"
85 #include <libmemcached/common.h>
86 #include <libmemcached/options.hpp>
88 #include <libmemcached/options/context.h>
89 #include <libmemcached/options/symbol.h>
90 #include <libmemcached/options/scanner.h>
92 #pragma GCC diagnostic ignored "-Wold-style-cast"
94 int conf_lex(YYSTYPE
* lvalp
, void* scanner
);
96 #define parser_abort(A, B) do { (A)->abort((B)); YYABORT; } while (0)
98 inline void config_error(Context
*context
, yyscan_t
*scanner
, const char *error
)
100 if (not context
->end())
101 context
->abort(error
);
106 /* Line 189 of yacc.c */
107 #line 108 "libmemcached/options/parser.cc"
109 /* Enabling traces. */
114 /* Enabling verbose error messages. */
115 #ifdef YYERROR_VERBOSE
116 # undef YYERROR_VERBOSE
117 # define YYERROR_VERBOSE 1
119 # define YYERROR_VERBOSE 1
122 /* Enabling the token table. */
123 #ifndef YYTOKEN_TABLE
124 # define YYTOKEN_TABLE 0
131 /* Put the tokens into the symbol table, so that GDB and other debuggers
140 CONFIGURE_FILE
= 264,
144 SERVERS_OPTION
= 268,
145 UNKNOWN_OPTION
= 269,
147 BINARY_PROTOCOL
= 271,
148 BUFFER_REQUESTS
= 272,
149 CONNECT_TIMEOUT
= 273,
152 HASH_WITH_NAMESPACE
= 276,
153 IO_BYTES_WATERMARK
= 277,
154 IO_KEY_PREFETCH
= 278,
155 IO_MSG_WATERMARK
= 279,
157 KETAMA_WEIGHTED
= 281,
159 NUMBER_OF_REPLICAS
= 283,
161 RANDOMIZE_REPLICA_READ
= 285,
163 REMOVE_FAILED_SERVERS
= 287,
166 SOCKET_RECV_SIZE
= 290,
167 SOCKET_SEND_SIZE
= 291,
173 _TCP_KEEPALIVE
= 297,
207 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
209 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
210 # define YYSTYPE_IS_DECLARED 1
214 /* Copy the second part of user declarations. */
217 /* Line 264 of yacc.c */
218 #line 219 "libmemcached/options/parser.cc"
225 typedef YYTYPE_UINT8 yytype_uint8
;
227 typedef unsigned char yytype_uint8
;
231 typedef YYTYPE_INT8 yytype_int8
;
232 #elif (defined __STDC__ || defined __C99__FUNC__ \
233 || defined __cplusplus || defined _MSC_VER)
234 typedef signed char yytype_int8
;
236 typedef short int yytype_int8
;
240 typedef YYTYPE_UINT16 yytype_uint16
;
242 typedef unsigned short int yytype_uint16
;
246 typedef YYTYPE_INT16 yytype_int16
;
248 typedef short int yytype_int16
;
252 # ifdef __SIZE_TYPE__
253 # define YYSIZE_T __SIZE_TYPE__
254 # elif defined size_t
255 # define YYSIZE_T size_t
256 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
257 || defined __cplusplus || defined _MSC_VER)
258 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
259 # define YYSIZE_T size_t
261 # define YYSIZE_T unsigned int
265 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
268 # if defined YYENABLE_NLS && YYENABLE_NLS
270 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
271 # define YY_(msgid) dgettext ("bison-runtime", msgid)
275 # define YY_(msgid) msgid
279 /* Suppress unused-variable warnings by "using" E. */
280 #if ! defined lint || defined __GNUC__
281 # define YYUSE(e) ((void) (e))
283 # define YYUSE(e) /* empty */
286 /* Identity function, used to suppress warnings about constant conditions. */
290 #if (defined __STDC__ || defined __C99__FUNC__ \
291 || defined __cplusplus || defined _MSC_VER)
304 #if ! defined yyoverflow || YYERROR_VERBOSE
306 /* The parser invokes alloca or malloc; define the necessary symbols. */
308 # ifdef YYSTACK_USE_ALLOCA
309 # if YYSTACK_USE_ALLOCA
311 # define YYSTACK_ALLOC __builtin_alloca
312 # elif defined __BUILTIN_VA_ARG_INCR
313 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
315 # define YYSTACK_ALLOC __alloca
316 # elif defined _MSC_VER
317 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
318 # define alloca _alloca
320 # define YYSTACK_ALLOC alloca
321 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
322 || defined __cplusplus || defined _MSC_VER)
323 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
332 # ifdef YYSTACK_ALLOC
333 /* Pacify GCC's `empty if-body' warning. */
334 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
335 # ifndef YYSTACK_ALLOC_MAXIMUM
336 /* The OS might guarantee only one guard page at the bottom of the stack,
337 and a page size can be as small as 4096 bytes. So we cannot safely
338 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
339 to allow for a few compiler-allocated temporary stack slots. */
340 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
343 # define YYSTACK_ALLOC YYMALLOC
344 # define YYSTACK_FREE YYFREE
345 # ifndef YYSTACK_ALLOC_MAXIMUM
346 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
348 # if (defined __cplusplus && ! defined _STDLIB_H \
349 && ! ((defined YYMALLOC || defined malloc) \
350 && (defined YYFREE || defined free)))
351 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
357 # define YYMALLOC malloc
358 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
359 || defined __cplusplus || defined _MSC_VER)
360 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
365 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
366 || defined __cplusplus || defined _MSC_VER)
367 void free (void *); /* INFRINGES ON USER NAME SPACE */
371 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
374 #if (! defined yyoverflow \
375 && (! defined __cplusplus \
376 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
378 /* A type that is properly aligned for any stack member. */
381 yytype_int16 yyss_alloc
;
385 /* The size of the maximum gap between one aligned stack and the next. */
386 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
388 /* The size of an array large to enough to hold all stacks, each with
390 # define YYSTACK_BYTES(N) \
391 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
392 + YYSTACK_GAP_MAXIMUM)
394 /* Copy COUNT objects from FROM to TO. The source and destination do
397 # if defined __GNUC__ && 1 < __GNUC__
398 # define YYCOPY(To, From, Count) \
399 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
401 # define YYCOPY(To, From, Count) \
405 for (yyi = 0; yyi < (Count); yyi++) \
406 (To)[yyi] = (From)[yyi]; \
412 /* Relocate STACK from its old location to the new one. The
413 local variables YYSIZE and YYSTACKSIZE give the old and new number of
414 elements in the stack, and YYPTR gives the new location of the
415 stack. Advance YYPTR to a properly aligned location for the next
417 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
420 YYSIZE_T yynewbytes; \
421 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
422 Stack = &yyptr->Stack_alloc; \
423 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
424 yyptr += yynewbytes / sizeof (*yyptr); \
430 /* YYFINAL -- State number of the termination state. */
432 /* YYLAST -- Last index in YYTABLE. */
435 /* YYNTOKENS -- Number of terminals. */
437 /* YYNNTS -- Number of nonterminals. */
439 /* YYNRULES -- Number of rules. */
441 /* YYNRULES -- Number of states. */
444 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
446 #define YYMAXUTOK 325
448 #define YYTRANSLATE(YYX) \
449 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
451 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
452 static const yytype_uint8 yytranslate
[] =
454 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 73, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 62, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 63, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
480 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
481 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
482 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
483 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
484 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
485 55, 56, 57, 58, 59, 60, 61, 64, 65, 66,
486 67, 68, 69, 70, 71, 72
490 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
492 static const yytype_uint8 yyprhs
[] =
494 0, 0, 3, 5, 9, 11, 13, 15, 17, 19,
495 21, 23, 27, 32, 37, 40, 43, 46, 48, 51,
496 54, 59, 62, 65, 67, 69, 71, 73, 75, 77,
497 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
498 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
499 118, 120, 121, 123, 125, 127, 129, 131, 133, 135,
500 137, 139, 141, 143, 145, 147, 149
503 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
504 static const yytype_int8 yyrhs
[] =
506 75, 0, -1, 76, -1, 75, 73, 76, -1, 77,
507 -1, 3, -1, 10, -1, 4, -1, 5, -1, 6,
508 -1, 7, -1, 8, 73, 84, -1, 11, 69, 81,
509 82, -1, 11, 68, 81, 82, -1, 9, 84, -1,
510 46, 65, -1, 47, 65, -1, 78, -1, 45, 84,
511 -1, 19, 85, -1, 19, 85, 62, 83, -1, 20,
512 83, -1, 79, 65, -1, 80, -1, 39, -1, 32,
513 -1, 18, -1, 24, -1, 22, -1, 23, -1, 28,
514 -1, 29, -1, 31, -1, 33, -1, 34, -1, 35,
515 -1, 36, -1, 16, -1, 17, -1, 21, -1, 27,
516 -1, 30, -1, 37, -1, 38, -1, 44, -1, 42,
517 -1, 43, -1, 40, -1, 41, -1, -1, 66, -1,
518 -1, 67, -1, 48, -1, 49, -1, 50, -1, 51,
519 -1, 52, -1, 53, -1, 54, -1, 55, -1, 56,
520 -1, 70, -1, 71, -1, 57, -1, 58, -1, 59,
524 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
525 static const yytype_uint16 yyrline
[] =
527 0, 159, 159, 160, 164, 166, 168, 170, 175, 180,
528 184, 188, 199, 207, 215, 219, 223, 227, 231, 238,
529 245, 256, 263, 270, 277, 283, 287, 291, 295, 299,
530 303, 307, 311, 315, 319, 323, 327, 334, 338, 342,
531 346, 350, 354, 358, 362, 366, 370, 374, 378, 385,
532 386, 391, 392, 397, 401, 405, 409, 413, 417, 421,
533 425, 429, 436, 440, 448, 452, 456
537 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
538 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
539 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
540 static const char *const yytname
[] =
542 "$end", "error", "$undefined", "COMMENT", "END", "ERROR", "RESET",
543 "PARSER_DEBUG", "INCLUDE", "CONFIGURE_FILE", "EMPTY_LINE", "SERVER",
544 "SERVERS", "SERVERS_OPTION", "UNKNOWN_OPTION", "UNKNOWN",
545 "BINARY_PROTOCOL", "BUFFER_REQUESTS", "CONNECT_TIMEOUT", "DISTRIBUTION",
546 "HASH", "HASH_WITH_NAMESPACE", "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH",
547 "IO_MSG_WATERMARK", "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY",
548 "NUMBER_OF_REPLICAS", "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ",
549 "RCV_TIMEOUT", "REMOVE_FAILED_SERVERS", "RETRY_TIMEOUT", "SND_TIMEOUT",
550 "SOCKET_RECV_SIZE", "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS",
551 "USER_DATA", "USE_UDP", "VERIFY_KEY", "_TCP_KEEPALIVE", "_TCP_KEEPIDLE",
552 "_TCP_NODELAY", "NAMESPACE", "POOL_MIN", "POOL_MAX", "MD5", "CRC",
553 "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32", "HSIEH", "MURMUR",
554 "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE", "FALSE", "','",
555 "'='", "FLOAT", "NUMBER", "PORT", "WEIGHT_START", "IPADDRESS",
556 "HOSTNAME", "STRING", "QUOTED_STRING", "FILE_PATH", "' '", "$accept",
557 "begin", "statement", "expression", "behaviors", "behavior_number",
558 "behavior_boolean", "optional_port", "optional_weight", "hash", "string",
564 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
566 static const yytype_uint16 yytoknum
[] =
568 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
569 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
570 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
571 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
572 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
573 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
574 315, 316, 44, 61, 317, 318, 319, 320, 321, 322,
579 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
580 static const yytype_uint8 yyr1
[] =
582 0, 74, 75, 75, 76, 76, 76, 76, 76, 76,
583 76, 76, 77, 77, 77, 77, 77, 77, 78, 78,
584 78, 78, 78, 78, 78, 79, 79, 79, 79, 79,
585 79, 79, 79, 79, 79, 79, 79, 80, 80, 80,
586 80, 80, 80, 80, 80, 80, 80, 80, 80, 81,
587 81, 82, 82, 83, 83, 83, 83, 83, 83, 83,
588 83, 83, 84, 84, 85, 85, 85
591 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
592 static const yytype_uint8 yyr2
[] =
594 0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
595 1, 3, 4, 4, 2, 2, 2, 1, 2, 2,
596 4, 2, 2, 1, 1, 1, 1, 1, 1, 1,
597 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
598 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
599 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
603 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
604 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
605 means the default is an error. */
606 static const yytype_uint8 yydefact
[] =
608 0, 5, 7, 8, 9, 10, 0, 0, 6, 0,
609 37, 38, 26, 0, 0, 39, 28, 29, 27, 40,
610 30, 31, 41, 32, 25, 33, 34, 35, 36, 42,
611 43, 24, 47, 48, 45, 46, 44, 0, 0, 0,
612 0, 2, 4, 17, 0, 23, 0, 62, 63, 14,
613 49, 49, 64, 65, 66, 19, 53, 54, 55, 56,
614 57, 58, 59, 60, 61, 21, 18, 15, 16, 1,
615 0, 22, 11, 50, 51, 51, 0, 3, 52, 13,
619 /* YYDEFGOTO[NTERM-NUM]. */
620 static const yytype_int8 yydefgoto
[] =
622 -1, 40, 41, 42, 43, 44, 45, 74, 79, 65,
626 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
628 #define YYPACT_NINF -61
629 static const yytype_int8 yypact
[] =
631 -2, -61, -61, -61, -61, -61, -60, -23, -61, -45,
632 -61, -61, -61, -47, 8, -61, -61, -61, -61, -61,
633 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
634 -61, -61, -61, -61, -61, -61, -61, -23, -16, -15,
635 0, -61, -61, -61, -14, -61, -23, -61, -61, -61,
636 -13, -13, -61, -61, -61, -10, -61, -61, -61, -61,
637 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
638 -2, -61, -61, -61, -1, -1, 8, -61, -61, -61,
642 /* YYPGOTO[NTERM-NUM]. */
643 static const yytype_int8 yypgoto
[] =
645 -61, -61, -5, -61, -61, -61, -61, 3, -8, -7,
649 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
650 positive, shift that token. If negative, reduce the rule which
651 number is the opposite. If zero, do what YYDEFACT says.
652 If YYTABLE_NINF, syntax error. */
653 #define YYTABLE_NINF -1
654 static const yytype_uint8 yytable
[] =
656 69, 1, 2, 3, 4, 5, 6, 7, 8, 9,
657 52, 53, 54, 46, 10, 11, 12, 13, 14, 15,
658 16, 17, 18, 50, 51, 19, 20, 21, 22, 23,
659 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
660 34, 35, 36, 37, 38, 39, 66, 47, 48, 67,
661 68, 71, 76, 73, 75, 72, 56, 57, 58, 59,
662 60, 61, 62, 63, 64, 77, 78, 80, 0, 81,
666 static const yytype_int8 yycheck
[] =
668 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
669 57, 58, 59, 73, 16, 17, 18, 19, 20, 21,
670 22, 23, 24, 68, 69, 27, 28, 29, 30, 31,
671 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
672 42, 43, 44, 45, 46, 47, 37, 70, 71, 65,
673 65, 65, 62, 66, 51, 46, 48, 49, 50, 51,
674 52, 53, 54, 55, 56, 70, 67, 75, -1, 76,
678 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
679 symbol of state STATE-NUM. */
680 static const yytype_uint8 yystos
[] =
682 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
683 16, 17, 18, 19, 20, 21, 22, 23, 24, 27,
684 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
685 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
686 75, 76, 77, 78, 79, 80, 73, 70, 71, 84,
687 68, 69, 57, 58, 59, 85, 48, 49, 50, 51,
688 52, 53, 54, 55, 56, 83, 84, 65, 65, 0,
689 73, 65, 84, 66, 81, 81, 62, 76, 67, 82,
693 #define yyerrok (yyerrstatus = 0)
694 #define yyclearin (yychar = YYEMPTY)
698 #define YYACCEPT goto yyacceptlab
699 #define YYABORT goto yyabortlab
700 #define YYERROR goto yyerrorlab
703 /* Like YYERROR except do call yyerror. This remains here temporarily
704 to ease the transition to the new meaning of YYERROR, for GCC.
705 Once GCC version 2 has supplanted version 1, this can go. However,
706 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
707 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
710 #define YYFAIL goto yyerrlab
712 /* This is here to suppress warnings from the GCC cpp's
713 -Wunused-macros. Normally we don't worry about that warning, but
714 some users do, and we want to make it easy for users to remove
715 YYFAIL uses, which will produce warnings from Bison 2.5. */
718 #define YYRECOVERING() (!!yyerrstatus)
720 #define YYBACKUP(Token, Value) \
722 if (yychar == YYEMPTY && yylen == 1) \
726 yytoken = YYTRANSLATE (yychar); \
732 yyerror (context, scanner, YY_("syntax error: cannot back up")); \
739 #define YYERRCODE 256
742 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
743 If N is 0, then set CURRENT to the empty location which ends
744 the previous symbol: RHS[0] (always defined). */
746 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
747 #ifndef YYLLOC_DEFAULT
748 # define YYLLOC_DEFAULT(Current, Rhs, N) \
752 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
753 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
754 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
755 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
759 (Current).first_line = (Current).last_line = \
760 YYRHSLOC (Rhs, 0).last_line; \
761 (Current).first_column = (Current).last_column = \
762 YYRHSLOC (Rhs, 0).last_column; \
768 /* YY_LOCATION_PRINT -- Print the location on the stream.
769 This macro was not mandated originally: define only if we know
770 we won't break user code: when these are the locations we know. */
772 #ifndef YY_LOCATION_PRINT
773 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
774 # define YY_LOCATION_PRINT(File, Loc) \
775 fprintf (File, "%d.%d-%d.%d", \
776 (Loc).first_line, (Loc).first_column, \
777 (Loc).last_line, (Loc).last_column)
779 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
784 /* YYLEX -- calling `yylex' with the right arguments. */
787 # define YYLEX yylex (&yylval, YYLEX_PARAM)
789 # define YYLEX yylex (&yylval, scanner)
792 /* Enable debugging if requested. */
796 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
797 # define YYFPRINTF fprintf
800 # define YYDPRINTF(Args) \
806 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
810 YYFPRINTF (stderr, "%s ", Title); \
811 yy_symbol_print (stderr, \
812 Type, Value, context, scanner); \
813 YYFPRINTF (stderr, "\n"); \
818 /*--------------------------------.
819 | Print this symbol on YYOUTPUT. |
820 `--------------------------------*/
823 #if (defined __STDC__ || defined __C99__FUNC__ \
824 || defined __cplusplus || defined _MSC_VER)
826 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
829 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
832 YYSTYPE
const * const yyvaluep
;
842 if (yytype
< YYNTOKENS
)
843 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
855 /*--------------------------------.
856 | Print this symbol on YYOUTPUT. |
857 `--------------------------------*/
859 #if (defined __STDC__ || defined __C99__FUNC__ \
860 || defined __cplusplus || defined _MSC_VER)
862 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
865 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
868 YYSTYPE
const * const yyvaluep
;
873 if (yytype
< YYNTOKENS
)
874 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
876 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
878 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
);
879 YYFPRINTF (yyoutput
, ")");
882 /*------------------------------------------------------------------.
883 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
885 `------------------------------------------------------------------*/
887 #if (defined __STDC__ || defined __C99__FUNC__ \
888 || defined __cplusplus || defined _MSC_VER)
890 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
893 yy_stack_print (yybottom
, yytop
)
894 yytype_int16
*yybottom
;
898 YYFPRINTF (stderr
, "Stack now");
899 for (; yybottom
<= yytop
; yybottom
++)
901 int yybot
= *yybottom
;
902 YYFPRINTF (stderr
, " %d", yybot
);
904 YYFPRINTF (stderr
, "\n");
907 # define YY_STACK_PRINT(Bottom, Top) \
910 yy_stack_print ((Bottom), (Top)); \
914 /*------------------------------------------------.
915 | Report that the YYRULE is going to be reduced. |
916 `------------------------------------------------*/
918 #if (defined __STDC__ || defined __C99__FUNC__ \
919 || defined __cplusplus || defined _MSC_VER)
921 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
, Context
*context
, yyscan_t
*scanner
)
924 yy_reduce_print (yyvsp
, yyrule
, context
, scanner
)
931 int yynrhs
= yyr2
[yyrule
];
933 unsigned long int yylno
= yyrline
[yyrule
];
934 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
936 /* The symbols being reduced. */
937 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
939 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
940 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
941 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
943 YYFPRINTF (stderr
, "\n");
947 # define YY_REDUCE_PRINT(Rule) \
950 yy_reduce_print (yyvsp, Rule, context, scanner); \
953 /* Nonzero means print parse trace. It is left uninitialized so that
954 multiple parsers can coexist. */
957 # define YYDPRINTF(Args)
958 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
959 # define YY_STACK_PRINT(Bottom, Top)
960 # define YY_REDUCE_PRINT(Rule)
961 #endif /* !YYDEBUG */
964 /* YYINITDEPTH -- initial size of the parser's stacks. */
966 # define YYINITDEPTH 200
969 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
970 if the built-in stack extension method is used).
972 Do not make this value too large; the results are undefined if
973 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
974 evaluated with infinite-precision integer arithmetic. */
977 # define YYMAXDEPTH 10000
985 # if defined __GLIBC__ && defined _STRING_H
986 # define yystrlen strlen
988 /* Return the length of YYSTR. */
989 #if (defined __STDC__ || defined __C99__FUNC__ \
990 || defined __cplusplus || defined _MSC_VER)
992 yystrlen (const char *yystr
)
1000 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1008 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1009 # define yystpcpy stpcpy
1011 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1013 #if (defined __STDC__ || defined __C99__FUNC__ \
1014 || defined __cplusplus || defined _MSC_VER)
1016 yystpcpy (char *yydest
, const char *yysrc
)
1019 yystpcpy (yydest
, yysrc
)
1025 const char *yys
= yysrc
;
1027 while ((*yyd
++ = *yys
++) != '\0')
1036 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1037 quotes and backslashes, so that it's suitable for yyerror. The
1038 heuristic is that double-quoting is unnecessary unless the string
1039 contains an apostrophe, a comma, or backslash (other than
1040 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1041 null, do not copy; instead, return the length of what the result
1044 yytnamerr (char *yyres
, const char *yystr
)
1049 char const *yyp
= yystr
;
1056 goto do_not_strip_quotes
;
1060 goto do_not_strip_quotes
;
1073 do_not_strip_quotes
: ;
1077 return yystrlen (yystr
);
1079 return yystpcpy (yyres
, yystr
) - yyres
;
1083 /* Copy into YYRESULT an error message about the unexpected token
1084 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1085 including the terminating null byte. If YYRESULT is null, do not
1086 copy anything; just return the number of bytes that would be
1087 copied. As a special case, return 0 if an ordinary "syntax error"
1088 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1089 size calculation. */
1091 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1093 int yyn
= yypact
[yystate
];
1095 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1099 int yytype
= YYTRANSLATE (yychar
);
1100 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1101 YYSIZE_T yysize
= yysize0
;
1103 int yysize_overflow
= 0;
1104 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1105 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1109 /* This is so xgettext sees the translatable formats that are
1110 constructed on the fly. */
1111 YY_("syntax error, unexpected %s");
1112 YY_("syntax error, unexpected %s, expecting %s");
1113 YY_("syntax error, unexpected %s, expecting %s or %s");
1114 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1115 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1119 static char const yyunexpected
[] = "syntax error, unexpected %s";
1120 static char const yyexpecting
[] = ", expecting %s";
1121 static char const yyor
[] = " or %s";
1122 char yyformat
[sizeof yyunexpected
1123 + sizeof yyexpecting
- 1
1124 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1125 * (sizeof yyor
- 1))];
1126 char const *yyprefix
= yyexpecting
;
1128 /* Start YYX at -YYN if negative to avoid negative indexes in
1130 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1132 /* Stay within bounds of both yycheck and yytname. */
1133 int yychecklim
= YYLAST
- yyn
+ 1;
1134 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1137 yyarg
[0] = yytname
[yytype
];
1138 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1140 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1141 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1143 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1147 yyformat
[sizeof yyunexpected
- 1] = '\0';
1150 yyarg
[yycount
++] = yytname
[yyx
];
1151 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1152 yysize_overflow
|= (yysize1
< yysize
);
1154 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1158 yyf
= YY_(yyformat
);
1159 yysize1
= yysize
+ yystrlen (yyf
);
1160 yysize_overflow
|= (yysize1
< yysize
);
1163 if (yysize_overflow
)
1164 return YYSIZE_MAXIMUM
;
1168 /* Avoid sprintf, as that infringes on the user's name space.
1169 Don't have undefined behavior even if the translation
1170 produced a string with the wrong number of "%s"s. */
1171 char *yyp
= yyresult
;
1173 while ((*yyp
= *yyf
) != '\0')
1175 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1177 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1190 #endif /* YYERROR_VERBOSE */
1193 /*-----------------------------------------------.
1194 | Release the memory associated to this symbol. |
1195 `-----------------------------------------------*/
1198 #if (defined __STDC__ || defined __C99__FUNC__ \
1199 || defined __cplusplus || defined _MSC_VER)
1201 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, Context
*context
, yyscan_t
*scanner
)
1204 yydestruct (yymsg
, yytype
, yyvaluep
, context
, scanner
)
1218 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1228 /* Prevent warnings from -Wmissing-prototypes. */
1229 #ifdef YYPARSE_PARAM
1230 #if defined __STDC__ || defined __cplusplus
1231 int yyparse (void *YYPARSE_PARAM
);
1235 #else /* ! YYPARSE_PARAM */
1236 #if defined __STDC__ || defined __cplusplus
1237 int yyparse (Context
*context
, yyscan_t
*scanner
);
1241 #endif /* ! YYPARSE_PARAM */
1247 /*-------------------------.
1248 | yyparse or yypush_parse. |
1249 `-------------------------*/
1251 #ifdef YYPARSE_PARAM
1252 #if (defined __STDC__ || defined __C99__FUNC__ \
1253 || defined __cplusplus || defined _MSC_VER)
1255 yyparse (void *YYPARSE_PARAM
)
1258 yyparse (YYPARSE_PARAM
)
1259 void *YYPARSE_PARAM
;
1261 #else /* ! YYPARSE_PARAM */
1262 #if (defined __STDC__ || defined __C99__FUNC__ \
1263 || defined __cplusplus || defined _MSC_VER)
1265 yyparse (Context
*context
, yyscan_t
*scanner
)
1268 yyparse (context
, scanner
)
1274 /* The lookahead symbol. */
1277 /* The semantic value of the lookahead symbol. */
1280 /* Number of syntax errors so far. */
1284 /* Number of tokens to shift before error messages enabled. */
1287 /* The stacks and their tools:
1288 `yyss': related to states.
1289 `yyvs': related to semantic values.
1291 Refer to the stacks thru separate pointers, to allow yyoverflow
1292 to reallocate them elsewhere. */
1294 /* The state stack. */
1295 yytype_int16 yyssa
[YYINITDEPTH
];
1297 yytype_int16
*yyssp
;
1299 /* The semantic value stack. */
1300 YYSTYPE yyvsa
[YYINITDEPTH
];
1304 YYSIZE_T yystacksize
;
1308 /* Lookahead token as an internal (translated) token number. */
1310 /* The variables used to return semantic value and location from the
1315 /* Buffer for error messages, and its allocated size. */
1317 char *yymsg
= yymsgbuf
;
1318 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1321 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1323 /* The number of symbols on the RHS of the reduced rule.
1324 Keep to zero when no symbol should be popped. */
1330 yystacksize
= YYINITDEPTH
;
1332 YYDPRINTF ((stderr
, "Starting parse\n"));
1337 yychar
= YYEMPTY
; /* Cause a token to be read. */
1339 /* Initialize stack pointers.
1340 Waste one element of value and location stack
1341 so that they stay on the same level as the state stack.
1342 The wasted elements are never initialized. */
1348 /*------------------------------------------------------------.
1349 | yynewstate -- Push a new state, which is found in yystate. |
1350 `------------------------------------------------------------*/
1352 /* In all cases, when you get here, the value and location stacks
1353 have just been pushed. So pushing a state here evens the stacks. */
1359 if (yyss
+ yystacksize
- 1 <= yyssp
)
1361 /* Get the current used size of the three stacks, in elements. */
1362 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1366 /* Give user a chance to reallocate the stack. Use copies of
1367 these so that the &'s don't force the real ones into
1369 YYSTYPE
*yyvs1
= yyvs
;
1370 yytype_int16
*yyss1
= yyss
;
1372 /* Each stack pointer address is followed by the size of the
1373 data in use in that stack, in bytes. This used to be a
1374 conditional around just the two extra args, but that might
1375 be undefined if yyoverflow is a macro. */
1376 yyoverflow (YY_("memory exhausted"),
1377 &yyss1
, yysize
* sizeof (*yyssp
),
1378 &yyvs1
, yysize
* sizeof (*yyvsp
),
1384 #else /* no yyoverflow */
1385 # ifndef YYSTACK_RELOCATE
1386 goto yyexhaustedlab
;
1388 /* Extend the stack our own way. */
1389 if (YYMAXDEPTH
<= yystacksize
)
1390 goto yyexhaustedlab
;
1392 if (YYMAXDEPTH
< yystacksize
)
1393 yystacksize
= YYMAXDEPTH
;
1396 yytype_int16
*yyss1
= yyss
;
1397 union yyalloc
*yyptr
=
1398 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1400 goto yyexhaustedlab
;
1401 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1402 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1403 # undef YYSTACK_RELOCATE
1405 YYSTACK_FREE (yyss1
);
1408 #endif /* no yyoverflow */
1410 yyssp
= yyss
+ yysize
- 1;
1411 yyvsp
= yyvs
+ yysize
- 1;
1413 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1414 (unsigned long int) yystacksize
));
1416 if (yyss
+ yystacksize
- 1 <= yyssp
)
1420 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1422 if (yystate
== YYFINAL
)
1432 /* Do appropriate processing given the current state. Read a
1433 lookahead token if we need one and don't already have one. */
1435 /* First try to decide what to do without reference to lookahead token. */
1436 yyn
= yypact
[yystate
];
1437 if (yyn
== YYPACT_NINF
)
1440 /* Not known => get a lookahead token if don't already have one. */
1442 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1443 if (yychar
== YYEMPTY
)
1445 YYDPRINTF ((stderr
, "Reading a token: "));
1449 if (yychar
<= YYEOF
)
1451 yychar
= yytoken
= YYEOF
;
1452 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1456 yytoken
= YYTRANSLATE (yychar
);
1457 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1460 /* If the proper action on seeing token YYTOKEN is to reduce or to
1461 detect an error, take that action. */
1463 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1468 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1474 /* Count tokens shifted since error; after three, turn off error
1479 /* Shift the lookahead token. */
1480 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1482 /* Discard the shifted token. */
1491 /*-----------------------------------------------------------.
1492 | yydefault -- do the default action for the current state. |
1493 `-----------------------------------------------------------*/
1495 yyn
= yydefact
[yystate
];
1501 /*-----------------------------.
1502 | yyreduce -- Do a reduction. |
1503 `-----------------------------*/
1505 /* yyn is the number of a rule to reduce with. */
1508 /* If YYLEN is nonzero, implement the default value of the action:
1511 Otherwise, the following line sets YYVAL to garbage.
1512 This behavior is undocumented and Bison
1513 users should not rely upon it. Assigning to YYVAL
1514 unconditionally makes the parser a bit smaller, and it avoids a
1515 GCC warning that YYVAL may be used uninitialized. */
1516 yyval
= yyvsp
[1-yylen
];
1519 YY_REDUCE_PRINT (yyn
);
1524 /* Line 1464 of yacc.c */
1525 #line 165 "libmemcached/options/parser.yy"
1531 /* Line 1464 of yacc.c */
1532 #line 167 "libmemcached/options/parser.yy"
1538 /* Line 1464 of yacc.c */
1539 #line 169 "libmemcached/options/parser.yy"
1545 /* Line 1464 of yacc.c */
1546 #line 171 "libmemcached/options/parser.yy"
1555 /* Line 1464 of yacc.c */
1556 #line 176 "libmemcached/options/parser.yy"
1558 context
->rc
= MEMCACHED_PARSE_USER_ERROR
;
1559 parser_abort(context
, NULL
);
1565 /* Line 1464 of yacc.c */
1566 #line 181 "libmemcached/options/parser.yy"
1568 memcached_reset(context
->memc
);
1574 /* Line 1464 of yacc.c */
1575 #line 185 "libmemcached/options/parser.yy"
1583 /* Line 1464 of yacc.c */
1584 #line 189 "libmemcached/options/parser.yy"
1586 if ((context
->rc
= memcached_parse_configure_file(*context
->memc
, (yyvsp
[(3) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].string
).size
)) != MEMCACHED_SUCCESS
)
1588 parser_abort(context
, NULL
);
1595 /* Line 1464 of yacc.c */
1596 #line 200 "libmemcached/options/parser.yy"
1598 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
))))
1600 parser_abort(context
, NULL
);
1602 context
->unset_server();
1608 /* Line 1464 of yacc.c */
1609 #line 208 "libmemcached/options/parser.yy"
1611 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
))))
1613 parser_abort(context
, NULL
);
1615 context
->unset_server();
1621 /* Line 1464 of yacc.c */
1622 #line 216 "libmemcached/options/parser.yy"
1624 memcached_set_configuration_file(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
);
1630 /* Line 1464 of yacc.c */
1631 #line 220 "libmemcached/options/parser.yy"
1633 context
->memc
->configure
.initial_pool_size
= (yyvsp
[(2) - (2)].number
);
1639 /* Line 1464 of yacc.c */
1640 #line 224 "libmemcached/options/parser.yy"
1642 context
->memc
->configure
.max_pool_size
= (yyvsp
[(2) - (2)].number
);
1648 /* Line 1464 of yacc.c */
1649 #line 232 "libmemcached/options/parser.yy"
1651 if ((context
->rc
= memcached_set_namespace(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
)) != MEMCACHED_SUCCESS
)
1653 parser_abort(context
, NULL
);;
1660 /* Line 1464 of yacc.c */
1661 #line 239 "libmemcached/options/parser.yy"
1663 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1665 parser_abort(context
, NULL
);;
1672 /* Line 1464 of yacc.c */
1673 #line 246 "libmemcached/options/parser.yy"
1675 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (4)].distribution
))) != MEMCACHED_SUCCESS
)
1677 parser_abort(context
, NULL
);;
1679 if ((context
->rc
= memcached_behavior_set_distribution_hash(context
->memc
, (yyvsp
[(4) - (4)].hash
))) != MEMCACHED_SUCCESS
)
1681 parser_abort(context
, NULL
);;
1688 /* Line 1464 of yacc.c */
1689 #line 257 "libmemcached/options/parser.yy"
1691 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_HASH
, (yyvsp
[(2) - (2)].hash
))) != MEMCACHED_SUCCESS
)
1693 parser_abort(context
, NULL
);;
1700 /* Line 1464 of yacc.c */
1701 #line 264 "libmemcached/options/parser.yy"
1703 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (2)].behavior
), (yyvsp
[(2) - (2)].number
))) != MEMCACHED_SUCCESS
)
1705 parser_abort(context
, NULL
);;
1712 /* Line 1464 of yacc.c */
1713 #line 271 "libmemcached/options/parser.yy"
1715 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (1)].behavior
), true)) != MEMCACHED_SUCCESS
)
1717 parser_abort(context
, NULL
);;
1724 /* Line 1464 of yacc.c */
1725 #line 278 "libmemcached/options/parser.yy"
1732 /* Line 1464 of yacc.c */
1733 #line 284 "libmemcached/options/parser.yy"
1735 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS
;
1741 /* Line 1464 of yacc.c */
1742 #line 288 "libmemcached/options/parser.yy"
1744 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
;
1750 /* Line 1464 of yacc.c */
1751 #line 292 "libmemcached/options/parser.yy"
1753 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
;
1759 /* Line 1464 of yacc.c */
1760 #line 296 "libmemcached/options/parser.yy"
1762 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
;
1768 /* Line 1464 of yacc.c */
1769 #line 300 "libmemcached/options/parser.yy"
1771 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
;
1777 /* Line 1464 of yacc.c */
1778 #line 304 "libmemcached/options/parser.yy"
1780 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
;
1786 /* Line 1464 of yacc.c */
1787 #line 308 "libmemcached/options/parser.yy"
1789 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT
;
1795 /* Line 1464 of yacc.c */
1796 #line 312 "libmemcached/options/parser.yy"
1798 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT
;
1804 /* Line 1464 of yacc.c */
1805 #line 316 "libmemcached/options/parser.yy"
1807 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
;
1813 /* Line 1464 of yacc.c */
1814 #line 320 "libmemcached/options/parser.yy"
1816 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SND_TIMEOUT
;
1822 /* Line 1464 of yacc.c */
1823 #line 324 "libmemcached/options/parser.yy"
1825 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
;
1831 /* Line 1464 of yacc.c */
1832 #line 328 "libmemcached/options/parser.yy"
1834 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
;
1840 /* Line 1464 of yacc.c */
1841 #line 335 "libmemcached/options/parser.yy"
1843 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
;
1849 /* Line 1464 of yacc.c */
1850 #line 339 "libmemcached/options/parser.yy"
1852 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
;
1858 /* Line 1464 of yacc.c */
1859 #line 343 "libmemcached/options/parser.yy"
1861 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
;
1867 /* Line 1464 of yacc.c */
1868 #line 347 "libmemcached/options/parser.yy"
1870 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NOREPLY
;
1876 /* Line 1464 of yacc.c */
1877 #line 351 "libmemcached/options/parser.yy"
1879 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
;
1885 /* Line 1464 of yacc.c */
1886 #line 355 "libmemcached/options/parser.yy"
1888 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SORT_HOSTS
;
1894 /* Line 1464 of yacc.c */
1895 #line 359 "libmemcached/options/parser.yy"
1897 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SUPPORT_CAS
;
1903 /* Line 1464 of yacc.c */
1904 #line 363 "libmemcached/options/parser.yy"
1906 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_NODELAY
;
1912 /* Line 1464 of yacc.c */
1913 #line 367 "libmemcached/options/parser.yy"
1915 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
;
1921 /* Line 1464 of yacc.c */
1922 #line 371 "libmemcached/options/parser.yy"
1924 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE
;
1930 /* Line 1464 of yacc.c */
1931 #line 375 "libmemcached/options/parser.yy"
1933 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_USE_UDP
;
1939 /* Line 1464 of yacc.c */
1940 #line 379 "libmemcached/options/parser.yy"
1942 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_VERIFY_KEY
;
1948 /* Line 1464 of yacc.c */
1949 #line 385 "libmemcached/options/parser.yy"
1950 { (yyval
.number
)= MEMCACHED_DEFAULT_PORT
;;}
1955 /* Line 1464 of yacc.c */
1956 #line 387 "libmemcached/options/parser.yy"
1962 /* Line 1464 of yacc.c */
1963 #line 391 "libmemcached/options/parser.yy"
1964 { (yyval
.number
)= 1; ;}
1969 /* Line 1464 of yacc.c */
1970 #line 393 "libmemcached/options/parser.yy"
1976 /* Line 1464 of yacc.c */
1977 #line 398 "libmemcached/options/parser.yy"
1979 (yyval
.hash
)= MEMCACHED_HASH_MD5
;
1985 /* Line 1464 of yacc.c */
1986 #line 402 "libmemcached/options/parser.yy"
1988 (yyval
.hash
)= MEMCACHED_HASH_CRC
;
1994 /* Line 1464 of yacc.c */
1995 #line 406 "libmemcached/options/parser.yy"
1997 (yyval
.hash
)= MEMCACHED_HASH_FNV1_64
;
2003 /* Line 1464 of yacc.c */
2004 #line 410 "libmemcached/options/parser.yy"
2006 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_64
;
2012 /* Line 1464 of yacc.c */
2013 #line 414 "libmemcached/options/parser.yy"
2015 (yyval
.hash
)= MEMCACHED_HASH_FNV1_32
;
2021 /* Line 1464 of yacc.c */
2022 #line 418 "libmemcached/options/parser.yy"
2024 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_32
;
2030 /* Line 1464 of yacc.c */
2031 #line 422 "libmemcached/options/parser.yy"
2033 (yyval
.hash
)= MEMCACHED_HASH_HSIEH
;
2039 /* Line 1464 of yacc.c */
2040 #line 426 "libmemcached/options/parser.yy"
2042 (yyval
.hash
)= MEMCACHED_HASH_MURMUR
;
2048 /* Line 1464 of yacc.c */
2049 #line 430 "libmemcached/options/parser.yy"
2051 (yyval
.hash
)= MEMCACHED_HASH_JENKINS
;
2057 /* Line 1464 of yacc.c */
2058 #line 437 "libmemcached/options/parser.yy"
2060 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2066 /* Line 1464 of yacc.c */
2067 #line 441 "libmemcached/options/parser.yy"
2069 (yyval
.string
).c_str
= (yyvsp
[(1) - (1)].string
).c_str
+1; // +1 to move use passed the initial quote
2070 (yyval
.string
).size
= (yyvsp
[(1) - (1)].string
).size
-2; // -2 removes the begin and end quote
2076 /* Line 1464 of yacc.c */
2077 #line 449 "libmemcached/options/parser.yy"
2079 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_CONSISTENT
;
2085 /* Line 1464 of yacc.c */
2086 #line 453 "libmemcached/options/parser.yy"
2088 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_MODULA
;
2094 /* Line 1464 of yacc.c */
2095 #line 457 "libmemcached/options/parser.yy"
2097 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_RANDOM
;
2103 /* Line 1464 of yacc.c */
2104 #line 2105 "libmemcached/options/parser.cc"
2107 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2111 YY_STACK_PRINT (yyss
, yyssp
);
2115 /* Now `shift' the result of the reduction. Determine what state
2116 that goes to, based on the state we popped back to and the rule
2117 number reduced by. */
2121 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2122 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2123 yystate
= yytable
[yystate
];
2125 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2130 /*------------------------------------.
2131 | yyerrlab -- here on detecting error |
2132 `------------------------------------*/
2134 /* If not already recovering from an error, report this error. */
2138 #if ! YYERROR_VERBOSE
2139 yyerror (context
, scanner
, YY_("syntax error"));
2142 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2143 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2145 YYSIZE_T yyalloc
= 2 * yysize
;
2146 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2147 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2148 if (yymsg
!= yymsgbuf
)
2149 YYSTACK_FREE (yymsg
);
2150 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2152 yymsg_alloc
= yyalloc
;
2156 yymsg_alloc
= sizeof yymsgbuf
;
2160 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2162 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2163 yyerror (context
, scanner
, yymsg
);
2167 yyerror (context
, scanner
, YY_("syntax error"));
2169 goto yyexhaustedlab
;
2177 if (yyerrstatus
== 3)
2179 /* If just tried and failed to reuse lookahead token after an
2180 error, discard it. */
2182 if (yychar
<= YYEOF
)
2184 /* Return failure if at end of input. */
2185 if (yychar
== YYEOF
)
2190 yydestruct ("Error: discarding",
2191 yytoken
, &yylval
, context
, scanner
);
2196 /* Else will try to reuse lookahead token after shifting the error
2201 /*---------------------------------------------------.
2202 | yyerrorlab -- error raised explicitly by YYERROR. |
2203 `---------------------------------------------------*/
2206 /* Pacify compilers like GCC when the user code never invokes
2207 YYERROR and the label yyerrorlab therefore never appears in user
2209 if (/*CONSTCOND*/ 0)
2212 /* Do not reclaim the symbols of the rule which action triggered
2216 YY_STACK_PRINT (yyss
, yyssp
);
2221 /*-------------------------------------------------------------.
2222 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2223 `-------------------------------------------------------------*/
2225 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2229 yyn
= yypact
[yystate
];
2230 if (yyn
!= YYPACT_NINF
)
2233 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2241 /* Pop the current state because it cannot handle the error token. */
2246 yydestruct ("Error: popping",
2247 yystos
[yystate
], yyvsp
, context
, scanner
);
2250 YY_STACK_PRINT (yyss
, yyssp
);
2256 /* Shift the error token. */
2257 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2263 /*-------------------------------------.
2264 | yyacceptlab -- YYACCEPT comes here. |
2265 `-------------------------------------*/
2270 /*-----------------------------------.
2271 | yyabortlab -- YYABORT comes here. |
2272 `-----------------------------------*/
2277 #if !defined(yyoverflow) || YYERROR_VERBOSE
2278 /*-------------------------------------------------.
2279 | yyexhaustedlab -- memory exhaustion comes here. |
2280 `-------------------------------------------------*/
2282 yyerror (context
, scanner
, YY_("memory exhausted"));
2288 if (yychar
!= YYEMPTY
)
2289 yydestruct ("Cleanup: discarding lookahead",
2290 yytoken
, &yylval
, context
, scanner
);
2291 /* Do not reclaim the symbols of the rule which action triggered
2292 this YYABORT or YYACCEPT. */
2294 YY_STACK_PRINT (yyss
, yyssp
);
2295 while (yyssp
!= yyss
)
2297 yydestruct ("Cleanup: popping",
2298 yystos
[*yyssp
], yyvsp
, context
, scanner
);
2303 YYSTACK_FREE (yyss
);
2306 if (yymsg
!= yymsgbuf
)
2307 YYSTACK_FREE (yymsg
);
2309 /* Make sure YYID is used. */
2310 return YYID (yyresult
);
2315 /* Line 1684 of yacc.c */
2316 #line 462 "libmemcached/options/parser.yy"
2319 void Context::start()
2321 config_parse(this, (void **)scanner
);