1 /* A Bison parser, made by GNU Bison 2.5. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.5"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 0
64 /* Substitute the variable and function names. */
65 #define yyparse config_parse
66 #define yylex config_lex
67 #define yyerror config_error
68 #define yylval config_lval
69 #define yychar config_char
70 #define yydebug config_debug
71 #define yynerrs config_nerrs
74 /* Copy the first part of user declarations. */
76 /* Line 268 of yacc.c */
77 #line 52 "libmemcached/csl/parser.yy"
80 #include <libmemcached/csl/common.h>
81 #include <libmemcached/options.hpp>
83 #include <libmemcached/csl/context.h>
84 #include <libmemcached/csl/symbol.h>
85 #include <libmemcached/csl/scanner.h>
87 #ifndef __INTEL_COMPILER
88 #pragma GCC diagnostic ignored "-Wold-style-cast"
91 #ifndef __INTEL_COMPILER
92 #pragma GCC diagnostic ignored "-Wlogical-op"
95 int conf_lex(YYSTYPE
* lvalp
, void* scanner
);
97 #define select_yychar(__context) yychar == UNKNOWN ? ( (__context)->previous_token == END ? UNKNOWN : (__context)->previous_token ) : yychar
99 #define stryytname(__yytokentype) ((__yytokentype) < YYNTOKENS ) ? yytname[(__yytokentype)] : ""
101 #define parser_abort(__context, __error_message) do { (__context)->abort((__error_message), yytokentype(select_yychar(__context)), stryytname(YYTRANSLATE(select_yychar(__context)))); YYABORT; } while (0)
103 // This is bison calling error.
104 inline void __config_error(Context
*context
, yyscan_t
*scanner
, const char *error
, int last_token
, const char *last_token_str
)
106 if (not context
->end())
108 context
->error(error
, yytokentype(last_token
), last_token_str
);
112 context
->error(error
, yytokentype(last_token
), last_token_str
);
116 #define config_error(__context, __scanner, __error_msg) do { __config_error((__context), (__scanner), (__error_msg), select_yychar(__context), stryytname(YYTRANSLATE(select_yychar(__context)))); } while (0)
121 /* Line 268 of yacc.c */
122 #line 123 "libmemcached/csl/parser.cc"
124 /* Enabling traces. */
129 /* Enabling verbose error messages. */
130 #ifdef YYERROR_VERBOSE
131 # undef YYERROR_VERBOSE
132 # define YYERROR_VERBOSE 1
134 # define YYERROR_VERBOSE 1
137 /* Enabling the token table. */
138 #ifndef YYTOKEN_TABLE
139 # define YYTOKEN_TABLE 0
146 /* Put the tokens into the symbol table, so that GDB and other debuggers
155 CONFIGURE_FILE
= 264,
160 SERVERS_OPTION
= 269,
161 UNKNOWN_OPTION
= 270,
163 BINARY_PROTOCOL
= 272,
164 BUFFER_REQUESTS
= 273,
165 CONNECT_TIMEOUT
= 274,
168 HASH_WITH_NAMESPACE
= 277,
169 IO_BYTES_WATERMARK
= 278,
170 IO_KEY_PREFETCH
= 279,
171 IO_MSG_WATERMARK
= 280,
173 KETAMA_WEIGHTED
= 282,
175 NUMBER_OF_REPLICAS
= 284,
177 RANDOMIZE_REPLICA_READ
= 286,
179 REMOVE_FAILED_SERVERS
= 288,
182 SOCKET_RECV_SIZE
= 291,
183 SOCKET_SEND_SIZE
= 292,
189 _TCP_KEEPALIVE
= 298,
224 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
226 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
227 # define YYSTYPE_IS_DECLARED 1
231 /* Copy the second part of user declarations. */
234 /* Line 343 of yacc.c */
235 #line 236 "libmemcached/csl/parser.cc"
242 typedef YYTYPE_UINT8 yytype_uint8
;
244 typedef unsigned char yytype_uint8
;
248 typedef YYTYPE_INT8 yytype_int8
;
249 #elif (defined __STDC__ || defined __C99__FUNC__ \
250 || defined __cplusplus || defined _MSC_VER)
251 typedef signed char yytype_int8
;
253 typedef short int yytype_int8
;
257 typedef YYTYPE_UINT16 yytype_uint16
;
259 typedef unsigned short int yytype_uint16
;
263 typedef YYTYPE_INT16 yytype_int16
;
265 typedef short int yytype_int16
;
269 # ifdef __SIZE_TYPE__
270 # define YYSIZE_T __SIZE_TYPE__
271 # elif defined size_t
272 # define YYSIZE_T size_t
273 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
274 || defined __cplusplus || defined _MSC_VER)
275 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
276 # define YYSIZE_T size_t
278 # define YYSIZE_T unsigned int
282 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
285 # if defined YYENABLE_NLS && YYENABLE_NLS
287 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
288 # define YY_(msgid) dgettext ("bison-runtime", msgid)
292 # define YY_(msgid) msgid
296 /* Suppress unused-variable warnings by "using" E. */
297 #if ! defined lint || defined __GNUC__
298 # define YYUSE(e) ((void) (e))
300 # define YYUSE(e) /* empty */
303 /* Identity function, used to suppress warnings about constant conditions. */
307 #if (defined __STDC__ || defined __C99__FUNC__ \
308 || defined __cplusplus || defined _MSC_VER)
321 #if ! defined yyoverflow || YYERROR_VERBOSE
323 /* The parser invokes alloca or malloc; define the necessary symbols. */
325 # ifdef YYSTACK_USE_ALLOCA
326 # if YYSTACK_USE_ALLOCA
328 # define YYSTACK_ALLOC __builtin_alloca
329 # elif defined __BUILTIN_VA_ARG_INCR
330 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
332 # define YYSTACK_ALLOC __alloca
333 # elif defined _MSC_VER
334 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
335 # define alloca _alloca
337 # define YYSTACK_ALLOC alloca
338 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
339 || defined __cplusplus || defined _MSC_VER)
340 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
341 # ifndef EXIT_SUCCESS
342 # define EXIT_SUCCESS 0
349 # ifdef YYSTACK_ALLOC
350 /* Pacify GCC's `empty if-body' warning. */
351 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
352 # ifndef YYSTACK_ALLOC_MAXIMUM
353 /* The OS might guarantee only one guard page at the bottom of the stack,
354 and a page size can be as small as 4096 bytes. So we cannot safely
355 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
356 to allow for a few compiler-allocated temporary stack slots. */
357 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
360 # define YYSTACK_ALLOC YYMALLOC
361 # define YYSTACK_FREE YYFREE
362 # ifndef YYSTACK_ALLOC_MAXIMUM
363 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
365 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
366 && ! ((defined YYMALLOC || defined malloc) \
367 && (defined YYFREE || defined free)))
368 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
369 # ifndef EXIT_SUCCESS
370 # define EXIT_SUCCESS 0
374 # define YYMALLOC malloc
375 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
376 || defined __cplusplus || defined _MSC_VER)
377 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
382 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
383 || defined __cplusplus || defined _MSC_VER)
384 void free (void *); /* INFRINGES ON USER NAME SPACE */
388 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
391 #if (! defined yyoverflow \
392 && (! defined __cplusplus \
393 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
395 /* A type that is properly aligned for any stack member. */
398 yytype_int16 yyss_alloc
;
402 /* The size of the maximum gap between one aligned stack and the next. */
403 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
405 /* The size of an array large to enough to hold all stacks, each with
407 # define YYSTACK_BYTES(N) \
408 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
409 + YYSTACK_GAP_MAXIMUM)
411 # define YYCOPY_NEEDED 1
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
418 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
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); \
431 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
432 /* Copy COUNT objects from FROM to TO. The source and destination do
435 # if defined __GNUC__ && 1 < __GNUC__
436 # define YYCOPY(To, From, Count) \
437 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
439 # define YYCOPY(To, From, Count) \
443 for (yyi = 0; yyi < (Count); yyi++) \
444 (To)[yyi] = (From)[yyi]; \
449 #endif /* !YYCOPY_NEEDED */
451 /* YYFINAL -- State number of the termination state. */
453 /* YYLAST -- Last index in YYTABLE. */
456 /* YYNTOKENS -- Number of terminals. */
458 /* YYNNTS -- Number of nonterminals. */
460 /* YYNRULES -- Number of rules. */
462 /* YYNRULES -- Number of states. */
465 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
467 #define YYMAXUTOK 327
469 #define YYTRANSLATE(YYX) \
470 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
472 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
473 static const yytype_uint8 yytranslate
[] =
475 0, 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, 75, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 2, 64, 2, 2, 2, 2, 2,
480 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
481 2, 65, 2, 2, 2, 2, 2, 2, 2, 2,
482 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
483 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
486 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
487 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
488 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
489 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
490 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
491 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
492 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
493 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
494 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
495 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
497 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
498 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
499 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
500 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
501 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
502 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
503 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
504 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
505 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
506 55, 56, 57, 58, 59, 60, 61, 62, 63, 66,
507 67, 68, 69, 70, 71, 72, 73, 74
511 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
513 static const yytype_uint8 yyprhs
[] =
515 0, 0, 3, 5, 9, 11, 13, 15, 17, 19,
516 21, 23, 27, 32, 37, 41, 44, 47, 50, 52,
517 55, 57, 60, 65, 68, 71, 73, 75, 77, 79,
518 81, 83, 85, 87, 89, 91, 93, 95, 97, 99,
519 101, 103, 105, 107, 109, 111, 113, 115, 117, 119,
520 121, 123, 124, 126, 127, 129, 131, 133, 135, 137,
521 139, 141, 143, 145, 147, 149, 151, 153, 155
524 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
525 static const yytype_int8 yyrhs
[] =
527 77, 0, -1, 78, -1, 77, 75, 78, -1, 79,
528 -1, 3, -1, 10, -1, 4, -1, 5, -1, 6,
529 -1, 7, -1, 8, 75, 86, -1, 11, 71, 83,
530 84, -1, 11, 70, 83, 84, -1, 12, 86, 84,
531 -1, 9, 86, -1, 48, 67, -1, 49, 67, -1,
532 80, -1, 47, 86, -1, 46, -1, 20, 87, -1,
533 20, 87, 64, 85, -1, 21, 85, -1, 81, 67,
534 -1, 82, -1, 40, -1, 33, -1, 19, -1, 25,
535 -1, 23, -1, 24, -1, 29, -1, 30, -1, 32,
536 -1, 34, -1, 35, -1, 36, -1, 37, -1, 17,
537 -1, 18, -1, 22, -1, 28, -1, 31, -1, 38,
538 -1, 39, -1, 45, -1, 43, -1, 44, -1, 41,
539 -1, 42, -1, -1, 68, -1, -1, 69, -1, 50,
540 -1, 51, -1, 52, -1, 53, -1, 54, -1, 55,
541 -1, 56, -1, 57, -1, 58, -1, 72, -1, 73,
542 -1, 59, -1, 60, -1, 61, -1
545 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
546 static const yytype_uint16 yyrline
[] =
548 0, 193, 193, 194, 198, 200, 202, 204, 209, 214,
549 218, 222, 233, 243, 253, 262, 266, 270, 274, 278,
550 290, 294, 307, 320, 327, 334, 343, 349, 353, 357,
551 361, 365, 369, 373, 377, 381, 385, 389, 393, 400,
552 404, 408, 412, 416, 420, 424, 428, 432, 436, 440,
553 444, 451, 452, 457, 458, 463, 467, 471, 475, 479,
554 483, 487, 491, 495, 502, 506, 513, 517, 521
558 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
559 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
560 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
561 static const char *const yytname
[] =
563 "$end", "error", "$undefined", "COMMENT", "END", "ERROR", "RESET",
564 "PARSER_DEBUG", "INCLUDE", "CONFIGURE_FILE", "EMPTY_LINE", "SERVER",
565 "SOCKET", "SERVERS", "SERVERS_OPTION", "UNKNOWN_OPTION", "UNKNOWN",
566 "BINARY_PROTOCOL", "BUFFER_REQUESTS", "CONNECT_TIMEOUT", "DISTRIBUTION",
567 "HASH", "HASH_WITH_NAMESPACE", "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH",
568 "IO_MSG_WATERMARK", "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY",
569 "NUMBER_OF_REPLICAS", "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ",
570 "RCV_TIMEOUT", "REMOVE_FAILED_SERVERS", "RETRY_TIMEOUT", "SND_TIMEOUT",
571 "SOCKET_RECV_SIZE", "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS",
572 "USER_DATA", "USE_UDP", "VERIFY_KEY", "_TCP_KEEPALIVE", "_TCP_KEEPIDLE",
573 "_TCP_NODELAY", "FETCH_VERSION", "NAMESPACE", "POOL_MIN", "POOL_MAX",
574 "MD5", "CRC", "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32", "HSIEH",
575 "MURMUR", "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE", "FALSE",
576 "','", "'='", "FLOAT", "NUMBER", "PORT", "WEIGHT_START", "IPADDRESS",
577 "HOSTNAME", "STRING", "QUOTED_STRING", "FILE_PATH", "' '", "$accept",
578 "begin", "statement", "expression", "behaviors", "behavior_number",
579 "behavior_boolean", "optional_port", "optional_weight", "hash", "string",
585 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
587 static const yytype_uint16 yytoknum
[] =
589 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
590 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
591 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
592 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
593 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
594 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
595 315, 316, 317, 318, 44, 61, 319, 320, 321, 322,
596 323, 324, 325, 326, 327, 32
600 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
601 static const yytype_uint8 yyr1
[] =
603 0, 76, 77, 77, 78, 78, 78, 78, 78, 78,
604 78, 78, 79, 79, 79, 79, 79, 79, 79, 80,
605 80, 80, 80, 80, 80, 80, 80, 81, 81, 81,
606 81, 81, 81, 81, 81, 81, 81, 81, 81, 82,
607 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
608 82, 83, 83, 84, 84, 85, 85, 85, 85, 85,
609 85, 85, 85, 85, 86, 86, 87, 87, 87
612 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
613 static const yytype_uint8 yyr2
[] =
615 0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
616 1, 3, 4, 4, 3, 2, 2, 2, 1, 2,
617 1, 2, 4, 2, 2, 1, 1, 1, 1, 1,
618 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
619 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
620 1, 0, 1, 0, 1, 1, 1, 1, 1, 1,
621 1, 1, 1, 1, 1, 1, 1, 1, 1
624 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
625 Performed when YYTABLE doesn't specify something else to do. Zero
626 means the default is an error. */
627 static const yytype_uint8 yydefact
[] =
629 0, 5, 7, 8, 9, 10, 0, 0, 6, 0,
630 0, 39, 40, 28, 0, 0, 41, 30, 31, 29,
631 42, 32, 33, 43, 34, 27, 35, 36, 37, 38,
632 44, 45, 26, 49, 50, 47, 48, 46, 20, 0,
633 0, 0, 0, 2, 4, 18, 0, 25, 0, 64,
634 65, 15, 51, 51, 53, 66, 67, 68, 21, 55,
635 56, 57, 58, 59, 60, 61, 62, 63, 23, 19,
636 16, 17, 1, 0, 24, 11, 52, 53, 53, 54,
640 /* YYDEFGOTO[NTERM-NUM]. */
641 static const yytype_int8 yydefgoto
[] =
643 -1, 42, 43, 44, 45, 46, 47, 77, 80, 68,
647 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
649 #define YYPACT_NINF -62
650 static const yytype_int8 yypact
[] =
652 -2, -62, -62, -62, -62, -62, -61, -24, -62, -20,
653 -24, -62, -62, -62, -48, 13, -62, -62, -62, -62,
654 -62, -62, -62, -62, -62, -62, -62, -62, -62, -62,
655 -62, -62, -62, -62, -62, -62, -62, -62, -62, -24,
656 -42, -15, 0, -62, -62, -62, -11, -62, -24, -62,
657 -62, -62, -10, -10, -12, -62, -62, -62, -5, -62,
658 -62, -62, -62, -62, -62, -62, -62, -62, -62, -62,
659 -62, -62, -62, -2, -62, -62, -62, -12, -12, -62,
660 -62, 13, -62, -62, -62, -62
663 /* YYPGOTO[NTERM-NUM]. */
664 static const yytype_int8 yypgoto
[] =
666 -62, -62, -13, -62, -62, -62, -62, 8, -23, -9,
670 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
671 positive, shift that token. If negative, reduce the rule which
672 number is the opposite. If YYTABLE_NINF, syntax error. */
673 #define YYTABLE_NINF -1
674 static const yytype_uint8 yytable
[] =
676 72, 1, 2, 3, 4, 5, 6, 7, 8, 9,
677 10, 55, 56, 57, 48, 11, 12, 13, 14, 15,
678 16, 17, 18, 19, 54, 70, 20, 21, 22, 23,
679 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
680 34, 35, 36, 37, 38, 39, 40, 41, 49, 50,
681 52, 53, 71, 69, 83, 84, 74, 79, 76, 81,
682 82, 78, 75, 59, 60, 61, 62, 63, 64, 65,
686 #define yypact_value_is_default(yystate) \
689 #define yytable_value_is_error(yytable_value) \
692 static const yytype_int8 yycheck
[] =
694 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
695 12, 59, 60, 61, 75, 17, 18, 19, 20, 21,
696 22, 23, 24, 25, 10, 67, 28, 29, 30, 31,
697 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
698 42, 43, 44, 45, 46, 47, 48, 49, 72, 73,
699 70, 71, 67, 39, 77, 78, 67, 69, 68, 64,
700 73, 53, 48, 50, 51, 52, 53, 54, 55, 56,
701 57, 58, 81, -1, -1, 75
704 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
705 symbol of state STATE-NUM. */
706 static const yytype_uint8 yystos
[] =
708 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
709 12, 17, 18, 19, 20, 21, 22, 23, 24, 25,
710 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
711 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
712 48, 49, 77, 78, 79, 80, 81, 82, 75, 72,
713 73, 86, 70, 71, 86, 59, 60, 61, 87, 50,
714 51, 52, 53, 54, 55, 56, 57, 58, 85, 86,
715 67, 67, 0, 75, 67, 86, 68, 83, 83, 69,
716 84, 64, 78, 84, 84, 85
719 #define yyerrok (yyerrstatus = 0)
720 #define yyclearin (yychar = YYEMPTY)
724 #define YYACCEPT goto yyacceptlab
725 #define YYABORT goto yyabortlab
726 #define YYERROR goto yyerrorlab
729 /* Like YYERROR except do call yyerror. This remains here temporarily
730 to ease the transition to the new meaning of YYERROR, for GCC.
731 Once GCC version 2 has supplanted version 1, this can go. However,
732 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
733 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
736 #define YYFAIL goto yyerrlab
738 /* This is here to suppress warnings from the GCC cpp's
739 -Wunused-macros. Normally we don't worry about that warning, but
740 some users do, and we want to make it easy for users to remove
741 YYFAIL uses, which will produce warnings from Bison 2.5. */
744 #define YYRECOVERING() (!!yyerrstatus)
746 #define YYBACKUP(Token, Value) \
748 if (yychar == YYEMPTY && yylen == 1) \
757 yyerror (context, scanner, YY_("syntax error: cannot back up")); \
764 #define YYERRCODE 256
767 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
768 If N is 0, then set CURRENT to the empty location which ends
769 the previous symbol: RHS[0] (always defined). */
771 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
772 #ifndef YYLLOC_DEFAULT
773 # define YYLLOC_DEFAULT(Current, Rhs, N) \
777 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
778 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
779 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
780 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
784 (Current).first_line = (Current).last_line = \
785 YYRHSLOC (Rhs, 0).last_line; \
786 (Current).first_column = (Current).last_column = \
787 YYRHSLOC (Rhs, 0).last_column; \
793 /* This macro is provided for backward compatibility. */
795 #ifndef YY_LOCATION_PRINT
796 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
800 /* YYLEX -- calling `yylex' with the right arguments. */
803 # define YYLEX yylex (&yylval, YYLEX_PARAM)
805 # define YYLEX yylex (&yylval, scanner)
808 /* Enable debugging if requested. */
812 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
813 # define YYFPRINTF fprintf
816 # define YYDPRINTF(Args) \
822 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
826 YYFPRINTF (stderr, "%s ", Title); \
827 yy_symbol_print (stderr, \
828 Type, Value, context, scanner); \
829 YYFPRINTF (stderr, "\n"); \
834 /*--------------------------------.
835 | Print this symbol on YYOUTPUT. |
836 `--------------------------------*/
839 #if (defined __STDC__ || defined __C99__FUNC__ \
840 || defined __cplusplus || defined _MSC_VER)
842 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
845 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
848 YYSTYPE
const * const yyvaluep
;
858 if (yytype
< YYNTOKENS
)
859 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
871 /*--------------------------------.
872 | Print this symbol on YYOUTPUT. |
873 `--------------------------------*/
875 #if (defined __STDC__ || defined __C99__FUNC__ \
876 || defined __cplusplus || defined _MSC_VER)
878 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
881 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
884 YYSTYPE
const * const yyvaluep
;
889 if (yytype
< YYNTOKENS
)
890 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
892 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
894 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
);
895 YYFPRINTF (yyoutput
, ")");
898 /*------------------------------------------------------------------.
899 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
901 `------------------------------------------------------------------*/
903 #if (defined __STDC__ || defined __C99__FUNC__ \
904 || defined __cplusplus || defined _MSC_VER)
906 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
909 yy_stack_print (yybottom
, yytop
)
910 yytype_int16
*yybottom
;
914 YYFPRINTF (stderr
, "Stack now");
915 for (; yybottom
<= yytop
; yybottom
++)
917 int yybot
= *yybottom
;
918 YYFPRINTF (stderr
, " %d", yybot
);
920 YYFPRINTF (stderr
, "\n");
923 # define YY_STACK_PRINT(Bottom, Top) \
926 yy_stack_print ((Bottom), (Top)); \
930 /*------------------------------------------------.
931 | Report that the YYRULE is going to be reduced. |
932 `------------------------------------------------*/
934 #if (defined __STDC__ || defined __C99__FUNC__ \
935 || defined __cplusplus || defined _MSC_VER)
937 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
, Context
*context
, yyscan_t
*scanner
)
940 yy_reduce_print (yyvsp
, yyrule
, context
, scanner
)
947 int yynrhs
= yyr2
[yyrule
];
949 unsigned long int yylno
= yyrline
[yyrule
];
950 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
952 /* The symbols being reduced. */
953 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
955 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
956 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
957 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
959 YYFPRINTF (stderr
, "\n");
963 # define YY_REDUCE_PRINT(Rule) \
966 yy_reduce_print (yyvsp, Rule, context, scanner); \
969 /* Nonzero means print parse trace. It is left uninitialized so that
970 multiple parsers can coexist. */
973 # define YYDPRINTF(Args)
974 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
975 # define YY_STACK_PRINT(Bottom, Top)
976 # define YY_REDUCE_PRINT(Rule)
977 #endif /* !YYDEBUG */
980 /* YYINITDEPTH -- initial size of the parser's stacks. */
982 # define YYINITDEPTH 200
985 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
986 if the built-in stack extension method is used).
988 Do not make this value too large; the results are undefined if
989 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
990 evaluated with infinite-precision integer arithmetic. */
993 # define YYMAXDEPTH 10000
1000 # if defined __GLIBC__ && defined _STRING_H
1001 # define yystrlen strlen
1003 /* Return the length of YYSTR. */
1004 #if (defined __STDC__ || defined __C99__FUNC__ \
1005 || defined __cplusplus || defined _MSC_VER)
1007 yystrlen (const char *yystr
)
1015 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1023 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1024 # define yystpcpy stpcpy
1026 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1028 #if (defined __STDC__ || defined __C99__FUNC__ \
1029 || defined __cplusplus || defined _MSC_VER)
1031 yystpcpy (char *yydest
, const char *yysrc
)
1034 yystpcpy (yydest
, yysrc
)
1040 const char *yys
= yysrc
;
1042 while ((*yyd
++ = *yys
++) != '\0')
1051 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1052 quotes and backslashes, so that it's suitable for yyerror. The
1053 heuristic is that double-quoting is unnecessary unless the string
1054 contains an apostrophe, a comma, or backslash (other than
1055 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1056 null, do not copy; instead, return the length of what the result
1059 yytnamerr (char *yyres
, const char *yystr
)
1064 char const *yyp
= yystr
;
1071 goto do_not_strip_quotes
;
1075 goto do_not_strip_quotes
;
1088 do_not_strip_quotes
: ;
1092 return yystrlen (yystr
);
1094 return yystpcpy (yyres
, yystr
) - yyres
;
1098 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1099 about the unexpected token YYTOKEN for the state stack whose top is
1102 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1103 not large enough to hold the message. In that case, also set
1104 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1105 required number of bytes is too large to store. */
1107 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1108 yytype_int16
*yyssp
, int yytoken
)
1110 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1111 YYSIZE_T yysize
= yysize0
;
1113 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1114 /* Internationalized format string. */
1115 const char *yyformat
= 0;
1116 /* Arguments of yyformat. */
1117 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1118 /* Number of reported tokens (one for the "unexpected", one per
1122 /* There are many possibilities here to consider:
1123 - Assume YYFAIL is not used. It's too flawed to consider. See
1124 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1125 for details. YYERROR is fine as it does not invoke this
1127 - If this state is a consistent state with a default action, then
1128 the only way this function was invoked is if the default action
1129 is an error action. In that case, don't check for expected
1130 tokens because there are none.
1131 - The only way there can be no lookahead present (in yychar) is if
1132 this state is a consistent state with a default action. Thus,
1133 detecting the absence of a lookahead is sufficient to determine
1134 that there is no unexpected or expected token to report. In that
1135 case, just report a simple "syntax error".
1136 - Don't assume there isn't a lookahead just because this state is a
1137 consistent state with a default action. There might have been a
1138 previous inconsistent state, consistent state with a non-default
1139 action, or user semantic action that manipulated yychar.
1140 - Of course, the expected token list depends on states to have
1141 correct lookahead information, and it depends on the parser not
1142 to perform extra reductions after fetching a lookahead from the
1143 scanner and before detecting a syntax error. Thus, state merging
1144 (from LALR or IELR) and default reductions corrupt the expected
1145 token list. However, the list is correct for canonical LR with
1146 one exception: it will still contain any token that will not be
1147 accepted due to an error action in a later state.
1149 if (yytoken
!= YYEMPTY
)
1151 int yyn
= yypact
[*yyssp
];
1152 yyarg
[yycount
++] = yytname
[yytoken
];
1153 if (!yypact_value_is_default (yyn
))
1155 /* Start YYX at -YYN if negative to avoid negative indexes in
1156 YYCHECK. In other words, skip the first -YYN actions for
1157 this state because they are default actions. */
1158 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1159 /* Stay within bounds of both yycheck and yytname. */
1160 int yychecklim
= YYLAST
- yyn
+ 1;
1161 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1164 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1165 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1166 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1168 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1174 yyarg
[yycount
++] = yytname
[yyx
];
1175 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1176 if (! (yysize
<= yysize1
1177 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1186 # define YYCASE_(N, S) \
1190 YYCASE_(0, YY_("syntax error"));
1191 YYCASE_(1, YY_("syntax error, unexpected %s"));
1192 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1193 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1194 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1195 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1199 yysize1
= yysize
+ yystrlen (yyformat
);
1200 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1204 if (*yymsg_alloc
< yysize
)
1206 *yymsg_alloc
= 2 * yysize
;
1207 if (! (yysize
<= *yymsg_alloc
1208 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1209 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1213 /* Avoid sprintf, as that infringes on the user's name space.
1214 Don't have undefined behavior even if the translation
1215 produced a string with the wrong number of "%s"s. */
1219 while ((*yyp
= *yyformat
) != '\0')
1220 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1222 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1233 #endif /* YYERROR_VERBOSE */
1235 /*-----------------------------------------------.
1236 | Release the memory associated to this symbol. |
1237 `-----------------------------------------------*/
1240 #if (defined __STDC__ || defined __C99__FUNC__ \
1241 || defined __cplusplus || defined _MSC_VER)
1243 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, Context
*context
, yyscan_t
*scanner
)
1246 yydestruct (yymsg
, yytype
, yyvaluep
, context
, scanner
)
1260 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1271 /* Prevent warnings from -Wmissing-prototypes. */
1272 #ifdef YYPARSE_PARAM
1273 #if defined __STDC__ || defined __cplusplus
1274 int yyparse (void *YYPARSE_PARAM
);
1278 #else /* ! YYPARSE_PARAM */
1279 #if defined __STDC__ || defined __cplusplus
1280 int yyparse (Context
*context
, yyscan_t
*scanner
);
1284 #endif /* ! YYPARSE_PARAM */
1291 #ifdef YYPARSE_PARAM
1292 #if (defined __STDC__ || defined __C99__FUNC__ \
1293 || defined __cplusplus || defined _MSC_VER)
1295 yyparse (void *YYPARSE_PARAM
)
1298 yyparse (YYPARSE_PARAM
)
1299 void *YYPARSE_PARAM
;
1301 #else /* ! YYPARSE_PARAM */
1302 #if (defined __STDC__ || defined __C99__FUNC__ \
1303 || defined __cplusplus || defined _MSC_VER)
1305 yyparse (Context
*context
, yyscan_t
*scanner
)
1308 yyparse (context
, scanner
)
1314 /* The lookahead symbol. */
1317 /* The semantic value of the lookahead symbol. */
1320 /* Number of syntax errors so far. */
1324 /* Number of tokens to shift before error messages enabled. */
1327 /* The stacks and their tools:
1328 `yyss': related to states.
1329 `yyvs': related to semantic values.
1331 Refer to the stacks thru separate pointers, to allow yyoverflow
1332 to reallocate them elsewhere. */
1334 /* The state stack. */
1335 yytype_int16 yyssa
[YYINITDEPTH
];
1337 yytype_int16
*yyssp
;
1339 /* The semantic value stack. */
1340 YYSTYPE yyvsa
[YYINITDEPTH
];
1344 YYSIZE_T yystacksize
;
1348 /* Lookahead token as an internal (translated) token number. */
1350 /* The variables used to return semantic value and location from the
1355 /* Buffer for error messages, and its allocated size. */
1357 char *yymsg
= yymsgbuf
;
1358 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1361 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1363 /* The number of symbols on the RHS of the reduced rule.
1364 Keep to zero when no symbol should be popped. */
1370 yystacksize
= YYINITDEPTH
;
1372 YYDPRINTF ((stderr
, "Starting parse\n"));
1377 yychar
= YYEMPTY
; /* Cause a token to be read. */
1379 /* Initialize stack pointers.
1380 Waste one element of value and location stack
1381 so that they stay on the same level as the state stack.
1382 The wasted elements are never initialized. */
1388 /*------------------------------------------------------------.
1389 | yynewstate -- Push a new state, which is found in yystate. |
1390 `------------------------------------------------------------*/
1392 /* In all cases, when you get here, the value and location stacks
1393 have just been pushed. So pushing a state here evens the stacks. */
1399 if (yyss
+ yystacksize
- 1 <= yyssp
)
1401 /* Get the current used size of the three stacks, in elements. */
1402 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1406 /* Give user a chance to reallocate the stack. Use copies of
1407 these so that the &'s don't force the real ones into
1409 YYSTYPE
*yyvs1
= yyvs
;
1410 yytype_int16
*yyss1
= yyss
;
1412 /* Each stack pointer address is followed by the size of the
1413 data in use in that stack, in bytes. This used to be a
1414 conditional around just the two extra args, but that might
1415 be undefined if yyoverflow is a macro. */
1416 yyoverflow (YY_("memory exhausted"),
1417 &yyss1
, yysize
* sizeof (*yyssp
),
1418 &yyvs1
, yysize
* sizeof (*yyvsp
),
1424 #else /* no yyoverflow */
1425 # ifndef YYSTACK_RELOCATE
1426 goto yyexhaustedlab
;
1428 /* Extend the stack our own way. */
1429 if (YYMAXDEPTH
<= yystacksize
)
1430 goto yyexhaustedlab
;
1432 if (YYMAXDEPTH
< yystacksize
)
1433 yystacksize
= YYMAXDEPTH
;
1436 yytype_int16
*yyss1
= yyss
;
1437 union yyalloc
*yyptr
=
1438 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1440 goto yyexhaustedlab
;
1441 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1442 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1443 # undef YYSTACK_RELOCATE
1445 YYSTACK_FREE (yyss1
);
1448 #endif /* no yyoverflow */
1450 yyssp
= yyss
+ yysize
- 1;
1451 yyvsp
= yyvs
+ yysize
- 1;
1453 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1454 (unsigned long int) yystacksize
));
1456 if (yyss
+ yystacksize
- 1 <= yyssp
)
1460 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1462 if (yystate
== YYFINAL
)
1472 /* Do appropriate processing given the current state. Read a
1473 lookahead token if we need one and don't already have one. */
1475 /* First try to decide what to do without reference to lookahead token. */
1476 yyn
= yypact
[yystate
];
1477 if (yypact_value_is_default (yyn
))
1480 /* Not known => get a lookahead token if don't already have one. */
1482 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1483 if (yychar
== YYEMPTY
)
1485 YYDPRINTF ((stderr
, "Reading a token: "));
1489 if (yychar
<= YYEOF
)
1491 yychar
= yytoken
= YYEOF
;
1492 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1496 yytoken
= YYTRANSLATE (yychar
);
1497 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1500 /* If the proper action on seeing token YYTOKEN is to reduce or to
1501 detect an error, take that action. */
1503 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1508 if (yytable_value_is_error (yyn
))
1514 /* Count tokens shifted since error; after three, turn off error
1519 /* Shift the lookahead token. */
1520 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1522 /* Discard the shifted token. */
1531 /*-----------------------------------------------------------.
1532 | yydefault -- do the default action for the current state. |
1533 `-----------------------------------------------------------*/
1535 yyn
= yydefact
[yystate
];
1541 /*-----------------------------.
1542 | yyreduce -- Do a reduction. |
1543 `-----------------------------*/
1545 /* yyn is the number of a rule to reduce with. */
1548 /* If YYLEN is nonzero, implement the default value of the action:
1551 Otherwise, the following line sets YYVAL to garbage.
1552 This behavior is undocumented and Bison
1553 users should not rely upon it. Assigning to YYVAL
1554 unconditionally makes the parser a bit smaller, and it avoids a
1555 GCC warning that YYVAL may be used uninitialized. */
1556 yyval
= yyvsp
[1-yylen
];
1559 YY_REDUCE_PRINT (yyn
);
1564 /* Line 1806 of yacc.c */
1565 #line 199 "libmemcached/csl/parser.yy"
1571 /* Line 1806 of yacc.c */
1572 #line 201 "libmemcached/csl/parser.yy"
1578 /* Line 1806 of yacc.c */
1579 #line 203 "libmemcached/csl/parser.yy"
1585 /* Line 1806 of yacc.c */
1586 #line 205 "libmemcached/csl/parser.yy"
1595 /* Line 1806 of yacc.c */
1596 #line 210 "libmemcached/csl/parser.yy"
1598 context
->rc
= MEMCACHED_PARSE_USER_ERROR
;
1599 parser_abort(context
, "ERROR called directly");
1605 /* Line 1806 of yacc.c */
1606 #line 215 "libmemcached/csl/parser.yy"
1608 memcached_reset(context
->memc
);
1614 /* Line 1806 of yacc.c */
1615 #line 219 "libmemcached/csl/parser.yy"
1623 /* Line 1806 of yacc.c */
1624 #line 223 "libmemcached/csl/parser.yy"
1626 if ((context
->rc
= memcached_parse_configure_file(*context
->memc
, (yyvsp
[(3) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].string
).size
)) != MEMCACHED_SUCCESS
)
1628 parser_abort(context
, "Failed to parse configuration file");
1635 /* Line 1806 of yacc.c */
1636 #line 234 "libmemcached/csl/parser.yy"
1638 if (memcached_failed(context
->rc
= memcached_server_add_with_weight(context
->memc
, (yyvsp
[(2) - (4)].server
).c_str
, (yyvsp
[(3) - (4)].number
), uint32_t((yyvsp
[(4) - (4)].number
)))))
1641 snprintf(buffer
, sizeof(buffer
), "Failed to add server: %s:%u", (yyvsp
[(2) - (4)].server
).c_str
, uint32_t((yyvsp
[(3) - (4)].number
)));
1642 parser_abort(context
, buffer
);
1644 context
->unset_server();
1650 /* Line 1806 of yacc.c */
1651 #line 244 "libmemcached/csl/parser.yy"
1653 if (memcached_failed(context
->rc
= memcached_server_add_with_weight(context
->memc
, (yyvsp
[(2) - (4)].server
).c_str
, (yyvsp
[(3) - (4)].number
), uint32_t((yyvsp
[(4) - (4)].number
)))))
1656 snprintf(buffer
, sizeof(buffer
), "Failed to add server: %s:%u", (yyvsp
[(2) - (4)].server
).c_str
, uint32_t((yyvsp
[(3) - (4)].number
)));
1657 parser_abort(context
, buffer
);
1659 context
->unset_server();
1665 /* Line 1806 of yacc.c */
1666 #line 254 "libmemcached/csl/parser.yy"
1668 if (memcached_failed(context
->rc
= memcached_server_add_unix_socket_with_weight(context
->memc
, (yyvsp
[(2) - (3)].string
).c_str
, uint32_t((yyvsp
[(3) - (3)].number
)))))
1671 snprintf(buffer
, sizeof(buffer
), "Failed to add socket: %s", (yyvsp
[(2) - (3)].string
).c_str
);
1672 parser_abort(context
, buffer
);
1679 /* Line 1806 of yacc.c */
1680 #line 263 "libmemcached/csl/parser.yy"
1682 memcached_set_configuration_file(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
);
1688 /* Line 1806 of yacc.c */
1689 #line 267 "libmemcached/csl/parser.yy"
1691 context
->memc
->configure
.initial_pool_size
= uint32_t((yyvsp
[(2) - (2)].number
));
1697 /* Line 1806 of yacc.c */
1698 #line 271 "libmemcached/csl/parser.yy"
1700 context
->memc
->configure
.max_pool_size
= uint32_t((yyvsp
[(2) - (2)].number
));
1706 /* Line 1806 of yacc.c */
1707 #line 279 "libmemcached/csl/parser.yy"
1709 if (memcached_callback_get(context
->memc
, MEMCACHED_CALLBACK_PREFIX_KEY
, NULL
))
1711 parser_abort(context
, "--NAMESPACE can only be called once");
1714 if ((context
->rc
= memcached_set_namespace(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
)) != MEMCACHED_SUCCESS
)
1716 parser_abort(context
, memcached_last_error_message(context
->memc
));
1723 /* Line 1806 of yacc.c */
1724 #line 291 "libmemcached/csl/parser.yy"
1726 memcached_flag(*context
->memc
, MEMCACHED_FLAG_IS_FETCHING_VERSION
, true);
1732 /* Line 1806 of yacc.c */
1733 #line 295 "libmemcached/csl/parser.yy"
1735 // Check to see if DISTRIBUTION has already been set
1736 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1738 parser_abort(context
, "--DISTRIBUTION can only be called once");
1741 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1743 parser_abort(context
, memcached_last_error_message(context
->memc
));;
1750 /* Line 1806 of yacc.c */
1751 #line 308 "libmemcached/csl/parser.yy"
1753 // Check to see if DISTRIBUTION has already been set
1754 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (4)].distribution
))) != MEMCACHED_SUCCESS
)
1756 parser_abort(context
, "--DISTRIBUTION can only be called once");
1759 if ((context
->rc
= memcached_behavior_set_distribution_hash(context
->memc
, (yyvsp
[(4) - (4)].hash
))) != MEMCACHED_SUCCESS
)
1761 parser_abort(context
, "Unable to set the hash for the DISTRIBUTION requested");
1768 /* Line 1806 of yacc.c */
1769 #line 321 "libmemcached/csl/parser.yy"
1771 if (context
->set_hash((yyvsp
[(2) - (2)].hash
)) == false)
1773 parser_abort(context
, "--HASH can only be set once");
1780 /* Line 1806 of yacc.c */
1781 #line 328 "libmemcached/csl/parser.yy"
1783 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (2)].behavior
), (yyvsp
[(2) - (2)].number
))) != MEMCACHED_SUCCESS
)
1785 parser_abort(context
, "Unable to set behavior");
1792 /* Line 1806 of yacc.c */
1793 #line 335 "libmemcached/csl/parser.yy"
1795 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (1)].behavior
), true)) != MEMCACHED_SUCCESS
)
1798 snprintf(buffer
, sizeof(buffer
), "Could not set: %s", libmemcached_string_behavior((yyvsp
[(1) - (1)].behavior
)));
1799 parser_abort(context
, buffer
);
1806 /* Line 1806 of yacc.c */
1807 #line 344 "libmemcached/csl/parser.yy"
1814 /* Line 1806 of yacc.c */
1815 #line 350 "libmemcached/csl/parser.yy"
1817 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS
;
1823 /* Line 1806 of yacc.c */
1824 #line 354 "libmemcached/csl/parser.yy"
1826 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
;
1832 /* Line 1806 of yacc.c */
1833 #line 358 "libmemcached/csl/parser.yy"
1835 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
;
1841 /* Line 1806 of yacc.c */
1842 #line 362 "libmemcached/csl/parser.yy"
1844 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
;
1850 /* Line 1806 of yacc.c */
1851 #line 366 "libmemcached/csl/parser.yy"
1853 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
;
1859 /* Line 1806 of yacc.c */
1860 #line 370 "libmemcached/csl/parser.yy"
1862 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
;
1868 /* Line 1806 of yacc.c */
1869 #line 374 "libmemcached/csl/parser.yy"
1871 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT
;
1877 /* Line 1806 of yacc.c */
1878 #line 378 "libmemcached/csl/parser.yy"
1880 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT
;
1886 /* Line 1806 of yacc.c */
1887 #line 382 "libmemcached/csl/parser.yy"
1889 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
;
1895 /* Line 1806 of yacc.c */
1896 #line 386 "libmemcached/csl/parser.yy"
1898 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SND_TIMEOUT
;
1904 /* Line 1806 of yacc.c */
1905 #line 390 "libmemcached/csl/parser.yy"
1907 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
;
1913 /* Line 1806 of yacc.c */
1914 #line 394 "libmemcached/csl/parser.yy"
1916 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
;
1922 /* Line 1806 of yacc.c */
1923 #line 401 "libmemcached/csl/parser.yy"
1925 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
;
1931 /* Line 1806 of yacc.c */
1932 #line 405 "libmemcached/csl/parser.yy"
1934 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
;
1940 /* Line 1806 of yacc.c */
1941 #line 409 "libmemcached/csl/parser.yy"
1943 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
;
1949 /* Line 1806 of yacc.c */
1950 #line 413 "libmemcached/csl/parser.yy"
1952 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NOREPLY
;
1958 /* Line 1806 of yacc.c */
1959 #line 417 "libmemcached/csl/parser.yy"
1961 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
;
1967 /* Line 1806 of yacc.c */
1968 #line 421 "libmemcached/csl/parser.yy"
1970 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SORT_HOSTS
;
1976 /* Line 1806 of yacc.c */
1977 #line 425 "libmemcached/csl/parser.yy"
1979 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SUPPORT_CAS
;
1985 /* Line 1806 of yacc.c */
1986 #line 429 "libmemcached/csl/parser.yy"
1988 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_NODELAY
;
1994 /* Line 1806 of yacc.c */
1995 #line 433 "libmemcached/csl/parser.yy"
1997 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
;
2003 /* Line 1806 of yacc.c */
2004 #line 437 "libmemcached/csl/parser.yy"
2006 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE
;
2012 /* Line 1806 of yacc.c */
2013 #line 441 "libmemcached/csl/parser.yy"
2015 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_USE_UDP
;
2021 /* Line 1806 of yacc.c */
2022 #line 445 "libmemcached/csl/parser.yy"
2024 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_VERIFY_KEY
;
2030 /* Line 1806 of yacc.c */
2031 #line 451 "libmemcached/csl/parser.yy"
2032 { (yyval
.number
)= MEMCACHED_DEFAULT_PORT
;}
2037 /* Line 1806 of yacc.c */
2038 #line 453 "libmemcached/csl/parser.yy"
2044 /* Line 1806 of yacc.c */
2045 #line 457 "libmemcached/csl/parser.yy"
2046 { (yyval
.number
)= 1; }
2051 /* Line 1806 of yacc.c */
2052 #line 459 "libmemcached/csl/parser.yy"
2058 /* Line 1806 of yacc.c */
2059 #line 464 "libmemcached/csl/parser.yy"
2061 (yyval
.hash
)= MEMCACHED_HASH_MD5
;
2067 /* Line 1806 of yacc.c */
2068 #line 468 "libmemcached/csl/parser.yy"
2070 (yyval
.hash
)= MEMCACHED_HASH_CRC
;
2076 /* Line 1806 of yacc.c */
2077 #line 472 "libmemcached/csl/parser.yy"
2079 (yyval
.hash
)= MEMCACHED_HASH_FNV1_64
;
2085 /* Line 1806 of yacc.c */
2086 #line 476 "libmemcached/csl/parser.yy"
2088 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_64
;
2094 /* Line 1806 of yacc.c */
2095 #line 480 "libmemcached/csl/parser.yy"
2097 (yyval
.hash
)= MEMCACHED_HASH_FNV1_32
;
2103 /* Line 1806 of yacc.c */
2104 #line 484 "libmemcached/csl/parser.yy"
2106 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_32
;
2112 /* Line 1806 of yacc.c */
2113 #line 488 "libmemcached/csl/parser.yy"
2115 (yyval
.hash
)= MEMCACHED_HASH_HSIEH
;
2121 /* Line 1806 of yacc.c */
2122 #line 492 "libmemcached/csl/parser.yy"
2124 (yyval
.hash
)= MEMCACHED_HASH_MURMUR
;
2130 /* Line 1806 of yacc.c */
2131 #line 496 "libmemcached/csl/parser.yy"
2133 (yyval
.hash
)= MEMCACHED_HASH_JENKINS
;
2139 /* Line 1806 of yacc.c */
2140 #line 503 "libmemcached/csl/parser.yy"
2142 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2148 /* Line 1806 of yacc.c */
2149 #line 507 "libmemcached/csl/parser.yy"
2151 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2157 /* Line 1806 of yacc.c */
2158 #line 514 "libmemcached/csl/parser.yy"
2160 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_CONSISTENT
;
2166 /* Line 1806 of yacc.c */
2167 #line 518 "libmemcached/csl/parser.yy"
2169 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_MODULA
;
2175 /* Line 1806 of yacc.c */
2176 #line 522 "libmemcached/csl/parser.yy"
2178 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_RANDOM
;
2184 /* Line 1806 of yacc.c */
2185 #line 2186 "libmemcached/csl/parser.cc"
2188 /* User semantic actions sometimes alter yychar, and that requires
2189 that yytoken be updated with the new translation. We take the
2190 approach of translating immediately before every use of yytoken.
2191 One alternative is translating here after every semantic action,
2192 but that translation would be missed if the semantic action invokes
2193 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2194 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2195 incorrect destructor might then be invoked immediately. In the
2196 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2197 to an incorrect destructor call or verbose syntax error message
2198 before the lookahead is translated. */
2199 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2203 YY_STACK_PRINT (yyss
, yyssp
);
2207 /* Now `shift' the result of the reduction. Determine what state
2208 that goes to, based on the state we popped back to and the rule
2209 number reduced by. */
2213 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2214 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2215 yystate
= yytable
[yystate
];
2217 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2222 /*------------------------------------.
2223 | yyerrlab -- here on detecting error |
2224 `------------------------------------*/
2226 /* Make sure we have latest lookahead translation. See comments at
2227 user semantic actions for why this is necessary. */
2228 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
2230 /* If not already recovering from an error, report this error. */
2234 #if ! YYERROR_VERBOSE
2235 yyerror (context
, scanner
, YY_("syntax error"));
2237 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2240 char const *yymsgp
= YY_("syntax error");
2241 int yysyntax_error_status
;
2242 yysyntax_error_status
= YYSYNTAX_ERROR
;
2243 if (yysyntax_error_status
== 0)
2245 else if (yysyntax_error_status
== 1)
2247 if (yymsg
!= yymsgbuf
)
2248 YYSTACK_FREE (yymsg
);
2249 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2253 yymsg_alloc
= sizeof yymsgbuf
;
2254 yysyntax_error_status
= 2;
2258 yysyntax_error_status
= YYSYNTAX_ERROR
;
2262 yyerror (context
, scanner
, yymsgp
);
2263 if (yysyntax_error_status
== 2)
2264 goto yyexhaustedlab
;
2266 # undef YYSYNTAX_ERROR
2272 if (yyerrstatus
== 3)
2274 /* If just tried and failed to reuse lookahead token after an
2275 error, discard it. */
2277 if (yychar
<= YYEOF
)
2279 /* Return failure if at end of input. */
2280 if (yychar
== YYEOF
)
2285 yydestruct ("Error: discarding",
2286 yytoken
, &yylval
, context
, scanner
);
2291 /* Else will try to reuse lookahead token after shifting the error
2296 /*---------------------------------------------------.
2297 | yyerrorlab -- error raised explicitly by YYERROR. |
2298 `---------------------------------------------------*/
2301 /* Pacify compilers like GCC when the user code never invokes
2302 YYERROR and the label yyerrorlab therefore never appears in user
2304 if (/*CONSTCOND*/ 0)
2307 /* Do not reclaim the symbols of the rule which action triggered
2311 YY_STACK_PRINT (yyss
, yyssp
);
2316 /*-------------------------------------------------------------.
2317 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2318 `-------------------------------------------------------------*/
2320 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2324 yyn
= yypact
[yystate
];
2325 if (!yypact_value_is_default (yyn
))
2328 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2336 /* Pop the current state because it cannot handle the error token. */
2341 yydestruct ("Error: popping",
2342 yystos
[yystate
], yyvsp
, context
, scanner
);
2345 YY_STACK_PRINT (yyss
, yyssp
);
2351 /* Shift the error token. */
2352 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2358 /*-------------------------------------.
2359 | yyacceptlab -- YYACCEPT comes here. |
2360 `-------------------------------------*/
2365 /*-----------------------------------.
2366 | yyabortlab -- YYABORT comes here. |
2367 `-----------------------------------*/
2372 #if !defined(yyoverflow) || YYERROR_VERBOSE
2373 /*-------------------------------------------------.
2374 | yyexhaustedlab -- memory exhaustion comes here. |
2375 `-------------------------------------------------*/
2377 yyerror (context
, scanner
, YY_("memory exhausted"));
2383 if (yychar
!= YYEMPTY
)
2385 /* Make sure we have latest lookahead translation. See comments at
2386 user semantic actions for why this is necessary. */
2387 yytoken
= YYTRANSLATE (yychar
);
2388 yydestruct ("Cleanup: discarding lookahead",
2389 yytoken
, &yylval
, context
, scanner
);
2391 /* Do not reclaim the symbols of the rule which action triggered
2392 this YYABORT or YYACCEPT. */
2394 YY_STACK_PRINT (yyss
, yyssp
);
2395 while (yyssp
!= yyss
)
2397 yydestruct ("Cleanup: popping",
2398 yystos
[*yyssp
], yyvsp
, context
, scanner
);
2403 YYSTACK_FREE (yyss
);
2406 if (yymsg
!= yymsgbuf
)
2407 YYSTACK_FREE (yymsg
);
2409 /* Make sure YYID is used. */
2410 return YYID (yyresult
);
2415 /* Line 2067 of yacc.c */
2416 #line 527 "libmemcached/csl/parser.yy"
2419 void Context::start()
2421 config_parse(this, (void **)scanner
);