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 zconfparse
68 #define yylex zconflex
69 #define yyerror zconferror
70 #define yylval zconflval
71 #define yychar zconfchar
72 #define yydebug zconfdebug
73 #define yynerrs zconfnerrs
76 /* Copy the first part of user declarations. */
80 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
81 * Released under the terms of the GNU GPL v2.0.
91 #define LKC_DIRECT_LINK
94 #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
97 #define DEBUG_PARSE 0x0002
101 extern int zconflex(void);
102 static void zconfprint(const char *err, ...);
103 static void zconf_error(const char *err, ...);
104 static void zconferror(const char *err);
105 static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken);
107 struct symbol *symbol_hash[SYMBOL_HASHSIZE];
109 static struct menu *current_menu, *current_entry;
113 #define YYERROR_VERBOSE
118 /* Enabling traces. */
123 /* Enabling verbose error messages. */
124 #ifdef YYERROR_VERBOSE
125 # undef YYERROR_VERBOSE
126 # define YYERROR_VERBOSE 1
128 # define YYERROR_VERBOSE 0
131 /* Enabling the token table. */
132 #ifndef YYTOKEN_TABLE
133 # define YYTOKEN_TABLE 0
140 /* Put the tokens into the symbol table, so that GDB and other debuggers
180 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
181 typedef union YYSTYPE
187 struct symbol *symbol;
195 # define YYSTYPE_IS_TRIVIAL 1
196 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
197 # define YYSTYPE_IS_DECLARED 1
201 /* Copy the second part of user declarations. */
204 /* Include zconf.hash.c here so it can see the token constants. */
205 #include "zconf.hash.c"
214 typedef YYTYPE_UINT8 yytype_uint8;
216 typedef unsigned char yytype_uint8;
220 typedef YYTYPE_INT8 yytype_int8;
221 #elif (defined __STDC__ || defined __C99__FUNC__ \
222 || defined __cplusplus || defined _MSC_VER)
223 typedef signed char yytype_int8;
225 typedef short int yytype_int8;
229 typedef YYTYPE_UINT16 yytype_uint16;
231 typedef unsigned short int yytype_uint16;
235 typedef YYTYPE_INT16 yytype_int16;
237 typedef short int yytype_int16;
241 # ifdef __SIZE_TYPE__
242 # define YYSIZE_T __SIZE_TYPE__
243 # elif defined size_t
244 # define YYSIZE_T size_t
245 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
246 || defined __cplusplus || defined _MSC_VER)
247 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
248 # define YYSIZE_T size_t
250 # define YYSIZE_T unsigned int
254 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
259 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
260 # define YY_(msgid) dgettext ("bison-runtime", msgid)
264 # define YY_(msgid) msgid
268 /* Suppress unused-variable warnings by "using" E. */
269 #if ! defined lint || defined __GNUC__
270 # define YYUSE(e) ((void) (e))
272 # define YYUSE(e) /* empty */
275 /* Identity function, used to suppress warnings about constant conditions. */
279 #if (defined __STDC__ || defined __C99__FUNC__ \
280 || defined __cplusplus || defined _MSC_VER)
293 #if ! defined yyoverflow || YYERROR_VERBOSE
295 /* The parser invokes alloca or malloc; define the necessary symbols. */
297 # ifdef YYSTACK_USE_ALLOCA
298 # if YYSTACK_USE_ALLOCA
300 # define YYSTACK_ALLOC __builtin_alloca
301 # elif defined __BUILTIN_VA_ARG_INCR
302 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
304 # define YYSTACK_ALLOC __alloca
305 # elif defined _MSC_VER
306 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
307 # define alloca _alloca
309 # define YYSTACK_ALLOC alloca
310 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
311 || defined __cplusplus || defined _MSC_VER)
312 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
321 # ifdef YYSTACK_ALLOC
322 /* Pacify GCC's `empty if-body' warning. */
323 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
324 # ifndef YYSTACK_ALLOC_MAXIMUM
325 /* The OS might guarantee only one guard page at the bottom of the stack,
326 and a page size can be as small as 4096 bytes. So we cannot safely
327 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
328 to allow for a few compiler-allocated temporary stack slots. */
329 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
332 # define YYSTACK_ALLOC YYMALLOC
333 # define YYSTACK_FREE YYFREE
334 # ifndef YYSTACK_ALLOC_MAXIMUM
335 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
337 # if (defined __cplusplus && ! defined _STDLIB_H \
338 && ! ((defined YYMALLOC || defined malloc) \
339 && (defined YYFREE || defined free)))
340 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
346 # define YYMALLOC malloc
347 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
348 || defined __cplusplus || defined _MSC_VER)
349 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
354 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
355 || defined __cplusplus || defined _MSC_VER)
356 void free (void *); /* INFRINGES ON USER NAME SPACE */
360 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
363 #if (! defined yyoverflow \
364 && (! defined __cplusplus \
365 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
367 /* A type that is properly aligned for any stack member. */
370 yytype_int16 yyss_alloc;
374 /* The size of the maximum gap between one aligned stack and the next. */
375 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
377 /* The size of an array large to enough to hold all stacks, each with
379 # define YYSTACK_BYTES(N) \
380 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
381 + YYSTACK_GAP_MAXIMUM)
383 /* Copy COUNT objects from FROM to TO. The source and destination do
386 # if defined __GNUC__ && 1 < __GNUC__
387 # define YYCOPY(To, From, Count) \
388 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
390 # define YYCOPY(To, From, Count) \
394 for (yyi = 0; yyi < (Count); yyi++) \
395 (To)[yyi] = (From)[yyi]; \
401 /* Relocate STACK from its old location to the new one. The
402 local variables YYSIZE and YYSTACKSIZE give the old and new number of
403 elements in the stack, and YYPTR gives the new location of the
404 stack. Advance YYPTR to a properly aligned location for the next
406 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
409 YYSIZE_T yynewbytes; \
410 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
411 Stack = &yyptr->Stack_alloc; \
412 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
413 yyptr += yynewbytes / sizeof (*yyptr); \
419 /* YYFINAL -- State number of the termination state. */
421 /* YYLAST -- Last index in YYTABLE. */
424 /* YYNTOKENS -- Number of terminals. */
426 /* YYNNTS -- Number of nonterminals. */
428 /* YYNRULES -- Number of rules. */
430 /* YYNRULES -- Number of states. */
431 #define YYNSTATES 180
433 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
435 #define YYMAXUTOK 289
437 #define YYTRANSLATE(YYX) \
438 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
440 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
441 static const yytype_uint8 yytranslate[] =
443 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 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, 1, 2, 3, 4,
469 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
470 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
471 25, 26, 27, 28, 29, 30, 31, 32, 33, 34
475 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
477 static const yytype_uint16 yyprhs[] =
479 0, 0, 3, 5, 6, 9, 12, 15, 20, 23,
480 28, 33, 37, 39, 41, 43, 45, 47, 49, 51,
481 53, 55, 57, 59, 61, 63, 67, 70, 74, 77,
482 81, 84, 85, 88, 91, 94, 97, 100, 103, 107,
483 112, 117, 122, 128, 132, 133, 137, 138, 141, 145,
484 148, 150, 154, 155, 158, 161, 164, 167, 170, 175,
485 179, 182, 187, 188, 191, 195, 197, 201, 202, 205,
486 208, 211, 215, 218, 220, 224, 225, 228, 231, 234,
487 238, 242, 245, 248, 251, 252, 255, 258, 261, 266,
488 267, 270, 272, 274, 277, 280, 283, 285, 288, 289,
489 292, 294, 298, 302, 306, 309, 313, 317, 319, 321,
493 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
494 static const yytype_int8 yyrhs[] =
496 36, 0, -1, 37, -1, -1, 37, 39, -1, 37,
497 53, -1, 37, 64, -1, 37, 3, 74, 76, -1,
498 37, 75, -1, 37, 25, 1, 30, -1, 37, 38,
499 1, 30, -1, 37, 1, 30, -1, 16, -1, 18,
500 -1, 19, -1, 21, -1, 17, -1, 22, -1, 20,
501 -1, 30, -1, 59, -1, 68, -1, 42, -1, 44,
502 -1, 66, -1, 25, 1, 30, -1, 1, 30, -1,
503 10, 25, 30, -1, 41, 45, -1, 11, 25, 30,
504 -1, 43, 45, -1, -1, 45, 46, -1, 45, 47,
505 -1, 45, 72, -1, 45, 70, -1, 45, 40, -1,
506 45, 30, -1, 19, 73, 30, -1, 18, 74, 77,
507 30, -1, 20, 78, 77, 30, -1, 21, 25, 77,
508 30, -1, 22, 79, 79, 77, 30, -1, 23, 48,
509 30, -1, -1, 48, 25, 49, -1, -1, 33, 74,
510 -1, 7, 80, 30, -1, 50, 54, -1, 75, -1,
511 51, 56, 52, -1, -1, 54, 55, -1, 54, 72,
512 -1, 54, 70, -1, 54, 30, -1, 54, 40, -1,
513 18, 74, 77, 30, -1, 19, 73, 30, -1, 17,
514 30, -1, 20, 25, 77, 30, -1, -1, 56, 39,
515 -1, 14, 78, 76, -1, 75, -1, 57, 60, 58,
516 -1, -1, 60, 39, -1, 60, 64, -1, 60, 53,
517 -1, 4, 74, 30, -1, 61, 71, -1, 75, -1,
518 62, 65, 63, -1, -1, 65, 39, -1, 65, 64,
519 -1, 65, 53, -1, 6, 74, 30, -1, 9, 74,
520 30, -1, 67, 71, -1, 12, 30, -1, 69, 13,
521 -1, -1, 71, 72, -1, 71, 30, -1, 71, 40,
522 -1, 16, 24, 78, 30, -1, -1, 74, 77, -1,
523 25, -1, 26, -1, 5, 30, -1, 8, 30, -1,
524 15, 30, -1, 30, -1, 76, 30, -1, -1, 14,
525 78, -1, 79, -1, 79, 33, 79, -1, 79, 27,
526 79, -1, 29, 78, 28, -1, 34, 78, -1, 78,
527 31, 78, -1, 78, 32, 78, -1, 25, -1, 26,
531 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
532 static const yytype_uint16 yyrline[] =
534 0, 107, 107, 109, 111, 112, 113, 114, 115, 116,
535 117, 121, 125, 125, 125, 125, 125, 125, 125, 129,
536 130, 131, 132, 133, 134, 138, 139, 145, 153, 159,
537 167, 177, 179, 180, 181, 182, 183, 184, 187, 195,
538 201, 211, 217, 223, 226, 228, 239, 240, 245, 254,
539 259, 267, 270, 272, 273, 274, 275, 276, 279, 285,
540 296, 302, 312, 314, 319, 327, 335, 338, 340, 341,
541 342, 347, 354, 359, 367, 370, 372, 373, 374, 377,
542 385, 392, 399, 405, 412, 414, 415, 416, 419, 427,
543 429, 434, 435, 438, 439, 440, 444, 445, 448, 449,
544 452, 453, 454, 455, 456, 457, 458, 461, 462, 465,
549 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
550 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
551 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
552 static const char *const yytname[] =
554 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
555 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
556 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
557 "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE",
558 "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
559 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
560 "T_NOT", "$accept", "input", "stmt_list", "option_name", "common_stmt",
561 "option_error", "config_entry_start", "config_stmt",
562 "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
563 "config_option", "symbol_option", "symbol_option_list",
564 "symbol_option_arg", "choice", "choice_entry", "choice_end",
565 "choice_stmt", "choice_option_list", "choice_option", "choice_block",
566 "if_entry", "if_end", "if_stmt", "if_block", "menu", "menu_entry",
567 "menu_end", "menu_stmt", "menu_block", "source_stmt", "comment",
568 "comment_stmt", "help_start", "help", "depends_list", "depends",
569 "prompt_stmt_opt", "prompt", "end", "nl", "if_expr", "expr", "symbol",
575 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
577 static const yytype_uint16 yytoknum[] =
579 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
580 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
581 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
582 285, 286, 287, 288, 289
586 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
587 static const yytype_uint8 yyr1[] =
589 0, 35, 36, 37, 37, 37, 37, 37, 37, 37,
590 37, 37, 38, 38, 38, 38, 38, 38, 38, 39,
591 39, 39, 39, 39, 39, 40, 40, 41, 42, 43,
592 44, 45, 45, 45, 45, 45, 45, 45, 46, 46,
593 46, 46, 46, 47, 48, 48, 49, 49, 50, 51,
594 52, 53, 54, 54, 54, 54, 54, 54, 55, 55,
595 55, 55, 56, 56, 57, 58, 59, 60, 60, 60,
596 60, 61, 62, 63, 64, 65, 65, 65, 65, 66,
597 67, 68, 69, 70, 71, 71, 71, 71, 72, 73,
598 73, 74, 74, 75, 75, 75, 76, 76, 77, 77,
599 78, 78, 78, 78, 78, 78, 78, 79, 79, 80,
603 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
604 static const yytype_uint8 yyr2[] =
606 0, 2, 1, 0, 2, 2, 2, 4, 2, 4,
607 4, 3, 1, 1, 1, 1, 1, 1, 1, 1,
608 1, 1, 1, 1, 1, 3, 2, 3, 2, 3,
609 2, 0, 2, 2, 2, 2, 2, 2, 3, 4,
610 4, 4, 5, 3, 0, 3, 0, 2, 3, 2,
611 1, 3, 0, 2, 2, 2, 2, 2, 4, 3,
612 2, 4, 0, 2, 3, 1, 3, 0, 2, 2,
613 2, 3, 2, 1, 3, 0, 2, 2, 2, 3,
614 3, 2, 2, 2, 0, 2, 2, 2, 4, 0,
615 2, 1, 1, 2, 2, 2, 1, 2, 0, 2,
616 1, 3, 3, 3, 2, 3, 3, 1, 1, 0,
620 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
621 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
622 means the default is an error. */
623 static const yytype_uint8 yydefact[] =
625 3, 0, 0, 1, 0, 0, 0, 0, 0, 109,
626 0, 0, 0, 0, 0, 0, 12, 16, 13, 14,
627 18, 15, 17, 0, 19, 0, 4, 31, 22, 31,
628 23, 52, 62, 5, 67, 20, 84, 75, 6, 24,
629 84, 21, 8, 11, 91, 92, 0, 0, 93, 0,
630 110, 0, 94, 0, 0, 0, 107, 108, 0, 0,
631 0, 100, 95, 0, 0, 0, 0, 0, 0, 0,
632 0, 0, 0, 96, 7, 71, 79, 48, 80, 27,
633 29, 0, 104, 0, 0, 64, 0, 0, 9, 10,
634 0, 0, 0, 0, 89, 0, 0, 0, 44, 0,
635 37, 36, 32, 33, 0, 35, 34, 0, 0, 89,
636 0, 56, 57, 53, 55, 54, 63, 51, 50, 68,
637 70, 66, 69, 65, 86, 87, 85, 76, 78, 74,
638 77, 73, 97, 103, 105, 106, 102, 101, 26, 82,
639 0, 98, 0, 98, 98, 98, 0, 0, 0, 83,
640 60, 98, 0, 98, 0, 0, 0, 38, 90, 0,
641 0, 98, 46, 43, 25, 0, 59, 0, 88, 99,
642 39, 40, 41, 0, 0, 45, 58, 61, 42, 47
645 /* YYDEFGOTO[NTERM-NUM]. */
646 static const yytype_int16 yydefgoto[] =
648 -1, 1, 2, 25, 26, 101, 27, 28, 29, 30,
649 65, 102, 103, 147, 175, 31, 32, 117, 33, 67,
650 113, 68, 34, 121, 35, 69, 36, 37, 129, 38,
651 71, 39, 40, 41, 104, 105, 70, 106, 142, 143,
652 42, 74, 156, 60, 61, 51
655 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
657 #define YYPACT_NINF -80
658 static const yytype_int16 yypact[] =
660 -80, 2, 132, -80, -13, -1, -1, -2, -1, 9,
661 33, -1, 27, 40, -3, 38, -80, -80, -80, -80,
662 -80, -80, -80, 71, -80, 77, -80, -80, -80, -80,
663 -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
664 -80, -80, -80, -80, -80, -80, 57, 61, -80, 63,
665 -80, 76, -80, 87, 101, 133, -80, -80, -3, -3,
666 195, -6, -80, 136, 149, 39, 104, 65, 150, 5,
667 194, 5, 167, -80, 176, -80, -80, -80, -80, -80,
668 -80, 68, -80, -3, -3, 176, 72, 72, -80, -80,
669 177, 187, 78, -1, -1, -3, 196, 72, -80, 222,
670 -80, -80, -80, -80, 221, -80, -80, 205, -1, -1,
671 211, -80, -80, -80, -80, -80, -80, -80, -80, -80,
672 -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
673 -80, -80, -80, -80, 206, -80, -80, -80, -80, -80,
674 -3, 223, 209, 223, 197, 223, 72, 7, 210, -80,
675 -80, 223, 212, 223, 201, -3, 213, -80, -80, 214,
676 215, 223, 208, -80, -80, 216, -80, 217, -80, 113,
677 -80, -80, -80, 218, -1, -80, -80, -80, -80, -80
680 /* YYPGOTO[NTERM-NUM]. */
681 static const yytype_int16 yypgoto[] =
683 -80, -80, -80, -80, 122, -34, -80, -80, -80, -80,
684 220, -80, -80, -80, -80, -80, -80, -80, 59, -80,
685 -80, -80, -80, -80, -80, -80, -80, -80, -80, 125,
686 -80, -80, -80, -80, -80, 183, 219, 22, 142, -5,
687 147, 192, 69, -54, -79, -80
690 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
691 positive, shift that token. If negative, reduce the rule which
692 number is the opposite. If zero, do what YYDEFACT says.
693 If YYTABLE_NINF, syntax error. */
694 #define YYTABLE_NINF -82
695 static const yytype_int16 yytable[] =
697 46, 47, 3, 49, 81, 82, 53, 136, 137, 6,
698 7, 8, 9, 10, 11, 12, 13, 43, 146, 14,
699 15, 86, 56, 57, 44, 45, 58, 87, 48, 134,
700 135, 59, 162, 112, 50, 24, 125, 163, 125, -28,
701 90, 144, -28, -28, -28, -28, -28, -28, -28, -28,
702 -28, 91, 54, -28, -28, 92, -28, 93, 94, 95,
703 96, 97, 98, 52, 99, 55, 90, 161, 62, 100,
704 -49, -49, 63, -49, -49, -49, -49, 91, 64, -49,
705 -49, 92, 107, 108, 109, 110, 154, 73, 141, 115,
706 99, 75, 126, 76, 126, 111, 133, 56, 57, 83,
707 84, 169, 140, 151, -30, 90, 77, -30, -30, -30,
708 -30, -30, -30, -30, -30, -30, 91, 78, -30, -30,
709 92, -30, 93, 94, 95, 96, 97, 98, 120, 99,
710 128, 79, -2, 4, 100, 5, 6, 7, 8, 9,
711 10, 11, 12, 13, 83, 84, 14, 15, 16, 17,
712 18, 19, 20, 21, 22, 7, 8, 23, 10, 11,
713 12, 13, 24, 80, 14, 15, 88, -81, 90, 179,
714 -81, -81, -81, -81, -81, -81, -81, -81, -81, 89,
715 24, -81, -81, 92, -81, -81, -81, -81, -81, -81,
716 116, 119, 99, 127, 122, 90, 130, 124, -72, -72,
717 -72, -72, -72, -72, -72, -72, 132, 138, -72, -72,
718 92, 155, 158, 159, 160, 118, 123, 139, 131, 99,
719 165, 145, 167, 148, 124, 73, 83, 84, 83, 84,
720 173, 168, 83, 84, 149, 150, 153, 155, 84, 157,
721 164, 174, 166, 170, 171, 172, 176, 177, 178, 66,
722 114, 152, 85, 0, 0, 0, 0, 0, 0, 72
725 static const yytype_int16 yycheck[] =
727 5, 6, 0, 8, 58, 59, 11, 86, 87, 4,
728 5, 6, 7, 8, 9, 10, 11, 30, 97, 14,
729 15, 27, 25, 26, 25, 26, 29, 33, 30, 83,
730 84, 34, 25, 67, 25, 30, 70, 30, 72, 0,
731 1, 95, 3, 4, 5, 6, 7, 8, 9, 10,
732 11, 12, 25, 14, 15, 16, 17, 18, 19, 20,
733 21, 22, 23, 30, 25, 25, 1, 146, 30, 30,
734 5, 6, 1, 8, 9, 10, 11, 12, 1, 14,
735 15, 16, 17, 18, 19, 20, 140, 30, 93, 67,
736 25, 30, 70, 30, 72, 30, 28, 25, 26, 31,
737 32, 155, 24, 108, 0, 1, 30, 3, 4, 5,
738 6, 7, 8, 9, 10, 11, 12, 30, 14, 15,
739 16, 17, 18, 19, 20, 21, 22, 23, 69, 25,
740 71, 30, 0, 1, 30, 3, 4, 5, 6, 7,
741 8, 9, 10, 11, 31, 32, 14, 15, 16, 17,
742 18, 19, 20, 21, 22, 5, 6, 25, 8, 9,
743 10, 11, 30, 30, 14, 15, 30, 0, 1, 174,
744 3, 4, 5, 6, 7, 8, 9, 10, 11, 30,
745 30, 14, 15, 16, 17, 18, 19, 20, 21, 22,
746 68, 69, 25, 71, 69, 1, 71, 30, 4, 5,
747 6, 7, 8, 9, 10, 11, 30, 30, 14, 15,
748 16, 14, 143, 144, 145, 68, 69, 30, 71, 25,
749 151, 25, 153, 1, 30, 30, 31, 32, 31, 32,
750 161, 30, 31, 32, 13, 30, 25, 14, 32, 30,
751 30, 33, 30, 30, 30, 30, 30, 30, 30, 29,
752 67, 109, 60, -1, -1, -1, -1, -1, -1, 40
755 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
756 symbol of state STATE-NUM. */
757 static const yytype_uint8 yystos[] =
759 0, 36, 37, 0, 1, 3, 4, 5, 6, 7,
760 8, 9, 10, 11, 14, 15, 16, 17, 18, 19,
761 20, 21, 22, 25, 30, 38, 39, 41, 42, 43,
762 44, 50, 51, 53, 57, 59, 61, 62, 64, 66,
763 67, 68, 75, 30, 25, 26, 74, 74, 30, 74,
764 25, 80, 30, 74, 25, 25, 25, 26, 29, 34,
765 78, 79, 30, 1, 1, 45, 45, 54, 56, 60,
766 71, 65, 71, 30, 76, 30, 30, 30, 30, 30,
767 30, 78, 78, 31, 32, 76, 27, 33, 30, 30,
768 1, 12, 16, 18, 19, 20, 21, 22, 23, 25,
769 30, 40, 46, 47, 69, 70, 72, 17, 18, 19,
770 20, 30, 40, 55, 70, 72, 39, 52, 75, 39,
771 53, 58, 64, 75, 30, 40, 72, 39, 53, 63,
772 64, 75, 30, 28, 78, 78, 79, 79, 30, 30,
773 24, 74, 73, 74, 78, 25, 79, 48, 1, 13,
774 30, 74, 73, 25, 78, 14, 77, 30, 77, 77,
775 77, 79, 25, 30, 30, 77, 30, 77, 30, 78,
776 30, 30, 30, 77, 33, 49, 30, 30, 30, 74
779 #define yyerrok (yyerrstatus = 0)
780 #define yyclearin (yychar = YYEMPTY)
784 #define YYACCEPT goto yyacceptlab
785 #define YYABORT goto yyabortlab
786 #define YYERROR goto yyerrorlab
789 /* Like YYERROR except do call yyerror. This remains here temporarily
790 to ease the transition to the new meaning of YYERROR, for GCC.
791 Once GCC version 2 has supplanted version 1, this can go. */
793 #define YYFAIL goto yyerrlab
795 #define YYRECOVERING() (!!yyerrstatus)
797 #define YYBACKUP(Token, Value) \
799 if (yychar == YYEMPTY && yylen == 1) \
803 yytoken = YYTRANSLATE (yychar); \
809 yyerror (YY_("syntax error: cannot back up")); \
816 #define YYERRCODE 256
819 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
820 If N is 0, then set CURRENT to the empty location which ends
821 the previous symbol: RHS[0] (always defined). */
823 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
824 #ifndef YYLLOC_DEFAULT
825 # define YYLLOC_DEFAULT(Current, Rhs, N) \
829 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
830 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
831 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
832 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
836 (Current).first_line = (Current).last_line = \
837 YYRHSLOC (Rhs, 0).last_line; \
838 (Current).first_column = (Current).last_column = \
839 YYRHSLOC (Rhs, 0).last_column; \
845 /* YY_LOCATION_PRINT -- Print the location on the stream.
846 This macro was not mandated originally: define only if we know
847 we won't break user code: when these are the locations we know. */
849 #ifndef YY_LOCATION_PRINT
850 # if YYLTYPE_IS_TRIVIAL
851 # define YY_LOCATION_PRINT(File, Loc) \
852 fprintf (File, "%d.%d-%d.%d", \
853 (Loc).first_line, (Loc).first_column, \
854 (Loc).last_line, (Loc).last_column)
856 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
861 /* YYLEX -- calling `yylex' with the right arguments. */
864 # define YYLEX yylex (YYLEX_PARAM)
866 # define YYLEX yylex ()
869 /* Enable debugging if requested. */
873 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
874 # define YYFPRINTF fprintf
877 # define YYDPRINTF(Args) \
883 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
887 YYFPRINTF (stderr, "%s ", Title); \
888 yy_symbol_print (stderr, \
890 YYFPRINTF (stderr, "\n"); \
895 /*--------------------------------.
896 | Print this symbol on YYOUTPUT. |
897 `--------------------------------*/
900 #if (defined __STDC__ || defined __C99__FUNC__ \
901 || defined __cplusplus || defined _MSC_VER)
903 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
906 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
909 YYSTYPE const * const yyvaluep;
915 if (yytype < YYNTOKENS)
916 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
928 /*--------------------------------.
929 | Print this symbol on YYOUTPUT. |
930 `--------------------------------*/
932 #if (defined __STDC__ || defined __C99__FUNC__ \
933 || defined __cplusplus || defined _MSC_VER)
935 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
938 yy_symbol_print (yyoutput, yytype, yyvaluep)
941 YYSTYPE const * const yyvaluep;
944 if (yytype < YYNTOKENS)
945 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
947 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
949 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
950 YYFPRINTF (yyoutput, ")");
953 /*------------------------------------------------------------------.
954 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
956 `------------------------------------------------------------------*/
958 #if (defined __STDC__ || defined __C99__FUNC__ \
959 || defined __cplusplus || defined _MSC_VER)
961 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
964 yy_stack_print (yybottom, yytop)
965 yytype_int16 *yybottom;
969 YYFPRINTF (stderr, "Stack now");
970 for (; yybottom <= yytop; yybottom++)
972 int yybot = *yybottom;
973 YYFPRINTF (stderr, " %d", yybot);
975 YYFPRINTF (stderr, "\n");
978 # define YY_STACK_PRINT(Bottom, Top) \
981 yy_stack_print ((Bottom), (Top)); \
985 /*------------------------------------------------.
986 | Report that the YYRULE is going to be reduced. |
987 `------------------------------------------------*/
989 #if (defined __STDC__ || defined __C99__FUNC__ \
990 || defined __cplusplus || defined _MSC_VER)
992 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
995 yy_reduce_print (yyvsp, yyrule)
1000 int yynrhs = yyr2[yyrule];
1002 unsigned long int yylno = yyrline[yyrule];
1003 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1005 /* The symbols being reduced. */
1006 for (yyi = 0; yyi < yynrhs; yyi++)
1008 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1009 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1010 &(yyvsp[(yyi + 1) - (yynrhs)])
1012 YYFPRINTF (stderr, "\n");
1016 # define YY_REDUCE_PRINT(Rule) \
1019 yy_reduce_print (yyvsp, Rule); \
1022 /* Nonzero means print parse trace. It is left uninitialized so that
1023 multiple parsers can coexist. */
1025 #else /* !YYDEBUG */
1026 # define YYDPRINTF(Args)
1027 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1028 # define YY_STACK_PRINT(Bottom, Top)
1029 # define YY_REDUCE_PRINT(Rule)
1030 #endif /* !YYDEBUG */
1033 /* YYINITDEPTH -- initial size of the parser's stacks. */
1035 # define YYINITDEPTH 200
1038 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1039 if the built-in stack extension method is used).
1041 Do not make this value too large; the results are undefined if
1042 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1043 evaluated with infinite-precision integer arithmetic. */
1046 # define YYMAXDEPTH 10000
1054 # if defined __GLIBC__ && defined _STRING_H
1055 # define yystrlen strlen
1057 /* Return the length of YYSTR. */
1058 #if (defined __STDC__ || defined __C99__FUNC__ \
1059 || defined __cplusplus || defined _MSC_VER)
1061 yystrlen (const char *yystr)
1069 for (yylen = 0; yystr[yylen]; yylen++)
1077 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1078 # define yystpcpy stpcpy
1080 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1082 #if (defined __STDC__ || defined __C99__FUNC__ \
1083 || defined __cplusplus || defined _MSC_VER)
1085 yystpcpy (char *yydest, const char *yysrc)
1088 yystpcpy (yydest, yysrc)
1094 const char *yys = yysrc;
1096 while ((*yyd++ = *yys++) != '\0')
1105 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1106 quotes and backslashes, so that it's suitable for yyerror. The
1107 heuristic is that double-quoting is unnecessary unless the string
1108 contains an apostrophe, a comma, or backslash (other than
1109 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1110 null, do not copy; instead, return the length of what the result
1113 yytnamerr (char *yyres, const char *yystr)
1118 char const *yyp = yystr;
1125 goto do_not_strip_quotes;
1129 goto do_not_strip_quotes;
1142 do_not_strip_quotes: ;
1146 return yystrlen (yystr);
1148 return yystpcpy (yyres, yystr) - yyres;
1152 /* Copy into YYRESULT an error message about the unexpected token
1153 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1154 including the terminating null byte. If YYRESULT is null, do not
1155 copy anything; just return the number of bytes that would be
1156 copied. As a special case, return 0 if an ordinary "syntax error"
1157 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1158 size calculation. */
1160 yysyntax_error (char *yyresult, int yystate, int yychar)
1162 int yyn = yypact[yystate];
1164 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1168 int yytype = YYTRANSLATE (yychar);
1169 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1170 YYSIZE_T yysize = yysize0;
1172 int yysize_overflow = 0;
1173 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1174 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1178 /* This is so xgettext sees the translatable formats that are
1179 constructed on the fly. */
1180 YY_("syntax error, unexpected %s");
1181 YY_("syntax error, unexpected %s, expecting %s");
1182 YY_("syntax error, unexpected %s, expecting %s or %s");
1183 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1184 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1188 static char const yyunexpected[] = "syntax error, unexpected %s";
1189 static char const yyexpecting[] = ", expecting %s";
1190 static char const yyor[] = " or %s";
1191 char yyformat[sizeof yyunexpected
1192 + sizeof yyexpecting - 1
1193 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1194 * (sizeof yyor - 1))];
1195 char const *yyprefix = yyexpecting;
1197 /* Start YYX at -YYN if negative to avoid negative indexes in
1199 int yyxbegin = yyn < 0 ? -yyn : 0;
1201 /* Stay within bounds of both yycheck and yytname. */
1202 int yychecklim = YYLAST - yyn + 1;
1203 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1206 yyarg[0] = yytname[yytype];
1207 yyfmt = yystpcpy (yyformat, yyunexpected);
1209 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1210 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1212 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1216 yyformat[sizeof yyunexpected - 1] = '\0';
1219 yyarg[yycount++] = yytname[yyx];
1220 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1221 yysize_overflow |= (yysize1 < yysize);
1223 yyfmt = yystpcpy (yyfmt, yyprefix);
1227 yyf = YY_(yyformat);
1228 yysize1 = yysize + yystrlen (yyf);
1229 yysize_overflow |= (yysize1 < yysize);
1232 if (yysize_overflow)
1233 return YYSIZE_MAXIMUM;
1237 /* Avoid sprintf, as that infringes on the user's name space.
1238 Don't have undefined behavior even if the translation
1239 produced a string with the wrong number of "%s"s. */
1240 char *yyp = yyresult;
1242 while ((*yyp = *yyf) != '\0')
1244 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1246 yyp += yytnamerr (yyp, yyarg[yyi++]);
1259 #endif /* YYERROR_VERBOSE */
1262 /*-----------------------------------------------.
1263 | Release the memory associated to this symbol. |
1264 `-----------------------------------------------*/
1267 #if (defined __STDC__ || defined __C99__FUNC__ \
1268 || defined __cplusplus || defined _MSC_VER)
1270 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1273 yydestruct (yymsg, yytype, yyvaluep)
1283 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1287 case 51: /* "choice_entry" */
1290 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1291 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1292 if (current_menu == (yyvaluep->menu))
1297 case 57: /* "if_entry" */
1300 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1301 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1302 if (current_menu == (yyvaluep->menu))
1307 case 62: /* "menu_entry" */
1310 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1311 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1312 if (current_menu == (yyvaluep->menu))
1323 /* Prevent warnings from -Wmissing-prototypes. */
1324 #ifdef YYPARSE_PARAM
1325 #if defined __STDC__ || defined __cplusplus
1326 int yyparse (void *YYPARSE_PARAM);
1330 #else /* ! YYPARSE_PARAM */
1331 #if defined __STDC__ || defined __cplusplus
1336 #endif /* ! YYPARSE_PARAM */
1339 /* The lookahead symbol. */
1342 /* The semantic value of the lookahead symbol. */
1345 /* Number of syntax errors so far. */
1350 /*-------------------------.
1351 | yyparse or yypush_parse. |
1352 `-------------------------*/
1354 #ifdef YYPARSE_PARAM
1355 #if (defined __STDC__ || defined __C99__FUNC__ \
1356 || defined __cplusplus || defined _MSC_VER)
1358 yyparse (void *YYPARSE_PARAM)
1361 yyparse (YYPARSE_PARAM)
1362 void *YYPARSE_PARAM;
1364 #else /* ! YYPARSE_PARAM */
1365 #if (defined __STDC__ || defined __C99__FUNC__ \
1366 || defined __cplusplus || defined _MSC_VER)
1379 /* Number of tokens to shift before error messages enabled. */
1382 /* The stacks and their tools:
1383 `yyss': related to states.
1384 `yyvs': related to semantic values.
1386 Refer to the stacks thru separate pointers, to allow yyoverflow
1387 to reallocate them elsewhere. */
1389 /* The state stack. */
1390 yytype_int16 yyssa[YYINITDEPTH];
1392 yytype_int16 *yyssp;
1394 /* The semantic value stack. */
1395 YYSTYPE yyvsa[YYINITDEPTH];
1399 YYSIZE_T yystacksize;
1403 /* Lookahead token as an internal (translated) token number. */
1405 /* The variables used to return semantic value and location from the
1410 /* Buffer for error messages, and its allocated size. */
1412 char *yymsg = yymsgbuf;
1413 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1416 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1418 /* The number of symbols on the RHS of the reduced rule.
1419 Keep to zero when no symbol should be popped. */
1425 yystacksize = YYINITDEPTH;
1427 YYDPRINTF ((stderr, "Starting parse\n"));
1432 yychar = YYEMPTY; /* Cause a token to be read. */
1434 /* Initialize stack pointers.
1435 Waste one element of value and location stack
1436 so that they stay on the same level as the state stack.
1437 The wasted elements are never initialized. */
1443 /*------------------------------------------------------------.
1444 | yynewstate -- Push a new state, which is found in yystate. |
1445 `------------------------------------------------------------*/
1447 /* In all cases, when you get here, the value and location stacks
1448 have just been pushed. So pushing a state here evens the stacks. */
1454 if (yyss + yystacksize - 1 <= yyssp)
1456 /* Get the current used size of the three stacks, in elements. */
1457 YYSIZE_T yysize = yyssp - yyss + 1;
1461 /* Give user a chance to reallocate the stack. Use copies of
1462 these so that the &'s don't force the real ones into
1464 YYSTYPE *yyvs1 = yyvs;
1465 yytype_int16 *yyss1 = yyss;
1467 /* Each stack pointer address is followed by the size of the
1468 data in use in that stack, in bytes. This used to be a
1469 conditional around just the two extra args, but that might
1470 be undefined if yyoverflow is a macro. */
1471 yyoverflow (YY_("memory exhausted"),
1472 &yyss1, yysize * sizeof (*yyssp),
1473 &yyvs1, yysize * sizeof (*yyvsp),
1479 #else /* no yyoverflow */
1480 # ifndef YYSTACK_RELOCATE
1481 goto yyexhaustedlab;
1483 /* Extend the stack our own way. */
1484 if (YYMAXDEPTH <= yystacksize)
1485 goto yyexhaustedlab;
1487 if (YYMAXDEPTH < yystacksize)
1488 yystacksize = YYMAXDEPTH;
1491 yytype_int16 *yyss1 = yyss;
1492 union yyalloc *yyptr =
1493 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1495 goto yyexhaustedlab;
1496 YYSTACK_RELOCATE (yyss_alloc, yyss);
1497 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1498 # undef YYSTACK_RELOCATE
1500 YYSTACK_FREE (yyss1);
1503 #endif /* no yyoverflow */
1505 yyssp = yyss + yysize - 1;
1506 yyvsp = yyvs + yysize - 1;
1508 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1509 (unsigned long int) yystacksize));
1511 if (yyss + yystacksize - 1 <= yyssp)
1515 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1517 if (yystate == YYFINAL)
1527 /* Do appropriate processing given the current state. Read a
1528 lookahead token if we need one and don't already have one. */
1530 /* First try to decide what to do without reference to lookahead token. */
1531 yyn = yypact[yystate];
1532 if (yyn == YYPACT_NINF)
1535 /* Not known => get a lookahead token if don't already have one. */
1537 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1538 if (yychar == YYEMPTY)
1540 YYDPRINTF ((stderr, "Reading a token: "));
1544 if (yychar <= YYEOF)
1546 yychar = yytoken = YYEOF;
1547 YYDPRINTF ((stderr, "Now at end of input.\n"));
1551 yytoken = YYTRANSLATE (yychar);
1552 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1555 /* If the proper action on seeing token YYTOKEN is to reduce or to
1556 detect an error, take that action. */
1558 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1563 if (yyn == 0 || yyn == YYTABLE_NINF)
1569 /* Count tokens shifted since error; after three, turn off error
1574 /* Shift the lookahead token. */
1575 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1577 /* Discard the shifted token. */
1586 /*-----------------------------------------------------------.
1587 | yydefault -- do the default action for the current state. |
1588 `-----------------------------------------------------------*/
1590 yyn = yydefact[yystate];
1596 /*-----------------------------.
1597 | yyreduce -- Do a reduction. |
1598 `-----------------------------*/
1600 /* yyn is the number of a rule to reduce with. */
1603 /* If YYLEN is nonzero, implement the default value of the action:
1606 Otherwise, the following line sets YYVAL to garbage.
1607 This behavior is undocumented and Bison
1608 users should not rely upon it. Assigning to YYVAL
1609 unconditionally makes the parser a bit smaller, and it avoids a
1610 GCC warning that YYVAL may be used uninitialized. */
1611 yyval = yyvsp[1-yylen];
1614 YY_REDUCE_PRINT (yyn);
1619 { zconf_error("unexpected end statement"); ;}
1624 { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;}
1630 zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
1636 { zconf_error("invalid statement"); ;}
1641 { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;}
1646 { zconf_error("invalid option"); ;}
1652 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
1653 sym->flags |= SYMBOL_OPTIONAL;
1654 menu_add_entry(sym);
1655 printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1663 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1670 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
1671 sym->flags |= SYMBOL_OPTIONAL;
1672 menu_add_entry(sym);
1673 printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1680 if (current_entry->prompt)
1681 current_entry->prompt->type = P_MENU;
1683 zconfprint("warning: menuconfig statement without prompt");
1685 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1692 menu_set_type((yyvsp[(1) - (3)].id)->stype);
1693 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1694 zconf_curname(), zconf_lineno(),
1695 (yyvsp[(1) - (3)].id)->stype);
1702 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
1703 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1710 menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr));
1711 if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN)
1712 menu_set_type((yyvsp[(1) - (4)].id)->stype);
1713 printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
1714 zconf_curname(), zconf_lineno(),
1715 (yyvsp[(1) - (4)].id)->stype);
1722 menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
1723 printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1730 menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr));
1731 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1738 struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
1739 if (id && id->flags & TF_OPTION)
1740 menu_add_option(id->token, (yyvsp[(3) - (3)].string));
1742 zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string));
1743 free((yyvsp[(2) - (3)].string));
1749 { (yyval.string) = NULL; ;}
1754 { (yyval.string) = (yyvsp[(2) - (2)].string); ;}
1760 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE);
1761 sym->flags |= SYMBOL_AUTO;
1762 menu_add_entry(sym);
1763 menu_add_expr(P_CHOICE, NULL, NULL);
1764 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1771 (yyval.menu) = menu_add_menu();
1778 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) {
1780 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
1788 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
1789 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1796 if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) {
1797 menu_set_type((yyvsp[(1) - (3)].id)->stype);
1798 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1799 zconf_curname(), zconf_lineno(),
1800 (yyvsp[(1) - (3)].id)->stype);
1809 current_entry->sym->flags |= SYMBOL_OPTIONAL;
1810 printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1817 if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) {
1818 menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
1819 printd(DEBUG_PARSE, "%s:%d:default\n",
1820 zconf_curname(), zconf_lineno());
1829 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
1830 menu_add_entry(NULL);
1831 menu_add_dep((yyvsp[(2) - (3)].expr));
1832 (yyval.menu) = menu_add_menu();
1839 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) {
1841 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
1849 menu_add_entry(NULL);
1850 menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1851 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1858 (yyval.menu) = menu_add_menu();
1865 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) {
1867 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
1875 printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1876 zconf_nextfile((yyvsp[(2) - (3)].string));
1883 menu_add_entry(NULL);
1884 menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL);
1885 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1899 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
1907 current_entry->help = (yyvsp[(2) - (2)].string);
1914 menu_add_dep((yyvsp[(3) - (4)].expr));
1915 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
1922 menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
1928 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1933 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1938 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1943 { (yyval.expr) = NULL; ;}
1948 { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;}
1953 { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;}
1958 { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
1963 { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
1968 { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;}
1973 { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;}
1978 { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
1983 { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
1988 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;}
1993 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;}
1998 { (yyval.string) = NULL; ;}
2005 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2009 YY_STACK_PRINT (yyss, yyssp);
2013 /* Now `shift' the result of the reduction. Determine what state
2014 that goes to, based on the state we popped back to and the rule
2015 number reduced by. */
2019 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2020 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2021 yystate = yytable[yystate];
2023 yystate = yydefgoto[yyn - YYNTOKENS];
2028 /*------------------------------------.
2029 | yyerrlab -- here on detecting error |
2030 `------------------------------------*/
2032 /* If not already recovering from an error, report this error. */
2036 #if ! YYERROR_VERBOSE
2037 yyerror (YY_("syntax error"));
2040 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2041 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2043 YYSIZE_T yyalloc = 2 * yysize;
2044 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2045 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2046 if (yymsg != yymsgbuf)
2047 YYSTACK_FREE (yymsg);
2048 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2050 yymsg_alloc = yyalloc;
2054 yymsg_alloc = sizeof yymsgbuf;
2058 if (0 < yysize && yysize <= yymsg_alloc)
2060 (void) yysyntax_error (yymsg, yystate, yychar);
2065 yyerror (YY_("syntax error"));
2067 goto yyexhaustedlab;
2075 if (yyerrstatus == 3)
2077 /* If just tried and failed to reuse lookahead token after an
2078 error, discard it. */
2080 if (yychar <= YYEOF)
2082 /* Return failure if at end of input. */
2083 if (yychar == YYEOF)
2088 yydestruct ("Error: discarding",
2094 /* Else will try to reuse lookahead token after shifting the error
2099 /*---------------------------------------------------.
2100 | yyerrorlab -- error raised explicitly by YYERROR. |
2101 `---------------------------------------------------*/
2104 /* Pacify compilers like GCC when the user code never invokes
2105 YYERROR and the label yyerrorlab therefore never appears in user
2107 if (/*CONSTCOND*/ 0)
2110 /* Do not reclaim the symbols of the rule which action triggered
2114 YY_STACK_PRINT (yyss, yyssp);
2119 /*-------------------------------------------------------------.
2120 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2121 `-------------------------------------------------------------*/
2123 yyerrstatus = 3; /* Each real token shifted decrements this. */
2127 yyn = yypact[yystate];
2128 if (yyn != YYPACT_NINF)
2131 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2139 /* Pop the current state because it cannot handle the error token. */
2144 yydestruct ("Error: popping",
2145 yystos[yystate], yyvsp);
2148 YY_STACK_PRINT (yyss, yyssp);
2154 /* Shift the error token. */
2155 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2161 /*-------------------------------------.
2162 | yyacceptlab -- YYACCEPT comes here. |
2163 `-------------------------------------*/
2168 /*-----------------------------------.
2169 | yyabortlab -- YYABORT comes here. |
2170 `-----------------------------------*/
2175 #if !defined(yyoverflow) || YYERROR_VERBOSE
2176 /*-------------------------------------------------.
2177 | yyexhaustedlab -- memory exhaustion comes here. |
2178 `-------------------------------------------------*/
2180 yyerror (YY_("memory exhausted"));
2186 if (yychar != YYEMPTY)
2187 yydestruct ("Cleanup: discarding lookahead",
2189 /* Do not reclaim the symbols of the rule which action triggered
2190 this YYABORT or YYACCEPT. */
2192 YY_STACK_PRINT (yyss, yyssp);
2193 while (yyssp != yyss)
2195 yydestruct ("Cleanup: popping",
2196 yystos[*yyssp], yyvsp);
2201 YYSTACK_FREE (yyss);
2204 if (yymsg != yymsgbuf)
2205 YYSTACK_FREE (yymsg);
2207 /* Make sure YYID is used. */
2208 return YYID (yyresult);
2215 void conf_parse(const char *name)
2220 zconf_initscan(name);
2224 modules_sym = sym_lookup(NULL, 0);
2225 modules_sym->type = S_BOOLEAN;
2226 modules_sym->flags |= SYMBOL_AUTO;
2227 rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
2230 if (getenv("ZCONF_DEBUG"))
2236 if (!modules_sym->prop) {
2237 struct property *prop;
2239 prop = prop_alloc(P_DEFAULT, modules_sym);
2240 prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
2242 menu_finalize(&rootmenu);
2243 for_all_symbols(i, sym) {
2244 if (sym_check_deps(sym))
2249 sym_set_change_count(1);
2252 static const char *zconf_tokenname(int token)
2255 case T_MENU: return "menu";
2256 case T_ENDMENU: return "endmenu";
2257 case T_CHOICE: return "choice";
2258 case T_ENDCHOICE: return "endchoice";
2259 case T_IF: return "if";
2260 case T_ENDIF: return "endif";
2261 case T_DEPENDS: return "depends";
2266 static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken)
2268 if (id->token != endtoken) {
2269 zconf_error("unexpected '%s' within %s block",
2270 kconf_id_strings + id->name, zconf_tokenname(starttoken));
2274 if (current_menu->file != current_file) {
2275 zconf_error("'%s' in different file than '%s'",
2276 kconf_id_strings + id->name, zconf_tokenname(starttoken));
2277 fprintf(stderr, "%s:%d: location of the '%s'\n",
2278 current_menu->file->name, current_menu->lineno,
2279 zconf_tokenname(starttoken));
2286 static void zconfprint(const char *err, ...)
2290 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
2292 vfprintf(stderr, err, ap);
2294 fprintf(stderr, "\n");
2297 static void zconf_error(const char *err, ...)
2302 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
2304 vfprintf(stderr, err, ap);
2306 fprintf(stderr, "\n");
2309 static void zconferror(const char *err)
2312 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
2316 static void print_quoted_string(FILE *out, const char *str)
2322 while ((p = strchr(str, '"'))) {
2325 fprintf(out, "%.*s", len, str);
2333 static void print_symbol(FILE *out, struct menu *menu)
2335 struct symbol *sym = menu->sym;
2336 struct property *prop;
2338 if (sym_is_choice(sym))
2339 fprintf(out, "\nchoice\n");
2341 fprintf(out, "\nconfig %s\n", sym->name);
2342 switch (sym->type) {
2344 fputs(" boolean\n", out);
2347 fputs(" tristate\n", out);
2350 fputs(" string\n", out);
2353 fputs(" integer\n", out);
2356 fputs(" hex\n", out);
2359 fputs(" ???\n", out);
2362 for (prop = sym->prop; prop; prop = prop->next) {
2363 if (prop->menu != menu)
2365 switch (prop->type) {
2367 fputs(" prompt ", out);
2368 print_quoted_string(out, prop->text);
2369 if (!expr_is_yes(prop->visible.expr)) {
2371 expr_fprint(prop->visible.expr, out);
2376 fputs( " default ", out);
2377 expr_fprint(prop->expr, out);
2378 if (!expr_is_yes(prop->visible.expr)) {
2380 expr_fprint(prop->visible.expr, out);
2385 fputs(" #choice value\n", out);
2388 fputs( " select ", out);
2389 expr_fprint(prop->expr, out);
2393 fputs( " range ", out);
2394 expr_fprint(prop->expr, out);
2398 fputs( " menu ", out);
2399 print_quoted_string(out, prop->text);
2403 fprintf(out, " unknown prop %d!\n", prop->type);
2408 int len = strlen(menu->help);
2409 while (menu->help[--len] == '\n')
2410 menu->help[len] = 0;
2411 fprintf(out, " help\n%s\n", menu->help);
2415 void zconfdump(FILE *out)
2417 struct property *prop;
2421 menu = rootmenu.list;
2423 if ((sym = menu->sym))
2424 print_symbol(out, menu);
2425 else if ((prop = menu->prompt)) {
2426 switch (prop->type) {
2428 fputs("\ncomment ", out);
2429 print_quoted_string(out, prop->text);
2433 fputs("\nmenu ", out);
2434 print_quoted_string(out, prop->text);
2440 if (!expr_is_yes(prop->visible.expr)) {
2441 fputs(" depends ", out);
2442 expr_fprint(prop->visible.expr, out);
2449 else if (menu->next)
2451 else while ((menu = menu->parent)) {
2452 if (menu->prompt && menu->prompt->type == P_MENU)
2453 fputs("\nendmenu\n", out);
2462 #include "lex.zconf.c"
2464 #include "confdata.c"