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/csl/parser.yy"
81 #include <libmemcached/csl/common.h>
82 #include <libmemcached/options.hpp>
84 #include <libmemcached/csl/context.h>
85 #include <libmemcached/csl/symbol.h>
86 #include <libmemcached/csl/scanner.h>
88 #ifndef __INTEL_COMPILER
89 #pragma GCC diagnostic ignored "-Wold-style-cast"
92 int conf_lex(YYSTYPE
* lvalp
, void* scanner
);
94 #define select_yychar(__context) yychar == UNKNOWN ? ( (__context)->previous_token == END ? UNKNOWN : (__context)->previous_token ) : yychar
96 #define stryytname(__yytokentype) ((__yytokentype) < YYNTOKENS ) ? yytname[(__yytokentype)] : ""
98 #define parser_abort(__context, __error_message) do { (__context)->abort((__error_message), yytokentype(select_yychar(__context)), stryytname(YYTRANSLATE(select_yychar(__context)))); YYABORT; } while (0)
100 // This is bison calling error.
101 inline void __config_error(Context
*context
, yyscan_t
*scanner
, const char *error
, int last_token
, const char *last_token_str
)
103 if (not context
->end())
105 context
->error(error
, yytokentype(last_token
), last_token_str
);
109 context
->error(error
, yytokentype(last_token
), last_token_str
);
113 #define config_error(__context, __scanner, __error_msg) do { __config_error((__context), (__scanner), (__error_msg), select_yychar(__context), stryytname(YYTRANSLATE(select_yychar(__context)))); } while (0)
118 /* Line 189 of yacc.c */
119 #line 120 "libmemcached/csl/parser.cc"
121 /* Enabling traces. */
126 /* Enabling verbose error messages. */
127 #ifdef YYERROR_VERBOSE
128 # undef YYERROR_VERBOSE
129 # define YYERROR_VERBOSE 1
131 # define YYERROR_VERBOSE 1
134 /* Enabling the token table. */
135 #ifndef YYTOKEN_TABLE
136 # define YYTOKEN_TABLE 0
143 /* Put the tokens into the symbol table, so that GDB and other debuggers
152 CONFIGURE_FILE
= 264,
157 SERVERS_OPTION
= 269,
158 UNKNOWN_OPTION
= 270,
160 BINARY_PROTOCOL
= 272,
161 BUFFER_REQUESTS
= 273,
162 CONNECT_TIMEOUT
= 274,
165 HASH_WITH_NAMESPACE
= 277,
166 IO_BYTES_WATERMARK
= 278,
167 IO_KEY_PREFETCH
= 279,
168 IO_MSG_WATERMARK
= 280,
170 KETAMA_WEIGHTED
= 282,
172 NUMBER_OF_REPLICAS
= 284,
174 RANDOMIZE_REPLICA_READ
= 286,
176 REMOVE_FAILED_SERVERS
= 288,
179 SOCKET_RECV_SIZE
= 291,
180 SOCKET_SEND_SIZE
= 292,
186 _TCP_KEEPALIVE
= 298,
220 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
222 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
223 # define YYSTYPE_IS_DECLARED 1
227 /* Copy the second part of user declarations. */
230 /* Line 264 of yacc.c */
231 #line 232 "libmemcached/csl/parser.cc"
238 typedef YYTYPE_UINT8 yytype_uint8
;
240 typedef unsigned char yytype_uint8
;
244 typedef YYTYPE_INT8 yytype_int8
;
245 #elif (defined __STDC__ || defined __C99__FUNC__ \
246 || defined __cplusplus || defined _MSC_VER)
247 typedef signed char yytype_int8
;
249 typedef short int yytype_int8
;
253 typedef YYTYPE_UINT16 yytype_uint16
;
255 typedef unsigned short int yytype_uint16
;
259 typedef YYTYPE_INT16 yytype_int16
;
261 typedef short int yytype_int16
;
265 # ifdef __SIZE_TYPE__
266 # define YYSIZE_T __SIZE_TYPE__
267 # elif defined size_t
268 # define YYSIZE_T size_t
269 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
270 || defined __cplusplus || defined _MSC_VER)
271 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
272 # define YYSIZE_T size_t
274 # define YYSIZE_T unsigned int
278 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
281 # if defined YYENABLE_NLS && YYENABLE_NLS
283 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
284 # define YY_(msgid) dgettext ("bison-runtime", msgid)
288 # define YY_(msgid) msgid
292 /* Suppress unused-variable warnings by "using" E. */
293 #if ! defined lint || defined __GNUC__
294 # define YYUSE(e) ((void) (e))
296 # define YYUSE(e) /* empty */
299 /* Identity function, used to suppress warnings about constant conditions. */
303 #if (defined __STDC__ || defined __C99__FUNC__ \
304 || defined __cplusplus || defined _MSC_VER)
317 #if ! defined yyoverflow || YYERROR_VERBOSE
319 /* The parser invokes alloca or malloc; define the necessary symbols. */
321 # ifdef YYSTACK_USE_ALLOCA
322 # if YYSTACK_USE_ALLOCA
324 # define YYSTACK_ALLOC __builtin_alloca
325 # elif defined __BUILTIN_VA_ARG_INCR
326 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
328 # define YYSTACK_ALLOC __alloca
329 # elif defined _MSC_VER
330 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
331 # define alloca _alloca
333 # define YYSTACK_ALLOC alloca
334 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
335 || defined __cplusplus || defined _MSC_VER)
336 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
345 # ifdef YYSTACK_ALLOC
346 /* Pacify GCC's `empty if-body' warning. */
347 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
348 # ifndef YYSTACK_ALLOC_MAXIMUM
349 /* The OS might guarantee only one guard page at the bottom of the stack,
350 and a page size can be as small as 4096 bytes. So we cannot safely
351 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
352 to allow for a few compiler-allocated temporary stack slots. */
353 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
356 # define YYSTACK_ALLOC YYMALLOC
357 # define YYSTACK_FREE YYFREE
358 # ifndef YYSTACK_ALLOC_MAXIMUM
359 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
361 # if (defined __cplusplus && ! defined _STDLIB_H \
362 && ! ((defined YYMALLOC || defined malloc) \
363 && (defined YYFREE || defined free)))
364 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
370 # define YYMALLOC malloc
371 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
372 || defined __cplusplus || defined _MSC_VER)
373 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
378 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
379 || defined __cplusplus || defined _MSC_VER)
380 void free (void *); /* INFRINGES ON USER NAME SPACE */
384 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
387 #if (! defined yyoverflow \
388 && (! defined __cplusplus \
389 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
391 /* A type that is properly aligned for any stack member. */
394 yytype_int16 yyss_alloc
;
398 /* The size of the maximum gap between one aligned stack and the next. */
399 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
401 /* The size of an array large to enough to hold all stacks, each with
403 # define YYSTACK_BYTES(N) \
404 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
405 + YYSTACK_GAP_MAXIMUM)
407 /* Copy COUNT objects from FROM to TO. The source and destination do
410 # if defined __GNUC__ && 1 < __GNUC__
411 # define YYCOPY(To, From, Count) \
412 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
414 # define YYCOPY(To, From, Count) \
418 for (yyi = 0; yyi < (Count); yyi++) \
419 (To)[yyi] = (From)[yyi]; \
425 /* Relocate STACK from its old location to the new one. The
426 local variables YYSIZE and YYSTACKSIZE give the old and new number of
427 elements in the stack, and YYPTR gives the new location of the
428 stack. Advance YYPTR to a properly aligned location for the next
430 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
433 YYSIZE_T yynewbytes; \
434 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
435 Stack = &yyptr->Stack_alloc; \
436 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
437 yyptr += yynewbytes / sizeof (*yyptr); \
443 /* YYFINAL -- State number of the termination state. */
445 /* YYLAST -- Last index in YYTABLE. */
448 /* YYNTOKENS -- Number of terminals. */
450 /* YYNNTS -- Number of nonterminals. */
452 /* YYNRULES -- Number of rules. */
454 /* YYNRULES -- Number of states. */
457 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
459 #define YYMAXUTOK 326
461 #define YYTRANSLATE(YYX) \
462 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
464 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
465 static const yytype_uint8 yytranslate
[] =
467 0, 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, 74, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 63, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 64, 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, 2, 2, 2, 2,
480 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
481 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
482 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
483 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
486 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
487 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
488 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
489 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
490 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
491 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
492 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
493 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
494 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
495 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
496 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
497 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
498 55, 56, 57, 58, 59, 60, 61, 62, 65, 66,
499 67, 68, 69, 70, 71, 72, 73
503 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
505 static const yytype_uint8 yyprhs
[] =
507 0, 0, 3, 5, 9, 11, 13, 15, 17, 19,
508 21, 23, 27, 32, 37, 41, 44, 47, 50, 52,
509 55, 58, 63, 66, 69, 71, 73, 75, 77, 79,
510 81, 83, 85, 87, 89, 91, 93, 95, 97, 99,
511 101, 103, 105, 107, 109, 111, 113, 115, 117, 119,
512 121, 122, 124, 125, 127, 129, 131, 133, 135, 137,
513 139, 141, 143, 145, 147, 149, 151, 153
516 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
517 static const yytype_int8 yyrhs
[] =
519 76, 0, -1, 77, -1, 76, 74, 77, -1, 78,
520 -1, 3, -1, 10, -1, 4, -1, 5, -1, 6,
521 -1, 7, -1, 8, 74, 85, -1, 11, 70, 82,
522 83, -1, 11, 69, 82, 83, -1, 12, 85, 83,
523 -1, 9, 85, -1, 47, 66, -1, 48, 66, -1,
524 79, -1, 46, 85, -1, 20, 86, -1, 20, 86,
525 63, 84, -1, 21, 84, -1, 80, 66, -1, 81,
526 -1, 40, -1, 33, -1, 19, -1, 25, -1, 23,
527 -1, 24, -1, 29, -1, 30, -1, 32, -1, 34,
528 -1, 35, -1, 36, -1, 37, -1, 17, -1, 18,
529 -1, 22, -1, 28, -1, 31, -1, 38, -1, 39,
530 -1, 45, -1, 43, -1, 44, -1, 41, -1, 42,
531 -1, -1, 67, -1, -1, 68, -1, 49, -1, 50,
532 -1, 51, -1, 52, -1, 53, -1, 54, -1, 55,
533 -1, 56, -1, 57, -1, 71, -1, 72, -1, 58,
537 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
538 static const yytype_uint16 yyrline
[] =
540 0, 172, 172, 173, 177, 179, 181, 183, 188, 193,
541 197, 201, 212, 220, 228, 235, 239, 243, 247, 251,
542 258, 265, 276, 283, 290, 297, 303, 307, 311, 315,
543 319, 323, 327, 331, 335, 339, 343, 347, 354, 358,
544 362, 366, 370, 374, 378, 382, 386, 390, 394, 398,
545 405, 406, 411, 412, 417, 421, 425, 429, 433, 437,
546 441, 445, 449, 456, 460, 467, 471, 475
550 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
551 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
552 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
553 static const char *const yytname
[] =
555 "$end", "error", "$undefined", "COMMENT", "END", "ERROR", "RESET",
556 "PARSER_DEBUG", "INCLUDE", "CONFIGURE_FILE", "EMPTY_LINE", "SERVER",
557 "SOCKET", "SERVERS", "SERVERS_OPTION", "UNKNOWN_OPTION", "UNKNOWN",
558 "BINARY_PROTOCOL", "BUFFER_REQUESTS", "CONNECT_TIMEOUT", "DISTRIBUTION",
559 "HASH", "HASH_WITH_NAMESPACE", "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH",
560 "IO_MSG_WATERMARK", "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY",
561 "NUMBER_OF_REPLICAS", "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ",
562 "RCV_TIMEOUT", "REMOVE_FAILED_SERVERS", "RETRY_TIMEOUT", "SND_TIMEOUT",
563 "SOCKET_RECV_SIZE", "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS",
564 "USER_DATA", "USE_UDP", "VERIFY_KEY", "_TCP_KEEPALIVE", "_TCP_KEEPIDLE",
565 "_TCP_NODELAY", "NAMESPACE", "POOL_MIN", "POOL_MAX", "MD5", "CRC",
566 "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32", "HSIEH", "MURMUR",
567 "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE", "FALSE", "','",
568 "'='", "FLOAT", "NUMBER", "PORT", "WEIGHT_START", "IPADDRESS",
569 "HOSTNAME", "STRING", "QUOTED_STRING", "FILE_PATH", "' '", "$accept",
570 "begin", "statement", "expression", "behaviors", "behavior_number",
571 "behavior_boolean", "optional_port", "optional_weight", "hash", "string",
577 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
579 static const yytype_uint16 yytoknum
[] =
581 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
582 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
583 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
584 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
585 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
586 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
587 315, 316, 317, 44, 61, 318, 319, 320, 321, 322,
588 323, 324, 325, 326, 32
592 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
593 static const yytype_uint8 yyr1
[] =
595 0, 75, 76, 76, 77, 77, 77, 77, 77, 77,
596 77, 77, 78, 78, 78, 78, 78, 78, 78, 79,
597 79, 79, 79, 79, 79, 79, 80, 80, 80, 80,
598 80, 80, 80, 80, 80, 80, 80, 80, 81, 81,
599 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
600 82, 82, 83, 83, 84, 84, 84, 84, 84, 84,
601 84, 84, 84, 85, 85, 86, 86, 86
604 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
605 static const yytype_uint8 yyr2
[] =
607 0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
608 1, 3, 4, 4, 3, 2, 2, 2, 1, 2,
609 2, 4, 2, 2, 1, 1, 1, 1, 1, 1,
610 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
611 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
612 0, 1, 0, 1, 1, 1, 1, 1, 1, 1,
613 1, 1, 1, 1, 1, 1, 1, 1
616 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
617 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
618 means the default is an error. */
619 static const yytype_uint8 yydefact
[] =
621 0, 5, 7, 8, 9, 10, 0, 0, 6, 0,
622 0, 38, 39, 27, 0, 0, 40, 29, 30, 28,
623 41, 31, 32, 42, 33, 26, 34, 35, 36, 37,
624 43, 44, 25, 48, 49, 46, 47, 45, 0, 0,
625 0, 0, 2, 4, 18, 0, 24, 0, 63, 64,
626 15, 50, 50, 52, 65, 66, 67, 20, 54, 55,
627 56, 57, 58, 59, 60, 61, 62, 22, 19, 16,
628 17, 1, 0, 23, 11, 51, 52, 52, 53, 14,
632 /* YYDEFGOTO[NTERM-NUM]. */
633 static const yytype_int8 yydefgoto
[] =
635 -1, 41, 42, 43, 44, 45, 46, 76, 79, 67,
639 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
641 #define YYPACT_NINF -61
642 static const yytype_int8 yypact
[] =
644 -2, -61, -61, -61, -61, -61, -60, -24, -61, -20,
645 -24, -61, -61, -61, -47, 13, -61, -61, -61, -61,
646 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
647 -61, -61, -61, -61, -61, -61, -61, -61, -24, -41,
648 -15, 0, -61, -61, -61, -11, -61, -24, -61, -61,
649 -61, -10, -10, -12, -61, -61, -61, -5, -61, -61,
650 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
651 -61, -61, -2, -61, -61, -61, -12, -12, -61, -61,
652 13, -61, -61, -61, -61
655 /* YYPGOTO[NTERM-NUM]. */
656 static const yytype_int8 yypgoto
[] =
658 -61, -61, -13, -61, -61, -61, -61, 8, -23, -9,
662 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
663 positive, shift that token. If negative, reduce the rule which
664 number is the opposite. If zero, do what YYDEFACT says.
665 If YYTABLE_NINF, syntax error. */
666 #define YYTABLE_NINF -1
667 static const yytype_uint8 yytable
[] =
669 71, 1, 2, 3, 4, 5, 6, 7, 8, 9,
670 10, 54, 55, 56, 47, 11, 12, 13, 14, 15,
671 16, 17, 18, 19, 53, 69, 20, 21, 22, 23,
672 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
673 34, 35, 36, 37, 38, 39, 40, 48, 49, 51,
674 52, 70, 68, 82, 83, 73, 78, 75, 80, 81,
675 77, 74, 58, 59, 60, 61, 62, 63, 64, 65,
679 static const yytype_int8 yycheck
[] =
681 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
682 12, 58, 59, 60, 74, 17, 18, 19, 20, 21,
683 22, 23, 24, 25, 10, 66, 28, 29, 30, 31,
684 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
685 42, 43, 44, 45, 46, 47, 48, 71, 72, 69,
686 70, 66, 38, 76, 77, 66, 68, 67, 63, 72,
687 52, 47, 49, 50, 51, 52, 53, 54, 55, 56,
691 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
692 symbol of state STATE-NUM. */
693 static const yytype_uint8 yystos
[] =
695 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
696 12, 17, 18, 19, 20, 21, 22, 23, 24, 25,
697 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
698 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
699 48, 76, 77, 78, 79, 80, 81, 74, 71, 72,
700 85, 69, 70, 85, 58, 59, 60, 86, 49, 50,
701 51, 52, 53, 54, 55, 56, 57, 84, 85, 66,
702 66, 0, 74, 66, 85, 67, 82, 82, 68, 83,
706 #define yyerrok (yyerrstatus = 0)
707 #define yyclearin (yychar = YYEMPTY)
711 #define YYACCEPT goto yyacceptlab
712 #define YYABORT goto yyabortlab
713 #define YYERROR goto yyerrorlab
716 /* Like YYERROR except do call yyerror. This remains here temporarily
717 to ease the transition to the new meaning of YYERROR, for GCC.
718 Once GCC version 2 has supplanted version 1, this can go. However,
719 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
720 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
723 #define YYFAIL goto yyerrlab
725 /* This is here to suppress warnings from the GCC cpp's
726 -Wunused-macros. Normally we don't worry about that warning, but
727 some users do, and we want to make it easy for users to remove
728 YYFAIL uses, which will produce warnings from Bison 2.5. */
731 #define YYRECOVERING() (!!yyerrstatus)
733 #define YYBACKUP(Token, Value) \
735 if (yychar == YYEMPTY && yylen == 1) \
739 yytoken = YYTRANSLATE (yychar); \
745 yyerror (context, scanner, YY_("syntax error: cannot back up")); \
752 #define YYERRCODE 256
755 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
756 If N is 0, then set CURRENT to the empty location which ends
757 the previous symbol: RHS[0] (always defined). */
759 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
760 #ifndef YYLLOC_DEFAULT
761 # define YYLLOC_DEFAULT(Current, Rhs, N) \
765 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
766 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
767 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
768 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
772 (Current).first_line = (Current).last_line = \
773 YYRHSLOC (Rhs, 0).last_line; \
774 (Current).first_column = (Current).last_column = \
775 YYRHSLOC (Rhs, 0).last_column; \
781 /* YY_LOCATION_PRINT -- Print the location on the stream.
782 This macro was not mandated originally: define only if we know
783 we won't break user code: when these are the locations we know. */
785 #ifndef YY_LOCATION_PRINT
786 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
787 # define YY_LOCATION_PRINT(File, Loc) \
788 fprintf (File, "%d.%d-%d.%d", \
789 (Loc).first_line, (Loc).first_column, \
790 (Loc).last_line, (Loc).last_column)
792 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
797 /* YYLEX -- calling `yylex' with the right arguments. */
800 # define YYLEX yylex (&yylval, YYLEX_PARAM)
802 # define YYLEX yylex (&yylval, scanner)
805 /* Enable debugging if requested. */
809 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
810 # define YYFPRINTF fprintf
813 # define YYDPRINTF(Args) \
819 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
823 YYFPRINTF (stderr, "%s ", Title); \
824 yy_symbol_print (stderr, \
825 Type, Value, context, scanner); \
826 YYFPRINTF (stderr, "\n"); \
831 /*--------------------------------.
832 | Print this symbol on YYOUTPUT. |
833 `--------------------------------*/
836 #if (defined __STDC__ || defined __C99__FUNC__ \
837 || defined __cplusplus || defined _MSC_VER)
839 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
842 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
845 YYSTYPE
const * const yyvaluep
;
855 if (yytype
< YYNTOKENS
)
856 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
868 /*--------------------------------.
869 | Print this symbol on YYOUTPUT. |
870 `--------------------------------*/
872 #if (defined __STDC__ || defined __C99__FUNC__ \
873 || defined __cplusplus || defined _MSC_VER)
875 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
878 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
881 YYSTYPE
const * const yyvaluep
;
886 if (yytype
< YYNTOKENS
)
887 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
889 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
891 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
);
892 YYFPRINTF (yyoutput
, ")");
895 /*------------------------------------------------------------------.
896 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
898 `------------------------------------------------------------------*/
900 #if (defined __STDC__ || defined __C99__FUNC__ \
901 || defined __cplusplus || defined _MSC_VER)
903 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
906 yy_stack_print (yybottom
, yytop
)
907 yytype_int16
*yybottom
;
911 YYFPRINTF (stderr
, "Stack now");
912 for (; yybottom
<= yytop
; yybottom
++)
914 int yybot
= *yybottom
;
915 YYFPRINTF (stderr
, " %d", yybot
);
917 YYFPRINTF (stderr
, "\n");
920 # define YY_STACK_PRINT(Bottom, Top) \
923 yy_stack_print ((Bottom), (Top)); \
927 /*------------------------------------------------.
928 | Report that the YYRULE is going to be reduced. |
929 `------------------------------------------------*/
931 #if (defined __STDC__ || defined __C99__FUNC__ \
932 || defined __cplusplus || defined _MSC_VER)
934 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
, Context
*context
, yyscan_t
*scanner
)
937 yy_reduce_print (yyvsp
, yyrule
, context
, scanner
)
944 int yynrhs
= yyr2
[yyrule
];
946 unsigned long int yylno
= yyrline
[yyrule
];
947 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
949 /* The symbols being reduced. */
950 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
952 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
953 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
954 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
956 YYFPRINTF (stderr
, "\n");
960 # define YY_REDUCE_PRINT(Rule) \
963 yy_reduce_print (yyvsp, Rule, context, scanner); \
966 /* Nonzero means print parse trace. It is left uninitialized so that
967 multiple parsers can coexist. */
970 # define YYDPRINTF(Args)
971 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
972 # define YY_STACK_PRINT(Bottom, Top)
973 # define YY_REDUCE_PRINT(Rule)
974 #endif /* !YYDEBUG */
977 /* YYINITDEPTH -- initial size of the parser's stacks. */
979 # define YYINITDEPTH 200
982 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
983 if the built-in stack extension method is used).
985 Do not make this value too large; the results are undefined if
986 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
987 evaluated with infinite-precision integer arithmetic. */
990 # define YYMAXDEPTH 10000
998 # if defined __GLIBC__ && defined _STRING_H
999 # define yystrlen strlen
1001 /* Return the length of YYSTR. */
1002 #if (defined __STDC__ || defined __C99__FUNC__ \
1003 || defined __cplusplus || defined _MSC_VER)
1005 yystrlen (const char *yystr
)
1013 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1021 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1022 # define yystpcpy stpcpy
1024 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1026 #if (defined __STDC__ || defined __C99__FUNC__ \
1027 || defined __cplusplus || defined _MSC_VER)
1029 yystpcpy (char *yydest
, const char *yysrc
)
1032 yystpcpy (yydest
, yysrc
)
1038 const char *yys
= yysrc
;
1040 while ((*yyd
++ = *yys
++) != '\0')
1049 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1050 quotes and backslashes, so that it's suitable for yyerror. The
1051 heuristic is that double-quoting is unnecessary unless the string
1052 contains an apostrophe, a comma, or backslash (other than
1053 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1054 null, do not copy; instead, return the length of what the result
1057 yytnamerr (char *yyres
, const char *yystr
)
1062 char const *yyp
= yystr
;
1069 goto do_not_strip_quotes
;
1073 goto do_not_strip_quotes
;
1086 do_not_strip_quotes
: ;
1090 return yystrlen (yystr
);
1092 return yystpcpy (yyres
, yystr
) - yyres
;
1096 /* Copy into YYRESULT an error message about the unexpected token
1097 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1098 including the terminating null byte. If YYRESULT is null, do not
1099 copy anything; just return the number of bytes that would be
1100 copied. As a special case, return 0 if an ordinary "syntax error"
1101 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1102 size calculation. */
1104 yysyntax_error (char *yyresult
, int yystate
, int yychar
)
1106 int yyn
= yypact
[yystate
];
1108 if (! (YYPACT_NINF
< yyn
&& yyn
<= YYLAST
))
1112 int yytype
= YYTRANSLATE (yychar
);
1113 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytype
]);
1114 YYSIZE_T yysize
= yysize0
;
1116 int yysize_overflow
= 0;
1117 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1118 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1122 /* This is so xgettext sees the translatable formats that are
1123 constructed on the fly. */
1124 YY_("syntax error, unexpected %s");
1125 YY_("syntax error, unexpected %s, expecting %s");
1126 YY_("syntax error, unexpected %s, expecting %s or %s");
1127 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1128 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1132 static char const yyunexpected
[] = "syntax error, unexpected %s";
1133 static char const yyexpecting
[] = ", expecting %s";
1134 static char const yyor
[] = " or %s";
1135 char yyformat
[sizeof yyunexpected
1136 + sizeof yyexpecting
- 1
1137 + ((YYERROR_VERBOSE_ARGS_MAXIMUM
- 2)
1138 * (sizeof yyor
- 1))];
1139 char const *yyprefix
= yyexpecting
;
1141 /* Start YYX at -YYN if negative to avoid negative indexes in
1143 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1145 /* Stay within bounds of both yycheck and yytname. */
1146 int yychecklim
= YYLAST
- yyn
+ 1;
1147 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1150 yyarg
[0] = yytname
[yytype
];
1151 yyfmt
= yystpcpy (yyformat
, yyunexpected
);
1153 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1154 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1156 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1160 yyformat
[sizeof yyunexpected
- 1] = '\0';
1163 yyarg
[yycount
++] = yytname
[yyx
];
1164 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1165 yysize_overflow
|= (yysize1
< yysize
);
1167 yyfmt
= yystpcpy (yyfmt
, yyprefix
);
1171 yyf
= YY_(yyformat
);
1172 yysize1
= yysize
+ yystrlen (yyf
);
1173 yysize_overflow
|= (yysize1
< yysize
);
1176 if (yysize_overflow
)
1177 return YYSIZE_MAXIMUM
;
1181 /* Avoid sprintf, as that infringes on the user's name space.
1182 Don't have undefined behavior even if the translation
1183 produced a string with the wrong number of "%s"s. */
1184 char *yyp
= yyresult
;
1186 while ((*yyp
= *yyf
) != '\0')
1188 if (*yyp
== '%' && yyf
[1] == 's' && yyi
< yycount
)
1190 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1203 #endif /* YYERROR_VERBOSE */
1206 /*-----------------------------------------------.
1207 | Release the memory associated to this symbol. |
1208 `-----------------------------------------------*/
1211 #if (defined __STDC__ || defined __C99__FUNC__ \
1212 || defined __cplusplus || defined _MSC_VER)
1214 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, Context
*context
, yyscan_t
*scanner
)
1217 yydestruct (yymsg
, yytype
, yyvaluep
, context
, scanner
)
1231 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1241 /* Prevent warnings from -Wmissing-prototypes. */
1242 #ifdef YYPARSE_PARAM
1243 #if defined __STDC__ || defined __cplusplus
1244 int yyparse (void *YYPARSE_PARAM
);
1248 #else /* ! YYPARSE_PARAM */
1249 #if defined __STDC__ || defined __cplusplus
1250 int yyparse (Context
*context
, yyscan_t
*scanner
);
1254 #endif /* ! YYPARSE_PARAM */
1260 /*-------------------------.
1261 | yyparse or yypush_parse. |
1262 `-------------------------*/
1264 #ifdef YYPARSE_PARAM
1265 #if (defined __STDC__ || defined __C99__FUNC__ \
1266 || defined __cplusplus || defined _MSC_VER)
1268 yyparse (void *YYPARSE_PARAM
)
1271 yyparse (YYPARSE_PARAM
)
1272 void *YYPARSE_PARAM
;
1274 #else /* ! YYPARSE_PARAM */
1275 #if (defined __STDC__ || defined __C99__FUNC__ \
1276 || defined __cplusplus || defined _MSC_VER)
1278 yyparse (Context
*context
, yyscan_t
*scanner
)
1281 yyparse (context
, scanner
)
1287 /* The lookahead symbol. */
1290 /* The semantic value of the lookahead symbol. */
1293 /* Number of syntax errors so far. */
1297 /* Number of tokens to shift before error messages enabled. */
1300 /* The stacks and their tools:
1301 `yyss': related to states.
1302 `yyvs': related to semantic values.
1304 Refer to the stacks thru separate pointers, to allow yyoverflow
1305 to reallocate them elsewhere. */
1307 /* The state stack. */
1308 yytype_int16 yyssa
[YYINITDEPTH
];
1310 yytype_int16
*yyssp
;
1312 /* The semantic value stack. */
1313 YYSTYPE yyvsa
[YYINITDEPTH
];
1317 YYSIZE_T yystacksize
;
1321 /* Lookahead token as an internal (translated) token number. */
1323 /* The variables used to return semantic value and location from the
1328 /* Buffer for error messages, and its allocated size. */
1330 char *yymsg
= yymsgbuf
;
1331 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1334 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1336 /* The number of symbols on the RHS of the reduced rule.
1337 Keep to zero when no symbol should be popped. */
1343 yystacksize
= YYINITDEPTH
;
1345 YYDPRINTF ((stderr
, "Starting parse\n"));
1350 yychar
= YYEMPTY
; /* Cause a token to be read. */
1352 /* Initialize stack pointers.
1353 Waste one element of value and location stack
1354 so that they stay on the same level as the state stack.
1355 The wasted elements are never initialized. */
1361 /*------------------------------------------------------------.
1362 | yynewstate -- Push a new state, which is found in yystate. |
1363 `------------------------------------------------------------*/
1365 /* In all cases, when you get here, the value and location stacks
1366 have just been pushed. So pushing a state here evens the stacks. */
1372 if (yyss
+ yystacksize
- 1 <= yyssp
)
1374 /* Get the current used size of the three stacks, in elements. */
1375 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1379 /* Give user a chance to reallocate the stack. Use copies of
1380 these so that the &'s don't force the real ones into
1382 YYSTYPE
*yyvs1
= yyvs
;
1383 yytype_int16
*yyss1
= yyss
;
1385 /* Each stack pointer address is followed by the size of the
1386 data in use in that stack, in bytes. This used to be a
1387 conditional around just the two extra args, but that might
1388 be undefined if yyoverflow is a macro. */
1389 yyoverflow (YY_("memory exhausted"),
1390 &yyss1
, yysize
* sizeof (*yyssp
),
1391 &yyvs1
, yysize
* sizeof (*yyvsp
),
1397 #else /* no yyoverflow */
1398 # ifndef YYSTACK_RELOCATE
1399 goto yyexhaustedlab
;
1401 /* Extend the stack our own way. */
1402 if (YYMAXDEPTH
<= yystacksize
)
1403 goto yyexhaustedlab
;
1405 if (YYMAXDEPTH
< yystacksize
)
1406 yystacksize
= YYMAXDEPTH
;
1409 yytype_int16
*yyss1
= yyss
;
1410 union yyalloc
*yyptr
=
1411 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1413 goto yyexhaustedlab
;
1414 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1415 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1416 # undef YYSTACK_RELOCATE
1418 YYSTACK_FREE (yyss1
);
1421 #endif /* no yyoverflow */
1423 yyssp
= yyss
+ yysize
- 1;
1424 yyvsp
= yyvs
+ yysize
- 1;
1426 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1427 (unsigned long int) yystacksize
));
1429 if (yyss
+ yystacksize
- 1 <= yyssp
)
1433 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1435 if (yystate
== YYFINAL
)
1445 /* Do appropriate processing given the current state. Read a
1446 lookahead token if we need one and don't already have one. */
1448 /* First try to decide what to do without reference to lookahead token. */
1449 yyn
= yypact
[yystate
];
1450 if (yyn
== YYPACT_NINF
)
1453 /* Not known => get a lookahead token if don't already have one. */
1455 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1456 if (yychar
== YYEMPTY
)
1458 YYDPRINTF ((stderr
, "Reading a token: "));
1462 if (yychar
<= YYEOF
)
1464 yychar
= yytoken
= YYEOF
;
1465 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1469 yytoken
= YYTRANSLATE (yychar
);
1470 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1473 /* If the proper action on seeing token YYTOKEN is to reduce or to
1474 detect an error, take that action. */
1476 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1481 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
1487 /* Count tokens shifted since error; after three, turn off error
1492 /* Shift the lookahead token. */
1493 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1495 /* Discard the shifted token. */
1504 /*-----------------------------------------------------------.
1505 | yydefault -- do the default action for the current state. |
1506 `-----------------------------------------------------------*/
1508 yyn
= yydefact
[yystate
];
1514 /*-----------------------------.
1515 | yyreduce -- Do a reduction. |
1516 `-----------------------------*/
1518 /* yyn is the number of a rule to reduce with. */
1521 /* If YYLEN is nonzero, implement the default value of the action:
1524 Otherwise, the following line sets YYVAL to garbage.
1525 This behavior is undocumented and Bison
1526 users should not rely upon it. Assigning to YYVAL
1527 unconditionally makes the parser a bit smaller, and it avoids a
1528 GCC warning that YYVAL may be used uninitialized. */
1529 yyval
= yyvsp
[1-yylen
];
1532 YY_REDUCE_PRINT (yyn
);
1537 /* Line 1464 of yacc.c */
1538 #line 178 "libmemcached/csl/parser.yy"
1544 /* Line 1464 of yacc.c */
1545 #line 180 "libmemcached/csl/parser.yy"
1551 /* Line 1464 of yacc.c */
1552 #line 182 "libmemcached/csl/parser.yy"
1558 /* Line 1464 of yacc.c */
1559 #line 184 "libmemcached/csl/parser.yy"
1568 /* Line 1464 of yacc.c */
1569 #line 189 "libmemcached/csl/parser.yy"
1571 context
->rc
= MEMCACHED_PARSE_USER_ERROR
;
1572 parser_abort(context
, NULL
);
1578 /* Line 1464 of yacc.c */
1579 #line 194 "libmemcached/csl/parser.yy"
1581 memcached_reset(context
->memc
);
1587 /* Line 1464 of yacc.c */
1588 #line 198 "libmemcached/csl/parser.yy"
1596 /* Line 1464 of yacc.c */
1597 #line 202 "libmemcached/csl/parser.yy"
1599 if ((context
->rc
= memcached_parse_configure_file(*context
->memc
, (yyvsp
[(3) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].string
).size
)) != MEMCACHED_SUCCESS
)
1601 parser_abort(context
, NULL
);
1608 /* Line 1464 of yacc.c */
1609 #line 213 "libmemcached/csl/parser.yy"
1611 if (memcached_failed(context
->rc
= memcached_server_add_with_weight(context
->memc
, (yyvsp
[(2) - (4)].server
).c_str
, (yyvsp
[(3) - (4)].number
), (yyvsp
[(4) - (4)].number
))))
1613 parser_abort(context
, NULL
);
1615 context
->unset_server();
1621 /* Line 1464 of yacc.c */
1622 #line 221 "libmemcached/csl/parser.yy"
1624 if (memcached_failed(context
->rc
= memcached_server_add_with_weight(context
->memc
, (yyvsp
[(2) - (4)].server
).c_str
, (yyvsp
[(3) - (4)].number
), (yyvsp
[(4) - (4)].number
))))
1626 parser_abort(context
, NULL
);
1628 context
->unset_server();
1634 /* Line 1464 of yacc.c */
1635 #line 229 "libmemcached/csl/parser.yy"
1637 if (memcached_failed(context
->rc
= memcached_server_add_unix_socket_with_weight(context
->memc
, (yyvsp
[(2) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].number
))))
1639 parser_abort(context
, NULL
);
1646 /* Line 1464 of yacc.c */
1647 #line 236 "libmemcached/csl/parser.yy"
1649 memcached_set_configuration_file(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
);
1655 /* Line 1464 of yacc.c */
1656 #line 240 "libmemcached/csl/parser.yy"
1658 context
->memc
->configure
.initial_pool_size
= (yyvsp
[(2) - (2)].number
);
1664 /* Line 1464 of yacc.c */
1665 #line 244 "libmemcached/csl/parser.yy"
1667 context
->memc
->configure
.max_pool_size
= (yyvsp
[(2) - (2)].number
);
1673 /* Line 1464 of yacc.c */
1674 #line 252 "libmemcached/csl/parser.yy"
1676 if ((context
->rc
= memcached_set_namespace(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
)) != MEMCACHED_SUCCESS
)
1678 parser_abort(context
, NULL
);;
1685 /* Line 1464 of yacc.c */
1686 #line 259 "libmemcached/csl/parser.yy"
1688 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1690 parser_abort(context
, NULL
);;
1697 /* Line 1464 of yacc.c */
1698 #line 266 "libmemcached/csl/parser.yy"
1700 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (4)].distribution
))) != MEMCACHED_SUCCESS
)
1702 parser_abort(context
, NULL
);;
1704 if ((context
->rc
= memcached_behavior_set_distribution_hash(context
->memc
, (yyvsp
[(4) - (4)].hash
))) != MEMCACHED_SUCCESS
)
1706 parser_abort(context
, NULL
);;
1713 /* Line 1464 of yacc.c */
1714 #line 277 "libmemcached/csl/parser.yy"
1716 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_HASH
, (yyvsp
[(2) - (2)].hash
))) != MEMCACHED_SUCCESS
)
1718 parser_abort(context
, NULL
);;
1725 /* Line 1464 of yacc.c */
1726 #line 284 "libmemcached/csl/parser.yy"
1728 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (2)].behavior
), (yyvsp
[(2) - (2)].number
))) != MEMCACHED_SUCCESS
)
1730 parser_abort(context
, NULL
);;
1737 /* Line 1464 of yacc.c */
1738 #line 291 "libmemcached/csl/parser.yy"
1740 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (1)].behavior
), true)) != MEMCACHED_SUCCESS
)
1742 parser_abort(context
, NULL
);;
1749 /* Line 1464 of yacc.c */
1750 #line 298 "libmemcached/csl/parser.yy"
1757 /* Line 1464 of yacc.c */
1758 #line 304 "libmemcached/csl/parser.yy"
1760 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS
;
1766 /* Line 1464 of yacc.c */
1767 #line 308 "libmemcached/csl/parser.yy"
1769 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
;
1775 /* Line 1464 of yacc.c */
1776 #line 312 "libmemcached/csl/parser.yy"
1778 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
;
1784 /* Line 1464 of yacc.c */
1785 #line 316 "libmemcached/csl/parser.yy"
1787 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
;
1793 /* Line 1464 of yacc.c */
1794 #line 320 "libmemcached/csl/parser.yy"
1796 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
;
1802 /* Line 1464 of yacc.c */
1803 #line 324 "libmemcached/csl/parser.yy"
1805 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
;
1811 /* Line 1464 of yacc.c */
1812 #line 328 "libmemcached/csl/parser.yy"
1814 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT
;
1820 /* Line 1464 of yacc.c */
1821 #line 332 "libmemcached/csl/parser.yy"
1823 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT
;
1829 /* Line 1464 of yacc.c */
1830 #line 336 "libmemcached/csl/parser.yy"
1832 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
;
1838 /* Line 1464 of yacc.c */
1839 #line 340 "libmemcached/csl/parser.yy"
1841 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SND_TIMEOUT
;
1847 /* Line 1464 of yacc.c */
1848 #line 344 "libmemcached/csl/parser.yy"
1850 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
;
1856 /* Line 1464 of yacc.c */
1857 #line 348 "libmemcached/csl/parser.yy"
1859 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
;
1865 /* Line 1464 of yacc.c */
1866 #line 355 "libmemcached/csl/parser.yy"
1868 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
;
1874 /* Line 1464 of yacc.c */
1875 #line 359 "libmemcached/csl/parser.yy"
1877 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
;
1883 /* Line 1464 of yacc.c */
1884 #line 363 "libmemcached/csl/parser.yy"
1886 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
;
1892 /* Line 1464 of yacc.c */
1893 #line 367 "libmemcached/csl/parser.yy"
1895 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NOREPLY
;
1901 /* Line 1464 of yacc.c */
1902 #line 371 "libmemcached/csl/parser.yy"
1904 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
;
1910 /* Line 1464 of yacc.c */
1911 #line 375 "libmemcached/csl/parser.yy"
1913 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SORT_HOSTS
;
1919 /* Line 1464 of yacc.c */
1920 #line 379 "libmemcached/csl/parser.yy"
1922 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SUPPORT_CAS
;
1928 /* Line 1464 of yacc.c */
1929 #line 383 "libmemcached/csl/parser.yy"
1931 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_NODELAY
;
1937 /* Line 1464 of yacc.c */
1938 #line 387 "libmemcached/csl/parser.yy"
1940 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
;
1946 /* Line 1464 of yacc.c */
1947 #line 391 "libmemcached/csl/parser.yy"
1949 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE
;
1955 /* Line 1464 of yacc.c */
1956 #line 395 "libmemcached/csl/parser.yy"
1958 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_USE_UDP
;
1964 /* Line 1464 of yacc.c */
1965 #line 399 "libmemcached/csl/parser.yy"
1967 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_VERIFY_KEY
;
1973 /* Line 1464 of yacc.c */
1974 #line 405 "libmemcached/csl/parser.yy"
1975 { (yyval
.number
)= MEMCACHED_DEFAULT_PORT
;;}
1980 /* Line 1464 of yacc.c */
1981 #line 407 "libmemcached/csl/parser.yy"
1987 /* Line 1464 of yacc.c */
1988 #line 411 "libmemcached/csl/parser.yy"
1989 { (yyval
.number
)= 1; ;}
1994 /* Line 1464 of yacc.c */
1995 #line 413 "libmemcached/csl/parser.yy"
2001 /* Line 1464 of yacc.c */
2002 #line 418 "libmemcached/csl/parser.yy"
2004 (yyval
.hash
)= MEMCACHED_HASH_MD5
;
2010 /* Line 1464 of yacc.c */
2011 #line 422 "libmemcached/csl/parser.yy"
2013 (yyval
.hash
)= MEMCACHED_HASH_CRC
;
2019 /* Line 1464 of yacc.c */
2020 #line 426 "libmemcached/csl/parser.yy"
2022 (yyval
.hash
)= MEMCACHED_HASH_FNV1_64
;
2028 /* Line 1464 of yacc.c */
2029 #line 430 "libmemcached/csl/parser.yy"
2031 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_64
;
2037 /* Line 1464 of yacc.c */
2038 #line 434 "libmemcached/csl/parser.yy"
2040 (yyval
.hash
)= MEMCACHED_HASH_FNV1_32
;
2046 /* Line 1464 of yacc.c */
2047 #line 438 "libmemcached/csl/parser.yy"
2049 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_32
;
2055 /* Line 1464 of yacc.c */
2056 #line 442 "libmemcached/csl/parser.yy"
2058 (yyval
.hash
)= MEMCACHED_HASH_HSIEH
;
2064 /* Line 1464 of yacc.c */
2065 #line 446 "libmemcached/csl/parser.yy"
2067 (yyval
.hash
)= MEMCACHED_HASH_MURMUR
;
2073 /* Line 1464 of yacc.c */
2074 #line 450 "libmemcached/csl/parser.yy"
2076 (yyval
.hash
)= MEMCACHED_HASH_JENKINS
;
2082 /* Line 1464 of yacc.c */
2083 #line 457 "libmemcached/csl/parser.yy"
2085 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2091 /* Line 1464 of yacc.c */
2092 #line 461 "libmemcached/csl/parser.yy"
2094 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2100 /* Line 1464 of yacc.c */
2101 #line 468 "libmemcached/csl/parser.yy"
2103 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_CONSISTENT
;
2109 /* Line 1464 of yacc.c */
2110 #line 472 "libmemcached/csl/parser.yy"
2112 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_MODULA
;
2118 /* Line 1464 of yacc.c */
2119 #line 476 "libmemcached/csl/parser.yy"
2121 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_RANDOM
;
2127 /* Line 1464 of yacc.c */
2128 #line 2129 "libmemcached/csl/parser.cc"
2131 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2135 YY_STACK_PRINT (yyss
, yyssp
);
2139 /* Now `shift' the result of the reduction. Determine what state
2140 that goes to, based on the state we popped back to and the rule
2141 number reduced by. */
2145 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2146 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2147 yystate
= yytable
[yystate
];
2149 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2154 /*------------------------------------.
2155 | yyerrlab -- here on detecting error |
2156 `------------------------------------*/
2158 /* If not already recovering from an error, report this error. */
2162 #if ! YYERROR_VERBOSE
2163 yyerror (context
, scanner
, YY_("syntax error"));
2166 YYSIZE_T yysize
= yysyntax_error (0, yystate
, yychar
);
2167 if (yymsg_alloc
< yysize
&& yymsg_alloc
< YYSTACK_ALLOC_MAXIMUM
)
2169 YYSIZE_T yyalloc
= 2 * yysize
;
2170 if (! (yysize
<= yyalloc
&& yyalloc
<= YYSTACK_ALLOC_MAXIMUM
))
2171 yyalloc
= YYSTACK_ALLOC_MAXIMUM
;
2172 if (yymsg
!= yymsgbuf
)
2173 YYSTACK_FREE (yymsg
);
2174 yymsg
= (char *) YYSTACK_ALLOC (yyalloc
);
2176 yymsg_alloc
= yyalloc
;
2180 yymsg_alloc
= sizeof yymsgbuf
;
2184 if (0 < yysize
&& yysize
<= yymsg_alloc
)
2186 (void) yysyntax_error (yymsg
, yystate
, yychar
);
2187 yyerror (context
, scanner
, yymsg
);
2191 yyerror (context
, scanner
, YY_("syntax error"));
2193 goto yyexhaustedlab
;
2201 if (yyerrstatus
== 3)
2203 /* If just tried and failed to reuse lookahead token after an
2204 error, discard it. */
2206 if (yychar
<= YYEOF
)
2208 /* Return failure if at end of input. */
2209 if (yychar
== YYEOF
)
2214 yydestruct ("Error: discarding",
2215 yytoken
, &yylval
, context
, scanner
);
2220 /* Else will try to reuse lookahead token after shifting the error
2225 /*---------------------------------------------------.
2226 | yyerrorlab -- error raised explicitly by YYERROR. |
2227 `---------------------------------------------------*/
2230 /* Pacify compilers like GCC when the user code never invokes
2231 YYERROR and the label yyerrorlab therefore never appears in user
2233 if (/*CONSTCOND*/ 0)
2236 /* Do not reclaim the symbols of the rule which action triggered
2240 YY_STACK_PRINT (yyss
, yyssp
);
2245 /*-------------------------------------------------------------.
2246 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2247 `-------------------------------------------------------------*/
2249 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2253 yyn
= yypact
[yystate
];
2254 if (yyn
!= YYPACT_NINF
)
2257 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2265 /* Pop the current state because it cannot handle the error token. */
2270 yydestruct ("Error: popping",
2271 yystos
[yystate
], yyvsp
, context
, scanner
);
2274 YY_STACK_PRINT (yyss
, yyssp
);
2280 /* Shift the error token. */
2281 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2287 /*-------------------------------------.
2288 | yyacceptlab -- YYACCEPT comes here. |
2289 `-------------------------------------*/
2294 /*-----------------------------------.
2295 | yyabortlab -- YYABORT comes here. |
2296 `-----------------------------------*/
2301 #if !defined(yyoverflow) || YYERROR_VERBOSE
2302 /*-------------------------------------------------.
2303 | yyexhaustedlab -- memory exhaustion comes here. |
2304 `-------------------------------------------------*/
2306 yyerror (context
, scanner
, YY_("memory exhausted"));
2312 if (yychar
!= YYEMPTY
)
2313 yydestruct ("Cleanup: discarding lookahead",
2314 yytoken
, &yylval
, context
, scanner
);
2315 /* Do not reclaim the symbols of the rule which action triggered
2316 this YYABORT or YYACCEPT. */
2318 YY_STACK_PRINT (yyss
, yyssp
);
2319 while (yyssp
!= yyss
)
2321 yydestruct ("Cleanup: popping",
2322 yystos
[*yyssp
], yyvsp
, context
, scanner
);
2327 YYSTACK_FREE (yyss
);
2330 if (yymsg
!= yymsgbuf
)
2331 YYSTACK_FREE (yymsg
);
2333 /* Make sure YYID is used. */
2334 return YYID (yyresult
);
2339 /* Line 1684 of yacc.c */
2340 #line 481 "libmemcached/csl/parser.yy"
2343 void Context::start()
2345 config_parse(this, (void **)scanner
);