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 AUTO_EJECT_HOSTS
= 271,
148 BINARY_PROTOCOL
= 272,
149 BUFFER_REQUESTS
= 273,
150 CONNECT_TIMEOUT
= 274,
153 HASH_WITH_PREFIX_KEY
= 277,
154 IO_BYTES_WATERMARK
= 278,
155 IO_KEY_PREFETCH
= 279,
156 IO_MSG_WATERMARK
= 280,
158 KETAMA_WEIGHTED
= 282,
160 NUMBER_OF_REPLICAS
= 284,
162 RANDOMIZE_REPLICA_READ
= 286,
165 SERVER_FAILURE_LIMIT
= 289,
167 SOCKET_RECV_SIZE
= 291,
168 SOCKET_SEND_SIZE
= 292,
172 _TCP_KEEPALIVE
= 296,
206 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
208 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
209 # define YYSTYPE_IS_DECLARED 1
213 /* Copy the second part of user declarations. */
216 /* Line 264 of yacc.c */
217 #line 218 "libmemcached/options/parser.cc"
224 typedef YYTYPE_UINT8 yytype_uint8
;
226 typedef unsigned char yytype_uint8
;
230 typedef YYTYPE_INT8 yytype_int8
;
231 #elif (defined __STDC__ || defined __C99__FUNC__ \
232 || defined __cplusplus || defined _MSC_VER)
233 typedef signed char yytype_int8
;
235 typedef short int yytype_int8
;
239 typedef YYTYPE_UINT16 yytype_uint16
;
241 typedef unsigned short int yytype_uint16
;
245 typedef YYTYPE_INT16 yytype_int16
;
247 typedef short int yytype_int16
;
251 # ifdef __SIZE_TYPE__
252 # define YYSIZE_T __SIZE_TYPE__
253 # elif defined size_t
254 # define YYSIZE_T size_t
255 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
256 || defined __cplusplus || defined _MSC_VER)
257 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
258 # define YYSIZE_T size_t
260 # define YYSIZE_T unsigned int
264 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
267 # if defined YYENABLE_NLS && YYENABLE_NLS
269 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
270 # define YY_(msgid) dgettext ("bison-runtime", msgid)
274 # define YY_(msgid) msgid
278 /* Suppress unused-variable warnings by "using" E. */
279 #if ! defined lint || defined __GNUC__
280 # define YYUSE(e) ((void) (e))
282 # define YYUSE(e) /* empty */
285 /* Identity function, used to suppress warnings about constant conditions. */
289 #if (defined __STDC__ || defined __C99__FUNC__ \
290 || defined __cplusplus || defined _MSC_VER)
303 #if ! defined yyoverflow || YYERROR_VERBOSE
305 /* The parser invokes alloca or malloc; define the necessary symbols. */
307 # ifdef YYSTACK_USE_ALLOCA
308 # if YYSTACK_USE_ALLOCA
310 # define YYSTACK_ALLOC __builtin_alloca
311 # elif defined __BUILTIN_VA_ARG_INCR
312 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
314 # define YYSTACK_ALLOC __alloca
315 # elif defined _MSC_VER
316 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
317 # define alloca _alloca
319 # define YYSTACK_ALLOC alloca
320 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
321 || defined __cplusplus || defined _MSC_VER)
322 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
331 # ifdef YYSTACK_ALLOC
332 /* Pacify GCC's `empty if-body' warning. */
333 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
334 # ifndef YYSTACK_ALLOC_MAXIMUM
335 /* The OS might guarantee only one guard page at the bottom of the stack,
336 and a page size can be as small as 4096 bytes. So we cannot safely
337 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
338 to allow for a few compiler-allocated temporary stack slots. */
339 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
342 # define YYSTACK_ALLOC YYMALLOC
343 # define YYSTACK_FREE YYFREE
344 # ifndef YYSTACK_ALLOC_MAXIMUM
345 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
347 # if (defined __cplusplus && ! defined _STDLIB_H \
348 && ! ((defined YYMALLOC || defined malloc) \
349 && (defined YYFREE || defined free)))
350 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
356 # define YYMALLOC malloc
357 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
358 || defined __cplusplus || defined _MSC_VER)
359 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
364 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
365 || defined __cplusplus || defined _MSC_VER)
366 void free (void *); /* INFRINGES ON USER NAME SPACE */
370 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
373 #if (! defined yyoverflow \
374 && (! defined __cplusplus \
375 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
377 /* A type that is properly aligned for any stack member. */
380 yytype_int16 yyss_alloc
;
384 /* The size of the maximum gap between one aligned stack and the next. */
385 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
387 /* The size of an array large to enough to hold all stacks, each with
389 # define YYSTACK_BYTES(N) \
390 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
391 + YYSTACK_GAP_MAXIMUM)
393 /* Copy COUNT objects from FROM to TO. The source and destination do
396 # if defined __GNUC__ && 1 < __GNUC__
397 # define YYCOPY(To, From, Count) \
398 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
400 # define YYCOPY(To, From, Count) \
404 for (yyi = 0; yyi < (Count); yyi++) \
405 (To)[yyi] = (From)[yyi]; \
411 /* Relocate STACK from its old location to the new one. The
412 local variables YYSIZE and YYSTACKSIZE give the old and new number of
413 elements in the stack, and YYPTR gives the new location of the
414 stack. Advance YYPTR to a properly aligned location for the next
416 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
419 YYSIZE_T yynewbytes; \
420 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
421 Stack = &yyptr->Stack_alloc; \
422 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
423 yyptr += yynewbytes / sizeof (*yyptr); \
429 /* YYFINAL -- State number of the termination state. */
431 /* YYLAST -- Last index in YYTABLE. */
434 /* YYNTOKENS -- Number of terminals. */
436 /* YYNNTS -- Number of nonterminals. */
438 /* YYNRULES -- Number of rules. */
440 /* YYNRULES -- Number of states. */
443 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
445 #define YYMAXUTOK 324
447 #define YYTRANSLATE(YYX) \
448 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
450 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
451 static const yytype_uint8 yytranslate
[] =
453 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 72, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 61, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 62, 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, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
479 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
480 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
481 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
482 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
483 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
484 55, 56, 57, 58, 59, 60, 63, 64, 65, 66,
489 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
491 static const yytype_uint8 yyprhs
[] =
493 0, 0, 3, 5, 9, 11, 13, 15, 17, 19,
494 21, 23, 27, 32, 37, 40, 42, 45, 48, 53,
495 56, 59, 61, 63, 65, 67, 69, 71, 73, 75,
496 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
497 97, 99, 101, 103, 105, 107, 109, 111, 113, 114,
498 116, 117, 119, 121, 123, 125, 127, 129, 131, 133,
499 135, 137, 139, 141, 143, 145
502 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
503 static const yytype_int8 yyrhs
[] =
505 74, 0, -1, 75, -1, 74, 72, 75, -1, 76,
506 -1, 3, -1, 10, -1, 4, -1, 5, -1, 6,
507 -1, 7, -1, 8, 72, 83, -1, 11, 68, 80,
508 81, -1, 11, 67, 80, 81, -1, 9, 83, -1,
509 77, -1, 46, 83, -1, 20, 84, -1, 20, 84,
510 61, 82, -1, 21, 82, -1, 78, 64, -1, 79,
511 -1, 43, -1, 19, -1, 25, -1, 23, -1, 24,
512 -1, 29, -1, 30, -1, 32, -1, 33, -1, 34,
513 -1, 35, -1, 36, -1, 37, -1, 16, -1, 17,
514 -1, 18, -1, 22, -1, 28, -1, 31, -1, 38,
515 -1, 39, -1, 40, -1, 41, -1, 42, -1, 44,
516 -1, 45, -1, -1, 65, -1, -1, 66, -1, 47,
517 -1, 48, -1, 49, -1, 50, -1, 51, -1, 52,
518 -1, 53, -1, 54, -1, 55, -1, 69, -1, 70,
519 -1, 56, -1, 57, -1, 58, -1
522 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
523 static const yytype_uint16 yyrline
[] =
525 0, 154, 154, 155, 159, 161, 163, 165, 170, 175,
526 179, 183, 194, 202, 210, 214, 218, 225, 232, 243,
527 250, 257, 264, 270, 274, 278, 282, 286, 290, 294,
528 298, 302, 306, 310, 314, 321, 325, 329, 333, 337,
529 341, 345, 349, 353, 357, 361, 365, 369, 376, 377,
530 382, 383, 388, 392, 396, 400, 404, 408, 412, 416,
531 420, 427, 431, 439, 443, 447
535 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
536 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
537 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
538 static const char *const yytname
[] =
540 "$end", "error", "$undefined", "COMMENT", "END", "ERROR", "RESET",
541 "PARSER_DEBUG", "INCLUDE", "CONFIGURE_FILE", "EMPTY_LINE", "SERVER",
542 "SERVERS", "SERVERS_OPTION", "UNKNOWN_OPTION", "UNKNOWN",
543 "AUTO_EJECT_HOSTS", "BINARY_PROTOCOL", "BUFFER_REQUESTS",
544 "CONNECT_TIMEOUT", "DISTRIBUTION", "HASH", "HASH_WITH_PREFIX_KEY",
545 "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH", "IO_MSG_WATERMARK",
546 "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY", "NUMBER_OF_REPLICAS",
547 "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ", "RCV_TIMEOUT", "RETRY_TIMEOUT",
548 "SERVER_FAILURE_LIMIT", "SND_TIMEOUT", "SOCKET_RECV_SIZE",
549 "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS", "_TCP_NODELAY",
550 "_TCP_KEEPALIVE", "_TCP_KEEPIDLE", "USER_DATA", "USE_UDP", "VERIFY_KEY",
551 "PREFIX_KEY", "MD5", "CRC", "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32",
552 "HSIEH", "MURMUR", "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE",
553 "FALSE", "','", "'='", "FLOAT", "NUMBER", "PORT", "WEIGHT_START",
554 "IPADDRESS", "HOSTNAME", "STRING", "QUOTED_STRING", "FILE_PATH", "' '",
555 "$accept", "begin", "statement", "expression", "behaviors",
556 "behavior_number", "behavior_boolean", "optional_port",
557 "optional_weight", "hash", "string", "distribution", 0
562 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
564 static const yytype_uint16 yytoknum
[] =
566 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
567 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
568 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
569 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
570 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
571 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
572 315, 44, 61, 316, 317, 318, 319, 320, 321, 322,
577 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
578 static const yytype_uint8 yyr1
[] =
580 0, 73, 74, 74, 75, 75, 75, 75, 75, 75,
581 75, 75, 76, 76, 76, 76, 77, 77, 77, 77,
582 77, 77, 77, 78, 78, 78, 78, 78, 78, 78,
583 78, 78, 78, 78, 78, 79, 79, 79, 79, 79,
584 79, 79, 79, 79, 79, 79, 79, 79, 80, 80,
585 81, 81, 82, 82, 82, 82, 82, 82, 82, 82,
586 82, 83, 83, 84, 84, 84
589 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
590 static const yytype_uint8 yyr2
[] =
592 0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
593 1, 3, 4, 4, 2, 1, 2, 2, 4, 2,
594 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
595 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
596 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
597 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
601 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
602 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
603 means the default is an error. */
604 static const yytype_uint8 yydefact
[] =
606 0, 5, 7, 8, 9, 10, 0, 0, 6, 0,
607 35, 36, 37, 23, 0, 0, 38, 25, 26, 24,
608 39, 27, 28, 40, 29, 30, 31, 32, 33, 34,
609 41, 42, 43, 44, 45, 22, 46, 47, 0, 0,
610 2, 4, 15, 0, 21, 0, 61, 62, 14, 48,
611 48, 63, 64, 65, 17, 52, 53, 54, 55, 56,
612 57, 58, 59, 60, 19, 16, 1, 0, 20, 11,
613 49, 50, 50, 0, 3, 51, 13, 12, 18
616 /* YYDEFGOTO[NTERM-NUM]. */
617 static const yytype_int8 yydefgoto
[] =
619 -1, 39, 40, 41, 42, 43, 44, 71, 76, 64,
623 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
625 #define YYPACT_NINF -60
626 static const yytype_int8 yypact
[] =
628 -2, -60, -60, -60, -60, -60, -59, -45, -60, -11,
629 -60, -60, -60, -60, -46, -1, -60, -60, -60, -60,
630 -60, -60, -60, -60, -60, -60, -60, -60, -60, -60,
631 -60, -60, -60, -60, -60, -60, -60, -60, -45, 0,
632 -60, -60, -60, -19, -60, -45, -60, -60, -60, -7,
633 -7, -60, -60, -60, 2, -60, -60, -60, -60, -60,
634 -60, -60, -60, -60, -60, -60, -60, -2, -60, -60,
635 -60, -6, -6, -1, -60, -60, -60, -60, -60
638 /* YYPGOTO[NTERM-NUM]. */
639 static const yytype_int8 yypgoto
[] =
641 -60, -60, -8, -60, -60, -60, -60, 11, -5, -9,
645 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
646 positive, shift that token. If negative, reduce the rule which
647 number is the opposite. If zero, do what YYDEFACT says.
648 If YYTABLE_NINF, syntax error. */
649 #define YYTABLE_NINF -1
650 static const yytype_uint8 yytable
[] =
652 66, 1, 2, 3, 4, 5, 6, 7, 8, 9,
653 51, 52, 53, 45, 10, 11, 12, 13, 14, 15,
654 16, 17, 18, 19, 46, 47, 20, 21, 22, 23,
655 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
656 34, 35, 36, 37, 38, 68, 55, 56, 57, 58,
657 59, 60, 61, 62, 63, 65, 49, 50, 70, 74,
658 75, 72, 69, 73, 78, 0, 0, 77, 0, 0,
662 static const yytype_int8 yycheck
[] =
664 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
665 56, 57, 58, 72, 16, 17, 18, 19, 20, 21,
666 22, 23, 24, 25, 69, 70, 28, 29, 30, 31,
667 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
668 42, 43, 44, 45, 46, 64, 47, 48, 49, 50,
669 51, 52, 53, 54, 55, 38, 67, 68, 65, 67,
670 66, 50, 45, 61, 73, -1, -1, 72, -1, -1,
674 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
675 symbol of state STATE-NUM. */
676 static const yytype_uint8 yystos
[] =
678 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
679 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
680 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
681 38, 39, 40, 41, 42, 43, 44, 45, 46, 74,
682 75, 76, 77, 78, 79, 72, 69, 70, 83, 67,
683 68, 56, 57, 58, 84, 47, 48, 49, 50, 51,
684 52, 53, 54, 55, 82, 83, 0, 72, 64, 83,
685 65, 80, 80, 61, 75, 66, 81, 81, 82
688 #define yyerrok (yyerrstatus = 0)
689 #define yyclearin (yychar = YYEMPTY)
693 #define YYACCEPT goto yyacceptlab
694 #define YYABORT goto yyabortlab
695 #define YYERROR goto yyerrorlab
698 /* Like YYERROR except do call yyerror. This remains here temporarily
699 to ease the transition to the new meaning of YYERROR, for GCC.
700 Once GCC version 2 has supplanted version 1, this can go. However,
701 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
702 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
705 #define YYFAIL goto yyerrlab
707 /* This is here to suppress warnings from the GCC cpp's
708 -Wunused-macros. Normally we don't worry about that warning, but
709 some users do, and we want to make it easy for users to remove
710 YYFAIL uses, which will produce warnings from Bison 2.5. */
713 #define YYRECOVERING() (!!yyerrstatus)
715 #define YYBACKUP(Token, Value) \
717 if (yychar == YYEMPTY && yylen == 1) \
721 yytoken = YYTRANSLATE (yychar); \
727 yyerror (context, scanner, YY_("syntax error: cannot back up")); \
734 #define YYERRCODE 256
737 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
738 If N is 0, then set CURRENT to the empty location which ends
739 the previous symbol: RHS[0] (always defined). */
741 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
742 #ifndef YYLLOC_DEFAULT
743 # define YYLLOC_DEFAULT(Current, Rhs, N) \
747 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
748 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
749 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
750 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
754 (Current).first_line = (Current).last_line = \
755 YYRHSLOC (Rhs, 0).last_line; \
756 (Current).first_column = (Current).last_column = \
757 YYRHSLOC (Rhs, 0).last_column; \
763 /* YY_LOCATION_PRINT -- Print the location on the stream.
764 This macro was not mandated originally: define only if we know
765 we won't break user code: when these are the locations we know. */
767 #ifndef YY_LOCATION_PRINT
768 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
769 # define YY_LOCATION_PRINT(File, Loc) \
770 fprintf (File, "%d.%d-%d.%d", \
771 (Loc).first_line, (Loc).first_column, \
772 (Loc).last_line, (Loc).last_column)
774 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
779 /* YYLEX -- calling `yylex' with the right arguments. */
782 # define YYLEX yylex (&yylval, YYLEX_PARAM)
784 # define YYLEX yylex (&yylval, scanner)
787 /* Enable debugging if requested. */
791 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
792 # define YYFPRINTF fprintf
795 # define YYDPRINTF(Args) \
801 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
805 YYFPRINTF (stderr, "%s ", Title); \
806 yy_symbol_print (stderr, \
807 Type, Value, context, scanner); \
808 YYFPRINTF (stderr, "\n"); \
813 /*--------------------------------.
814 | Print this symbol on YYOUTPUT. |
815 `--------------------------------*/
818 #if (defined __STDC__ || defined __C99__FUNC__ \
819 || defined __cplusplus || defined _MSC_VER)
821 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
824 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
827 YYSTYPE
const * const yyvaluep
;
837 if (yytype
< YYNTOKENS
)
838 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
850 /*--------------------------------.
851 | Print this symbol on YYOUTPUT. |
852 `--------------------------------*/
854 #if (defined __STDC__ || defined __C99__FUNC__ \
855 || defined __cplusplus || defined _MSC_VER)
857 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
860 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
863 YYSTYPE
const * const yyvaluep
;
868 if (yytype
< YYNTOKENS
)
869 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
871 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
873 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
);
874 YYFPRINTF (yyoutput
, ")");
877 /*------------------------------------------------------------------.
878 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
880 `------------------------------------------------------------------*/
882 #if (defined __STDC__ || defined __C99__FUNC__ \
883 || defined __cplusplus || defined _MSC_VER)
885 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
888 yy_stack_print (yybottom
, yytop
)
889 yytype_int16
*yybottom
;
893 YYFPRINTF (stderr
, "Stack now");
894 for (; yybottom
<= yytop
; yybottom
++)
896 int yybot
= *yybottom
;
897 YYFPRINTF (stderr
, " %d", yybot
);
899 YYFPRINTF (stderr
, "\n");
902 # define YY_STACK_PRINT(Bottom, Top) \
905 yy_stack_print ((Bottom), (Top)); \
909 /*------------------------------------------------.
910 | Report that the YYRULE is going to be reduced. |
911 `------------------------------------------------*/
913 #if (defined __STDC__ || defined __C99__FUNC__ \
914 || defined __cplusplus || defined _MSC_VER)
916 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
, Context
*context
, yyscan_t
*scanner
)
919 yy_reduce_print (yyvsp
, yyrule
, context
, scanner
)
926 int yynrhs
= yyr2
[yyrule
];
928 unsigned long int yylno
= yyrline
[yyrule
];
929 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
931 /* The symbols being reduced. */
932 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
934 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
935 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
936 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
938 YYFPRINTF (stderr
, "\n");
942 # define YY_REDUCE_PRINT(Rule) \
945 yy_reduce_print (yyvsp, Rule, context, scanner); \
948 /* Nonzero means print parse trace. It is left uninitialized so that
949 multiple parsers can coexist. */
952 # define YYDPRINTF(Args)
953 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
954 # define YY_STACK_PRINT(Bottom, Top)
955 # define YY_REDUCE_PRINT(Rule)
956 #endif /* !YYDEBUG */
959 /* YYINITDEPTH -- initial size of the parser's stacks. */
961 # define YYINITDEPTH 200
964 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
965 if the built-in stack extension method is used).
967 Do not make this value too large; the results are undefined if
968 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
969 evaluated with infinite-precision integer arithmetic. */
972 # define YYMAXDEPTH 10000
980 # if defined __GLIBC__ && defined _STRING_H
981 # define yystrlen strlen
983 /* Return the length of YYSTR. */
984 #if (defined __STDC__ || defined __C99__FUNC__ \
985 || defined __cplusplus || defined _MSC_VER)
987 yystrlen (const char *yystr
)
995 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1003 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1004 # define yystpcpy stpcpy
1006 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1008 #if (defined __STDC__ || defined __C99__FUNC__ \
1009 || defined __cplusplus || defined _MSC_VER)
1011 yystpcpy (char *yydest
, const char *yysrc
)
1014 yystpcpy (yydest
, yysrc
)
1020 const char *yys
= yysrc
;
1022 while ((*yyd
++ = *yys
++) != '\0')
1031 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1032 quotes and backslashes, so that it's suitable for yyerror. The
1033 heuristic is that double-quoting is unnecessary unless the string
1034 contains an apostrophe, a comma, or backslash (other than
1035 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1036 null, do not copy; instead, return the length of what the result
1039 yytnamerr (char *yyres
, const char *yystr
)
1044 char const *yyp
= yystr
;
1051 goto do_not_strip_quotes
;
1055 goto do_not_strip_quotes
;
1068 do_not_strip_quotes
: ;
1072 return yystrlen (yystr
);
1074 return yystpcpy (yyres
, yystr
) - yyres
;
1078 /* Copy into YYRESULT an error message about the unexpected token
1079 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1080 including the terminating null byte. If YYRESULT is null, do not
1081 copy anything; just return the number of bytes that would be
1082 copied. As a special case, return 0 if an ordinary "syntax error"
1083 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1084 size calculation. */
1086 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1088 int yyn
= yypact
[yystate
];
1090 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1094 int yytype
= YYTRANSLATE (yychar
);
1095 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1096 YYSIZE_T yysize
= yysize0
;
1098 int yysize_overflow
= 0;
1099 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1100 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1104 /* This is so xgettext sees the translatable formats that are
1105 constructed on the fly. */
1106 YY_("syntax error, unexpected %s");
1107 YY_("syntax error, unexpected %s, expecting %s");
1108 YY_("syntax error, unexpected %s, expecting %s or %s");
1109 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1110 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1114 static char const yyunexpected
[] = "syntax error, unexpected %s";
1115 static char const yyexpecting
[] = ", expecting %s";
1116 static char const yyor
[] = " or %s";
1117 char yyformat
[sizeof yyunexpected
1118 + sizeof yyexpecting
- 1
1119 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1120 * (sizeof yyor
- 1))];
1121 char const *yyprefix
= yyexpecting
;
1123 /* Start YYX at -YYN if negative to avoid negative indexes in
1125 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1127 /* Stay within bounds of both yycheck and yytname. */
1128 int yychecklim
= YYLAST
- yyn
+ 1;
1129 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1132 yyarg
[0] = yytname
[yytype
];
1133 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1135 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1136 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1138 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1142 yyformat
[sizeof yyunexpected
- 1] = '\0';
1145 yyarg
[yycount
++] = yytname
[yyx
];
1146 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1147 yysize_overflow
|= (yysize1
< yysize
);
1149 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1153 yyf
= YY_(yyformat
);
1154 yysize1
= yysize
+ yystrlen (yyf
);
1155 yysize_overflow
|= (yysize1
< yysize
);
1158 if (yysize_overflow
)
1159 return YYSIZE_MAXIMUM
;
1163 /* Avoid sprintf, as that infringes on the user's name space.
1164 Don't have undefined behavior even if the translation
1165 produced a string with the wrong number of "%s"s. */
1166 char *yyp
= yyresult
;
1168 while ((*yyp
= *yyf
) != '\0')
1170 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1172 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1185 #endif /* YYERROR_VERBOSE */
1188 /*-----------------------------------------------.
1189 | Release the memory associated to this symbol. |
1190 `-----------------------------------------------*/
1193 #if (defined __STDC__ || defined __C99__FUNC__ \
1194 || defined __cplusplus || defined _MSC_VER)
1196 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, Context
*context
, yyscan_t
*scanner
)
1199 yydestruct (yymsg
, yytype
, yyvaluep
, context
, scanner
)
1213 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1223 /* Prevent warnings from -Wmissing-prototypes. */
1224 #ifdef YYPARSE_PARAM
1225 #if defined __STDC__ || defined __cplusplus
1226 int yyparse (void *YYPARSE_PARAM
);
1230 #else /* ! YYPARSE_PARAM */
1231 #if defined __STDC__ || defined __cplusplus
1232 int yyparse (Context
*context
, yyscan_t
*scanner
);
1236 #endif /* ! YYPARSE_PARAM */
1242 /*-------------------------.
1243 | yyparse or yypush_parse. |
1244 `-------------------------*/
1246 #ifdef YYPARSE_PARAM
1247 #if (defined __STDC__ || defined __C99__FUNC__ \
1248 || defined __cplusplus || defined _MSC_VER)
1250 yyparse (void *YYPARSE_PARAM
)
1253 yyparse (YYPARSE_PARAM
)
1254 void *YYPARSE_PARAM
;
1256 #else /* ! YYPARSE_PARAM */
1257 #if (defined __STDC__ || defined __C99__FUNC__ \
1258 || defined __cplusplus || defined _MSC_VER)
1260 yyparse (Context
*context
, yyscan_t
*scanner
)
1263 yyparse (context
, scanner
)
1269 /* The lookahead symbol. */
1272 /* The semantic value of the lookahead symbol. */
1275 /* Number of syntax errors so far. */
1279 /* Number of tokens to shift before error messages enabled. */
1282 /* The stacks and their tools:
1283 `yyss': related to states.
1284 `yyvs': related to semantic values.
1286 Refer to the stacks thru separate pointers, to allow yyoverflow
1287 to reallocate them elsewhere. */
1289 /* The state stack. */
1290 yytype_int16 yyssa
[YYINITDEPTH
];
1292 yytype_int16
*yyssp
;
1294 /* The semantic value stack. */
1295 YYSTYPE yyvsa
[YYINITDEPTH
];
1299 YYSIZE_T yystacksize
;
1303 /* Lookahead token as an internal (translated) token number. */
1305 /* The variables used to return semantic value and location from the
1310 /* Buffer for error messages, and its allocated size. */
1312 char *yymsg
= yymsgbuf
;
1313 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1316 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1318 /* The number of symbols on the RHS of the reduced rule.
1319 Keep to zero when no symbol should be popped. */
1325 yystacksize
= YYINITDEPTH
;
1327 YYDPRINTF ((stderr
, "Starting parse\n"));
1332 yychar
= YYEMPTY
; /* Cause a token to be read. */
1334 /* Initialize stack pointers.
1335 Waste one element of value and location stack
1336 so that they stay on the same level as the state stack.
1337 The wasted elements are never initialized. */
1343 /*------------------------------------------------------------.
1344 | yynewstate -- Push a new state, which is found in yystate. |
1345 `------------------------------------------------------------*/
1347 /* In all cases, when you get here, the value and location stacks
1348 have just been pushed. So pushing a state here evens the stacks. */
1354 if (yyss
+ yystacksize
- 1 <= yyssp
)
1356 /* Get the current used size of the three stacks, in elements. */
1357 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1361 /* Give user a chance to reallocate the stack. Use copies of
1362 these so that the &'s don't force the real ones into
1364 YYSTYPE
*yyvs1
= yyvs
;
1365 yytype_int16
*yyss1
= yyss
;
1367 /* Each stack pointer address is followed by the size of the
1368 data in use in that stack, in bytes. This used to be a
1369 conditional around just the two extra args, but that might
1370 be undefined if yyoverflow is a macro. */
1371 yyoverflow (YY_("memory exhausted"),
1372 &yyss1
, yysize
* sizeof (*yyssp
),
1373 &yyvs1
, yysize
* sizeof (*yyvsp
),
1379 #else /* no yyoverflow */
1380 # ifndef YYSTACK_RELOCATE
1381 goto yyexhaustedlab
;
1383 /* Extend the stack our own way. */
1384 if (YYMAXDEPTH
<= yystacksize
)
1385 goto yyexhaustedlab
;
1387 if (YYMAXDEPTH
< yystacksize
)
1388 yystacksize
= YYMAXDEPTH
;
1391 yytype_int16
*yyss1
= yyss
;
1392 union yyalloc
*yyptr
=
1393 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1395 goto yyexhaustedlab
;
1396 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1397 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1398 # undef YYSTACK_RELOCATE
1400 YYSTACK_FREE (yyss1
);
1403 #endif /* no yyoverflow */
1405 yyssp
= yyss
+ yysize
- 1;
1406 yyvsp
= yyvs
+ yysize
- 1;
1408 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1409 (unsigned long int) yystacksize
));
1411 if (yyss
+ yystacksize
- 1 <= yyssp
)
1415 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1417 if (yystate
== YYFINAL
)
1427 /* Do appropriate processing given the current state. Read a
1428 lookahead token if we need one and don't already have one. */
1430 /* First try to decide what to do without reference to lookahead token. */
1431 yyn
= yypact
[yystate
];
1432 if (yyn
== YYPACT_NINF
)
1435 /* Not known => get a lookahead token if don't already have one. */
1437 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1438 if (yychar
== YYEMPTY
)
1440 YYDPRINTF ((stderr
, "Reading a token: "));
1444 if (yychar
<= YYEOF
)
1446 yychar
= yytoken
= YYEOF
;
1447 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1451 yytoken
= YYTRANSLATE (yychar
);
1452 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1455 /* If the proper action on seeing token YYTOKEN is to reduce or to
1456 detect an error, take that action. */
1458 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1463 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1469 /* Count tokens shifted since error; after three, turn off error
1474 /* Shift the lookahead token. */
1475 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1477 /* Discard the shifted token. */
1486 /*-----------------------------------------------------------.
1487 | yydefault -- do the default action for the current state. |
1488 `-----------------------------------------------------------*/
1490 yyn
= yydefact
[yystate
];
1496 /*-----------------------------.
1497 | yyreduce -- Do a reduction. |
1498 `-----------------------------*/
1500 /* yyn is the number of a rule to reduce with. */
1503 /* If YYLEN is nonzero, implement the default value of the action:
1506 Otherwise, the following line sets YYVAL to garbage.
1507 This behavior is undocumented and Bison
1508 users should not rely upon it. Assigning to YYVAL
1509 unconditionally makes the parser a bit smaller, and it avoids a
1510 GCC warning that YYVAL may be used uninitialized. */
1511 yyval
= yyvsp
[1-yylen
];
1514 YY_REDUCE_PRINT (yyn
);
1519 /* Line 1464 of yacc.c */
1520 #line 160 "libmemcached/options/parser.yy"
1526 /* Line 1464 of yacc.c */
1527 #line 162 "libmemcached/options/parser.yy"
1533 /* Line 1464 of yacc.c */
1534 #line 164 "libmemcached/options/parser.yy"
1540 /* Line 1464 of yacc.c */
1541 #line 166 "libmemcached/options/parser.yy"
1550 /* Line 1464 of yacc.c */
1551 #line 171 "libmemcached/options/parser.yy"
1553 context
->rc
= MEMCACHED_PARSE_USER_ERROR
;
1554 parser_abort(context
, NULL
);
1560 /* Line 1464 of yacc.c */
1561 #line 176 "libmemcached/options/parser.yy"
1563 memcached_reset(context
->memc
);
1569 /* Line 1464 of yacc.c */
1570 #line 180 "libmemcached/options/parser.yy"
1578 /* Line 1464 of yacc.c */
1579 #line 184 "libmemcached/options/parser.yy"
1581 if ((context
->rc
= memcached_parse_configure_file(context
->memc
, (yyvsp
[(3) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].string
).length
)) != MEMCACHED_SUCCESS
)
1583 parser_abort(context
, NULL
);
1590 /* Line 1464 of yacc.c */
1591 #line 195 "libmemcached/options/parser.yy"
1593 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
)
1595 parser_abort(context
, NULL
);
1597 context
->unset_server();
1603 /* Line 1464 of yacc.c */
1604 #line 203 "libmemcached/options/parser.yy"
1606 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
)
1608 parser_abort(context
, NULL
);
1610 context
->unset_server();
1616 /* Line 1464 of yacc.c */
1617 #line 211 "libmemcached/options/parser.yy"
1619 memcached_set_configuration_file(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).length
);
1625 /* Line 1464 of yacc.c */
1626 #line 219 "libmemcached/options/parser.yy"
1628 if ((context
->rc
= memcached_set_prefix_key(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).length
)) != MEMCACHED_SUCCESS
)
1630 parser_abort(context
, NULL
);;
1637 /* Line 1464 of yacc.c */
1638 #line 226 "libmemcached/options/parser.yy"
1640 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1642 parser_abort(context
, NULL
);;
1649 /* Line 1464 of yacc.c */
1650 #line 233 "libmemcached/options/parser.yy"
1652 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (4)].distribution
))) != MEMCACHED_SUCCESS
)
1654 parser_abort(context
, NULL
);;
1656 if ((context
->rc
= memcached_behavior_set_distribution_hash(context
->memc
, (yyvsp
[(4) - (4)].hash
))) != MEMCACHED_SUCCESS
)
1658 parser_abort(context
, NULL
);;
1665 /* Line 1464 of yacc.c */
1666 #line 244 "libmemcached/options/parser.yy"
1668 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_HASH
, (yyvsp
[(2) - (2)].hash
))) != MEMCACHED_SUCCESS
)
1670 parser_abort(context
, NULL
);;
1677 /* Line 1464 of yacc.c */
1678 #line 251 "libmemcached/options/parser.yy"
1680 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (2)].behavior
), (yyvsp
[(2) - (2)].number
))) != MEMCACHED_SUCCESS
)
1682 parser_abort(context
, NULL
);;
1689 /* Line 1464 of yacc.c */
1690 #line 258 "libmemcached/options/parser.yy"
1692 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (1)].behavior
), true)) != MEMCACHED_SUCCESS
)
1694 parser_abort(context
, NULL
);;
1701 /* Line 1464 of yacc.c */
1702 #line 265 "libmemcached/options/parser.yy"
1709 /* Line 1464 of yacc.c */
1710 #line 271 "libmemcached/options/parser.yy"
1712 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
;
1718 /* Line 1464 of yacc.c */
1719 #line 275 "libmemcached/options/parser.yy"
1721 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
;
1727 /* Line 1464 of yacc.c */
1728 #line 279 "libmemcached/options/parser.yy"
1730 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
;
1736 /* Line 1464 of yacc.c */
1737 #line 283 "libmemcached/options/parser.yy"
1739 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
;
1745 /* Line 1464 of yacc.c */
1746 #line 287 "libmemcached/options/parser.yy"
1748 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
;
1754 /* Line 1464 of yacc.c */
1755 #line 291 "libmemcached/options/parser.yy"
1757 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT
;
1763 /* Line 1464 of yacc.c */
1764 #line 295 "libmemcached/options/parser.yy"
1766 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT
;
1772 /* Line 1464 of yacc.c */
1773 #line 299 "libmemcached/options/parser.yy"
1775 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
;
1781 /* Line 1464 of yacc.c */
1782 #line 303 "libmemcached/options/parser.yy"
1784 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
;
1790 /* Line 1464 of yacc.c */
1791 #line 307 "libmemcached/options/parser.yy"
1793 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SND_TIMEOUT
;
1799 /* Line 1464 of yacc.c */
1800 #line 311 "libmemcached/options/parser.yy"
1802 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
;
1808 /* Line 1464 of yacc.c */
1809 #line 315 "libmemcached/options/parser.yy"
1811 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
;
1817 /* Line 1464 of yacc.c */
1818 #line 322 "libmemcached/options/parser.yy"
1820 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS
;
1826 /* Line 1464 of yacc.c */
1827 #line 326 "libmemcached/options/parser.yy"
1829 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
;
1835 /* Line 1464 of yacc.c */
1836 #line 330 "libmemcached/options/parser.yy"
1838 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
;
1844 /* Line 1464 of yacc.c */
1845 #line 334 "libmemcached/options/parser.yy"
1847 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
;
1853 /* Line 1464 of yacc.c */
1854 #line 338 "libmemcached/options/parser.yy"
1856 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NOREPLY
;
1862 /* Line 1464 of yacc.c */
1863 #line 342 "libmemcached/options/parser.yy"
1865 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
;
1871 /* Line 1464 of yacc.c */
1872 #line 346 "libmemcached/options/parser.yy"
1874 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SORT_HOSTS
;
1880 /* Line 1464 of yacc.c */
1881 #line 350 "libmemcached/options/parser.yy"
1883 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SUPPORT_CAS
;
1889 /* Line 1464 of yacc.c */
1890 #line 354 "libmemcached/options/parser.yy"
1892 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_NODELAY
;
1898 /* Line 1464 of yacc.c */
1899 #line 358 "libmemcached/options/parser.yy"
1901 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
;
1907 /* Line 1464 of yacc.c */
1908 #line 362 "libmemcached/options/parser.yy"
1910 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE
;
1916 /* Line 1464 of yacc.c */
1917 #line 366 "libmemcached/options/parser.yy"
1919 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_USE_UDP
;
1925 /* Line 1464 of yacc.c */
1926 #line 370 "libmemcached/options/parser.yy"
1928 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_VERIFY_KEY
;
1934 /* Line 1464 of yacc.c */
1935 #line 376 "libmemcached/options/parser.yy"
1941 /* Line 1464 of yacc.c */
1942 #line 378 "libmemcached/options/parser.yy"
1948 /* Line 1464 of yacc.c */
1949 #line 382 "libmemcached/options/parser.yy"
1955 /* Line 1464 of yacc.c */
1956 #line 384 "libmemcached/options/parser.yy"
1962 /* Line 1464 of yacc.c */
1963 #line 389 "libmemcached/options/parser.yy"
1965 (yyval
.hash
)= MEMCACHED_HASH_MD5
;
1971 /* Line 1464 of yacc.c */
1972 #line 393 "libmemcached/options/parser.yy"
1974 (yyval
.hash
)= MEMCACHED_HASH_CRC
;
1980 /* Line 1464 of yacc.c */
1981 #line 397 "libmemcached/options/parser.yy"
1983 (yyval
.hash
)= MEMCACHED_HASH_FNV1_64
;
1989 /* Line 1464 of yacc.c */
1990 #line 401 "libmemcached/options/parser.yy"
1992 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_64
;
1998 /* Line 1464 of yacc.c */
1999 #line 405 "libmemcached/options/parser.yy"
2001 (yyval
.hash
)= MEMCACHED_HASH_FNV1_32
;
2007 /* Line 1464 of yacc.c */
2008 #line 409 "libmemcached/options/parser.yy"
2010 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_32
;
2016 /* Line 1464 of yacc.c */
2017 #line 413 "libmemcached/options/parser.yy"
2019 (yyval
.hash
)= MEMCACHED_HASH_HSIEH
;
2025 /* Line 1464 of yacc.c */
2026 #line 417 "libmemcached/options/parser.yy"
2028 (yyval
.hash
)= MEMCACHED_HASH_MURMUR
;
2034 /* Line 1464 of yacc.c */
2035 #line 421 "libmemcached/options/parser.yy"
2037 (yyval
.hash
)= MEMCACHED_HASH_JENKINS
;
2043 /* Line 1464 of yacc.c */
2044 #line 428 "libmemcached/options/parser.yy"
2046 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2052 /* Line 1464 of yacc.c */
2053 #line 432 "libmemcached/options/parser.yy"
2055 (yyval
.string
).c_str
= (yyvsp
[(1) - (1)].string
).c_str
+1; // +1 to move use passed the initial quote
2056 (yyval
.string
).length
= (yyvsp
[(1) - (1)].string
).length
-1; // -1 removes the end quote
2062 /* Line 1464 of yacc.c */
2063 #line 440 "libmemcached/options/parser.yy"
2065 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_CONSISTENT
;
2071 /* Line 1464 of yacc.c */
2072 #line 444 "libmemcached/options/parser.yy"
2074 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_MODULA
;
2080 /* Line 1464 of yacc.c */
2081 #line 448 "libmemcached/options/parser.yy"
2083 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_RANDOM
;
2089 /* Line 1464 of yacc.c */
2090 #line 2091 "libmemcached/options/parser.cc"
2093 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2097 YY_STACK_PRINT (yyss
, yyssp
);
2101 /* Now `shift' the result of the reduction. Determine what state
2102 that goes to, based on the state we popped back to and the rule
2103 number reduced by. */
2107 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2108 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2109 yystate
= yytable
[yystate
];
2111 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2116 /*------------------------------------.
2117 | yyerrlab -- here on detecting error |
2118 `------------------------------------*/
2120 /* If not already recovering from an error, report this error. */
2124 #if ! YYERROR_VERBOSE
2125 yyerror (context
, scanner
, YY_("syntax error"));
2128 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2129 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2131 YYSIZE_T yyalloc
= 2 * yysize
;
2132 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2133 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2134 if (yymsg
!= yymsgbuf
)
2135 YYSTACK_FREE (yymsg
);
2136 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2138 yymsg_alloc
= yyalloc
;
2142 yymsg_alloc
= sizeof yymsgbuf
;
2146 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2148 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2149 yyerror (context
, scanner
, yymsg
);
2153 yyerror (context
, scanner
, YY_("syntax error"));
2155 goto yyexhaustedlab
;
2163 if (yyerrstatus
== 3)
2165 /* If just tried and failed to reuse lookahead token after an
2166 error, discard it. */
2168 if (yychar
<= YYEOF
)
2170 /* Return failure if at end of input. */
2171 if (yychar
== YYEOF
)
2176 yydestruct ("Error: discarding",
2177 yytoken
, &yylval
, context
, scanner
);
2182 /* Else will try to reuse lookahead token after shifting the error
2187 /*---------------------------------------------------.
2188 | yyerrorlab -- error raised explicitly by YYERROR. |
2189 `---------------------------------------------------*/
2192 /* Pacify compilers like GCC when the user code never invokes
2193 YYERROR and the label yyerrorlab therefore never appears in user
2195 if (/*CONSTCOND*/ 0)
2198 /* Do not reclaim the symbols of the rule which action triggered
2202 YY_STACK_PRINT (yyss
, yyssp
);
2207 /*-------------------------------------------------------------.
2208 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2209 `-------------------------------------------------------------*/
2211 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2215 yyn
= yypact
[yystate
];
2216 if (yyn
!= YYPACT_NINF
)
2219 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2227 /* Pop the current state because it cannot handle the error token. */
2232 yydestruct ("Error: popping",
2233 yystos
[yystate
], yyvsp
, context
, scanner
);
2236 YY_STACK_PRINT (yyss
, yyssp
);
2242 /* Shift the error token. */
2243 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2249 /*-------------------------------------.
2250 | yyacceptlab -- YYACCEPT comes here. |
2251 `-------------------------------------*/
2256 /*-----------------------------------.
2257 | yyabortlab -- YYABORT comes here. |
2258 `-----------------------------------*/
2263 #if !defined(yyoverflow) || YYERROR_VERBOSE
2264 /*-------------------------------------------------.
2265 | yyexhaustedlab -- memory exhaustion comes here. |
2266 `-------------------------------------------------*/
2268 yyerror (context
, scanner
, YY_("memory exhausted"));
2274 if (yychar
!= YYEMPTY
)
2275 yydestruct ("Cleanup: discarding lookahead",
2276 yytoken
, &yylval
, context
, scanner
);
2277 /* Do not reclaim the symbols of the rule which action triggered
2278 this YYABORT or YYACCEPT. */
2280 YY_STACK_PRINT (yyss
, yyssp
);
2281 while (yyssp
!= yyss
)
2283 yydestruct ("Cleanup: popping",
2284 yystos
[*yyssp
], yyvsp
, context
, scanner
);
2289 YYSTACK_FREE (yyss
);
2292 if (yymsg
!= yymsgbuf
)
2293 YYSTACK_FREE (yymsg
);
2295 /* Make sure YYID is used. */
2296 return YYID (yyresult
);
2301 /* Line 1684 of yacc.c */
2302 #line 453 "libmemcached/options/parser.yy"
2305 void Context::start()
2307 config_parse(this, (void **)scanner
);