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