1 /* A Bison parser, made by GNU Bison 2.4.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6 2009, 2010 Free Software Foundation, Inc.
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
44 /* Identify Bison output. */
48 #define YYBISON_VERSION "2.4.3"
51 #define YYSKELETON_NAME "yacc.c"
62 /* Using locations. */
63 #define YYLSP_NEEDED 0
65 /* Substitute the variable and function names. */
66 #define yyparse config_parse
67 #define yylex config_lex
68 #define yyerror config_error
69 #define yylval config_lval
70 #define yychar config_char
71 #define yydebug config_debug
72 #define yynerrs config_nerrs
75 /* Copy the first part of user declarations. */
77 /* Line 189 of yacc.c */
78 #line 36 "libmemcached/options/parser.yy"
85 #include <libmemcached/options/context.h>
86 #include <libmemcached/options/build.h>
87 #include <libmemcached/options/string.h>
88 #include <libmemcached/options/symbol.h>
89 #include <libmemcached/visibility.h>
90 #include <libmemcached/prefix_key.h>
92 #pragma GCC diagnostic ignored "-Wold-style-cast"
93 #include <libmemcached/options/scanner.h>
95 int conf_lex(YYSTYPE
* lvalp
, void* scanner
);
97 #define parser_abort(A, B) do { parser::abort_func((A), (B)); YYABORT; } while (0)
99 inline void config_error(Context
*context
, yyscan_t
*scanner
, const char *error
)
101 if (not context
->end())
102 parser::abort_func(context
, error
);
107 /* Line 189 of yacc.c */
108 #line 109 "libmemcached/options/parser.cc"
110 /* Enabling traces. */
115 /* Enabling verbose error messages. */
116 #ifdef YYERROR_VERBOSE
117 # undef YYERROR_VERBOSE
118 # define YYERROR_VERBOSE 1
120 # define YYERROR_VERBOSE 1
123 /* Enabling the token table. */
124 #ifndef YYTOKEN_TABLE
125 # define YYTOKEN_TABLE 0
132 /* Put the tokens into the symbol table, so that GDB and other debuggers
141 CONFIGURE_FILE
= 264,
145 SERVERS_OPTION
= 268,
146 UNKNOWN_OPTION
= 269,
148 AUTO_EJECT_HOSTS
= 271,
149 BINARY_PROTOCOL
= 272,
150 BUFFER_REQUESTS
= 273,
151 CONNECT_TIMEOUT
= 274,
154 HASH_WITH_PREFIX_KEY
= 277,
155 IO_BYTES_WATERMARK
= 278,
156 IO_KEY_PREFETCH
= 279,
157 IO_MSG_WATERMARK
= 280,
159 KETAMA_WEIGHTED
= 282,
161 NUMBER_OF_REPLICAS
= 284,
163 RANDOMIZE_REPLICA_READ
= 286,
166 SERVER_FAILURE_LIMIT
= 289,
168 SOCKET_RECV_SIZE
= 291,
169 SOCKET_SEND_SIZE
= 292,
173 _TCP_KEEPALIVE
= 296,
207 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
209 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
210 # define YYSTYPE_IS_DECLARED 1
214 /* Copy the second part of user declarations. */
217 /* Line 264 of yacc.c */
218 #line 219 "libmemcached/options/parser.cc"
225 typedef YYTYPE_UINT8 yytype_uint8
;
227 typedef unsigned char yytype_uint8
;
231 typedef YYTYPE_INT8 yytype_int8
;
232 #elif (defined __STDC__ || defined __C99__FUNC__ \
233 || defined __cplusplus || defined _MSC_VER)
234 typedef signed char yytype_int8
;
236 typedef short int yytype_int8
;
240 typedef YYTYPE_UINT16 yytype_uint16
;
242 typedef unsigned short int yytype_uint16
;
246 typedef YYTYPE_INT16 yytype_int16
;
248 typedef short int yytype_int16
;
252 # ifdef __SIZE_TYPE__
253 # define YYSIZE_T __SIZE_TYPE__
254 # elif defined size_t
255 # define YYSIZE_T size_t
256 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
257 || defined __cplusplus || defined _MSC_VER)
258 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
259 # define YYSIZE_T size_t
261 # define YYSIZE_T unsigned int
265 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
268 # if defined YYENABLE_NLS && YYENABLE_NLS
270 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
271 # define YY_(msgid) dgettext ("bison-runtime", msgid)
275 # define YY_(msgid) msgid
279 /* Suppress unused-variable warnings by "using" E. */
280 #if ! defined lint || defined __GNUC__
281 # define YYUSE(e) ((void) (e))
283 # define YYUSE(e) /* empty */
286 /* Identity function, used to suppress warnings about constant conditions. */
290 #if (defined __STDC__ || defined __C99__FUNC__ \
291 || defined __cplusplus || defined _MSC_VER)
304 #if ! defined yyoverflow || YYERROR_VERBOSE
306 /* The parser invokes alloca or malloc; define the necessary symbols. */
308 # ifdef YYSTACK_USE_ALLOCA
309 # if YYSTACK_USE_ALLOCA
311 # define YYSTACK_ALLOC __builtin_alloca
312 # elif defined __BUILTIN_VA_ARG_INCR
313 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
315 # define YYSTACK_ALLOC __alloca
316 # elif defined _MSC_VER
317 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
318 # define alloca _alloca
320 # define YYSTACK_ALLOC alloca
321 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
322 || defined __cplusplus || defined _MSC_VER)
323 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
332 # ifdef YYSTACK_ALLOC
333 /* Pacify GCC's `empty if-body' warning. */
334 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
335 # ifndef YYSTACK_ALLOC_MAXIMUM
336 /* The OS might guarantee only one guard page at the bottom of the stack,
337 and a page size can be as small as 4096 bytes. So we cannot safely
338 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
339 to allow for a few compiler-allocated temporary stack slots. */
340 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
343 # define YYSTACK_ALLOC YYMALLOC
344 # define YYSTACK_FREE YYFREE
345 # ifndef YYSTACK_ALLOC_MAXIMUM
346 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
348 # if (defined __cplusplus && ! defined _STDLIB_H \
349 && ! ((defined YYMALLOC || defined malloc) \
350 && (defined YYFREE || defined free)))
351 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
357 # define YYMALLOC malloc
358 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
359 || defined __cplusplus || defined _MSC_VER)
360 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
365 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
366 || defined __cplusplus || defined _MSC_VER)
367 void free (void *); /* INFRINGES ON USER NAME SPACE */
371 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
374 #if (! defined yyoverflow \
375 && (! defined __cplusplus \
376 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
378 /* A type that is properly aligned for any stack member. */
381 yytype_int16 yyss_alloc
;
385 /* The size of the maximum gap between one aligned stack and the next. */
386 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
388 /* The size of an array large to enough to hold all stacks, each with
390 # define YYSTACK_BYTES(N) \
391 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
392 + YYSTACK_GAP_MAXIMUM)
394 /* Copy COUNT objects from FROM to TO. The source and destination do
397 # if defined __GNUC__ && 1 < __GNUC__
398 # define YYCOPY(To, From, Count) \
399 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
401 # define YYCOPY(To, From, Count) \
405 for (yyi = 0; yyi < (Count); yyi++) \
406 (To)[yyi] = (From)[yyi]; \
412 /* Relocate STACK from its old location to the new one. The
413 local variables YYSIZE and YYSTACKSIZE give the old and new number of
414 elements in the stack, and YYPTR gives the new location of the
415 stack. Advance YYPTR to a properly aligned location for the next
417 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
420 YYSIZE_T yynewbytes; \
421 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
422 Stack = &yyptr->Stack_alloc; \
423 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
424 yyptr += yynewbytes / sizeof (*yyptr); \
430 /* YYFINAL -- State number of the termination state. */
432 /* YYLAST -- Last index in YYTABLE. */
435 /* YYNTOKENS -- Number of terminals. */
437 /* YYNNTS -- Number of nonterminals. */
439 /* YYNRULES -- Number of rules. */
441 /* YYNRULES -- Number of states. */
444 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
446 #define YYMAXUTOK 324
448 #define YYTRANSLATE(YYX) \
449 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
451 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
452 static const yytype_uint8 yytranslate
[] =
454 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 72, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 61, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 62, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
480 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
481 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
482 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
483 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
484 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
485 55, 56, 57, 58, 59, 60, 63, 64, 65, 66,
490 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
492 static const yytype_uint8 yyprhs
[] =
494 0, 0, 3, 5, 9, 11, 13, 15, 17, 19,
495 21, 23, 27, 32, 37, 40, 42, 45, 48, 53,
496 56, 59, 61, 63, 65, 67, 69, 71, 73, 75,
497 77, 79, 81, 83, 85, 87, 89, 91, 93, 95,
498 97, 99, 101, 103, 105, 107, 109, 111, 113, 114,
499 116, 117, 119, 121, 123, 125, 127, 129, 131, 133,
500 135, 137, 139, 141, 143, 145
503 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
504 static const yytype_int8 yyrhs
[] =
506 74, 0, -1, 75, -1, 74, 72, 75, -1, 76,
507 -1, 3, -1, 10, -1, 4, -1, 5, -1, 6,
508 -1, 7, -1, 8, 72, 83, -1, 11, 68, 80,
509 81, -1, 11, 67, 80, 81, -1, 9, 83, -1,
510 77, -1, 46, 83, -1, 20, 84, -1, 20, 84,
511 61, 82, -1, 21, 82, -1, 78, 64, -1, 79,
512 -1, 43, -1, 19, -1, 25, -1, 23, -1, 24,
513 -1, 29, -1, 30, -1, 32, -1, 33, -1, 34,
514 -1, 35, -1, 36, -1, 37, -1, 16, -1, 17,
515 -1, 18, -1, 22, -1, 28, -1, 31, -1, 38,
516 -1, 39, -1, 40, -1, 41, -1, 42, -1, 44,
517 -1, 45, -1, -1, 65, -1, -1, 66, -1, 47,
518 -1, 48, -1, 49, -1, 50, -1, 51, -1, 52,
519 -1, 53, -1, 54, -1, 55, -1, 69, -1, 70,
520 -1, 56, -1, 57, -1, 58, -1
523 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
524 static const yytype_uint16 yyrline
[] =
526 0, 155, 155, 156, 160, 162, 164, 166, 171, 176,
527 180, 184, 195, 203, 211, 215, 219, 226, 233, 244,
528 251, 258, 265, 271, 275, 279, 283, 287, 291, 295,
529 299, 303, 307, 311, 315, 322, 326, 330, 334, 338,
530 342, 346, 350, 354, 358, 362, 366, 370, 377, 378,
531 383, 384, 389, 393, 397, 401, 405, 409, 413, 417,
532 421, 428, 432, 440, 444, 448
536 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
537 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
538 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
539 static const char *const yytname
[] =
541 "$end", "error", "$undefined", "COMMENT", "END", "ERROR", "RESET",
542 "PARSER_DEBUG", "INCLUDE", "CONFIGURE_FILE", "EMPTY_LINE", "SERVER",
543 "SERVERS", "SERVERS_OPTION", "UNKNOWN_OPTION", "UNKNOWN",
544 "AUTO_EJECT_HOSTS", "BINARY_PROTOCOL", "BUFFER_REQUESTS",
545 "CONNECT_TIMEOUT", "DISTRIBUTION", "HASH", "HASH_WITH_PREFIX_KEY",
546 "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH", "IO_MSG_WATERMARK",
547 "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY", "NUMBER_OF_REPLICAS",
548 "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ", "RCV_TIMEOUT", "RETRY_TIMEOUT",
549 "SERVER_FAILURE_LIMIT", "SND_TIMEOUT", "SOCKET_RECV_SIZE",
550 "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS", "_TCP_NODELAY",
551 "_TCP_KEEPALIVE", "_TCP_KEEPIDLE", "USER_DATA", "USE_UDP", "VERIFY_KEY",
552 "PREFIX_KEY", "MD5", "CRC", "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32",
553 "HSIEH", "MURMUR", "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE",
554 "FALSE", "','", "'='", "FLOAT", "NUMBER", "PORT", "WEIGHT_START",
555 "IPADDRESS", "HOSTNAME", "STRING", "QUOTED_STRING", "FILE_PATH", "' '",
556 "$accept", "begin", "statement", "expression", "behaviors",
557 "behavior_number", "behavior_boolean", "optional_port",
558 "optional_weight", "hash", "string", "distribution", 0
563 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
565 static const yytype_uint16 yytoknum
[] =
567 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
568 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
569 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
570 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
571 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
572 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
573 315, 44, 61, 316, 317, 318, 319, 320, 321, 322,
578 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
579 static const yytype_uint8 yyr1
[] =
581 0, 73, 74, 74, 75, 75, 75, 75, 75, 75,
582 75, 75, 76, 76, 76, 76, 77, 77, 77, 77,
583 77, 77, 77, 78, 78, 78, 78, 78, 78, 78,
584 78, 78, 78, 78, 78, 79, 79, 79, 79, 79,
585 79, 79, 79, 79, 79, 79, 79, 79, 80, 80,
586 81, 81, 82, 82, 82, 82, 82, 82, 82, 82,
587 82, 83, 83, 84, 84, 84
590 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
591 static const yytype_uint8 yyr2
[] =
593 0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
594 1, 3, 4, 4, 2, 1, 2, 2, 4, 2,
595 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
596 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
597 1, 1, 1, 1, 1, 1, 1, 1, 0, 1,
598 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
602 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
603 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
604 means the default is an error. */
605 static const yytype_uint8 yydefact
[] =
607 0, 5, 7, 8, 9, 10, 0, 0, 6, 0,
608 35, 36, 37, 23, 0, 0, 38, 25, 26, 24,
609 39, 27, 28, 40, 29, 30, 31, 32, 33, 34,
610 41, 42, 43, 44, 45, 22, 46, 47, 0, 0,
611 2, 4, 15, 0, 21, 0, 61, 62, 14, 48,
612 48, 63, 64, 65, 17, 52, 53, 54, 55, 56,
613 57, 58, 59, 60, 19, 16, 1, 0, 20, 11,
614 49, 50, 50, 0, 3, 51, 13, 12, 18
617 /* YYDEFGOTO[NTERM-NUM]. */
618 static const yytype_int8 yydefgoto
[] =
620 -1, 39, 40, 41, 42, 43, 44, 71, 76, 64,
624 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
626 #define YYPACT_NINF -60
627 static const yytype_int8 yypact
[] =
629 -2, -60, -60, -60, -60, -60, -59, -45, -60, -11,
630 -60, -60, -60, -60, -46, -1, -60, -60, -60, -60,
631 -60, -60, -60, -60, -60, -60, -60, -60, -60, -60,
632 -60, -60, -60, -60, -60, -60, -60, -60, -45, 0,
633 -60, -60, -60, -19, -60, -45, -60, -60, -60, -7,
634 -7, -60, -60, -60, 2, -60, -60, -60, -60, -60,
635 -60, -60, -60, -60, -60, -60, -60, -2, -60, -60,
636 -60, -6, -6, -1, -60, -60, -60, -60, -60
639 /* YYPGOTO[NTERM-NUM]. */
640 static const yytype_int8 yypgoto
[] =
642 -60, -60, -8, -60, -60, -60, -60, 11, -5, -9,
646 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
647 positive, shift that token. If negative, reduce the rule which
648 number is the opposite. If zero, do what YYDEFACT says.
649 If YYTABLE_NINF, syntax error. */
650 #define YYTABLE_NINF -1
651 static const yytype_uint8 yytable
[] =
653 66, 1, 2, 3, 4, 5, 6, 7, 8, 9,
654 51, 52, 53, 45, 10, 11, 12, 13, 14, 15,
655 16, 17, 18, 19, 46, 47, 20, 21, 22, 23,
656 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
657 34, 35, 36, 37, 38, 68, 55, 56, 57, 58,
658 59, 60, 61, 62, 63, 65, 49, 50, 70, 74,
659 75, 72, 69, 73, 78, 0, 0, 77, 0, 0,
663 static const yytype_int8 yycheck
[] =
665 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
666 56, 57, 58, 72, 16, 17, 18, 19, 20, 21,
667 22, 23, 24, 25, 69, 70, 28, 29, 30, 31,
668 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
669 42, 43, 44, 45, 46, 64, 47, 48, 49, 50,
670 51, 52, 53, 54, 55, 38, 67, 68, 65, 67,
671 66, 50, 45, 61, 73, -1, -1, 72, -1, -1,
675 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
676 symbol of state STATE-NUM. */
677 static const yytype_uint8 yystos
[] =
679 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
680 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
681 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
682 38, 39, 40, 41, 42, 43, 44, 45, 46, 74,
683 75, 76, 77, 78, 79, 72, 69, 70, 83, 67,
684 68, 56, 57, 58, 84, 47, 48, 49, 50, 51,
685 52, 53, 54, 55, 82, 83, 0, 72, 64, 83,
686 65, 80, 80, 61, 75, 66, 81, 81, 82
689 #define yyerrok (yyerrstatus = 0)
690 #define yyclearin (yychar = YYEMPTY)
694 #define YYACCEPT goto yyacceptlab
695 #define YYABORT goto yyabortlab
696 #define YYERROR goto yyerrorlab
699 /* Like YYERROR except do call yyerror. This remains here temporarily
700 to ease the transition to the new meaning of YYERROR, for GCC.
701 Once GCC version 2 has supplanted version 1, this can go. However,
702 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
703 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
706 #define YYFAIL goto yyerrlab
708 /* This is here to suppress warnings from the GCC cpp's
709 -Wunused-macros. Normally we don't worry about that warning, but
710 some users do, and we want to make it easy for users to remove
711 YYFAIL uses, which will produce warnings from Bison 2.5. */
714 #define YYRECOVERING() (!!yyerrstatus)
716 #define YYBACKUP(Token, Value) \
718 if (yychar == YYEMPTY && yylen == 1) \
722 yytoken = YYTRANSLATE (yychar); \
728 yyerror (context, scanner, YY_("syntax error: cannot back up")); \
735 #define YYERRCODE 256
738 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
739 If N is 0, then set CURRENT to the empty location which ends
740 the previous symbol: RHS[0] (always defined). */
742 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
743 #ifndef YYLLOC_DEFAULT
744 # define YYLLOC_DEFAULT(Current, Rhs, N) \
748 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
749 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
750 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
751 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
755 (Current).first_line = (Current).last_line = \
756 YYRHSLOC (Rhs, 0).last_line; \
757 (Current).first_column = (Current).last_column = \
758 YYRHSLOC (Rhs, 0).last_column; \
764 /* YY_LOCATION_PRINT -- Print the location on the stream.
765 This macro was not mandated originally: define only if we know
766 we won't break user code: when these are the locations we know. */
768 #ifndef YY_LOCATION_PRINT
769 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
770 # define YY_LOCATION_PRINT(File, Loc) \
771 fprintf (File, "%d.%d-%d.%d", \
772 (Loc).first_line, (Loc).first_column, \
773 (Loc).last_line, (Loc).last_column)
775 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
780 /* YYLEX -- calling `yylex' with the right arguments. */
783 # define YYLEX yylex (&yylval, YYLEX_PARAM)
785 # define YYLEX yylex (&yylval, scanner)
788 /* Enable debugging if requested. */
792 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
793 # define YYFPRINTF fprintf
796 # define YYDPRINTF(Args) \
802 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
806 YYFPRINTF (stderr, "%s ", Title); \
807 yy_symbol_print (stderr, \
808 Type, Value, context, scanner); \
809 YYFPRINTF (stderr, "\n"); \
814 /*--------------------------------.
815 | Print this symbol on YYOUTPUT. |
816 `--------------------------------*/
819 #if (defined __STDC__ || defined __C99__FUNC__ \
820 || defined __cplusplus || defined _MSC_VER)
822 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
825 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
828 YYSTYPE
const * const yyvaluep
;
838 if (yytype
< YYNTOKENS
)
839 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
851 /*--------------------------------.
852 | Print this symbol on YYOUTPUT. |
853 `--------------------------------*/
855 #if (defined __STDC__ || defined __C99__FUNC__ \
856 || defined __cplusplus || defined _MSC_VER)
858 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
861 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
864 YYSTYPE
const * const yyvaluep
;
869 if (yytype
< YYNTOKENS
)
870 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
872 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
874 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
);
875 YYFPRINTF (yyoutput
, ")");
878 /*------------------------------------------------------------------.
879 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
881 `------------------------------------------------------------------*/
883 #if (defined __STDC__ || defined __C99__FUNC__ \
884 || defined __cplusplus || defined _MSC_VER)
886 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
889 yy_stack_print (yybottom
, yytop
)
890 yytype_int16
*yybottom
;
894 YYFPRINTF (stderr
, "Stack now");
895 for (; yybottom
<= yytop
; yybottom
++)
897 int yybot
= *yybottom
;
898 YYFPRINTF (stderr
, " %d", yybot
);
900 YYFPRINTF (stderr
, "\n");
903 # define YY_STACK_PRINT(Bottom, Top) \
906 yy_stack_print ((Bottom), (Top)); \
910 /*------------------------------------------------.
911 | Report that the YYRULE is going to be reduced. |
912 `------------------------------------------------*/
914 #if (defined __STDC__ || defined __C99__FUNC__ \
915 || defined __cplusplus || defined _MSC_VER)
917 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
, Context
*context
, yyscan_t
*scanner
)
920 yy_reduce_print (yyvsp
, yyrule
, context
, scanner
)
927 int yynrhs
= yyr2
[yyrule
];
929 unsigned long int yylno
= yyrline
[yyrule
];
930 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
932 /* The symbols being reduced. */
933 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
935 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
936 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
937 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
939 YYFPRINTF (stderr
, "\n");
943 # define YY_REDUCE_PRINT(Rule) \
946 yy_reduce_print (yyvsp, Rule, context, scanner); \
949 /* Nonzero means print parse trace. It is left uninitialized so that
950 multiple parsers can coexist. */
953 # define YYDPRINTF(Args)
954 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
955 # define YY_STACK_PRINT(Bottom, Top)
956 # define YY_REDUCE_PRINT(Rule)
957 #endif /* !YYDEBUG */
960 /* YYINITDEPTH -- initial size of the parser's stacks. */
962 # define YYINITDEPTH 200
965 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
966 if the built-in stack extension method is used).
968 Do not make this value too large; the results are undefined if
969 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
970 evaluated with infinite-precision integer arithmetic. */
973 # define YYMAXDEPTH 10000
981 # if defined __GLIBC__ && defined _STRING_H
982 # define yystrlen strlen
984 /* Return the length of YYSTR. */
985 #if (defined __STDC__ || defined __C99__FUNC__ \
986 || defined __cplusplus || defined _MSC_VER)
988 yystrlen (const char *yystr
)
996 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1004 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1005 # define yystpcpy stpcpy
1007 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1009 #if (defined __STDC__ || defined __C99__FUNC__ \
1010 || defined __cplusplus || defined _MSC_VER)
1012 yystpcpy (char *yydest
, const char *yysrc
)
1015 yystpcpy (yydest
, yysrc
)
1021 const char *yys
= yysrc
;
1023 while ((*yyd
++ = *yys
++) != '\0')
1032 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1033 quotes and backslashes, so that it's suitable for yyerror. The
1034 heuristic is that double-quoting is unnecessary unless the string
1035 contains an apostrophe, a comma, or backslash (other than
1036 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1037 null, do not copy; instead, return the length of what the result
1040 yytnamerr (char *yyres
, const char *yystr
)
1045 char const *yyp
= yystr
;
1052 goto do_not_strip_quotes
;
1056 goto do_not_strip_quotes
;
1069 do_not_strip_quotes
: ;
1073 return yystrlen (yystr
);
1075 return yystpcpy (yyres
, yystr
) - yyres
;
1079 /* Copy into YYRESULT an error message about the unexpected token
1080 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1081 including the terminating null byte. If YYRESULT is null, do not
1082 copy anything; just return the number of bytes that would be
1083 copied. As a special case, return 0 if an ordinary "syntax error"
1084 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1085 size calculation. */
1087 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1089 int yyn
= yypact
[yystate
];
1091 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1095 int yytype
= YYTRANSLATE (yychar
);
1096 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1097 YYSIZE_T yysize
= yysize0
;
1099 int yysize_overflow
= 0;
1100 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1101 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1105 /* This is so xgettext sees the translatable formats that are
1106 constructed on the fly. */
1107 YY_("syntax error, unexpected %s");
1108 YY_("syntax error, unexpected %s, expecting %s");
1109 YY_("syntax error, unexpected %s, expecting %s or %s");
1110 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1111 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1115 static char const yyunexpected
[] = "syntax error, unexpected %s";
1116 static char const yyexpecting
[] = ", expecting %s";
1117 static char const yyor
[] = " or %s";
1118 char yyformat
[sizeof yyunexpected
1119 + sizeof yyexpecting
- 1
1120 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1121 * (sizeof yyor
- 1))];
1122 char const *yyprefix
= yyexpecting
;
1124 /* Start YYX at -YYN if negative to avoid negative indexes in
1126 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1128 /* Stay within bounds of both yycheck and yytname. */
1129 int yychecklim
= YYLAST
- yyn
+ 1;
1130 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1133 yyarg
[0] = yytname
[yytype
];
1134 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1136 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1137 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1139 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1143 yyformat
[sizeof yyunexpected
- 1] = '\0';
1146 yyarg
[yycount
++] = yytname
[yyx
];
1147 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1148 yysize_overflow
|= (yysize1
< yysize
);
1150 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1154 yyf
= YY_(yyformat
);
1155 yysize1
= yysize
+ yystrlen (yyf
);
1156 yysize_overflow
|= (yysize1
< yysize
);
1159 if (yysize_overflow
)
1160 return YYSIZE_MAXIMUM
;
1164 /* Avoid sprintf, as that infringes on the user's name space.
1165 Don't have undefined behavior even if the translation
1166 produced a string with the wrong number of "%s"s. */
1167 char *yyp
= yyresult
;
1169 while ((*yyp
= *yyf
) != '\0')
1171 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1173 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1186 #endif /* YYERROR_VERBOSE */
1189 /*-----------------------------------------------.
1190 | Release the memory associated to this symbol. |
1191 `-----------------------------------------------*/
1194 #if (defined __STDC__ || defined __C99__FUNC__ \
1195 || defined __cplusplus || defined _MSC_VER)
1197 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, Context
*context
, yyscan_t
*scanner
)
1200 yydestruct (yymsg
, yytype
, yyvaluep
, context
, scanner
)
1214 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1224 /* Prevent warnings from -Wmissing-prototypes. */
1225 #ifdef YYPARSE_PARAM
1226 #if defined __STDC__ || defined __cplusplus
1227 int yyparse (void *YYPARSE_PARAM
);
1231 #else /* ! YYPARSE_PARAM */
1232 #if defined __STDC__ || defined __cplusplus
1233 int yyparse (Context
*context
, yyscan_t
*scanner
);
1237 #endif /* ! YYPARSE_PARAM */
1243 /*-------------------------.
1244 | yyparse or yypush_parse. |
1245 `-------------------------*/
1247 #ifdef YYPARSE_PARAM
1248 #if (defined __STDC__ || defined __C99__FUNC__ \
1249 || defined __cplusplus || defined _MSC_VER)
1251 yyparse (void *YYPARSE_PARAM
)
1254 yyparse (YYPARSE_PARAM
)
1255 void *YYPARSE_PARAM
;
1257 #else /* ! YYPARSE_PARAM */
1258 #if (defined __STDC__ || defined __C99__FUNC__ \
1259 || defined __cplusplus || defined _MSC_VER)
1261 yyparse (Context
*context
, yyscan_t
*scanner
)
1264 yyparse (context
, scanner
)
1270 /* The lookahead symbol. */
1273 /* The semantic value of the lookahead symbol. */
1276 /* Number of syntax errors so far. */
1280 /* Number of tokens to shift before error messages enabled. */
1283 /* The stacks and their tools:
1284 `yyss': related to states.
1285 `yyvs': related to semantic values.
1287 Refer to the stacks thru separate pointers, to allow yyoverflow
1288 to reallocate them elsewhere. */
1290 /* The state stack. */
1291 yytype_int16 yyssa
[YYINITDEPTH
];
1293 yytype_int16
*yyssp
;
1295 /* The semantic value stack. */
1296 YYSTYPE yyvsa
[YYINITDEPTH
];
1300 YYSIZE_T yystacksize
;
1304 /* Lookahead token as an internal (translated) token number. */
1306 /* The variables used to return semantic value and location from the
1311 /* Buffer for error messages, and its allocated size. */
1313 char *yymsg
= yymsgbuf
;
1314 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1317 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1319 /* The number of symbols on the RHS of the reduced rule.
1320 Keep to zero when no symbol should be popped. */
1326 yystacksize
= YYINITDEPTH
;
1328 YYDPRINTF ((stderr
, "Starting parse\n"));
1333 yychar
= YYEMPTY
; /* Cause a token to be read. */
1335 /* Initialize stack pointers.
1336 Waste one element of value and location stack
1337 so that they stay on the same level as the state stack.
1338 The wasted elements are never initialized. */
1344 /*------------------------------------------------------------.
1345 | yynewstate -- Push a new state, which is found in yystate. |
1346 `------------------------------------------------------------*/
1348 /* In all cases, when you get here, the value and location stacks
1349 have just been pushed. So pushing a state here evens the stacks. */
1355 if (yyss
+ yystacksize
- 1 <= yyssp
)
1357 /* Get the current used size of the three stacks, in elements. */
1358 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1362 /* Give user a chance to reallocate the stack. Use copies of
1363 these so that the &'s don't force the real ones into
1365 YYSTYPE
*yyvs1
= yyvs
;
1366 yytype_int16
*yyss1
= yyss
;
1368 /* Each stack pointer address is followed by the size of the
1369 data in use in that stack, in bytes. This used to be a
1370 conditional around just the two extra args, but that might
1371 be undefined if yyoverflow is a macro. */
1372 yyoverflow (YY_("memory exhausted"),
1373 &yyss1
, yysize
* sizeof (*yyssp
),
1374 &yyvs1
, yysize
* sizeof (*yyvsp
),
1380 #else /* no yyoverflow */
1381 # ifndef YYSTACK_RELOCATE
1382 goto yyexhaustedlab
;
1384 /* Extend the stack our own way. */
1385 if (YYMAXDEPTH
<= yystacksize
)
1386 goto yyexhaustedlab
;
1388 if (YYMAXDEPTH
< yystacksize
)
1389 yystacksize
= YYMAXDEPTH
;
1392 yytype_int16
*yyss1
= yyss
;
1393 union yyalloc
*yyptr
=
1394 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1396 goto yyexhaustedlab
;
1397 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1398 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1399 # undef YYSTACK_RELOCATE
1401 YYSTACK_FREE (yyss1
);
1404 #endif /* no yyoverflow */
1406 yyssp
= yyss
+ yysize
- 1;
1407 yyvsp
= yyvs
+ yysize
- 1;
1409 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1410 (unsigned long int) yystacksize
));
1412 if (yyss
+ yystacksize
- 1 <= yyssp
)
1416 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1418 if (yystate
== YYFINAL
)
1428 /* Do appropriate processing given the current state. Read a
1429 lookahead token if we need one and don't already have one. */
1431 /* First try to decide what to do without reference to lookahead token. */
1432 yyn
= yypact
[yystate
];
1433 if (yyn
== YYPACT_NINF
)
1436 /* Not known => get a lookahead token if don't already have one. */
1438 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1439 if (yychar
== YYEMPTY
)
1441 YYDPRINTF ((stderr
, "Reading a token: "));
1445 if (yychar
<= YYEOF
)
1447 yychar
= yytoken
= YYEOF
;
1448 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1452 yytoken
= YYTRANSLATE (yychar
);
1453 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1456 /* If the proper action on seeing token YYTOKEN is to reduce or to
1457 detect an error, take that action. */
1459 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1464 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1470 /* Count tokens shifted since error; after three, turn off error
1475 /* Shift the lookahead token. */
1476 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1478 /* Discard the shifted token. */
1487 /*-----------------------------------------------------------.
1488 | yydefault -- do the default action for the current state. |
1489 `-----------------------------------------------------------*/
1491 yyn
= yydefact
[yystate
];
1497 /*-----------------------------.
1498 | yyreduce -- Do a reduction. |
1499 `-----------------------------*/
1501 /* yyn is the number of a rule to reduce with. */
1504 /* If YYLEN is nonzero, implement the default value of the action:
1507 Otherwise, the following line sets YYVAL to garbage.
1508 This behavior is undocumented and Bison
1509 users should not rely upon it. Assigning to YYVAL
1510 unconditionally makes the parser a bit smaller, and it avoids a
1511 GCC warning that YYVAL may be used uninitialized. */
1512 yyval
= yyvsp
[1-yylen
];
1515 YY_REDUCE_PRINT (yyn
);
1520 /* Line 1464 of yacc.c */
1521 #line 161 "libmemcached/options/parser.yy"
1527 /* Line 1464 of yacc.c */
1528 #line 163 "libmemcached/options/parser.yy"
1534 /* Line 1464 of yacc.c */
1535 #line 165 "libmemcached/options/parser.yy"
1541 /* Line 1464 of yacc.c */
1542 #line 167 "libmemcached/options/parser.yy"
1551 /* Line 1464 of yacc.c */
1552 #line 172 "libmemcached/options/parser.yy"
1554 context
->rc
= MEMCACHED_PARSE_USER_ERROR
;
1555 parser_abort(context
, NULL
);
1561 /* Line 1464 of yacc.c */
1562 #line 177 "libmemcached/options/parser.yy"
1564 memcached_reset(context
->memc
);
1570 /* Line 1464 of yacc.c */
1571 #line 181 "libmemcached/options/parser.yy"
1579 /* Line 1464 of yacc.c */
1580 #line 185 "libmemcached/options/parser.yy"
1582 if ((context
->rc
= memcached_parse_configure_file(context
->memc
, (yyvsp
[(3) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].string
).length
)) != MEMCACHED_SUCCESS
)
1584 parser_abort(context
, NULL
);
1591 /* Line 1464 of yacc.c */
1592 #line 196 "libmemcached/options/parser.yy"
1594 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
)
1596 parser_abort(context
, NULL
);
1598 context
->unset_server();
1604 /* Line 1464 of yacc.c */
1605 #line 204 "libmemcached/options/parser.yy"
1607 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
)
1609 parser_abort(context
, NULL
);
1611 context
->unset_server();
1617 /* Line 1464 of yacc.c */
1618 #line 212 "libmemcached/options/parser.yy"
1620 memcached_set_configuration_file(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).length
);
1626 /* Line 1464 of yacc.c */
1627 #line 220 "libmemcached/options/parser.yy"
1629 if ((context
->rc
= memcached_set_prefix_key(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).length
)) != MEMCACHED_SUCCESS
)
1631 parser_abort(context
, NULL
);;
1638 /* Line 1464 of yacc.c */
1639 #line 227 "libmemcached/options/parser.yy"
1641 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1643 parser_abort(context
, NULL
);;
1650 /* Line 1464 of yacc.c */
1651 #line 234 "libmemcached/options/parser.yy"
1653 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (4)].distribution
))) != MEMCACHED_SUCCESS
)
1655 parser_abort(context
, NULL
);;
1657 if ((context
->rc
= memcached_behavior_set_distribution_hash(context
->memc
, (yyvsp
[(4) - (4)].hash
))) != MEMCACHED_SUCCESS
)
1659 parser_abort(context
, NULL
);;
1666 /* Line 1464 of yacc.c */
1667 #line 245 "libmemcached/options/parser.yy"
1669 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_HASH
, (yyvsp
[(2) - (2)].hash
))) != MEMCACHED_SUCCESS
)
1671 parser_abort(context
, NULL
);;
1678 /* Line 1464 of yacc.c */
1679 #line 252 "libmemcached/options/parser.yy"
1681 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (2)].behavior
), (yyvsp
[(2) - (2)].number
))) != MEMCACHED_SUCCESS
)
1683 parser_abort(context
, NULL
);;
1690 /* Line 1464 of yacc.c */
1691 #line 259 "libmemcached/options/parser.yy"
1693 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (1)].behavior
), true)) != MEMCACHED_SUCCESS
)
1695 parser_abort(context
, NULL
);;
1702 /* Line 1464 of yacc.c */
1703 #line 266 "libmemcached/options/parser.yy"
1710 /* Line 1464 of yacc.c */
1711 #line 272 "libmemcached/options/parser.yy"
1713 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
;
1719 /* Line 1464 of yacc.c */
1720 #line 276 "libmemcached/options/parser.yy"
1722 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
;
1728 /* Line 1464 of yacc.c */
1729 #line 280 "libmemcached/options/parser.yy"
1731 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
;
1737 /* Line 1464 of yacc.c */
1738 #line 284 "libmemcached/options/parser.yy"
1740 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
;
1746 /* Line 1464 of yacc.c */
1747 #line 288 "libmemcached/options/parser.yy"
1749 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
;
1755 /* Line 1464 of yacc.c */
1756 #line 292 "libmemcached/options/parser.yy"
1758 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT
;
1764 /* Line 1464 of yacc.c */
1765 #line 296 "libmemcached/options/parser.yy"
1767 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT
;
1773 /* Line 1464 of yacc.c */
1774 #line 300 "libmemcached/options/parser.yy"
1776 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
;
1782 /* Line 1464 of yacc.c */
1783 #line 304 "libmemcached/options/parser.yy"
1785 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT
;
1791 /* Line 1464 of yacc.c */
1792 #line 308 "libmemcached/options/parser.yy"
1794 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SND_TIMEOUT
;
1800 /* Line 1464 of yacc.c */
1801 #line 312 "libmemcached/options/parser.yy"
1803 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
;
1809 /* Line 1464 of yacc.c */
1810 #line 316 "libmemcached/options/parser.yy"
1812 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
;
1818 /* Line 1464 of yacc.c */
1819 #line 323 "libmemcached/options/parser.yy"
1821 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS
;
1827 /* Line 1464 of yacc.c */
1828 #line 327 "libmemcached/options/parser.yy"
1830 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
;
1836 /* Line 1464 of yacc.c */
1837 #line 331 "libmemcached/options/parser.yy"
1839 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
;
1845 /* Line 1464 of yacc.c */
1846 #line 335 "libmemcached/options/parser.yy"
1848 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
;
1854 /* Line 1464 of yacc.c */
1855 #line 339 "libmemcached/options/parser.yy"
1857 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NOREPLY
;
1863 /* Line 1464 of yacc.c */
1864 #line 343 "libmemcached/options/parser.yy"
1866 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
;
1872 /* Line 1464 of yacc.c */
1873 #line 347 "libmemcached/options/parser.yy"
1875 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SORT_HOSTS
;
1881 /* Line 1464 of yacc.c */
1882 #line 351 "libmemcached/options/parser.yy"
1884 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SUPPORT_CAS
;
1890 /* Line 1464 of yacc.c */
1891 #line 355 "libmemcached/options/parser.yy"
1893 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_NODELAY
;
1899 /* Line 1464 of yacc.c */
1900 #line 359 "libmemcached/options/parser.yy"
1902 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
;
1908 /* Line 1464 of yacc.c */
1909 #line 363 "libmemcached/options/parser.yy"
1911 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE
;
1917 /* Line 1464 of yacc.c */
1918 #line 367 "libmemcached/options/parser.yy"
1920 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_USE_UDP
;
1926 /* Line 1464 of yacc.c */
1927 #line 371 "libmemcached/options/parser.yy"
1929 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_VERIFY_KEY
;
1935 /* Line 1464 of yacc.c */
1936 #line 377 "libmemcached/options/parser.yy"
1942 /* Line 1464 of yacc.c */
1943 #line 379 "libmemcached/options/parser.yy"
1949 /* Line 1464 of yacc.c */
1950 #line 383 "libmemcached/options/parser.yy"
1956 /* Line 1464 of yacc.c */
1957 #line 385 "libmemcached/options/parser.yy"
1963 /* Line 1464 of yacc.c */
1964 #line 390 "libmemcached/options/parser.yy"
1966 (yyval
.hash
)= MEMCACHED_HASH_MD5
;
1972 /* Line 1464 of yacc.c */
1973 #line 394 "libmemcached/options/parser.yy"
1975 (yyval
.hash
)= MEMCACHED_HASH_CRC
;
1981 /* Line 1464 of yacc.c */
1982 #line 398 "libmemcached/options/parser.yy"
1984 (yyval
.hash
)= MEMCACHED_HASH_FNV1_64
;
1990 /* Line 1464 of yacc.c */
1991 #line 402 "libmemcached/options/parser.yy"
1993 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_64
;
1999 /* Line 1464 of yacc.c */
2000 #line 406 "libmemcached/options/parser.yy"
2002 (yyval
.hash
)= MEMCACHED_HASH_FNV1_32
;
2008 /* Line 1464 of yacc.c */
2009 #line 410 "libmemcached/options/parser.yy"
2011 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_32
;
2017 /* Line 1464 of yacc.c */
2018 #line 414 "libmemcached/options/parser.yy"
2020 (yyval
.hash
)= MEMCACHED_HASH_HSIEH
;
2026 /* Line 1464 of yacc.c */
2027 #line 418 "libmemcached/options/parser.yy"
2029 (yyval
.hash
)= MEMCACHED_HASH_MURMUR
;
2035 /* Line 1464 of yacc.c */
2036 #line 422 "libmemcached/options/parser.yy"
2038 (yyval
.hash
)= MEMCACHED_HASH_JENKINS
;
2044 /* Line 1464 of yacc.c */
2045 #line 429 "libmemcached/options/parser.yy"
2047 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2053 /* Line 1464 of yacc.c */
2054 #line 433 "libmemcached/options/parser.yy"
2056 (yyval
.string
).c_str
= (yyvsp
[(1) - (1)].string
).c_str
+1; // +1 to move use passed the initial quote
2057 (yyval
.string
).length
= (yyvsp
[(1) - (1)].string
).length
-1; // -1 removes the end quote
2063 /* Line 1464 of yacc.c */
2064 #line 441 "libmemcached/options/parser.yy"
2066 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_CONSISTENT
;
2072 /* Line 1464 of yacc.c */
2073 #line 445 "libmemcached/options/parser.yy"
2075 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_MODULA
;
2081 /* Line 1464 of yacc.c */
2082 #line 449 "libmemcached/options/parser.yy"
2084 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_RANDOM
;
2090 /* Line 1464 of yacc.c */
2091 #line 2092 "libmemcached/options/parser.cc"
2094 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2098 YY_STACK_PRINT (yyss
, yyssp
);
2102 /* Now `shift' the result of the reduction. Determine what state
2103 that goes to, based on the state we popped back to and the rule
2104 number reduced by. */
2108 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2109 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2110 yystate
= yytable
[yystate
];
2112 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2117 /*------------------------------------.
2118 | yyerrlab -- here on detecting error |
2119 `------------------------------------*/
2121 /* If not already recovering from an error, report this error. */
2125 #if ! YYERROR_VERBOSE
2126 yyerror (context
, scanner
, YY_("syntax error"));
2129 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2130 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2132 YYSIZE_T yyalloc
= 2 * yysize
;
2133 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2134 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2135 if (yymsg
!= yymsgbuf
)
2136 YYSTACK_FREE (yymsg
);
2137 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2139 yymsg_alloc
= yyalloc
;
2143 yymsg_alloc
= sizeof yymsgbuf
;
2147 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2149 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2150 yyerror (context
, scanner
, yymsg
);
2154 yyerror (context
, scanner
, YY_("syntax error"));
2156 goto yyexhaustedlab
;
2164 if (yyerrstatus
== 3)
2166 /* If just tried and failed to reuse lookahead token after an
2167 error, discard it. */
2169 if (yychar
<= YYEOF
)
2171 /* Return failure if at end of input. */
2172 if (yychar
== YYEOF
)
2177 yydestruct ("Error: discarding",
2178 yytoken
, &yylval
, context
, scanner
);
2183 /* Else will try to reuse lookahead token after shifting the error
2188 /*---------------------------------------------------.
2189 | yyerrorlab -- error raised explicitly by YYERROR. |
2190 `---------------------------------------------------*/
2193 /* Pacify compilers like GCC when the user code never invokes
2194 YYERROR and the label yyerrorlab therefore never appears in user
2196 if (/*CONSTCOND*/ 0)
2199 /* Do not reclaim the symbols of the rule which action triggered
2203 YY_STACK_PRINT (yyss
, yyssp
);
2208 /*-------------------------------------------------------------.
2209 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2210 `-------------------------------------------------------------*/
2212 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2216 yyn
= yypact
[yystate
];
2217 if (yyn
!= YYPACT_NINF
)
2220 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2228 /* Pop the current state because it cannot handle the error token. */
2233 yydestruct ("Error: popping",
2234 yystos
[yystate
], yyvsp
, context
, scanner
);
2237 YY_STACK_PRINT (yyss
, yyssp
);
2243 /* Shift the error token. */
2244 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2250 /*-------------------------------------.
2251 | yyacceptlab -- YYACCEPT comes here. |
2252 `-------------------------------------*/
2257 /*-----------------------------------.
2258 | yyabortlab -- YYABORT comes here. |
2259 `-----------------------------------*/
2264 #if !defined(yyoverflow) || YYERROR_VERBOSE
2265 /*-------------------------------------------------.
2266 | yyexhaustedlab -- memory exhaustion comes here. |
2267 `-------------------------------------------------*/
2269 yyerror (context
, scanner
, YY_("memory exhausted"));
2275 if (yychar
!= YYEMPTY
)
2276 yydestruct ("Cleanup: discarding lookahead",
2277 yytoken
, &yylval
, context
, scanner
);
2278 /* Do not reclaim the symbols of the rule which action triggered
2279 this YYABORT or YYACCEPT. */
2281 YY_STACK_PRINT (yyss
, yyssp
);
2282 while (yyssp
!= yyss
)
2284 yydestruct ("Cleanup: popping",
2285 yystos
[*yyssp
], yyvsp
, context
, scanner
);
2290 YYSTACK_FREE (yyss
);
2293 if (yymsg
!= yymsgbuf
)
2294 YYSTACK_FREE (yymsg
);
2296 /* Make sure YYID is used. */
2297 return YYID (yyresult
);
2302 /* Line 1684 of yacc.c */
2303 #line 454 "libmemcached/options/parser.yy"
2306 void Context::start()
2308 config_parse(this, (void **)scanner
);