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