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