Merge in namespace fixes for binary protocol.
[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/common.h>
86 #include <libmemcached/options.hpp>
87
88 #include <libmemcached/options/context.h>
89 #include <libmemcached/options/symbol.h>
90 #include <libmemcached/options/scanner.h>
91
92 #pragma GCC diagnostic ignored "-Wold-style-cast"
93
94 int conf_lex(YYSTYPE* lvalp, void* scanner);
95
96 #define parser_abort(A, B) do { (A)->abort((B)); YYABORT; } while (0)
97
98 inline void config_error(Context *context, yyscan_t *scanner, const char *error)
99 {
100 if (not context->end())
101 context->abort(error);
102 }
103
104
105
106 /* Line 189 of yacc.c */
107 #line 108 "libmemcached/options/parser.cc"
108
109 /* Enabling traces. */
110 #ifndef YYDEBUG
111 # define YYDEBUG 1
112 #endif
113
114 /* Enabling verbose error messages. */
115 #ifdef YYERROR_VERBOSE
116 # undef YYERROR_VERBOSE
117 # define YYERROR_VERBOSE 1
118 #else
119 # define YYERROR_VERBOSE 1
120 #endif
121
122 /* Enabling the token table. */
123 #ifndef YYTOKEN_TABLE
124 # define YYTOKEN_TABLE 0
125 #endif
126
127
128 /* Tokens. */
129 #ifndef YYTOKENTYPE
130 # define YYTOKENTYPE
131 /* Put the tokens into the symbol table, so that GDB and other debuggers
132 know about them. */
133 enum yytokentype {
134 COMMENT = 258,
135 END = 259,
136 ERROR = 260,
137 RESET = 261,
138 PARSER_DEBUG = 262,
139 INCLUDE = 263,
140 CONFIGURE_FILE = 264,
141 EMPTY_LINE = 265,
142 SERVER = 266,
143 SERVERS = 267,
144 SERVERS_OPTION = 268,
145 UNKNOWN_OPTION = 269,
146 UNKNOWN = 270,
147 BINARY_PROTOCOL = 271,
148 BUFFER_REQUESTS = 272,
149 CONNECT_TIMEOUT = 273,
150 DISTRIBUTION = 274,
151 HASH = 275,
152 HASH_WITH_NAMESPACE = 276,
153 IO_BYTES_WATERMARK = 277,
154 IO_KEY_PREFETCH = 278,
155 IO_MSG_WATERMARK = 279,
156 KETAMA_HASH = 280,
157 KETAMA_WEIGHTED = 281,
158 NOREPLY = 282,
159 NUMBER_OF_REPLICAS = 283,
160 POLL_TIMEOUT = 284,
161 RANDOMIZE_REPLICA_READ = 285,
162 RCV_TIMEOUT = 286,
163 REMOVE_FAILED_SERVERS = 287,
164 RETRY_TIMEOUT = 288,
165 SND_TIMEOUT = 289,
166 SOCKET_RECV_SIZE = 290,
167 SOCKET_SEND_SIZE = 291,
168 SORT_HOSTS = 292,
169 SUPPORT_CAS = 293,
170 USER_DATA = 294,
171 USE_UDP = 295,
172 VERIFY_KEY = 296,
173 _TCP_KEEPALIVE = 297,
174 _TCP_KEEPIDLE = 298,
175 _TCP_NODELAY = 299,
176 NAMESPACE = 300,
177 POOL_MIN = 301,
178 POOL_MAX = 302,
179 MD5 = 303,
180 CRC = 304,
181 FNV1_64 = 305,
182 FNV1A_64 = 306,
183 FNV1_32 = 307,
184 FNV1A_32 = 308,
185 HSIEH = 309,
186 MURMUR = 310,
187 JENKINS = 311,
188 CONSISTENT = 312,
189 MODULA = 313,
190 RANDOM = 314,
191 TRUE = 315,
192 FALSE = 316,
193 FLOAT = 317,
194 NUMBER = 318,
195 PORT = 319,
196 WEIGHT_START = 320,
197 IPADDRESS = 321,
198 HOSTNAME = 322,
199 STRING = 323,
200 QUOTED_STRING = 324,
201 FILE_PATH = 325
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 69
432 /* YYLAST -- Last index in YYTABLE. */
433 #define YYLAST 73
434
435 /* YYNTOKENS -- Number of terminals. */
436 #define YYNTOKENS 74
437 /* YYNNTS -- Number of nonterminals. */
438 #define YYNNTS 12
439 /* YYNRULES -- Number of rules. */
440 #define YYNRULES 66
441 /* YYNRULES -- Number of states. */
442 #define YYNSTATES 82
443
444 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
445 #define YYUNDEFTOK 2
446 #define YYMAXUTOK 325
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, 73, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 62, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 63, 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, 61, 64, 65, 66,
486 67, 68, 69, 70, 71, 72
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, 32, 37, 40, 43, 46, 48, 51,
496 54, 59, 62, 65, 67, 69, 71, 73, 75, 77,
497 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
498 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
499 118, 120, 121, 123, 125, 127, 129, 131, 133, 135,
500 137, 139, 141, 143, 145, 147, 149
501 };
502
503 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
504 static const yytype_int8 yyrhs[] =
505 {
506 75, 0, -1, 76, -1, 75, 73, 76, -1, 77,
507 -1, 3, -1, 10, -1, 4, -1, 5, -1, 6,
508 -1, 7, -1, 8, 73, 84, -1, 11, 69, 81,
509 82, -1, 11, 68, 81, 82, -1, 9, 84, -1,
510 46, 65, -1, 47, 65, -1, 78, -1, 45, 84,
511 -1, 19, 85, -1, 19, 85, 62, 83, -1, 20,
512 83, -1, 79, 65, -1, 80, -1, 39, -1, 32,
513 -1, 18, -1, 24, -1, 22, -1, 23, -1, 28,
514 -1, 29, -1, 31, -1, 33, -1, 34, -1, 35,
515 -1, 36, -1, 16, -1, 17, -1, 21, -1, 27,
516 -1, 30, -1, 37, -1, 38, -1, 44, -1, 42,
517 -1, 43, -1, 40, -1, 41, -1, -1, 66, -1,
518 -1, 67, -1, 48, -1, 49, -1, 50, -1, 51,
519 -1, 52, -1, 53, -1, 54, -1, 55, -1, 56,
520 -1, 70, -1, 71, -1, 57, -1, 58, -1, 59,
521 -1
522 };
523
524 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
525 static const yytype_uint16 yyrline[] =
526 {
527 0, 159, 159, 160, 164, 166, 168, 170, 175, 180,
528 184, 188, 199, 207, 215, 219, 223, 227, 231, 238,
529 245, 256, 263, 270, 277, 283, 287, 291, 295, 299,
530 303, 307, 311, 315, 319, 323, 327, 334, 338, 342,
531 346, 350, 354, 358, 362, 366, 370, 374, 378, 385,
532 386, 391, 392, 397, 401, 405, 409, 413, 417, 421,
533 425, 429, 436, 440, 448, 452, 456
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 "BINARY_PROTOCOL", "BUFFER_REQUESTS", "CONNECT_TIMEOUT", "DISTRIBUTION",
546 "HASH", "HASH_WITH_NAMESPACE", "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH",
547 "IO_MSG_WATERMARK", "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY",
548 "NUMBER_OF_REPLICAS", "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ",
549 "RCV_TIMEOUT", "REMOVE_FAILED_SERVERS", "RETRY_TIMEOUT", "SND_TIMEOUT",
550 "SOCKET_RECV_SIZE", "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS",
551 "USER_DATA", "USE_UDP", "VERIFY_KEY", "_TCP_KEEPALIVE", "_TCP_KEEPIDLE",
552 "_TCP_NODELAY", "NAMESPACE", "POOL_MIN", "POOL_MAX", "MD5", "CRC",
553 "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32", "HSIEH", "MURMUR",
554 "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE", "FALSE", "','",
555 "'='", "FLOAT", "NUMBER", "PORT", "WEIGHT_START", "IPADDRESS",
556 "HOSTNAME", "STRING", "QUOTED_STRING", "FILE_PATH", "' '", "$accept",
557 "begin", "statement", "expression", "behaviors", "behavior_number",
558 "behavior_boolean", "optional_port", "optional_weight", "hash", "string",
559 "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, 316, 44, 61, 317, 318, 319, 320, 321, 322,
575 323, 324, 325, 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, 74, 75, 75, 76, 76, 76, 76, 76, 76,
583 76, 76, 77, 77, 77, 77, 77, 77, 78, 78,
584 78, 78, 78, 78, 78, 79, 79, 79, 79, 79,
585 79, 79, 79, 79, 79, 79, 79, 80, 80, 80,
586 80, 80, 80, 80, 80, 80, 80, 80, 80, 81,
587 81, 82, 82, 83, 83, 83, 83, 83, 83, 83,
588 83, 83, 84, 84, 85, 85, 85
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, 4, 4, 2, 2, 2, 1, 2, 2,
596 4, 2, 2, 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, 0,
599 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
600 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 37, 38, 26, 0, 0, 39, 28, 29, 27, 40,
610 30, 31, 41, 32, 25, 33, 34, 35, 36, 42,
611 43, 24, 47, 48, 45, 46, 44, 0, 0, 0,
612 0, 2, 4, 17, 0, 23, 0, 62, 63, 14,
613 49, 49, 64, 65, 66, 19, 53, 54, 55, 56,
614 57, 58, 59, 60, 61, 21, 18, 15, 16, 1,
615 0, 22, 11, 50, 51, 51, 0, 3, 52, 13,
616 12, 20
617 };
618
619 /* YYDEFGOTO[NTERM-NUM]. */
620 static const yytype_int8 yydefgoto[] =
621 {
622 -1, 40, 41, 42, 43, 44, 45, 74, 79, 65,
623 49, 55
624 };
625
626 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
627 STATE-NUM. */
628 #define YYPACT_NINF -61
629 static const yytype_int8 yypact[] =
630 {
631 -2, -61, -61, -61, -61, -61, -60, -23, -61, -45,
632 -61, -61, -61, -47, 8, -61, -61, -61, -61, -61,
633 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
634 -61, -61, -61, -61, -61, -61, -61, -23, -16, -15,
635 0, -61, -61, -61, -14, -61, -23, -61, -61, -61,
636 -13, -13, -61, -61, -61, -10, -61, -61, -61, -61,
637 -61, -61, -61, -61, -61, -61, -61, -61, -61, -61,
638 -2, -61, -61, -61, -1, -1, 8, -61, -61, -61,
639 -61, -61
640 };
641
642 /* YYPGOTO[NTERM-NUM]. */
643 static const yytype_int8 yypgoto[] =
644 {
645 -61, -61, -5, -61, -61, -61, -61, 3, -8, -7,
646 9, -61
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 69, 1, 2, 3, 4, 5, 6, 7, 8, 9,
657 52, 53, 54, 46, 10, 11, 12, 13, 14, 15,
658 16, 17, 18, 50, 51, 19, 20, 21, 22, 23,
659 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
660 34, 35, 36, 37, 38, 39, 66, 47, 48, 67,
661 68, 71, 76, 73, 75, 72, 56, 57, 58, 59,
662 60, 61, 62, 63, 64, 77, 78, 80, 0, 81,
663 0, 0, 0, 70
664 };
665
666 static const yytype_int8 yycheck[] =
667 {
668 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
669 57, 58, 59, 73, 16, 17, 18, 19, 20, 21,
670 22, 23, 24, 68, 69, 27, 28, 29, 30, 31,
671 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
672 42, 43, 44, 45, 46, 47, 37, 70, 71, 65,
673 65, 65, 62, 66, 51, 46, 48, 49, 50, 51,
674 52, 53, 54, 55, 56, 70, 67, 75, -1, 76,
675 -1, -1, -1, 73
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 16, 17, 18, 19, 20, 21, 22, 23, 24, 27,
684 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
685 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
686 75, 76, 77, 78, 79, 80, 73, 70, 71, 84,
687 68, 69, 57, 58, 59, 85, 48, 49, 50, 51,
688 52, 53, 54, 55, 56, 83, 84, 65, 65, 0,
689 73, 65, 84, 66, 81, 81, 62, 76, 67, 82,
690 82, 83
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 165 "libmemcached/options/parser.yy"
1526 { ;}
1527 break;
1528
1529 case 5:
1530
1531 /* Line 1464 of yacc.c */
1532 #line 167 "libmemcached/options/parser.yy"
1533 { ;}
1534 break;
1535
1536 case 6:
1537
1538 /* Line 1464 of yacc.c */
1539 #line 169 "libmemcached/options/parser.yy"
1540 { ;}
1541 break;
1542
1543 case 7:
1544
1545 /* Line 1464 of yacc.c */
1546 #line 171 "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 176 "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 181 "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 185 "libmemcached/options/parser.yy"
1576 {
1577 yydebug= 1;
1578 ;}
1579 break;
1580
1581 case 11:
1582
1583 /* Line 1464 of yacc.c */
1584 #line 189 "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).size)) != 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 200 "libmemcached/options/parser.yy"
1597 {
1598 if (memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(3) - (4)].number), (yyvsp[(4) - (4)].number))))
1599 {
1600 parser_abort(context, NULL);
1601 }
1602 context->unset_server();
1603 ;}
1604 break;
1605
1606 case 13:
1607
1608 /* Line 1464 of yacc.c */
1609 #line 208 "libmemcached/options/parser.yy"
1610 {
1611 if (memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(3) - (4)].number), (yyvsp[(4) - (4)].number))))
1612 {
1613 parser_abort(context, NULL);
1614 }
1615 context->unset_server();
1616 ;}
1617 break;
1618
1619 case 14:
1620
1621 /* Line 1464 of yacc.c */
1622 #line 216 "libmemcached/options/parser.yy"
1623 {
1624 memcached_set_configuration_file(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).size);
1625 ;}
1626 break;
1627
1628 case 15:
1629
1630 /* Line 1464 of yacc.c */
1631 #line 220 "libmemcached/options/parser.yy"
1632 {
1633 context->memc->configure.initial_pool_size= (yyvsp[(2) - (2)].number);
1634 ;}
1635 break;
1636
1637 case 16:
1638
1639 /* Line 1464 of yacc.c */
1640 #line 224 "libmemcached/options/parser.yy"
1641 {
1642 context->memc->configure.max_pool_size= (yyvsp[(2) - (2)].number);
1643 ;}
1644 break;
1645
1646 case 18:
1647
1648 /* Line 1464 of yacc.c */
1649 #line 232 "libmemcached/options/parser.yy"
1650 {
1651 if ((context->rc= memcached_set_namespace(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).size)) != MEMCACHED_SUCCESS)
1652 {
1653 parser_abort(context, NULL);;
1654 }
1655 ;}
1656 break;
1657
1658 case 19:
1659
1660 /* Line 1464 of yacc.c */
1661 #line 239 "libmemcached/options/parser.yy"
1662 {
1663 if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (2)].distribution))) != MEMCACHED_SUCCESS)
1664 {
1665 parser_abort(context, NULL);;
1666 }
1667 ;}
1668 break;
1669
1670 case 20:
1671
1672 /* Line 1464 of yacc.c */
1673 #line 246 "libmemcached/options/parser.yy"
1674 {
1675 if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (4)].distribution))) != MEMCACHED_SUCCESS)
1676 {
1677 parser_abort(context, NULL);;
1678 }
1679 if ((context->rc= memcached_behavior_set_distribution_hash(context->memc, (yyvsp[(4) - (4)].hash))) != 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 257 "libmemcached/options/parser.yy"
1690 {
1691 if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_HASH, (yyvsp[(2) - (2)].hash))) != 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 264 "libmemcached/options/parser.yy"
1702 {
1703 if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (2)].behavior), (yyvsp[(2) - (2)].number))) != MEMCACHED_SUCCESS)
1704 {
1705 parser_abort(context, NULL);;
1706 }
1707 ;}
1708 break;
1709
1710 case 23:
1711
1712 /* Line 1464 of yacc.c */
1713 #line 271 "libmemcached/options/parser.yy"
1714 {
1715 if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (1)].behavior), true)) != MEMCACHED_SUCCESS)
1716 {
1717 parser_abort(context, NULL);;
1718 }
1719 ;}
1720 break;
1721
1722 case 24:
1723
1724 /* Line 1464 of yacc.c */
1725 #line 278 "libmemcached/options/parser.yy"
1726 {
1727 ;}
1728 break;
1729
1730 case 25:
1731
1732 /* Line 1464 of yacc.c */
1733 #line 284 "libmemcached/options/parser.yy"
1734 {
1735 (yyval.behavior)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS;
1736 ;}
1737 break;
1738
1739 case 26:
1740
1741 /* Line 1464 of yacc.c */
1742 #line 288 "libmemcached/options/parser.yy"
1743 {
1744 (yyval.behavior)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT;
1745 ;}
1746 break;
1747
1748 case 27:
1749
1750 /* Line 1464 of yacc.c */
1751 #line 292 "libmemcached/options/parser.yy"
1752 {
1753 (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK;
1754 ;}
1755 break;
1756
1757 case 28:
1758
1759 /* Line 1464 of yacc.c */
1760 #line 296 "libmemcached/options/parser.yy"
1761 {
1762 (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK;
1763 ;}
1764 break;
1765
1766 case 29:
1767
1768 /* Line 1464 of yacc.c */
1769 #line 300 "libmemcached/options/parser.yy"
1770 {
1771 (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH;
1772 ;}
1773 break;
1774
1775 case 30:
1776
1777 /* Line 1464 of yacc.c */
1778 #line 304 "libmemcached/options/parser.yy"
1779 {
1780 (yyval.behavior)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS;
1781 ;}
1782 break;
1783
1784 case 31:
1785
1786 /* Line 1464 of yacc.c */
1787 #line 308 "libmemcached/options/parser.yy"
1788 {
1789 (yyval.behavior)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT;
1790 ;}
1791 break;
1792
1793 case 32:
1794
1795 /* Line 1464 of yacc.c */
1796 #line 312 "libmemcached/options/parser.yy"
1797 {
1798 (yyval.behavior)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT;
1799 ;}
1800 break;
1801
1802 case 33:
1803
1804 /* Line 1464 of yacc.c */
1805 #line 316 "libmemcached/options/parser.yy"
1806 {
1807 (yyval.behavior)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT;
1808 ;}
1809 break;
1810
1811 case 34:
1812
1813 /* Line 1464 of yacc.c */
1814 #line 320 "libmemcached/options/parser.yy"
1815 {
1816 (yyval.behavior)= MEMCACHED_BEHAVIOR_SND_TIMEOUT;
1817 ;}
1818 break;
1819
1820 case 35:
1821
1822 /* Line 1464 of yacc.c */
1823 #line 324 "libmemcached/options/parser.yy"
1824 {
1825 (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE;
1826 ;}
1827 break;
1828
1829 case 36:
1830
1831 /* Line 1464 of yacc.c */
1832 #line 328 "libmemcached/options/parser.yy"
1833 {
1834 (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE;
1835 ;}
1836 break;
1837
1838 case 37:
1839
1840 /* Line 1464 of yacc.c */
1841 #line 335 "libmemcached/options/parser.yy"
1842 {
1843 (yyval.behavior)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL;
1844 ;}
1845 break;
1846
1847 case 38:
1848
1849 /* Line 1464 of yacc.c */
1850 #line 339 "libmemcached/options/parser.yy"
1851 {
1852 (yyval.behavior)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS;
1853 ;}
1854 break;
1855
1856 case 39:
1857
1858 /* Line 1464 of yacc.c */
1859 #line 343 "libmemcached/options/parser.yy"
1860 {
1861 (yyval.behavior)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY;
1862 ;}
1863 break;
1864
1865 case 40:
1866
1867 /* Line 1464 of yacc.c */
1868 #line 347 "libmemcached/options/parser.yy"
1869 {
1870 (yyval.behavior)= MEMCACHED_BEHAVIOR_NOREPLY;
1871 ;}
1872 break;
1873
1874 case 41:
1875
1876 /* Line 1464 of yacc.c */
1877 #line 351 "libmemcached/options/parser.yy"
1878 {
1879 (yyval.behavior)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ;
1880 ;}
1881 break;
1882
1883 case 42:
1884
1885 /* Line 1464 of yacc.c */
1886 #line 355 "libmemcached/options/parser.yy"
1887 {
1888 (yyval.behavior)= MEMCACHED_BEHAVIOR_SORT_HOSTS;
1889 ;}
1890 break;
1891
1892 case 43:
1893
1894 /* Line 1464 of yacc.c */
1895 #line 359 "libmemcached/options/parser.yy"
1896 {
1897 (yyval.behavior)= MEMCACHED_BEHAVIOR_SUPPORT_CAS;
1898 ;}
1899 break;
1900
1901 case 44:
1902
1903 /* Line 1464 of yacc.c */
1904 #line 363 "libmemcached/options/parser.yy"
1905 {
1906 (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_NODELAY;
1907 ;}
1908 break;
1909
1910 case 45:
1911
1912 /* Line 1464 of yacc.c */
1913 #line 367 "libmemcached/options/parser.yy"
1914 {
1915 (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE;
1916 ;}
1917 break;
1918
1919 case 46:
1920
1921 /* Line 1464 of yacc.c */
1922 #line 371 "libmemcached/options/parser.yy"
1923 {
1924 (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE;
1925 ;}
1926 break;
1927
1928 case 47:
1929
1930 /* Line 1464 of yacc.c */
1931 #line 375 "libmemcached/options/parser.yy"
1932 {
1933 (yyval.behavior)= MEMCACHED_BEHAVIOR_USE_UDP;
1934 ;}
1935 break;
1936
1937 case 48:
1938
1939 /* Line 1464 of yacc.c */
1940 #line 379 "libmemcached/options/parser.yy"
1941 {
1942 (yyval.behavior)= MEMCACHED_BEHAVIOR_VERIFY_KEY;
1943 ;}
1944 break;
1945
1946 case 49:
1947
1948 /* Line 1464 of yacc.c */
1949 #line 385 "libmemcached/options/parser.yy"
1950 { (yyval.number)= MEMCACHED_DEFAULT_PORT;;}
1951 break;
1952
1953 case 50:
1954
1955 /* Line 1464 of yacc.c */
1956 #line 387 "libmemcached/options/parser.yy"
1957 { ;}
1958 break;
1959
1960 case 51:
1961
1962 /* Line 1464 of yacc.c */
1963 #line 391 "libmemcached/options/parser.yy"
1964 { (yyval.number)= 1; ;}
1965 break;
1966
1967 case 52:
1968
1969 /* Line 1464 of yacc.c */
1970 #line 393 "libmemcached/options/parser.yy"
1971 { ;}
1972 break;
1973
1974 case 53:
1975
1976 /* Line 1464 of yacc.c */
1977 #line 398 "libmemcached/options/parser.yy"
1978 {
1979 (yyval.hash)= MEMCACHED_HASH_MD5;
1980 ;}
1981 break;
1982
1983 case 54:
1984
1985 /* Line 1464 of yacc.c */
1986 #line 402 "libmemcached/options/parser.yy"
1987 {
1988 (yyval.hash)= MEMCACHED_HASH_CRC;
1989 ;}
1990 break;
1991
1992 case 55:
1993
1994 /* Line 1464 of yacc.c */
1995 #line 406 "libmemcached/options/parser.yy"
1996 {
1997 (yyval.hash)= MEMCACHED_HASH_FNV1_64;
1998 ;}
1999 break;
2000
2001 case 56:
2002
2003 /* Line 1464 of yacc.c */
2004 #line 410 "libmemcached/options/parser.yy"
2005 {
2006 (yyval.hash)= MEMCACHED_HASH_FNV1A_64;
2007 ;}
2008 break;
2009
2010 case 57:
2011
2012 /* Line 1464 of yacc.c */
2013 #line 414 "libmemcached/options/parser.yy"
2014 {
2015 (yyval.hash)= MEMCACHED_HASH_FNV1_32;
2016 ;}
2017 break;
2018
2019 case 58:
2020
2021 /* Line 1464 of yacc.c */
2022 #line 418 "libmemcached/options/parser.yy"
2023 {
2024 (yyval.hash)= MEMCACHED_HASH_FNV1A_32;
2025 ;}
2026 break;
2027
2028 case 59:
2029
2030 /* Line 1464 of yacc.c */
2031 #line 422 "libmemcached/options/parser.yy"
2032 {
2033 (yyval.hash)= MEMCACHED_HASH_HSIEH;
2034 ;}
2035 break;
2036
2037 case 60:
2038
2039 /* Line 1464 of yacc.c */
2040 #line 426 "libmemcached/options/parser.yy"
2041 {
2042 (yyval.hash)= MEMCACHED_HASH_MURMUR;
2043 ;}
2044 break;
2045
2046 case 61:
2047
2048 /* Line 1464 of yacc.c */
2049 #line 430 "libmemcached/options/parser.yy"
2050 {
2051 (yyval.hash)= MEMCACHED_HASH_JENKINS;
2052 ;}
2053 break;
2054
2055 case 62:
2056
2057 /* Line 1464 of yacc.c */
2058 #line 437 "libmemcached/options/parser.yy"
2059 {
2060 (yyval.string)= (yyvsp[(1) - (1)].string);
2061 ;}
2062 break;
2063
2064 case 63:
2065
2066 /* Line 1464 of yacc.c */
2067 #line 441 "libmemcached/options/parser.yy"
2068 {
2069 (yyval.string).c_str= (yyvsp[(1) - (1)].string).c_str +1; // +1 to move use passed the initial quote
2070 (yyval.string).size= (yyvsp[(1) - (1)].string).size -2; // -2 removes the begin and end quote
2071 ;}
2072 break;
2073
2074 case 64:
2075
2076 /* Line 1464 of yacc.c */
2077 #line 449 "libmemcached/options/parser.yy"
2078 {
2079 (yyval.distribution)= MEMCACHED_DISTRIBUTION_CONSISTENT;
2080 ;}
2081 break;
2082
2083 case 65:
2084
2085 /* Line 1464 of yacc.c */
2086 #line 453 "libmemcached/options/parser.yy"
2087 {
2088 (yyval.distribution)= MEMCACHED_DISTRIBUTION_MODULA;
2089 ;}
2090 break;
2091
2092 case 66:
2093
2094 /* Line 1464 of yacc.c */
2095 #line 457 "libmemcached/options/parser.yy"
2096 {
2097 (yyval.distribution)= MEMCACHED_DISTRIBUTION_RANDOM;
2098 ;}
2099 break;
2100
2101
2102
2103 /* Line 1464 of yacc.c */
2104 #line 2105 "libmemcached/options/parser.cc"
2105 default: break;
2106 }
2107 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2108
2109 YYPOPSTACK (yylen);
2110 yylen = 0;
2111 YY_STACK_PRINT (yyss, yyssp);
2112
2113 *++yyvsp = yyval;
2114
2115 /* Now `shift' the result of the reduction. Determine what state
2116 that goes to, based on the state we popped back to and the rule
2117 number reduced by. */
2118
2119 yyn = yyr1[yyn];
2120
2121 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2122 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2123 yystate = yytable[yystate];
2124 else
2125 yystate = yydefgoto[yyn - YYNTOKENS];
2126
2127 goto yynewstate;
2128
2129
2130 /*------------------------------------.
2131 | yyerrlab -- here on detecting error |
2132 `------------------------------------*/
2133 yyerrlab:
2134 /* If not already recovering from an error, report this error. */
2135 if (!yyerrstatus)
2136 {
2137 ++yynerrs;
2138 #if ! YYERROR_VERBOSE
2139 yyerror (context, scanner, YY_("syntax error"));
2140 #else
2141 {
2142 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2143 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2144 {
2145 YYSIZE_T yyalloc = 2 * yysize;
2146 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2147 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2148 if (yymsg != yymsgbuf)
2149 YYSTACK_FREE (yymsg);
2150 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2151 if (yymsg)
2152 yymsg_alloc = yyalloc;
2153 else
2154 {
2155 yymsg = yymsgbuf;
2156 yymsg_alloc = sizeof yymsgbuf;
2157 }
2158 }
2159
2160 if (0 < yysize && yysize <= yymsg_alloc)
2161 {
2162 (void) yysyntax_error (yymsg, yystate, yychar);
2163 yyerror (context, scanner, yymsg);
2164 }
2165 else
2166 {
2167 yyerror (context, scanner, YY_("syntax error"));
2168 if (yysize != 0)
2169 goto yyexhaustedlab;
2170 }
2171 }
2172 #endif
2173 }
2174
2175
2176
2177 if (yyerrstatus == 3)
2178 {
2179 /* If just tried and failed to reuse lookahead token after an
2180 error, discard it. */
2181
2182 if (yychar <= YYEOF)
2183 {
2184 /* Return failure if at end of input. */
2185 if (yychar == YYEOF)
2186 YYABORT;
2187 }
2188 else
2189 {
2190 yydestruct ("Error: discarding",
2191 yytoken, &yylval, context, scanner);
2192 yychar = YYEMPTY;
2193 }
2194 }
2195
2196 /* Else will try to reuse lookahead token after shifting the error
2197 token. */
2198 goto yyerrlab1;
2199
2200
2201 /*---------------------------------------------------.
2202 | yyerrorlab -- error raised explicitly by YYERROR. |
2203 `---------------------------------------------------*/
2204 yyerrorlab:
2205
2206 /* Pacify compilers like GCC when the user code never invokes
2207 YYERROR and the label yyerrorlab therefore never appears in user
2208 code. */
2209 if (/*CONSTCOND*/ 0)
2210 goto yyerrorlab;
2211
2212 /* Do not reclaim the symbols of the rule which action triggered
2213 this YYERROR. */
2214 YYPOPSTACK (yylen);
2215 yylen = 0;
2216 YY_STACK_PRINT (yyss, yyssp);
2217 yystate = *yyssp;
2218 goto yyerrlab1;
2219
2220
2221 /*-------------------------------------------------------------.
2222 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2223 `-------------------------------------------------------------*/
2224 yyerrlab1:
2225 yyerrstatus = 3; /* Each real token shifted decrements this. */
2226
2227 for (;;)
2228 {
2229 yyn = yypact[yystate];
2230 if (yyn != YYPACT_NINF)
2231 {
2232 yyn += YYTERROR;
2233 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2234 {
2235 yyn = yytable[yyn];
2236 if (0 < yyn)
2237 break;
2238 }
2239 }
2240
2241 /* Pop the current state because it cannot handle the error token. */
2242 if (yyssp == yyss)
2243 YYABORT;
2244
2245
2246 yydestruct ("Error: popping",
2247 yystos[yystate], yyvsp, context, scanner);
2248 YYPOPSTACK (1);
2249 yystate = *yyssp;
2250 YY_STACK_PRINT (yyss, yyssp);
2251 }
2252
2253 *++yyvsp = yylval;
2254
2255
2256 /* Shift the error token. */
2257 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2258
2259 yystate = yyn;
2260 goto yynewstate;
2261
2262
2263 /*-------------------------------------.
2264 | yyacceptlab -- YYACCEPT comes here. |
2265 `-------------------------------------*/
2266 yyacceptlab:
2267 yyresult = 0;
2268 goto yyreturn;
2269
2270 /*-----------------------------------.
2271 | yyabortlab -- YYABORT comes here. |
2272 `-----------------------------------*/
2273 yyabortlab:
2274 yyresult = 1;
2275 goto yyreturn;
2276
2277 #if !defined(yyoverflow) || YYERROR_VERBOSE
2278 /*-------------------------------------------------.
2279 | yyexhaustedlab -- memory exhaustion comes here. |
2280 `-------------------------------------------------*/
2281 yyexhaustedlab:
2282 yyerror (context, scanner, YY_("memory exhausted"));
2283 yyresult = 2;
2284 /* Fall through. */
2285 #endif
2286
2287 yyreturn:
2288 if (yychar != YYEMPTY)
2289 yydestruct ("Cleanup: discarding lookahead",
2290 yytoken, &yylval, context, scanner);
2291 /* Do not reclaim the symbols of the rule which action triggered
2292 this YYABORT or YYACCEPT. */
2293 YYPOPSTACK (yylen);
2294 YY_STACK_PRINT (yyss, yyssp);
2295 while (yyssp != yyss)
2296 {
2297 yydestruct ("Cleanup: popping",
2298 yystos[*yyssp], yyvsp, context, scanner);
2299 YYPOPSTACK (1);
2300 }
2301 #ifndef yyoverflow
2302 if (yyss != yyssa)
2303 YYSTACK_FREE (yyss);
2304 #endif
2305 #if YYERROR_VERBOSE
2306 if (yymsg != yymsgbuf)
2307 YYSTACK_FREE (yymsg);
2308 #endif
2309 /* Make sure YYID is used. */
2310 return YYID (yyresult);
2311 }
2312
2313
2314
2315 /* Line 1684 of yacc.c */
2316 #line 462 "libmemcached/options/parser.yy"
2317
2318
2319 void Context::start()
2320 {
2321 config_parse(this, (void **)scanner);
2322 }
2323
2324