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 int conf_lex(YYSTYPE
* lvalp
, void* scanner
);
93 #define select_yychar(__context) yychar == UNKNOWN ? ( (__context)->previous_token == END ? UNKNOWN : (__context)->previous_token ) : yychar
95 #define stryytname(__yytokentype) ((__yytokentype) < YYNTOKENS ) ? yytname[(__yytokentype)] : ""
97 #define parser_abort(__context, __error_message) do { (__context)->abort((__error_message), yytokentype(select_yychar(__context)), stryytname(YYTRANSLATE(select_yychar(__context)))); YYABORT; } while (0)
99 // This is bison calling error.
100 inline void __config_error(Context
*context
, yyscan_t
*scanner
, const char *error
, int last_token
, const char *last_token_str
)
102 if (not context
->end())
104 context
->error(error
, yytokentype(last_token
), last_token_str
);
108 context
->error(error
, yytokentype(last_token
), last_token_str
);
112 #define config_error(__context, __scanner, __error_msg) do { __config_error((__context), (__scanner), (__error_msg), select_yychar(__context), stryytname(YYTRANSLATE(select_yychar(__context)))); } while (0)
117 /* Line 268 of yacc.c */
118 #line 119 "libmemcached/csl/parser.cc"
120 /* Enabling traces. */
125 /* Enabling verbose error messages. */
126 #ifdef YYERROR_VERBOSE
127 # undef YYERROR_VERBOSE
128 # define YYERROR_VERBOSE 1
130 # define YYERROR_VERBOSE 1
133 /* Enabling the token table. */
134 #ifndef YYTOKEN_TABLE
135 # define YYTOKEN_TABLE 0
142 /* Put the tokens into the symbol table, so that GDB and other debuggers
151 CONFIGURE_FILE
= 264,
156 SERVERS_OPTION
= 269,
157 UNKNOWN_OPTION
= 270,
159 BINARY_PROTOCOL
= 272,
160 BUFFER_REQUESTS
= 273,
161 CONNECT_TIMEOUT
= 274,
164 HASH_WITH_NAMESPACE
= 277,
165 IO_BYTES_WATERMARK
= 278,
166 IO_KEY_PREFETCH
= 279,
167 IO_MSG_WATERMARK
= 280,
169 KETAMA_WEIGHTED
= 282,
171 NUMBER_OF_REPLICAS
= 284,
173 RANDOMIZE_REPLICA_READ
= 286,
175 REMOVE_FAILED_SERVERS
= 288,
178 SOCKET_RECV_SIZE
= 291,
179 SOCKET_SEND_SIZE
= 292,
185 _TCP_KEEPALIVE
= 298,
220 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
222 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
223 # define YYSTYPE_IS_DECLARED 1
227 /* Copy the second part of user declarations. */
230 /* Line 343 of yacc.c */
231 #line 232 "libmemcached/csl/parser.cc"
238 typedef YYTYPE_UINT8 yytype_uint8
;
240 typedef unsigned char yytype_uint8
;
244 typedef YYTYPE_INT8 yytype_int8
;
245 #elif (defined __STDC__ || defined __C99__FUNC__ \
246 || defined __cplusplus || defined _MSC_VER)
247 typedef signed char yytype_int8
;
249 typedef short int yytype_int8
;
253 typedef YYTYPE_UINT16 yytype_uint16
;
255 typedef unsigned short int yytype_uint16
;
259 typedef YYTYPE_INT16 yytype_int16
;
261 typedef short int yytype_int16
;
265 # ifdef __SIZE_TYPE__
266 # define YYSIZE_T __SIZE_TYPE__
267 # elif defined size_t
268 # define YYSIZE_T size_t
269 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
270 || defined __cplusplus || defined _MSC_VER)
271 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
272 # define YYSIZE_T size_t
274 # define YYSIZE_T unsigned int
278 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
281 # if defined YYENABLE_NLS && YYENABLE_NLS
283 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
284 # define YY_(msgid) dgettext ("bison-runtime", msgid)
288 # define YY_(msgid) msgid
292 /* Suppress unused-variable warnings by "using" E. */
293 #if ! defined lint || defined __GNUC__
294 # define YYUSE(e) ((void) (e))
296 # define YYUSE(e) /* empty */
299 /* Identity function, used to suppress warnings about constant conditions. */
303 #if (defined __STDC__ || defined __C99__FUNC__ \
304 || defined __cplusplus || defined _MSC_VER)
317 #if ! defined yyoverflow || YYERROR_VERBOSE
319 /* The parser invokes alloca or malloc; define the necessary symbols. */
321 # ifdef YYSTACK_USE_ALLOCA
322 # if YYSTACK_USE_ALLOCA
324 # define YYSTACK_ALLOC __builtin_alloca
325 # elif defined __BUILTIN_VA_ARG_INCR
326 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
328 # define YYSTACK_ALLOC __alloca
329 # elif defined _MSC_VER
330 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
331 # define alloca _alloca
333 # define YYSTACK_ALLOC alloca
334 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
335 || defined __cplusplus || defined _MSC_VER)
336 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
337 # ifndef EXIT_SUCCESS
338 # define EXIT_SUCCESS 0
345 # ifdef YYSTACK_ALLOC
346 /* Pacify GCC's `empty if-body' warning. */
347 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
348 # ifndef YYSTACK_ALLOC_MAXIMUM
349 /* The OS might guarantee only one guard page at the bottom of the stack,
350 and a page size can be as small as 4096 bytes. So we cannot safely
351 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
352 to allow for a few compiler-allocated temporary stack slots. */
353 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
356 # define YYSTACK_ALLOC YYMALLOC
357 # define YYSTACK_FREE YYFREE
358 # ifndef YYSTACK_ALLOC_MAXIMUM
359 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
361 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
362 && ! ((defined YYMALLOC || defined malloc) \
363 && (defined YYFREE || defined free)))
364 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
365 # ifndef EXIT_SUCCESS
366 # define EXIT_SUCCESS 0
370 # define YYMALLOC malloc
371 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
372 || defined __cplusplus || defined _MSC_VER)
373 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
378 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
379 || defined __cplusplus || defined _MSC_VER)
380 void free (void *); /* INFRINGES ON USER NAME SPACE */
384 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
387 #if (! defined yyoverflow \
388 && (! defined __cplusplus \
389 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
391 /* A type that is properly aligned for any stack member. */
394 yytype_int16 yyss_alloc
;
398 /* The size of the maximum gap between one aligned stack and the next. */
399 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
401 /* The size of an array large to enough to hold all stacks, each with
403 # define YYSTACK_BYTES(N) \
404 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
405 + YYSTACK_GAP_MAXIMUM)
407 # define YYCOPY_NEEDED 1
409 /* Relocate STACK from its old location to the new one. The
410 local variables YYSIZE and YYSTACKSIZE give the old and new number of
411 elements in the stack, and YYPTR gives the new location of the
412 stack. Advance YYPTR to a properly aligned location for the next
414 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
417 YYSIZE_T yynewbytes; \
418 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
419 Stack = &yyptr->Stack_alloc; \
420 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
421 yyptr += yynewbytes / sizeof (*yyptr); \
427 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
428 /* Copy COUNT objects from FROM to TO. The source and destination do
431 # if defined __GNUC__ && 1 < __GNUC__
432 # define YYCOPY(To, From, Count) \
433 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
435 # define YYCOPY(To, From, Count) \
439 for (yyi = 0; yyi < (Count); yyi++) \
440 (To)[yyi] = (From)[yyi]; \
445 #endif /* !YYCOPY_NEEDED */
447 /* YYFINAL -- State number of the termination state. */
449 /* YYLAST -- Last index in YYTABLE. */
452 /* YYNTOKENS -- Number of terminals. */
454 /* YYNNTS -- Number of nonterminals. */
456 /* YYNRULES -- Number of rules. */
458 /* YYNRULES -- Number of states. */
461 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
463 #define YYMAXUTOK 327
465 #define YYTRANSLATE(YYX) \
466 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
468 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
469 static const yytype_uint8 yytranslate
[] =
471 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 75, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 64, 2, 2, 2, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 65, 2, 2, 2, 2, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
481 2, 2, 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, 1, 2, 3, 4,
497 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
498 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
499 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
500 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
501 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
502 55, 56, 57, 58, 59, 60, 61, 62, 63, 66,
503 67, 68, 69, 70, 71, 72, 73, 74
507 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
509 static const yytype_uint8 yyprhs
[] =
511 0, 0, 3, 5, 9, 11, 13, 15, 17, 19,
512 21, 23, 27, 32, 37, 41, 44, 47, 50, 52,
513 55, 57, 60, 65, 68, 71, 73, 75, 77, 79,
514 81, 83, 85, 87, 89, 91, 93, 95, 97, 99,
515 101, 103, 105, 107, 109, 111, 113, 115, 117, 119,
516 121, 123, 124, 126, 127, 129, 131, 133, 135, 137,
517 139, 141, 143, 145, 147, 149, 151, 153, 155
520 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
521 static const yytype_int8 yyrhs
[] =
523 77, 0, -1, 78, -1, 77, 75, 78, -1, 79,
524 -1, 3, -1, 10, -1, 4, -1, 5, -1, 6,
525 -1, 7, -1, 8, 75, 86, -1, 11, 71, 83,
526 84, -1, 11, 70, 83, 84, -1, 12, 86, 84,
527 -1, 9, 86, -1, 48, 67, -1, 49, 67, -1,
528 80, -1, 47, 86, -1, 46, -1, 20, 87, -1,
529 20, 87, 64, 85, -1, 21, 85, -1, 81, 67,
530 -1, 82, -1, 40, -1, 33, -1, 19, -1, 25,
531 -1, 23, -1, 24, -1, 29, -1, 30, -1, 32,
532 -1, 34, -1, 35, -1, 36, -1, 37, -1, 17,
533 -1, 18, -1, 22, -1, 28, -1, 31, -1, 38,
534 -1, 39, -1, 45, -1, 43, -1, 44, -1, 41,
535 -1, 42, -1, -1, 68, -1, -1, 69, -1, 50,
536 -1, 51, -1, 52, -1, 53, -1, 54, -1, 55,
537 -1, 56, -1, 57, -1, 58, -1, 72, -1, 73,
538 -1, 59, -1, 60, -1, 61, -1
541 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
542 static const yytype_uint16 yyrline
[] =
544 0, 189, 189, 190, 194, 196, 198, 200, 205, 210,
545 214, 218, 229, 239, 249, 258, 262, 266, 270, 274,
546 286, 290, 303, 316, 323, 330, 339, 345, 349, 353,
547 357, 361, 365, 369, 373, 377, 381, 385, 389, 396,
548 400, 404, 408, 412, 416, 420, 424, 428, 432, 436,
549 440, 447, 448, 453, 454, 459, 463, 467, 471, 475,
550 479, 483, 487, 491, 498, 502, 509, 513, 517
554 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
555 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
556 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
557 static const char *const yytname
[] =
559 "$end", "error", "$undefined", "COMMENT", "END", "ERROR", "RESET",
560 "PARSER_DEBUG", "INCLUDE", "CONFIGURE_FILE", "EMPTY_LINE", "SERVER",
561 "SOCKET", "SERVERS", "SERVERS_OPTION", "UNKNOWN_OPTION", "UNKNOWN",
562 "BINARY_PROTOCOL", "BUFFER_REQUESTS", "CONNECT_TIMEOUT", "DISTRIBUTION",
563 "HASH", "HASH_WITH_NAMESPACE", "IO_BYTES_WATERMARK", "IO_KEY_PREFETCH",
564 "IO_MSG_WATERMARK", "KETAMA_HASH", "KETAMA_WEIGHTED", "NOREPLY",
565 "NUMBER_OF_REPLICAS", "POLL_TIMEOUT", "RANDOMIZE_REPLICA_READ",
566 "RCV_TIMEOUT", "REMOVE_FAILED_SERVERS", "RETRY_TIMEOUT", "SND_TIMEOUT",
567 "SOCKET_RECV_SIZE", "SOCKET_SEND_SIZE", "SORT_HOSTS", "SUPPORT_CAS",
568 "USER_DATA", "USE_UDP", "VERIFY_KEY", "_TCP_KEEPALIVE", "_TCP_KEEPIDLE",
569 "_TCP_NODELAY", "FETCH_VERSION", "NAMESPACE", "POOL_MIN", "POOL_MAX",
570 "MD5", "CRC", "FNV1_64", "FNV1A_64", "FNV1_32", "FNV1A_32", "HSIEH",
571 "MURMUR", "JENKINS", "CONSISTENT", "MODULA", "RANDOM", "TRUE", "FALSE",
572 "','", "'='", "FLOAT", "NUMBER", "PORT", "WEIGHT_START", "IPADDRESS",
573 "HOSTNAME", "STRING", "QUOTED_STRING", "FILE_PATH", "' '", "$accept",
574 "begin", "statement", "expression", "behaviors", "behavior_number",
575 "behavior_boolean", "optional_port", "optional_weight", "hash", "string",
581 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
583 static const yytype_uint16 yytoknum
[] =
585 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
586 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
587 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
588 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
589 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
590 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
591 315, 316, 317, 318, 44, 61, 319, 320, 321, 322,
592 323, 324, 325, 326, 327, 32
596 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
597 static const yytype_uint8 yyr1
[] =
599 0, 76, 77, 77, 78, 78, 78, 78, 78, 78,
600 78, 78, 79, 79, 79, 79, 79, 79, 79, 80,
601 80, 80, 80, 80, 80, 80, 80, 81, 81, 81,
602 81, 81, 81, 81, 81, 81, 81, 81, 81, 82,
603 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
604 82, 83, 83, 84, 84, 85, 85, 85, 85, 85,
605 85, 85, 85, 85, 86, 86, 87, 87, 87
608 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
609 static const yytype_uint8 yyr2
[] =
611 0, 2, 1, 3, 1, 1, 1, 1, 1, 1,
612 1, 3, 4, 4, 3, 2, 2, 2, 1, 2,
613 1, 2, 4, 2, 2, 1, 1, 1, 1, 1,
614 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
615 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
616 1, 0, 1, 0, 1, 1, 1, 1, 1, 1,
617 1, 1, 1, 1, 1, 1, 1, 1, 1
620 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
621 Performed when YYTABLE doesn't specify something else to do. Zero
622 means the default is an error. */
623 static const yytype_uint8 yydefact
[] =
625 0, 5, 7, 8, 9, 10, 0, 0, 6, 0,
626 0, 39, 40, 28, 0, 0, 41, 30, 31, 29,
627 42, 32, 33, 43, 34, 27, 35, 36, 37, 38,
628 44, 45, 26, 49, 50, 47, 48, 46, 20, 0,
629 0, 0, 0, 2, 4, 18, 0, 25, 0, 64,
630 65, 15, 51, 51, 53, 66, 67, 68, 21, 55,
631 56, 57, 58, 59, 60, 61, 62, 63, 23, 19,
632 16, 17, 1, 0, 24, 11, 52, 53, 53, 54,
636 /* YYDEFGOTO[NTERM-NUM]. */
637 static const yytype_int8 yydefgoto
[] =
639 -1, 42, 43, 44, 45, 46, 47, 77, 80, 68,
643 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
645 #define YYPACT_NINF -62
646 static const yytype_int8 yypact
[] =
648 -2, -62, -62, -62, -62, -62, -61, -24, -62, -20,
649 -24, -62, -62, -62, -48, 13, -62, -62, -62, -62,
650 -62, -62, -62, -62, -62, -62, -62, -62, -62, -62,
651 -62, -62, -62, -62, -62, -62, -62, -62, -62, -24,
652 -42, -15, 0, -62, -62, -62, -11, -62, -24, -62,
653 -62, -62, -10, -10, -12, -62, -62, -62, -5, -62,
654 -62, -62, -62, -62, -62, -62, -62, -62, -62, -62,
655 -62, -62, -62, -2, -62, -62, -62, -12, -12, -62,
656 -62, 13, -62, -62, -62, -62
659 /* YYPGOTO[NTERM-NUM]. */
660 static const yytype_int8 yypgoto
[] =
662 -62, -62, -13, -62, -62, -62, -62, 8, -23, -9,
666 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
667 positive, shift that token. If negative, reduce the rule which
668 number is the opposite. If YYTABLE_NINF, syntax error. */
669 #define YYTABLE_NINF -1
670 static const yytype_uint8 yytable
[] =
672 72, 1, 2, 3, 4, 5, 6, 7, 8, 9,
673 10, 55, 56, 57, 48, 11, 12, 13, 14, 15,
674 16, 17, 18, 19, 54, 70, 20, 21, 22, 23,
675 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
676 34, 35, 36, 37, 38, 39, 40, 41, 49, 50,
677 52, 53, 71, 69, 83, 84, 74, 79, 76, 81,
678 82, 78, 75, 59, 60, 61, 62, 63, 64, 65,
682 #define yypact_value_is_default(yystate) \
685 #define yytable_value_is_error(yytable_value) \
688 static const yytype_int8 yycheck
[] =
690 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
691 12, 59, 60, 61, 75, 17, 18, 19, 20, 21,
692 22, 23, 24, 25, 10, 67, 28, 29, 30, 31,
693 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
694 42, 43, 44, 45, 46, 47, 48, 49, 72, 73,
695 70, 71, 67, 39, 77, 78, 67, 69, 68, 64,
696 73, 53, 48, 50, 51, 52, 53, 54, 55, 56,
697 57, 58, 81, -1, -1, 75
700 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
701 symbol of state STATE-NUM. */
702 static const yytype_uint8 yystos
[] =
704 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
705 12, 17, 18, 19, 20, 21, 22, 23, 24, 25,
706 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
707 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
708 48, 49, 77, 78, 79, 80, 81, 82, 75, 72,
709 73, 86, 70, 71, 86, 59, 60, 61, 87, 50,
710 51, 52, 53, 54, 55, 56, 57, 58, 85, 86,
711 67, 67, 0, 75, 67, 86, 68, 83, 83, 69,
712 84, 64, 78, 84, 84, 85
715 #define yyerrok (yyerrstatus = 0)
716 #define yyclearin (yychar = YYEMPTY)
720 #define YYACCEPT goto yyacceptlab
721 #define YYABORT goto yyabortlab
722 #define YYERROR goto yyerrorlab
725 /* Like YYERROR except do call yyerror. This remains here temporarily
726 to ease the transition to the new meaning of YYERROR, for GCC.
727 Once GCC version 2 has supplanted version 1, this can go. However,
728 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
729 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
732 #define YYFAIL goto yyerrlab
734 /* This is here to suppress warnings from the GCC cpp's
735 -Wunused-macros. Normally we don't worry about that warning, but
736 some users do, and we want to make it easy for users to remove
737 YYFAIL uses, which will produce warnings from Bison 2.5. */
740 #define YYRECOVERING() (!!yyerrstatus)
742 #define YYBACKUP(Token, Value) \
744 if (yychar == YYEMPTY && yylen == 1) \
753 yyerror (context, scanner, YY_("syntax error: cannot back up")); \
760 #define YYERRCODE 256
763 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
764 If N is 0, then set CURRENT to the empty location which ends
765 the previous symbol: RHS[0] (always defined). */
767 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
768 #ifndef YYLLOC_DEFAULT
769 # define YYLLOC_DEFAULT(Current, Rhs, N) \
773 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
774 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
775 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
776 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
780 (Current).first_line = (Current).last_line = \
781 YYRHSLOC (Rhs, 0).last_line; \
782 (Current).first_column = (Current).last_column = \
783 YYRHSLOC (Rhs, 0).last_column; \
789 /* This macro is provided for backward compatibility. */
791 #ifndef YY_LOCATION_PRINT
792 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
796 /* YYLEX -- calling `yylex' with the right arguments. */
799 # define YYLEX yylex (&yylval, YYLEX_PARAM)
801 # define YYLEX yylex (&yylval, scanner)
804 /* Enable debugging if requested. */
808 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
809 # define YYFPRINTF fprintf
812 # define YYDPRINTF(Args) \
818 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
822 YYFPRINTF (stderr, "%s ", Title); \
823 yy_symbol_print (stderr, \
824 Type, Value, context, scanner); \
825 YYFPRINTF (stderr, "\n"); \
830 /*--------------------------------.
831 | Print this symbol on YYOUTPUT. |
832 `--------------------------------*/
835 #if (defined __STDC__ || defined __C99__FUNC__ \
836 || defined __cplusplus || defined _MSC_VER)
838 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
841 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
844 YYSTYPE
const * const yyvaluep
;
854 if (yytype
< YYNTOKENS
)
855 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
867 /*--------------------------------.
868 | Print this symbol on YYOUTPUT. |
869 `--------------------------------*/
871 #if (defined __STDC__ || defined __C99__FUNC__ \
872 || defined __cplusplus || defined _MSC_VER)
874 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, Context
*context
, yyscan_t
*scanner
)
877 yy_symbol_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
)
880 YYSTYPE
const * const yyvaluep
;
885 if (yytype
< YYNTOKENS
)
886 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
888 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
890 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, context
, scanner
);
891 YYFPRINTF (yyoutput
, ")");
894 /*------------------------------------------------------------------.
895 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
897 `------------------------------------------------------------------*/
899 #if (defined __STDC__ || defined __C99__FUNC__ \
900 || defined __cplusplus || defined _MSC_VER)
902 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
905 yy_stack_print (yybottom
, yytop
)
906 yytype_int16
*yybottom
;
910 YYFPRINTF (stderr
, "Stack now");
911 for (; yybottom
<= yytop
; yybottom
++)
913 int yybot
= *yybottom
;
914 YYFPRINTF (stderr
, " %d", yybot
);
916 YYFPRINTF (stderr
, "\n");
919 # define YY_STACK_PRINT(Bottom, Top) \
922 yy_stack_print ((Bottom), (Top)); \
926 /*------------------------------------------------.
927 | Report that the YYRULE is going to be reduced. |
928 `------------------------------------------------*/
930 #if (defined __STDC__ || defined __C99__FUNC__ \
931 || defined __cplusplus || defined _MSC_VER)
933 yy_reduce_print (YYSTYPE
*yyvsp
, int yyrule
, Context
*context
, yyscan_t
*scanner
)
936 yy_reduce_print (yyvsp
, yyrule
, context
, scanner
)
943 int yynrhs
= yyr2
[yyrule
];
945 unsigned long int yylno
= yyrline
[yyrule
];
946 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
948 /* The symbols being reduced. */
949 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
951 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
952 yy_symbol_print (stderr
, yyrhs
[yyprhs
[yyrule
] + yyi
],
953 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
955 YYFPRINTF (stderr
, "\n");
959 # define YY_REDUCE_PRINT(Rule) \
962 yy_reduce_print (yyvsp, Rule, context, scanner); \
965 /* Nonzero means print parse trace. It is left uninitialized so that
966 multiple parsers can coexist. */
969 # define YYDPRINTF(Args)
970 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
971 # define YY_STACK_PRINT(Bottom, Top)
972 # define YY_REDUCE_PRINT(Rule)
973 #endif /* !YYDEBUG */
976 /* YYINITDEPTH -- initial size of the parser's stacks. */
978 # define YYINITDEPTH 200
981 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
982 if the built-in stack extension method is used).
984 Do not make this value too large; the results are undefined if
985 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
986 evaluated with infinite-precision integer arithmetic. */
989 # define YYMAXDEPTH 10000
996 # if defined __GLIBC__ && defined _STRING_H
997 # define yystrlen strlen
999 /* Return the length of YYSTR. */
1000 #if (defined __STDC__ || defined __C99__FUNC__ \
1001 || defined __cplusplus || defined _MSC_VER)
1003 yystrlen (const char *yystr
)
1011 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1019 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1020 # define yystpcpy stpcpy
1022 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1024 #if (defined __STDC__ || defined __C99__FUNC__ \
1025 || defined __cplusplus || defined _MSC_VER)
1027 yystpcpy (char *yydest
, const char *yysrc
)
1030 yystpcpy (yydest
, yysrc
)
1036 const char *yys
= yysrc
;
1038 while ((*yyd
++ = *yys
++) != '\0')
1047 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1048 quotes and backslashes, so that it's suitable for yyerror. The
1049 heuristic is that double-quoting is unnecessary unless the string
1050 contains an apostrophe, a comma, or backslash (other than
1051 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1052 null, do not copy; instead, return the length of what the result
1055 yytnamerr (char *yyres
, const char *yystr
)
1060 char const *yyp
= yystr
;
1067 goto do_not_strip_quotes
;
1071 goto do_not_strip_quotes
;
1084 do_not_strip_quotes
: ;
1088 return yystrlen (yystr
);
1090 return yystpcpy (yyres
, yystr
) - yyres
;
1094 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1095 about the unexpected token YYTOKEN for the state stack whose top is
1098 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1099 not large enough to hold the message. In that case, also set
1100 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1101 required number of bytes is too large to store. */
1103 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1104 yytype_int16
*yyssp
, int yytoken
)
1106 YYSIZE_T yysize0
= yytnamerr (0, yytname
[yytoken
]);
1107 YYSIZE_T yysize
= yysize0
;
1109 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1110 /* Internationalized format string. */
1111 const char *yyformat
= 0;
1112 /* Arguments of yyformat. */
1113 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1114 /* Number of reported tokens (one for the "unexpected", one per
1118 /* There are many possibilities here to consider:
1119 - Assume YYFAIL is not used. It's too flawed to consider. See
1120 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1121 for details. YYERROR is fine as it does not invoke this
1123 - If this state is a consistent state with a default action, then
1124 the only way this function was invoked is if the default action
1125 is an error action. In that case, don't check for expected
1126 tokens because there are none.
1127 - The only way there can be no lookahead present (in yychar) is if
1128 this state is a consistent state with a default action. Thus,
1129 detecting the absence of a lookahead is sufficient to determine
1130 that there is no unexpected or expected token to report. In that
1131 case, just report a simple "syntax error".
1132 - Don't assume there isn't a lookahead just because this state is a
1133 consistent state with a default action. There might have been a
1134 previous inconsistent state, consistent state with a non-default
1135 action, or user semantic action that manipulated yychar.
1136 - Of course, the expected token list depends on states to have
1137 correct lookahead information, and it depends on the parser not
1138 to perform extra reductions after fetching a lookahead from the
1139 scanner and before detecting a syntax error. Thus, state merging
1140 (from LALR or IELR) and default reductions corrupt the expected
1141 token list. However, the list is correct for canonical LR with
1142 one exception: it will still contain any token that will not be
1143 accepted due to an error action in a later state.
1145 if (yytoken
!= YYEMPTY
)
1147 int yyn
= yypact
[*yyssp
];
1148 yyarg
[yycount
++] = yytname
[yytoken
];
1149 if (!yypact_value_is_default (yyn
))
1151 /* Start YYX at -YYN if negative to avoid negative indexes in
1152 YYCHECK. In other words, skip the first -YYN actions for
1153 this state because they are default actions. */
1154 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1155 /* Stay within bounds of both yycheck and yytname. */
1156 int yychecklim
= YYLAST
- yyn
+ 1;
1157 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1160 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1161 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1162 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1164 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1170 yyarg
[yycount
++] = yytname
[yyx
];
1171 yysize1
= yysize
+ yytnamerr (0, yytname
[yyx
]);
1172 if (! (yysize
<= yysize1
1173 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1182 # define YYCASE_(N, S) \
1186 YYCASE_(0, YY_("syntax error"));
1187 YYCASE_(1, YY_("syntax error, unexpected %s"));
1188 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1189 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1190 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1191 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1195 yysize1
= yysize
+ yystrlen (yyformat
);
1196 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1200 if (*yymsg_alloc
< yysize
)
1202 *yymsg_alloc
= 2 * yysize
;
1203 if (! (yysize
<= *yymsg_alloc
1204 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1205 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1209 /* Avoid sprintf, as that infringes on the user's name space.
1210 Don't have undefined behavior even if the translation
1211 produced a string with the wrong number of "%s"s. */
1215 while ((*yyp
= *yyformat
) != '\0')
1216 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1218 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1229 #endif /* YYERROR_VERBOSE */
1231 /*-----------------------------------------------.
1232 | Release the memory associated to this symbol. |
1233 `-----------------------------------------------*/
1236 #if (defined __STDC__ || defined __C99__FUNC__ \
1237 || defined __cplusplus || defined _MSC_VER)
1239 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, Context
*context
, yyscan_t
*scanner
)
1242 yydestruct (yymsg
, yytype
, yyvaluep
, context
, scanner
)
1256 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1267 /* Prevent warnings from -Wmissing-prototypes. */
1268 #ifdef YYPARSE_PARAM
1269 #if defined __STDC__ || defined __cplusplus
1270 int yyparse (void *YYPARSE_PARAM
);
1274 #else /* ! YYPARSE_PARAM */
1275 #if defined __STDC__ || defined __cplusplus
1276 int yyparse (Context
*context
, yyscan_t
*scanner
);
1280 #endif /* ! YYPARSE_PARAM */
1287 #ifdef YYPARSE_PARAM
1288 #if (defined __STDC__ || defined __C99__FUNC__ \
1289 || defined __cplusplus || defined _MSC_VER)
1291 yyparse (void *YYPARSE_PARAM
)
1294 yyparse (YYPARSE_PARAM
)
1295 void *YYPARSE_PARAM
;
1297 #else /* ! YYPARSE_PARAM */
1298 #if (defined __STDC__ || defined __C99__FUNC__ \
1299 || defined __cplusplus || defined _MSC_VER)
1301 yyparse (Context
*context
, yyscan_t
*scanner
)
1304 yyparse (context
, scanner
)
1310 /* The lookahead symbol. */
1313 /* The semantic value of the lookahead symbol. */
1316 /* Number of syntax errors so far. */
1320 /* Number of tokens to shift before error messages enabled. */
1323 /* The stacks and their tools:
1324 `yyss': related to states.
1325 `yyvs': related to semantic values.
1327 Refer to the stacks thru separate pointers, to allow yyoverflow
1328 to reallocate them elsewhere. */
1330 /* The state stack. */
1331 yytype_int16 yyssa
[YYINITDEPTH
];
1333 yytype_int16
*yyssp
;
1335 /* The semantic value stack. */
1336 YYSTYPE yyvsa
[YYINITDEPTH
];
1340 YYSIZE_T yystacksize
;
1344 /* Lookahead token as an internal (translated) token number. */
1346 /* The variables used to return semantic value and location from the
1351 /* Buffer for error messages, and its allocated size. */
1353 char *yymsg
= yymsgbuf
;
1354 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1357 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1359 /* The number of symbols on the RHS of the reduced rule.
1360 Keep to zero when no symbol should be popped. */
1366 yystacksize
= YYINITDEPTH
;
1368 YYDPRINTF ((stderr
, "Starting parse\n"));
1373 yychar
= YYEMPTY
; /* Cause a token to be read. */
1375 /* Initialize stack pointers.
1376 Waste one element of value and location stack
1377 so that they stay on the same level as the state stack.
1378 The wasted elements are never initialized. */
1384 /*------------------------------------------------------------.
1385 | yynewstate -- Push a new state, which is found in yystate. |
1386 `------------------------------------------------------------*/
1388 /* In all cases, when you get here, the value and location stacks
1389 have just been pushed. So pushing a state here evens the stacks. */
1395 if (yyss
+ yystacksize
- 1 <= yyssp
)
1397 /* Get the current used size of the three stacks, in elements. */
1398 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1402 /* Give user a chance to reallocate the stack. Use copies of
1403 these so that the &'s don't force the real ones into
1405 YYSTYPE
*yyvs1
= yyvs
;
1406 yytype_int16
*yyss1
= yyss
;
1408 /* Each stack pointer address is followed by the size of the
1409 data in use in that stack, in bytes. This used to be a
1410 conditional around just the two extra args, but that might
1411 be undefined if yyoverflow is a macro. */
1412 yyoverflow (YY_("memory exhausted"),
1413 &yyss1
, yysize
* sizeof (*yyssp
),
1414 &yyvs1
, yysize
* sizeof (*yyvsp
),
1420 #else /* no yyoverflow */
1421 # ifndef YYSTACK_RELOCATE
1422 goto yyexhaustedlab
;
1424 /* Extend the stack our own way. */
1425 if (YYMAXDEPTH
<= yystacksize
)
1426 goto yyexhaustedlab
;
1428 if (YYMAXDEPTH
< yystacksize
)
1429 yystacksize
= YYMAXDEPTH
;
1432 yytype_int16
*yyss1
= yyss
;
1433 union yyalloc
*yyptr
=
1434 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1436 goto yyexhaustedlab
;
1437 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1438 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1439 # undef YYSTACK_RELOCATE
1441 YYSTACK_FREE (yyss1
);
1444 #endif /* no yyoverflow */
1446 yyssp
= yyss
+ yysize
- 1;
1447 yyvsp
= yyvs
+ yysize
- 1;
1449 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1450 (unsigned long int) yystacksize
));
1452 if (yyss
+ yystacksize
- 1 <= yyssp
)
1456 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1458 if (yystate
== YYFINAL
)
1468 /* Do appropriate processing given the current state. Read a
1469 lookahead token if we need one and don't already have one. */
1471 /* First try to decide what to do without reference to lookahead token. */
1472 yyn
= yypact
[yystate
];
1473 if (yypact_value_is_default (yyn
))
1476 /* Not known => get a lookahead token if don't already have one. */
1478 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1479 if (yychar
== YYEMPTY
)
1481 YYDPRINTF ((stderr
, "Reading a token: "));
1485 if (yychar
<= YYEOF
)
1487 yychar
= yytoken
= YYEOF
;
1488 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1492 yytoken
= YYTRANSLATE (yychar
);
1493 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1496 /* If the proper action on seeing token YYTOKEN is to reduce or to
1497 detect an error, take that action. */
1499 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1504 if (yytable_value_is_error (yyn
))
1510 /* Count tokens shifted since error; after three, turn off error
1515 /* Shift the lookahead token. */
1516 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1518 /* Discard the shifted token. */
1527 /*-----------------------------------------------------------.
1528 | yydefault -- do the default action for the current state. |
1529 `-----------------------------------------------------------*/
1531 yyn
= yydefact
[yystate
];
1537 /*-----------------------------.
1538 | yyreduce -- Do a reduction. |
1539 `-----------------------------*/
1541 /* yyn is the number of a rule to reduce with. */
1544 /* If YYLEN is nonzero, implement the default value of the action:
1547 Otherwise, the following line sets YYVAL to garbage.
1548 This behavior is undocumented and Bison
1549 users should not rely upon it. Assigning to YYVAL
1550 unconditionally makes the parser a bit smaller, and it avoids a
1551 GCC warning that YYVAL may be used uninitialized. */
1552 yyval
= yyvsp
[1-yylen
];
1555 YY_REDUCE_PRINT (yyn
);
1560 /* Line 1806 of yacc.c */
1561 #line 195 "libmemcached/csl/parser.yy"
1567 /* Line 1806 of yacc.c */
1568 #line 197 "libmemcached/csl/parser.yy"
1574 /* Line 1806 of yacc.c */
1575 #line 199 "libmemcached/csl/parser.yy"
1581 /* Line 1806 of yacc.c */
1582 #line 201 "libmemcached/csl/parser.yy"
1591 /* Line 1806 of yacc.c */
1592 #line 206 "libmemcached/csl/parser.yy"
1594 context
->rc
= MEMCACHED_PARSE_USER_ERROR
;
1595 parser_abort(context
, "ERROR called directly");
1601 /* Line 1806 of yacc.c */
1602 #line 211 "libmemcached/csl/parser.yy"
1604 memcached_reset(context
->memc
);
1610 /* Line 1806 of yacc.c */
1611 #line 215 "libmemcached/csl/parser.yy"
1619 /* Line 1806 of yacc.c */
1620 #line 219 "libmemcached/csl/parser.yy"
1622 if ((context
->rc
= memcached_parse_configure_file(*context
->memc
, (yyvsp
[(3) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].string
).size
)) != MEMCACHED_SUCCESS
)
1624 parser_abort(context
, "Failed to parse configuration file");
1631 /* Line 1806 of yacc.c */
1632 #line 230 "libmemcached/csl/parser.yy"
1634 if (memcached_failed(context
->rc
= memcached_server_add_with_weight(context
->memc
, (yyvsp
[(2) - (4)].server
).c_str
, (yyvsp
[(3) - (4)].number
), (yyvsp
[(4) - (4)].number
))))
1637 snprintf(buffer
, sizeof(buffer
), "Failed to add server: %s:%u", (yyvsp
[(2) - (4)].server
).c_str
, uint32_t((yyvsp
[(3) - (4)].number
)));
1638 parser_abort(context
, buffer
);
1640 context
->unset_server();
1646 /* Line 1806 of yacc.c */
1647 #line 240 "libmemcached/csl/parser.yy"
1649 if (memcached_failed(context
->rc
= memcached_server_add_with_weight(context
->memc
, (yyvsp
[(2) - (4)].server
).c_str
, (yyvsp
[(3) - (4)].number
), (yyvsp
[(4) - (4)].number
))))
1652 snprintf(buffer
, sizeof(buffer
), "Failed to add server: %s:%u", (yyvsp
[(2) - (4)].server
).c_str
, uint32_t((yyvsp
[(3) - (4)].number
)));
1653 parser_abort(context
, buffer
);
1655 context
->unset_server();
1661 /* Line 1806 of yacc.c */
1662 #line 250 "libmemcached/csl/parser.yy"
1664 if (memcached_failed(context
->rc
= memcached_server_add_unix_socket_with_weight(context
->memc
, (yyvsp
[(2) - (3)].string
).c_str
, (yyvsp
[(3) - (3)].number
))))
1667 snprintf(buffer
, sizeof(buffer
), "Failed to add server: %s", (yyvsp
[(2) - (3)].string
).c_str
);
1668 parser_abort(context
, buffer
);
1675 /* Line 1806 of yacc.c */
1676 #line 259 "libmemcached/csl/parser.yy"
1678 memcached_set_configuration_file(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
);
1684 /* Line 1806 of yacc.c */
1685 #line 263 "libmemcached/csl/parser.yy"
1687 context
->memc
->configure
.initial_pool_size
= (yyvsp
[(2) - (2)].number
);
1693 /* Line 1806 of yacc.c */
1694 #line 267 "libmemcached/csl/parser.yy"
1696 context
->memc
->configure
.max_pool_size
= (yyvsp
[(2) - (2)].number
);
1702 /* Line 1806 of yacc.c */
1703 #line 275 "libmemcached/csl/parser.yy"
1705 if (memcached_callback_get(context
->memc
, MEMCACHED_CALLBACK_PREFIX_KEY
, NULL
))
1707 parser_abort(context
, "--NAMESPACE can only be called once");
1710 if ((context
->rc
= memcached_set_namespace(context
->memc
, (yyvsp
[(2) - (2)].string
).c_str
, (yyvsp
[(2) - (2)].string
).size
)) != MEMCACHED_SUCCESS
)
1712 parser_abort(context
, memcached_last_error_message(context
->memc
));
1719 /* Line 1806 of yacc.c */
1720 #line 287 "libmemcached/csl/parser.yy"
1722 memcached_flag(*context
->memc
, MEMCACHED_FLAG_IS_FETCHING_VERSION
, true);
1728 /* Line 1806 of yacc.c */
1729 #line 291 "libmemcached/csl/parser.yy"
1731 // Check to see if DISTRIBUTION has already been set
1732 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1734 parser_abort(context
, "--DISTRIBUTION can only be called once");
1737 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (2)].distribution
))) != MEMCACHED_SUCCESS
)
1739 parser_abort(context
, memcached_last_error_message(context
->memc
));;
1746 /* Line 1806 of yacc.c */
1747 #line 304 "libmemcached/csl/parser.yy"
1749 // Check to see if DISTRIBUTION has already been set
1750 if ((context
->rc
= memcached_behavior_set(context
->memc
, MEMCACHED_BEHAVIOR_DISTRIBUTION
, (yyvsp
[(2) - (4)].distribution
))) != MEMCACHED_SUCCESS
)
1752 parser_abort(context
, "--DISTRIBUTION can only be called once");
1755 if ((context
->rc
= memcached_behavior_set_distribution_hash(context
->memc
, (yyvsp
[(4) - (4)].hash
))) != MEMCACHED_SUCCESS
)
1757 parser_abort(context
, "Unable to set the hash for the DISTRIBUTION requested");
1764 /* Line 1806 of yacc.c */
1765 #line 317 "libmemcached/csl/parser.yy"
1767 if (context
->set_hash((yyvsp
[(2) - (2)].hash
)) == false)
1769 parser_abort(context
, "--HASH can only be set once");
1776 /* Line 1806 of yacc.c */
1777 #line 324 "libmemcached/csl/parser.yy"
1779 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (2)].behavior
), (yyvsp
[(2) - (2)].number
))) != MEMCACHED_SUCCESS
)
1781 parser_abort(context
, "Unable to set behavior");
1788 /* Line 1806 of yacc.c */
1789 #line 331 "libmemcached/csl/parser.yy"
1791 if ((context
->rc
= memcached_behavior_set(context
->memc
, (yyvsp
[(1) - (1)].behavior
), true)) != MEMCACHED_SUCCESS
)
1794 snprintf(buffer
, sizeof(buffer
), "Could not set: %s", libmemcached_string_behavior((yyvsp
[(1) - (1)].behavior
)));
1795 parser_abort(context
, buffer
);
1802 /* Line 1806 of yacc.c */
1803 #line 340 "libmemcached/csl/parser.yy"
1810 /* Line 1806 of yacc.c */
1811 #line 346 "libmemcached/csl/parser.yy"
1813 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS
;
1819 /* Line 1806 of yacc.c */
1820 #line 350 "libmemcached/csl/parser.yy"
1822 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT
;
1828 /* Line 1806 of yacc.c */
1829 #line 354 "libmemcached/csl/parser.yy"
1831 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK
;
1837 /* Line 1806 of yacc.c */
1838 #line 358 "libmemcached/csl/parser.yy"
1840 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK
;
1846 /* Line 1806 of yacc.c */
1847 #line 362 "libmemcached/csl/parser.yy"
1849 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH
;
1855 /* Line 1806 of yacc.c */
1856 #line 366 "libmemcached/csl/parser.yy"
1858 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS
;
1864 /* Line 1806 of yacc.c */
1865 #line 370 "libmemcached/csl/parser.yy"
1867 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT
;
1873 /* Line 1806 of yacc.c */
1874 #line 374 "libmemcached/csl/parser.yy"
1876 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT
;
1882 /* Line 1806 of yacc.c */
1883 #line 378 "libmemcached/csl/parser.yy"
1885 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT
;
1891 /* Line 1806 of yacc.c */
1892 #line 382 "libmemcached/csl/parser.yy"
1894 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SND_TIMEOUT
;
1900 /* Line 1806 of yacc.c */
1901 #line 386 "libmemcached/csl/parser.yy"
1903 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE
;
1909 /* Line 1806 of yacc.c */
1910 #line 390 "libmemcached/csl/parser.yy"
1912 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
;
1918 /* Line 1806 of yacc.c */
1919 #line 397 "libmemcached/csl/parser.yy"
1921 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL
;
1927 /* Line 1806 of yacc.c */
1928 #line 401 "libmemcached/csl/parser.yy"
1930 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS
;
1936 /* Line 1806 of yacc.c */
1937 #line 405 "libmemcached/csl/parser.yy"
1939 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY
;
1945 /* Line 1806 of yacc.c */
1946 #line 409 "libmemcached/csl/parser.yy"
1948 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_NOREPLY
;
1954 /* Line 1806 of yacc.c */
1955 #line 413 "libmemcached/csl/parser.yy"
1957 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ
;
1963 /* Line 1806 of yacc.c */
1964 #line 417 "libmemcached/csl/parser.yy"
1966 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SORT_HOSTS
;
1972 /* Line 1806 of yacc.c */
1973 #line 421 "libmemcached/csl/parser.yy"
1975 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_SUPPORT_CAS
;
1981 /* Line 1806 of yacc.c */
1982 #line 425 "libmemcached/csl/parser.yy"
1984 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_NODELAY
;
1990 /* Line 1806 of yacc.c */
1991 #line 429 "libmemcached/csl/parser.yy"
1993 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE
;
1999 /* Line 1806 of yacc.c */
2000 #line 433 "libmemcached/csl/parser.yy"
2002 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE
;
2008 /* Line 1806 of yacc.c */
2009 #line 437 "libmemcached/csl/parser.yy"
2011 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_USE_UDP
;
2017 /* Line 1806 of yacc.c */
2018 #line 441 "libmemcached/csl/parser.yy"
2020 (yyval
.behavior
)= MEMCACHED_BEHAVIOR_VERIFY_KEY
;
2026 /* Line 1806 of yacc.c */
2027 #line 447 "libmemcached/csl/parser.yy"
2028 { (yyval
.number
)= MEMCACHED_DEFAULT_PORT
;}
2033 /* Line 1806 of yacc.c */
2034 #line 449 "libmemcached/csl/parser.yy"
2040 /* Line 1806 of yacc.c */
2041 #line 453 "libmemcached/csl/parser.yy"
2042 { (yyval
.number
)= 1; }
2047 /* Line 1806 of yacc.c */
2048 #line 455 "libmemcached/csl/parser.yy"
2054 /* Line 1806 of yacc.c */
2055 #line 460 "libmemcached/csl/parser.yy"
2057 (yyval
.hash
)= MEMCACHED_HASH_MD5
;
2063 /* Line 1806 of yacc.c */
2064 #line 464 "libmemcached/csl/parser.yy"
2066 (yyval
.hash
)= MEMCACHED_HASH_CRC
;
2072 /* Line 1806 of yacc.c */
2073 #line 468 "libmemcached/csl/parser.yy"
2075 (yyval
.hash
)= MEMCACHED_HASH_FNV1_64
;
2081 /* Line 1806 of yacc.c */
2082 #line 472 "libmemcached/csl/parser.yy"
2084 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_64
;
2090 /* Line 1806 of yacc.c */
2091 #line 476 "libmemcached/csl/parser.yy"
2093 (yyval
.hash
)= MEMCACHED_HASH_FNV1_32
;
2099 /* Line 1806 of yacc.c */
2100 #line 480 "libmemcached/csl/parser.yy"
2102 (yyval
.hash
)= MEMCACHED_HASH_FNV1A_32
;
2108 /* Line 1806 of yacc.c */
2109 #line 484 "libmemcached/csl/parser.yy"
2111 (yyval
.hash
)= MEMCACHED_HASH_HSIEH
;
2117 /* Line 1806 of yacc.c */
2118 #line 488 "libmemcached/csl/parser.yy"
2120 (yyval
.hash
)= MEMCACHED_HASH_MURMUR
;
2126 /* Line 1806 of yacc.c */
2127 #line 492 "libmemcached/csl/parser.yy"
2129 (yyval
.hash
)= MEMCACHED_HASH_JENKINS
;
2135 /* Line 1806 of yacc.c */
2136 #line 499 "libmemcached/csl/parser.yy"
2138 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2144 /* Line 1806 of yacc.c */
2145 #line 503 "libmemcached/csl/parser.yy"
2147 (yyval
.string
)= (yyvsp
[(1) - (1)].string
);
2153 /* Line 1806 of yacc.c */
2154 #line 510 "libmemcached/csl/parser.yy"
2156 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_CONSISTENT
;
2162 /* Line 1806 of yacc.c */
2163 #line 514 "libmemcached/csl/parser.yy"
2165 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_MODULA
;
2171 /* Line 1806 of yacc.c */
2172 #line 518 "libmemcached/csl/parser.yy"
2174 (yyval
.distribution
)= MEMCACHED_DISTRIBUTION_RANDOM
;
2180 /* Line 1806 of yacc.c */
2181 #line 2182 "libmemcached/csl/parser.cc"
2184 /* User semantic actions sometimes alter yychar, and that requires
2185 that yytoken be updated with the new translation. We take the
2186 approach of translating immediately before every use of yytoken.
2187 One alternative is translating here after every semantic action,
2188 but that translation would be missed if the semantic action invokes
2189 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2190 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2191 incorrect destructor might then be invoked immediately. In the
2192 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2193 to an incorrect destructor call or verbose syntax error message
2194 before the lookahead is translated. */
2195 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2199 YY_STACK_PRINT (yyss
, yyssp
);
2203 /* Now `shift' the result of the reduction. Determine what state
2204 that goes to, based on the state we popped back to and the rule
2205 number reduced by. */
2209 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2210 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2211 yystate
= yytable
[yystate
];
2213 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2218 /*------------------------------------.
2219 | yyerrlab -- here on detecting error |
2220 `------------------------------------*/
2222 /* Make sure we have latest lookahead translation. See comments at
2223 user semantic actions for why this is necessary. */
2224 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
2226 /* If not already recovering from an error, report this error. */
2230 #if ! YYERROR_VERBOSE
2231 yyerror (context
, scanner
, YY_("syntax error"));
2233 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2236 char const *yymsgp
= YY_("syntax error");
2237 int yysyntax_error_status
;
2238 yysyntax_error_status
= YYSYNTAX_ERROR
;
2239 if (yysyntax_error_status
== 0)
2241 else if (yysyntax_error_status
== 1)
2243 if (yymsg
!= yymsgbuf
)
2244 YYSTACK_FREE (yymsg
);
2245 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2249 yymsg_alloc
= sizeof yymsgbuf
;
2250 yysyntax_error_status
= 2;
2254 yysyntax_error_status
= YYSYNTAX_ERROR
;
2258 yyerror (context
, scanner
, yymsgp
);
2259 if (yysyntax_error_status
== 2)
2260 goto yyexhaustedlab
;
2262 # undef YYSYNTAX_ERROR
2268 if (yyerrstatus
== 3)
2270 /* If just tried and failed to reuse lookahead token after an
2271 error, discard it. */
2273 if (yychar
<= YYEOF
)
2275 /* Return failure if at end of input. */
2276 if (yychar
== YYEOF
)
2281 yydestruct ("Error: discarding",
2282 yytoken
, &yylval
, context
, scanner
);
2287 /* Else will try to reuse lookahead token after shifting the error
2292 /*---------------------------------------------------.
2293 | yyerrorlab -- error raised explicitly by YYERROR. |
2294 `---------------------------------------------------*/
2297 /* Pacify compilers like GCC when the user code never invokes
2298 YYERROR and the label yyerrorlab therefore never appears in user
2300 if (/*CONSTCOND*/ 0)
2303 /* Do not reclaim the symbols of the rule which action triggered
2307 YY_STACK_PRINT (yyss
, yyssp
);
2312 /*-------------------------------------------------------------.
2313 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2314 `-------------------------------------------------------------*/
2316 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2320 yyn
= yypact
[yystate
];
2321 if (!yypact_value_is_default (yyn
))
2324 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2332 /* Pop the current state because it cannot handle the error token. */
2337 yydestruct ("Error: popping",
2338 yystos
[yystate
], yyvsp
, context
, scanner
);
2341 YY_STACK_PRINT (yyss
, yyssp
);
2347 /* Shift the error token. */
2348 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2354 /*-------------------------------------.
2355 | yyacceptlab -- YYACCEPT comes here. |
2356 `-------------------------------------*/
2361 /*-----------------------------------.
2362 | yyabortlab -- YYABORT comes here. |
2363 `-----------------------------------*/
2368 #if !defined(yyoverflow) || YYERROR_VERBOSE
2369 /*-------------------------------------------------.
2370 | yyexhaustedlab -- memory exhaustion comes here. |
2371 `-------------------------------------------------*/
2373 yyerror (context
, scanner
, YY_("memory exhausted"));
2379 if (yychar
!= YYEMPTY
)
2381 /* Make sure we have latest lookahead translation. See comments at
2382 user semantic actions for why this is necessary. */
2383 yytoken
= YYTRANSLATE (yychar
);
2384 yydestruct ("Cleanup: discarding lookahead",
2385 yytoken
, &yylval
, context
, scanner
);
2387 /* Do not reclaim the symbols of the rule which action triggered
2388 this YYABORT or YYACCEPT. */
2390 YY_STACK_PRINT (yyss
, yyssp
);
2391 while (yyssp
!= yyss
)
2393 yydestruct ("Cleanup: popping",
2394 yystos
[*yyssp
], yyvsp
, context
, scanner
);
2399 YYSTACK_FREE (yyss
);
2402 if (yymsg
!= yymsgbuf
)
2403 YYSTACK_FREE (yymsg
);
2405 /* Make sure YYID is used. */
2406 return YYID (yyresult
);
2411 /* Line 2067 of yacc.c */
2412 #line 523 "libmemcached/csl/parser.yy"
2415 void Context::start()
2417 config_parse(this, (void **)scanner
);