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