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