Adding prebuilt parser/scanner
[m6w6/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 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, 188, 188, 189, 193, 195, 197, 199, 204, 209,
544 213, 217, 228, 238, 248, 257, 261, 265, 269, 273,
545 285, 298, 311, 318, 325, 334, 340, 344, 348, 352,
546 356, 360, 364, 368, 372, 376, 380, 384, 391, 395,
547 399, 403, 407, 411, 415, 419, 423, 427, 431, 435,
548 442, 443, 448, 449, 454, 458, 462, 466, 470, 474,
549 478, 482, 486, 493, 497, 504, 508, 512
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 194 "libmemcached/csl/parser.yy"
1561 { }
1562 break;
1563
1564 case 5:
1565
1566 /* Line 1806 of yacc.c */
1567 #line 196 "libmemcached/csl/parser.yy"
1568 { }
1569 break;
1570
1571 case 6:
1572
1573 /* Line 1806 of yacc.c */
1574 #line 198 "libmemcached/csl/parser.yy"
1575 { }
1576 break;
1577
1578 case 7:
1579
1580 /* Line 1806 of yacc.c */
1581 #line 200 "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 205 "libmemcached/csl/parser.yy"
1592 {
1593 context->rc= MEMCACHED_PARSE_USER_ERROR;
1594 parser_abort(context, "ERROR called directly");
1595 }
1596 break;
1597
1598 case 9:
1599
1600 /* Line 1806 of yacc.c */
1601 #line 210 "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 214 "libmemcached/csl/parser.yy"
1611 {
1612 yydebug= 1;
1613 }
1614 break;
1615
1616 case 11:
1617
1618 /* Line 1806 of yacc.c */
1619 #line 218 "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, "Failed to parse configuration file");
1624 }
1625 }
1626 break;
1627
1628 case 12:
1629
1630 /* Line 1806 of yacc.c */
1631 #line 229 "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 char buffer[1024];
1636 snprintf(buffer, sizeof(buffer), "Failed to add server: %s:%u", (yyvsp[(2) - (4)].server).c_str, uint32_t((yyvsp[(3) - (4)].number)));
1637 parser_abort(context, buffer);
1638 }
1639 context->unset_server();
1640 }
1641 break;
1642
1643 case 13:
1644
1645 /* Line 1806 of yacc.c */
1646 #line 239 "libmemcached/csl/parser.yy"
1647 {
1648 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))))
1649 {
1650 char buffer[1024];
1651 snprintf(buffer, sizeof(buffer), "Failed to add server: %s:%u", (yyvsp[(2) - (4)].server).c_str, uint32_t((yyvsp[(3) - (4)].number)));
1652 parser_abort(context, buffer);
1653 }
1654 context->unset_server();
1655 }
1656 break;
1657
1658 case 14:
1659
1660 /* Line 1806 of yacc.c */
1661 #line 249 "libmemcached/csl/parser.yy"
1662 {
1663 if (memcached_failed(context->rc= memcached_server_add_unix_socket_with_weight(context->memc, (yyvsp[(2) - (3)].string).c_str, (yyvsp[(3) - (3)].number))))
1664 {
1665 char buffer[1024];
1666 snprintf(buffer, sizeof(buffer), "Failed to add server: %s", (yyvsp[(2) - (3)].string).c_str);
1667 parser_abort(context, buffer);
1668 }
1669 }
1670 break;
1671
1672 case 15:
1673
1674 /* Line 1806 of yacc.c */
1675 #line 258 "libmemcached/csl/parser.yy"
1676 {
1677 memcached_set_configuration_file(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).size);
1678 }
1679 break;
1680
1681 case 16:
1682
1683 /* Line 1806 of yacc.c */
1684 #line 262 "libmemcached/csl/parser.yy"
1685 {
1686 context->memc->configure.initial_pool_size= (yyvsp[(2) - (2)].number);
1687 }
1688 break;
1689
1690 case 17:
1691
1692 /* Line 1806 of yacc.c */
1693 #line 266 "libmemcached/csl/parser.yy"
1694 {
1695 context->memc->configure.max_pool_size= (yyvsp[(2) - (2)].number);
1696 }
1697 break;
1698
1699 case 19:
1700
1701 /* Line 1806 of yacc.c */
1702 #line 274 "libmemcached/csl/parser.yy"
1703 {
1704 if (memcached_callback_get(context->memc, MEMCACHED_CALLBACK_PREFIX_KEY, NULL))
1705 {
1706 parser_abort(context, "--NAMESPACE can only be called once");
1707 }
1708
1709 if ((context->rc= memcached_set_namespace(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).size)) != MEMCACHED_SUCCESS)
1710 {
1711 parser_abort(context, memcached_last_error_message(context->memc));
1712 }
1713 }
1714 break;
1715
1716 case 20:
1717
1718 /* Line 1806 of yacc.c */
1719 #line 286 "libmemcached/csl/parser.yy"
1720 {
1721 // Check to see if DISTRIBUTION has already been set
1722 if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (2)].distribution))) != MEMCACHED_SUCCESS)
1723 {
1724 parser_abort(context, "--DISTRIBUTION can only be called once");
1725 }
1726
1727 if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (2)].distribution))) != MEMCACHED_SUCCESS)
1728 {
1729 parser_abort(context, memcached_last_error_message(context->memc));;
1730 }
1731 }
1732 break;
1733
1734 case 21:
1735
1736 /* Line 1806 of yacc.c */
1737 #line 299 "libmemcached/csl/parser.yy"
1738 {
1739 // Check to see if DISTRIBUTION has already been set
1740 if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (4)].distribution))) != MEMCACHED_SUCCESS)
1741 {
1742 parser_abort(context, "--DISTRIBUTION can only be called once");
1743 }
1744
1745 if ((context->rc= memcached_behavior_set_distribution_hash(context->memc, (yyvsp[(4) - (4)].hash))) != MEMCACHED_SUCCESS)
1746 {
1747 parser_abort(context, "Unable to set the hash for the DISTRIBUTION requested");
1748 }
1749 }
1750 break;
1751
1752 case 22:
1753
1754 /* Line 1806 of yacc.c */
1755 #line 312 "libmemcached/csl/parser.yy"
1756 {
1757 if (context->set_hash((yyvsp[(2) - (2)].hash)) == false)
1758 {
1759 parser_abort(context, "--HASH can only be set once");
1760 }
1761 }
1762 break;
1763
1764 case 23:
1765
1766 /* Line 1806 of yacc.c */
1767 #line 319 "libmemcached/csl/parser.yy"
1768 {
1769 if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (2)].behavior), (yyvsp[(2) - (2)].number))) != MEMCACHED_SUCCESS)
1770 {
1771 parser_abort(context, "Unable to set behavior");
1772 }
1773 }
1774 break;
1775
1776 case 24:
1777
1778 /* Line 1806 of yacc.c */
1779 #line 326 "libmemcached/csl/parser.yy"
1780 {
1781 if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (1)].behavior), true)) != MEMCACHED_SUCCESS)
1782 {
1783 char buffer[1024];
1784 snprintf(buffer, sizeof(buffer), "Could not set: %s", libmemcached_string_behavior((yyvsp[(1) - (1)].behavior)));
1785 parser_abort(context, buffer);
1786 }
1787 }
1788 break;
1789
1790 case 25:
1791
1792 /* Line 1806 of yacc.c */
1793 #line 335 "libmemcached/csl/parser.yy"
1794 {
1795 }
1796 break;
1797
1798 case 26:
1799
1800 /* Line 1806 of yacc.c */
1801 #line 341 "libmemcached/csl/parser.yy"
1802 {
1803 (yyval.behavior)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS;
1804 }
1805 break;
1806
1807 case 27:
1808
1809 /* Line 1806 of yacc.c */
1810 #line 345 "libmemcached/csl/parser.yy"
1811 {
1812 (yyval.behavior)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT;
1813 }
1814 break;
1815
1816 case 28:
1817
1818 /* Line 1806 of yacc.c */
1819 #line 349 "libmemcached/csl/parser.yy"
1820 {
1821 (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK;
1822 }
1823 break;
1824
1825 case 29:
1826
1827 /* Line 1806 of yacc.c */
1828 #line 353 "libmemcached/csl/parser.yy"
1829 {
1830 (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK;
1831 }
1832 break;
1833
1834 case 30:
1835
1836 /* Line 1806 of yacc.c */
1837 #line 357 "libmemcached/csl/parser.yy"
1838 {
1839 (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH;
1840 }
1841 break;
1842
1843 case 31:
1844
1845 /* Line 1806 of yacc.c */
1846 #line 361 "libmemcached/csl/parser.yy"
1847 {
1848 (yyval.behavior)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS;
1849 }
1850 break;
1851
1852 case 32:
1853
1854 /* Line 1806 of yacc.c */
1855 #line 365 "libmemcached/csl/parser.yy"
1856 {
1857 (yyval.behavior)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT;
1858 }
1859 break;
1860
1861 case 33:
1862
1863 /* Line 1806 of yacc.c */
1864 #line 369 "libmemcached/csl/parser.yy"
1865 {
1866 (yyval.behavior)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT;
1867 }
1868 break;
1869
1870 case 34:
1871
1872 /* Line 1806 of yacc.c */
1873 #line 373 "libmemcached/csl/parser.yy"
1874 {
1875 (yyval.behavior)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT;
1876 }
1877 break;
1878
1879 case 35:
1880
1881 /* Line 1806 of yacc.c */
1882 #line 377 "libmemcached/csl/parser.yy"
1883 {
1884 (yyval.behavior)= MEMCACHED_BEHAVIOR_SND_TIMEOUT;
1885 }
1886 break;
1887
1888 case 36:
1889
1890 /* Line 1806 of yacc.c */
1891 #line 381 "libmemcached/csl/parser.yy"
1892 {
1893 (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE;
1894 }
1895 break;
1896
1897 case 37:
1898
1899 /* Line 1806 of yacc.c */
1900 #line 385 "libmemcached/csl/parser.yy"
1901 {
1902 (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE;
1903 }
1904 break;
1905
1906 case 38:
1907
1908 /* Line 1806 of yacc.c */
1909 #line 392 "libmemcached/csl/parser.yy"
1910 {
1911 (yyval.behavior)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL;
1912 }
1913 break;
1914
1915 case 39:
1916
1917 /* Line 1806 of yacc.c */
1918 #line 396 "libmemcached/csl/parser.yy"
1919 {
1920 (yyval.behavior)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS;
1921 }
1922 break;
1923
1924 case 40:
1925
1926 /* Line 1806 of yacc.c */
1927 #line 400 "libmemcached/csl/parser.yy"
1928 {
1929 (yyval.behavior)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY;
1930 }
1931 break;
1932
1933 case 41:
1934
1935 /* Line 1806 of yacc.c */
1936 #line 404 "libmemcached/csl/parser.yy"
1937 {
1938 (yyval.behavior)= MEMCACHED_BEHAVIOR_NOREPLY;
1939 }
1940 break;
1941
1942 case 42:
1943
1944 /* Line 1806 of yacc.c */
1945 #line 408 "libmemcached/csl/parser.yy"
1946 {
1947 (yyval.behavior)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ;
1948 }
1949 break;
1950
1951 case 43:
1952
1953 /* Line 1806 of yacc.c */
1954 #line 412 "libmemcached/csl/parser.yy"
1955 {
1956 (yyval.behavior)= MEMCACHED_BEHAVIOR_SORT_HOSTS;
1957 }
1958 break;
1959
1960 case 44:
1961
1962 /* Line 1806 of yacc.c */
1963 #line 416 "libmemcached/csl/parser.yy"
1964 {
1965 (yyval.behavior)= MEMCACHED_BEHAVIOR_SUPPORT_CAS;
1966 }
1967 break;
1968
1969 case 45:
1970
1971 /* Line 1806 of yacc.c */
1972 #line 420 "libmemcached/csl/parser.yy"
1973 {
1974 (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_NODELAY;
1975 }
1976 break;
1977
1978 case 46:
1979
1980 /* Line 1806 of yacc.c */
1981 #line 424 "libmemcached/csl/parser.yy"
1982 {
1983 (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE;
1984 }
1985 break;
1986
1987 case 47:
1988
1989 /* Line 1806 of yacc.c */
1990 #line 428 "libmemcached/csl/parser.yy"
1991 {
1992 (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE;
1993 }
1994 break;
1995
1996 case 48:
1997
1998 /* Line 1806 of yacc.c */
1999 #line 432 "libmemcached/csl/parser.yy"
2000 {
2001 (yyval.behavior)= MEMCACHED_BEHAVIOR_USE_UDP;
2002 }
2003 break;
2004
2005 case 49:
2006
2007 /* Line 1806 of yacc.c */
2008 #line 436 "libmemcached/csl/parser.yy"
2009 {
2010 (yyval.behavior)= MEMCACHED_BEHAVIOR_VERIFY_KEY;
2011 }
2012 break;
2013
2014 case 50:
2015
2016 /* Line 1806 of yacc.c */
2017 #line 442 "libmemcached/csl/parser.yy"
2018 { (yyval.number)= MEMCACHED_DEFAULT_PORT;}
2019 break;
2020
2021 case 51:
2022
2023 /* Line 1806 of yacc.c */
2024 #line 444 "libmemcached/csl/parser.yy"
2025 { }
2026 break;
2027
2028 case 52:
2029
2030 /* Line 1806 of yacc.c */
2031 #line 448 "libmemcached/csl/parser.yy"
2032 { (yyval.number)= 1; }
2033 break;
2034
2035 case 53:
2036
2037 /* Line 1806 of yacc.c */
2038 #line 450 "libmemcached/csl/parser.yy"
2039 { }
2040 break;
2041
2042 case 54:
2043
2044 /* Line 1806 of yacc.c */
2045 #line 455 "libmemcached/csl/parser.yy"
2046 {
2047 (yyval.hash)= MEMCACHED_HASH_MD5;
2048 }
2049 break;
2050
2051 case 55:
2052
2053 /* Line 1806 of yacc.c */
2054 #line 459 "libmemcached/csl/parser.yy"
2055 {
2056 (yyval.hash)= MEMCACHED_HASH_CRC;
2057 }
2058 break;
2059
2060 case 56:
2061
2062 /* Line 1806 of yacc.c */
2063 #line 463 "libmemcached/csl/parser.yy"
2064 {
2065 (yyval.hash)= MEMCACHED_HASH_FNV1_64;
2066 }
2067 break;
2068
2069 case 57:
2070
2071 /* Line 1806 of yacc.c */
2072 #line 467 "libmemcached/csl/parser.yy"
2073 {
2074 (yyval.hash)= MEMCACHED_HASH_FNV1A_64;
2075 }
2076 break;
2077
2078 case 58:
2079
2080 /* Line 1806 of yacc.c */
2081 #line 471 "libmemcached/csl/parser.yy"
2082 {
2083 (yyval.hash)= MEMCACHED_HASH_FNV1_32;
2084 }
2085 break;
2086
2087 case 59:
2088
2089 /* Line 1806 of yacc.c */
2090 #line 475 "libmemcached/csl/parser.yy"
2091 {
2092 (yyval.hash)= MEMCACHED_HASH_FNV1A_32;
2093 }
2094 break;
2095
2096 case 60:
2097
2098 /* Line 1806 of yacc.c */
2099 #line 479 "libmemcached/csl/parser.yy"
2100 {
2101 (yyval.hash)= MEMCACHED_HASH_HSIEH;
2102 }
2103 break;
2104
2105 case 61:
2106
2107 /* Line 1806 of yacc.c */
2108 #line 483 "libmemcached/csl/parser.yy"
2109 {
2110 (yyval.hash)= MEMCACHED_HASH_MURMUR;
2111 }
2112 break;
2113
2114 case 62:
2115
2116 /* Line 1806 of yacc.c */
2117 #line 487 "libmemcached/csl/parser.yy"
2118 {
2119 (yyval.hash)= MEMCACHED_HASH_JENKINS;
2120 }
2121 break;
2122
2123 case 63:
2124
2125 /* Line 1806 of yacc.c */
2126 #line 494 "libmemcached/csl/parser.yy"
2127 {
2128 (yyval.string)= (yyvsp[(1) - (1)].string);
2129 }
2130 break;
2131
2132 case 64:
2133
2134 /* Line 1806 of yacc.c */
2135 #line 498 "libmemcached/csl/parser.yy"
2136 {
2137 (yyval.string)= (yyvsp[(1) - (1)].string);
2138 }
2139 break;
2140
2141 case 65:
2142
2143 /* Line 1806 of yacc.c */
2144 #line 505 "libmemcached/csl/parser.yy"
2145 {
2146 (yyval.distribution)= MEMCACHED_DISTRIBUTION_CONSISTENT;
2147 }
2148 break;
2149
2150 case 66:
2151
2152 /* Line 1806 of yacc.c */
2153 #line 509 "libmemcached/csl/parser.yy"
2154 {
2155 (yyval.distribution)= MEMCACHED_DISTRIBUTION_MODULA;
2156 }
2157 break;
2158
2159 case 67:
2160
2161 /* Line 1806 of yacc.c */
2162 #line 513 "libmemcached/csl/parser.yy"
2163 {
2164 (yyval.distribution)= MEMCACHED_DISTRIBUTION_RANDOM;
2165 }
2166 break;
2167
2168
2169
2170 /* Line 1806 of yacc.c */
2171 #line 2172 "libmemcached/csl/parser.cc"
2172 default: break;
2173 }
2174 /* User semantic actions sometimes alter yychar, and that requires
2175 that yytoken be updated with the new translation. We take the
2176 approach of translating immediately before every use of yytoken.
2177 One alternative is translating here after every semantic action,
2178 but that translation would be missed if the semantic action invokes
2179 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2180 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2181 incorrect destructor might then be invoked immediately. In the
2182 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2183 to an incorrect destructor call or verbose syntax error message
2184 before the lookahead is translated. */
2185 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2186
2187 YYPOPSTACK (yylen);
2188 yylen = 0;
2189 YY_STACK_PRINT (yyss, yyssp);
2190
2191 *++yyvsp = yyval;
2192
2193 /* Now `shift' the result of the reduction. Determine what state
2194 that goes to, based on the state we popped back to and the rule
2195 number reduced by. */
2196
2197 yyn = yyr1[yyn];
2198
2199 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2200 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2201 yystate = yytable[yystate];
2202 else
2203 yystate = yydefgoto[yyn - YYNTOKENS];
2204
2205 goto yynewstate;
2206
2207
2208 /*------------------------------------.
2209 | yyerrlab -- here on detecting error |
2210 `------------------------------------*/
2211 yyerrlab:
2212 /* Make sure we have latest lookahead translation. See comments at
2213 user semantic actions for why this is necessary. */
2214 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2215
2216 /* If not already recovering from an error, report this error. */
2217 if (!yyerrstatus)
2218 {
2219 ++yynerrs;
2220 #if ! YYERROR_VERBOSE
2221 yyerror (context, scanner, YY_("syntax error"));
2222 #else
2223 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2224 yyssp, yytoken)
2225 {
2226 char const *yymsgp = YY_("syntax error");
2227 int yysyntax_error_status;
2228 yysyntax_error_status = YYSYNTAX_ERROR;
2229 if (yysyntax_error_status == 0)
2230 yymsgp = yymsg;
2231 else if (yysyntax_error_status == 1)
2232 {
2233 if (yymsg != yymsgbuf)
2234 YYSTACK_FREE (yymsg);
2235 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2236 if (!yymsg)
2237 {
2238 yymsg = yymsgbuf;
2239 yymsg_alloc = sizeof yymsgbuf;
2240 yysyntax_error_status = 2;
2241 }
2242 else
2243 {
2244 yysyntax_error_status = YYSYNTAX_ERROR;
2245 yymsgp = yymsg;
2246 }
2247 }
2248 yyerror (context, scanner, yymsgp);
2249 if (yysyntax_error_status == 2)
2250 goto yyexhaustedlab;
2251 }
2252 # undef YYSYNTAX_ERROR
2253 #endif
2254 }
2255
2256
2257
2258 if (yyerrstatus == 3)
2259 {
2260 /* If just tried and failed to reuse lookahead token after an
2261 error, discard it. */
2262
2263 if (yychar <= YYEOF)
2264 {
2265 /* Return failure if at end of input. */
2266 if (yychar == YYEOF)
2267 YYABORT;
2268 }
2269 else
2270 {
2271 yydestruct ("Error: discarding",
2272 yytoken, &yylval, context, scanner);
2273 yychar = YYEMPTY;
2274 }
2275 }
2276
2277 /* Else will try to reuse lookahead token after shifting the error
2278 token. */
2279 goto yyerrlab1;
2280
2281
2282 /*---------------------------------------------------.
2283 | yyerrorlab -- error raised explicitly by YYERROR. |
2284 `---------------------------------------------------*/
2285 yyerrorlab:
2286
2287 /* Pacify compilers like GCC when the user code never invokes
2288 YYERROR and the label yyerrorlab therefore never appears in user
2289 code. */
2290 if (/*CONSTCOND*/ 0)
2291 goto yyerrorlab;
2292
2293 /* Do not reclaim the symbols of the rule which action triggered
2294 this YYERROR. */
2295 YYPOPSTACK (yylen);
2296 yylen = 0;
2297 YY_STACK_PRINT (yyss, yyssp);
2298 yystate = *yyssp;
2299 goto yyerrlab1;
2300
2301
2302 /*-------------------------------------------------------------.
2303 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2304 `-------------------------------------------------------------*/
2305 yyerrlab1:
2306 yyerrstatus = 3; /* Each real token shifted decrements this. */
2307
2308 for (;;)
2309 {
2310 yyn = yypact[yystate];
2311 if (!yypact_value_is_default (yyn))
2312 {
2313 yyn += YYTERROR;
2314 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2315 {
2316 yyn = yytable[yyn];
2317 if (0 < yyn)
2318 break;
2319 }
2320 }
2321
2322 /* Pop the current state because it cannot handle the error token. */
2323 if (yyssp == yyss)
2324 YYABORT;
2325
2326
2327 yydestruct ("Error: popping",
2328 yystos[yystate], yyvsp, context, scanner);
2329 YYPOPSTACK (1);
2330 yystate = *yyssp;
2331 YY_STACK_PRINT (yyss, yyssp);
2332 }
2333
2334 *++yyvsp = yylval;
2335
2336
2337 /* Shift the error token. */
2338 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2339
2340 yystate = yyn;
2341 goto yynewstate;
2342
2343
2344 /*-------------------------------------.
2345 | yyacceptlab -- YYACCEPT comes here. |
2346 `-------------------------------------*/
2347 yyacceptlab:
2348 yyresult = 0;
2349 goto yyreturn;
2350
2351 /*-----------------------------------.
2352 | yyabortlab -- YYABORT comes here. |
2353 `-----------------------------------*/
2354 yyabortlab:
2355 yyresult = 1;
2356 goto yyreturn;
2357
2358 #if !defined(yyoverflow) || YYERROR_VERBOSE
2359 /*-------------------------------------------------.
2360 | yyexhaustedlab -- memory exhaustion comes here. |
2361 `-------------------------------------------------*/
2362 yyexhaustedlab:
2363 yyerror (context, scanner, YY_("memory exhausted"));
2364 yyresult = 2;
2365 /* Fall through. */
2366 #endif
2367
2368 yyreturn:
2369 if (yychar != YYEMPTY)
2370 {
2371 /* Make sure we have latest lookahead translation. See comments at
2372 user semantic actions for why this is necessary. */
2373 yytoken = YYTRANSLATE (yychar);
2374 yydestruct ("Cleanup: discarding lookahead",
2375 yytoken, &yylval, context, scanner);
2376 }
2377 /* Do not reclaim the symbols of the rule which action triggered
2378 this YYABORT or YYACCEPT. */
2379 YYPOPSTACK (yylen);
2380 YY_STACK_PRINT (yyss, yyssp);
2381 while (yyssp != yyss)
2382 {
2383 yydestruct ("Cleanup: popping",
2384 yystos[*yyssp], yyvsp, context, scanner);
2385 YYPOPSTACK (1);
2386 }
2387 #ifndef yyoverflow
2388 if (yyss != yyssa)
2389 YYSTACK_FREE (yyss);
2390 #endif
2391 #if YYERROR_VERBOSE
2392 if (yymsg != yymsgbuf)
2393 YYSTACK_FREE (yymsg);
2394 #endif
2395 /* Make sure YYID is used. */
2396 return YYID (yyresult);
2397 }
2398
2399
2400
2401 /* Line 2067 of yacc.c */
2402 #line 518 "libmemcached/csl/parser.yy"
2403
2404
2405 void Context::start()
2406 {
2407 config_parse(this, (void **)scanner);
2408 }
2409
2410