1 /* A Bison parser, made by GNU Bison 2.4.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6 2009, 2010 Free Software Foundation, Inc.
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
44 /* Identify Bison output. */
48 #define YYBISON_VERSION "2.4.3"
51 #define YYSKELETON_NAME "yacc.c"
62 /* Using locations. */
63 #define YYLSP_NEEDED 0
65 /* Substitute the variable and function names. */
66 #define yyparse config_parse
67 #define yylex config_lex
68 #define yyerror config_error
69 #define yylval config_lval
70 #define yychar config_char
71 #define yydebug config_debug
72 #define yynerrs config_nerrs
75 /* Copy the first part of user declarations. */
77 /* Line 189 of yacc.c */
78 #line 36 "libmemcached/options/parser.yy"
85 #include <libmemcached/options/context.h>
86 #include <libmemcached/options/string.h>
87 #include <libmemcached/options/symbol.h>
88 #include <libmemcached/visibility.h>
89 #include <libmemcached/prefix_key.h>
91 #pragma GCC diagnostic ignored "-Wold-style-cast"
92 #include <libmemcached/options/scanner.h>
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_PREFIX_KEY
= 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,
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 323
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, 71, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 60, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 61, 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, 62, 63, 64, 65, 66,
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, 42, 45, 48, 53,
494 56, 59, 61, 63, 65, 67, 69, 71, 73, 75,
495 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
496 97, 99, 101, 103, 105, 107, 109, 111, 112, 114,
497 115, 117, 119, 121, 123, 125, 127, 129, 131, 133,
498 135, 137, 139, 141, 143
501 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
502 static const yytype_int8 yyrhs
[] =
504 73, 0, -1, 74, -1, 73, 71, 74, -1, 75,
505 -1, 3, -1, 10, -1, 4, -1, 5, -1, 6,
506 -1, 7, -1, 8, 71, 82, -1, 11, 67, 79,
507 80, -1, 11, 66, 79, 80, -1, 9, 82, -1,
508 76, -1, 45, 82, -1, 19, 83, -1, 19, 83,
509 60, 81, -1, 20, 81, -1, 77, 63, -1, 78,
510 -1, 39, -1, 32, -1, 18, -1, 24, -1, 22,
511 -1, 23, -1, 28, -1, 29, -1, 31, -1, 33,
512 -1, 34, -1, 35, -1, 36, -1, 16, -1, 17,
513 -1, 21, -1, 27, -1, 30, -1, 37, -1, 38,
514 -1, 44, -1, 42, -1, 43, -1, 40, -1, 41,
515 -1, -1, 64, -1, -1, 65, -1, 46, -1, 47,
516 -1, 48, -1, 49, -1, 50, -1, 51, -1, 52,
517 -1, 53, -1, 54, -1, 68, -1, 69, -1, 55,
521 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
522 static const yytype_uint16 yyrline
[] =
524 0, 153, 153, 154, 158, 160, 162, 164, 169, 174,
525 178, 182, 193, 201, 209, 213, 217, 224, 231, 242,
526 249, 256, 263, 269, 273, 277, 281, 285, 289, 293,
527 297, 301, 305, 309, 313, 320, 324, 328, 332, 336,
528 340, 344, 348, 352, 356, 360, 364, 371, 372, 377,
529 378, 383, 387, 391, 395, 399, 403, 407, 411, 415,
530 422, 426, 434, 438, 442
534 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
535 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
536 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
537 static const char *const yytname
[] =
539 "$end", "error", "$undefined", "COMMENT", "END", "ERROR", "RESET",
540 "PARSER_DEBUG", "INCLUDE", "CONFIGURE_FILE", "EMPTY_LINE", "SERVER",
541 "SERVERS", "SERVERS_OPTION", "UNKNOWN_OPTION", "UNKNOWN",
542 "BINARY_PROTOCOL", "BUFFER_REQUESTS", "CONNECT_TIMEOUT", "DISTRIBUTION",
543 "HASH", "HASH_WITH_PREFIX_KEY", "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH",
544 "IO_MSG_WATERMARK", "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY",
545 "NUMBER_OF_REPLICAS", "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ",
546 "RCV_TIMEOUT", "REMOVE_FAILED_SERVERS", "RETRY_TIMEOUT", "SND_TIMEOUT",
547 "SOCKET_RECV_SIZE", "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS",
548 "USER_DATA", "USE_UDP", "VERIFY_KEY", "_TCP_KEEPALIVE", "_TCP_KEEPIDLE",
549 "_TCP_NODELAY", "PREFIX_KEY", "MD5", "CRC", "FNV1_64", "FNV1A_64",
550 "FNV1_32", "FNV1A_32", "HSIEH", "MURMUR", "JENKINS", "CONSISTENT",
551 "MODULA", "RANDOM", "TRUE", "FALSE", "','", "'='", "FLOAT", "NUMBER",
552 "PORT", "WEIGHT_START", "IPADDRESS", "HOSTNAME", "STRING",
553 "QUOTED_STRING", "FILE_PATH", "' '", "$accept", "begin", "statement",
554 "expression", "behaviors", "behavior_number", "behavior_boolean",
555 "optional_port", "optional_weight", "hash", "string", "distribution", 0
560 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
562 static const yytype_uint16 yytoknum
[] =
564 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
565 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
566 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
567 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
568 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
569 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
570 44, 61, 315, 316, 317, 318, 319, 320, 321, 322,
575 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
576 static const yytype_uint8 yyr1
[] =
578 0, 72, 73, 73, 74, 74, 74, 74, 74, 74,
579 74, 74, 75, 75, 75, 75, 76, 76, 76, 76,
580 76, 76, 76, 77, 77, 77, 77, 77, 77, 77,
581 77, 77, 77, 77, 77, 78, 78, 78, 78, 78,
582 78, 78, 78, 78, 78, 78, 78, 79, 79, 80,
583 80, 81, 81, 81, 81, 81, 81, 81, 81, 81,
587 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
588 static const yytype_uint8 yyr2
[] =
590 0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
591 1, 3, 4, 4, 2, 1, 2, 2, 4, 2,
592 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
593 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
594 1, 1, 1, 1, 1, 1, 1, 0, 1, 0,
595 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
599 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
600 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
601 means the default is an error. */
602 static const yytype_uint8 yydefact
[] =
604 0, 5, 7, 8, 9, 10, 0, 0, 6, 0,
605 35, 36, 24, 0, 0, 37, 26, 27, 25, 38,
606 28, 29, 39, 30, 23, 31, 32, 33, 34, 40,
607 41, 22, 45, 46, 43, 44, 42, 0, 0, 2,
608 4, 15, 0, 21, 0, 60, 61, 14, 47, 47,
609 62, 63, 64, 17, 51, 52, 53, 54, 55, 56,
610 57, 58, 59, 19, 16, 1, 0, 20, 11, 48,
611 49, 49, 0, 3, 50, 13, 12, 18
614 /* YYDEFGOTO[NTERM-NUM]. */
615 static const yytype_int8 yydefgoto
[] =
617 -1, 38, 39, 40, 41, 42, 43, 70, 75, 63,
621 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
623 #define YYPACT_NINF -59
624 static const yytype_int8 yypact
[] =
626 -2, -59, -59, -59, -59, -59, -58, -13, -59, -43,
627 -59, -59, -59, -45, -1, -59, -59, -59, -59, -59,
628 -59, -59, -59, -59, -59, -59, -59, -59, -59, -59,
629 -59, -59, -59, -59, -59, -59, -59, -13, 0, -59,
630 -59, -59, -19, -59, -13, -59, -59, -59, -7, -7,
631 -59, -59, -59, 2, -59, -59, -59, -59, -59, -59,
632 -59, -59, -59, -59, -59, -59, -2, -59, -59, -59,
633 -6, -6, -1, -59, -59, -59, -59, -59
636 /* YYPGOTO[NTERM-NUM]. */
637 static const yytype_int8 yypgoto
[] =
639 -59, -59, -8, -59, -59, -59, -59, 11, -5, -9,
643 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
644 positive, shift that token. If negative, reduce the rule which
645 number is the opposite. If zero, do what YYDEFACT says.
646 If YYTABLE_NINF, syntax error. */
647 #define YYTABLE_NINF -1
648 static const yytype_uint8 yytable
[] =
650 65, 1, 2, 3, 4, 5, 6, 7, 8, 9,
651 50, 51, 52, 44, 10, 11, 12, 13, 14, 15,
652 16, 17, 18, 48, 49, 19, 20, 21, 22, 23,
653 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
654 34, 35, 36, 37, 67, 54, 55, 56, 57, 58,
655 59, 60, 61, 62, 64, 45, 46, 69, 73, 74,
656 71, 68, 72, 77, 0, 0, 76, 0, 0, 0,
660 static const yytype_int8 yycheck
[] =
662 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
663 55, 56, 57, 71, 16, 17, 18, 19, 20, 21,
664 22, 23, 24, 66, 67, 27, 28, 29, 30, 31,
665 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
666 42, 43, 44, 45, 63, 46, 47, 48, 49, 50,
667 51, 52, 53, 54, 37, 68, 69, 64, 66, 65,
668 49, 44, 60, 72, -1, -1, 71, -1, -1, -1,
672 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
673 symbol of state STATE-NUM. */
674 static const yytype_uint8 yystos
[] =
676 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
677 16, 17, 18, 19, 20, 21, 22, 23, 24, 27,
678 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
679 38, 39, 40, 41, 42, 43, 44, 45, 73, 74,
680 75, 76, 77, 78, 71, 68, 69, 82, 66, 67,
681 55, 56, 57, 83, 46, 47, 48, 49, 50, 51,
682 52, 53, 54, 81, 82, 0, 71, 63, 82, 64,
683 79, 79, 60, 74, 65, 80, 80, 81
686 #define yyerrok (yyerrstatus = 0)
687 #define yyclearin (yychar = YYEMPTY)
691 #define YYACCEPT goto yyacceptlab
692 #define YYABORT goto yyabortlab
693 #define YYERROR goto yyerrorlab
696 /* Like YYERROR except do call yyerror. This remains here temporarily
697 to ease the transition to the new meaning of YYERROR, for GCC.
698 Once GCC version 2 has supplanted version 1, this can go. However,
699 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
700 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
703 #define YYFAIL goto yyerrlab
705 /* This is here to suppress warnings from the GCC cpp's
706 -Wunused-macros. Normally we don't worry about that warning, but
707 some users do, and we want to make it easy for users to remove
708 YYFAIL uses, which will produce warnings from Bison 2.5. */
711 #define YYRECOVERING() (!!yyerrstatus)
713 #define YYBACKUP(Token, Value) \
715 if (yychar == YYEMPTY && yylen == 1) \
719 yytoken = YYTRANSLATE (yychar); \
725 yyerror (context, scanner, YY_("syntax error: cannot back up")); \
732 #define YYERRCODE 256
735 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
736 If N is 0, then set CURRENT to the empty location which ends
737 the previous symbol: RHS[0] (always defined). */
739 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
740 #ifndef YYLLOC_DEFAULT
741 # define YYLLOC_DEFAULT(Current, Rhs, N) \
745 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
746 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
747 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
748 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
752 (Current).first_line = (Current).last_line = \
753 YYRHSLOC (Rhs, 0).last_line; \
754 (Current).first_column = (Current).last_column = \
755 YYRHSLOC (Rhs, 0).last_column; \
761 /* YY_LOCATION_PRINT -- Print the location on the stream.
762 This macro was not mandated originally: define only if we know
763 we won't break user code: when these are the locations we know. */
765 #ifndef YY_LOCATION_PRINT
766 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
767 # define YY_LOCATION_PRINT(File, Loc) \
768 fprintf (File, "%d.%d-%d.%d", \
769 (Loc).first_line, (Loc).first_column, \
770 (Loc).last_line, (Loc).last_column)
772 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
777 /* YYLEX -- calling `yylex' with the right arguments. */
780 # define YYLEX yylex (&yylval, YYLEX_PARAM)
782 # define YYLEX yylex (&yylval, scanner)
785 /* Enable debugging if requested. */
789 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
790 # define YYFPRINTF fprintf
793 # define YYDPRINTF(Args) \
799 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
803 YYFPRINTF (stderr, "%s ", Title); \
804 yy_symbol_print (stderr, \
805 Type, Value, context, scanner); \
806 YYFPRINTF (stderr, "\n"); \
811 /*--------------------------------.
812 | Print this symbol on YYOUTPUT. |
813 `--------------------------------*/
816 #if (defined __STDC__ || defined __C99__FUNC__ \
817 || defined __cplusplus || defined _MSC_VER)
819 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
822 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
825 YYSTYPE
const * const yyvaluep
;
835 if (yytype
< YYNTOKENS
)
836 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
848 /*--------------------------------.
849 | Print this symbol on YYOUTPUT. |
850 `--------------------------------*/
852 #if (defined __STDC__ || defined __C99__FUNC__ \
853 || defined __cplusplus || defined _MSC_VER)
855 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
858 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
861 YYSTYPE
const * const yyvaluep
;
866 if (yytype
< YYNTOKENS
)
867 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
869 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
871 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
);
872 YYFPRINTF (yyoutput
, ")");
875 /*------------------------------------------------------------------.
876 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
878 `------------------------------------------------------------------*/
880 #if (defined __STDC__ || defined __C99__FUNC__ \
881 || defined __cplusplus || defined _MSC_VER)
883 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
886 yy_stack_print (yybottom
, yytop
)
887 yytype_int16
*yybottom
;
891 YYFPRINTF (stderr
, "Stack now");
892 for (; yybottom
<= yytop
; yybottom
++)
894 int yybot
= *yybottom
;
895 YYFPRINTF (stderr
, " %d", yybot
);
897 YYFPRINTF (stderr
, "\n");
900 # define YY_STACK_PRINT(Bottom, Top) \
903 yy_stack_print ((Bottom), (Top)); \
907 /*------------------------------------------------.
908 | Report that the YYRULE is going to be reduced. |
909 `------------------------------------------------*/
911 #if (defined __STDC__ || defined __C99__FUNC__ \
912 || defined __cplusplus || defined _MSC_VER)
914 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
, Context
*context
, yyscan_t
*scanner
)
917 yy_reduce_print (yyvsp
, yyrule
, context
, scanner
)
924 int yynrhs
= yyr2
[yyrule
];
926 unsigned long int yylno
= yyrline
[yyrule
];
927 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
929 /* The symbols being reduced. */
930 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
932 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
933 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
934 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
936 YYFPRINTF (stderr
, "\n");
940 # define YY_REDUCE_PRINT(Rule) \
943 yy_reduce_print (yyvsp, Rule, context, scanner); \
946 /* Nonzero means print parse trace. It is left uninitialized so that
947 multiple parsers can coexist. */
950 # define YYDPRINTF(Args)
951 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
952 # define YY_STACK_PRINT(Bottom, Top)
953 # define YY_REDUCE_PRINT(Rule)
954 #endif /* !YYDEBUG */
957 /* YYINITDEPTH -- initial size of the parser's stacks. */
959 # define YYINITDEPTH 200
962 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
963 if the built-in stack extension method is used).
965 Do not make this value too large; the results are undefined if
966 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
967 evaluated with infinite-precision integer arithmetic. */
970 # define YYMAXDEPTH 10000
978 # if defined __GLIBC__ && defined _STRING_H
979 # define yystrlen strlen
981 /* Return the length of YYSTR. */
982 #if (defined __STDC__ || defined __C99__FUNC__ \
983 || defined __cplusplus || defined _MSC_VER)
985 yystrlen (const char *yystr
)
993 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1001 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1002 # define yystpcpy stpcpy
1004 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1006 #if (defined __STDC__ || defined __C99__FUNC__ \
1007 || defined __cplusplus || defined _MSC_VER)
1009 yystpcpy (char *yydest
, const char *yysrc
)
1012 yystpcpy (yydest
, yysrc
)
1018 const char *yys
= yysrc
;
1020 while ((*yyd
++ = *yys
++) != '\0')
1029 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1030 quotes and backslashes, so that it's suitable for yyerror. The
1031 heuristic is that double-quoting is unnecessary unless the string
1032 contains an apostrophe, a comma, or backslash (other than
1033 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1034 null, do not copy; instead, return the length of what the result
1037 yytnamerr (char *yyres
, const char *yystr
)
1042 char const *yyp
= yystr
;
1049 goto do_not_strip_quotes
;
1053 goto do_not_strip_quotes
;
1066 do_not_strip_quotes
: ;
1070 return yystrlen (yystr
);
1072 return yystpcpy (yyres
, yystr
) - yyres
;
1076 /* Copy into YYRESULT an error message about the unexpected token
1077 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1078 including the terminating null byte. If YYRESULT is null, do not
1079 copy anything; just return the number of bytes that would be
1080 copied. As a special case, return 0 if an ordinary "syntax error"
1081 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1082 size calculation. */
1084 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1086 int yyn
= yypact
[yystate
];
1088 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1092 int yytype
= YYTRANSLATE (yychar
);
1093 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1094 YYSIZE_T yysize
= yysize0
;
1096 int yysize_overflow
= 0;
1097 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1098 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1102 /* This is so xgettext sees the translatable formats that are
1103 constructed on the fly. */
1104 YY_("syntax error, unexpected %s");
1105 YY_("syntax error, unexpected %s, expecting %s");
1106 YY_("syntax error, unexpected %s, expecting %s or %s");
1107 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1108 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1112 static char const yyunexpected
[] = "syntax error, unexpected %s";
1113 static char const yyexpecting
[] = ", expecting %s";
1114 static char const yyor
[] = " or %s";
1115 char yyformat
[sizeof yyunexpected
1116 + sizeof yyexpecting
- 1
1117 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1118 * (sizeof yyor
- 1))];
1119 char const *yyprefix
= yyexpecting
;
1121 /* Start YYX at -YYN if negative to avoid negative indexes in
1123 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1125 /* Stay within bounds of both yycheck and yytname. */
1126 int yychecklim
= YYLAST
- yyn
+ 1;
1127 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1130 yyarg
[0] = yytname
[yytype
];
1131 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1133 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1134 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1136 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1140 yyformat
[sizeof yyunexpected
- 1] = '\0';
1143 yyarg
[yycount
++] = yytname
[yyx
];
1144 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1145 yysize_overflow
|= (yysize1
< yysize
);
1147 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1151 yyf
= YY_(yyformat
);
1152 yysize1
= yysize
+ yystrlen (yyf
);
1153 yysize_overflow
|= (yysize1
< yysize
);
1156 if (yysize_overflow
)
1157 return YYSIZE_MAXIMUM
;
1161 /* Avoid sprintf, as that infringes on the user's name space.
1162 Don't have undefined behavior even if the translation
1163 produced a string with the wrong number of "%s"s. */
1164 char *yyp
= yyresult
;
1166 while ((*yyp
= *yyf
) != '\0')
1168 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1170 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1183 #endif /* YYERROR_VERBOSE */
1186 /*-----------------------------------------------.
1187 | Release the memory associated to this symbol. |
1188 `-----------------------------------------------*/
1191 #if (defined __STDC__ || defined __C99__FUNC__ \
1192 || defined __cplusplus || defined _MSC_VER)
1194 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, Context
*context
, yyscan_t
*scanner
)
1197 yydestruct (yymsg
, yytype
, yyvaluep
, context
, scanner
)
1211 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1221 /* Prevent warnings from -Wmissing-prototypes. */
1222 #ifdef YYPARSE_PARAM
1223 #if defined __STDC__ || defined __cplusplus
1224 int yyparse (void *YYPARSE_PARAM
);
1228 #else /* ! YYPARSE_PARAM */
1229 #if defined __STDC__ || defined __cplusplus
1230 int yyparse (Context
*context
, yyscan_t
*scanner
);
1234 #endif /* ! YYPARSE_PARAM */
1240 /*-------------------------.
1241 | yyparse or yypush_parse. |
1242 `-------------------------*/
1244 #ifdef YYPARSE_PARAM
1245 #if (defined __STDC__ || defined __C99__FUNC__ \
1246 || defined __cplusplus || defined _MSC_VER)
1248 yyparse (void *YYPARSE_PARAM
)
1251 yyparse (YYPARSE_PARAM
)
1252 void *YYPARSE_PARAM
;
1254 #else /* ! YYPARSE_PARAM */
1255 #if (defined __STDC__ || defined __C99__FUNC__ \
1256 || defined __cplusplus || defined _MSC_VER)
1258 yyparse (Context
*context
, yyscan_t
*scanner
)
1261 yyparse (context
, scanner
)
1267 /* The lookahead symbol. */
1270 /* The semantic value of the lookahead symbol. */
1273 /* Number of syntax errors so far. */
1277 /* Number of tokens to shift before error messages enabled. */
1280 /* The stacks and their tools:
1281 `yyss': related to states.
1282 `yyvs': related to semantic values.
1284 Refer to the stacks thru separate pointers, to allow yyoverflow
1285 to reallocate them elsewhere. */
1287 /* The state stack. */
1288 yytype_int16 yyssa
[YYINITDEPTH
];
1290 yytype_int16
*yyssp
;
1292 /* The semantic value stack. */
1293 YYSTYPE yyvsa
[YYINITDEPTH
];
1297 YYSIZE_T yystacksize
;
1301 /* Lookahead token as an internal (translated) token number. */
1303 /* The variables used to return semantic value and location from the
1308 /* Buffer for error messages, and its allocated size. */
1310 char *yymsg
= yymsgbuf
;
1311 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1314 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1316 /* The number of symbols on the RHS of the reduced rule.
1317 Keep to zero when no symbol should be popped. */
1323 yystacksize
= YYINITDEPTH
;
1325 YYDPRINTF ((stderr
, "Starting parse\n"));
1330 yychar
= YYEMPTY
; /* Cause a token to be read. */
1332 /* Initialize stack pointers.
1333 Waste one element of value and location stack
1334 so that they stay on the same level as the state stack.
1335 The wasted elements are never initialized. */
1341 /*------------------------------------------------------------.
1342 | yynewstate -- Push a new state, which is found in yystate. |
1343 `------------------------------------------------------------*/
1345 /* In all cases, when you get here, the value and location stacks
1346 have just been pushed. So pushing a state here evens the stacks. */
1352 if (yyss
+ yystacksize
- 1 <= yyssp
)
1354 /* Get the current used size of the three stacks, in elements. */
1355 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1359 /* Give user a chance to reallocate the stack. Use copies of
1360 these so that the &'s don't force the real ones into
1362 YYSTYPE
*yyvs1
= yyvs
;
1363 yytype_int16
*yyss1
= yyss
;
1365 /* Each stack pointer address is followed by the size of the
1366 data in use in that stack, in bytes. This used to be a
1367 conditional around just the two extra args, but that might
1368 be undefined if yyoverflow is a macro. */
1369 yyoverflow (YY_("memory exhausted"),
1370 &yyss1
, yysize
* sizeof (*yyssp
),
1371 &yyvs1
, yysize
* sizeof (*yyvsp
),
1377 #else /* no yyoverflow */
1378 # ifndef YYSTACK_RELOCATE
1379 goto yyexhaustedlab
;
1381 /* Extend the stack our own way. */
1382 if (YYMAXDEPTH
<= yystacksize
)
1383 goto yyexhaustedlab
;
1385 if (YYMAXDEPTH
< yystacksize
)
1386 yystacksize
= YYMAXDEPTH
;
1389 yytype_int16
*yyss1
= yyss
;
1390 union yyalloc
*yyptr
=
1391 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1393 goto yyexhaustedlab
;
1394 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1395 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1396 # undef YYSTACK_RELOCATE
1398 YYSTACK_FREE (yyss1
);
1401 #endif /* no yyoverflow */
1403 yyssp
= yyss
+ yysize
- 1;
1404 yyvsp
= yyvs
+ yysize
- 1;
1406 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1407 (unsigned long int) yystacksize
));
1409 if (yyss
+ yystacksize
- 1 <= yyssp
)
1413 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1415 if (yystate
== YYFINAL
)
1425 /* Do appropriate processing given the current state. Read a
1426 lookahead token if we need one and don't already have one. */
1428 /* First try to decide what to do without reference to lookahead token. */
1429 yyn
= yypact
[yystate
];
1430 if (yyn
== YYPACT_NINF
)
1433 /* Not known => get a lookahead token if don't already have one. */
1435 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1436 if (yychar
== YYEMPTY
)
1438 YYDPRINTF ((stderr
, "Reading a token: "));
1442 if (yychar
<= YYEOF
)
1444 yychar
= yytoken
= YYEOF
;
1445 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1449 yytoken
= YYTRANSLATE (yychar
);
1450 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1453 /* If the proper action on seeing token YYTOKEN is to reduce or to
1454 detect an error, take that action. */
1456 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1461 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1467 /* Count tokens shifted since error; after three, turn off error
1472 /* Shift the lookahead token. */
1473 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1475 /* Discard the shifted token. */
1484 /*-----------------------------------------------------------.
1485 | yydefault -- do the default action for the current state. |
1486 `-----------------------------------------------------------*/
1488 yyn
= yydefact
[yystate
];
1494 /*-----------------------------.
1495 | yyreduce -- Do a reduction. |
1496 `-----------------------------*/
1498 /* yyn is the number of a rule to reduce with. */
1501 /* If YYLEN is nonzero, implement the default value of the action:
1504 Otherwise, the following line sets YYVAL to garbage.
1505 This behavior is undocumented and Bison
1506 users should not rely upon it. Assigning to YYVAL
1507 unconditionally makes the parser a bit smaller, and it avoids a
1508 GCC warning that YYVAL may be used uninitialized. */
1509 yyval
= yyvsp
[1-yylen
];
1512 YY_REDUCE_PRINT (yyn
);
1517 /* Line 1464 of yacc.c */
1518 #line 159 "libmemcached/options/parser.yy"
1524 /* Line 1464 of yacc.c */
1525 #line 161 "libmemcached/options/parser.yy"
1531 /* Line 1464 of yacc.c */
1532 #line 163 "libmemcached/options/parser.yy"
1538 /* Line 1464 of yacc.c */
1539 #line 165 "libmemcached/options/parser.yy"
1548 /* Line 1464 of yacc.c */
1549 #line 170 "libmemcached/options/parser.yy"
1551 context
->rc
= MEMCACHED_PARSE_USER_ERROR
;
1552 parser_abort(context
, NULL
);
1558 /* Line 1464 of yacc.c */
1559 #line 175 "libmemcached/options/parser.yy"
1561 memcached_reset(context
->memc
);
1567 /* Line 1464 of yacc.c */
1568 #line 179 "libmemcached/options/parser.yy"
1576 /* Line 1464 of yacc.c */
1577 #line 183 "libmemcached/options/parser.yy"
1579 if ((context
->rc
= memcached_parse_configure_file(context
->memc
, (yyvsp
[(3) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].string
).length
)) != MEMCACHED_SUCCESS
)
1581 parser_abort(context
, NULL
);
1588 /* Line 1464 of yacc.c */
1589 #line 194 "libmemcached/options/parser.yy"
1591 if ((context
->rc
= memcached_server_add_with_weight(context
->memc
, (yyvsp
[(2) - (4)].server
).c_str
, (yyvsp
[(2) - (4)].server
).port
, (yyvsp
[(2) - (4)].server
).weight
)) != MEMCACHED_SUCCESS
)
1593 parser_abort(context
, NULL
);
1595 context
->unset_server();
1601 /* Line 1464 of yacc.c */
1602 #line 202 "libmemcached/options/parser.yy"
1604 if ((context
->rc
= memcached_server_add_with_weight(context
->memc
, (yyvsp
[(2) - (4)].server
).c_str
, (yyvsp
[(2) - (4)].server
).port
, (yyvsp
[(2) - (4)].server
).weight
)) != MEMCACHED_SUCCESS
)
1606 parser_abort(context
, NULL
);
1608 context
->unset_server();
1614 /* Line 1464 of yacc.c */
1615 #line 210 "libmemcached/options/parser.yy"
1617 memcached_set_configuration_file(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).length
);
1623 /* Line 1464 of yacc.c */
1624 #line 218 "libmemcached/options/parser.yy"
1626 if ((context
->rc
= memcached_set_prefix_key(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).length
)) != MEMCACHED_SUCCESS
)
1628 parser_abort(context
, NULL
);;
1635 /* Line 1464 of yacc.c */
1636 #line 225 "libmemcached/options/parser.yy"
1638 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1640 parser_abort(context
, NULL
);;
1647 /* Line 1464 of yacc.c */
1648 #line 232 "libmemcached/options/parser.yy"
1650 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (4)].distribution
))) != MEMCACHED_SUCCESS
)
1652 parser_abort(context
, NULL
);;
1654 if ((context
->rc
= memcached_behavior_set_distribution_hash(context
->memc
, (yyvsp
[(4) - (4)].hash
))) != MEMCACHED_SUCCESS
)
1656 parser_abort(context
, NULL
);;
1663 /* Line 1464 of yacc.c */
1664 #line 243 "libmemcached/options/parser.yy"
1666 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_HASH
, (yyvsp
[(2) - (2)].hash
))) != MEMCACHED_SUCCESS
)
1668 parser_abort(context
, NULL
);;
1675 /* Line 1464 of yacc.c */
1676 #line 250 "libmemcached/options/parser.yy"
1678 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (2)].behavior
), (yyvsp
[(2) - (2)].number
))) != MEMCACHED_SUCCESS
)
1680 parser_abort(context
, NULL
);;
1687 /* Line 1464 of yacc.c */
1688 #line 257 "libmemcached/options/parser.yy"
1690 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (1)].behavior
), true)) != MEMCACHED_SUCCESS
)
1692 parser_abort(context
, NULL
);;
1699 /* Line 1464 of yacc.c */
1700 #line 264 "libmemcached/options/parser.yy"
1707 /* Line 1464 of yacc.c */
1708 #line 270 "libmemcached/options/parser.yy"
1710 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS
;
1716 /* Line 1464 of yacc.c */
1717 #line 274 "libmemcached/options/parser.yy"
1719 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
;
1725 /* Line 1464 of yacc.c */
1726 #line 278 "libmemcached/options/parser.yy"
1728 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
;
1734 /* Line 1464 of yacc.c */
1735 #line 282 "libmemcached/options/parser.yy"
1737 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
;
1743 /* Line 1464 of yacc.c */
1744 #line 286 "libmemcached/options/parser.yy"
1746 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
;
1752 /* Line 1464 of yacc.c */
1753 #line 290 "libmemcached/options/parser.yy"
1755 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
;
1761 /* Line 1464 of yacc.c */
1762 #line 294 "libmemcached/options/parser.yy"
1764 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT
;
1770 /* Line 1464 of yacc.c */
1771 #line 298 "libmemcached/options/parser.yy"
1773 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT
;
1779 /* Line 1464 of yacc.c */
1780 #line 302 "libmemcached/options/parser.yy"
1782 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
;
1788 /* Line 1464 of yacc.c */
1789 #line 306 "libmemcached/options/parser.yy"
1791 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SND_TIMEOUT
;
1797 /* Line 1464 of yacc.c */
1798 #line 310 "libmemcached/options/parser.yy"
1800 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
;
1806 /* Line 1464 of yacc.c */
1807 #line 314 "libmemcached/options/parser.yy"
1809 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
;
1815 /* Line 1464 of yacc.c */
1816 #line 321 "libmemcached/options/parser.yy"
1818 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
;
1824 /* Line 1464 of yacc.c */
1825 #line 325 "libmemcached/options/parser.yy"
1827 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
;
1833 /* Line 1464 of yacc.c */
1834 #line 329 "libmemcached/options/parser.yy"
1836 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
;
1842 /* Line 1464 of yacc.c */
1843 #line 333 "libmemcached/options/parser.yy"
1845 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NOREPLY
;
1851 /* Line 1464 of yacc.c */
1852 #line 337 "libmemcached/options/parser.yy"
1854 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
;
1860 /* Line 1464 of yacc.c */
1861 #line 341 "libmemcached/options/parser.yy"
1863 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SORT_HOSTS
;
1869 /* Line 1464 of yacc.c */
1870 #line 345 "libmemcached/options/parser.yy"
1872 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SUPPORT_CAS
;
1878 /* Line 1464 of yacc.c */
1879 #line 349 "libmemcached/options/parser.yy"
1881 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_NODELAY
;
1887 /* Line 1464 of yacc.c */
1888 #line 353 "libmemcached/options/parser.yy"
1890 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
;
1896 /* Line 1464 of yacc.c */
1897 #line 357 "libmemcached/options/parser.yy"
1899 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE
;
1905 /* Line 1464 of yacc.c */
1906 #line 361 "libmemcached/options/parser.yy"
1908 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_USE_UDP
;
1914 /* Line 1464 of yacc.c */
1915 #line 365 "libmemcached/options/parser.yy"
1917 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_VERIFY_KEY
;
1923 /* Line 1464 of yacc.c */
1924 #line 371 "libmemcached/options/parser.yy"
1930 /* Line 1464 of yacc.c */
1931 #line 373 "libmemcached/options/parser.yy"
1937 /* Line 1464 of yacc.c */
1938 #line 377 "libmemcached/options/parser.yy"
1944 /* Line 1464 of yacc.c */
1945 #line 379 "libmemcached/options/parser.yy"
1951 /* Line 1464 of yacc.c */
1952 #line 384 "libmemcached/options/parser.yy"
1954 (yyval
.hash
)= MEMCACHED_HASH_MD5
;
1960 /* Line 1464 of yacc.c */
1961 #line 388 "libmemcached/options/parser.yy"
1963 (yyval
.hash
)= MEMCACHED_HASH_CRC
;
1969 /* Line 1464 of yacc.c */
1970 #line 392 "libmemcached/options/parser.yy"
1972 (yyval
.hash
)= MEMCACHED_HASH_FNV1_64
;
1978 /* Line 1464 of yacc.c */
1979 #line 396 "libmemcached/options/parser.yy"
1981 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_64
;
1987 /* Line 1464 of yacc.c */
1988 #line 400 "libmemcached/options/parser.yy"
1990 (yyval
.hash
)= MEMCACHED_HASH_FNV1_32
;
1996 /* Line 1464 of yacc.c */
1997 #line 404 "libmemcached/options/parser.yy"
1999 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_32
;
2005 /* Line 1464 of yacc.c */
2006 #line 408 "libmemcached/options/parser.yy"
2008 (yyval
.hash
)= MEMCACHED_HASH_HSIEH
;
2014 /* Line 1464 of yacc.c */
2015 #line 412 "libmemcached/options/parser.yy"
2017 (yyval
.hash
)= MEMCACHED_HASH_MURMUR
;
2023 /* Line 1464 of yacc.c */
2024 #line 416 "libmemcached/options/parser.yy"
2026 (yyval
.hash
)= MEMCACHED_HASH_JENKINS
;
2032 /* Line 1464 of yacc.c */
2033 #line 423 "libmemcached/options/parser.yy"
2035 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2041 /* Line 1464 of yacc.c */
2042 #line 427 "libmemcached/options/parser.yy"
2044 (yyval
.string
).c_str
= (yyvsp
[(1) - (1)].string
).c_str
+1; // +1 to move use passed the initial quote
2045 (yyval
.string
).length
= (yyvsp
[(1) - (1)].string
).length
-1; // -1 removes the end quote
2051 /* Line 1464 of yacc.c */
2052 #line 435 "libmemcached/options/parser.yy"
2054 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_CONSISTENT
;
2060 /* Line 1464 of yacc.c */
2061 #line 439 "libmemcached/options/parser.yy"
2063 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_MODULA
;
2069 /* Line 1464 of yacc.c */
2070 #line 443 "libmemcached/options/parser.yy"
2072 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_RANDOM
;
2078 /* Line 1464 of yacc.c */
2079 #line 2080 "libmemcached/options/parser.cc"
2082 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2086 YY_STACK_PRINT (yyss
, yyssp
);
2090 /* Now `shift' the result of the reduction. Determine what state
2091 that goes to, based on the state we popped back to and the rule
2092 number reduced by. */
2096 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2097 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2098 yystate
= yytable
[yystate
];
2100 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2105 /*------------------------------------.
2106 | yyerrlab -- here on detecting error |
2107 `------------------------------------*/
2109 /* If not already recovering from an error, report this error. */
2113 #if ! YYERROR_VERBOSE
2114 yyerror (context
, scanner
, YY_("syntax error"));
2117 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2118 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2120 YYSIZE_T yyalloc
= 2 * yysize
;
2121 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2122 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2123 if (yymsg
!= yymsgbuf
)
2124 YYSTACK_FREE (yymsg
);
2125 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2127 yymsg_alloc
= yyalloc
;
2131 yymsg_alloc
= sizeof yymsgbuf
;
2135 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2137 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2138 yyerror (context
, scanner
, yymsg
);
2142 yyerror (context
, scanner
, YY_("syntax error"));
2144 goto yyexhaustedlab
;
2152 if (yyerrstatus
== 3)
2154 /* If just tried and failed to reuse lookahead token after an
2155 error, discard it. */
2157 if (yychar
<= YYEOF
)
2159 /* Return failure if at end of input. */
2160 if (yychar
== YYEOF
)
2165 yydestruct ("Error: discarding",
2166 yytoken
, &yylval
, context
, scanner
);
2171 /* Else will try to reuse lookahead token after shifting the error
2176 /*---------------------------------------------------.
2177 | yyerrorlab -- error raised explicitly by YYERROR. |
2178 `---------------------------------------------------*/
2181 /* Pacify compilers like GCC when the user code never invokes
2182 YYERROR and the label yyerrorlab therefore never appears in user
2184 if (/*CONSTCOND*/ 0)
2187 /* Do not reclaim the symbols of the rule which action triggered
2191 YY_STACK_PRINT (yyss
, yyssp
);
2196 /*-------------------------------------------------------------.
2197 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2198 `-------------------------------------------------------------*/
2200 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2204 yyn
= yypact
[yystate
];
2205 if (yyn
!= YYPACT_NINF
)
2208 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2216 /* Pop the current state because it cannot handle the error token. */
2221 yydestruct ("Error: popping",
2222 yystos
[yystate
], yyvsp
, context
, scanner
);
2225 YY_STACK_PRINT (yyss
, yyssp
);
2231 /* Shift the error token. */
2232 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2238 /*-------------------------------------.
2239 | yyacceptlab -- YYACCEPT comes here. |
2240 `-------------------------------------*/
2245 /*-----------------------------------.
2246 | yyabortlab -- YYABORT comes here. |
2247 `-----------------------------------*/
2252 #if !defined(yyoverflow) || YYERROR_VERBOSE
2253 /*-------------------------------------------------.
2254 | yyexhaustedlab -- memory exhaustion comes here. |
2255 `-------------------------------------------------*/
2257 yyerror (context
, scanner
, YY_("memory exhausted"));
2263 if (yychar
!= YYEMPTY
)
2264 yydestruct ("Cleanup: discarding lookahead",
2265 yytoken
, &yylval
, context
, scanner
);
2266 /* Do not reclaim the symbols of the rule which action triggered
2267 this YYABORT or YYACCEPT. */
2269 YY_STACK_PRINT (yyss
, yyssp
);
2270 while (yyssp
!= yyss
)
2272 yydestruct ("Cleanup: popping",
2273 yystos
[*yyssp
], yyvsp
, context
, scanner
);
2278 YYSTACK_FREE (yyss
);
2281 if (yymsg
!= yymsgbuf
)
2282 YYSTACK_FREE (yymsg
);
2284 /* Make sure YYID is used. */
2285 return YYID (yyresult
);
2290 /* Line 1684 of yacc.c */
2291 #line 448 "libmemcached/options/parser.yy"
2294 void Context::start()
2296 config_parse(this, (void **)scanner
);