Fix UUID and issue on older Debian systems.
[awesomized/libmemcached] / libmemcached / csl / parser.cc
1 /* A Bison parser, made by GNU Bison 2.5. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
6
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
29
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
35
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
42
43 /* Identify Bison output. */
44 #define YYBISON 1
45
46 /* Bison version. */
47 #define YYBISON_VERSION "2.5"
48
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers. */
53 #define YYPURE 1
54
55 /* Push parsers. */
56 #define YYPUSH 0
57
58 /* Pull parsers. */
59 #define YYPULL 1
60
61 /* Using locations. */
62 #define YYLSP_NEEDED 0
63
64 /* Substitute the variable and function names. */
65 #define yyparse config_parse
66 #define yylex config_lex
67 #define yyerror config_error
68 #define yylval config_lval
69 #define yychar config_char
70 #define yydebug config_debug
71 #define yynerrs config_nerrs
72
73
74 /* Copy the first part of user declarations. */
75
76 /* Line 268 of yacc.c */
77 #line 52 "libmemcached/csl/parser.yy"
78
79
80 #include <libmemcached/csl/common.h>
81 #include <libmemcached/options.hpp>
82
83 #include <libmemcached/csl/context.h>
84 #include <libmemcached/csl/symbol.h>
85 #include <libmemcached/csl/scanner.h>
86
87 #ifndef __INTEL_COMPILER
88 #pragma GCC diagnostic ignored "-Wold-style-cast"
89 #endif
90
91 #ifndef __INTEL_COMPILER
92 #pragma GCC diagnostic ignored "-Wlogical-op"
93 #endif
94
95 int conf_lex(YYSTYPE* lvalp, void* scanner);
96
97 #define select_yychar(__context) yychar == UNKNOWN ? ( (__context)->previous_token == END ? UNKNOWN : (__context)->previous_token ) : yychar
98
99 #define stryytname(__yytokentype) ((__yytokentype) < YYNTOKENS ) ? yytname[(__yytokentype)] : ""
100
101 #define parser_abort(__context, __error_message) do { (__context)->abort((__error_message), yytokentype(select_yychar(__context)), stryytname(YYTRANSLATE(select_yychar(__context)))); YYABORT; } while (0)
102
103 // This is bison calling error.
104 inline void __config_error(Context *context, yyscan_t *scanner, const char *error, int last_token, const char *last_token_str)
105 {
106 if (not context->end())
107 {
108 context->error(error, yytokentype(last_token), last_token_str);
109 }
110 else
111 {
112 context->error(error, yytokentype(last_token), last_token_str);
113 }
114 }
115
116 #define config_error(__context, __scanner, __error_msg) do { __config_error((__context), (__scanner), (__error_msg), select_yychar(__context), stryytname(YYTRANSLATE(select_yychar(__context)))); } while (0)
117
118
119
120
121 /* Line 268 of yacc.c */
122 #line 123 "libmemcached/csl/parser.cc"
123
124 /* Enabling traces. */
125 #ifndef YYDEBUG
126 # define YYDEBUG 1
127 #endif
128
129 /* Enabling verbose error messages. */
130 #ifdef YYERROR_VERBOSE
131 # undef YYERROR_VERBOSE
132 # define YYERROR_VERBOSE 1
133 #else
134 # define YYERROR_VERBOSE 1
135 #endif
136
137 /* Enabling the token table. */
138 #ifndef YYTOKEN_TABLE
139 # define YYTOKEN_TABLE 0
140 #endif
141
142
143 /* Tokens. */
144 #ifndef YYTOKENTYPE
145 # define YYTOKENTYPE
146 /* Put the tokens into the symbol table, so that GDB and other debuggers
147 know about them. */
148 enum yytokentype {
149 COMMENT = 258,
150 END = 259,
151 ERROR = 260,
152 RESET = 261,
153 PARSER_DEBUG = 262,
154 INCLUDE = 263,
155 CONFIGURE_FILE = 264,
156 EMPTY_LINE = 265,
157 SERVER = 266,
158 SOCKET = 267,
159 SERVERS = 268,
160 SERVERS_OPTION = 269,
161 UNKNOWN_OPTION = 270,
162 UNKNOWN = 271,
163 BINARY_PROTOCOL = 272,
164 BUFFER_REQUESTS = 273,
165 CONNECT_TIMEOUT = 274,
166 DISTRIBUTION = 275,
167 HASH = 276,
168 HASH_WITH_NAMESPACE = 277,
169 IO_BYTES_WATERMARK = 278,
170 IO_KEY_PREFETCH = 279,
171 IO_MSG_WATERMARK = 280,
172 KETAMA_HASH = 281,
173 KETAMA_WEIGHTED = 282,
174 NOREPLY = 283,
175 NUMBER_OF_REPLICAS = 284,
176 POLL_TIMEOUT = 285,
177 RANDOMIZE_REPLICA_READ = 286,
178 RCV_TIMEOUT = 287,
179 REMOVE_FAILED_SERVERS = 288,
180 RETRY_TIMEOUT = 289,
181 SND_TIMEOUT = 290,
182 SOCKET_RECV_SIZE = 291,
183 SOCKET_SEND_SIZE = 292,
184 SORT_HOSTS = 293,
185 SUPPORT_CAS = 294,
186 USER_DATA = 295,
187 USE_UDP = 296,
188 VERIFY_KEY = 297,
189 _TCP_KEEPALIVE = 298,
190 _TCP_KEEPIDLE = 299,
191 _TCP_NODELAY = 300,
192 FETCH_VERSION = 301,
193 NAMESPACE = 302,
194 POOL_MIN = 303,
195 POOL_MAX = 304,
196 MD5 = 305,
197 CRC = 306,
198 FNV1_64 = 307,
199 FNV1A_64 = 308,
200 FNV1_32 = 309,
201 FNV1A_32 = 310,
202 HSIEH = 311,
203 MURMUR = 312,
204 JENKINS = 313,
205 CONSISTENT = 314,
206 MODULA = 315,
207 RANDOM = 316,
208 TRUE = 317,
209 FALSE = 318,
210 FLOAT = 319,
211 NUMBER = 320,
212 PORT = 321,
213 WEIGHT_START = 322,
214 IPADDRESS = 323,
215 HOSTNAME = 324,
216 STRING = 325,
217 QUOTED_STRING = 326,
218 FILE_PATH = 327
219 };
220 #endif
221
222
223
224 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
225
226 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
227 # define YYSTYPE_IS_DECLARED 1
228 #endif
229
230
231 /* Copy the second part of user declarations. */
232
233
234 /* Line 343 of yacc.c */
235 #line 236 "libmemcached/csl/parser.cc"
236
237 #ifdef short
238 # undef short
239 #endif
240
241 #ifdef YYTYPE_UINT8
242 typedef YYTYPE_UINT8 yytype_uint8;
243 #else
244 typedef unsigned char yytype_uint8;
245 #endif
246
247 #ifdef YYTYPE_INT8
248 typedef YYTYPE_INT8 yytype_int8;
249 #elif (defined __STDC__ || defined __C99__FUNC__ \
250 || defined __cplusplus || defined _MSC_VER)
251 typedef signed char yytype_int8;
252 #else
253 typedef short int yytype_int8;
254 #endif
255
256 #ifdef YYTYPE_UINT16
257 typedef YYTYPE_UINT16 yytype_uint16;
258 #else
259 typedef unsigned short int yytype_uint16;
260 #endif
261
262 #ifdef YYTYPE_INT16
263 typedef YYTYPE_INT16 yytype_int16;
264 #else
265 typedef short int yytype_int16;
266 #endif
267
268 #ifndef YYSIZE_T
269 # ifdef __SIZE_TYPE__
270 # define YYSIZE_T __SIZE_TYPE__
271 # elif defined size_t
272 # define YYSIZE_T size_t
273 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
274 || defined __cplusplus || defined _MSC_VER)
275 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
276 # define YYSIZE_T size_t
277 # else
278 # define YYSIZE_T unsigned int
279 # endif
280 #endif
281
282 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
283
284 #ifndef YY_
285 # if defined YYENABLE_NLS && YYENABLE_NLS
286 # if ENABLE_NLS
287 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
288 # define YY_(msgid) dgettext ("bison-runtime", msgid)
289 # endif
290 # endif
291 # ifndef YY_
292 # define YY_(msgid) msgid
293 # endif
294 #endif
295
296 /* Suppress unused-variable warnings by "using" E. */
297 #if ! defined lint || defined __GNUC__
298 # define YYUSE(e) ((void) (e))
299 #else
300 # define YYUSE(e) /* empty */
301 #endif
302
303 /* Identity function, used to suppress warnings about constant conditions. */
304 #ifndef lint
305 # define YYID(n) (n)
306 #else
307 #if (defined __STDC__ || defined __C99__FUNC__ \
308 || defined __cplusplus || defined _MSC_VER)
309 static int
310 YYID (int yyi)
311 #else
312 static int
313 YYID (yyi)
314 int yyi;
315 #endif
316 {
317 return yyi;
318 }
319 #endif
320
321 #if ! defined yyoverflow || YYERROR_VERBOSE
322
323 /* The parser invokes alloca or malloc; define the necessary symbols. */
324
325 # ifdef YYSTACK_USE_ALLOCA
326 # if YYSTACK_USE_ALLOCA
327 # ifdef __GNUC__
328 # define YYSTACK_ALLOC __builtin_alloca
329 # elif defined __BUILTIN_VA_ARG_INCR
330 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
331 # elif defined _AIX
332 # define YYSTACK_ALLOC __alloca
333 # elif defined _MSC_VER
334 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
335 # define alloca _alloca
336 # else
337 # define YYSTACK_ALLOC alloca
338 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
339 || defined __cplusplus || defined _MSC_VER)
340 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
341 # ifndef EXIT_SUCCESS
342 # define EXIT_SUCCESS 0
343 # endif
344 # endif
345 # endif
346 # endif
347 # endif
348
349 # ifdef YYSTACK_ALLOC
350 /* Pacify GCC's `empty if-body' warning. */
351 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
352 # ifndef YYSTACK_ALLOC_MAXIMUM
353 /* The OS might guarantee only one guard page at the bottom of the stack,
354 and a page size can be as small as 4096 bytes. So we cannot safely
355 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
356 to allow for a few compiler-allocated temporary stack slots. */
357 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
358 # endif
359 # else
360 # define YYSTACK_ALLOC YYMALLOC
361 # define YYSTACK_FREE YYFREE
362 # ifndef YYSTACK_ALLOC_MAXIMUM
363 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
364 # endif
365 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
366 && ! ((defined YYMALLOC || defined malloc) \
367 && (defined YYFREE || defined free)))
368 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
369 # ifndef EXIT_SUCCESS
370 # define EXIT_SUCCESS 0
371 # endif
372 # endif
373 # ifndef YYMALLOC
374 # define YYMALLOC malloc
375 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
376 || defined __cplusplus || defined _MSC_VER)
377 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
378 # endif
379 # endif
380 # ifndef YYFREE
381 # define YYFREE free
382 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
383 || defined __cplusplus || defined _MSC_VER)
384 void free (void *); /* INFRINGES ON USER NAME SPACE */
385 # endif
386 # endif
387 # endif
388 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
389
390
391 #if (! defined yyoverflow \
392 && (! defined __cplusplus \
393 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
394
395 /* A type that is properly aligned for any stack member. */
396 union yyalloc
397 {
398 yytype_int16 yyss_alloc;
399 YYSTYPE yyvs_alloc;
400 };
401
402 /* The size of the maximum gap between one aligned stack and the next. */
403 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
404
405 /* The size of an array large to enough to hold all stacks, each with
406 N elements. */
407 # define YYSTACK_BYTES(N) \
408 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
409 + YYSTACK_GAP_MAXIMUM)
410
411 # define YYCOPY_NEEDED 1
412
413 /* Relocate STACK from its old location to the new one. The
414 local variables YYSIZE and YYSTACKSIZE give the old and new number of
415 elements in the stack, and YYPTR gives the new location of the
416 stack. Advance YYPTR to a properly aligned location for the next
417 stack. */
418 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
419 do \
420 { \
421 YYSIZE_T yynewbytes; \
422 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
423 Stack = &yyptr->Stack_alloc; \
424 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
425 yyptr += yynewbytes / sizeof (*yyptr); \
426 } \
427 while (YYID (0))
428
429 #endif
430
431 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
432 /* Copy COUNT objects from FROM to TO. The source and destination do
433 not overlap. */
434 # ifndef YYCOPY
435 # if defined __GNUC__ && 1 < __GNUC__
436 # define YYCOPY(To, From, Count) \
437 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
438 # else
439 # define YYCOPY(To, From, Count) \
440 do \
441 { \
442 YYSIZE_T yyi; \
443 for (yyi = 0; yyi < (Count); yyi++) \
444 (To)[yyi] = (From)[yyi]; \
445 } \
446 while (YYID (0))
447 # endif
448 # endif
449 #endif /* !YYCOPY_NEEDED */
450
451 /* YYFINAL -- State number of the termination state. */
452 #define YYFINAL 72
453 /* YYLAST -- Last index in YYTABLE. */
454 #define YYLAST 75
455
456 /* YYNTOKENS -- Number of terminals. */
457 #define YYNTOKENS 76
458 /* YYNNTS -- Number of nonterminals. */
459 #define YYNNTS 12
460 /* YYNRULES -- Number of rules. */
461 #define YYNRULES 68
462 /* YYNRULES -- Number of states. */
463 #define YYNSTATES 86
464
465 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
466 #define YYUNDEFTOK 2
467 #define YYMAXUTOK 327
468
469 #define YYTRANSLATE(YYX) \
470 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
471
472 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
473 static const yytype_uint8 yytranslate[] =
474 {
475 0, 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, 75, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 2, 64, 2, 2, 2, 2, 2,
480 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
481 2, 65, 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, 2, 2, 2, 2,
493 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
494 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
495 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
497 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
498 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
499 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
500 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
501 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
502 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
503 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
504 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
505 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
506 55, 56, 57, 58, 59, 60, 61, 62, 63, 66,
507 67, 68, 69, 70, 71, 72, 73, 74
508 };
509
510 #if YYDEBUG
511 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
512 YYRHS. */
513 static const yytype_uint8 yyprhs[] =
514 {
515 0, 0, 3, 5, 9, 11, 13, 15, 17, 19,
516 21, 23, 27, 32, 37, 41, 44, 47, 50, 52,
517 55, 57, 60, 65, 68, 71, 73, 75, 77, 79,
518 81, 83, 85, 87, 89, 91, 93, 95, 97, 99,
519 101, 103, 105, 107, 109, 111, 113, 115, 117, 119,
520 121, 123, 124, 126, 127, 129, 131, 133, 135, 137,
521 139, 141, 143, 145, 147, 149, 151, 153, 155
522 };
523
524 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
525 static const yytype_int8 yyrhs[] =
526 {
527 77, 0, -1, 78, -1, 77, 75, 78, -1, 79,
528 -1, 3, -1, 10, -1, 4, -1, 5, -1, 6,
529 -1, 7, -1, 8, 75, 86, -1, 11, 71, 83,
530 84, -1, 11, 70, 83, 84, -1, 12, 86, 84,
531 -1, 9, 86, -1, 48, 67, -1, 49, 67, -1,
532 80, -1, 47, 86, -1, 46, -1, 20, 87, -1,
533 20, 87, 64, 85, -1, 21, 85, -1, 81, 67,
534 -1, 82, -1, 40, -1, 33, -1, 19, -1, 25,
535 -1, 23, -1, 24, -1, 29, -1, 30, -1, 32,
536 -1, 34, -1, 35, -1, 36, -1, 37, -1, 17,
537 -1, 18, -1, 22, -1, 28, -1, 31, -1, 38,
538 -1, 39, -1, 45, -1, 43, -1, 44, -1, 41,
539 -1, 42, -1, -1, 68, -1, -1, 69, -1, 50,
540 -1, 51, -1, 52, -1, 53, -1, 54, -1, 55,
541 -1, 56, -1, 57, -1, 58, -1, 72, -1, 73,
542 -1, 59, -1, 60, -1, 61, -1
543 };
544
545 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
546 static const yytype_uint16 yyrline[] =
547 {
548 0, 193, 193, 194, 198, 200, 202, 204, 209, 214,
549 218, 222, 233, 243, 253, 262, 266, 270, 274, 278,
550 290, 294, 307, 320, 327, 334, 343, 349, 353, 357,
551 361, 365, 369, 373, 377, 381, 385, 389, 393, 400,
552 404, 408, 412, 416, 420, 424, 428, 432, 436, 440,
553 444, 451, 452, 457, 458, 463, 467, 471, 475, 479,
554 483, 487, 491, 495, 502, 506, 513, 517, 521
555 };
556 #endif
557
558 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
559 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
560 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
561 static const char *const yytname[] =
562 {
563 "$end", "error", "$undefined", "COMMENT", "END", "ERROR", "RESET",
564 "PARSER_DEBUG", "INCLUDE", "CONFIGURE_FILE", "EMPTY_LINE", "SERVER",
565 "SOCKET", "SERVERS", "SERVERS_OPTION", "UNKNOWN_OPTION", "UNKNOWN",
566 "BINARY_PROTOCOL", "BUFFER_REQUESTS", "CONNECT_TIMEOUT", "DISTRIBUTION",
567 "HASH", "HASH_WITH_NAMESPACE", "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH",
568 "IO_MSG_WATERMARK", "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY",
569 "NUMBER_OF_REPLICAS", "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ",
570 "RCV_TIMEOUT", "REMOVE_FAILED_SERVERS", "RETRY_TIMEOUT", "SND_TIMEOUT",
571 "SOCKET_RECV_SIZE", "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS",
572 "USER_DATA", "USE_UDP", "VERIFY_KEY", "_TCP_KEEPALIVE", "_TCP_KEEPIDLE",
573 "_TCP_NODELAY", "FETCH_VERSION", "NAMESPACE", "POOL_MIN", "POOL_MAX",
574 "MD5", "CRC", "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32", "HSIEH",
575 "MURMUR", "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE", "FALSE",
576 "','", "'='", "FLOAT", "NUMBER", "PORT", "WEIGHT_START", "IPADDRESS",
577 "HOSTNAME", "STRING", "QUOTED_STRING", "FILE_PATH", "' '", "$accept",
578 "begin", "statement", "expression", "behaviors", "behavior_number",
579 "behavior_boolean", "optional_port", "optional_weight", "hash", "string",
580 "distribution", 0
581 };
582 #endif
583
584 # ifdef YYPRINT
585 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
586 token YYLEX-NUM. */
587 static const yytype_uint16 yytoknum[] =
588 {
589 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
590 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
591 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
592 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
593 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
594 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
595 315, 316, 317, 318, 44, 61, 319, 320, 321, 322,
596 323, 324, 325, 326, 327, 32
597 };
598 # endif
599
600 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
601 static const yytype_uint8 yyr1[] =
602 {
603 0, 76, 77, 77, 78, 78, 78, 78, 78, 78,
604 78, 78, 79, 79, 79, 79, 79, 79, 79, 80,
605 80, 80, 80, 80, 80, 80, 80, 81, 81, 81,
606 81, 81, 81, 81, 81, 81, 81, 81, 81, 82,
607 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
608 82, 83, 83, 84, 84, 85, 85, 85, 85, 85,
609 85, 85, 85, 85, 86, 86, 87, 87, 87
610 };
611
612 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
613 static const yytype_uint8 yyr2[] =
614 {
615 0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
616 1, 3, 4, 4, 3, 2, 2, 2, 1, 2,
617 1, 2, 4, 2, 2, 1, 1, 1, 1, 1,
618 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
619 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
620 1, 0, 1, 0, 1, 1, 1, 1, 1, 1,
621 1, 1, 1, 1, 1, 1, 1, 1, 1
622 };
623
624 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
625 Performed when YYTABLE doesn't specify something else to do. Zero
626 means the default is an error. */
627 static const yytype_uint8 yydefact[] =
628 {
629 0, 5, 7, 8, 9, 10, 0, 0, 6, 0,
630 0, 39, 40, 28, 0, 0, 41, 30, 31, 29,
631 42, 32, 33, 43, 34, 27, 35, 36, 37, 38,
632 44, 45, 26, 49, 50, 47, 48, 46, 20, 0,
633 0, 0, 0, 2, 4, 18, 0, 25, 0, 64,
634 65, 15, 51, 51, 53, 66, 67, 68, 21, 55,
635 56, 57, 58, 59, 60, 61, 62, 63, 23, 19,
636 16, 17, 1, 0, 24, 11, 52, 53, 53, 54,
637 14, 0, 3, 13, 12, 22
638 };
639
640 /* YYDEFGOTO[NTERM-NUM]. */
641 static const yytype_int8 yydefgoto[] =
642 {
643 -1, 42, 43, 44, 45, 46, 47, 77, 80, 68,
644 51, 58
645 };
646
647 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
648 STATE-NUM. */
649 #define YYPACT_NINF -62
650 static const yytype_int8 yypact[] =
651 {
652 -2, -62, -62, -62, -62, -62, -61, -24, -62, -20,
653 -24, -62, -62, -62, -48, 13, -62, -62, -62, -62,
654 -62, -62, -62, -62, -62, -62, -62, -62, -62, -62,
655 -62, -62, -62, -62, -62, -62, -62, -62, -62, -24,
656 -42, -15, 0, -62, -62, -62, -11, -62, -24, -62,
657 -62, -62, -10, -10, -12, -62, -62, -62, -5, -62,
658 -62, -62, -62, -62, -62, -62, -62, -62, -62, -62,
659 -62, -62, -62, -2, -62, -62, -62, -12, -12, -62,
660 -62, 13, -62, -62, -62, -62
661 };
662
663 /* YYPGOTO[NTERM-NUM]. */
664 static const yytype_int8 yypgoto[] =
665 {
666 -62, -62, -13, -62, -62, -62, -62, 8, -23, -9,
667 14, -62
668 };
669
670 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
671 positive, shift that token. If negative, reduce the rule which
672 number is the opposite. If YYTABLE_NINF, syntax error. */
673 #define YYTABLE_NINF -1
674 static const yytype_uint8 yytable[] =
675 {
676 72, 1, 2, 3, 4, 5, 6, 7, 8, 9,
677 10, 55, 56, 57, 48, 11, 12, 13, 14, 15,
678 16, 17, 18, 19, 54, 70, 20, 21, 22, 23,
679 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
680 34, 35, 36, 37, 38, 39, 40, 41, 49, 50,
681 52, 53, 71, 69, 83, 84, 74, 79, 76, 81,
682 82, 78, 75, 59, 60, 61, 62, 63, 64, 65,
683 66, 67, 85, 0, 0, 73
684 };
685
686 #define yypact_value_is_default(yystate) \
687 ((yystate) == (-62))
688
689 #define yytable_value_is_error(yytable_value) \
690 YYID (0)
691
692 static const yytype_int8 yycheck[] =
693 {
694 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
695 12, 59, 60, 61, 75, 17, 18, 19, 20, 21,
696 22, 23, 24, 25, 10, 67, 28, 29, 30, 31,
697 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
698 42, 43, 44, 45, 46, 47, 48, 49, 72, 73,
699 70, 71, 67, 39, 77, 78, 67, 69, 68, 64,
700 73, 53, 48, 50, 51, 52, 53, 54, 55, 56,
701 57, 58, 81, -1, -1, 75
702 };
703
704 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
705 symbol of state STATE-NUM. */
706 static const yytype_uint8 yystos[] =
707 {
708 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
709 12, 17, 18, 19, 20, 21, 22, 23, 24, 25,
710 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
711 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
712 48, 49, 77, 78, 79, 80, 81, 82, 75, 72,
713 73, 86, 70, 71, 86, 59, 60, 61, 87, 50,
714 51, 52, 53, 54, 55, 56, 57, 58, 85, 86,
715 67, 67, 0, 75, 67, 86, 68, 83, 83, 69,
716 84, 64, 78, 84, 84, 85
717 };
718
719 #define yyerrok (yyerrstatus = 0)
720 #define yyclearin (yychar = YYEMPTY)
721 #define YYEMPTY (-2)
722 #define YYEOF 0
723
724 #define YYACCEPT goto yyacceptlab
725 #define YYABORT goto yyabortlab
726 #define YYERROR goto yyerrorlab
727
728
729 /* Like YYERROR except do call yyerror. This remains here temporarily
730 to ease the transition to the new meaning of YYERROR, for GCC.
731 Once GCC version 2 has supplanted version 1, this can go. However,
732 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
733 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
734 discussed. */
735
736 #define YYFAIL goto yyerrlab
737 #if defined YYFAIL
738 /* This is here to suppress warnings from the GCC cpp's
739 -Wunused-macros. Normally we don't worry about that warning, but
740 some users do, and we want to make it easy for users to remove
741 YYFAIL uses, which will produce warnings from Bison 2.5. */
742 #endif
743
744 #define YYRECOVERING() (!!yyerrstatus)
745
746 #define YYBACKUP(Token, Value) \
747 do \
748 if (yychar == YYEMPTY && yylen == 1) \
749 { \
750 yychar = (Token); \
751 yylval = (Value); \
752 YYPOPSTACK (1); \
753 goto yybackup; \
754 } \
755 else \
756 { \
757 yyerror (context, scanner, YY_("syntax error: cannot back up")); \
758 YYERROR; \
759 } \
760 while (YYID (0))
761
762
763 #define YYTERROR 1
764 #define YYERRCODE 256
765
766
767 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
768 If N is 0, then set CURRENT to the empty location which ends
769 the previous symbol: RHS[0] (always defined). */
770
771 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
772 #ifndef YYLLOC_DEFAULT
773 # define YYLLOC_DEFAULT(Current, Rhs, N) \
774 do \
775 if (YYID (N)) \
776 { \
777 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
778 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
779 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
780 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
781 } \
782 else \
783 { \
784 (Current).first_line = (Current).last_line = \
785 YYRHSLOC (Rhs, 0).last_line; \
786 (Current).first_column = (Current).last_column = \
787 YYRHSLOC (Rhs, 0).last_column; \
788 } \
789 while (YYID (0))
790 #endif
791
792
793 /* This macro is provided for backward compatibility. */
794
795 #ifndef YY_LOCATION_PRINT
796 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
797 #endif
798
799
800 /* YYLEX -- calling `yylex' with the right arguments. */
801
802 #ifdef YYLEX_PARAM
803 # define YYLEX yylex (&yylval, YYLEX_PARAM)
804 #else
805 # define YYLEX yylex (&yylval, scanner)
806 #endif
807
808 /* Enable debugging if requested. */
809 #if YYDEBUG
810
811 # ifndef YYFPRINTF
812 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
813 # define YYFPRINTF fprintf
814 # endif
815
816 # define YYDPRINTF(Args) \
817 do { \
818 if (yydebug) \
819 YYFPRINTF Args; \
820 } while (YYID (0))
821
822 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
823 do { \
824 if (yydebug) \
825 { \
826 YYFPRINTF (stderr, "%s ", Title); \
827 yy_symbol_print (stderr, \
828 Type, Value, context, scanner); \
829 YYFPRINTF (stderr, "\n"); \
830 } \
831 } while (YYID (0))
832
833
834 /*--------------------------------.
835 | Print this symbol on YYOUTPUT. |
836 `--------------------------------*/
837
838 /*ARGSUSED*/
839 #if (defined __STDC__ || defined __C99__FUNC__ \
840 || defined __cplusplus || defined _MSC_VER)
841 static void
842 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, Context *context, yyscan_t *scanner)
843 #else
844 static void
845 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context, scanner)
846 FILE *yyoutput;
847 int yytype;
848 YYSTYPE const * const yyvaluep;
849 Context *context;
850 yyscan_t *scanner;
851 #endif
852 {
853 if (!yyvaluep)
854 return;
855 YYUSE (context);
856 YYUSE (scanner);
857 # ifdef YYPRINT
858 if (yytype < YYNTOKENS)
859 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
860 # else
861 YYUSE (yyoutput);
862 # endif
863 switch (yytype)
864 {
865 default:
866 break;
867 }
868 }
869
870
871 /*--------------------------------.
872 | Print this symbol on YYOUTPUT. |
873 `--------------------------------*/
874
875 #if (defined __STDC__ || defined __C99__FUNC__ \
876 || defined __cplusplus || defined _MSC_VER)
877 static void
878 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, Context *context, yyscan_t *scanner)
879 #else
880 static void
881 yy_symbol_print (yyoutput, yytype, yyvaluep, context, scanner)
882 FILE *yyoutput;
883 int yytype;
884 YYSTYPE const * const yyvaluep;
885 Context *context;
886 yyscan_t *scanner;
887 #endif
888 {
889 if (yytype < YYNTOKENS)
890 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
891 else
892 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
893
894 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context, scanner);
895 YYFPRINTF (yyoutput, ")");
896 }
897
898 /*------------------------------------------------------------------.
899 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
900 | TOP (included). |
901 `------------------------------------------------------------------*/
902
903 #if (defined __STDC__ || defined __C99__FUNC__ \
904 || defined __cplusplus || defined _MSC_VER)
905 static void
906 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
907 #else
908 static void
909 yy_stack_print (yybottom, yytop)
910 yytype_int16 *yybottom;
911 yytype_int16 *yytop;
912 #endif
913 {
914 YYFPRINTF (stderr, "Stack now");
915 for (; yybottom <= yytop; yybottom++)
916 {
917 int yybot = *yybottom;
918 YYFPRINTF (stderr, " %d", yybot);
919 }
920 YYFPRINTF (stderr, "\n");
921 }
922
923 # define YY_STACK_PRINT(Bottom, Top) \
924 do { \
925 if (yydebug) \
926 yy_stack_print ((Bottom), (Top)); \
927 } while (YYID (0))
928
929
930 /*------------------------------------------------.
931 | Report that the YYRULE is going to be reduced. |
932 `------------------------------------------------*/
933
934 #if (defined __STDC__ || defined __C99__FUNC__ \
935 || defined __cplusplus || defined _MSC_VER)
936 static void
937 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, Context *context, yyscan_t *scanner)
938 #else
939 static void
940 yy_reduce_print (yyvsp, yyrule, context, scanner)
941 YYSTYPE *yyvsp;
942 int yyrule;
943 Context *context;
944 yyscan_t *scanner;
945 #endif
946 {
947 int yynrhs = yyr2[yyrule];
948 int yyi;
949 unsigned long int yylno = yyrline[yyrule];
950 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
951 yyrule - 1, yylno);
952 /* The symbols being reduced. */
953 for (yyi = 0; yyi < yynrhs; yyi++)
954 {
955 YYFPRINTF (stderr, " $%d = ", yyi + 1);
956 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
957 &(yyvsp[(yyi + 1) - (yynrhs)])
958 , context, scanner);
959 YYFPRINTF (stderr, "\n");
960 }
961 }
962
963 # define YY_REDUCE_PRINT(Rule) \
964 do { \
965 if (yydebug) \
966 yy_reduce_print (yyvsp, Rule, context, scanner); \
967 } while (YYID (0))
968
969 /* Nonzero means print parse trace. It is left uninitialized so that
970 multiple parsers can coexist. */
971 int yydebug;
972 #else /* !YYDEBUG */
973 # define YYDPRINTF(Args)
974 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
975 # define YY_STACK_PRINT(Bottom, Top)
976 # define YY_REDUCE_PRINT(Rule)
977 #endif /* !YYDEBUG */
978
979
980 /* YYINITDEPTH -- initial size of the parser's stacks. */
981 #ifndef YYINITDEPTH
982 # define YYINITDEPTH 200
983 #endif
984
985 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
986 if the built-in stack extension method is used).
987
988 Do not make this value too large; the results are undefined if
989 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
990 evaluated with infinite-precision integer arithmetic. */
991
992 #ifndef YYMAXDEPTH
993 # define YYMAXDEPTH 10000
994 #endif
995
996
997 #if YYERROR_VERBOSE
998
999 # ifndef yystrlen
1000 # if defined __GLIBC__ && defined _STRING_H
1001 # define yystrlen strlen
1002 # else
1003 /* Return the length of YYSTR. */
1004 #if (defined __STDC__ || defined __C99__FUNC__ \
1005 || defined __cplusplus || defined _MSC_VER)
1006 static YYSIZE_T
1007 yystrlen (const char *yystr)
1008 #else
1009 static YYSIZE_T
1010 yystrlen (yystr)
1011 const char *yystr;
1012 #endif
1013 {
1014 YYSIZE_T yylen;
1015 for (yylen = 0; yystr[yylen]; yylen++)
1016 continue;
1017 return yylen;
1018 }
1019 # endif
1020 # endif
1021
1022 # ifndef yystpcpy
1023 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1024 # define yystpcpy stpcpy
1025 # else
1026 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1027 YYDEST. */
1028 #if (defined __STDC__ || defined __C99__FUNC__ \
1029 || defined __cplusplus || defined _MSC_VER)
1030 static char *
1031 yystpcpy (char *yydest, const char *yysrc)
1032 #else
1033 static char *
1034 yystpcpy (yydest, yysrc)
1035 char *yydest;
1036 const char *yysrc;
1037 #endif
1038 {
1039 char *yyd = yydest;
1040 const char *yys = yysrc;
1041
1042 while ((*yyd++ = *yys++) != '\0')
1043 continue;
1044
1045 return yyd - 1;
1046 }
1047 # endif
1048 # endif
1049
1050 # ifndef yytnamerr
1051 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1052 quotes and backslashes, so that it's suitable for yyerror. The
1053 heuristic is that double-quoting is unnecessary unless the string
1054 contains an apostrophe, a comma, or backslash (other than
1055 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1056 null, do not copy; instead, return the length of what the result
1057 would have been. */
1058 static YYSIZE_T
1059 yytnamerr (char *yyres, const char *yystr)
1060 {
1061 if (*yystr == '"')
1062 {
1063 YYSIZE_T yyn = 0;
1064 char const *yyp = yystr;
1065
1066 for (;;)
1067 switch (*++yyp)
1068 {
1069 case '\'':
1070 case ',':
1071 goto do_not_strip_quotes;
1072
1073 case '\\':
1074 if (*++yyp != '\\')
1075 goto do_not_strip_quotes;
1076 /* Fall through. */
1077 default:
1078 if (yyres)
1079 yyres[yyn] = *yyp;
1080 yyn++;
1081 break;
1082
1083 case '"':
1084 if (yyres)
1085 yyres[yyn] = '\0';
1086 return yyn;
1087 }
1088 do_not_strip_quotes: ;
1089 }
1090
1091 if (! yyres)
1092 return yystrlen (yystr);
1093
1094 return yystpcpy (yyres, yystr) - yyres;
1095 }
1096 # endif
1097
1098 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1099 about the unexpected token YYTOKEN for the state stack whose top is
1100 YYSSP.
1101
1102 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1103 not large enough to hold the message. In that case, also set
1104 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1105 required number of bytes is too large to store. */
1106 static int
1107 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1108 yytype_int16 *yyssp, int yytoken)
1109 {
1110 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1111 YYSIZE_T yysize = yysize0;
1112 YYSIZE_T yysize1;
1113 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1114 /* Internationalized format string. */
1115 const char *yyformat = 0;
1116 /* Arguments of yyformat. */
1117 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1118 /* Number of reported tokens (one for the "unexpected", one per
1119 "expected"). */
1120 int yycount = 0;
1121
1122 /* There are many possibilities here to consider:
1123 - Assume YYFAIL is not used. It's too flawed to consider. See
1124 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1125 for details. YYERROR is fine as it does not invoke this
1126 function.
1127 - If this state is a consistent state with a default action, then
1128 the only way this function was invoked is if the default action
1129 is an error action. In that case, don't check for expected
1130 tokens because there are none.
1131 - The only way there can be no lookahead present (in yychar) is if
1132 this state is a consistent state with a default action. Thus,
1133 detecting the absence of a lookahead is sufficient to determine
1134 that there is no unexpected or expected token to report. In that
1135 case, just report a simple "syntax error".
1136 - Don't assume there isn't a lookahead just because this state is a
1137 consistent state with a default action. There might have been a
1138 previous inconsistent state, consistent state with a non-default
1139 action, or user semantic action that manipulated yychar.
1140 - Of course, the expected token list depends on states to have
1141 correct lookahead information, and it depends on the parser not
1142 to perform extra reductions after fetching a lookahead from the
1143 scanner and before detecting a syntax error. Thus, state merging
1144 (from LALR or IELR) and default reductions corrupt the expected
1145 token list. However, the list is correct for canonical LR with
1146 one exception: it will still contain any token that will not be
1147 accepted due to an error action in a later state.
1148 */
1149 if (yytoken != YYEMPTY)
1150 {
1151 int yyn = yypact[*yyssp];
1152 yyarg[yycount++] = yytname[yytoken];
1153 if (!yypact_value_is_default (yyn))
1154 {
1155 /* Start YYX at -YYN if negative to avoid negative indexes in
1156 YYCHECK. In other words, skip the first -YYN actions for
1157 this state because they are default actions. */
1158 int yyxbegin = yyn < 0 ? -yyn : 0;
1159 /* Stay within bounds of both yycheck and yytname. */
1160 int yychecklim = YYLAST - yyn + 1;
1161 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1162 int yyx;
1163
1164 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1165 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1166 && !yytable_value_is_error (yytable[yyx + yyn]))
1167 {
1168 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1169 {
1170 yycount = 1;
1171 yysize = yysize0;
1172 break;
1173 }
1174 yyarg[yycount++] = yytname[yyx];
1175 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1176 if (! (yysize <= yysize1
1177 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1178 return 2;
1179 yysize = yysize1;
1180 }
1181 }
1182 }
1183
1184 switch (yycount)
1185 {
1186 # define YYCASE_(N, S) \
1187 case N: \
1188 yyformat = S; \
1189 break
1190 YYCASE_(0, YY_("syntax error"));
1191 YYCASE_(1, YY_("syntax error, unexpected %s"));
1192 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1193 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1194 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1195 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1196 # undef YYCASE_
1197 }
1198
1199 yysize1 = yysize + yystrlen (yyformat);
1200 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1201 return 2;
1202 yysize = yysize1;
1203
1204 if (*yymsg_alloc < yysize)
1205 {
1206 *yymsg_alloc = 2 * yysize;
1207 if (! (yysize <= *yymsg_alloc
1208 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1209 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1210 return 1;
1211 }
1212
1213 /* Avoid sprintf, as that infringes on the user's name space.
1214 Don't have undefined behavior even if the translation
1215 produced a string with the wrong number of "%s"s. */
1216 {
1217 char *yyp = *yymsg;
1218 int yyi = 0;
1219 while ((*yyp = *yyformat) != '\0')
1220 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1221 {
1222 yyp += yytnamerr (yyp, yyarg[yyi++]);
1223 yyformat += 2;
1224 }
1225 else
1226 {
1227 yyp++;
1228 yyformat++;
1229 }
1230 }
1231 return 0;
1232 }
1233 #endif /* YYERROR_VERBOSE */
1234
1235 /*-----------------------------------------------.
1236 | Release the memory associated to this symbol. |
1237 `-----------------------------------------------*/
1238
1239 /*ARGSUSED*/
1240 #if (defined __STDC__ || defined __C99__FUNC__ \
1241 || defined __cplusplus || defined _MSC_VER)
1242 static void
1243 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, Context *context, yyscan_t *scanner)
1244 #else
1245 static void
1246 yydestruct (yymsg, yytype, yyvaluep, context, scanner)
1247 const char *yymsg;
1248 int yytype;
1249 YYSTYPE *yyvaluep;
1250 Context *context;
1251 yyscan_t *scanner;
1252 #endif
1253 {
1254 YYUSE (yyvaluep);
1255 YYUSE (context);
1256 YYUSE (scanner);
1257
1258 if (!yymsg)
1259 yymsg = "Deleting";
1260 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1261
1262 switch (yytype)
1263 {
1264
1265 default:
1266 break;
1267 }
1268 }
1269
1270
1271 /* Prevent warnings from -Wmissing-prototypes. */
1272 #ifdef YYPARSE_PARAM
1273 #if defined __STDC__ || defined __cplusplus
1274 int yyparse (void *YYPARSE_PARAM);
1275 #else
1276 int yyparse ();
1277 #endif
1278 #else /* ! YYPARSE_PARAM */
1279 #if defined __STDC__ || defined __cplusplus
1280 int yyparse (Context *context, yyscan_t *scanner);
1281 #else
1282 int yyparse ();
1283 #endif
1284 #endif /* ! YYPARSE_PARAM */
1285
1286
1287 /*----------.
1288 | yyparse. |
1289 `----------*/
1290
1291 #ifdef YYPARSE_PARAM
1292 #if (defined __STDC__ || defined __C99__FUNC__ \
1293 || defined __cplusplus || defined _MSC_VER)
1294 int
1295 yyparse (void *YYPARSE_PARAM)
1296 #else
1297 int
1298 yyparse (YYPARSE_PARAM)
1299 void *YYPARSE_PARAM;
1300 #endif
1301 #else /* ! YYPARSE_PARAM */
1302 #if (defined __STDC__ || defined __C99__FUNC__ \
1303 || defined __cplusplus || defined _MSC_VER)
1304 int
1305 yyparse (Context *context, yyscan_t *scanner)
1306 #else
1307 int
1308 yyparse (context, scanner)
1309 Context *context;
1310 yyscan_t *scanner;
1311 #endif
1312 #endif
1313 {
1314 /* The lookahead symbol. */
1315 int yychar;
1316
1317 /* The semantic value of the lookahead symbol. */
1318 YYSTYPE yylval;
1319
1320 /* Number of syntax errors so far. */
1321 int yynerrs;
1322
1323 int yystate;
1324 /* Number of tokens to shift before error messages enabled. */
1325 int yyerrstatus;
1326
1327 /* The stacks and their tools:
1328 `yyss': related to states.
1329 `yyvs': related to semantic values.
1330
1331 Refer to the stacks thru separate pointers, to allow yyoverflow
1332 to reallocate them elsewhere. */
1333
1334 /* The state stack. */
1335 yytype_int16 yyssa[YYINITDEPTH];
1336 yytype_int16 *yyss;
1337 yytype_int16 *yyssp;
1338
1339 /* The semantic value stack. */
1340 YYSTYPE yyvsa[YYINITDEPTH];
1341 YYSTYPE *yyvs;
1342 YYSTYPE *yyvsp;
1343
1344 YYSIZE_T yystacksize;
1345
1346 int yyn;
1347 int yyresult;
1348 /* Lookahead token as an internal (translated) token number. */
1349 int yytoken;
1350 /* The variables used to return semantic value and location from the
1351 action routines. */
1352 YYSTYPE yyval;
1353
1354 #if YYERROR_VERBOSE
1355 /* Buffer for error messages, and its allocated size. */
1356 char yymsgbuf[128];
1357 char *yymsg = yymsgbuf;
1358 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1359 #endif
1360
1361 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1362
1363 /* The number of symbols on the RHS of the reduced rule.
1364 Keep to zero when no symbol should be popped. */
1365 int yylen = 0;
1366
1367 yytoken = 0;
1368 yyss = yyssa;
1369 yyvs = yyvsa;
1370 yystacksize = YYINITDEPTH;
1371
1372 YYDPRINTF ((stderr, "Starting parse\n"));
1373
1374 yystate = 0;
1375 yyerrstatus = 0;
1376 yynerrs = 0;
1377 yychar = YYEMPTY; /* Cause a token to be read. */
1378
1379 /* Initialize stack pointers.
1380 Waste one element of value and location stack
1381 so that they stay on the same level as the state stack.
1382 The wasted elements are never initialized. */
1383 yyssp = yyss;
1384 yyvsp = yyvs;
1385
1386 goto yysetstate;
1387
1388 /*------------------------------------------------------------.
1389 | yynewstate -- Push a new state, which is found in yystate. |
1390 `------------------------------------------------------------*/
1391 yynewstate:
1392 /* In all cases, when you get here, the value and location stacks
1393 have just been pushed. So pushing a state here evens the stacks. */
1394 yyssp++;
1395
1396 yysetstate:
1397 *yyssp = yystate;
1398
1399 if (yyss + yystacksize - 1 <= yyssp)
1400 {
1401 /* Get the current used size of the three stacks, in elements. */
1402 YYSIZE_T yysize = yyssp - yyss + 1;
1403
1404 #ifdef yyoverflow
1405 {
1406 /* Give user a chance to reallocate the stack. Use copies of
1407 these so that the &'s don't force the real ones into
1408 memory. */
1409 YYSTYPE *yyvs1 = yyvs;
1410 yytype_int16 *yyss1 = yyss;
1411
1412 /* Each stack pointer address is followed by the size of the
1413 data in use in that stack, in bytes. This used to be a
1414 conditional around just the two extra args, but that might
1415 be undefined if yyoverflow is a macro. */
1416 yyoverflow (YY_("memory exhausted"),
1417 &yyss1, yysize * sizeof (*yyssp),
1418 &yyvs1, yysize * sizeof (*yyvsp),
1419 &yystacksize);
1420
1421 yyss = yyss1;
1422 yyvs = yyvs1;
1423 }
1424 #else /* no yyoverflow */
1425 # ifndef YYSTACK_RELOCATE
1426 goto yyexhaustedlab;
1427 # else
1428 /* Extend the stack our own way. */
1429 if (YYMAXDEPTH <= yystacksize)
1430 goto yyexhaustedlab;
1431 yystacksize *= 2;
1432 if (YYMAXDEPTH < yystacksize)
1433 yystacksize = YYMAXDEPTH;
1434
1435 {
1436 yytype_int16 *yyss1 = yyss;
1437 union yyalloc *yyptr =
1438 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1439 if (! yyptr)
1440 goto yyexhaustedlab;
1441 YYSTACK_RELOCATE (yyss_alloc, yyss);
1442 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1443 # undef YYSTACK_RELOCATE
1444 if (yyss1 != yyssa)
1445 YYSTACK_FREE (yyss1);
1446 }
1447 # endif
1448 #endif /* no yyoverflow */
1449
1450 yyssp = yyss + yysize - 1;
1451 yyvsp = yyvs + yysize - 1;
1452
1453 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1454 (unsigned long int) yystacksize));
1455
1456 if (yyss + yystacksize - 1 <= yyssp)
1457 YYABORT;
1458 }
1459
1460 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1461
1462 if (yystate == YYFINAL)
1463 YYACCEPT;
1464
1465 goto yybackup;
1466
1467 /*-----------.
1468 | yybackup. |
1469 `-----------*/
1470 yybackup:
1471
1472 /* Do appropriate processing given the current state. Read a
1473 lookahead token if we need one and don't already have one. */
1474
1475 /* First try to decide what to do without reference to lookahead token. */
1476 yyn = yypact[yystate];
1477 if (yypact_value_is_default (yyn))
1478 goto yydefault;
1479
1480 /* Not known => get a lookahead token if don't already have one. */
1481
1482 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1483 if (yychar == YYEMPTY)
1484 {
1485 YYDPRINTF ((stderr, "Reading a token: "));
1486 yychar = YYLEX;
1487 }
1488
1489 if (yychar <= YYEOF)
1490 {
1491 yychar = yytoken = YYEOF;
1492 YYDPRINTF ((stderr, "Now at end of input.\n"));
1493 }
1494 else
1495 {
1496 yytoken = YYTRANSLATE (yychar);
1497 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1498 }
1499
1500 /* If the proper action on seeing token YYTOKEN is to reduce or to
1501 detect an error, take that action. */
1502 yyn += yytoken;
1503 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1504 goto yydefault;
1505 yyn = yytable[yyn];
1506 if (yyn <= 0)
1507 {
1508 if (yytable_value_is_error (yyn))
1509 goto yyerrlab;
1510 yyn = -yyn;
1511 goto yyreduce;
1512 }
1513
1514 /* Count tokens shifted since error; after three, turn off error
1515 status. */
1516 if (yyerrstatus)
1517 yyerrstatus--;
1518
1519 /* Shift the lookahead token. */
1520 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1521
1522 /* Discard the shifted token. */
1523 yychar = YYEMPTY;
1524
1525 yystate = yyn;
1526 *++yyvsp = yylval;
1527
1528 goto yynewstate;
1529
1530
1531 /*-----------------------------------------------------------.
1532 | yydefault -- do the default action for the current state. |
1533 `-----------------------------------------------------------*/
1534 yydefault:
1535 yyn = yydefact[yystate];
1536 if (yyn == 0)
1537 goto yyerrlab;
1538 goto yyreduce;
1539
1540
1541 /*-----------------------------.
1542 | yyreduce -- Do a reduction. |
1543 `-----------------------------*/
1544 yyreduce:
1545 /* yyn is the number of a rule to reduce with. */
1546 yylen = yyr2[yyn];
1547
1548 /* If YYLEN is nonzero, implement the default value of the action:
1549 `$$ = $1'.
1550
1551 Otherwise, the following line sets YYVAL to garbage.
1552 This behavior is undocumented and Bison
1553 users should not rely upon it. Assigning to YYVAL
1554 unconditionally makes the parser a bit smaller, and it avoids a
1555 GCC warning that YYVAL may be used uninitialized. */
1556 yyval = yyvsp[1-yylen];
1557
1558
1559 YY_REDUCE_PRINT (yyn);
1560 switch (yyn)
1561 {
1562 case 4:
1563
1564 /* Line 1806 of yacc.c */
1565 #line 199 "libmemcached/csl/parser.yy"
1566 { }
1567 break;
1568
1569 case 5:
1570
1571 /* Line 1806 of yacc.c */
1572 #line 201 "libmemcached/csl/parser.yy"
1573 { }
1574 break;
1575
1576 case 6:
1577
1578 /* Line 1806 of yacc.c */
1579 #line 203 "libmemcached/csl/parser.yy"
1580 { }
1581 break;
1582
1583 case 7:
1584
1585 /* Line 1806 of yacc.c */
1586 #line 205 "libmemcached/csl/parser.yy"
1587 {
1588 context->set_end();
1589 YYACCEPT;
1590 }
1591 break;
1592
1593 case 8:
1594
1595 /* Line 1806 of yacc.c */
1596 #line 210 "libmemcached/csl/parser.yy"
1597 {
1598 context->rc= MEMCACHED_PARSE_USER_ERROR;
1599 parser_abort(context, "ERROR called directly");
1600 }
1601 break;
1602
1603 case 9:
1604
1605 /* Line 1806 of yacc.c */
1606 #line 215 "libmemcached/csl/parser.yy"
1607 {
1608 memcached_reset(context->memc);
1609 }
1610 break;
1611
1612 case 10:
1613
1614 /* Line 1806 of yacc.c */
1615 #line 219 "libmemcached/csl/parser.yy"
1616 {
1617 yydebug= 1;
1618 }
1619 break;
1620
1621 case 11:
1622
1623 /* Line 1806 of yacc.c */
1624 #line 223 "libmemcached/csl/parser.yy"
1625 {
1626 if ((context->rc= memcached_parse_configure_file(*context->memc, (yyvsp[(3) - (3)].string).c_str, (yyvsp[(3) - (3)].string).size)) != MEMCACHED_SUCCESS)
1627 {
1628 parser_abort(context, "Failed to parse configuration file");
1629 }
1630 }
1631 break;
1632
1633 case 12:
1634
1635 /* Line 1806 of yacc.c */
1636 #line 234 "libmemcached/csl/parser.yy"
1637 {
1638 if (memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(3) - (4)].number), uint32_t((yyvsp[(4) - (4)].number)))))
1639 {
1640 char buffer[1024];
1641 snprintf(buffer, sizeof(buffer), "Failed to add server: %s:%u", (yyvsp[(2) - (4)].server).c_str, uint32_t((yyvsp[(3) - (4)].number)));
1642 parser_abort(context, buffer);
1643 }
1644 context->unset_server();
1645 }
1646 break;
1647
1648 case 13:
1649
1650 /* Line 1806 of yacc.c */
1651 #line 244 "libmemcached/csl/parser.yy"
1652 {
1653 if (memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(3) - (4)].number), uint32_t((yyvsp[(4) - (4)].number)))))
1654 {
1655 char buffer[1024];
1656 snprintf(buffer, sizeof(buffer), "Failed to add server: %s:%u", (yyvsp[(2) - (4)].server).c_str, uint32_t((yyvsp[(3) - (4)].number)));
1657 parser_abort(context, buffer);
1658 }
1659 context->unset_server();
1660 }
1661 break;
1662
1663 case 14:
1664
1665 /* Line 1806 of yacc.c */
1666 #line 254 "libmemcached/csl/parser.yy"
1667 {
1668 if (memcached_failed(context->rc= memcached_server_add_unix_socket_with_weight(context->memc, (yyvsp[(2) - (3)].string).c_str, uint32_t((yyvsp[(3) - (3)].number)))))
1669 {
1670 char buffer[1024];
1671 snprintf(buffer, sizeof(buffer), "Failed to add socket: %s", (yyvsp[(2) - (3)].string).c_str);
1672 parser_abort(context, buffer);
1673 }
1674 }
1675 break;
1676
1677 case 15:
1678
1679 /* Line 1806 of yacc.c */
1680 #line 263 "libmemcached/csl/parser.yy"
1681 {
1682 memcached_set_configuration_file(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).size);
1683 }
1684 break;
1685
1686 case 16:
1687
1688 /* Line 1806 of yacc.c */
1689 #line 267 "libmemcached/csl/parser.yy"
1690 {
1691 context->memc->configure.initial_pool_size= uint32_t((yyvsp[(2) - (2)].number));
1692 }
1693 break;
1694
1695 case 17:
1696
1697 /* Line 1806 of yacc.c */
1698 #line 271 "libmemcached/csl/parser.yy"
1699 {
1700 context->memc->configure.max_pool_size= uint32_t((yyvsp[(2) - (2)].number));
1701 }
1702 break;
1703
1704 case 19:
1705
1706 /* Line 1806 of yacc.c */
1707 #line 279 "libmemcached/csl/parser.yy"
1708 {
1709 if (memcached_callback_get(context->memc, MEMCACHED_CALLBACK_PREFIX_KEY, NULL))
1710 {
1711 parser_abort(context, "--NAMESPACE can only be called once");
1712 }
1713
1714 if ((context->rc= memcached_set_namespace(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).size)) != MEMCACHED_SUCCESS)
1715 {
1716 parser_abort(context, memcached_last_error_message(context->memc));
1717 }
1718 }
1719 break;
1720
1721 case 20:
1722
1723 /* Line 1806 of yacc.c */
1724 #line 291 "libmemcached/csl/parser.yy"
1725 {
1726 memcached_flag(*context->memc, MEMCACHED_FLAG_IS_FETCHING_VERSION, true);
1727 }
1728 break;
1729
1730 case 21:
1731
1732 /* Line 1806 of yacc.c */
1733 #line 295 "libmemcached/csl/parser.yy"
1734 {
1735 // Check to see if DISTRIBUTION has already been set
1736 if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (2)].distribution))) != MEMCACHED_SUCCESS)
1737 {
1738 parser_abort(context, "--DISTRIBUTION can only be called once");
1739 }
1740
1741 if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (2)].distribution))) != MEMCACHED_SUCCESS)
1742 {
1743 parser_abort(context, memcached_last_error_message(context->memc));;
1744 }
1745 }
1746 break;
1747
1748 case 22:
1749
1750 /* Line 1806 of yacc.c */
1751 #line 308 "libmemcached/csl/parser.yy"
1752 {
1753 // Check to see if DISTRIBUTION has already been set
1754 if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (4)].distribution))) != MEMCACHED_SUCCESS)
1755 {
1756 parser_abort(context, "--DISTRIBUTION can only be called once");
1757 }
1758
1759 if ((context->rc= memcached_behavior_set_distribution_hash(context->memc, (yyvsp[(4) - (4)].hash))) != MEMCACHED_SUCCESS)
1760 {
1761 parser_abort(context, "Unable to set the hash for the DISTRIBUTION requested");
1762 }
1763 }
1764 break;
1765
1766 case 23:
1767
1768 /* Line 1806 of yacc.c */
1769 #line 321 "libmemcached/csl/parser.yy"
1770 {
1771 if (context->set_hash((yyvsp[(2) - (2)].hash)) == false)
1772 {
1773 parser_abort(context, "--HASH can only be set once");
1774 }
1775 }
1776 break;
1777
1778 case 24:
1779
1780 /* Line 1806 of yacc.c */
1781 #line 328 "libmemcached/csl/parser.yy"
1782 {
1783 if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (2)].behavior), (yyvsp[(2) - (2)].number))) != MEMCACHED_SUCCESS)
1784 {
1785 parser_abort(context, "Unable to set behavior");
1786 }
1787 }
1788 break;
1789
1790 case 25:
1791
1792 /* Line 1806 of yacc.c */
1793 #line 335 "libmemcached/csl/parser.yy"
1794 {
1795 if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (1)].behavior), true)) != MEMCACHED_SUCCESS)
1796 {
1797 char buffer[1024];
1798 snprintf(buffer, sizeof(buffer), "Could not set: %s", libmemcached_string_behavior((yyvsp[(1) - (1)].behavior)));
1799 parser_abort(context, buffer);
1800 }
1801 }
1802 break;
1803
1804 case 26:
1805
1806 /* Line 1806 of yacc.c */
1807 #line 344 "libmemcached/csl/parser.yy"
1808 {
1809 }
1810 break;
1811
1812 case 27:
1813
1814 /* Line 1806 of yacc.c */
1815 #line 350 "libmemcached/csl/parser.yy"
1816 {
1817 (yyval.behavior)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS;
1818 }
1819 break;
1820
1821 case 28:
1822
1823 /* Line 1806 of yacc.c */
1824 #line 354 "libmemcached/csl/parser.yy"
1825 {
1826 (yyval.behavior)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT;
1827 }
1828 break;
1829
1830 case 29:
1831
1832 /* Line 1806 of yacc.c */
1833 #line 358 "libmemcached/csl/parser.yy"
1834 {
1835 (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK;
1836 }
1837 break;
1838
1839 case 30:
1840
1841 /* Line 1806 of yacc.c */
1842 #line 362 "libmemcached/csl/parser.yy"
1843 {
1844 (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK;
1845 }
1846 break;
1847
1848 case 31:
1849
1850 /* Line 1806 of yacc.c */
1851 #line 366 "libmemcached/csl/parser.yy"
1852 {
1853 (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH;
1854 }
1855 break;
1856
1857 case 32:
1858
1859 /* Line 1806 of yacc.c */
1860 #line 370 "libmemcached/csl/parser.yy"
1861 {
1862 (yyval.behavior)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS;
1863 }
1864 break;
1865
1866 case 33:
1867
1868 /* Line 1806 of yacc.c */
1869 #line 374 "libmemcached/csl/parser.yy"
1870 {
1871 (yyval.behavior)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT;
1872 }
1873 break;
1874
1875 case 34:
1876
1877 /* Line 1806 of yacc.c */
1878 #line 378 "libmemcached/csl/parser.yy"
1879 {
1880 (yyval.behavior)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT;
1881 }
1882 break;
1883
1884 case 35:
1885
1886 /* Line 1806 of yacc.c */
1887 #line 382 "libmemcached/csl/parser.yy"
1888 {
1889 (yyval.behavior)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT;
1890 }
1891 break;
1892
1893 case 36:
1894
1895 /* Line 1806 of yacc.c */
1896 #line 386 "libmemcached/csl/parser.yy"
1897 {
1898 (yyval.behavior)= MEMCACHED_BEHAVIOR_SND_TIMEOUT;
1899 }
1900 break;
1901
1902 case 37:
1903
1904 /* Line 1806 of yacc.c */
1905 #line 390 "libmemcached/csl/parser.yy"
1906 {
1907 (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE;
1908 }
1909 break;
1910
1911 case 38:
1912
1913 /* Line 1806 of yacc.c */
1914 #line 394 "libmemcached/csl/parser.yy"
1915 {
1916 (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE;
1917 }
1918 break;
1919
1920 case 39:
1921
1922 /* Line 1806 of yacc.c */
1923 #line 401 "libmemcached/csl/parser.yy"
1924 {
1925 (yyval.behavior)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL;
1926 }
1927 break;
1928
1929 case 40:
1930
1931 /* Line 1806 of yacc.c */
1932 #line 405 "libmemcached/csl/parser.yy"
1933 {
1934 (yyval.behavior)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS;
1935 }
1936 break;
1937
1938 case 41:
1939
1940 /* Line 1806 of yacc.c */
1941 #line 409 "libmemcached/csl/parser.yy"
1942 {
1943 (yyval.behavior)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY;
1944 }
1945 break;
1946
1947 case 42:
1948
1949 /* Line 1806 of yacc.c */
1950 #line 413 "libmemcached/csl/parser.yy"
1951 {
1952 (yyval.behavior)= MEMCACHED_BEHAVIOR_NOREPLY;
1953 }
1954 break;
1955
1956 case 43:
1957
1958 /* Line 1806 of yacc.c */
1959 #line 417 "libmemcached/csl/parser.yy"
1960 {
1961 (yyval.behavior)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ;
1962 }
1963 break;
1964
1965 case 44:
1966
1967 /* Line 1806 of yacc.c */
1968 #line 421 "libmemcached/csl/parser.yy"
1969 {
1970 (yyval.behavior)= MEMCACHED_BEHAVIOR_SORT_HOSTS;
1971 }
1972 break;
1973
1974 case 45:
1975
1976 /* Line 1806 of yacc.c */
1977 #line 425 "libmemcached/csl/parser.yy"
1978 {
1979 (yyval.behavior)= MEMCACHED_BEHAVIOR_SUPPORT_CAS;
1980 }
1981 break;
1982
1983 case 46:
1984
1985 /* Line 1806 of yacc.c */
1986 #line 429 "libmemcached/csl/parser.yy"
1987 {
1988 (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_NODELAY;
1989 }
1990 break;
1991
1992 case 47:
1993
1994 /* Line 1806 of yacc.c */
1995 #line 433 "libmemcached/csl/parser.yy"
1996 {
1997 (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE;
1998 }
1999 break;
2000
2001 case 48:
2002
2003 /* Line 1806 of yacc.c */
2004 #line 437 "libmemcached/csl/parser.yy"
2005 {
2006 (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE;
2007 }
2008 break;
2009
2010 case 49:
2011
2012 /* Line 1806 of yacc.c */
2013 #line 441 "libmemcached/csl/parser.yy"
2014 {
2015 (yyval.behavior)= MEMCACHED_BEHAVIOR_USE_UDP;
2016 }
2017 break;
2018
2019 case 50:
2020
2021 /* Line 1806 of yacc.c */
2022 #line 445 "libmemcached/csl/parser.yy"
2023 {
2024 (yyval.behavior)= MEMCACHED_BEHAVIOR_VERIFY_KEY;
2025 }
2026 break;
2027
2028 case 51:
2029
2030 /* Line 1806 of yacc.c */
2031 #line 451 "libmemcached/csl/parser.yy"
2032 { (yyval.number)= MEMCACHED_DEFAULT_PORT;}
2033 break;
2034
2035 case 52:
2036
2037 /* Line 1806 of yacc.c */
2038 #line 453 "libmemcached/csl/parser.yy"
2039 { }
2040 break;
2041
2042 case 53:
2043
2044 /* Line 1806 of yacc.c */
2045 #line 457 "libmemcached/csl/parser.yy"
2046 { (yyval.number)= 1; }
2047 break;
2048
2049 case 54:
2050
2051 /* Line 1806 of yacc.c */
2052 #line 459 "libmemcached/csl/parser.yy"
2053 { }
2054 break;
2055
2056 case 55:
2057
2058 /* Line 1806 of yacc.c */
2059 #line 464 "libmemcached/csl/parser.yy"
2060 {
2061 (yyval.hash)= MEMCACHED_HASH_MD5;
2062 }
2063 break;
2064
2065 case 56:
2066
2067 /* Line 1806 of yacc.c */
2068 #line 468 "libmemcached/csl/parser.yy"
2069 {
2070 (yyval.hash)= MEMCACHED_HASH_CRC;
2071 }
2072 break;
2073
2074 case 57:
2075
2076 /* Line 1806 of yacc.c */
2077 #line 472 "libmemcached/csl/parser.yy"
2078 {
2079 (yyval.hash)= MEMCACHED_HASH_FNV1_64;
2080 }
2081 break;
2082
2083 case 58:
2084
2085 /* Line 1806 of yacc.c */
2086 #line 476 "libmemcached/csl/parser.yy"
2087 {
2088 (yyval.hash)= MEMCACHED_HASH_FNV1A_64;
2089 }
2090 break;
2091
2092 case 59:
2093
2094 /* Line 1806 of yacc.c */
2095 #line 480 "libmemcached/csl/parser.yy"
2096 {
2097 (yyval.hash)= MEMCACHED_HASH_FNV1_32;
2098 }
2099 break;
2100
2101 case 60:
2102
2103 /* Line 1806 of yacc.c */
2104 #line 484 "libmemcached/csl/parser.yy"
2105 {
2106 (yyval.hash)= MEMCACHED_HASH_FNV1A_32;
2107 }
2108 break;
2109
2110 case 61:
2111
2112 /* Line 1806 of yacc.c */
2113 #line 488 "libmemcached/csl/parser.yy"
2114 {
2115 (yyval.hash)= MEMCACHED_HASH_HSIEH;
2116 }
2117 break;
2118
2119 case 62:
2120
2121 /* Line 1806 of yacc.c */
2122 #line 492 "libmemcached/csl/parser.yy"
2123 {
2124 (yyval.hash)= MEMCACHED_HASH_MURMUR;
2125 }
2126 break;
2127
2128 case 63:
2129
2130 /* Line 1806 of yacc.c */
2131 #line 496 "libmemcached/csl/parser.yy"
2132 {
2133 (yyval.hash)= MEMCACHED_HASH_JENKINS;
2134 }
2135 break;
2136
2137 case 64:
2138
2139 /* Line 1806 of yacc.c */
2140 #line 503 "libmemcached/csl/parser.yy"
2141 {
2142 (yyval.string)= (yyvsp[(1) - (1)].string);
2143 }
2144 break;
2145
2146 case 65:
2147
2148 /* Line 1806 of yacc.c */
2149 #line 507 "libmemcached/csl/parser.yy"
2150 {
2151 (yyval.string)= (yyvsp[(1) - (1)].string);
2152 }
2153 break;
2154
2155 case 66:
2156
2157 /* Line 1806 of yacc.c */
2158 #line 514 "libmemcached/csl/parser.yy"
2159 {
2160 (yyval.distribution)= MEMCACHED_DISTRIBUTION_CONSISTENT;
2161 }
2162 break;
2163
2164 case 67:
2165
2166 /* Line 1806 of yacc.c */
2167 #line 518 "libmemcached/csl/parser.yy"
2168 {
2169 (yyval.distribution)= MEMCACHED_DISTRIBUTION_MODULA;
2170 }
2171 break;
2172
2173 case 68:
2174
2175 /* Line 1806 of yacc.c */
2176 #line 522 "libmemcached/csl/parser.yy"
2177 {
2178 (yyval.distribution)= MEMCACHED_DISTRIBUTION_RANDOM;
2179 }
2180 break;
2181
2182
2183
2184 /* Line 1806 of yacc.c */
2185 #line 2186 "libmemcached/csl/parser.cc"
2186 default: break;
2187 }
2188 /* User semantic actions sometimes alter yychar, and that requires
2189 that yytoken be updated with the new translation. We take the
2190 approach of translating immediately before every use of yytoken.
2191 One alternative is translating here after every semantic action,
2192 but that translation would be missed if the semantic action invokes
2193 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2194 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2195 incorrect destructor might then be invoked immediately. In the
2196 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2197 to an incorrect destructor call or verbose syntax error message
2198 before the lookahead is translated. */
2199 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2200
2201 YYPOPSTACK (yylen);
2202 yylen = 0;
2203 YY_STACK_PRINT (yyss, yyssp);
2204
2205 *++yyvsp = yyval;
2206
2207 /* Now `shift' the result of the reduction. Determine what state
2208 that goes to, based on the state we popped back to and the rule
2209 number reduced by. */
2210
2211 yyn = yyr1[yyn];
2212
2213 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2214 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2215 yystate = yytable[yystate];
2216 else
2217 yystate = yydefgoto[yyn - YYNTOKENS];
2218
2219 goto yynewstate;
2220
2221
2222 /*------------------------------------.
2223 | yyerrlab -- here on detecting error |
2224 `------------------------------------*/
2225 yyerrlab:
2226 /* Make sure we have latest lookahead translation. See comments at
2227 user semantic actions for why this is necessary. */
2228 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2229
2230 /* If not already recovering from an error, report this error. */
2231 if (!yyerrstatus)
2232 {
2233 ++yynerrs;
2234 #if ! YYERROR_VERBOSE
2235 yyerror (context, scanner, YY_("syntax error"));
2236 #else
2237 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2238 yyssp, yytoken)
2239 {
2240 char const *yymsgp = YY_("syntax error");
2241 int yysyntax_error_status;
2242 yysyntax_error_status = YYSYNTAX_ERROR;
2243 if (yysyntax_error_status == 0)
2244 yymsgp = yymsg;
2245 else if (yysyntax_error_status == 1)
2246 {
2247 if (yymsg != yymsgbuf)
2248 YYSTACK_FREE (yymsg);
2249 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2250 if (!yymsg)
2251 {
2252 yymsg = yymsgbuf;
2253 yymsg_alloc = sizeof yymsgbuf;
2254 yysyntax_error_status = 2;
2255 }
2256 else
2257 {
2258 yysyntax_error_status = YYSYNTAX_ERROR;
2259 yymsgp = yymsg;
2260 }
2261 }
2262 yyerror (context, scanner, yymsgp);
2263 if (yysyntax_error_status == 2)
2264 goto yyexhaustedlab;
2265 }
2266 # undef YYSYNTAX_ERROR
2267 #endif
2268 }
2269
2270
2271
2272 if (yyerrstatus == 3)
2273 {
2274 /* If just tried and failed to reuse lookahead token after an
2275 error, discard it. */
2276
2277 if (yychar <= YYEOF)
2278 {
2279 /* Return failure if at end of input. */
2280 if (yychar == YYEOF)
2281 YYABORT;
2282 }
2283 else
2284 {
2285 yydestruct ("Error: discarding",
2286 yytoken, &yylval, context, scanner);
2287 yychar = YYEMPTY;
2288 }
2289 }
2290
2291 /* Else will try to reuse lookahead token after shifting the error
2292 token. */
2293 goto yyerrlab1;
2294
2295
2296 /*---------------------------------------------------.
2297 | yyerrorlab -- error raised explicitly by YYERROR. |
2298 `---------------------------------------------------*/
2299 yyerrorlab:
2300
2301 /* Pacify compilers like GCC when the user code never invokes
2302 YYERROR and the label yyerrorlab therefore never appears in user
2303 code. */
2304 if (/*CONSTCOND*/ 0)
2305 goto yyerrorlab;
2306
2307 /* Do not reclaim the symbols of the rule which action triggered
2308 this YYERROR. */
2309 YYPOPSTACK (yylen);
2310 yylen = 0;
2311 YY_STACK_PRINT (yyss, yyssp);
2312 yystate = *yyssp;
2313 goto yyerrlab1;
2314
2315
2316 /*-------------------------------------------------------------.
2317 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2318 `-------------------------------------------------------------*/
2319 yyerrlab1:
2320 yyerrstatus = 3; /* Each real token shifted decrements this. */
2321
2322 for (;;)
2323 {
2324 yyn = yypact[yystate];
2325 if (!yypact_value_is_default (yyn))
2326 {
2327 yyn += YYTERROR;
2328 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2329 {
2330 yyn = yytable[yyn];
2331 if (0 < yyn)
2332 break;
2333 }
2334 }
2335
2336 /* Pop the current state because it cannot handle the error token. */
2337 if (yyssp == yyss)
2338 YYABORT;
2339
2340
2341 yydestruct ("Error: popping",
2342 yystos[yystate], yyvsp, context, scanner);
2343 YYPOPSTACK (1);
2344 yystate = *yyssp;
2345 YY_STACK_PRINT (yyss, yyssp);
2346 }
2347
2348 *++yyvsp = yylval;
2349
2350
2351 /* Shift the error token. */
2352 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2353
2354 yystate = yyn;
2355 goto yynewstate;
2356
2357
2358 /*-------------------------------------.
2359 | yyacceptlab -- YYACCEPT comes here. |
2360 `-------------------------------------*/
2361 yyacceptlab:
2362 yyresult = 0;
2363 goto yyreturn;
2364
2365 /*-----------------------------------.
2366 | yyabortlab -- YYABORT comes here. |
2367 `-----------------------------------*/
2368 yyabortlab:
2369 yyresult = 1;
2370 goto yyreturn;
2371
2372 #if !defined(yyoverflow) || YYERROR_VERBOSE
2373 /*-------------------------------------------------.
2374 | yyexhaustedlab -- memory exhaustion comes here. |
2375 `-------------------------------------------------*/
2376 yyexhaustedlab:
2377 yyerror (context, scanner, YY_("memory exhausted"));
2378 yyresult = 2;
2379 /* Fall through. */
2380 #endif
2381
2382 yyreturn:
2383 if (yychar != YYEMPTY)
2384 {
2385 /* Make sure we have latest lookahead translation. See comments at
2386 user semantic actions for why this is necessary. */
2387 yytoken = YYTRANSLATE (yychar);
2388 yydestruct ("Cleanup: discarding lookahead",
2389 yytoken, &yylval, context, scanner);
2390 }
2391 /* Do not reclaim the symbols of the rule which action triggered
2392 this YYABORT or YYACCEPT. */
2393 YYPOPSTACK (yylen);
2394 YY_STACK_PRINT (yyss, yyssp);
2395 while (yyssp != yyss)
2396 {
2397 yydestruct ("Cleanup: popping",
2398 yystos[*yyssp], yyvsp, context, scanner);
2399 YYPOPSTACK (1);
2400 }
2401 #ifndef yyoverflow
2402 if (yyss != yyssa)
2403 YYSTACK_FREE (yyss);
2404 #endif
2405 #if YYERROR_VERBOSE
2406 if (yymsg != yymsgbuf)
2407 YYSTACK_FREE (yymsg);
2408 #endif
2409 /* Make sure YYID is used. */
2410 return YYID (yyresult);
2411 }
2412
2413
2414
2415 /* Line 2067 of yacc.c */
2416 #line 527 "libmemcached/csl/parser.yy"
2417
2418
2419 void Context::start()
2420 {
2421 config_parse(this, (void **)scanner);
2422 }
2423
2424