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
93 #pragma GCC diagnostic ignored "-Wlogical-op"
97 int conf_lex(YYSTYPE
* lvalp
, void* scanner
);
99 #define select_yychar(__context) yychar == UNKNOWN ? ( (__context)->previous_token == END ? UNKNOWN : (__context)->previous_token ) : yychar
101 #define stryytname(__yytokentype) ((__yytokentype) < YYNTOKENS ) ? yytname[(__yytokentype)] : ""
103 #define parser_abort(__context, __error_message) do { (__context)->abort((__error_message), yytokentype(select_yychar(__context)), stryytname(YYTRANSLATE(select_yychar(__context)))); YYABORT; } while (0)
105 // This is bison calling error.
106 inline void __config_error(Context
*context
, yyscan_t
*scanner
, const char *error
, int last_token
, const char *last_token_str
)
108 if (not context
->end())
110 context
->error(error
, yytokentype(last_token
), last_token_str
);
114 context
->error(error
, yytokentype(last_token
), last_token_str
);
118 #define config_error(__context, __scanner, __error_msg) do { __config_error((__context), (__scanner), (__error_msg), select_yychar(__context), stryytname(YYTRANSLATE(select_yychar(__context)))); } while (0)
123 /* Line 268 of yacc.c */
124 #line 125 "libmemcached/csl/parser.cc"
126 /* Enabling traces. */
131 /* Enabling verbose error messages. */
132 #ifdef YYERROR_VERBOSE
133 # undef YYERROR_VERBOSE
134 # define YYERROR_VERBOSE 1
136 # define YYERROR_VERBOSE 1
139 /* Enabling the token table. */
140 #ifndef YYTOKEN_TABLE
141 # define YYTOKEN_TABLE 0
148 /* Put the tokens into the symbol table, so that GDB and other debuggers
157 CONFIGURE_FILE
= 264,
162 SERVERS_OPTION
= 269,
163 UNKNOWN_OPTION
= 270,
165 BINARY_PROTOCOL
= 272,
166 BUFFER_REQUESTS
= 273,
167 CONNECT_TIMEOUT
= 274,
170 HASH_WITH_NAMESPACE
= 277,
171 IO_BYTES_WATERMARK
= 278,
172 IO_KEY_PREFETCH
= 279,
173 IO_MSG_WATERMARK
= 280,
175 KETAMA_WEIGHTED
= 282,
177 NUMBER_OF_REPLICAS
= 284,
179 RANDOMIZE_REPLICA_READ
= 286,
181 REMOVE_FAILED_SERVERS
= 288,
184 SOCKET_RECV_SIZE
= 291,
185 SOCKET_SEND_SIZE
= 292,
191 _TCP_KEEPALIVE
= 298,
226 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
228 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
229 # define YYSTYPE_IS_DECLARED 1
233 /* Copy the second part of user declarations. */
236 /* Line 343 of yacc.c */
237 #line 238 "libmemcached/csl/parser.cc"
244 typedef YYTYPE_UINT8 yytype_uint8
;
246 typedef unsigned char yytype_uint8
;
250 typedef YYTYPE_INT8 yytype_int8
;
251 #elif (defined __STDC__ || defined __C99__FUNC__ \
252 || defined __cplusplus || defined _MSC_VER)
253 typedef signed char yytype_int8
;
255 typedef short int yytype_int8
;
259 typedef YYTYPE_UINT16 yytype_uint16
;
261 typedef unsigned short int yytype_uint16
;
265 typedef YYTYPE_INT16 yytype_int16
;
267 typedef short int yytype_int16
;
271 # ifdef __SIZE_TYPE__
272 # define YYSIZE_T __SIZE_TYPE__
273 # elif defined size_t
274 # define YYSIZE_T size_t
275 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
276 || defined __cplusplus || defined _MSC_VER)
277 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
278 # define YYSIZE_T size_t
280 # define YYSIZE_T unsigned int
284 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
287 # if defined YYENABLE_NLS && YYENABLE_NLS
289 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
290 # define YY_(msgid) dgettext ("bison-runtime", msgid)
294 # define YY_(msgid) msgid
298 /* Suppress unused-variable warnings by "using" E. */
299 #if ! defined lint || defined __GNUC__
300 # define YYUSE(e) ((void) (e))
302 # define YYUSE(e) /* empty */
305 /* Identity function, used to suppress warnings about constant conditions. */
309 #if (defined __STDC__ || defined __C99__FUNC__ \
310 || defined __cplusplus || defined _MSC_VER)
323 #if ! defined yyoverflow || YYERROR_VERBOSE
325 /* The parser invokes alloca or malloc; define the necessary symbols. */
327 # ifdef YYSTACK_USE_ALLOCA
328 # if YYSTACK_USE_ALLOCA
330 # define YYSTACK_ALLOC __builtin_alloca
331 # elif defined __BUILTIN_VA_ARG_INCR
332 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
334 # define YYSTACK_ALLOC __alloca
335 # elif defined _MSC_VER
336 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
337 # define alloca _alloca
339 # define YYSTACK_ALLOC alloca
340 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
341 || defined __cplusplus || defined _MSC_VER)
342 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
343 # ifndef EXIT_SUCCESS
344 # define EXIT_SUCCESS 0
351 # ifdef YYSTACK_ALLOC
352 /* Pacify GCC's `empty if-body' warning. */
353 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
354 # ifndef YYSTACK_ALLOC_MAXIMUM
355 /* The OS might guarantee only one guard page at the bottom of the stack,
356 and a page size can be as small as 4096 bytes. So we cannot safely
357 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
358 to allow for a few compiler-allocated temporary stack slots. */
359 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
362 # define YYSTACK_ALLOC YYMALLOC
363 # define YYSTACK_FREE YYFREE
364 # ifndef YYSTACK_ALLOC_MAXIMUM
365 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
367 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
368 && ! ((defined YYMALLOC || defined malloc) \
369 && (defined YYFREE || defined free)))
370 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
371 # ifndef EXIT_SUCCESS
372 # define EXIT_SUCCESS 0
376 # define YYMALLOC malloc
377 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
378 || defined __cplusplus || defined _MSC_VER)
379 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
384 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
385 || defined __cplusplus || defined _MSC_VER)
386 void free (void *); /* INFRINGES ON USER NAME SPACE */
390 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
393 #if (! defined yyoverflow \
394 && (! defined __cplusplus \
395 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
397 /* A type that is properly aligned for any stack member. */
400 yytype_int16 yyss_alloc
;
404 /* The size of the maximum gap between one aligned stack and the next. */
405 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
407 /* The size of an array large to enough to hold all stacks, each with
409 # define YYSTACK_BYTES(N) \
410 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
411 + YYSTACK_GAP_MAXIMUM)
413 # define YYCOPY_NEEDED 1
415 /* Relocate STACK from its old location to the new one. The
416 local variables YYSIZE and YYSTACKSIZE give the old and new number of
417 elements in the stack, and YYPTR gives the new location of the
418 stack. Advance YYPTR to a properly aligned location for the next
420 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
423 YYSIZE_T yynewbytes; \
424 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
425 Stack = &yyptr->Stack_alloc; \
426 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
427 yyptr += yynewbytes / sizeof (*yyptr); \
433 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
434 /* Copy COUNT objects from FROM to TO. The source and destination do
437 # if defined __GNUC__ && 1 < __GNUC__
438 # define YYCOPY(To, From, Count) \
439 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
441 # define YYCOPY(To, From, Count) \
445 for (yyi = 0; yyi < (Count); yyi++) \
446 (To)[yyi] = (From)[yyi]; \
451 #endif /* !YYCOPY_NEEDED */
453 /* YYFINAL -- State number of the termination state. */
455 /* YYLAST -- Last index in YYTABLE. */
458 /* YYNTOKENS -- Number of terminals. */
460 /* YYNNTS -- Number of nonterminals. */
462 /* YYNRULES -- Number of rules. */
464 /* YYNRULES -- Number of states. */
467 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
469 #define YYMAXUTOK 327
471 #define YYTRANSLATE(YYX) \
472 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
474 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
475 static const yytype_uint8 yytranslate
[] =
477 0, 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, 75, 2, 2, 2, 2, 2, 2, 2,
481 2, 2, 2, 2, 64, 2, 2, 2, 2, 2,
482 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
483 2, 65, 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, 2, 2, 2, 2,
501 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
502 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
503 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
504 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
505 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
506 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
507 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
508 55, 56, 57, 58, 59, 60, 61, 62, 63, 66,
509 67, 68, 69, 70, 71, 72, 73, 74
513 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
515 static const yytype_uint8 yyprhs
[] =
517 0, 0, 3, 5, 9, 11, 13, 15, 17, 19,
518 21, 23, 27, 32, 37, 41, 44, 47, 50, 52,
519 55, 57, 60, 65, 68, 71, 73, 75, 77, 79,
520 81, 83, 85, 87, 89, 91, 93, 95, 97, 99,
521 101, 103, 105, 107, 109, 111, 113, 115, 117, 119,
522 121, 123, 124, 126, 127, 129, 131, 133, 135, 137,
523 139, 141, 143, 145, 147, 149, 151, 153, 155
526 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
527 static const yytype_int8 yyrhs
[] =
529 77, 0, -1, 78, -1, 77, 75, 78, -1, 79,
530 -1, 3, -1, 10, -1, 4, -1, 5, -1, 6,
531 -1, 7, -1, 8, 75, 86, -1, 11, 71, 83,
532 84, -1, 11, 70, 83, 84, -1, 12, 86, 84,
533 -1, 9, 86, -1, 48, 67, -1, 49, 67, -1,
534 80, -1, 47, 86, -1, 46, -1, 20, 87, -1,
535 20, 87, 64, 85, -1, 21, 85, -1, 81, 67,
536 -1, 82, -1, 40, -1, 33, -1, 19, -1, 25,
537 -1, 23, -1, 24, -1, 29, -1, 30, -1, 32,
538 -1, 34, -1, 35, -1, 36, -1, 37, -1, 17,
539 -1, 18, -1, 22, -1, 28, -1, 31, -1, 38,
540 -1, 39, -1, 45, -1, 43, -1, 44, -1, 41,
541 -1, 42, -1, -1, 68, -1, -1, 69, -1, 50,
542 -1, 51, -1, 52, -1, 53, -1, 54, -1, 55,
543 -1, 56, -1, 57, -1, 58, -1, 72, -1, 73,
544 -1, 59, -1, 60, -1, 61, -1
547 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
548 static const yytype_uint16 yyrline
[] =
550 0, 195, 195, 196, 200, 202, 204, 206, 211, 216,
551 220, 224, 235, 245, 255, 264, 268, 272, 276, 280,
552 292, 296, 309, 322, 329, 336, 345, 351, 355, 359,
553 363, 367, 371, 375, 379, 383, 387, 391, 395, 402,
554 406, 410, 414, 418, 422, 426, 430, 434, 438, 442,
555 446, 453, 454, 459, 460, 465, 469, 473, 477, 481,
556 485, 489, 493, 497, 504, 508, 515, 519, 523
560 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
561 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
562 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
563 static const char *const yytname
[] =
565 "$end", "error", "$undefined", "COMMENT", "END", "ERROR", "RESET",
566 "PARSER_DEBUG", "INCLUDE", "CONFIGURE_FILE", "EMPTY_LINE", "SERVER",
567 "SOCKET", "SERVERS", "SERVERS_OPTION", "UNKNOWN_OPTION", "UNKNOWN",
568 "BINARY_PROTOCOL", "BUFFER_REQUESTS", "CONNECT_TIMEOUT", "DISTRIBUTION",
569 "HASH", "HASH_WITH_NAMESPACE", "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH",
570 "IO_MSG_WATERMARK", "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY",
571 "NUMBER_OF_REPLICAS", "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ",
572 "RCV_TIMEOUT", "REMOVE_FAILED_SERVERS", "RETRY_TIMEOUT", "SND_TIMEOUT",
573 "SOCKET_RECV_SIZE", "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS",
574 "USER_DATA", "USE_UDP", "VERIFY_KEY", "_TCP_KEEPALIVE", "_TCP_KEEPIDLE",
575 "_TCP_NODELAY", "FETCH_VERSION", "NAMESPACE", "POOL_MIN", "POOL_MAX",
576 "MD5", "CRC", "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32", "HSIEH",
577 "MURMUR", "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE", "FALSE",
578 "','", "'='", "FLOAT", "NUMBER", "PORT", "WEIGHT_START", "IPADDRESS",
579 "HOSTNAME", "STRING", "QUOTED_STRING", "FILE_PATH", "' '", "$accept",
580 "begin", "statement", "expression", "behaviors", "behavior_number",
581 "behavior_boolean", "optional_port", "optional_weight", "hash", "string",
587 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
589 static const yytype_uint16 yytoknum
[] =
591 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
592 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
593 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
594 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
595 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
596 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
597 315, 316, 317, 318, 44, 61, 319, 320, 321, 322,
598 323, 324, 325, 326, 327, 32
602 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
603 static const yytype_uint8 yyr1
[] =
605 0, 76, 77, 77, 78, 78, 78, 78, 78, 78,
606 78, 78, 79, 79, 79, 79, 79, 79, 79, 80,
607 80, 80, 80, 80, 80, 80, 80, 81, 81, 81,
608 81, 81, 81, 81, 81, 81, 81, 81, 81, 82,
609 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
610 82, 83, 83, 84, 84, 85, 85, 85, 85, 85,
611 85, 85, 85, 85, 86, 86, 87, 87, 87
614 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
615 static const yytype_uint8 yyr2
[] =
617 0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
618 1, 3, 4, 4, 3, 2, 2, 2, 1, 2,
619 1, 2, 4, 2, 2, 1, 1, 1, 1, 1,
620 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
621 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
622 1, 0, 1, 0, 1, 1, 1, 1, 1, 1,
623 1, 1, 1, 1, 1, 1, 1, 1, 1
626 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
627 Performed when YYTABLE doesn't specify something else to do. Zero
628 means the default is an error. */
629 static const yytype_uint8 yydefact
[] =
631 0, 5, 7, 8, 9, 10, 0, 0, 6, 0,
632 0, 39, 40, 28, 0, 0, 41, 30, 31, 29,
633 42, 32, 33, 43, 34, 27, 35, 36, 37, 38,
634 44, 45, 26, 49, 50, 47, 48, 46, 20, 0,
635 0, 0, 0, 2, 4, 18, 0, 25, 0, 64,
636 65, 15, 51, 51, 53, 66, 67, 68, 21, 55,
637 56, 57, 58, 59, 60, 61, 62, 63, 23, 19,
638 16, 17, 1, 0, 24, 11, 52, 53, 53, 54,
642 /* YYDEFGOTO[NTERM-NUM]. */
643 static const yytype_int8 yydefgoto
[] =
645 -1, 42, 43, 44, 45, 46, 47, 77, 80, 68,
649 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
651 #define YYPACT_NINF -62
652 static const yytype_int8 yypact
[] =
654 -2, -62, -62, -62, -62, -62, -61, -24, -62, -20,
655 -24, -62, -62, -62, -48, 13, -62, -62, -62, -62,
656 -62, -62, -62, -62, -62, -62, -62, -62, -62, -62,
657 -62, -62, -62, -62, -62, -62, -62, -62, -62, -24,
658 -42, -15, 0, -62, -62, -62, -11, -62, -24, -62,
659 -62, -62, -10, -10, -12, -62, -62, -62, -5, -62,
660 -62, -62, -62, -62, -62, -62, -62, -62, -62, -62,
661 -62, -62, -62, -2, -62, -62, -62, -12, -12, -62,
662 -62, 13, -62, -62, -62, -62
665 /* YYPGOTO[NTERM-NUM]. */
666 static const yytype_int8 yypgoto
[] =
668 -62, -62, -13, -62, -62, -62, -62, 8, -23, -9,
672 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
673 positive, shift that token. If negative, reduce the rule which
674 number is the opposite. If YYTABLE_NINF, syntax error. */
675 #define YYTABLE_NINF -1
676 static const yytype_uint8 yytable
[] =
678 72, 1, 2, 3, 4, 5, 6, 7, 8, 9,
679 10, 55, 56, 57, 48, 11, 12, 13, 14, 15,
680 16, 17, 18, 19, 54, 70, 20, 21, 22, 23,
681 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
682 34, 35, 36, 37, 38, 39, 40, 41, 49, 50,
683 52, 53, 71, 69, 83, 84, 74, 79, 76, 81,
684 82, 78, 75, 59, 60, 61, 62, 63, 64, 65,
688 #define yypact_value_is_default(yystate) \
691 #define yytable_value_is_error(yytable_value) \
694 static const yytype_int8 yycheck
[] =
696 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
697 12, 59, 60, 61, 75, 17, 18, 19, 20, 21,
698 22, 23, 24, 25, 10, 67, 28, 29, 30, 31,
699 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
700 42, 43, 44, 45, 46, 47, 48, 49, 72, 73,
701 70, 71, 67, 39, 77, 78, 67, 69, 68, 64,
702 73, 53, 48, 50, 51, 52, 53, 54, 55, 56,
703 57, 58, 81, -1, -1, 75
706 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
707 symbol of state STATE-NUM. */
708 static const yytype_uint8 yystos
[] =
710 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
711 12, 17, 18, 19, 20, 21, 22, 23, 24, 25,
712 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
713 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
714 48, 49, 77, 78, 79, 80, 81, 82, 75, 72,
715 73, 86, 70, 71, 86, 59, 60, 61, 87, 50,
716 51, 52, 53, 54, 55, 56, 57, 58, 85, 86,
717 67, 67, 0, 75, 67, 86, 68, 83, 83, 69,
718 84, 64, 78, 84, 84, 85
721 #define yyerrok (yyerrstatus = 0)
722 #define yyclearin (yychar = YYEMPTY)
726 #define YYACCEPT goto yyacceptlab
727 #define YYABORT goto yyabortlab
728 #define YYERROR goto yyerrorlab
731 /* Like YYERROR except do call yyerror. This remains here temporarily
732 to ease the transition to the new meaning of YYERROR, for GCC.
733 Once GCC version 2 has supplanted version 1, this can go. However,
734 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
735 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
738 #define YYFAIL goto yyerrlab
740 /* This is here to suppress warnings from the GCC cpp's
741 -Wunused-macros. Normally we don't worry about that warning, but
742 some users do, and we want to make it easy for users to remove
743 YYFAIL uses, which will produce warnings from Bison 2.5. */
746 #define YYRECOVERING() (!!yyerrstatus)
748 #define YYBACKUP(Token, Value) \
750 if (yychar == YYEMPTY && yylen == 1) \
759 yyerror (context, scanner, YY_("syntax error: cannot back up")); \
766 #define YYERRCODE 256
769 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
770 If N is 0, then set CURRENT to the empty location which ends
771 the previous symbol: RHS[0] (always defined). */
773 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
774 #ifndef YYLLOC_DEFAULT
775 # define YYLLOC_DEFAULT(Current, Rhs, N) \
779 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
780 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
781 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
782 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
786 (Current).first_line = (Current).last_line = \
787 YYRHSLOC (Rhs, 0).last_line; \
788 (Current).first_column = (Current).last_column = \
789 YYRHSLOC (Rhs, 0).last_column; \
795 /* This macro is provided for backward compatibility. */
797 #ifndef YY_LOCATION_PRINT
798 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
802 /* YYLEX -- calling `yylex' with the right arguments. */
805 # define YYLEX yylex (&yylval, YYLEX_PARAM)
807 # define YYLEX yylex (&yylval, scanner)
810 /* Enable debugging if requested. */
814 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
815 # define YYFPRINTF fprintf
818 # define YYDPRINTF(Args) \
824 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
828 YYFPRINTF (stderr, "%s ", Title); \
829 yy_symbol_print (stderr, \
830 Type, Value, context, scanner); \
831 YYFPRINTF (stderr, "\n"); \
836 /*--------------------------------.
837 | Print this symbol on YYOUTPUT. |
838 `--------------------------------*/
841 #if (defined __STDC__ || defined __C99__FUNC__ \
842 || defined __cplusplus || defined _MSC_VER)
844 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
847 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
850 YYSTYPE
const * const yyvaluep
;
860 if (yytype
< YYNTOKENS
)
861 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
873 /*--------------------------------.
874 | Print this symbol on YYOUTPUT. |
875 `--------------------------------*/
877 #if (defined __STDC__ || defined __C99__FUNC__ \
878 || defined __cplusplus || defined _MSC_VER)
880 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
883 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
886 YYSTYPE
const * const yyvaluep
;
891 if (yytype
< YYNTOKENS
)
892 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
894 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
896 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
);
897 YYFPRINTF (yyoutput
, ")");
900 /*------------------------------------------------------------------.
901 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
903 `------------------------------------------------------------------*/
905 #if (defined __STDC__ || defined __C99__FUNC__ \
906 || defined __cplusplus || defined _MSC_VER)
908 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
911 yy_stack_print (yybottom
, yytop
)
912 yytype_int16
*yybottom
;
916 YYFPRINTF (stderr
, "Stack now");
917 for (; yybottom
<= yytop
; yybottom
++)
919 int yybot
= *yybottom
;
920 YYFPRINTF (stderr
, " %d", yybot
);
922 YYFPRINTF (stderr
, "\n");
925 # define YY_STACK_PRINT(Bottom, Top) \
928 yy_stack_print ((Bottom), (Top)); \
932 /*------------------------------------------------.
933 | Report that the YYRULE is going to be reduced. |
934 `------------------------------------------------*/
936 #if (defined __STDC__ || defined __C99__FUNC__ \
937 || defined __cplusplus || defined _MSC_VER)
939 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
, Context
*context
, yyscan_t
*scanner
)
942 yy_reduce_print (yyvsp
, yyrule
, context
, scanner
)
949 int yynrhs
= yyr2
[yyrule
];
951 unsigned long int yylno
= yyrline
[yyrule
];
952 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
954 /* The symbols being reduced. */
955 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
957 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
958 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
959 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
961 YYFPRINTF (stderr
, "\n");
965 # define YY_REDUCE_PRINT(Rule) \
968 yy_reduce_print (yyvsp, Rule, context, scanner); \
971 /* Nonzero means print parse trace. It is left uninitialized so that
972 multiple parsers can coexist. */
975 # define YYDPRINTF(Args)
976 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
977 # define YY_STACK_PRINT(Bottom, Top)
978 # define YY_REDUCE_PRINT(Rule)
979 #endif /* !YYDEBUG */
982 /* YYINITDEPTH -- initial size of the parser's stacks. */
984 # define YYINITDEPTH 200
987 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
988 if the built-in stack extension method is used).
990 Do not make this value too large; the results are undefined if
991 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
992 evaluated with infinite-precision integer arithmetic. */
995 # define YYMAXDEPTH 10000
1002 # if defined __GLIBC__ && defined _STRING_H
1003 # define yystrlen strlen
1005 /* Return the length of YYSTR. */
1006 #if (defined __STDC__ || defined __C99__FUNC__ \
1007 || defined __cplusplus || defined _MSC_VER)
1009 yystrlen (const char *yystr
)
1017 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1025 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1026 # define yystpcpy stpcpy
1028 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1030 #if (defined __STDC__ || defined __C99__FUNC__ \
1031 || defined __cplusplus || defined _MSC_VER)
1033 yystpcpy (char *yydest
, const char *yysrc
)
1036 yystpcpy (yydest
, yysrc
)
1042 const char *yys
= yysrc
;
1044 while ((*yyd
++ = *yys
++) != '\0')
1053 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1054 quotes and backslashes, so that it's suitable for yyerror. The
1055 heuristic is that double-quoting is unnecessary unless the string
1056 contains an apostrophe, a comma, or backslash (other than
1057 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1058 null, do not copy; instead, return the length of what the result
1061 yytnamerr (char *yyres
, const char *yystr
)
1066 char const *yyp
= yystr
;
1073 goto do_not_strip_quotes
;
1077 goto do_not_strip_quotes
;
1090 do_not_strip_quotes
: ;
1094 return yystrlen (yystr
);
1096 return yystpcpy (yyres
, yystr
) - yyres
;
1100 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1101 about the unexpected token YYTOKEN for the state stack whose top is
1104 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1105 not large enough to hold the message. In that case, also set
1106 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1107 required number of bytes is too large to store. */
1109 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1110 yytype_int16
*yyssp
, int yytoken
)
1112 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1113 YYSIZE_T yysize
= yysize0
;
1115 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1116 /* Internationalized format string. */
1117 const char *yyformat
= 0;
1118 /* Arguments of yyformat. */
1119 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1120 /* Number of reported tokens (one for the "unexpected", one per
1124 /* There are many possibilities here to consider:
1125 - Assume YYFAIL is not used. It's too flawed to consider. See
1126 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1127 for details. YYERROR is fine as it does not invoke this
1129 - If this state is a consistent state with a default action, then
1130 the only way this function was invoked is if the default action
1131 is an error action. In that case, don't check for expected
1132 tokens because there are none.
1133 - The only way there can be no lookahead present (in yychar) is if
1134 this state is a consistent state with a default action. Thus,
1135 detecting the absence of a lookahead is sufficient to determine
1136 that there is no unexpected or expected token to report. In that
1137 case, just report a simple "syntax error".
1138 - Don't assume there isn't a lookahead just because this state is a
1139 consistent state with a default action. There might have been a
1140 previous inconsistent state, consistent state with a non-default
1141 action, or user semantic action that manipulated yychar.
1142 - Of course, the expected token list depends on states to have
1143 correct lookahead information, and it depends on the parser not
1144 to perform extra reductions after fetching a lookahead from the
1145 scanner and before detecting a syntax error. Thus, state merging
1146 (from LALR or IELR) and default reductions corrupt the expected
1147 token list. However, the list is correct for canonical LR with
1148 one exception: it will still contain any token that will not be
1149 accepted due to an error action in a later state.
1151 if (yytoken
!= YYEMPTY
)
1153 int yyn
= yypact
[*yyssp
];
1154 yyarg
[yycount
++] = yytname
[yytoken
];
1155 if (!yypact_value_is_default (yyn
))
1157 /* Start YYX at -YYN if negative to avoid negative indexes in
1158 YYCHECK. In other words, skip the first -YYN actions for
1159 this state because they are default actions. */
1160 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1161 /* Stay within bounds of both yycheck and yytname. */
1162 int yychecklim
= YYLAST
- yyn
+ 1;
1163 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1166 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1167 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1168 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1170 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1176 yyarg
[yycount
++] = yytname
[yyx
];
1177 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1178 if (! (yysize
<= yysize1
1179 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1188 # define YYCASE_(N, S) \
1192 YYCASE_(0, YY_("syntax error"));
1193 YYCASE_(1, YY_("syntax error, unexpected %s"));
1194 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1195 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1196 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1197 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1201 yysize1
= yysize
+ yystrlen (yyformat
);
1202 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1206 if (*yymsg_alloc
< yysize
)
1208 *yymsg_alloc
= 2 * yysize
;
1209 if (! (yysize
<= *yymsg_alloc
1210 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1211 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1215 /* Avoid sprintf, as that infringes on the user's name space.
1216 Don't have undefined behavior even if the translation
1217 produced a string with the wrong number of "%s"s. */
1221 while ((*yyp
= *yyformat
) != '\0')
1222 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1224 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1235 #endif /* YYERROR_VERBOSE */
1237 /*-----------------------------------------------.
1238 | Release the memory associated to this symbol. |
1239 `-----------------------------------------------*/
1242 #if (defined __STDC__ || defined __C99__FUNC__ \
1243 || defined __cplusplus || defined _MSC_VER)
1245 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, Context
*context
, yyscan_t
*scanner
)
1248 yydestruct (yymsg
, yytype
, yyvaluep
, context
, scanner
)
1262 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1273 /* Prevent warnings from -Wmissing-prototypes. */
1274 #ifdef YYPARSE_PARAM
1275 #if defined __STDC__ || defined __cplusplus
1276 int yyparse (void *YYPARSE_PARAM
);
1280 #else /* ! YYPARSE_PARAM */
1281 #if defined __STDC__ || defined __cplusplus
1282 int yyparse (Context
*context
, yyscan_t
*scanner
);
1286 #endif /* ! YYPARSE_PARAM */
1293 #ifdef YYPARSE_PARAM
1294 #if (defined __STDC__ || defined __C99__FUNC__ \
1295 || defined __cplusplus || defined _MSC_VER)
1297 yyparse (void *YYPARSE_PARAM
)
1300 yyparse (YYPARSE_PARAM
)
1301 void *YYPARSE_PARAM
;
1303 #else /* ! YYPARSE_PARAM */
1304 #if (defined __STDC__ || defined __C99__FUNC__ \
1305 || defined __cplusplus || defined _MSC_VER)
1307 yyparse (Context
*context
, yyscan_t
*scanner
)
1310 yyparse (context
, scanner
)
1316 /* The lookahead symbol. */
1319 /* The semantic value of the lookahead symbol. */
1322 /* Number of syntax errors so far. */
1326 /* Number of tokens to shift before error messages enabled. */
1329 /* The stacks and their tools:
1330 `yyss': related to states.
1331 `yyvs': related to semantic values.
1333 Refer to the stacks thru separate pointers, to allow yyoverflow
1334 to reallocate them elsewhere. */
1336 /* The state stack. */
1337 yytype_int16 yyssa
[YYINITDEPTH
];
1339 yytype_int16
*yyssp
;
1341 /* The semantic value stack. */
1342 YYSTYPE yyvsa
[YYINITDEPTH
];
1346 YYSIZE_T yystacksize
;
1350 /* Lookahead token as an internal (translated) token number. */
1352 /* The variables used to return semantic value and location from the
1357 /* Buffer for error messages, and its allocated size. */
1359 char *yymsg
= yymsgbuf
;
1360 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1363 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1365 /* The number of symbols on the RHS of the reduced rule.
1366 Keep to zero when no symbol should be popped. */
1372 yystacksize
= YYINITDEPTH
;
1374 YYDPRINTF ((stderr
, "Starting parse\n"));
1379 yychar
= YYEMPTY
; /* Cause a token to be read. */
1381 /* Initialize stack pointers.
1382 Waste one element of value and location stack
1383 so that they stay on the same level as the state stack.
1384 The wasted elements are never initialized. */
1390 /*------------------------------------------------------------.
1391 | yynewstate -- Push a new state, which is found in yystate. |
1392 `------------------------------------------------------------*/
1394 /* In all cases, when you get here, the value and location stacks
1395 have just been pushed. So pushing a state here evens the stacks. */
1401 if (yyss
+ yystacksize
- 1 <= yyssp
)
1403 /* Get the current used size of the three stacks, in elements. */
1404 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1408 /* Give user a chance to reallocate the stack. Use copies of
1409 these so that the &'s don't force the real ones into
1411 YYSTYPE
*yyvs1
= yyvs
;
1412 yytype_int16
*yyss1
= yyss
;
1414 /* Each stack pointer address is followed by the size of the
1415 data in use in that stack, in bytes. This used to be a
1416 conditional around just the two extra args, but that might
1417 be undefined if yyoverflow is a macro. */
1418 yyoverflow (YY_("memory exhausted"),
1419 &yyss1
, yysize
* sizeof (*yyssp
),
1420 &yyvs1
, yysize
* sizeof (*yyvsp
),
1426 #else /* no yyoverflow */
1427 # ifndef YYSTACK_RELOCATE
1428 goto yyexhaustedlab
;
1430 /* Extend the stack our own way. */
1431 if (YYMAXDEPTH
<= yystacksize
)
1432 goto yyexhaustedlab
;
1434 if (YYMAXDEPTH
< yystacksize
)
1435 yystacksize
= YYMAXDEPTH
;
1438 yytype_int16
*yyss1
= yyss
;
1439 union yyalloc
*yyptr
=
1440 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1442 goto yyexhaustedlab
;
1443 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1444 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1445 # undef YYSTACK_RELOCATE
1447 YYSTACK_FREE (yyss1
);
1450 #endif /* no yyoverflow */
1452 yyssp
= yyss
+ yysize
- 1;
1453 yyvsp
= yyvs
+ yysize
- 1;
1455 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1456 (unsigned long int) yystacksize
));
1458 if (yyss
+ yystacksize
- 1 <= yyssp
)
1462 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1464 if (yystate
== YYFINAL
)
1474 /* Do appropriate processing given the current state. Read a
1475 lookahead token if we need one and don't already have one. */
1477 /* First try to decide what to do without reference to lookahead token. */
1478 yyn
= yypact
[yystate
];
1479 if (yypact_value_is_default (yyn
))
1482 /* Not known => get a lookahead token if don't already have one. */
1484 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1485 if (yychar
== YYEMPTY
)
1487 YYDPRINTF ((stderr
, "Reading a token: "));
1491 if (yychar
<= YYEOF
)
1493 yychar
= yytoken
= YYEOF
;
1494 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1498 yytoken
= YYTRANSLATE (yychar
);
1499 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1502 /* If the proper action on seeing token YYTOKEN is to reduce or to
1503 detect an error, take that action. */
1505 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1510 if (yytable_value_is_error (yyn
))
1516 /* Count tokens shifted since error; after three, turn off error
1521 /* Shift the lookahead token. */
1522 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1524 /* Discard the shifted token. */
1533 /*-----------------------------------------------------------.
1534 | yydefault -- do the default action for the current state. |
1535 `-----------------------------------------------------------*/
1537 yyn
= yydefact
[yystate
];
1543 /*-----------------------------.
1544 | yyreduce -- Do a reduction. |
1545 `-----------------------------*/
1547 /* yyn is the number of a rule to reduce with. */
1550 /* If YYLEN is nonzero, implement the default value of the action:
1553 Otherwise, the following line sets YYVAL to garbage.
1554 This behavior is undocumented and Bison
1555 users should not rely upon it. Assigning to YYVAL
1556 unconditionally makes the parser a bit smaller, and it avoids a
1557 GCC warning that YYVAL may be used uninitialized. */
1558 yyval
= yyvsp
[1-yylen
];
1561 YY_REDUCE_PRINT (yyn
);
1566 /* Line 1806 of yacc.c */
1567 #line 201 "libmemcached/csl/parser.yy"
1573 /* Line 1806 of yacc.c */
1574 #line 203 "libmemcached/csl/parser.yy"
1580 /* Line 1806 of yacc.c */
1581 #line 205 "libmemcached/csl/parser.yy"
1587 /* Line 1806 of yacc.c */
1588 #line 207 "libmemcached/csl/parser.yy"
1597 /* Line 1806 of yacc.c */
1598 #line 212 "libmemcached/csl/parser.yy"
1600 context
->rc
= MEMCACHED_PARSE_USER_ERROR
;
1601 parser_abort(context
, "ERROR called directly");
1607 /* Line 1806 of yacc.c */
1608 #line 217 "libmemcached/csl/parser.yy"
1610 memcached_reset(context
->memc
);
1616 /* Line 1806 of yacc.c */
1617 #line 221 "libmemcached/csl/parser.yy"
1625 /* Line 1806 of yacc.c */
1626 #line 225 "libmemcached/csl/parser.yy"
1628 if ((context
->rc
= memcached_parse_configure_file(*context
->memc
, (yyvsp
[(3) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].string
).size
)) != MEMCACHED_SUCCESS
)
1630 parser_abort(context
, "Failed to parse configuration file");
1637 /* Line 1806 of yacc.c */
1638 #line 236 "libmemcached/csl/parser.yy"
1640 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
)))))
1643 snprintf(buffer
, sizeof(buffer
), "Failed to add server: %s:%u", (yyvsp
[(2) - (4)].server
).c_str
, uint32_t((yyvsp
[(3) - (4)].number
)));
1644 parser_abort(context
, buffer
);
1646 context
->unset_server();
1652 /* Line 1806 of yacc.c */
1653 #line 246 "libmemcached/csl/parser.yy"
1655 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
)))))
1658 snprintf(buffer
, sizeof(buffer
), "Failed to add server: %s:%u", (yyvsp
[(2) - (4)].server
).c_str
, uint32_t((yyvsp
[(3) - (4)].number
)));
1659 parser_abort(context
, buffer
);
1661 context
->unset_server();
1667 /* Line 1806 of yacc.c */
1668 #line 256 "libmemcached/csl/parser.yy"
1670 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
)))))
1673 snprintf(buffer
, sizeof(buffer
), "Failed to add socket: %s", (yyvsp
[(2) - (3)].string
).c_str
);
1674 parser_abort(context
, buffer
);
1681 /* Line 1806 of yacc.c */
1682 #line 265 "libmemcached/csl/parser.yy"
1684 memcached_set_configuration_file(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
);
1690 /* Line 1806 of yacc.c */
1691 #line 269 "libmemcached/csl/parser.yy"
1693 context
->memc
->configure
.initial_pool_size
= uint32_t((yyvsp
[(2) - (2)].number
));
1699 /* Line 1806 of yacc.c */
1700 #line 273 "libmemcached/csl/parser.yy"
1702 context
->memc
->configure
.max_pool_size
= uint32_t((yyvsp
[(2) - (2)].number
));
1708 /* Line 1806 of yacc.c */
1709 #line 281 "libmemcached/csl/parser.yy"
1711 if (memcached_callback_get(context
->memc
, MEMCACHED_CALLBACK_PREFIX_KEY
, NULL
))
1713 parser_abort(context
, "--NAMESPACE can only be called once");
1716 if ((context
->rc
= memcached_set_namespace(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
)) != MEMCACHED_SUCCESS
)
1718 parser_abort(context
, memcached_last_error_message(context
->memc
));
1725 /* Line 1806 of yacc.c */
1726 #line 293 "libmemcached/csl/parser.yy"
1728 memcached_flag(*context
->memc
, MEMCACHED_FLAG_IS_FETCHING_VERSION
, true);
1734 /* Line 1806 of yacc.c */
1735 #line 297 "libmemcached/csl/parser.yy"
1737 // Check to see if DISTRIBUTION has already been set
1738 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1740 parser_abort(context
, "--DISTRIBUTION can only be called once");
1743 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1745 parser_abort(context
, memcached_last_error_message(context
->memc
));;
1752 /* Line 1806 of yacc.c */
1753 #line 310 "libmemcached/csl/parser.yy"
1755 // Check to see if DISTRIBUTION has already been set
1756 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (4)].distribution
))) != MEMCACHED_SUCCESS
)
1758 parser_abort(context
, "--DISTRIBUTION can only be called once");
1761 if ((context
->rc
= memcached_behavior_set_distribution_hash(context
->memc
, (yyvsp
[(4) - (4)].hash
))) != MEMCACHED_SUCCESS
)
1763 parser_abort(context
, "Unable to set the hash for the DISTRIBUTION requested");
1770 /* Line 1806 of yacc.c */
1771 #line 323 "libmemcached/csl/parser.yy"
1773 if (context
->set_hash((yyvsp
[(2) - (2)].hash
)) == false)
1775 parser_abort(context
, "--HASH can only be set once");
1782 /* Line 1806 of yacc.c */
1783 #line 330 "libmemcached/csl/parser.yy"
1785 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (2)].behavior
), (yyvsp
[(2) - (2)].number
))) != MEMCACHED_SUCCESS
)
1787 parser_abort(context
, "Unable to set behavior");
1794 /* Line 1806 of yacc.c */
1795 #line 337 "libmemcached/csl/parser.yy"
1797 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (1)].behavior
), true)) != MEMCACHED_SUCCESS
)
1800 snprintf(buffer
, sizeof(buffer
), "Could not set: %s", libmemcached_string_behavior((yyvsp
[(1) - (1)].behavior
)));
1801 parser_abort(context
, buffer
);
1808 /* Line 1806 of yacc.c */
1809 #line 346 "libmemcached/csl/parser.yy"
1816 /* Line 1806 of yacc.c */
1817 #line 352 "libmemcached/csl/parser.yy"
1819 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS
;
1825 /* Line 1806 of yacc.c */
1826 #line 356 "libmemcached/csl/parser.yy"
1828 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
;
1834 /* Line 1806 of yacc.c */
1835 #line 360 "libmemcached/csl/parser.yy"
1837 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
;
1843 /* Line 1806 of yacc.c */
1844 #line 364 "libmemcached/csl/parser.yy"
1846 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
;
1852 /* Line 1806 of yacc.c */
1853 #line 368 "libmemcached/csl/parser.yy"
1855 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
;
1861 /* Line 1806 of yacc.c */
1862 #line 372 "libmemcached/csl/parser.yy"
1864 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
;
1870 /* Line 1806 of yacc.c */
1871 #line 376 "libmemcached/csl/parser.yy"
1873 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT
;
1879 /* Line 1806 of yacc.c */
1880 #line 380 "libmemcached/csl/parser.yy"
1882 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT
;
1888 /* Line 1806 of yacc.c */
1889 #line 384 "libmemcached/csl/parser.yy"
1891 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
;
1897 /* Line 1806 of yacc.c */
1898 #line 388 "libmemcached/csl/parser.yy"
1900 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SND_TIMEOUT
;
1906 /* Line 1806 of yacc.c */
1907 #line 392 "libmemcached/csl/parser.yy"
1909 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
;
1915 /* Line 1806 of yacc.c */
1916 #line 396 "libmemcached/csl/parser.yy"
1918 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
;
1924 /* Line 1806 of yacc.c */
1925 #line 403 "libmemcached/csl/parser.yy"
1927 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
;
1933 /* Line 1806 of yacc.c */
1934 #line 407 "libmemcached/csl/parser.yy"
1936 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
;
1942 /* Line 1806 of yacc.c */
1943 #line 411 "libmemcached/csl/parser.yy"
1945 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
;
1951 /* Line 1806 of yacc.c */
1952 #line 415 "libmemcached/csl/parser.yy"
1954 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NOREPLY
;
1960 /* Line 1806 of yacc.c */
1961 #line 419 "libmemcached/csl/parser.yy"
1963 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
;
1969 /* Line 1806 of yacc.c */
1970 #line 423 "libmemcached/csl/parser.yy"
1972 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SORT_HOSTS
;
1978 /* Line 1806 of yacc.c */
1979 #line 427 "libmemcached/csl/parser.yy"
1981 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SUPPORT_CAS
;
1987 /* Line 1806 of yacc.c */
1988 #line 431 "libmemcached/csl/parser.yy"
1990 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_NODELAY
;
1996 /* Line 1806 of yacc.c */
1997 #line 435 "libmemcached/csl/parser.yy"
1999 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
;
2005 /* Line 1806 of yacc.c */
2006 #line 439 "libmemcached/csl/parser.yy"
2008 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE
;
2014 /* Line 1806 of yacc.c */
2015 #line 443 "libmemcached/csl/parser.yy"
2017 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_USE_UDP
;
2023 /* Line 1806 of yacc.c */
2024 #line 447 "libmemcached/csl/parser.yy"
2026 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_VERIFY_KEY
;
2032 /* Line 1806 of yacc.c */
2033 #line 453 "libmemcached/csl/parser.yy"
2034 { (yyval
.number
)= MEMCACHED_DEFAULT_PORT
;}
2039 /* Line 1806 of yacc.c */
2040 #line 455 "libmemcached/csl/parser.yy"
2046 /* Line 1806 of yacc.c */
2047 #line 459 "libmemcached/csl/parser.yy"
2048 { (yyval
.number
)= 1; }
2053 /* Line 1806 of yacc.c */
2054 #line 461 "libmemcached/csl/parser.yy"
2060 /* Line 1806 of yacc.c */
2061 #line 466 "libmemcached/csl/parser.yy"
2063 (yyval
.hash
)= MEMCACHED_HASH_MD5
;
2069 /* Line 1806 of yacc.c */
2070 #line 470 "libmemcached/csl/parser.yy"
2072 (yyval
.hash
)= MEMCACHED_HASH_CRC
;
2078 /* Line 1806 of yacc.c */
2079 #line 474 "libmemcached/csl/parser.yy"
2081 (yyval
.hash
)= MEMCACHED_HASH_FNV1_64
;
2087 /* Line 1806 of yacc.c */
2088 #line 478 "libmemcached/csl/parser.yy"
2090 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_64
;
2096 /* Line 1806 of yacc.c */
2097 #line 482 "libmemcached/csl/parser.yy"
2099 (yyval
.hash
)= MEMCACHED_HASH_FNV1_32
;
2105 /* Line 1806 of yacc.c */
2106 #line 486 "libmemcached/csl/parser.yy"
2108 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_32
;
2114 /* Line 1806 of yacc.c */
2115 #line 490 "libmemcached/csl/parser.yy"
2117 (yyval
.hash
)= MEMCACHED_HASH_HSIEH
;
2123 /* Line 1806 of yacc.c */
2124 #line 494 "libmemcached/csl/parser.yy"
2126 (yyval
.hash
)= MEMCACHED_HASH_MURMUR
;
2132 /* Line 1806 of yacc.c */
2133 #line 498 "libmemcached/csl/parser.yy"
2135 (yyval
.hash
)= MEMCACHED_HASH_JENKINS
;
2141 /* Line 1806 of yacc.c */
2142 #line 505 "libmemcached/csl/parser.yy"
2144 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2150 /* Line 1806 of yacc.c */
2151 #line 509 "libmemcached/csl/parser.yy"
2153 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2159 /* Line 1806 of yacc.c */
2160 #line 516 "libmemcached/csl/parser.yy"
2162 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_CONSISTENT
;
2168 /* Line 1806 of yacc.c */
2169 #line 520 "libmemcached/csl/parser.yy"
2171 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_MODULA
;
2177 /* Line 1806 of yacc.c */
2178 #line 524 "libmemcached/csl/parser.yy"
2180 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_RANDOM
;
2186 /* Line 1806 of yacc.c */
2187 #line 2188 "libmemcached/csl/parser.cc"
2190 /* User semantic actions sometimes alter yychar, and that requires
2191 that yytoken be updated with the new translation. We take the
2192 approach of translating immediately before every use of yytoken.
2193 One alternative is translating here after every semantic action,
2194 but that translation would be missed if the semantic action invokes
2195 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2196 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2197 incorrect destructor might then be invoked immediately. In the
2198 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2199 to an incorrect destructor call or verbose syntax error message
2200 before the lookahead is translated. */
2201 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2205 YY_STACK_PRINT (yyss
, yyssp
);
2209 /* Now `shift' the result of the reduction. Determine what state
2210 that goes to, based on the state we popped back to and the rule
2211 number reduced by. */
2215 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2216 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2217 yystate
= yytable
[yystate
];
2219 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2224 /*------------------------------------.
2225 | yyerrlab -- here on detecting error |
2226 `------------------------------------*/
2228 /* Make sure we have latest lookahead translation. See comments at
2229 user semantic actions for why this is necessary. */
2230 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
2232 /* If not already recovering from an error, report this error. */
2236 #if ! YYERROR_VERBOSE
2237 yyerror (context
, scanner
, YY_("syntax error"));
2239 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2242 char const *yymsgp
= YY_("syntax error");
2243 int yysyntax_error_status
;
2244 yysyntax_error_status
= YYSYNTAX_ERROR
;
2245 if (yysyntax_error_status
== 0)
2247 else if (yysyntax_error_status
== 1)
2249 if (yymsg
!= yymsgbuf
)
2250 YYSTACK_FREE (yymsg
);
2251 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2255 yymsg_alloc
= sizeof yymsgbuf
;
2256 yysyntax_error_status
= 2;
2260 yysyntax_error_status
= YYSYNTAX_ERROR
;
2264 yyerror (context
, scanner
, yymsgp
);
2265 if (yysyntax_error_status
== 2)
2266 goto yyexhaustedlab
;
2268 # undef YYSYNTAX_ERROR
2274 if (yyerrstatus
== 3)
2276 /* If just tried and failed to reuse lookahead token after an
2277 error, discard it. */
2279 if (yychar
<= YYEOF
)
2281 /* Return failure if at end of input. */
2282 if (yychar
== YYEOF
)
2287 yydestruct ("Error: discarding",
2288 yytoken
, &yylval
, context
, scanner
);
2293 /* Else will try to reuse lookahead token after shifting the error
2298 /*---------------------------------------------------.
2299 | yyerrorlab -- error raised explicitly by YYERROR. |
2300 `---------------------------------------------------*/
2303 /* Pacify compilers like GCC when the user code never invokes
2304 YYERROR and the label yyerrorlab therefore never appears in user
2306 if (/*CONSTCOND*/ 0)
2309 /* Do not reclaim the symbols of the rule which action triggered
2313 YY_STACK_PRINT (yyss
, yyssp
);
2318 /*-------------------------------------------------------------.
2319 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2320 `-------------------------------------------------------------*/
2322 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2326 yyn
= yypact
[yystate
];
2327 if (!yypact_value_is_default (yyn
))
2330 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2338 /* Pop the current state because it cannot handle the error token. */
2343 yydestruct ("Error: popping",
2344 yystos
[yystate
], yyvsp
, context
, scanner
);
2347 YY_STACK_PRINT (yyss
, yyssp
);
2353 /* Shift the error token. */
2354 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2360 /*-------------------------------------.
2361 | yyacceptlab -- YYACCEPT comes here. |
2362 `-------------------------------------*/
2367 /*-----------------------------------.
2368 | yyabortlab -- YYABORT comes here. |
2369 `-----------------------------------*/
2374 #if !defined(yyoverflow) || YYERROR_VERBOSE
2375 /*-------------------------------------------------.
2376 | yyexhaustedlab -- memory exhaustion comes here. |
2377 `-------------------------------------------------*/
2379 yyerror (context
, scanner
, YY_("memory exhausted"));
2385 if (yychar
!= YYEMPTY
)
2387 /* Make sure we have latest lookahead translation. See comments at
2388 user semantic actions for why this is necessary. */
2389 yytoken
= YYTRANSLATE (yychar
);
2390 yydestruct ("Cleanup: discarding lookahead",
2391 yytoken
, &yylval
, context
, scanner
);
2393 /* Do not reclaim the symbols of the rule which action triggered
2394 this YYABORT or YYACCEPT. */
2396 YY_STACK_PRINT (yyss
, yyssp
);
2397 while (yyssp
!= yyss
)
2399 yydestruct ("Cleanup: popping",
2400 yystos
[*yyssp
], yyvsp
, context
, scanner
);
2405 YYSTACK_FREE (yyss
);
2408 if (yymsg
!= yymsgbuf
)
2409 YYSTACK_FREE (yymsg
);
2411 /* Make sure YYID is used. */
2412 return YYID (yyresult
);
2417 /* Line 2067 of yacc.c */
2418 #line 529 "libmemcached/csl/parser.yy"
2421 void Context::start()
2423 config_parse(this, (void **)scanner
);