2 /* A Bison parser, made by GNU Bison 2.4.1. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4.1"
52 #define YYSKELETON_NAME "yacc.c"
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
66 /* Substitute the variable and function names. */
67 #define yyparse libconfig_yyparse
68 #define yylex libconfig_yylex
69 #define yyerror libconfig_yyerror
70 #define yylval libconfig_yylval
71 #define yychar libconfig_yychar
72 #define yydebug libconfig_yydebug
73 #define yynerrs libconfig_yynerrs
76 /* Copy the first part of user declarations. */
78 /* Line 189 of yacc.c */
83 #include "libconfig.h"
85 #include "wincompat.h"
87 /* prevent warnings about redefined malloc/free in generated code: */
97 /* these delcarations are provided to suppress compiler warnings */
98 extern int libconfig_yylex();
99 extern int libconfig_yyget_lineno();
101 static const char *err_array_elem_type = "mismatched element type in array";
102 static const char *err_duplicate_setting = "duplicate setting name";
104 #define _delete(P) free((void *)(P))
107 (ctx->parent && (ctx->parent->type == CONFIG_TYPE_ARRAY))
110 (ctx->parent && (ctx->parent->type == CONFIG_TYPE_LIST))
112 static void capture_parse_pos(void *scanner, struct scan_context *scan_ctx,
113 config_setting_t *setting)
115 setting->line = (unsigned int)libconfig_yyget_lineno(scanner);
116 setting->file = scanctx_current_filename(scan_ctx);
119 #define CAPTURE_PARSE_POS(S) \
120 capture_parse_pos(scanner, scan_ctx, (S))
122 void libconfig_yyerror(void *scanner, struct parse_context *ctx,
123 struct scan_context *scan_ctx, char const *s)
125 if(ctx->config->error_text) return;
126 ctx->config->error_line = libconfig_yyget_lineno(scanner);
127 ctx->config->error_text = s;
132 /* Line 189 of yacc.c */
133 #line 134 "grammar.c"
135 /* Enabling traces. */
140 /* Enabling verbose error messages. */
141 #ifdef YYERROR_VERBOSE
142 # undef YYERROR_VERBOSE
143 # define YYERROR_VERBOSE 1
145 # define YYERROR_VERBOSE 0
148 /* Enabling the token table. */
149 #ifndef YYTOKEN_TABLE
150 # define YYTOKEN_TABLE 0
157 /* Put the tokens into the symbol table, so that GDB and other debuggers
170 TOK_ARRAY_START = 268,
172 TOK_LIST_START = 270,
175 TOK_GROUP_START = 273,
183 #define TOK_BOOLEAN 258
184 #define TOK_INTEGER 259
186 #define TOK_INTEGER64 261
187 #define TOK_HEX64 262
188 #define TOK_FLOAT 263
189 #define TOK_STRING 264
191 #define TOK_EQUALS 266
192 #define TOK_NEWLINE 267
193 #define TOK_ARRAY_START 268
194 #define TOK_ARRAY_END 269
195 #define TOK_LIST_START 270
196 #define TOK_LIST_END 271
197 #define TOK_COMMA 272
198 #define TOK_GROUP_START 273
199 #define TOK_GROUP_END 274
200 #define TOK_SEMICOLON 275
201 #define TOK_GARBAGE 276
202 #define TOK_ERROR 277
207 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
208 typedef union YYSTYPE
211 /* Line 214 of yacc.c */
221 /* Line 214 of yacc.c */
222 #line 223 "grammar.c"
224 # define YYSTYPE_IS_TRIVIAL 1
225 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
226 # define YYSTYPE_IS_DECLARED 1
230 /* Copy the second part of user declarations. */
233 /* Line 264 of yacc.c */
234 #line 235 "grammar.c"
241 typedef YYTYPE_UINT8 yytype_uint8;
243 typedef unsigned char yytype_uint8;
247 typedef YYTYPE_INT8 yytype_int8;
248 #elif (defined __STDC__ || defined __C99__FUNC__ \
249 || defined __cplusplus || defined _MSC_VER)
250 typedef signed char yytype_int8;
252 typedef short int yytype_int8;
256 typedef YYTYPE_UINT16 yytype_uint16;
258 typedef unsigned short int yytype_uint16;
262 typedef YYTYPE_INT16 yytype_int16;
264 typedef short int yytype_int16;
268 # ifdef __SIZE_TYPE__
269 # define YYSIZE_T __SIZE_TYPE__
270 # elif defined size_t
271 # define YYSIZE_T size_t
272 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
273 || defined __cplusplus || defined _MSC_VER)
274 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
275 # define YYSIZE_T size_t
277 # define YYSIZE_T unsigned int
281 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
286 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
287 # define YY_(msgid) dgettext ("bison-runtime", msgid)
291 # define YY_(msgid) msgid
295 /* Suppress unused-variable warnings by "using" E. */
296 #if ! defined lint || defined __GNUC__
297 # define YYUSE(e) ((void) (e))
299 # define YYUSE(e) /* empty */
302 /* Identity function, used to suppress warnings about constant conditions. */
306 #if (defined __STDC__ || defined __C99__FUNC__ \
307 || defined __cplusplus || defined _MSC_VER)
320 #if ! defined yyoverflow || YYERROR_VERBOSE
322 /* The parser invokes alloca or malloc; define the necessary symbols. */
324 # ifdef YYSTACK_USE_ALLOCA
325 # if YYSTACK_USE_ALLOCA
327 # define YYSTACK_ALLOC __builtin_alloca
328 # elif defined __BUILTIN_VA_ARG_INCR
329 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
331 # define YYSTACK_ALLOC __alloca
332 # elif defined _MSC_VER
333 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
334 # define alloca _alloca
336 # define YYSTACK_ALLOC alloca
337 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
338 || defined __cplusplus || defined _MSC_VER)
339 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
348 # ifdef YYSTACK_ALLOC
349 /* Pacify GCC's `empty if-body' warning. */
350 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
351 # ifndef YYSTACK_ALLOC_MAXIMUM
352 /* The OS might guarantee only one guard page at the bottom of the stack,
353 and a page size can be as small as 4096 bytes. So we cannot safely
354 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
355 to allow for a few compiler-allocated temporary stack slots. */
356 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
359 # define YYSTACK_ALLOC YYMALLOC
360 # define YYSTACK_FREE YYFREE
361 # ifndef YYSTACK_ALLOC_MAXIMUM
362 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
364 # if (defined __cplusplus && ! defined _STDLIB_H \
365 && ! ((defined YYMALLOC || defined malloc) \
366 && (defined YYFREE || defined free)))
367 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
373 # define YYMALLOC malloc
374 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
375 || defined __cplusplus || defined _MSC_VER)
376 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
381 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
382 || defined __cplusplus || defined _MSC_VER)
383 void free (void *); /* INFRINGES ON USER NAME SPACE */
387 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
390 #if (! defined yyoverflow \
391 && (! defined __cplusplus \
392 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
394 /* A type that is properly aligned for any stack member. */
397 yytype_int16 yyss_alloc;
401 /* The size of the maximum gap between one aligned stack and the next. */
402 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
404 /* The size of an array large to enough to hold all stacks, each with
406 # define YYSTACK_BYTES(N) \
407 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
408 + YYSTACK_GAP_MAXIMUM)
410 /* Copy COUNT objects from FROM to TO. The source and destination do
413 # if defined __GNUC__ && 1 < __GNUC__
414 # define YYCOPY(To, From, Count) \
415 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
417 # define YYCOPY(To, From, Count) \
421 for (yyi = 0; yyi < (Count); yyi++) \
422 (To)[yyi] = (From)[yyi]; \
428 /* Relocate STACK from its old location to the new one. The
429 local variables YYSIZE and YYSTACKSIZE give the old and new number of
430 elements in the stack, and YYPTR gives the new location of the
431 stack. Advance YYPTR to a properly aligned location for the next
433 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
436 YYSIZE_T yynewbytes; \
437 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
438 Stack = &yyptr->Stack_alloc; \
439 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
440 yyptr += yynewbytes / sizeof (*yyptr); \
446 /* YYFINAL -- State number of the termination state. */
448 /* YYLAST -- Last index in YYTABLE. */
451 /* YYNTOKENS -- Number of terminals. */
453 /* YYNNTS -- Number of nonterminals. */
455 /* YYNRULES -- Number of rules. */
457 /* YYNRULES -- Number of states. */
460 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
462 #define YYMAXUTOK 277
464 #define YYTRANSLATE(YYX) \
465 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
467 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
468 static const yytype_uint8 yytranslate[] =
470 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
496 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
497 15, 16, 17, 18, 19, 20, 21, 22
501 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
503 static const yytype_uint8 yyprhs[] =
505 0, 0, 3, 4, 6, 8, 11, 12, 14, 15,
506 17, 19, 20, 26, 27, 32, 33, 38, 40, 42,
507 44, 46, 48, 51, 53, 55, 57, 59, 61, 63,
508 65, 67, 71, 72, 74, 76, 80, 81, 83, 84
511 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
512 static const yytype_int8 yyrhs[] =
514 24, 0, -1, -1, 25, -1, 28, -1, 25, 28,
515 -1, -1, 25, -1, -1, 20, -1, 17, -1, -1,
516 10, 29, 11, 34, 27, -1, -1, 13, 31, 40,
517 14, -1, -1, 15, 33, 38, 16, -1, 36, -1,
518 30, -1, 32, -1, 41, -1, 9, -1, 35, 9,
519 -1, 3, -1, 4, -1, 6, -1, 5, -1, 7,
520 -1, 8, -1, 35, -1, 34, -1, 37, 17, 34,
521 -1, -1, 37, -1, 36, -1, 39, 17, 36, -1,
522 -1, 39, -1, -1, 18, 42, 26, 19, -1
525 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
526 static const yytype_uint16 yyrline[] =
528 0, 100, 100, 102, 106, 107, 110, 112, 115, 117,
529 118, 123, 122, 142, 141, 165, 164, 187, 188, 189,
530 190, 194, 195, 199, 219, 241, 263, 285, 307, 325,
531 353, 354, 357, 359, 363, 364, 367, 369, 374, 373
535 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
536 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
537 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
538 static const char *const yytname[] =
540 "$end", "error", "$undefined", "TOK_BOOLEAN", "TOK_INTEGER", "TOK_HEX",
541 "TOK_INTEGER64", "TOK_HEX64", "TOK_FLOAT", "TOK_STRING", "TOK_NAME",
542 "TOK_EQUALS", "TOK_NEWLINE", "TOK_ARRAY_START", "TOK_ARRAY_END",
543 "TOK_LIST_START", "TOK_LIST_END", "TOK_COMMA", "TOK_GROUP_START",
544 "TOK_GROUP_END", "TOK_SEMICOLON", "TOK_GARBAGE", "TOK_ERROR", "$accept",
545 "configuration", "setting_list", "setting_list_optional",
546 "setting_terminator", "setting", "$@1", "array", "$@2", "list", "$@3",
547 "value", "string", "simple_value", "value_list", "value_list_optional",
548 "simple_value_list", "simple_value_list_optional", "group", "$@4", 0
553 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
555 static const yytype_uint16 yytoknum[] =
557 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
558 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
563 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
564 static const yytype_uint8 yyr1[] =
566 0, 23, 24, 24, 25, 25, 26, 26, 27, 27,
567 27, 29, 28, 31, 30, 33, 32, 34, 34, 34,
568 34, 35, 35, 36, 36, 36, 36, 36, 36, 36,
569 37, 37, 38, 38, 39, 39, 40, 40, 42, 41
572 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
573 static const yytype_uint8 yyr2[] =
575 0, 2, 0, 1, 1, 2, 0, 1, 0, 1,
576 1, 0, 5, 0, 4, 0, 4, 1, 1, 1,
577 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
578 1, 3, 0, 1, 1, 3, 0, 1, 0, 4
581 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
582 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
583 means the default is an error. */
584 static const yytype_uint8 yydefact[] =
586 2, 11, 0, 3, 4, 0, 1, 5, 0, 23,
587 24, 26, 25, 27, 28, 21, 13, 15, 38, 18,
588 19, 8, 29, 17, 20, 36, 32, 6, 10, 9,
589 12, 22, 34, 37, 0, 30, 33, 0, 7, 0,
590 0, 14, 0, 16, 39, 35, 31
593 /* YYDEFGOTO[NTERM-NUM]. */
594 static const yytype_int8 yydefgoto[] =
596 -1, 2, 3, 39, 30, 4, 5, 19, 25, 20,
597 26, 21, 22, 23, 36, 37, 33, 34, 24, 27
600 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
602 #define YYPACT_NINF -26
603 static const yytype_int8 yypact[] =
605 -8, -26, 12, -8, -26, 5, -26, -26, 0, -26,
606 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
607 -26, -6, 10, -26, -26, 23, 0, -8, -26, -26,
608 -26, -26, -26, 3, 7, -26, 6, 8, -8, 14,
609 23, -26, 0, -26, -26, -26, -26
612 /* YYPGOTO[NTERM-NUM]. */
613 static const yytype_int8 yypgoto[] =
615 -26, -26, -5, -26, -26, -3, -26, -26, -26, -26,
616 -26, -25, -26, -15, -26, -26, -26, -26, -26, -26
619 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
620 positive, shift that token. If negative, reduce the rule which
621 number is the opposite. If zero, do what YYDEFACT says.
622 If YYTABLE_NINF, syntax error. */
623 #define YYTABLE_NINF -1
624 static const yytype_uint8 yytable[] =
626 7, 35, 1, 9, 10, 11, 12, 13, 14, 15,
627 32, 28, 6, 16, 29, 17, 8, 46, 18, 31,
628 40, 41, 38, 42, 43, 45, 9, 10, 11, 12,
632 static const yytype_int8 yycheck[] =
634 3, 26, 10, 3, 4, 5, 6, 7, 8, 9,
635 25, 17, 0, 13, 20, 15, 11, 42, 18, 9,
636 17, 14, 27, 17, 16, 40, 3, 4, 5, 6,
640 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
641 symbol of state STATE-NUM. */
642 static const yytype_uint8 yystos[] =
644 0, 10, 24, 25, 28, 29, 0, 28, 11, 3,
645 4, 5, 6, 7, 8, 9, 13, 15, 18, 30,
646 32, 34, 35, 36, 41, 31, 33, 42, 17, 20,
647 27, 9, 36, 39, 40, 34, 37, 38, 25, 26,
648 17, 14, 17, 16, 19, 36, 34
651 #define yyerrok (yyerrstatus = 0)
652 #define yyclearin (yychar = YYEMPTY)
656 #define YYACCEPT goto yyacceptlab
657 #define YYABORT goto yyabortlab
658 #define YYERROR goto yyerrorlab
661 /* Like YYERROR except do call yyerror. This remains here temporarily
662 to ease the transition to the new meaning of YYERROR, for GCC.
663 Once GCC version 2 has supplanted version 1, this can go. */
665 #define YYFAIL goto yyerrlab
667 #define YYRECOVERING() (!!yyerrstatus)
669 #define YYBACKUP(Token, Value) \
671 if (yychar == YYEMPTY && yylen == 1) \
675 yytoken = YYTRANSLATE (yychar); \
681 yyerror (scanner, ctx, scan_ctx, YY_("syntax error: cannot back up")); \
688 #define YYERRCODE 256
691 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
692 If N is 0, then set CURRENT to the empty location which ends
693 the previous symbol: RHS[0] (always defined). */
695 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
696 #ifndef YYLLOC_DEFAULT
697 # define YYLLOC_DEFAULT(Current, Rhs, N) \
701 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
702 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
703 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
704 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
708 (Current).first_line = (Current).last_line = \
709 YYRHSLOC (Rhs, 0).last_line; \
710 (Current).first_column = (Current).last_column = \
711 YYRHSLOC (Rhs, 0).last_column; \
717 /* YY_LOCATION_PRINT -- Print the location on the stream.
718 This macro was not mandated originally: define only if we know
719 we won't break user code: when these are the locations we know. */
721 #ifndef YY_LOCATION_PRINT
722 # if YYLTYPE_IS_TRIVIAL
723 # define YY_LOCATION_PRINT(File, Loc) \
724 fprintf (File, "%d.%d-%d.%d", \
725 (Loc).first_line, (Loc).first_column, \
726 (Loc).last_line, (Loc).last_column)
728 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
733 /* YYLEX -- calling `yylex' with the right arguments. */
736 # define YYLEX yylex (&yylval, YYLEX_PARAM)
738 # define YYLEX yylex (&yylval, scanner)
741 /* Enable debugging if requested. */
745 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
746 # define YYFPRINTF fprintf
749 # define YYDPRINTF(Args) \
755 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
759 YYFPRINTF (stderr, "%s ", Title); \
760 yy_symbol_print (stderr, \
761 Type, Value, scanner, ctx, scan_ctx); \
762 YYFPRINTF (stderr, "\n"); \
767 /*--------------------------------.
768 | Print this symbol on YYOUTPUT. |
769 `--------------------------------*/
772 #if (defined __STDC__ || defined __C99__FUNC__ \
773 || defined __cplusplus || defined _MSC_VER)
775 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, struct parse_context *ctx, struct scan_context *scan_ctx)
778 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, ctx, scan_ctx)
781 YYSTYPE const * const yyvaluep;
783 struct parse_context *ctx;
784 struct scan_context *scan_ctx;
793 if (yytype < YYNTOKENS)
794 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
806 /*--------------------------------.
807 | Print this symbol on YYOUTPUT. |
808 `--------------------------------*/
810 #if (defined __STDC__ || defined __C99__FUNC__ \
811 || defined __cplusplus || defined _MSC_VER)
813 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, struct parse_context *ctx, struct scan_context *scan_ctx)
816 yy_symbol_print (yyoutput, yytype, yyvaluep, scanner, ctx, scan_ctx)
819 YYSTYPE const * const yyvaluep;
821 struct parse_context *ctx;
822 struct scan_context *scan_ctx;
825 if (yytype < YYNTOKENS)
826 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
828 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
830 yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, ctx, scan_ctx);
831 YYFPRINTF (yyoutput, ")");
834 /*------------------------------------------------------------------.
835 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
837 `------------------------------------------------------------------*/
839 #if (defined __STDC__ || defined __C99__FUNC__ \
840 || defined __cplusplus || defined _MSC_VER)
842 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
845 yy_stack_print (yybottom, yytop)
846 yytype_int16 *yybottom;
850 YYFPRINTF (stderr, "Stack now");
851 for (; yybottom <= yytop; yybottom++)
853 int yybot = *yybottom;
854 YYFPRINTF (stderr, " %d", yybot);
856 YYFPRINTF (stderr, "\n");
859 # define YY_STACK_PRINT(Bottom, Top) \
862 yy_stack_print ((Bottom), (Top)); \
866 /*------------------------------------------------.
867 | Report that the YYRULE is going to be reduced. |
868 `------------------------------------------------*/
870 #if (defined __STDC__ || defined __C99__FUNC__ \
871 || defined __cplusplus || defined _MSC_VER)
873 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, void *scanner, struct parse_context *ctx, struct scan_context *scan_ctx)
876 yy_reduce_print (yyvsp, yyrule, scanner, ctx, scan_ctx)
880 struct parse_context *ctx;
881 struct scan_context *scan_ctx;
884 int yynrhs = yyr2[yyrule];
886 unsigned long int yylno = yyrline[yyrule];
887 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
889 /* The symbols being reduced. */
890 for (yyi = 0; yyi < yynrhs; yyi++)
892 YYFPRINTF (stderr, " $%d = ", yyi + 1);
893 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
894 &(yyvsp[(yyi + 1) - (yynrhs)])
895 , scanner, ctx, scan_ctx);
896 YYFPRINTF (stderr, "\n");
900 # define YY_REDUCE_PRINT(Rule) \
903 yy_reduce_print (yyvsp, Rule, scanner, ctx, scan_ctx); \
906 /* Nonzero means print parse trace. It is left uninitialized so that
907 multiple parsers can coexist. */
910 # define YYDPRINTF(Args)
911 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
912 # define YY_STACK_PRINT(Bottom, Top)
913 # define YY_REDUCE_PRINT(Rule)
914 #endif /* !YYDEBUG */
917 /* YYINITDEPTH -- initial size of the parser's stacks. */
919 # define YYINITDEPTH 200
922 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
923 if the built-in stack extension method is used).
925 Do not make this value too large; the results are undefined if
926 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
927 evaluated with infinite-precision integer arithmetic. */
930 # define YYMAXDEPTH 10000
938 # if defined __GLIBC__ && defined _STRING_H
939 # define yystrlen strlen
941 /* Return the length of YYSTR. */
942 #if (defined __STDC__ || defined __C99__FUNC__ \
943 || defined __cplusplus || defined _MSC_VER)
945 yystrlen (const char *yystr)
953 for (yylen = 0; yystr[yylen]; yylen++)
961 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
962 # define yystpcpy stpcpy
964 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
966 #if (defined __STDC__ || defined __C99__FUNC__ \
967 || defined __cplusplus || defined _MSC_VER)
969 yystpcpy (char *yydest, const char *yysrc)
972 yystpcpy (yydest, yysrc)
978 const char *yys = yysrc;
980 while ((*yyd++ = *yys++) != '\0')
989 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
990 quotes and backslashes, so that it's suitable for yyerror. The
991 heuristic is that double-quoting is unnecessary unless the string
992 contains an apostrophe, a comma, or backslash (other than
993 backslash-backslash). YYSTR is taken from yytname. If YYRES is
994 null, do not copy; instead, return the length of what the result
997 yytnamerr (char *yyres, const char *yystr)
1002 char const *yyp = yystr;
1009 goto do_not_strip_quotes;
1013 goto do_not_strip_quotes;
1026 do_not_strip_quotes: ;
1030 return yystrlen (yystr);
1032 return yystpcpy (yyres, yystr) - yyres;
1036 /* Copy into YYRESULT an error message about the unexpected token
1037 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1038 including the terminating null byte. If YYRESULT is null, do not
1039 copy anything; just return the number of bytes that would be
1040 copied. As a special case, return 0 if an ordinary "syntax error"
1041 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1042 size calculation. */
1044 yysyntax_error (char *yyresult, int yystate, int yychar)
1046 int yyn = yypact[yystate];
1048 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1052 int yytype = YYTRANSLATE (yychar);
1053 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1054 YYSIZE_T yysize = yysize0;
1056 int yysize_overflow = 0;
1057 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1058 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1062 /* This is so xgettext sees the translatable formats that are
1063 constructed on the fly. */
1064 YY_("syntax error, unexpected %s");
1065 YY_("syntax error, unexpected %s, expecting %s");
1066 YY_("syntax error, unexpected %s, expecting %s or %s");
1067 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1068 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1072 static char const yyunexpected[] = "syntax error, unexpected %s";
1073 static char const yyexpecting[] = ", expecting %s";
1074 static char const yyor[] = " or %s";
1075 char yyformat[sizeof yyunexpected
1076 + sizeof yyexpecting - 1
1077 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1078 * (sizeof yyor - 1))];
1079 char const *yyprefix = yyexpecting;
1081 /* Start YYX at -YYN if negative to avoid negative indexes in
1083 int yyxbegin = yyn < 0 ? -yyn : 0;
1085 /* Stay within bounds of both yycheck and yytname. */
1086 int yychecklim = YYLAST - yyn + 1;
1087 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1090 yyarg[0] = yytname[yytype];
1091 yyfmt = yystpcpy (yyformat, yyunexpected);
1093 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1094 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1096 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1100 yyformat[sizeof yyunexpected - 1] = '\0';
1103 yyarg[yycount++] = yytname[yyx];
1104 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1105 yysize_overflow |= (yysize1 < yysize);
1107 yyfmt = yystpcpy (yyfmt, yyprefix);
1111 yyf = YY_(yyformat);
1112 yysize1 = yysize + yystrlen (yyf);
1113 yysize_overflow |= (yysize1 < yysize);
1116 if (yysize_overflow)
1117 return YYSIZE_MAXIMUM;
1121 /* Avoid sprintf, as that infringes on the user's name space.
1122 Don't have undefined behavior even if the translation
1123 produced a string with the wrong number of "%s"s. */
1124 char *yyp = yyresult;
1126 while ((*yyp = *yyf) != '\0')
1128 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1130 yyp += yytnamerr (yyp, yyarg[yyi++]);
1143 #endif /* YYERROR_VERBOSE */
1146 /*-----------------------------------------------.
1147 | Release the memory associated to this symbol. |
1148 `-----------------------------------------------*/
1151 #if (defined __STDC__ || defined __C99__FUNC__ \
1152 || defined __cplusplus || defined _MSC_VER)
1154 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *scanner, struct parse_context *ctx, struct scan_context *scan_ctx)
1157 yydestruct (yymsg, yytype, yyvaluep, scanner, ctx, scan_ctx)
1162 struct parse_context *ctx;
1163 struct scan_context *scan_ctx;
1173 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1183 /* Prevent warnings from -Wmissing-prototypes. */
1184 #ifdef YYPARSE_PARAM
1185 #if defined __STDC__ || defined __cplusplus
1186 int yyparse (void *YYPARSE_PARAM);
1190 #else /* ! YYPARSE_PARAM */
1191 #if defined __STDC__ || defined __cplusplus
1192 int yyparse (void *scanner, struct parse_context *ctx, struct scan_context *scan_ctx);
1196 #endif /* ! YYPARSE_PARAM */
1202 /*-------------------------.
1203 | yyparse or yypush_parse. |
1204 `-------------------------*/
1206 #ifdef YYPARSE_PARAM
1207 #if (defined __STDC__ || defined __C99__FUNC__ \
1208 || defined __cplusplus || defined _MSC_VER)
1210 yyparse (void *YYPARSE_PARAM)
1213 yyparse (YYPARSE_PARAM)
1214 void *YYPARSE_PARAM;
1216 #else /* ! YYPARSE_PARAM */
1217 #if (defined __STDC__ || defined __C99__FUNC__ \
1218 || defined __cplusplus || defined _MSC_VER)
1220 yyparse (void *scanner, struct parse_context *ctx, struct scan_context *scan_ctx)
1223 yyparse (scanner, ctx, scan_ctx)
1225 struct parse_context *ctx;
1226 struct scan_context *scan_ctx;
1230 /* The lookahead symbol. */
1233 /* The semantic value of the lookahead symbol. */
1236 /* Number of syntax errors so far. */
1240 /* Number of tokens to shift before error messages enabled. */
1243 /* The stacks and their tools:
1244 `yyss': related to states.
1245 `yyvs': related to semantic values.
1247 Refer to the stacks thru separate pointers, to allow yyoverflow
1248 to reallocate them elsewhere. */
1250 /* The state stack. */
1251 yytype_int16 yyssa[YYINITDEPTH];
1253 yytype_int16 *yyssp;
1255 /* The semantic value stack. */
1256 YYSTYPE yyvsa[YYINITDEPTH];
1260 YYSIZE_T yystacksize;
1264 /* Lookahead token as an internal (translated) token number. */
1266 /* The variables used to return semantic value and location from the
1271 /* Buffer for error messages, and its allocated size. */
1273 char *yymsg = yymsgbuf;
1274 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1277 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1279 /* The number of symbols on the RHS of the reduced rule.
1280 Keep to zero when no symbol should be popped. */
1286 yystacksize = YYINITDEPTH;
1288 YYDPRINTF ((stderr, "Starting parse\n"));
1293 yychar = YYEMPTY; /* Cause a token to be read. */
1295 /* Initialize stack pointers.
1296 Waste one element of value and location stack
1297 so that they stay on the same level as the state stack.
1298 The wasted elements are never initialized. */
1304 /*------------------------------------------------------------.
1305 | yynewstate -- Push a new state, which is found in yystate. |
1306 `------------------------------------------------------------*/
1308 /* In all cases, when you get here, the value and location stacks
1309 have just been pushed. So pushing a state here evens the stacks. */
1315 if (yyss + yystacksize - 1 <= yyssp)
1317 /* Get the current used size of the three stacks, in elements. */
1318 YYSIZE_T yysize = yyssp - yyss + 1;
1322 /* Give user a chance to reallocate the stack. Use copies of
1323 these so that the &'s don't force the real ones into
1325 YYSTYPE *yyvs1 = yyvs;
1326 yytype_int16 *yyss1 = yyss;
1328 /* Each stack pointer address is followed by the size of the
1329 data in use in that stack, in bytes. This used to be a
1330 conditional around just the two extra args, but that might
1331 be undefined if yyoverflow is a macro. */
1332 yyoverflow (YY_("memory exhausted"),
1333 &yyss1, yysize * sizeof (*yyssp),
1334 &yyvs1, yysize * sizeof (*yyvsp),
1340 #else /* no yyoverflow */
1341 # ifndef YYSTACK_RELOCATE
1342 goto yyexhaustedlab;
1344 /* Extend the stack our own way. */
1345 if (YYMAXDEPTH <= yystacksize)
1346 goto yyexhaustedlab;
1348 if (YYMAXDEPTH < yystacksize)
1349 yystacksize = YYMAXDEPTH;
1352 yytype_int16 *yyss1 = yyss;
1353 union yyalloc *yyptr =
1354 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1356 goto yyexhaustedlab;
1357 YYSTACK_RELOCATE (yyss_alloc, yyss);
1358 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1359 # undef YYSTACK_RELOCATE
1361 YYSTACK_FREE (yyss1);
1364 #endif /* no yyoverflow */
1366 yyssp = yyss + yysize - 1;
1367 yyvsp = yyvs + yysize - 1;
1369 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1370 (unsigned long int) yystacksize));
1372 if (yyss + yystacksize - 1 <= yyssp)
1376 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1378 if (yystate == YYFINAL)
1388 /* Do appropriate processing given the current state. Read a
1389 lookahead token if we need one and don't already have one. */
1391 /* First try to decide what to do without reference to lookahead token. */
1392 yyn = yypact[yystate];
1393 if (yyn == YYPACT_NINF)
1396 /* Not known => get a lookahead token if don't already have one. */
1398 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1399 if (yychar == YYEMPTY)
1401 YYDPRINTF ((stderr, "Reading a token: "));
1405 if (yychar <= YYEOF)
1407 yychar = yytoken = YYEOF;
1408 YYDPRINTF ((stderr, "Now at end of input.\n"));
1412 yytoken = YYTRANSLATE (yychar);
1413 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1416 /* If the proper action on seeing token YYTOKEN is to reduce or to
1417 detect an error, take that action. */
1419 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1424 if (yyn == 0 || yyn == YYTABLE_NINF)
1430 /* Count tokens shifted since error; after three, turn off error
1435 /* Shift the lookahead token. */
1436 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1438 /* Discard the shifted token. */
1447 /*-----------------------------------------------------------.
1448 | yydefault -- do the default action for the current state. |
1449 `-----------------------------------------------------------*/
1451 yyn = yydefact[yystate];
1457 /*-----------------------------.
1458 | yyreduce -- Do a reduction. |
1459 `-----------------------------*/
1461 /* yyn is the number of a rule to reduce with. */
1464 /* If YYLEN is nonzero, implement the default value of the action:
1467 Otherwise, the following line sets YYVAL to garbage.
1468 This behavior is undocumented and Bison
1469 users should not rely upon it. Assigning to YYVAL
1470 unconditionally makes the parser a bit smaller, and it avoids a
1471 GCC warning that YYVAL may be used uninitialized. */
1472 yyval = yyvsp[1-yylen];
1475 YY_REDUCE_PRINT (yyn);
1480 /* Line 1455 of yacc.c */
1481 #line 123 "grammar.y"
1483 ctx->setting = config_setting_add(ctx->parent, (yyvsp[(1) - (1)].sval), CONFIG_TYPE_NONE);
1485 if(ctx->setting == NULL)
1487 libconfig_yyerror(scanner, ctx, scan_ctx, err_duplicate_setting);
1492 CAPTURE_PARSE_POS(ctx->setting);
1499 /* Line 1455 of yacc.c */
1500 #line 142 "grammar.y"
1504 ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_ARRAY);
1505 CAPTURE_PARSE_POS(ctx->parent);
1509 ctx->setting->type = CONFIG_TYPE_ARRAY;
1510 ctx->parent = ctx->setting;
1511 ctx->setting = NULL;
1518 /* Line 1455 of yacc.c */
1519 #line 157 "grammar.y"
1522 ctx->parent = ctx->parent->parent;
1528 /* Line 1455 of yacc.c */
1529 #line 165 "grammar.y"
1533 ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_LIST);
1534 CAPTURE_PARSE_POS(ctx->parent);
1538 ctx->setting->type = CONFIG_TYPE_LIST;
1539 ctx->parent = ctx->setting;
1540 ctx->setting = NULL;
1547 /* Line 1455 of yacc.c */
1548 #line 180 "grammar.y"
1551 ctx->parent = ctx->parent->parent;
1557 /* Line 1455 of yacc.c */
1558 #line 194 "grammar.y"
1559 { parsectx_append_string(ctx, (yyvsp[(1) - (1)].sval)); free((yyvsp[(1) - (1)].sval)); }
1564 /* Line 1455 of yacc.c */
1565 #line 195 "grammar.y"
1566 { parsectx_append_string(ctx, (yyvsp[(2) - (2)].sval)); free((yyvsp[(2) - (2)].sval)); }
1571 /* Line 1455 of yacc.c */
1572 #line 200 "grammar.y"
1574 if(IN_ARRAY() || IN_LIST())
1576 config_setting_t *e = config_setting_set_bool_elem(ctx->parent, -1,
1577 (int)(yyvsp[(1) - (1)].ival));
1581 libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
1586 CAPTURE_PARSE_POS(e);
1590 config_setting_set_bool(ctx->setting, (int)(yyvsp[(1) - (1)].ival));
1596 /* Line 1455 of yacc.c */
1597 #line 220 "grammar.y"
1599 if(IN_ARRAY() || IN_LIST())
1601 config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[(1) - (1)].ival));
1604 libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
1609 config_setting_set_format(e, CONFIG_FORMAT_DEFAULT);
1610 CAPTURE_PARSE_POS(e);
1615 config_setting_set_int(ctx->setting, (yyvsp[(1) - (1)].ival));
1616 config_setting_set_format(ctx->setting, CONFIG_FORMAT_DEFAULT);
1623 /* Line 1455 of yacc.c */
1624 #line 242 "grammar.y"
1626 if(IN_ARRAY() || IN_LIST())
1628 config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[(1) - (1)].llval));
1631 libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
1636 config_setting_set_format(e, CONFIG_FORMAT_DEFAULT);
1637 CAPTURE_PARSE_POS(e);
1642 config_setting_set_int64(ctx->setting, (yyvsp[(1) - (1)].llval));
1643 config_setting_set_format(ctx->setting, CONFIG_FORMAT_DEFAULT);
1650 /* Line 1455 of yacc.c */
1651 #line 264 "grammar.y"
1653 if(IN_ARRAY() || IN_LIST())
1655 config_setting_t *e = config_setting_set_int_elem(ctx->parent, -1, (yyvsp[(1) - (1)].ival));
1658 libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
1663 config_setting_set_format(e, CONFIG_FORMAT_HEX);
1664 CAPTURE_PARSE_POS(e);
1669 config_setting_set_int(ctx->setting, (yyvsp[(1) - (1)].ival));
1670 config_setting_set_format(ctx->setting, CONFIG_FORMAT_HEX);
1677 /* Line 1455 of yacc.c */
1678 #line 286 "grammar.y"
1680 if(IN_ARRAY() || IN_LIST())
1682 config_setting_t *e = config_setting_set_int64_elem(ctx->parent, -1, (yyvsp[(1) - (1)].llval));
1685 libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
1690 config_setting_set_format(e, CONFIG_FORMAT_HEX);
1691 CAPTURE_PARSE_POS(e);
1696 config_setting_set_int64(ctx->setting, (yyvsp[(1) - (1)].llval));
1697 config_setting_set_format(ctx->setting, CONFIG_FORMAT_HEX);
1704 /* Line 1455 of yacc.c */
1705 #line 308 "grammar.y"
1707 if(IN_ARRAY() || IN_LIST())
1709 config_setting_t *e = config_setting_set_float_elem(ctx->parent, -1, (yyvsp[(1) - (1)].fval));
1712 libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
1717 CAPTURE_PARSE_POS(e);
1721 config_setting_set_float(ctx->setting, (yyvsp[(1) - (1)].fval));
1727 /* Line 1455 of yacc.c */
1728 #line 326 "grammar.y"
1730 if(IN_ARRAY() || IN_LIST())
1732 const char *s = parsectx_take_string(ctx);
1733 config_setting_t *e = config_setting_set_string_elem(ctx->parent, -1, s);
1738 libconfig_yyerror(scanner, ctx, scan_ctx, err_array_elem_type);
1743 CAPTURE_PARSE_POS(e);
1748 const char *s = parsectx_take_string(ctx);
1749 config_setting_set_string(ctx->setting, s);
1757 /* Line 1455 of yacc.c */
1758 #line 374 "grammar.y"
1762 ctx->parent = config_setting_add(ctx->parent, NULL, CONFIG_TYPE_GROUP);
1763 CAPTURE_PARSE_POS(ctx->parent);
1767 ctx->setting->type = CONFIG_TYPE_GROUP;
1768 ctx->parent = ctx->setting;
1769 ctx->setting = NULL;
1776 /* Line 1455 of yacc.c */
1777 #line 389 "grammar.y"
1780 ctx->parent = ctx->parent->parent;
1786 /* Line 1455 of yacc.c */
1787 #line 1788 "grammar.c"
1790 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1794 YY_STACK_PRINT (yyss, yyssp);
1798 /* Now `shift' the result of the reduction. Determine what state
1799 that goes to, based on the state we popped back to and the rule
1800 number reduced by. */
1804 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1805 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1806 yystate = yytable[yystate];
1808 yystate = yydefgoto[yyn - YYNTOKENS];
1813 /*------------------------------------.
1814 | yyerrlab -- here on detecting error |
1815 `------------------------------------*/
1817 /* If not already recovering from an error, report this error. */
1821 #if ! YYERROR_VERBOSE
1822 yyerror (scanner, ctx, scan_ctx, YY_("syntax error"));
1825 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1826 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1828 YYSIZE_T yyalloc = 2 * yysize;
1829 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1830 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1831 if (yymsg != yymsgbuf)
1832 YYSTACK_FREE (yymsg);
1833 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1835 yymsg_alloc = yyalloc;
1839 yymsg_alloc = sizeof yymsgbuf;
1843 if (0 < yysize && yysize <= yymsg_alloc)
1845 (void) yysyntax_error (yymsg, yystate, yychar);
1846 yyerror (scanner, ctx, scan_ctx, yymsg);
1850 yyerror (scanner, ctx, scan_ctx, YY_("syntax error"));
1852 goto yyexhaustedlab;
1860 if (yyerrstatus == 3)
1862 /* If just tried and failed to reuse lookahead token after an
1863 error, discard it. */
1865 if (yychar <= YYEOF)
1867 /* Return failure if at end of input. */
1868 if (yychar == YYEOF)
1873 yydestruct ("Error: discarding",
1874 yytoken, &yylval, scanner, ctx, scan_ctx);
1879 /* Else will try to reuse lookahead token after shifting the error
1884 /*---------------------------------------------------.
1885 | yyerrorlab -- error raised explicitly by YYERROR. |
1886 `---------------------------------------------------*/
1889 /* Pacify compilers like GCC when the user code never invokes
1890 YYERROR and the label yyerrorlab therefore never appears in user
1892 if (/*CONSTCOND*/ 0)
1895 /* Do not reclaim the symbols of the rule which action triggered
1899 YY_STACK_PRINT (yyss, yyssp);
1904 /*-------------------------------------------------------------.
1905 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1906 `-------------------------------------------------------------*/
1908 yyerrstatus = 3; /* Each real token shifted decrements this. */
1912 yyn = yypact[yystate];
1913 if (yyn != YYPACT_NINF)
1916 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1924 /* Pop the current state because it cannot handle the error token. */
1929 yydestruct ("Error: popping",
1930 yystos[yystate], yyvsp, scanner, ctx, scan_ctx);
1933 YY_STACK_PRINT (yyss, yyssp);
1939 /* Shift the error token. */
1940 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1946 /*-------------------------------------.
1947 | yyacceptlab -- YYACCEPT comes here. |
1948 `-------------------------------------*/
1953 /*-----------------------------------.
1954 | yyabortlab -- YYABORT comes here. |
1955 `-----------------------------------*/
1960 #if !defined(yyoverflow) || YYERROR_VERBOSE
1961 /*-------------------------------------------------.
1962 | yyexhaustedlab -- memory exhaustion comes here. |
1963 `-------------------------------------------------*/
1965 yyerror (scanner, ctx, scan_ctx, YY_("memory exhausted"));
1971 if (yychar != YYEMPTY)
1972 yydestruct ("Cleanup: discarding lookahead",
1973 yytoken, &yylval, scanner, ctx, scan_ctx);
1974 /* Do not reclaim the symbols of the rule which action triggered
1975 this YYABORT or YYACCEPT. */
1977 YY_STACK_PRINT (yyss, yyssp);
1978 while (yyssp != yyss)
1980 yydestruct ("Cleanup: popping",
1981 yystos[*yyssp], yyvsp, scanner, ctx, scan_ctx);
1986 YYSTACK_FREE (yyss);
1989 if (yymsg != yymsgbuf)
1990 YYSTACK_FREE (yymsg);
1992 /* Make sure YYID is used. */
1993 return YYID (yyresult);
1998 /* Line 1675 of yacc.c */
1999 #line 395 "grammar.y"