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