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