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 185
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, 6, 8, 11, 13, 14, 17, 20,
480 23, 26, 31, 36, 40, 42, 44, 46, 48, 50,
481 52, 54, 56, 58, 60, 62, 64, 66, 70, 73,
482 77, 80, 84, 87, 88, 91, 94, 97, 100, 103,
483 106, 110, 115, 120, 125, 131, 135, 136, 140, 141,
484 144, 148, 151, 153, 157, 158, 161, 164, 167, 170,
485 173, 178, 182, 185, 190, 191, 194, 198, 200, 204,
486 205, 208, 211, 214, 218, 222, 225, 227, 231, 232,
487 235, 238, 241, 245, 249, 252, 255, 258, 259, 262,
488 265, 268, 273, 274, 277, 279, 281, 284, 287, 290,
489 292, 295, 296, 299, 301, 305, 309, 313, 316, 320,
493 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
494 static const yytype_int8 yyrhs[] =
496 36, 0, -1, 78, 37, -1, 37, -1, 62, 38,
497 -1, 38, -1, -1, 38, 40, -1, 38, 54, -1,
498 38, 66, -1, 38, 77, -1, 38, 25, 1, 30,
499 -1, 38, 39, 1, 30, -1, 38, 1, 30, -1,
500 16, -1, 18, -1, 19, -1, 21, -1, 17, -1,
501 22, -1, 20, -1, 30, -1, 60, -1, 70, -1,
502 43, -1, 45, -1, 68, -1, 25, 1, 30, -1,
503 1, 30, -1, 10, 25, 30, -1, 42, 46, -1,
504 11, 25, 30, -1, 44, 46, -1, -1, 46, 47,
505 -1, 46, 48, -1, 46, 74, -1, 46, 72, -1,
506 46, 41, -1, 46, 30, -1, 19, 75, 30, -1,
507 18, 76, 79, 30, -1, 20, 80, 79, 30, -1,
508 21, 25, 79, 30, -1, 22, 81, 81, 79, 30,
509 -1, 23, 49, 30, -1, -1, 49, 25, 50, -1,
510 -1, 33, 76, -1, 7, 82, 30, -1, 51, 55,
511 -1, 77, -1, 52, 57, 53, -1, -1, 55, 56,
512 -1, 55, 74, -1, 55, 72, -1, 55, 30, -1,
513 55, 41, -1, 18, 76, 79, 30, -1, 19, 75,
514 30, -1, 17, 30, -1, 20, 25, 79, 30, -1,
515 -1, 57, 40, -1, 14, 80, 78, -1, 77, -1,
516 58, 61, 59, -1, -1, 61, 40, -1, 61, 66,
517 -1, 61, 54, -1, 3, 76, 78, -1, 4, 76,
518 30, -1, 63, 73, -1, 77, -1, 64, 67, 65,
519 -1, -1, 67, 40, -1, 67, 66, -1, 67, 54,
520 -1, 6, 76, 30, -1, 9, 76, 30, -1, 69,
521 73, -1, 12, 30, -1, 71, 13, -1, -1, 73,
522 74, -1, 73, 30, -1, 73, 41, -1, 16, 24,
523 80, 30, -1, -1, 76, 79, -1, 25, -1, 26,
524 -1, 5, 30, -1, 8, 30, -1, 15, 30, -1,
525 30, -1, 78, 30, -1, -1, 14, 80, -1, 81,
526 -1, 81, 33, 81, -1, 81, 27, 81, -1, 29,
527 80, 28, -1, 34, 80, -1, 80, 31, 80, -1,
528 80, 32, 80, -1, 25, -1, 26, -1, -1, 25,
532 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
533 static const yytype_uint16 yyrline[] =
535 0, 107, 107, 107, 109, 109, 111, 113, 114, 115,
536 116, 117, 118, 122, 126, 126, 126, 126, 126, 126,
537 126, 130, 131, 132, 133, 134, 135, 139, 140, 146,
538 154, 160, 168, 178, 180, 181, 182, 183, 184, 185,
539 188, 196, 202, 212, 218, 224, 227, 229, 240, 241,
540 246, 255, 260, 268, 271, 273, 274, 275, 276, 277,
541 280, 286, 297, 303, 313, 315, 320, 328, 336, 339,
542 341, 342, 343, 348, 355, 362, 367, 375, 378, 380,
543 381, 382, 385, 393, 400, 407, 413, 420, 422, 423,
544 424, 427, 435, 437, 442, 443, 446, 447, 448, 452,
545 453, 456, 457, 460, 461, 462, 463, 464, 465, 466,
550 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
551 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
552 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
553 static const char *const yytname[] =
555 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
556 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
557 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
558 "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE",
559 "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
560 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
561 "T_NOT", "$accept", "input", "start", "stmt_list", "option_name",
562 "common_stmt", "option_error", "config_entry_start", "config_stmt",
563 "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
564 "config_option", "symbol_option", "symbol_option_list",
565 "symbol_option_arg", "choice", "choice_entry", "choice_end",
566 "choice_stmt", "choice_option_list", "choice_option", "choice_block",
567 "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu",
568 "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt",
569 "comment", "comment_stmt", "help_start", "help", "depends_list",
570 "depends", "prompt_stmt_opt", "prompt", "end", "nl", "if_expr", "expr",
571 "symbol", "word_opt", 0
576 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
578 static const yytype_uint16 yytoknum[] =
580 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
581 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
582 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
583 285, 286, 287, 288, 289
587 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
588 static const yytype_uint8 yyr1[] =
590 0, 35, 36, 36, 37, 37, 38, 38, 38, 38,
591 38, 38, 38, 38, 39, 39, 39, 39, 39, 39,
592 39, 40, 40, 40, 40, 40, 40, 41, 41, 42,
593 43, 44, 45, 46, 46, 46, 46, 46, 46, 46,
594 47, 47, 47, 47, 47, 48, 49, 49, 50, 50,
595 51, 52, 53, 54, 55, 55, 55, 55, 55, 55,
596 56, 56, 56, 56, 57, 57, 58, 59, 60, 61,
597 61, 61, 61, 62, 63, 64, 65, 66, 67, 67,
598 67, 67, 68, 69, 70, 71, 72, 73, 73, 73,
599 73, 74, 75, 75, 76, 76, 77, 77, 77, 78,
600 78, 79, 79, 80, 80, 80, 80, 80, 80, 80,
604 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
605 static const yytype_uint8 yyr2[] =
607 0, 2, 2, 1, 2, 1, 0, 2, 2, 2,
608 2, 4, 4, 3, 1, 1, 1, 1, 1, 1,
609 1, 1, 1, 1, 1, 1, 1, 3, 2, 3,
610 2, 3, 2, 0, 2, 2, 2, 2, 2, 2,
611 3, 4, 4, 4, 5, 3, 0, 3, 0, 2,
612 3, 2, 1, 3, 0, 2, 2, 2, 2, 2,
613 4, 3, 2, 4, 0, 2, 3, 1, 3, 0,
614 2, 2, 2, 3, 3, 2, 1, 3, 0, 2,
615 2, 2, 3, 3, 2, 2, 2, 0, 2, 2,
616 2, 4, 0, 2, 1, 1, 2, 2, 2, 1,
617 2, 0, 2, 1, 3, 3, 3, 2, 3, 3,
621 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
622 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
623 means the default is an error. */
624 static const yytype_uint8 yydefact[] =
626 6, 0, 99, 0, 3, 0, 6, 6, 94, 95,
627 0, 1, 0, 0, 0, 0, 112, 0, 0, 0,
628 0, 0, 0, 14, 18, 15, 16, 20, 17, 19,
629 0, 21, 0, 7, 33, 24, 33, 25, 54, 64,
630 8, 69, 22, 87, 78, 9, 26, 87, 23, 10,
631 0, 100, 2, 73, 13, 0, 96, 0, 113, 0,
632 97, 0, 0, 0, 110, 111, 0, 0, 0, 103,
633 98, 0, 0, 0, 0, 0, 0, 0, 0, 0,
634 0, 74, 82, 50, 83, 29, 31, 0, 107, 0,
635 0, 66, 0, 0, 11, 12, 0, 0, 0, 0,
636 92, 0, 0, 0, 46, 0, 39, 38, 34, 35,
637 0, 37, 36, 0, 0, 92, 0, 58, 59, 55,
638 57, 56, 65, 53, 52, 70, 72, 68, 71, 67,
639 89, 90, 88, 79, 81, 77, 80, 76, 106, 108,
640 109, 105, 104, 28, 85, 0, 101, 0, 101, 101,
641 101, 0, 0, 0, 86, 62, 101, 0, 101, 0,
642 0, 0, 40, 93, 0, 0, 101, 48, 45, 27,
643 0, 61, 0, 91, 102, 41, 42, 43, 0, 0,
647 /* YYDEFGOTO[NTERM-NUM]. */
648 static const yytype_int16 yydefgoto[] =
650 -1, 3, 4, 5, 32, 33, 107, 34, 35, 36,
651 37, 73, 108, 109, 152, 180, 38, 39, 123, 40,
652 75, 119, 76, 41, 127, 42, 77, 6, 43, 44,
653 135, 45, 79, 46, 47, 48, 110, 111, 78, 112,
654 147, 148, 49, 7, 161, 68, 69, 59
657 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
659 #define YYPACT_NINF -89
660 static const yytype_int16 yypact[] =
662 3, 4, -89, 20, -89, 100, -89, 7, -89, -89,
663 -8, -89, 17, 4, 28, 4, 37, 36, 4, 68,
664 87, -18, 69, -89, -89, -89, -89, -89, -89, -89,
665 128, -89, 138, -89, -89, -89, -89, -89, -89, -89,
666 -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
667 127, -89, -89, 110, -89, 126, -89, 136, -89, 137,
668 -89, 147, 150, 152, -89, -89, -18, -18, 171, -14,
669 -89, 153, 157, 34, 67, 180, 233, 220, 207, 220,
670 154, -89, -89, -89, -89, -89, -89, 0, -89, -18,
671 -18, 110, 44, 44, -89, -89, 163, 174, 182, 4,
672 4, -18, 194, 44, -89, 219, -89, -89, -89, -89,
673 223, -89, -89, 203, 4, 4, 215, -89, -89, -89,
674 -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
675 -89, -89, -89, -89, -89, -89, -89, -89, -89, 213,
676 -89, -89, -89, -89, -89, -18, 232, 227, 232, -5,
677 232, 44, 35, 234, -89, -89, 232, 235, 232, 224,
678 -18, 236, -89, -89, 237, 238, 232, 216, -89, -89,
679 240, -89, 241, -89, 71, -89, -89, -89, 242, 4,
680 -89, -89, -89, -89, -89
683 /* YYPGOTO[NTERM-NUM]. */
684 static const yytype_int16 yypgoto[] =
686 -89, -89, 255, 267, -89, 47, -57, -89, -89, -89,
687 -89, 239, -89, -89, -89, -89, -89, -89, -89, 130,
688 -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
689 -89, 181, -89, -89, -89, -89, -89, 199, 229, 16,
690 162, -1, 74, -7, 103, -65, -88, -89
693 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
694 positive, shift that token. If negative, reduce the rule which
695 number is the opposite. If zero, do what YYDEFACT says.
696 If YYTABLE_NINF, syntax error. */
697 #define YYTABLE_NINF -85
698 static const yytype_int16 yytable[] =
700 10, 87, 88, 53, 141, 142, 1, 64, 65, 160,
701 1, 66, 55, 92, 57, 151, 67, 61, 118, 93,
702 11, 131, 2, 131, 139, 140, 89, 90, 138, 8,
703 9, 89, 90, 2, -30, 96, 149, 51, -30, -30,
704 -30, -30, -30, -30, -30, -30, 97, 54, -30, -30,
705 98, -30, 99, 100, 101, 102, 103, 104, 56, 105,
706 167, 91, 58, 166, 106, 168, 60, -32, 96, 64,
707 65, -32, -32, -32, -32, -32, -32, -32, -32, 97,
708 159, -32, -32, 98, -32, 99, 100, 101, 102, 103,
709 104, 121, 105, 62, 132, 174, 132, 106, 146, 70,
710 -5, 12, 89, 90, 13, 14, 15, 16, 17, 18,
711 19, 20, 63, 156, 21, 22, 23, 24, 25, 26,
712 27, 28, 29, 122, 125, 30, 133, -4, 12, 71,
713 31, 13, 14, 15, 16, 17, 18, 19, 20, 72,
714 51, 21, 22, 23, 24, 25, 26, 27, 28, 29,
715 124, 129, 30, 137, -84, 96, 81, 31, -84, -84,
716 -84, -84, -84, -84, -84, -84, 82, 83, -84, -84,
717 98, -84, -84, -84, -84, -84, -84, 84, 184, 105,
718 85, 96, 86, 94, 130, -51, -51, 95, -51, -51,
719 -51, -51, 97, 143, -51, -51, 98, 113, 114, 115,
720 116, 2, 89, 90, 144, 105, 145, 126, 96, 134,
721 117, -75, -75, -75, -75, -75, -75, -75, -75, 150,
722 153, -75, -75, 98, 13, 14, 15, 16, 17, 18,
723 19, 20, 105, 155, 21, 22, 154, 130, 14, 15,
724 158, 17, 18, 19, 20, 90, 160, 21, 22, 179,
725 31, 163, 164, 165, 173, 89, 90, 162, 128, 170,
726 136, 172, 52, 31, 169, 171, 175, 176, 177, 178,
727 181, 182, 183, 50, 120, 74, 80, 157
730 static const yytype_uint8 yycheck[] =
732 1, 66, 67, 10, 92, 93, 3, 25, 26, 14,
733 3, 29, 13, 27, 15, 103, 34, 18, 75, 33,
734 0, 78, 30, 80, 89, 90, 31, 32, 28, 25,
735 26, 31, 32, 30, 0, 1, 101, 30, 4, 5,
736 6, 7, 8, 9, 10, 11, 12, 30, 14, 15,
737 16, 17, 18, 19, 20, 21, 22, 23, 30, 25,
738 25, 68, 25, 151, 30, 30, 30, 0, 1, 25,
739 26, 4, 5, 6, 7, 8, 9, 10, 11, 12,
740 145, 14, 15, 16, 17, 18, 19, 20, 21, 22,
741 23, 75, 25, 25, 78, 160, 80, 30, 99, 30,
742 0, 1, 31, 32, 4, 5, 6, 7, 8, 9,
743 10, 11, 25, 114, 14, 15, 16, 17, 18, 19,
744 20, 21, 22, 76, 77, 25, 79, 0, 1, 1,
745 30, 4, 5, 6, 7, 8, 9, 10, 11, 1,
746 30, 14, 15, 16, 17, 18, 19, 20, 21, 22,
747 76, 77, 25, 79, 0, 1, 30, 30, 4, 5,
748 6, 7, 8, 9, 10, 11, 30, 30, 14, 15,
749 16, 17, 18, 19, 20, 21, 22, 30, 179, 25,
750 30, 1, 30, 30, 30, 5, 6, 30, 8, 9,
751 10, 11, 12, 30, 14, 15, 16, 17, 18, 19,
752 20, 30, 31, 32, 30, 25, 24, 77, 1, 79,
753 30, 4, 5, 6, 7, 8, 9, 10, 11, 25,
754 1, 14, 15, 16, 4, 5, 6, 7, 8, 9,
755 10, 11, 25, 30, 14, 15, 13, 30, 5, 6,
756 25, 8, 9, 10, 11, 32, 14, 14, 15, 33,
757 30, 148, 149, 150, 30, 31, 32, 30, 77, 156,
758 79, 158, 7, 30, 30, 30, 30, 30, 30, 166,
759 30, 30, 30, 6, 75, 36, 47, 115
762 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
763 symbol of state STATE-NUM. */
764 static const yytype_uint8 yystos[] =
766 0, 3, 30, 36, 37, 38, 62, 78, 25, 26,
767 76, 0, 1, 4, 5, 6, 7, 8, 9, 10,
768 11, 14, 15, 16, 17, 18, 19, 20, 21, 22,
769 25, 30, 39, 40, 42, 43, 44, 45, 51, 52,
770 54, 58, 60, 63, 64, 66, 68, 69, 70, 77,
771 38, 30, 37, 78, 30, 76, 30, 76, 25, 82,
772 30, 76, 25, 25, 25, 26, 29, 34, 80, 81,
773 30, 1, 1, 46, 46, 55, 57, 61, 73, 67,
774 73, 30, 30, 30, 30, 30, 30, 80, 80, 31,
775 32, 78, 27, 33, 30, 30, 1, 12, 16, 18,
776 19, 20, 21, 22, 23, 25, 30, 41, 47, 48,
777 71, 72, 74, 17, 18, 19, 20, 30, 41, 56,
778 72, 74, 40, 53, 77, 40, 54, 59, 66, 77,
779 30, 41, 74, 40, 54, 65, 66, 77, 28, 80,
780 80, 81, 81, 30, 30, 24, 76, 75, 76, 80,
781 25, 81, 49, 1, 13, 30, 76, 75, 25, 80,
782 14, 79, 30, 79, 79, 79, 81, 25, 30, 30,
783 79, 30, 79, 30, 80, 30, 30, 30, 79, 33,
787 #define yyerrok (yyerrstatus = 0)
788 #define yyclearin (yychar = YYEMPTY)
792 #define YYACCEPT goto yyacceptlab
793 #define YYABORT goto yyabortlab
794 #define YYERROR goto yyerrorlab
797 /* Like YYERROR except do call yyerror. This remains here temporarily
798 to ease the transition to the new meaning of YYERROR, for GCC.
799 Once GCC version 2 has supplanted version 1, this can go. */
801 #define YYFAIL goto yyerrlab
803 #define YYRECOVERING() (!!yyerrstatus)
805 #define YYBACKUP(Token, Value) \
807 if (yychar == YYEMPTY && yylen == 1) \
811 yytoken = YYTRANSLATE (yychar); \
817 yyerror (YY_("syntax error: cannot back up")); \
824 #define YYERRCODE 256
827 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
828 If N is 0, then set CURRENT to the empty location which ends
829 the previous symbol: RHS[0] (always defined). */
831 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
832 #ifndef YYLLOC_DEFAULT
833 # define YYLLOC_DEFAULT(Current, Rhs, N) \
837 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
838 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
839 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
840 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
844 (Current).first_line = (Current).last_line = \
845 YYRHSLOC (Rhs, 0).last_line; \
846 (Current).first_column = (Current).last_column = \
847 YYRHSLOC (Rhs, 0).last_column; \
853 /* YY_LOCATION_PRINT -- Print the location on the stream.
854 This macro was not mandated originally: define only if we know
855 we won't break user code: when these are the locations we know. */
857 #ifndef YY_LOCATION_PRINT
858 # if YYLTYPE_IS_TRIVIAL
859 # define YY_LOCATION_PRINT(File, Loc) \
860 fprintf (File, "%d.%d-%d.%d", \
861 (Loc).first_line, (Loc).first_column, \
862 (Loc).last_line, (Loc).last_column)
864 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
869 /* YYLEX -- calling `yylex' with the right arguments. */
872 # define YYLEX yylex (YYLEX_PARAM)
874 # define YYLEX yylex ()
877 /* Enable debugging if requested. */
881 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
882 # define YYFPRINTF fprintf
885 # define YYDPRINTF(Args) \
891 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
895 YYFPRINTF (stderr, "%s ", Title); \
896 yy_symbol_print (stderr, \
898 YYFPRINTF (stderr, "\n"); \
903 /*--------------------------------.
904 | Print this symbol on YYOUTPUT. |
905 `--------------------------------*/
908 #if (defined __STDC__ || defined __C99__FUNC__ \
909 || defined __cplusplus || defined _MSC_VER)
911 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
914 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
917 YYSTYPE const * const yyvaluep;
923 if (yytype < YYNTOKENS)
924 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
936 /*--------------------------------.
937 | Print this symbol on YYOUTPUT. |
938 `--------------------------------*/
940 #if (defined __STDC__ || defined __C99__FUNC__ \
941 || defined __cplusplus || defined _MSC_VER)
943 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
946 yy_symbol_print (yyoutput, yytype, yyvaluep)
949 YYSTYPE const * const yyvaluep;
952 if (yytype < YYNTOKENS)
953 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
955 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
957 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
958 YYFPRINTF (yyoutput, ")");
961 /*------------------------------------------------------------------.
962 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
964 `------------------------------------------------------------------*/
966 #if (defined __STDC__ || defined __C99__FUNC__ \
967 || defined __cplusplus || defined _MSC_VER)
969 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
972 yy_stack_print (yybottom, yytop)
973 yytype_int16 *yybottom;
977 YYFPRINTF (stderr, "Stack now");
978 for (; yybottom <= yytop; yybottom++)
980 int yybot = *yybottom;
981 YYFPRINTF (stderr, " %d", yybot);
983 YYFPRINTF (stderr, "\n");
986 # define YY_STACK_PRINT(Bottom, Top) \
989 yy_stack_print ((Bottom), (Top)); \
993 /*------------------------------------------------.
994 | Report that the YYRULE is going to be reduced. |
995 `------------------------------------------------*/
997 #if (defined __STDC__ || defined __C99__FUNC__ \
998 || defined __cplusplus || defined _MSC_VER)
1000 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1003 yy_reduce_print (yyvsp, yyrule)
1008 int yynrhs = yyr2[yyrule];
1010 unsigned long int yylno = yyrline[yyrule];
1011 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1013 /* The symbols being reduced. */
1014 for (yyi = 0; yyi < yynrhs; yyi++)
1016 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1017 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1018 &(yyvsp[(yyi + 1) - (yynrhs)])
1020 YYFPRINTF (stderr, "\n");
1024 # define YY_REDUCE_PRINT(Rule) \
1027 yy_reduce_print (yyvsp, Rule); \
1030 /* Nonzero means print parse trace. It is left uninitialized so that
1031 multiple parsers can coexist. */
1033 #else /* !YYDEBUG */
1034 # define YYDPRINTF(Args)
1035 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1036 # define YY_STACK_PRINT(Bottom, Top)
1037 # define YY_REDUCE_PRINT(Rule)
1038 #endif /* !YYDEBUG */
1041 /* YYINITDEPTH -- initial size of the parser's stacks. */
1043 # define YYINITDEPTH 200
1046 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1047 if the built-in stack extension method is used).
1049 Do not make this value too large; the results are undefined if
1050 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1051 evaluated with infinite-precision integer arithmetic. */
1054 # define YYMAXDEPTH 10000
1062 # if defined __GLIBC__ && defined _STRING_H
1063 # define yystrlen strlen
1065 /* Return the length of YYSTR. */
1066 #if (defined __STDC__ || defined __C99__FUNC__ \
1067 || defined __cplusplus || defined _MSC_VER)
1069 yystrlen (const char *yystr)
1077 for (yylen = 0; yystr[yylen]; yylen++)
1085 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1086 # define yystpcpy stpcpy
1088 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1090 #if (defined __STDC__ || defined __C99__FUNC__ \
1091 || defined __cplusplus || defined _MSC_VER)
1093 yystpcpy (char *yydest, const char *yysrc)
1096 yystpcpy (yydest, yysrc)
1102 const char *yys = yysrc;
1104 while ((*yyd++ = *yys++) != '\0')
1113 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1114 quotes and backslashes, so that it's suitable for yyerror. The
1115 heuristic is that double-quoting is unnecessary unless the string
1116 contains an apostrophe, a comma, or backslash (other than
1117 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1118 null, do not copy; instead, return the length of what the result
1121 yytnamerr (char *yyres, const char *yystr)
1126 char const *yyp = yystr;
1133 goto do_not_strip_quotes;
1137 goto do_not_strip_quotes;
1150 do_not_strip_quotes: ;
1154 return yystrlen (yystr);
1156 return yystpcpy (yyres, yystr) - yyres;
1160 /* Copy into YYRESULT an error message about the unexpected token
1161 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1162 including the terminating null byte. If YYRESULT is null, do not
1163 copy anything; just return the number of bytes that would be
1164 copied. As a special case, return 0 if an ordinary "syntax error"
1165 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1166 size calculation. */
1168 yysyntax_error (char *yyresult, int yystate, int yychar)
1170 int yyn = yypact[yystate];
1172 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1176 int yytype = YYTRANSLATE (yychar);
1177 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1178 YYSIZE_T yysize = yysize0;
1180 int yysize_overflow = 0;
1181 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1182 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1186 /* This is so xgettext sees the translatable formats that are
1187 constructed on the fly. */
1188 YY_("syntax error, unexpected %s");
1189 YY_("syntax error, unexpected %s, expecting %s");
1190 YY_("syntax error, unexpected %s, expecting %s or %s");
1191 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1192 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1196 static char const yyunexpected[] = "syntax error, unexpected %s";
1197 static char const yyexpecting[] = ", expecting %s";
1198 static char const yyor[] = " or %s";
1199 char yyformat[sizeof yyunexpected
1200 + sizeof yyexpecting - 1
1201 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1202 * (sizeof yyor - 1))];
1203 char const *yyprefix = yyexpecting;
1205 /* Start YYX at -YYN if negative to avoid negative indexes in
1207 int yyxbegin = yyn < 0 ? -yyn : 0;
1209 /* Stay within bounds of both yycheck and yytname. */
1210 int yychecklim = YYLAST - yyn + 1;
1211 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1214 yyarg[0] = yytname[yytype];
1215 yyfmt = yystpcpy (yyformat, yyunexpected);
1217 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1218 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1220 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1224 yyformat[sizeof yyunexpected - 1] = '\0';
1227 yyarg[yycount++] = yytname[yyx];
1228 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1229 yysize_overflow |= (yysize1 < yysize);
1231 yyfmt = yystpcpy (yyfmt, yyprefix);
1235 yyf = YY_(yyformat);
1236 yysize1 = yysize + yystrlen (yyf);
1237 yysize_overflow |= (yysize1 < yysize);
1240 if (yysize_overflow)
1241 return YYSIZE_MAXIMUM;
1245 /* Avoid sprintf, as that infringes on the user's name space.
1246 Don't have undefined behavior even if the translation
1247 produced a string with the wrong number of "%s"s. */
1248 char *yyp = yyresult;
1250 while ((*yyp = *yyf) != '\0')
1252 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1254 yyp += yytnamerr (yyp, yyarg[yyi++]);
1267 #endif /* YYERROR_VERBOSE */
1270 /*-----------------------------------------------.
1271 | Release the memory associated to this symbol. |
1272 `-----------------------------------------------*/
1275 #if (defined __STDC__ || defined __C99__FUNC__ \
1276 || defined __cplusplus || defined _MSC_VER)
1278 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1281 yydestruct (yymsg, yytype, yyvaluep)
1291 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1295 case 52: /* "choice_entry" */
1298 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1299 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1300 if (current_menu == (yyvaluep->menu))
1305 case 58: /* "if_entry" */
1308 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1309 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1310 if (current_menu == (yyvaluep->menu))
1315 case 64: /* "menu_entry" */
1318 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1319 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1320 if (current_menu == (yyvaluep->menu))
1331 /* Prevent warnings from -Wmissing-prototypes. */
1332 #ifdef YYPARSE_PARAM
1333 #if defined __STDC__ || defined __cplusplus
1334 int yyparse (void *YYPARSE_PARAM);
1338 #else /* ! YYPARSE_PARAM */
1339 #if defined __STDC__ || defined __cplusplus
1344 #endif /* ! YYPARSE_PARAM */
1347 /* The lookahead symbol. */
1350 /* The semantic value of the lookahead symbol. */
1353 /* Number of syntax errors so far. */
1358 /*-------------------------.
1359 | yyparse or yypush_parse. |
1360 `-------------------------*/
1362 #ifdef YYPARSE_PARAM
1363 #if (defined __STDC__ || defined __C99__FUNC__ \
1364 || defined __cplusplus || defined _MSC_VER)
1366 yyparse (void *YYPARSE_PARAM)
1369 yyparse (YYPARSE_PARAM)
1370 void *YYPARSE_PARAM;
1372 #else /* ! YYPARSE_PARAM */
1373 #if (defined __STDC__ || defined __C99__FUNC__ \
1374 || defined __cplusplus || defined _MSC_VER)
1387 /* Number of tokens to shift before error messages enabled. */
1390 /* The stacks and their tools:
1391 `yyss': related to states.
1392 `yyvs': related to semantic values.
1394 Refer to the stacks thru separate pointers, to allow yyoverflow
1395 to reallocate them elsewhere. */
1397 /* The state stack. */
1398 yytype_int16 yyssa[YYINITDEPTH];
1400 yytype_int16 *yyssp;
1402 /* The semantic value stack. */
1403 YYSTYPE yyvsa[YYINITDEPTH];
1407 YYSIZE_T yystacksize;
1411 /* Lookahead token as an internal (translated) token number. */
1413 /* The variables used to return semantic value and location from the
1418 /* Buffer for error messages, and its allocated size. */
1420 char *yymsg = yymsgbuf;
1421 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1424 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1426 /* The number of symbols on the RHS of the reduced rule.
1427 Keep to zero when no symbol should be popped. */
1433 yystacksize = YYINITDEPTH;
1435 YYDPRINTF ((stderr, "Starting parse\n"));
1440 yychar = YYEMPTY; /* Cause a token to be read. */
1442 /* Initialize stack pointers.
1443 Waste one element of value and location stack
1444 so that they stay on the same level as the state stack.
1445 The wasted elements are never initialized. */
1451 /*------------------------------------------------------------.
1452 | yynewstate -- Push a new state, which is found in yystate. |
1453 `------------------------------------------------------------*/
1455 /* In all cases, when you get here, the value and location stacks
1456 have just been pushed. So pushing a state here evens the stacks. */
1462 if (yyss + yystacksize - 1 <= yyssp)
1464 /* Get the current used size of the three stacks, in elements. */
1465 YYSIZE_T yysize = yyssp - yyss + 1;
1469 /* Give user a chance to reallocate the stack. Use copies of
1470 these so that the &'s don't force the real ones into
1472 YYSTYPE *yyvs1 = yyvs;
1473 yytype_int16 *yyss1 = yyss;
1475 /* Each stack pointer address is followed by the size of the
1476 data in use in that stack, in bytes. This used to be a
1477 conditional around just the two extra args, but that might
1478 be undefined if yyoverflow is a macro. */
1479 yyoverflow (YY_("memory exhausted"),
1480 &yyss1, yysize * sizeof (*yyssp),
1481 &yyvs1, yysize * sizeof (*yyvsp),
1487 #else /* no yyoverflow */
1488 # ifndef YYSTACK_RELOCATE
1489 goto yyexhaustedlab;
1491 /* Extend the stack our own way. */
1492 if (YYMAXDEPTH <= yystacksize)
1493 goto yyexhaustedlab;
1495 if (YYMAXDEPTH < yystacksize)
1496 yystacksize = YYMAXDEPTH;
1499 yytype_int16 *yyss1 = yyss;
1500 union yyalloc *yyptr =
1501 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1503 goto yyexhaustedlab;
1504 YYSTACK_RELOCATE (yyss_alloc, yyss);
1505 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1506 # undef YYSTACK_RELOCATE
1508 YYSTACK_FREE (yyss1);
1511 #endif /* no yyoverflow */
1513 yyssp = yyss + yysize - 1;
1514 yyvsp = yyvs + yysize - 1;
1516 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1517 (unsigned long int) yystacksize));
1519 if (yyss + yystacksize - 1 <= yyssp)
1523 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1525 if (yystate == YYFINAL)
1535 /* Do appropriate processing given the current state. Read a
1536 lookahead token if we need one and don't already have one. */
1538 /* First try to decide what to do without reference to lookahead token. */
1539 yyn = yypact[yystate];
1540 if (yyn == YYPACT_NINF)
1543 /* Not known => get a lookahead token if don't already have one. */
1545 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1546 if (yychar == YYEMPTY)
1548 YYDPRINTF ((stderr, "Reading a token: "));
1552 if (yychar <= YYEOF)
1554 yychar = yytoken = YYEOF;
1555 YYDPRINTF ((stderr, "Now at end of input.\n"));
1559 yytoken = YYTRANSLATE (yychar);
1560 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1563 /* If the proper action on seeing token YYTOKEN is to reduce or to
1564 detect an error, take that action. */
1566 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1571 if (yyn == 0 || yyn == YYTABLE_NINF)
1577 /* Count tokens shifted since error; after three, turn off error
1582 /* Shift the lookahead token. */
1583 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1585 /* Discard the shifted token. */
1594 /*-----------------------------------------------------------.
1595 | yydefault -- do the default action for the current state. |
1596 `-----------------------------------------------------------*/
1598 yyn = yydefact[yystate];
1604 /*-----------------------------.
1605 | yyreduce -- Do a reduction. |
1606 `-----------------------------*/
1608 /* yyn is the number of a rule to reduce with. */
1611 /* If YYLEN is nonzero, implement the default value of the action:
1614 Otherwise, the following line sets YYVAL to garbage.
1615 This behavior is undocumented and Bison
1616 users should not rely upon it. Assigning to YYVAL
1617 unconditionally makes the parser a bit smaller, and it avoids a
1618 GCC warning that YYVAL may be used uninitialized. */
1619 yyval = yyvsp[1-yylen];
1622 YY_REDUCE_PRINT (yyn);
1627 { zconf_error("unexpected end statement"); ;}
1632 { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;}
1638 zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
1644 { zconf_error("invalid statement"); ;}
1649 { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;}
1654 { zconf_error("invalid option"); ;}
1660 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
1661 sym->flags |= SYMBOL_OPTIONAL;
1662 menu_add_entry(sym);
1663 printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1671 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1678 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
1679 sym->flags |= SYMBOL_OPTIONAL;
1680 menu_add_entry(sym);
1681 printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1688 if (current_entry->prompt)
1689 current_entry->prompt->type = P_MENU;
1691 zconfprint("warning: menuconfig statement without prompt");
1693 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1700 menu_set_type((yyvsp[(1) - (3)].id)->stype);
1701 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1702 zconf_curname(), zconf_lineno(),
1703 (yyvsp[(1) - (3)].id)->stype);
1710 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
1711 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1718 menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr));
1719 if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN)
1720 menu_set_type((yyvsp[(1) - (4)].id)->stype);
1721 printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
1722 zconf_curname(), zconf_lineno(),
1723 (yyvsp[(1) - (4)].id)->stype);
1730 menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
1731 printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1738 menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr));
1739 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1746 struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
1747 if (id && id->flags & TF_OPTION)
1748 menu_add_option(id->token, (yyvsp[(3) - (3)].string));
1750 zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string));
1751 free((yyvsp[(2) - (3)].string));
1757 { (yyval.string) = NULL; ;}
1762 { (yyval.string) = (yyvsp[(2) - (2)].string); ;}
1768 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE);
1769 sym->flags |= SYMBOL_AUTO;
1770 menu_add_entry(sym);
1771 menu_add_expr(P_CHOICE, NULL, NULL);
1772 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1779 (yyval.menu) = menu_add_menu();
1786 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) {
1788 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
1796 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
1797 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1804 if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) {
1805 menu_set_type((yyvsp[(1) - (3)].id)->stype);
1806 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1807 zconf_curname(), zconf_lineno(),
1808 (yyvsp[(1) - (3)].id)->stype);
1817 current_entry->sym->flags |= SYMBOL_OPTIONAL;
1818 printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1825 if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) {
1826 menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
1827 printd(DEBUG_PARSE, "%s:%d:default\n",
1828 zconf_curname(), zconf_lineno());
1837 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
1838 menu_add_entry(NULL);
1839 menu_add_dep((yyvsp[(2) - (3)].expr));
1840 (yyval.menu) = menu_add_menu();
1847 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) {
1849 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
1857 menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1864 menu_add_entry(NULL);
1865 menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1866 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1873 (yyval.menu) = menu_add_menu();
1880 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) {
1882 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
1890 printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1891 zconf_nextfile((yyvsp[(2) - (3)].string));
1898 menu_add_entry(NULL);
1899 menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL);
1900 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1914 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
1922 current_entry->help = (yyvsp[(2) - (2)].string);
1929 menu_add_dep((yyvsp[(3) - (4)].expr));
1930 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
1937 menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
1943 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1948 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1953 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1958 { (yyval.expr) = NULL; ;}
1963 { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;}
1968 { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;}
1973 { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
1978 { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
1983 { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;}
1988 { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;}
1993 { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
1998 { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2003 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;}
2008 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;}
2013 { (yyval.string) = NULL; ;}
2020 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2024 YY_STACK_PRINT (yyss, yyssp);
2028 /* Now `shift' the result of the reduction. Determine what state
2029 that goes to, based on the state we popped back to and the rule
2030 number reduced by. */
2034 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2035 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2036 yystate = yytable[yystate];
2038 yystate = yydefgoto[yyn - YYNTOKENS];
2043 /*------------------------------------.
2044 | yyerrlab -- here on detecting error |
2045 `------------------------------------*/
2047 /* If not already recovering from an error, report this error. */
2051 #if ! YYERROR_VERBOSE
2052 yyerror (YY_("syntax error"));
2055 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2056 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2058 YYSIZE_T yyalloc = 2 * yysize;
2059 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2060 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2061 if (yymsg != yymsgbuf)
2062 YYSTACK_FREE (yymsg);
2063 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2065 yymsg_alloc = yyalloc;
2069 yymsg_alloc = sizeof yymsgbuf;
2073 if (0 < yysize && yysize <= yymsg_alloc)
2075 (void) yysyntax_error (yymsg, yystate, yychar);
2080 yyerror (YY_("syntax error"));
2082 goto yyexhaustedlab;
2090 if (yyerrstatus == 3)
2092 /* If just tried and failed to reuse lookahead token after an
2093 error, discard it. */
2095 if (yychar <= YYEOF)
2097 /* Return failure if at end of input. */
2098 if (yychar == YYEOF)
2103 yydestruct ("Error: discarding",
2109 /* Else will try to reuse lookahead token after shifting the error
2114 /*---------------------------------------------------.
2115 | yyerrorlab -- error raised explicitly by YYERROR. |
2116 `---------------------------------------------------*/
2119 /* Pacify compilers like GCC when the user code never invokes
2120 YYERROR and the label yyerrorlab therefore never appears in user
2122 if (/*CONSTCOND*/ 0)
2125 /* Do not reclaim the symbols of the rule which action triggered
2129 YY_STACK_PRINT (yyss, yyssp);
2134 /*-------------------------------------------------------------.
2135 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2136 `-------------------------------------------------------------*/
2138 yyerrstatus = 3; /* Each real token shifted decrements this. */
2142 yyn = yypact[yystate];
2143 if (yyn != YYPACT_NINF)
2146 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2154 /* Pop the current state because it cannot handle the error token. */
2159 yydestruct ("Error: popping",
2160 yystos[yystate], yyvsp);
2163 YY_STACK_PRINT (yyss, yyssp);
2169 /* Shift the error token. */
2170 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2176 /*-------------------------------------.
2177 | yyacceptlab -- YYACCEPT comes here. |
2178 `-------------------------------------*/
2183 /*-----------------------------------.
2184 | yyabortlab -- YYABORT comes here. |
2185 `-----------------------------------*/
2190 #if !defined(yyoverflow) || YYERROR_VERBOSE
2191 /*-------------------------------------------------.
2192 | yyexhaustedlab -- memory exhaustion comes here. |
2193 `-------------------------------------------------*/
2195 yyerror (YY_("memory exhausted"));
2201 if (yychar != YYEMPTY)
2202 yydestruct ("Cleanup: discarding lookahead",
2204 /* Do not reclaim the symbols of the rule which action triggered
2205 this YYABORT or YYACCEPT. */
2207 YY_STACK_PRINT (yyss, yyssp);
2208 while (yyssp != yyss)
2210 yydestruct ("Cleanup: popping",
2211 yystos[*yyssp], yyvsp);
2216 YYSTACK_FREE (yyss);
2219 if (yymsg != yymsgbuf)
2220 YYSTACK_FREE (yymsg);
2222 /* Make sure YYID is used. */
2223 return YYID (yyresult);
2230 void conf_parse(const char *name)
2235 zconf_initscan(name);
2239 modules_sym = sym_lookup(NULL, 0);
2240 modules_sym->type = S_BOOLEAN;
2241 modules_sym->flags |= SYMBOL_AUTO;
2242 rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
2245 if (getenv("ZCONF_DEBUG"))
2251 if (!modules_sym->prop) {
2252 struct property *prop;
2254 prop = prop_alloc(P_DEFAULT, modules_sym);
2255 prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
2258 rootmenu.prompt->text = _(rootmenu.prompt->text);
2259 rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
2261 menu_finalize(&rootmenu);
2262 for_all_symbols(i, sym) {
2263 if (sym_check_deps(sym))
2268 sym_set_change_count(1);
2271 static const char *zconf_tokenname(int token)
2274 case T_MENU: return "menu";
2275 case T_ENDMENU: return "endmenu";
2276 case T_CHOICE: return "choice";
2277 case T_ENDCHOICE: return "endchoice";
2278 case T_IF: return "if";
2279 case T_ENDIF: return "endif";
2280 case T_DEPENDS: return "depends";
2285 static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken)
2287 if (id->token != endtoken) {
2288 zconf_error("unexpected '%s' within %s block",
2289 kconf_id_strings + id->name, zconf_tokenname(starttoken));
2293 if (current_menu->file != current_file) {
2294 zconf_error("'%s' in different file than '%s'",
2295 kconf_id_strings + id->name, zconf_tokenname(starttoken));
2296 fprintf(stderr, "%s:%d: location of the '%s'\n",
2297 current_menu->file->name, current_menu->lineno,
2298 zconf_tokenname(starttoken));
2305 static void zconfprint(const char *err, ...)
2309 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
2311 vfprintf(stderr, err, ap);
2313 fprintf(stderr, "\n");
2316 static void zconf_error(const char *err, ...)
2321 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
2323 vfprintf(stderr, err, ap);
2325 fprintf(stderr, "\n");
2328 static void zconferror(const char *err)
2331 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
2335 static void print_quoted_string(FILE *out, const char *str)
2341 while ((p = strchr(str, '"'))) {
2344 fprintf(out, "%.*s", len, str);
2352 static void print_symbol(FILE *out, struct menu *menu)
2354 struct symbol *sym = menu->sym;
2355 struct property *prop;
2357 if (sym_is_choice(sym))
2358 fprintf(out, "\nchoice\n");
2360 fprintf(out, "\nconfig %s\n", sym->name);
2361 switch (sym->type) {
2363 fputs(" boolean\n", out);
2366 fputs(" tristate\n", out);
2369 fputs(" string\n", out);
2372 fputs(" integer\n", out);
2375 fputs(" hex\n", out);
2378 fputs(" ???\n", out);
2381 for (prop = sym->prop; prop; prop = prop->next) {
2382 if (prop->menu != menu)
2384 switch (prop->type) {
2386 fputs(" prompt ", out);
2387 print_quoted_string(out, prop->text);
2388 if (!expr_is_yes(prop->visible.expr)) {
2390 expr_fprint(prop->visible.expr, out);
2395 fputs( " default ", out);
2396 expr_fprint(prop->expr, out);
2397 if (!expr_is_yes(prop->visible.expr)) {
2399 expr_fprint(prop->visible.expr, out);
2404 fputs(" #choice value\n", out);
2407 fputs( " select ", out);
2408 expr_fprint(prop->expr, out);
2412 fputs( " range ", out);
2413 expr_fprint(prop->expr, out);
2417 fputs( " menu ", out);
2418 print_quoted_string(out, prop->text);
2422 fprintf(out, " unknown prop %d!\n", prop->type);
2427 int len = strlen(menu->help);
2428 while (menu->help[--len] == '\n')
2429 menu->help[len] = 0;
2430 fprintf(out, " help\n%s\n", menu->help);
2434 void zconfdump(FILE *out)
2436 struct property *prop;
2440 menu = rootmenu.list;
2442 if ((sym = menu->sym))
2443 print_symbol(out, menu);
2444 else if ((prop = menu->prompt)) {
2445 switch (prop->type) {
2447 fputs("\ncomment ", out);
2448 print_quoted_string(out, prop->text);
2452 fputs("\nmenu ", out);
2453 print_quoted_string(out, prop->text);
2459 if (!expr_is_yes(prop->visible.expr)) {
2460 fputs(" depends ", out);
2461 expr_fprint(prop->visible.expr, out);
2468 else if (menu->next)
2470 else while ((menu = menu->parent)) {
2471 if (menu->prompt && menu->prompt->type == P_MENU)
2472 fputs("\nendmenu\n", out);
2481 #include "lex.zconf.c"
2483 #include "confdata.c"