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 zconfparse
66 #define yylex zconflex
67 #define yyerror zconferror
68 #define yylval zconflval
69 #define yychar zconfchar
70 #define yydebug zconfdebug
71 #define yynerrs zconfnerrs
74 /* Copy the first part of user declarations. */
76 /* Line 268 of yacc.c */
80 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
81 * Released under the terms of the GNU GPL v2.0.
93 #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
96 #define DEBUG_PARSE 0x0002
100 extern int zconflex(void);
101 static void zconfprint(const char *err, ...);
102 static void zconf_error(const char *err, ...);
103 static void zconferror(const char *err);
104 static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
106 struct symbol *symbol_hash[SYMBOL_HASHSIZE];
108 static struct menu *current_menu, *current_entry;
112 /* Line 268 of yacc.c */
113 #line 114 "zconf.tab.c"
115 /* Enabling traces. */
120 /* Enabling verbose error messages. */
121 #ifdef YYERROR_VERBOSE
122 # undef YYERROR_VERBOSE
123 # define YYERROR_VERBOSE 1
125 # define YYERROR_VERBOSE 0
128 /* Enabling the token table. */
129 #ifndef YYTOKEN_TABLE
130 # define YYTOKEN_TABLE 0
137 /* Put the tokens into the symbol table, so that GDB and other debuggers
178 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
179 typedef union YYSTYPE
182 /* Line 293 of yacc.c */
187 struct symbol *symbol;
190 const struct kconf_id *id;
194 /* Line 293 of yacc.c */
195 #line 196 "zconf.tab.c"
197 # define YYSTYPE_IS_TRIVIAL 1
198 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
199 # define YYSTYPE_IS_DECLARED 1
203 /* Copy the second part of user declarations. */
205 /* Line 343 of yacc.c */
208 /* Include zconf.hash.c here so it can see the token constants. */
209 #include "zconf.hash.c"
212 /* Line 343 of yacc.c */
213 #line 214 "zconf.tab.c"
220 typedef YYTYPE_UINT8 yytype_uint8;
222 typedef unsigned char yytype_uint8;
226 typedef YYTYPE_INT8 yytype_int8;
227 #elif (defined __STDC__ || defined __C99__FUNC__ \
228 || defined __cplusplus || defined _MSC_VER)
229 typedef signed char yytype_int8;
231 typedef short int yytype_int8;
235 typedef YYTYPE_UINT16 yytype_uint16;
237 typedef unsigned short int yytype_uint16;
241 typedef YYTYPE_INT16 yytype_int16;
243 typedef short int yytype_int16;
247 # ifdef __SIZE_TYPE__
248 # define YYSIZE_T __SIZE_TYPE__
249 # elif defined size_t
250 # define YYSIZE_T size_t
251 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
252 || defined __cplusplus || defined _MSC_VER)
253 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
254 # define YYSIZE_T size_t
256 # define YYSIZE_T unsigned int
260 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
263 # if defined YYENABLE_NLS && YYENABLE_NLS
265 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
266 # define YY_(msgid) dgettext ("bison-runtime", msgid)
270 # define YY_(msgid) msgid
274 /* Suppress unused-variable warnings by "using" E. */
275 #if ! defined lint || defined __GNUC__
276 # define YYUSE(e) ((void) (e))
278 # define YYUSE(e) /* empty */
281 /* Identity function, used to suppress warnings about constant conditions. */
285 #if (defined __STDC__ || defined __C99__FUNC__ \
286 || defined __cplusplus || defined _MSC_VER)
299 #if ! defined yyoverflow || YYERROR_VERBOSE
301 /* The parser invokes alloca or malloc; define the necessary symbols. */
303 # ifdef YYSTACK_USE_ALLOCA
304 # if YYSTACK_USE_ALLOCA
306 # define YYSTACK_ALLOC __builtin_alloca
307 # elif defined __BUILTIN_VA_ARG_INCR
308 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
310 # define YYSTACK_ALLOC __alloca
311 # elif defined _MSC_VER
312 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
313 # define alloca _alloca
315 # define YYSTACK_ALLOC alloca
316 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
317 || defined __cplusplus || defined _MSC_VER)
318 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
319 # ifndef EXIT_SUCCESS
320 # define EXIT_SUCCESS 0
327 # ifdef YYSTACK_ALLOC
328 /* Pacify GCC's `empty if-body' warning. */
329 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
330 # ifndef YYSTACK_ALLOC_MAXIMUM
331 /* The OS might guarantee only one guard page at the bottom of the stack,
332 and a page size can be as small as 4096 bytes. So we cannot safely
333 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
334 to allow for a few compiler-allocated temporary stack slots. */
335 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
338 # define YYSTACK_ALLOC YYMALLOC
339 # define YYSTACK_FREE YYFREE
340 # ifndef YYSTACK_ALLOC_MAXIMUM
341 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
343 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
344 && ! ((defined YYMALLOC || defined malloc) \
345 && (defined YYFREE || defined free)))
346 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
347 # ifndef EXIT_SUCCESS
348 # define EXIT_SUCCESS 0
352 # define YYMALLOC malloc
353 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
354 || defined __cplusplus || defined _MSC_VER)
355 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
360 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
361 || defined __cplusplus || defined _MSC_VER)
362 void free (void *); /* INFRINGES ON USER NAME SPACE */
366 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
369 #if (! defined yyoverflow \
370 && (! defined __cplusplus \
371 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
373 /* A type that is properly aligned for any stack member. */
376 yytype_int16 yyss_alloc;
380 /* The size of the maximum gap between one aligned stack and the next. */
381 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
383 /* The size of an array large to enough to hold all stacks, each with
385 # define YYSTACK_BYTES(N) \
386 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
387 + YYSTACK_GAP_MAXIMUM)
389 # define YYCOPY_NEEDED 1
391 /* Relocate STACK from its old location to the new one. The
392 local variables YYSIZE and YYSTACKSIZE give the old and new number of
393 elements in the stack, and YYPTR gives the new location of the
394 stack. Advance YYPTR to a properly aligned location for the next
396 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
399 YYSIZE_T yynewbytes; \
400 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
401 Stack = &yyptr->Stack_alloc; \
402 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
403 yyptr += yynewbytes / sizeof (*yyptr); \
409 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
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]; \
427 #endif /* !YYCOPY_NEEDED */
429 /* YYFINAL -- State number of the termination state. */
431 /* YYLAST -- Last index in YYTABLE. */
434 /* YYNTOKENS -- Number of terminals. */
436 /* YYNNTS -- Number of nonterminals. */
438 /* YYNRULES -- Number of rules. */
440 /* YYNRULES -- Number of states. */
441 #define YYNSTATES 194
443 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
445 #define YYMAXUTOK 290
447 #define YYTRANSLATE(YYX) \
448 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
450 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
451 static const yytype_uint8 yytranslate[] =
453 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
479 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
480 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
481 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
486 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
488 static const yytype_uint16 yyprhs[] =
490 0, 0, 3, 6, 8, 11, 13, 14, 17, 20,
491 23, 26, 31, 36, 40, 42, 44, 46, 48, 50,
492 52, 54, 56, 58, 60, 62, 64, 66, 68, 72,
493 75, 79, 82, 86, 89, 90, 93, 96, 99, 102,
494 105, 108, 112, 117, 122, 127, 133, 139, 143, 144,
495 148, 149, 152, 156, 159, 161, 165, 166, 169, 172,
496 175, 178, 181, 186, 190, 193, 198, 199, 202, 206,
497 208, 212, 213, 216, 219, 222, 226, 230, 234, 236,
498 240, 241, 244, 247, 250, 254, 258, 261, 264, 267,
499 268, 271, 274, 277, 282, 283, 286, 289, 292, 293,
500 296, 298, 300, 303, 306, 309, 311, 314, 315, 318,
501 320, 324, 328, 332, 335, 339, 343, 345, 347, 348
504 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
505 static const yytype_int8 yyrhs[] =
507 37, 0, -1, 81, 38, -1, 38, -1, 63, 39,
508 -1, 39, -1, -1, 39, 41, -1, 39, 55, -1,
509 39, 67, -1, 39, 80, -1, 39, 26, 1, 31,
510 -1, 39, 40, 1, 31, -1, 39, 1, 31, -1,
511 16, -1, 18, -1, 19, -1, 21, -1, 17, -1,
512 22, -1, 20, -1, 23, -1, 31, -1, 61, -1,
513 71, -1, 44, -1, 46, -1, 69, -1, 26, 1,
514 31, -1, 1, 31, -1, 10, 26, 31, -1, 43,
515 47, -1, 11, 26, 31, -1, 45, 47, -1, -1,
516 47, 48, -1, 47, 49, -1, 47, 75, -1, 47,
517 73, -1, 47, 42, -1, 47, 31, -1, 19, 78,
518 31, -1, 18, 79, 82, 31, -1, 20, 83, 82,
519 31, -1, 21, 26, 82, 31, -1, 21, 26, 83,
520 82, 31, -1, 22, 84, 84, 82, 31, -1, 24,
521 50, 31, -1, -1, 50, 26, 51, -1, -1, 34,
522 79, -1, 7, 85, 31, -1, 52, 56, -1, 80,
523 -1, 53, 58, 54, -1, -1, 56, 57, -1, 56,
524 75, -1, 56, 73, -1, 56, 31, -1, 56, 42,
525 -1, 18, 79, 82, 31, -1, 19, 78, 31, -1,
526 17, 31, -1, 20, 26, 82, 31, -1, -1, 58,
527 41, -1, 14, 83, 81, -1, 80, -1, 59, 62,
528 60, -1, -1, 62, 41, -1, 62, 67, -1, 62,
529 55, -1, 3, 79, 81, -1, 4, 79, 31, -1,
530 64, 76, 74, -1, 80, -1, 65, 68, 66, -1,
531 -1, 68, 41, -1, 68, 67, -1, 68, 55, -1,
532 6, 79, 31, -1, 9, 79, 31, -1, 70, 74,
533 -1, 12, 31, -1, 72, 13, -1, -1, 74, 75,
534 -1, 74, 31, -1, 74, 42, -1, 16, 25, 83,
535 31, -1, -1, 76, 77, -1, 76, 31, -1, 23,
536 82, -1, -1, 79, 82, -1, 26, -1, 27, -1,
537 5, 31, -1, 8, 31, -1, 15, 31, -1, 31,
538 -1, 81, 31, -1, -1, 14, 83, -1, 84, -1,
539 84, 34, 84, -1, 84, 28, 84, -1, 30, 83,
540 29, -1, 35, 83, -1, 83, 32, 83, -1, 83,
541 33, 83, -1, 26, -1, 27, -1, -1, 26, -1
544 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
545 static const yytype_uint16 yyrline[] =
547 0, 103, 103, 103, 105, 105, 107, 109, 110, 111,
548 112, 113, 114, 118, 122, 122, 122, 122, 122, 122,
549 122, 122, 126, 127, 128, 129, 130, 131, 135, 136,
550 142, 150, 156, 164, 174, 176, 177, 178, 179, 180,
551 181, 184, 192, 198, 208, 214, 220, 226, 229, 231,
552 242, 243, 248, 257, 262, 270, 273, 275, 276, 277,
553 278, 279, 282, 288, 299, 305, 315, 317, 322, 330,
554 338, 341, 343, 344, 345, 350, 357, 364, 369, 377,
555 380, 382, 383, 384, 387, 395, 402, 409, 415, 422,
556 424, 425, 426, 429, 437, 439, 440, 443, 450, 452,
557 457, 458, 461, 462, 463, 467, 468, 471, 472, 475,
558 476, 477, 478, 479, 480, 481, 484, 485, 488, 489
562 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
563 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
564 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
565 static const char *const yytname[] =
567 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
568 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
569 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
570 "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE",
571 "T_VISIBLE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
572 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
573 "T_NOT", "$accept", "input", "start", "stmt_list", "option_name",
574 "common_stmt", "option_error", "config_entry_start", "config_stmt",
575 "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
576 "config_option", "symbol_option", "symbol_option_list",
577 "symbol_option_arg", "choice", "choice_entry", "choice_end",
578 "choice_stmt", "choice_option_list", "choice_option", "choice_block",
579 "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu",
580 "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt",
581 "comment", "comment_stmt", "help_start", "help", "depends_list",
582 "depends", "visibility_list", "visible", "prompt_stmt_opt", "prompt",
583 "end", "nl", "if_expr", "expr", "symbol", "word_opt", 0
588 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
590 static const yytype_uint16 yytoknum[] =
592 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
593 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
594 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
595 285, 286, 287, 288, 289, 290
599 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
600 static const yytype_uint8 yyr1[] =
602 0, 36, 37, 37, 38, 38, 39, 39, 39, 39,
603 39, 39, 39, 39, 40, 40, 40, 40, 40, 40,
604 40, 40, 41, 41, 41, 41, 41, 41, 42, 42,
605 43, 44, 45, 46, 47, 47, 47, 47, 47, 47,
606 47, 48, 48, 48, 48, 48, 48, 49, 50, 50,
607 51, 51, 52, 53, 54, 55, 56, 56, 56, 56,
608 56, 56, 57, 57, 57, 57, 58, 58, 59, 60,
609 61, 62, 62, 62, 62, 63, 64, 65, 66, 67,
610 68, 68, 68, 68, 69, 70, 71, 72, 73, 74,
611 74, 74, 74, 75, 76, 76, 76, 77, 78, 78,
612 79, 79, 80, 80, 80, 81, 81, 82, 82, 83,
613 83, 83, 83, 83, 83, 83, 84, 84, 85, 85
616 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
617 static const yytype_uint8 yyr2[] =
619 0, 2, 2, 1, 2, 1, 0, 2, 2, 2,
620 2, 4, 4, 3, 1, 1, 1, 1, 1, 1,
621 1, 1, 1, 1, 1, 1, 1, 1, 3, 2,
622 3, 2, 3, 2, 0, 2, 2, 2, 2, 2,
623 2, 3, 4, 4, 4, 5, 5, 3, 0, 3,
624 0, 2, 3, 2, 1, 3, 0, 2, 2, 2,
625 2, 2, 4, 3, 2, 4, 0, 2, 3, 1,
626 3, 0, 2, 2, 2, 3, 3, 3, 1, 3,
627 0, 2, 2, 2, 3, 3, 2, 2, 2, 0,
628 2, 2, 2, 4, 0, 2, 2, 2, 0, 2,
629 1, 1, 2, 2, 2, 1, 2, 0, 2, 1,
630 3, 3, 3, 2, 3, 3, 1, 1, 0, 1
633 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
634 Performed when YYTABLE doesn't specify something else to do. Zero
635 means the default is an error. */
636 static const yytype_uint8 yydefact[] =
638 6, 0, 105, 0, 3, 0, 6, 6, 100, 101,
639 0, 1, 0, 0, 0, 0, 118, 0, 0, 0,
640 0, 0, 0, 14, 18, 15, 16, 20, 17, 19,
641 21, 0, 22, 0, 7, 34, 25, 34, 26, 56,
642 66, 8, 71, 23, 94, 80, 9, 27, 89, 24,
643 10, 0, 106, 2, 75, 13, 0, 102, 0, 119,
644 0, 103, 0, 0, 0, 116, 117, 0, 0, 0,
645 109, 104, 0, 0, 0, 0, 0, 0, 0, 89,
646 0, 0, 76, 84, 52, 85, 30, 32, 0, 113,
647 0, 0, 68, 0, 0, 11, 12, 0, 0, 0,
648 0, 98, 0, 0, 0, 48, 0, 40, 39, 35,
649 36, 0, 38, 37, 0, 0, 98, 0, 60, 61,
650 57, 59, 58, 67, 55, 54, 72, 74, 70, 73,
651 69, 107, 96, 0, 95, 81, 83, 79, 82, 78,
652 91, 92, 90, 112, 114, 115, 111, 110, 29, 87,
653 0, 107, 0, 107, 107, 107, 0, 0, 0, 88,
654 64, 107, 0, 107, 0, 97, 0, 0, 41, 99,
655 0, 0, 107, 107, 50, 47, 28, 0, 63, 0,
656 108, 93, 42, 43, 44, 0, 0, 0, 49, 62,
660 /* YYDEFGOTO[NTERM-NUM]. */
661 static const yytype_int16 yydefgoto[] =
663 -1, 3, 4, 5, 33, 34, 108, 35, 36, 37,
664 38, 74, 109, 110, 157, 188, 39, 40, 124, 41,
665 76, 120, 77, 42, 128, 43, 78, 6, 44, 45,
666 137, 46, 80, 47, 48, 49, 111, 112, 81, 113,
667 79, 134, 152, 153, 50, 7, 165, 69, 70, 60
670 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
672 #define YYPACT_NINF -90
673 static const yytype_int16 yypact[] =
675 4, 77, -90, 61, -90, 129, -90, 15, -90, -90,
676 37, -90, 47, 77, 51, 77, 59, 63, 77, 66,
677 71, 60, 69, -90, -90, -90, -90, -90, -90, -90,
678 -90, 125, -90, 127, -90, -90, -90, -90, -90, -90,
679 -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
680 -90, 157, -90, -90, 100, -90, 128, -90, 154, -90,
681 156, -90, 160, 161, 170, -90, -90, 60, 60, 203,
682 49, -90, 171, 182, 33, 101, 213, 252, 241, -2,
683 241, 189, -90, -90, -90, -90, -90, -90, -13, -90,
684 60, 60, 100, 115, 115, -90, -90, 185, 186, 201,
685 77, 77, 60, 211, 115, -90, 237, -90, -90, -90,
686 -90, 230, -90, -90, 222, 77, 77, 228, -90, -90,
687 -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
688 -90, 245, -90, 65, -90, -90, -90, -90, -90, -90,
689 -90, -90, -90, -90, 231, -90, -90, -90, -90, -90,
690 60, 245, 234, 245, -5, -4, 115, 62, 238, -90,
691 -90, 245, 239, 245, 60, -90, 209, 240, -90, -90,
692 242, 244, -5, 245, 246, -90, -90, 248, -90, 250,
693 137, -90, -90, -90, -90, 251, 254, 77, -90, -90,
697 /* YYPGOTO[NTERM-NUM]. */
698 static const yytype_int16 yypgoto[] =
700 -90, -90, 261, 281, -90, 76, -70, -90, -90, -90,
701 -90, 253, -90, -90, -90, -90, -90, -90, -90, -48,
702 -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
703 -90, -20, -90, -90, -90, -90, -90, 212, 210, -68,
704 -90, -90, 175, -1, 104, -7, 123, -66, -89, -90
707 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
708 positive, shift that token. If negative, reduce the rule which
709 number is the opposite. If YYTABLE_NINF, syntax error. */
710 #define YYTABLE_NINF -87
711 static const yytype_int16 yytable[] =
713 10, 88, 89, 54, 146, 147, 119, 1, 122, 164,
714 164, 141, 56, 142, 58, 156, 143, 62, 1, 90,
715 91, 131, 65, 66, 144, 145, 67, 90, 91, 132,
716 127, 68, 136, -31, 97, 2, 154, -31, -31, -31,
717 -31, -31, -31, -31, -31, 98, 52, -31, -31, 99,
718 -31, 100, 101, 102, 103, 104, -31, 105, 129, 106,
719 138, 11, 92, 141, 107, 142, 97, 173, 2, -77,
720 -77, -77, -77, -77, -77, -77, -77, 93, 55, -77,
721 -77, 99, 57, 94, 166, 59, 65, 66, 174, 172,
722 67, 106, 63, 175, 61, 68, 140, 64, 180, 151,
723 71, -33, 97, 8, 9, -33, -33, -33, -33, -33,
724 -33, -33, -33, 98, 161, -33, -33, 99, -33, 100,
725 101, 102, 103, 104, -33, 105, 72, 106, 73, -5,
726 12, 52, 107, 13, 14, 15, 16, 17, 18, 19,
727 20, 65, 66, 21, 22, 23, 24, 25, 26, 27,
728 28, 29, 30, 123, 126, 31, 135, -4, 12, 82,
729 32, 13, 14, 15, 16, 17, 18, 19, 20, 90,
730 91, 21, 22, 23, 24, 25, 26, 27, 28, 29,
731 30, 125, 130, 31, 139, 83, 193, 84, 32, -86,
732 97, 85, 86, -86, -86, -86, -86, -86, -86, -86,
733 -86, 87, 95, -86, -86, 99, -86, -86, -86, -86,
734 -86, -86, -86, 96, 97, 106, 148, 149, -53, -53,
735 140, -53, -53, -53, -53, 98, 150, -53, -53, 99,
736 114, 115, 116, 117, 2, 90, 91, 155, 158, 106,
737 181, 90, 91, 159, 118, 13, 14, 15, 16, 17,
738 18, 19, 20, 160, 163, 21, 22, 14, 15, 164,
739 17, 18, 19, 20, 91, 168, 21, 22, 53, 176,
740 178, 182, 32, 183, 167, 184, 169, 170, 171, 189,
741 187, 190, 191, 32, 177, 192, 179, 51, 121, 133,
742 75, 162, 0, 0, 0, 185, 186
745 #define yypact_value_is_default(yystate) \
748 #define yytable_value_is_error(yytable_value) \
751 static const yytype_int16 yycheck[] =
753 1, 67, 68, 10, 93, 94, 76, 3, 76, 14,
754 14, 81, 13, 81, 15, 104, 29, 18, 3, 32,
755 33, 23, 26, 27, 90, 91, 30, 32, 33, 31,
756 78, 35, 80, 0, 1, 31, 102, 4, 5, 6,
757 7, 8, 9, 10, 11, 12, 31, 14, 15, 16,
758 17, 18, 19, 20, 21, 22, 23, 24, 78, 26,
759 80, 0, 69, 133, 31, 133, 1, 156, 31, 4,
760 5, 6, 7, 8, 9, 10, 11, 28, 31, 14,
761 15, 16, 31, 34, 150, 26, 26, 27, 26, 155,
762 30, 26, 26, 31, 31, 35, 31, 26, 164, 100,
763 31, 0, 1, 26, 27, 4, 5, 6, 7, 8,
764 9, 10, 11, 12, 115, 14, 15, 16, 17, 18,
765 19, 20, 21, 22, 23, 24, 1, 26, 1, 0,
766 1, 31, 31, 4, 5, 6, 7, 8, 9, 10,
767 11, 26, 27, 14, 15, 16, 17, 18, 19, 20,
768 21, 22, 23, 77, 78, 26, 80, 0, 1, 31,
769 31, 4, 5, 6, 7, 8, 9, 10, 11, 32,
770 33, 14, 15, 16, 17, 18, 19, 20, 21, 22,
771 23, 77, 78, 26, 80, 31, 187, 31, 31, 0,
772 1, 31, 31, 4, 5, 6, 7, 8, 9, 10,
773 11, 31, 31, 14, 15, 16, 17, 18, 19, 20,
774 21, 22, 23, 31, 1, 26, 31, 31, 5, 6,
775 31, 8, 9, 10, 11, 12, 25, 14, 15, 16,
776 17, 18, 19, 20, 31, 32, 33, 26, 1, 26,
777 31, 32, 33, 13, 31, 4, 5, 6, 7, 8,
778 9, 10, 11, 31, 26, 14, 15, 5, 6, 14,
779 8, 9, 10, 11, 33, 31, 14, 15, 7, 31,
780 31, 31, 31, 31, 151, 31, 153, 154, 155, 31,
781 34, 31, 31, 31, 161, 31, 163, 6, 76, 79,
782 37, 116, -1, -1, -1, 172, 173
785 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
786 symbol of state STATE-NUM. */
787 static const yytype_uint8 yystos[] =
789 0, 3, 31, 37, 38, 39, 63, 81, 26, 27,
790 79, 0, 1, 4, 5, 6, 7, 8, 9, 10,
791 11, 14, 15, 16, 17, 18, 19, 20, 21, 22,
792 23, 26, 31, 40, 41, 43, 44, 45, 46, 52,
793 53, 55, 59, 61, 64, 65, 67, 69, 70, 71,
794 80, 39, 31, 38, 81, 31, 79, 31, 79, 26,
795 85, 31, 79, 26, 26, 26, 27, 30, 35, 83,
796 84, 31, 1, 1, 47, 47, 56, 58, 62, 76,
797 68, 74, 31, 31, 31, 31, 31, 31, 83, 83,
798 32, 33, 81, 28, 34, 31, 31, 1, 12, 16,
799 18, 19, 20, 21, 22, 24, 26, 31, 42, 48,
800 49, 72, 73, 75, 17, 18, 19, 20, 31, 42,
801 57, 73, 75, 41, 54, 80, 41, 55, 60, 67,
802 80, 23, 31, 74, 77, 41, 55, 66, 67, 80,
803 31, 42, 75, 29, 83, 83, 84, 84, 31, 31,
804 25, 79, 78, 79, 83, 26, 84, 50, 1, 13,
805 31, 79, 78, 26, 14, 82, 83, 82, 31, 82,
806 82, 82, 83, 84, 26, 31, 31, 82, 31, 82,
807 83, 31, 31, 31, 31, 82, 82, 34, 51, 31,
811 #define yyerrok (yyerrstatus = 0)
812 #define yyclearin (yychar = YYEMPTY)
816 #define YYACCEPT goto yyacceptlab
817 #define YYABORT goto yyabortlab
818 #define YYERROR goto yyerrorlab
821 /* Like YYERROR except do call yyerror. This remains here temporarily
822 to ease the transition to the new meaning of YYERROR, for GCC.
823 Once GCC version 2 has supplanted version 1, this can go. However,
824 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
825 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
828 #define YYFAIL goto yyerrlab
830 /* This is here to suppress warnings from the GCC cpp's
831 -Wunused-macros. Normally we don't worry about that warning, but
832 some users do, and we want to make it easy for users to remove
833 YYFAIL uses, which will produce warnings from Bison 2.5. */
836 #define YYRECOVERING() (!!yyerrstatus)
838 #define YYBACKUP(Token, Value) \
840 if (yychar == YYEMPTY && yylen == 1) \
849 yyerror (YY_("syntax error: cannot back up")); \
856 #define YYERRCODE 256
859 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
860 If N is 0, then set CURRENT to the empty location which ends
861 the previous symbol: RHS[0] (always defined). */
863 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
864 #ifndef YYLLOC_DEFAULT
865 # define YYLLOC_DEFAULT(Current, Rhs, N) \
869 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
870 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
871 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
872 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
876 (Current).first_line = (Current).last_line = \
877 YYRHSLOC (Rhs, 0).last_line; \
878 (Current).first_column = (Current).last_column = \
879 YYRHSLOC (Rhs, 0).last_column; \
885 /* This macro is provided for backward compatibility. */
887 #ifndef YY_LOCATION_PRINT
888 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
892 /* YYLEX -- calling `yylex' with the right arguments. */
895 # define YYLEX yylex (YYLEX_PARAM)
897 # define YYLEX yylex ()
900 /* Enable debugging if requested. */
904 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
905 # define YYFPRINTF fprintf
908 # define YYDPRINTF(Args) \
914 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
918 YYFPRINTF (stderr, "%s ", Title); \
919 yy_symbol_print (stderr, \
921 YYFPRINTF (stderr, "\n"); \
926 /*--------------------------------.
927 | Print this symbol on YYOUTPUT. |
928 `--------------------------------*/
931 #if (defined __STDC__ || defined __C99__FUNC__ \
932 || defined __cplusplus || defined _MSC_VER)
934 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
937 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
940 YYSTYPE const * const yyvaluep;
946 if (yytype < YYNTOKENS)
947 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
959 /*--------------------------------.
960 | Print this symbol on YYOUTPUT. |
961 `--------------------------------*/
963 #if (defined __STDC__ || defined __C99__FUNC__ \
964 || defined __cplusplus || defined _MSC_VER)
966 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
969 yy_symbol_print (yyoutput, yytype, yyvaluep)
972 YYSTYPE const * const yyvaluep;
975 if (yytype < YYNTOKENS)
976 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
978 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
980 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
981 YYFPRINTF (yyoutput, ")");
984 /*------------------------------------------------------------------.
985 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
987 `------------------------------------------------------------------*/
989 #if (defined __STDC__ || defined __C99__FUNC__ \
990 || defined __cplusplus || defined _MSC_VER)
992 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
995 yy_stack_print (yybottom, yytop)
996 yytype_int16 *yybottom;
1000 YYFPRINTF (stderr, "Stack now");
1001 for (; yybottom <= yytop; yybottom++)
1003 int yybot = *yybottom;
1004 YYFPRINTF (stderr, " %d", yybot);
1006 YYFPRINTF (stderr, "\n");
1009 # define YY_STACK_PRINT(Bottom, Top) \
1012 yy_stack_print ((Bottom), (Top)); \
1016 /*------------------------------------------------.
1017 | Report that the YYRULE is going to be reduced. |
1018 `------------------------------------------------*/
1020 #if (defined __STDC__ || defined __C99__FUNC__ \
1021 || defined __cplusplus || defined _MSC_VER)
1023 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1026 yy_reduce_print (yyvsp, yyrule)
1031 int yynrhs = yyr2[yyrule];
1033 unsigned long int yylno = yyrline[yyrule];
1034 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1036 /* The symbols being reduced. */
1037 for (yyi = 0; yyi < yynrhs; yyi++)
1039 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1040 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1041 &(yyvsp[(yyi + 1) - (yynrhs)])
1043 YYFPRINTF (stderr, "\n");
1047 # define YY_REDUCE_PRINT(Rule) \
1050 yy_reduce_print (yyvsp, Rule); \
1053 /* Nonzero means print parse trace. It is left uninitialized so that
1054 multiple parsers can coexist. */
1056 #else /* !YYDEBUG */
1057 # define YYDPRINTF(Args)
1058 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1059 # define YY_STACK_PRINT(Bottom, Top)
1060 # define YY_REDUCE_PRINT(Rule)
1061 #endif /* !YYDEBUG */
1064 /* YYINITDEPTH -- initial size of the parser's stacks. */
1066 # define YYINITDEPTH 200
1069 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1070 if the built-in stack extension method is used).
1072 Do not make this value too large; the results are undefined if
1073 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1074 evaluated with infinite-precision integer arithmetic. */
1077 # define YYMAXDEPTH 10000
1084 # if defined __GLIBC__ && defined _STRING_H
1085 # define yystrlen strlen
1087 /* Return the length of YYSTR. */
1088 #if (defined __STDC__ || defined __C99__FUNC__ \
1089 || defined __cplusplus || defined _MSC_VER)
1091 yystrlen (const char *yystr)
1099 for (yylen = 0; yystr[yylen]; yylen++)
1107 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1108 # define yystpcpy stpcpy
1110 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1112 #if (defined __STDC__ || defined __C99__FUNC__ \
1113 || defined __cplusplus || defined _MSC_VER)
1115 yystpcpy (char *yydest, const char *yysrc)
1118 yystpcpy (yydest, yysrc)
1124 const char *yys = yysrc;
1126 while ((*yyd++ = *yys++) != '\0')
1135 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1136 quotes and backslashes, so that it's suitable for yyerror. The
1137 heuristic is that double-quoting is unnecessary unless the string
1138 contains an apostrophe, a comma, or backslash (other than
1139 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1140 null, do not copy; instead, return the length of what the result
1143 yytnamerr (char *yyres, const char *yystr)
1148 char const *yyp = yystr;
1155 goto do_not_strip_quotes;
1159 goto do_not_strip_quotes;
1172 do_not_strip_quotes: ;
1176 return yystrlen (yystr);
1178 return yystpcpy (yyres, yystr) - yyres;
1182 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1183 about the unexpected token YYTOKEN for the state stack whose top is
1186 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1187 not large enough to hold the message. In that case, also set
1188 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1189 required number of bytes is too large to store. */
1191 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1192 yytype_int16 *yyssp, int yytoken)
1194 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1195 YYSIZE_T yysize = yysize0;
1197 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1198 /* Internationalized format string. */
1199 const char *yyformat = 0;
1200 /* Arguments of yyformat. */
1201 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1202 /* Number of reported tokens (one for the "unexpected", one per
1206 /* There are many possibilities here to consider:
1207 - Assume YYFAIL is not used. It's too flawed to consider. See
1208 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1209 for details. YYERROR is fine as it does not invoke this
1211 - If this state is a consistent state with a default action, then
1212 the only way this function was invoked is if the default action
1213 is an error action. In that case, don't check for expected
1214 tokens because there are none.
1215 - The only way there can be no lookahead present (in yychar) is if
1216 this state is a consistent state with a default action. Thus,
1217 detecting the absence of a lookahead is sufficient to determine
1218 that there is no unexpected or expected token to report. In that
1219 case, just report a simple "syntax error".
1220 - Don't assume there isn't a lookahead just because this state is a
1221 consistent state with a default action. There might have been a
1222 previous inconsistent state, consistent state with a non-default
1223 action, or user semantic action that manipulated yychar.
1224 - Of course, the expected token list depends on states to have
1225 correct lookahead information, and it depends on the parser not
1226 to perform extra reductions after fetching a lookahead from the
1227 scanner and before detecting a syntax error. Thus, state merging
1228 (from LALR or IELR) and default reductions corrupt the expected
1229 token list. However, the list is correct for canonical LR with
1230 one exception: it will still contain any token that will not be
1231 accepted due to an error action in a later state.
1233 if (yytoken != YYEMPTY)
1235 int yyn = yypact[*yyssp];
1236 yyarg[yycount++] = yytname[yytoken];
1237 if (!yypact_value_is_default (yyn))
1239 /* Start YYX at -YYN if negative to avoid negative indexes in
1240 YYCHECK. In other words, skip the first -YYN actions for
1241 this state because they are default actions. */
1242 int yyxbegin = yyn < 0 ? -yyn : 0;
1243 /* Stay within bounds of both yycheck and yytname. */
1244 int yychecklim = YYLAST - yyn + 1;
1245 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1248 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1249 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1250 && !yytable_value_is_error (yytable[yyx + yyn]))
1252 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1258 yyarg[yycount++] = yytname[yyx];
1259 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1260 if (! (yysize <= yysize1
1261 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1270 # define YYCASE_(N, S) \
1274 YYCASE_(0, YY_("syntax error"));
1275 YYCASE_(1, YY_("syntax error, unexpected %s"));
1276 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1277 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1278 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1279 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1283 yysize1 = yysize + yystrlen (yyformat);
1284 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1288 if (*yymsg_alloc < yysize)
1290 *yymsg_alloc = 2 * yysize;
1291 if (! (yysize <= *yymsg_alloc
1292 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1293 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1297 /* Avoid sprintf, as that infringes on the user's name space.
1298 Don't have undefined behavior even if the translation
1299 produced a string with the wrong number of "%s"s. */
1303 while ((*yyp = *yyformat) != '\0')
1304 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1306 yyp += yytnamerr (yyp, yyarg[yyi++]);
1317 #endif /* YYERROR_VERBOSE */
1319 /*-----------------------------------------------.
1320 | Release the memory associated to this symbol. |
1321 `-----------------------------------------------*/
1324 #if (defined __STDC__ || defined __C99__FUNC__ \
1325 || defined __cplusplus || defined _MSC_VER)
1327 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1330 yydestruct (yymsg, yytype, yyvaluep)
1340 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1344 case 53: /* "choice_entry" */
1346 /* Line 1391 of yacc.c */
1349 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1350 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1351 if (current_menu == (yyvaluep->menu))
1355 /* Line 1391 of yacc.c */
1356 #line 1357 "zconf.tab.c"
1358 case 59: /* "if_entry" */
1360 /* Line 1391 of yacc.c */
1363 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1364 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1365 if (current_menu == (yyvaluep->menu))
1369 /* Line 1391 of yacc.c */
1370 #line 1371 "zconf.tab.c"
1372 case 65: /* "menu_entry" */
1374 /* Line 1391 of yacc.c */
1377 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1378 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1379 if (current_menu == (yyvaluep->menu))
1383 /* Line 1391 of yacc.c */
1384 #line 1385 "zconf.tab.c"
1393 /* Prevent warnings from -Wmissing-prototypes. */
1394 #ifdef YYPARSE_PARAM
1395 #if defined __STDC__ || defined __cplusplus
1396 int yyparse (void *YYPARSE_PARAM);
1400 #else /* ! YYPARSE_PARAM */
1401 #if defined __STDC__ || defined __cplusplus
1406 #endif /* ! YYPARSE_PARAM */
1409 /* The lookahead symbol. */
1412 /* The semantic value of the lookahead symbol. */
1415 /* Number of syntax errors so far. */
1423 #ifdef YYPARSE_PARAM
1424 #if (defined __STDC__ || defined __C99__FUNC__ \
1425 || defined __cplusplus || defined _MSC_VER)
1427 yyparse (void *YYPARSE_PARAM)
1430 yyparse (YYPARSE_PARAM)
1431 void *YYPARSE_PARAM;
1433 #else /* ! YYPARSE_PARAM */
1434 #if (defined __STDC__ || defined __C99__FUNC__ \
1435 || defined __cplusplus || defined _MSC_VER)
1446 /* Number of tokens to shift before error messages enabled. */
1449 /* The stacks and their tools:
1450 `yyss': related to states.
1451 `yyvs': related to semantic values.
1453 Refer to the stacks thru separate pointers, to allow yyoverflow
1454 to reallocate them elsewhere. */
1456 /* The state stack. */
1457 yytype_int16 yyssa[YYINITDEPTH];
1459 yytype_int16 *yyssp;
1461 /* The semantic value stack. */
1462 YYSTYPE yyvsa[YYINITDEPTH];
1466 YYSIZE_T yystacksize;
1470 /* Lookahead token as an internal (translated) token number. */
1472 /* The variables used to return semantic value and location from the
1477 /* Buffer for error messages, and its allocated size. */
1479 char *yymsg = yymsgbuf;
1480 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1483 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1485 /* The number of symbols on the RHS of the reduced rule.
1486 Keep to zero when no symbol should be popped. */
1492 yystacksize = YYINITDEPTH;
1494 YYDPRINTF ((stderr, "Starting parse\n"));
1499 yychar = YYEMPTY; /* Cause a token to be read. */
1501 /* Initialize stack pointers.
1502 Waste one element of value and location stack
1503 so that they stay on the same level as the state stack.
1504 The wasted elements are never initialized. */
1510 /*------------------------------------------------------------.
1511 | yynewstate -- Push a new state, which is found in yystate. |
1512 `------------------------------------------------------------*/
1514 /* In all cases, when you get here, the value and location stacks
1515 have just been pushed. So pushing a state here evens the stacks. */
1521 if (yyss + yystacksize - 1 <= yyssp)
1523 /* Get the current used size of the three stacks, in elements. */
1524 YYSIZE_T yysize = yyssp - yyss + 1;
1528 /* Give user a chance to reallocate the stack. Use copies of
1529 these so that the &'s don't force the real ones into
1531 YYSTYPE *yyvs1 = yyvs;
1532 yytype_int16 *yyss1 = yyss;
1534 /* Each stack pointer address is followed by the size of the
1535 data in use in that stack, in bytes. This used to be a
1536 conditional around just the two extra args, but that might
1537 be undefined if yyoverflow is a macro. */
1538 yyoverflow (YY_("memory exhausted"),
1539 &yyss1, yysize * sizeof (*yyssp),
1540 &yyvs1, yysize * sizeof (*yyvsp),
1546 #else /* no yyoverflow */
1547 # ifndef YYSTACK_RELOCATE
1548 goto yyexhaustedlab;
1550 /* Extend the stack our own way. */
1551 if (YYMAXDEPTH <= yystacksize)
1552 goto yyexhaustedlab;
1554 if (YYMAXDEPTH < yystacksize)
1555 yystacksize = YYMAXDEPTH;
1558 yytype_int16 *yyss1 = yyss;
1559 union yyalloc *yyptr =
1560 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1562 goto yyexhaustedlab;
1563 YYSTACK_RELOCATE (yyss_alloc, yyss);
1564 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1565 # undef YYSTACK_RELOCATE
1567 YYSTACK_FREE (yyss1);
1570 #endif /* no yyoverflow */
1572 yyssp = yyss + yysize - 1;
1573 yyvsp = yyvs + yysize - 1;
1575 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1576 (unsigned long int) yystacksize));
1578 if (yyss + yystacksize - 1 <= yyssp)
1582 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1584 if (yystate == YYFINAL)
1594 /* Do appropriate processing given the current state. Read a
1595 lookahead token if we need one and don't already have one. */
1597 /* First try to decide what to do without reference to lookahead token. */
1598 yyn = yypact[yystate];
1599 if (yypact_value_is_default (yyn))
1602 /* Not known => get a lookahead token if don't already have one. */
1604 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1605 if (yychar == YYEMPTY)
1607 YYDPRINTF ((stderr, "Reading a token: "));
1611 if (yychar <= YYEOF)
1613 yychar = yytoken = YYEOF;
1614 YYDPRINTF ((stderr, "Now at end of input.\n"));
1618 yytoken = YYTRANSLATE (yychar);
1619 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1622 /* If the proper action on seeing token YYTOKEN is to reduce or to
1623 detect an error, take that action. */
1625 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1630 if (yytable_value_is_error (yyn))
1636 /* Count tokens shifted since error; after three, turn off error
1641 /* Shift the lookahead token. */
1642 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1644 /* Discard the shifted token. */
1653 /*-----------------------------------------------------------.
1654 | yydefault -- do the default action for the current state. |
1655 `-----------------------------------------------------------*/
1657 yyn = yydefact[yystate];
1663 /*-----------------------------.
1664 | yyreduce -- Do a reduction. |
1665 `-----------------------------*/
1667 /* yyn is the number of a rule to reduce with. */
1670 /* If YYLEN is nonzero, implement the default value of the action:
1673 Otherwise, the following line sets YYVAL to garbage.
1674 This behavior is undocumented and Bison
1675 users should not rely upon it. Assigning to YYVAL
1676 unconditionally makes the parser a bit smaller, and it avoids a
1677 GCC warning that YYVAL may be used uninitialized. */
1678 yyval = yyvsp[1-yylen];
1681 YY_REDUCE_PRINT (yyn);
1686 /* Line 1806 of yacc.c */
1688 { zconf_error("unexpected end statement"); }
1693 /* Line 1806 of yacc.c */
1695 { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); }
1700 /* Line 1806 of yacc.c */
1703 zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
1709 /* Line 1806 of yacc.c */
1711 { zconf_error("invalid statement"); }
1716 /* Line 1806 of yacc.c */
1718 { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); }
1723 /* Line 1806 of yacc.c */
1725 { zconf_error("invalid option"); }
1730 /* Line 1806 of yacc.c */
1733 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
1734 sym->flags |= SYMBOL_OPTIONAL;
1735 menu_add_entry(sym);
1736 printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1742 /* Line 1806 of yacc.c */
1746 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1752 /* Line 1806 of yacc.c */
1755 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
1756 sym->flags |= SYMBOL_OPTIONAL;
1757 menu_add_entry(sym);
1758 printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1764 /* Line 1806 of yacc.c */
1767 if (current_entry->prompt)
1768 current_entry->prompt->type = P_MENU;
1770 zconfprint("warning: menuconfig statement without prompt");
1772 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1778 /* Line 1806 of yacc.c */
1781 menu_set_type((yyvsp[(1) - (3)].id)->stype);
1782 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1783 zconf_curname(), zconf_lineno(),
1784 (yyvsp[(1) - (3)].id)->stype);
1790 /* Line 1806 of yacc.c */
1793 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
1794 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1800 /* Line 1806 of yacc.c */
1803 menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr));
1804 if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN)
1805 menu_set_type((yyvsp[(1) - (4)].id)->stype);
1806 printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
1807 zconf_curname(), zconf_lineno(),
1808 (yyvsp[(1) - (4)].id)->stype);
1814 /* Line 1806 of yacc.c */
1817 menu_add_select(sym_lookup((yyvsp[(2) - (4)].string), 0), NULL, (yyvsp[(3) - (4)].expr));
1818 printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1824 /* Line 1806 of yacc.c */
1827 menu_add_select(sym_lookup((yyvsp[(2) - (5)].string), 0), (yyvsp[(3) - (5)].expr), (yyvsp[(4) - (5)].expr));
1828 printd(DEBUG_PARSE, "%s:%d:select with value\n", zconf_curname(), zconf_lineno());
1834 /* Line 1806 of yacc.c */
1837 menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr));
1838 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1844 /* Line 1806 of yacc.c */
1847 const struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
1848 if (id && id->flags & TF_OPTION)
1849 menu_add_option(id->token, (yyvsp[(3) - (3)].string));
1851 zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string));
1852 free((yyvsp[(2) - (3)].string));
1858 /* Line 1806 of yacc.c */
1860 { (yyval.string) = NULL; }
1865 /* Line 1806 of yacc.c */
1867 { (yyval.string) = (yyvsp[(2) - (2)].string); }
1872 /* Line 1806 of yacc.c */
1875 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE);
1876 sym->flags |= SYMBOL_AUTO;
1877 menu_add_entry(sym);
1878 menu_add_expr(P_CHOICE, NULL, NULL);
1879 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1885 /* Line 1806 of yacc.c */
1888 (yyval.menu) = menu_add_menu();
1894 /* Line 1806 of yacc.c */
1897 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) {
1899 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
1906 /* Line 1806 of yacc.c */
1909 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
1910 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1916 /* Line 1806 of yacc.c */
1919 if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) {
1920 menu_set_type((yyvsp[(1) - (3)].id)->stype);
1921 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1922 zconf_curname(), zconf_lineno(),
1923 (yyvsp[(1) - (3)].id)->stype);
1931 /* Line 1806 of yacc.c */
1934 current_entry->sym->flags |= SYMBOL_OPTIONAL;
1935 printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1941 /* Line 1806 of yacc.c */
1944 if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) {
1945 menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
1946 printd(DEBUG_PARSE, "%s:%d:default\n",
1947 zconf_curname(), zconf_lineno());
1955 /* Line 1806 of yacc.c */
1958 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
1959 menu_add_entry(NULL);
1960 menu_add_dep((yyvsp[(2) - (3)].expr));
1961 (yyval.menu) = menu_add_menu();
1967 /* Line 1806 of yacc.c */
1970 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) {
1972 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
1979 /* Line 1806 of yacc.c */
1982 menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1988 /* Line 1806 of yacc.c */
1991 menu_add_entry(NULL);
1992 menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1993 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1999 /* Line 1806 of yacc.c */
2002 (yyval.menu) = menu_add_menu();
2008 /* Line 1806 of yacc.c */
2011 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) {
2013 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
2020 /* Line 1806 of yacc.c */
2023 printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
2024 zconf_nextfile((yyvsp[(2) - (3)].string));
2030 /* Line 1806 of yacc.c */
2033 menu_add_entry(NULL);
2034 menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL);
2035 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
2041 /* Line 1806 of yacc.c */
2050 /* Line 1806 of yacc.c */
2053 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
2060 /* Line 1806 of yacc.c */
2063 current_entry->help = (yyvsp[(2) - (2)].string);
2069 /* Line 1806 of yacc.c */
2072 menu_add_dep((yyvsp[(3) - (4)].expr));
2073 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
2079 /* Line 1806 of yacc.c */
2082 menu_add_visibility((yyvsp[(2) - (2)].expr));
2088 /* Line 1806 of yacc.c */
2091 menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
2097 /* Line 1806 of yacc.c */
2099 { (yyval.id) = (yyvsp[(1) - (2)].id); }
2104 /* Line 1806 of yacc.c */
2106 { (yyval.id) = (yyvsp[(1) - (2)].id); }
2111 /* Line 1806 of yacc.c */
2113 { (yyval.id) = (yyvsp[(1) - (2)].id); }
2118 /* Line 1806 of yacc.c */
2120 { (yyval.expr) = NULL; }
2125 /* Line 1806 of yacc.c */
2127 { (yyval.expr) = (yyvsp[(2) - (2)].expr); }
2132 /* Line 1806 of yacc.c */
2134 { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); }
2139 /* Line 1806 of yacc.c */
2141 { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); }
2146 /* Line 1806 of yacc.c */
2148 { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); }
2153 /* Line 1806 of yacc.c */
2155 { (yyval.expr) = (yyvsp[(2) - (3)].expr); }
2160 /* Line 1806 of yacc.c */
2162 { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); }
2167 /* Line 1806 of yacc.c */
2169 { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
2174 /* Line 1806 of yacc.c */
2176 { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); }
2181 /* Line 1806 of yacc.c */
2183 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); }
2188 /* Line 1806 of yacc.c */
2190 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); }
2195 /* Line 1806 of yacc.c */
2197 { (yyval.string) = NULL; }
2202 /* Line 1806 of yacc.c */
2203 #line 2204 "zconf.tab.c"
2206 /* User semantic actions sometimes alter yychar, and that requires
2207 that yytoken be updated with the new translation. We take the
2208 approach of translating immediately before every use of yytoken.
2209 One alternative is translating here after every semantic action,
2210 but that translation would be missed if the semantic action invokes
2211 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2212 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2213 incorrect destructor might then be invoked immediately. In the
2214 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2215 to an incorrect destructor call or verbose syntax error message
2216 before the lookahead is translated. */
2217 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2221 YY_STACK_PRINT (yyss, yyssp);
2225 /* Now `shift' the result of the reduction. Determine what state
2226 that goes to, based on the state we popped back to and the rule
2227 number reduced by. */
2231 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2232 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2233 yystate = yytable[yystate];
2235 yystate = yydefgoto[yyn - YYNTOKENS];
2240 /*------------------------------------.
2241 | yyerrlab -- here on detecting error |
2242 `------------------------------------*/
2244 /* Make sure we have latest lookahead translation. See comments at
2245 user semantic actions for why this is necessary. */
2246 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2248 /* If not already recovering from an error, report this error. */
2252 #if ! YYERROR_VERBOSE
2253 yyerror (YY_("syntax error"));
2255 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2258 char const *yymsgp = YY_("syntax error");
2259 int yysyntax_error_status;
2260 yysyntax_error_status = YYSYNTAX_ERROR;
2261 if (yysyntax_error_status == 0)
2263 else if (yysyntax_error_status == 1)
2265 if (yymsg != yymsgbuf)
2266 YYSTACK_FREE (yymsg);
2267 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2271 yymsg_alloc = sizeof yymsgbuf;
2272 yysyntax_error_status = 2;
2276 yysyntax_error_status = YYSYNTAX_ERROR;
2281 if (yysyntax_error_status == 2)
2282 goto yyexhaustedlab;
2284 # undef YYSYNTAX_ERROR
2290 if (yyerrstatus == 3)
2292 /* If just tried and failed to reuse lookahead token after an
2293 error, discard it. */
2295 if (yychar <= YYEOF)
2297 /* Return failure if at end of input. */
2298 if (yychar == YYEOF)
2303 yydestruct ("Error: discarding",
2309 /* Else will try to reuse lookahead token after shifting the error
2314 /*---------------------------------------------------.
2315 | yyerrorlab -- error raised explicitly by YYERROR. |
2316 `---------------------------------------------------*/
2319 /* Pacify compilers like GCC when the user code never invokes
2320 YYERROR and the label yyerrorlab therefore never appears in user
2322 if (/*CONSTCOND*/ 0)
2325 /* Do not reclaim the symbols of the rule which action triggered
2329 YY_STACK_PRINT (yyss, yyssp);
2334 /*-------------------------------------------------------------.
2335 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2336 `-------------------------------------------------------------*/
2338 yyerrstatus = 3; /* Each real token shifted decrements this. */
2342 yyn = yypact[yystate];
2343 if (!yypact_value_is_default (yyn))
2346 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2354 /* Pop the current state because it cannot handle the error token. */
2359 yydestruct ("Error: popping",
2360 yystos[yystate], yyvsp);
2363 YY_STACK_PRINT (yyss, yyssp);
2369 /* Shift the error token. */
2370 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2376 /*-------------------------------------.
2377 | yyacceptlab -- YYACCEPT comes here. |
2378 `-------------------------------------*/
2383 /*-----------------------------------.
2384 | yyabortlab -- YYABORT comes here. |
2385 `-----------------------------------*/
2390 #if !defined(yyoverflow) || YYERROR_VERBOSE
2391 /*-------------------------------------------------.
2392 | yyexhaustedlab -- memory exhaustion comes here. |
2393 `-------------------------------------------------*/
2395 yyerror (YY_("memory exhausted"));
2401 if (yychar != YYEMPTY)
2403 /* Make sure we have latest lookahead translation. See comments at
2404 user semantic actions for why this is necessary. */
2405 yytoken = YYTRANSLATE (yychar);
2406 yydestruct ("Cleanup: discarding lookahead",
2409 /* Do not reclaim the symbols of the rule which action triggered
2410 this YYABORT or YYACCEPT. */
2412 YY_STACK_PRINT (yyss, yyssp);
2413 while (yyssp != yyss)
2415 yydestruct ("Cleanup: popping",
2416 yystos[*yyssp], yyvsp);
2421 YYSTACK_FREE (yyss);
2424 if (yymsg != yymsgbuf)
2425 YYSTACK_FREE (yymsg);
2427 /* Make sure YYID is used. */
2428 return YYID (yyresult);
2433 /* Line 2067 of yacc.c */
2437 void conf_parse(const char *name)
2442 zconf_initscan(name);
2446 rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
2448 if (getenv("ZCONF_DEBUG"))
2454 modules_sym = sym_find( "n" );
2456 rootmenu.prompt->text = _(rootmenu.prompt->text);
2457 rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
2459 menu_finalize(&rootmenu);
2460 for_all_symbols(i, sym) {
2461 if (sym_check_deps(sym))
2466 sym_set_change_count(1);
2469 static const char *zconf_tokenname(int token)
2472 case T_MENU: return "menu";
2473 case T_ENDMENU: return "endmenu";
2474 case T_CHOICE: return "choice";
2475 case T_ENDCHOICE: return "endchoice";
2476 case T_IF: return "if";
2477 case T_ENDIF: return "endif";
2478 case T_DEPENDS: return "depends";
2479 case T_VISIBLE: return "visible";
2484 static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken)
2486 if (id->token != endtoken) {
2487 zconf_error("unexpected '%s' within %s block",
2488 kconf_id_strings + id->name, zconf_tokenname(starttoken));
2492 if (current_menu->file != current_file) {
2493 zconf_error("'%s' in different file than '%s'",
2494 kconf_id_strings + id->name, zconf_tokenname(starttoken));
2495 fprintf(stderr, "%s:%d: location of the '%s'\n",
2496 current_menu->file->name, current_menu->lineno,
2497 zconf_tokenname(starttoken));
2504 static void zconfprint(const char *err, ...)
2508 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
2510 vfprintf(stderr, err, ap);
2512 fprintf(stderr, "\n");
2515 static void zconf_error(const char *err, ...)
2520 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
2522 vfprintf(stderr, err, ap);
2524 fprintf(stderr, "\n");
2527 static void zconferror(const char *err)
2529 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
2532 static void print_quoted_string(FILE *out, const char *str)
2538 while ((p = strchr(str, '"'))) {
2541 fprintf(out, "%.*s", len, str);
2549 static void print_symbol(FILE *out, struct menu *menu)
2551 struct symbol *sym = menu->sym;
2552 struct property *prop;
2554 if (sym_is_choice(sym))
2555 fprintf(out, "\nchoice\n");
2557 fprintf(out, "\nconfig %s\n", sym->name);
2558 switch (sym->type) {
2560 fputs(" boolean\n", out);
2563 fputs(" tristate\n", out);
2566 fputs(" string\n", out);
2569 fputs(" integer\n", out);
2572 fputs(" hex\n", out);
2575 fputs(" ???\n", out);
2578 for (prop = sym->prop; prop; prop = prop->next) {
2579 if (prop->menu != menu)
2581 switch (prop->type) {
2583 fputs(" prompt ", out);
2584 print_quoted_string(out, prop->text);
2585 if (!expr_is_yes(prop->visible.expr)) {
2587 expr_fprint(prop->visible.expr, out);
2592 fputs( " default ", out);
2593 expr_fprint(prop->expr, out);
2594 if (!expr_is_yes(prop->visible.expr)) {
2596 expr_fprint(prop->visible.expr, out);
2601 fputs(" #choice value\n", out);
2604 fputs( " select ", out);
2605 expr_fprint(prop->expr, out);
2607 fputs(" (value=", out);
2608 expr_fprint(prop->value, out);
2611 if (!expr_is_yes(prop->visible.expr)) {
2613 expr_fprint(prop->visible.expr, out);
2618 fputs( " range ", out);
2619 expr_fprint(prop->expr, out);
2623 fputs( " menu ", out);
2624 print_quoted_string(out, prop->text);
2628 fprintf(out, " unknown prop %d!\n", prop->type);
2633 int len = strlen(menu->help);
2634 while (menu->help[--len] == '\n')
2635 menu->help[len] = 0;
2636 fprintf(out, " help\n%s\n", menu->help);
2640 void zconfdump(FILE *out)
2642 struct property *prop;
2646 menu = rootmenu.list;
2648 if ((sym = menu->sym))
2649 print_symbol(out, menu);
2650 else if ((prop = menu->prompt)) {
2651 switch (prop->type) {
2653 fputs("\ncomment ", out);
2654 print_quoted_string(out, prop->text);
2658 fputs("\nmenu ", out);
2659 print_quoted_string(out, prop->text);
2665 if (!expr_is_yes(prop->visible.expr)) {
2666 fputs(" depends ", out);
2667 expr_fprint(prop->visible.expr, out);
2674 else if (menu->next)
2676 else while ((menu = menu->parent)) {
2677 if (menu->prompt && menu->prompt->type == P_MENU)
2678 fputs("\nendmenu\n", out);
2687 #include "zconf.lex.c"
2689 #include "confdata.c"