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