1 /* A Bison parser, made by GNU Bison 2.4.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6 2009, 2010 Free Software Foundation, Inc.
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
44 /* Identify Bison output. */
48 #define YYBISON_VERSION "2.4.3"
51 #define YYSKELETON_NAME "yacc.c"
62 /* Using locations. */
63 #define YYLSP_NEEDED 0
65 /* Substitute the variable and function names. */
66 #define yyparse zconfparse
67 #define yylex zconflex
68 #define yyerror zconferror
69 #define yylval zconflval
70 #define yychar zconfchar
71 #define yydebug zconfdebug
72 #define yynerrs zconfnerrs
75 /* Copy the first part of user declarations. */
79 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
80 * Released under the terms of the GNU GPL v2.0.
90 #define LKC_DIRECT_LINK
93 #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
96 #define DEBUG_PARSE 0x0002
100 extern int zconflex(void);
101 static void zconfprint(const char *err, ...);
102 static void zconf_error(const char *err, ...);
103 static void zconferror(const char *err);
104 static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
106 struct symbol *symbol_hash[SYMBOL_HASHSIZE];
108 static struct menu *current_menu, *current_entry;
113 /* Enabling traces. */
118 /* Enabling verbose error messages. */
119 #ifdef YYERROR_VERBOSE
120 # undef YYERROR_VERBOSE
121 # define YYERROR_VERBOSE 1
123 # define YYERROR_VERBOSE 0
126 /* Enabling the token table. */
127 #ifndef YYTOKEN_TABLE
128 # define YYTOKEN_TABLE 0
135 /* Put the tokens into the symbol table, so that GDB and other debuggers
176 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
177 typedef union YYSTYPE
183 struct symbol *symbol;
186 const struct kconf_id *id;
191 # define YYSTYPE_IS_TRIVIAL 1
192 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
193 # define YYSTYPE_IS_DECLARED 1
197 /* Copy the second part of user declarations. */
200 /* Include zconf.hash.c here so it can see the token constants. */
201 #include "zconf.hash.c"
210 typedef YYTYPE_UINT8 yytype_uint8;
212 typedef unsigned char yytype_uint8;
216 typedef YYTYPE_INT8 yytype_int8;
217 #elif (defined __STDC__ || defined __C99__FUNC__ \
218 || defined __cplusplus || defined _MSC_VER)
219 typedef signed char yytype_int8;
221 typedef short int yytype_int8;
225 typedef YYTYPE_UINT16 yytype_uint16;
227 typedef unsigned short int yytype_uint16;
231 typedef YYTYPE_INT16 yytype_int16;
233 typedef short int yytype_int16;
237 # ifdef __SIZE_TYPE__
238 # define YYSIZE_T __SIZE_TYPE__
239 # elif defined size_t
240 # define YYSIZE_T size_t
241 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
242 || defined __cplusplus || defined _MSC_VER)
243 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
244 # define YYSIZE_T size_t
246 # define YYSIZE_T unsigned int
250 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
253 # if defined YYENABLE_NLS && YYENABLE_NLS
255 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
256 # define YY_(msgid) dgettext ("bison-runtime", msgid)
260 # define YY_(msgid) msgid
264 /* Suppress unused-variable warnings by "using" E. */
265 #if ! defined lint || defined __GNUC__
266 # define YYUSE(e) ((void) (e))
268 # define YYUSE(e) /* empty */
271 /* Identity function, used to suppress warnings about constant conditions. */
275 #if (defined __STDC__ || defined __C99__FUNC__ \
276 || defined __cplusplus || defined _MSC_VER)
289 #if ! defined yyoverflow || YYERROR_VERBOSE
291 /* The parser invokes alloca or malloc; define the necessary symbols. */
293 # ifdef YYSTACK_USE_ALLOCA
294 # if YYSTACK_USE_ALLOCA
296 # define YYSTACK_ALLOC __builtin_alloca
297 # elif defined __BUILTIN_VA_ARG_INCR
298 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
300 # define YYSTACK_ALLOC __alloca
301 # elif defined _MSC_VER
302 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
303 # define alloca _alloca
305 # define YYSTACK_ALLOC alloca
306 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
307 || defined __cplusplus || defined _MSC_VER)
308 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
317 # ifdef YYSTACK_ALLOC
318 /* Pacify GCC's `empty if-body' warning. */
319 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
320 # ifndef YYSTACK_ALLOC_MAXIMUM
321 /* The OS might guarantee only one guard page at the bottom of the stack,
322 and a page size can be as small as 4096 bytes. So we cannot safely
323 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
324 to allow for a few compiler-allocated temporary stack slots. */
325 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
328 # define YYSTACK_ALLOC YYMALLOC
329 # define YYSTACK_FREE YYFREE
330 # ifndef YYSTACK_ALLOC_MAXIMUM
331 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
333 # if (defined __cplusplus && ! defined _STDLIB_H \
334 && ! ((defined YYMALLOC || defined malloc) \
335 && (defined YYFREE || defined free)))
336 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
342 # define YYMALLOC malloc
343 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
344 || defined __cplusplus || defined _MSC_VER)
345 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
350 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
351 || defined __cplusplus || defined _MSC_VER)
352 void free (void *); /* INFRINGES ON USER NAME SPACE */
356 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
359 #if (! defined yyoverflow \
360 && (! defined __cplusplus \
361 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
363 /* A type that is properly aligned for any stack member. */
366 yytype_int16 yyss_alloc;
370 /* The size of the maximum gap between one aligned stack and the next. */
371 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
373 /* The size of an array large to enough to hold all stacks, each with
375 # define YYSTACK_BYTES(N) \
376 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
377 + YYSTACK_GAP_MAXIMUM)
379 /* Copy COUNT objects from FROM to TO. The source and destination do
382 # if defined __GNUC__ && 1 < __GNUC__
383 # define YYCOPY(To, From, Count) \
384 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
386 # define YYCOPY(To, From, Count) \
390 for (yyi = 0; yyi < (Count); yyi++) \
391 (To)[yyi] = (From)[yyi]; \
397 /* Relocate STACK from its old location to the new one. The
398 local variables YYSIZE and YYSTACKSIZE give the old and new number of
399 elements in the stack, and YYPTR gives the new location of the
400 stack. Advance YYPTR to a properly aligned location for the next
402 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
405 YYSIZE_T yynewbytes; \
406 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
407 Stack = &yyptr->Stack_alloc; \
408 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
409 yyptr += yynewbytes / sizeof (*yyptr); \
415 /* YYFINAL -- State number of the termination state. */
417 /* YYLAST -- Last index in YYTABLE. */
420 /* YYNTOKENS -- Number of terminals. */
422 /* YYNNTS -- Number of nonterminals. */
424 /* YYNRULES -- Number of rules. */
426 /* YYNRULES -- Number of states. */
427 #define YYNSTATES 191
429 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
431 #define YYMAXUTOK 290
433 #define YYTRANSLATE(YYX) \
434 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
436 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
437 static const yytype_uint8 yytranslate[] =
439 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 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, 1, 2, 3, 4,
465 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
466 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
467 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
472 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
474 static const yytype_uint16 yyprhs[] =
476 0, 0, 3, 6, 8, 11, 13, 14, 17, 20,
477 23, 26, 31, 36, 40, 42, 44, 46, 48, 50,
478 52, 54, 56, 58, 60, 62, 64, 66, 68, 72,
479 75, 79, 82, 86, 89, 90, 93, 96, 99, 102,
480 105, 108, 112, 117, 122, 127, 133, 137, 138, 142,
481 143, 146, 150, 153, 155, 159, 160, 163, 166, 169,
482 172, 175, 180, 184, 187, 192, 193, 196, 200, 202,
483 206, 207, 210, 213, 216, 220, 224, 228, 230, 234,
484 235, 238, 241, 244, 248, 252, 255, 258, 261, 262,
485 265, 268, 271, 276, 277, 280, 283, 286, 287, 290,
486 292, 294, 297, 300, 303, 305, 308, 309, 312, 314,
487 318, 322, 326, 329, 333, 337, 339, 341, 342
490 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
491 static const yytype_int8 yyrhs[] =
493 37, 0, -1, 81, 38, -1, 38, -1, 63, 39,
494 -1, 39, -1, -1, 39, 41, -1, 39, 55, -1,
495 39, 67, -1, 39, 80, -1, 39, 26, 1, 31,
496 -1, 39, 40, 1, 31, -1, 39, 1, 31, -1,
497 16, -1, 18, -1, 19, -1, 21, -1, 17, -1,
498 22, -1, 20, -1, 23, -1, 31, -1, 61, -1,
499 71, -1, 44, -1, 46, -1, 69, -1, 26, 1,
500 31, -1, 1, 31, -1, 10, 26, 31, -1, 43,
501 47, -1, 11, 26, 31, -1, 45, 47, -1, -1,
502 47, 48, -1, 47, 49, -1, 47, 75, -1, 47,
503 73, -1, 47, 42, -1, 47, 31, -1, 19, 78,
504 31, -1, 18, 79, 82, 31, -1, 20, 83, 82,
505 31, -1, 21, 26, 82, 31, -1, 22, 84, 84,
506 82, 31, -1, 24, 50, 31, -1, -1, 50, 26,
507 51, -1, -1, 34, 79, -1, 7, 85, 31, -1,
508 52, 56, -1, 80, -1, 53, 58, 54, -1, -1,
509 56, 57, -1, 56, 75, -1, 56, 73, -1, 56,
510 31, -1, 56, 42, -1, 18, 79, 82, 31, -1,
511 19, 78, 31, -1, 17, 31, -1, 20, 26, 82,
512 31, -1, -1, 58, 41, -1, 14, 83, 81, -1,
513 80, -1, 59, 62, 60, -1, -1, 62, 41, -1,
514 62, 67, -1, 62, 55, -1, 3, 79, 81, -1,
515 4, 79, 31, -1, 64, 76, 74, -1, 80, -1,
516 65, 68, 66, -1, -1, 68, 41, -1, 68, 67,
517 -1, 68, 55, -1, 6, 79, 31, -1, 9, 79,
518 31, -1, 70, 74, -1, 12, 31, -1, 72, 13,
519 -1, -1, 74, 75, -1, 74, 31, -1, 74, 42,
520 -1, 16, 25, 83, 31, -1, -1, 76, 77, -1,
521 76, 31, -1, 23, 82, -1, -1, 79, 82, -1,
522 26, -1, 27, -1, 5, 31, -1, 8, 31, -1,
523 15, 31, -1, 31, -1, 81, 31, -1, -1, 14,
524 83, -1, 84, -1, 84, 34, 84, -1, 84, 28,
525 84, -1, 30, 83, 29, -1, 35, 83, -1, 83,
526 32, 83, -1, 83, 33, 83, -1, 26, -1, 27,
530 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
531 static const yytype_uint16 yyrline[] =
533 0, 104, 104, 104, 106, 106, 108, 110, 111, 112,
534 113, 114, 115, 119, 123, 123, 123, 123, 123, 123,
535 123, 123, 127, 128, 129, 130, 131, 132, 136, 137,
536 143, 151, 157, 165, 175, 177, 178, 179, 180, 181,
537 182, 185, 193, 199, 209, 215, 221, 224, 226, 237,
538 238, 243, 252, 257, 265, 268, 270, 271, 272, 273,
539 274, 277, 283, 294, 300, 310, 312, 317, 325, 333,
540 336, 338, 339, 340, 345, 352, 359, 364, 372, 375,
541 377, 378, 379, 382, 390, 397, 404, 410, 417, 419,
542 420, 421, 424, 432, 434, 435, 438, 445, 447, 452,
543 453, 456, 457, 458, 462, 463, 466, 467, 470, 471,
544 472, 473, 474, 475, 476, 479, 480, 483, 484
548 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
549 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
550 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
551 static const char *const yytname[] =
553 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
554 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
555 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
556 "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE",
557 "T_VISIBLE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
558 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
559 "T_NOT", "$accept", "input", "start", "stmt_list", "option_name",
560 "common_stmt", "option_error", "config_entry_start", "config_stmt",
561 "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
562 "config_option", "symbol_option", "symbol_option_list",
563 "symbol_option_arg", "choice", "choice_entry", "choice_end",
564 "choice_stmt", "choice_option_list", "choice_option", "choice_block",
565 "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu",
566 "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt",
567 "comment", "comment_stmt", "help_start", "help", "depends_list",
568 "depends", "visibility_list", "visible", "prompt_stmt_opt", "prompt",
569 "end", "nl", "if_expr", "expr", "symbol", "word_opt", 0
574 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
576 static const yytype_uint16 yytoknum[] =
578 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
579 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
580 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
581 285, 286, 287, 288, 289, 290
585 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
586 static const yytype_uint8 yyr1[] =
588 0, 36, 37, 37, 38, 38, 39, 39, 39, 39,
589 39, 39, 39, 39, 40, 40, 40, 40, 40, 40,
590 40, 40, 41, 41, 41, 41, 41, 41, 42, 42,
591 43, 44, 45, 46, 47, 47, 47, 47, 47, 47,
592 47, 48, 48, 48, 48, 48, 49, 50, 50, 51,
593 51, 52, 53, 54, 55, 56, 56, 56, 56, 56,
594 56, 57, 57, 57, 57, 58, 58, 59, 60, 61,
595 62, 62, 62, 62, 63, 64, 65, 66, 67, 68,
596 68, 68, 68, 69, 70, 71, 72, 73, 74, 74,
597 74, 74, 75, 76, 76, 76, 77, 78, 78, 79,
598 79, 80, 80, 80, 81, 81, 82, 82, 83, 83,
599 83, 83, 83, 83, 83, 84, 84, 85, 85
602 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
603 static const yytype_uint8 yyr2[] =
605 0, 2, 2, 1, 2, 1, 0, 2, 2, 2,
606 2, 4, 4, 3, 1, 1, 1, 1, 1, 1,
607 1, 1, 1, 1, 1, 1, 1, 1, 3, 2,
608 3, 2, 3, 2, 0, 2, 2, 2, 2, 2,
609 2, 3, 4, 4, 4, 5, 3, 0, 3, 0,
610 2, 3, 2, 1, 3, 0, 2, 2, 2, 2,
611 2, 4, 3, 2, 4, 0, 2, 3, 1, 3,
612 0, 2, 2, 2, 3, 3, 3, 1, 3, 0,
613 2, 2, 2, 3, 3, 2, 2, 2, 0, 2,
614 2, 2, 4, 0, 2, 2, 2, 0, 2, 1,
615 1, 2, 2, 2, 1, 2, 0, 2, 1, 3,
616 3, 3, 2, 3, 3, 1, 1, 0, 1
619 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
620 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
621 means the default is an error. */
622 static const yytype_uint8 yydefact[] =
624 6, 0, 104, 0, 3, 0, 6, 6, 99, 100,
625 0, 1, 0, 0, 0, 0, 117, 0, 0, 0,
626 0, 0, 0, 14, 18, 15, 16, 20, 17, 19,
627 21, 0, 22, 0, 7, 34, 25, 34, 26, 55,
628 65, 8, 70, 23, 93, 79, 9, 27, 88, 24,
629 10, 0, 105, 2, 74, 13, 0, 101, 0, 118,
630 0, 102, 0, 0, 0, 115, 116, 0, 0, 0,
631 108, 103, 0, 0, 0, 0, 0, 0, 0, 88,
632 0, 0, 75, 83, 51, 84, 30, 32, 0, 112,
633 0, 0, 67, 0, 0, 11, 12, 0, 0, 0,
634 0, 97, 0, 0, 0, 47, 0, 40, 39, 35,
635 36, 0, 38, 37, 0, 0, 97, 0, 59, 60,
636 56, 58, 57, 66, 54, 53, 71, 73, 69, 72,
637 68, 106, 95, 0, 94, 80, 82, 78, 81, 77,
638 90, 91, 89, 111, 113, 114, 110, 109, 29, 86,
639 0, 106, 0, 106, 106, 106, 0, 0, 0, 87,
640 63, 106, 0, 106, 0, 96, 0, 0, 41, 98,
641 0, 0, 106, 49, 46, 28, 0, 62, 0, 107,
642 92, 42, 43, 44, 0, 0, 48, 61, 64, 45,
646 /* YYDEFGOTO[NTERM-NUM]. */
647 static const yytype_int16 yydefgoto[] =
649 -1, 3, 4, 5, 33, 34, 108, 35, 36, 37,
650 38, 74, 109, 110, 157, 186, 39, 40, 124, 41,
651 76, 120, 77, 42, 128, 43, 78, 6, 44, 45,
652 137, 46, 80, 47, 48, 49, 111, 112, 81, 113,
653 79, 134, 152, 153, 50, 7, 165, 69, 70, 60
656 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
658 #define YYPACT_NINF -90
659 static const yytype_int16 yypact[] =
661 4, 42, -90, 96, -90, 111, -90, 15, -90, -90,
662 75, -90, 82, 42, 104, 42, 110, 107, 42, 115,
663 125, -4, 121, -90, -90, -90, -90, -90, -90, -90,
664 -90, 162, -90, 163, -90, -90, -90, -90, -90, -90,
665 -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
666 -90, 139, -90, -90, 138, -90, 142, -90, 143, -90,
667 152, -90, 164, 167, 168, -90, -90, -4, -4, 77,
668 -18, -90, 177, 185, 33, 71, 195, 247, 236, -2,
669 236, 171, -90, -90, -90, -90, -90, -90, 41, -90,
670 -4, -4, 138, 97, 97, -90, -90, 186, 187, 194,
671 42, 42, -4, 196, 97, -90, 219, -90, -90, -90,
672 -90, 210, -90, -90, 204, 42, 42, 199, -90, -90,
673 -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
674 -90, 222, -90, 223, -90, -90, -90, -90, -90, -90,
675 -90, -90, -90, -90, 215, -90, -90, -90, -90, -90,
676 -4, 222, 228, 222, -5, 222, 97, 35, 229, -90,
677 -90, 222, 232, 222, -4, -90, 135, 233, -90, -90,
678 234, 235, 222, 240, -90, -90, 237, -90, 239, -13,
679 -90, -90, -90, -90, 244, 42, -90, -90, -90, -90,
683 /* YYPGOTO[NTERM-NUM]. */
684 static const yytype_int16 yypgoto[] =
686 -90, -90, 269, 271, -90, 23, -70, -90, -90, -90,
687 -90, 243, -90, -90, -90, -90, -90, -90, -90, -48,
688 -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
689 -90, -20, -90, -90, -90, -90, -90, 206, 205, -68,
690 -90, -90, 169, -1, 27, -7, 118, -66, -89, -90
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 -86
698 static const yytype_int16 yytable[] =
700 10, 88, 89, 54, 146, 147, 119, 1, 122, 164,
701 93, 141, 56, 142, 58, 156, 94, 62, 1, 90,
702 91, 131, 65, 66, 144, 145, 67, 90, 91, 132,
703 127, 68, 136, -31, 97, 2, 154, -31, -31, -31,
704 -31, -31, -31, -31, -31, 98, 52, -31, -31, 99,
705 -31, 100, 101, 102, 103, 104, -31, 105, 129, 106,
706 138, 173, 92, 141, 107, 142, 174, 172, 8, 9,
707 143, -33, 97, 90, 91, -33, -33, -33, -33, -33,
708 -33, -33, -33, 98, 166, -33, -33, 99, -33, 100,
709 101, 102, 103, 104, -33, 105, 11, 106, 179, 151,
710 123, 126, 107, 135, 125, 130, 2, 139, 2, 90,
711 91, -5, 12, 55, 161, 13, 14, 15, 16, 17,
712 18, 19, 20, 65, 66, 21, 22, 23, 24, 25,
713 26, 27, 28, 29, 30, 57, 59, 31, 61, -4,
714 12, 63, 32, 13, 14, 15, 16, 17, 18, 19,
715 20, 64, 71, 21, 22, 23, 24, 25, 26, 27,
716 28, 29, 30, 72, 73, 31, 180, 90, 91, 52,
717 32, -85, 97, 82, 83, -85, -85, -85, -85, -85,
718 -85, -85, -85, 84, 190, -85, -85, 99, -85, -85,
719 -85, -85, -85, -85, -85, 85, 97, 106, 86, 87,
720 -52, -52, 140, -52, -52, -52, -52, 98, 95, -52,
721 -52, 99, 114, 115, 116, 117, 96, 148, 149, 150,
722 158, 106, 155, 159, 97, 163, 118, -76, -76, -76,
723 -76, -76, -76, -76, -76, 160, 164, -76, -76, 99,
724 13, 14, 15, 16, 17, 18, 19, 20, 91, 106,
725 21, 22, 14, 15, 140, 17, 18, 19, 20, 168,
726 175, 21, 22, 177, 181, 182, 183, 32, 187, 167,
727 188, 169, 170, 171, 185, 189, 53, 51, 32, 176,
728 75, 178, 121, 0, 133, 162, 0, 0, 0, 0,
732 static const yytype_int16 yycheck[] =
734 1, 67, 68, 10, 93, 94, 76, 3, 76, 14,
735 28, 81, 13, 81, 15, 104, 34, 18, 3, 32,
736 33, 23, 26, 27, 90, 91, 30, 32, 33, 31,
737 78, 35, 80, 0, 1, 31, 102, 4, 5, 6,
738 7, 8, 9, 10, 11, 12, 31, 14, 15, 16,
739 17, 18, 19, 20, 21, 22, 23, 24, 78, 26,
740 80, 26, 69, 133, 31, 133, 31, 156, 26, 27,
741 29, 0, 1, 32, 33, 4, 5, 6, 7, 8,
742 9, 10, 11, 12, 150, 14, 15, 16, 17, 18,
743 19, 20, 21, 22, 23, 24, 0, 26, 164, 100,
744 77, 78, 31, 80, 77, 78, 31, 80, 31, 32,
745 33, 0, 1, 31, 115, 4, 5, 6, 7, 8,
746 9, 10, 11, 26, 27, 14, 15, 16, 17, 18,
747 19, 20, 21, 22, 23, 31, 26, 26, 31, 0,
748 1, 26, 31, 4, 5, 6, 7, 8, 9, 10,
749 11, 26, 31, 14, 15, 16, 17, 18, 19, 20,
750 21, 22, 23, 1, 1, 26, 31, 32, 33, 31,
751 31, 0, 1, 31, 31, 4, 5, 6, 7, 8,
752 9, 10, 11, 31, 185, 14, 15, 16, 17, 18,
753 19, 20, 21, 22, 23, 31, 1, 26, 31, 31,
754 5, 6, 31, 8, 9, 10, 11, 12, 31, 14,
755 15, 16, 17, 18, 19, 20, 31, 31, 31, 25,
756 1, 26, 26, 13, 1, 26, 31, 4, 5, 6,
757 7, 8, 9, 10, 11, 31, 14, 14, 15, 16,
758 4, 5, 6, 7, 8, 9, 10, 11, 33, 26,
759 14, 15, 5, 6, 31, 8, 9, 10, 11, 31,
760 31, 14, 15, 31, 31, 31, 31, 31, 31, 151,
761 31, 153, 154, 155, 34, 31, 7, 6, 31, 161,
762 37, 163, 76, -1, 79, 116, -1, -1, -1, -1,
766 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
767 symbol of state STATE-NUM. */
768 static const yytype_uint8 yystos[] =
770 0, 3, 31, 37, 38, 39, 63, 81, 26, 27,
771 79, 0, 1, 4, 5, 6, 7, 8, 9, 10,
772 11, 14, 15, 16, 17, 18, 19, 20, 21, 22,
773 23, 26, 31, 40, 41, 43, 44, 45, 46, 52,
774 53, 55, 59, 61, 64, 65, 67, 69, 70, 71,
775 80, 39, 31, 38, 81, 31, 79, 31, 79, 26,
776 85, 31, 79, 26, 26, 26, 27, 30, 35, 83,
777 84, 31, 1, 1, 47, 47, 56, 58, 62, 76,
778 68, 74, 31, 31, 31, 31, 31, 31, 83, 83,
779 32, 33, 81, 28, 34, 31, 31, 1, 12, 16,
780 18, 19, 20, 21, 22, 24, 26, 31, 42, 48,
781 49, 72, 73, 75, 17, 18, 19, 20, 31, 42,
782 57, 73, 75, 41, 54, 80, 41, 55, 60, 67,
783 80, 23, 31, 74, 77, 41, 55, 66, 67, 80,
784 31, 42, 75, 29, 83, 83, 84, 84, 31, 31,
785 25, 79, 78, 79, 83, 26, 84, 50, 1, 13,
786 31, 79, 78, 26, 14, 82, 83, 82, 31, 82,
787 82, 82, 84, 26, 31, 31, 82, 31, 82, 83,
788 31, 31, 31, 31, 82, 34, 51, 31, 31, 31,
792 #define yyerrok (yyerrstatus = 0)
793 #define yyclearin (yychar = YYEMPTY)
797 #define YYACCEPT goto yyacceptlab
798 #define YYABORT goto yyabortlab
799 #define YYERROR goto yyerrorlab
802 /* Like YYERROR except do call yyerror. This remains here temporarily
803 to ease the transition to the new meaning of YYERROR, for GCC.
804 Once GCC version 2 has supplanted version 1, this can go. However,
805 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
806 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
809 #define YYFAIL goto yyerrlab
811 /* This is here to suppress warnings from the GCC cpp's
812 -Wunused-macros. Normally we don't worry about that warning, but
813 some users do, and we want to make it easy for users to remove
814 YYFAIL uses, which will produce warnings from Bison 2.5. */
817 #define YYRECOVERING() (!!yyerrstatus)
819 #define YYBACKUP(Token, Value) \
821 if (yychar == YYEMPTY && yylen == 1) \
825 yytoken = YYTRANSLATE (yychar); \
831 yyerror (YY_("syntax error: cannot back up")); \
838 #define YYERRCODE 256
841 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
842 If N is 0, then set CURRENT to the empty location which ends
843 the previous symbol: RHS[0] (always defined). */
845 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
846 #ifndef YYLLOC_DEFAULT
847 # define YYLLOC_DEFAULT(Current, Rhs, N) \
851 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
852 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
853 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
854 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
858 (Current).first_line = (Current).last_line = \
859 YYRHSLOC (Rhs, 0).last_line; \
860 (Current).first_column = (Current).last_column = \
861 YYRHSLOC (Rhs, 0).last_column; \
867 /* YY_LOCATION_PRINT -- Print the location on the stream.
868 This macro was not mandated originally: define only if we know
869 we won't break user code: when these are the locations we know. */
871 #ifndef YY_LOCATION_PRINT
872 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
873 # define YY_LOCATION_PRINT(File, Loc) \
874 fprintf (File, "%d.%d-%d.%d", \
875 (Loc).first_line, (Loc).first_column, \
876 (Loc).last_line, (Loc).last_column)
878 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
883 /* YYLEX -- calling `yylex' with the right arguments. */
886 # define YYLEX yylex (YYLEX_PARAM)
888 # define YYLEX yylex ()
891 /* Enable debugging if requested. */
895 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
896 # define YYFPRINTF fprintf
899 # define YYDPRINTF(Args) \
905 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
909 YYFPRINTF (stderr, "%s ", Title); \
910 yy_symbol_print (stderr, \
912 YYFPRINTF (stderr, "\n"); \
917 /*--------------------------------.
918 | Print this symbol on YYOUTPUT. |
919 `--------------------------------*/
922 #if (defined __STDC__ || defined __C99__FUNC__ \
923 || defined __cplusplus || defined _MSC_VER)
925 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
928 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
931 YYSTYPE const * const yyvaluep;
937 if (yytype < YYNTOKENS)
938 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
950 /*--------------------------------.
951 | Print this symbol on YYOUTPUT. |
952 `--------------------------------*/
954 #if (defined __STDC__ || defined __C99__FUNC__ \
955 || defined __cplusplus || defined _MSC_VER)
957 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
960 yy_symbol_print (yyoutput, yytype, yyvaluep)
963 YYSTYPE const * const yyvaluep;
966 if (yytype < YYNTOKENS)
967 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
969 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
971 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
972 YYFPRINTF (yyoutput, ")");
975 /*------------------------------------------------------------------.
976 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
978 `------------------------------------------------------------------*/
980 #if (defined __STDC__ || defined __C99__FUNC__ \
981 || defined __cplusplus || defined _MSC_VER)
983 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
986 yy_stack_print (yybottom, yytop)
987 yytype_int16 *yybottom;
991 YYFPRINTF (stderr, "Stack now");
992 for (; yybottom <= yytop; yybottom++)
994 int yybot = *yybottom;
995 YYFPRINTF (stderr, " %d", yybot);
997 YYFPRINTF (stderr, "\n");
1000 # define YY_STACK_PRINT(Bottom, Top) \
1003 yy_stack_print ((Bottom), (Top)); \
1007 /*------------------------------------------------.
1008 | Report that the YYRULE is going to be reduced. |
1009 `------------------------------------------------*/
1011 #if (defined __STDC__ || defined __C99__FUNC__ \
1012 || defined __cplusplus || defined _MSC_VER)
1014 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1017 yy_reduce_print (yyvsp, yyrule)
1022 int yynrhs = yyr2[yyrule];
1024 unsigned long int yylno = yyrline[yyrule];
1025 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1027 /* The symbols being reduced. */
1028 for (yyi = 0; yyi < yynrhs; yyi++)
1030 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1031 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1032 &(yyvsp[(yyi + 1) - (yynrhs)])
1034 YYFPRINTF (stderr, "\n");
1038 # define YY_REDUCE_PRINT(Rule) \
1041 yy_reduce_print (yyvsp, Rule); \
1044 /* Nonzero means print parse trace. It is left uninitialized so that
1045 multiple parsers can coexist. */
1047 #else /* !YYDEBUG */
1048 # define YYDPRINTF(Args)
1049 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1050 # define YY_STACK_PRINT(Bottom, Top)
1051 # define YY_REDUCE_PRINT(Rule)
1052 #endif /* !YYDEBUG */
1055 /* YYINITDEPTH -- initial size of the parser's stacks. */
1057 # define YYINITDEPTH 200
1060 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1061 if the built-in stack extension method is used).
1063 Do not make this value too large; the results are undefined if
1064 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1065 evaluated with infinite-precision integer arithmetic. */
1068 # define YYMAXDEPTH 10000
1076 # if defined __GLIBC__ && defined _STRING_H
1077 # define yystrlen strlen
1079 /* Return the length of YYSTR. */
1080 #if (defined __STDC__ || defined __C99__FUNC__ \
1081 || defined __cplusplus || defined _MSC_VER)
1083 yystrlen (const char *yystr)
1091 for (yylen = 0; yystr[yylen]; yylen++)
1099 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1100 # define yystpcpy stpcpy
1102 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1104 #if (defined __STDC__ || defined __C99__FUNC__ \
1105 || defined __cplusplus || defined _MSC_VER)
1107 yystpcpy (char *yydest, const char *yysrc)
1110 yystpcpy (yydest, yysrc)
1116 const char *yys = yysrc;
1118 while ((*yyd++ = *yys++) != '\0')
1127 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1128 quotes and backslashes, so that it's suitable for yyerror. The
1129 heuristic is that double-quoting is unnecessary unless the string
1130 contains an apostrophe, a comma, or backslash (other than
1131 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1132 null, do not copy; instead, return the length of what the result
1135 yytnamerr (char *yyres, const char *yystr)
1140 char const *yyp = yystr;
1147 goto do_not_strip_quotes;
1151 goto do_not_strip_quotes;
1164 do_not_strip_quotes: ;
1168 return yystrlen (yystr);
1170 return yystpcpy (yyres, yystr) - yyres;
1174 /* Copy into YYRESULT an error message about the unexpected token
1175 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1176 including the terminating null byte. If YYRESULT is null, do not
1177 copy anything; just return the number of bytes that would be
1178 copied. As a special case, return 0 if an ordinary "syntax error"
1179 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1180 size calculation. */
1182 yysyntax_error (char *yyresult, int yystate, int yychar)
1184 int yyn = yypact[yystate];
1186 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1190 int yytype = YYTRANSLATE (yychar);
1191 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1192 YYSIZE_T yysize = yysize0;
1194 int yysize_overflow = 0;
1195 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1196 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1200 /* This is so xgettext sees the translatable formats that are
1201 constructed on the fly. */
1202 YY_("syntax error, unexpected %s");
1203 YY_("syntax error, unexpected %s, expecting %s");
1204 YY_("syntax error, unexpected %s, expecting %s or %s");
1205 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1206 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1210 static char const yyunexpected[] = "syntax error, unexpected %s";
1211 static char const yyexpecting[] = ", expecting %s";
1212 static char const yyor[] = " or %s";
1213 char yyformat[sizeof yyunexpected
1214 + sizeof yyexpecting - 1
1215 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1216 * (sizeof yyor - 1))];
1217 char const *yyprefix = yyexpecting;
1219 /* Start YYX at -YYN if negative to avoid negative indexes in
1221 int yyxbegin = yyn < 0 ? -yyn : 0;
1223 /* Stay within bounds of both yycheck and yytname. */
1224 int yychecklim = YYLAST - yyn + 1;
1225 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1228 yyarg[0] = yytname[yytype];
1229 yyfmt = yystpcpy (yyformat, yyunexpected);
1231 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1232 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1234 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1238 yyformat[sizeof yyunexpected - 1] = '\0';
1241 yyarg[yycount++] = yytname[yyx];
1242 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1243 yysize_overflow |= (yysize1 < yysize);
1245 yyfmt = yystpcpy (yyfmt, yyprefix);
1249 yyf = YY_(yyformat);
1250 yysize1 = yysize + yystrlen (yyf);
1251 yysize_overflow |= (yysize1 < yysize);
1254 if (yysize_overflow)
1255 return YYSIZE_MAXIMUM;
1259 /* Avoid sprintf, as that infringes on the user's name space.
1260 Don't have undefined behavior even if the translation
1261 produced a string with the wrong number of "%s"s. */
1262 char *yyp = yyresult;
1264 while ((*yyp = *yyf) != '\0')
1266 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1268 yyp += yytnamerr (yyp, yyarg[yyi++]);
1281 #endif /* YYERROR_VERBOSE */
1284 /*-----------------------------------------------.
1285 | Release the memory associated to this symbol. |
1286 `-----------------------------------------------*/
1289 #if (defined __STDC__ || defined __C99__FUNC__ \
1290 || defined __cplusplus || defined _MSC_VER)
1292 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1295 yydestruct (yymsg, yytype, yyvaluep)
1305 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1309 case 53: /* "choice_entry" */
1312 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1313 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1314 if (current_menu == (yyvaluep->menu))
1319 case 59: /* "if_entry" */
1322 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1323 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1324 if (current_menu == (yyvaluep->menu))
1329 case 65: /* "menu_entry" */
1332 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1333 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1334 if (current_menu == (yyvaluep->menu))
1345 /* Prevent warnings from -Wmissing-prototypes. */
1346 #ifdef YYPARSE_PARAM
1347 #if defined __STDC__ || defined __cplusplus
1348 int yyparse (void *YYPARSE_PARAM);
1352 #else /* ! YYPARSE_PARAM */
1353 #if defined __STDC__ || defined __cplusplus
1358 #endif /* ! YYPARSE_PARAM */
1361 /* The lookahead symbol. */
1364 /* The semantic value of the lookahead symbol. */
1367 /* Number of syntax errors so far. */
1372 /*-------------------------.
1373 | yyparse or yypush_parse. |
1374 `-------------------------*/
1376 #ifdef YYPARSE_PARAM
1377 #if (defined __STDC__ || defined __C99__FUNC__ \
1378 || defined __cplusplus || defined _MSC_VER)
1380 yyparse (void *YYPARSE_PARAM)
1383 yyparse (YYPARSE_PARAM)
1384 void *YYPARSE_PARAM;
1386 #else /* ! YYPARSE_PARAM */
1387 #if (defined __STDC__ || defined __C99__FUNC__ \
1388 || defined __cplusplus || defined _MSC_VER)
1401 /* Number of tokens to shift before error messages enabled. */
1404 /* The stacks and their tools:
1405 `yyss': related to states.
1406 `yyvs': related to semantic values.
1408 Refer to the stacks thru separate pointers, to allow yyoverflow
1409 to reallocate them elsewhere. */
1411 /* The state stack. */
1412 yytype_int16 yyssa[YYINITDEPTH];
1414 yytype_int16 *yyssp;
1416 /* The semantic value stack. */
1417 YYSTYPE yyvsa[YYINITDEPTH];
1421 YYSIZE_T yystacksize;
1425 /* Lookahead token as an internal (translated) token number. */
1427 /* The variables used to return semantic value and location from the
1432 /* Buffer for error messages, and its allocated size. */
1434 char *yymsg = yymsgbuf;
1435 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1438 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1440 /* The number of symbols on the RHS of the reduced rule.
1441 Keep to zero when no symbol should be popped. */
1447 yystacksize = YYINITDEPTH;
1449 YYDPRINTF ((stderr, "Starting parse\n"));
1454 yychar = YYEMPTY; /* Cause a token to be read. */
1456 /* Initialize stack pointers.
1457 Waste one element of value and location stack
1458 so that they stay on the same level as the state stack.
1459 The wasted elements are never initialized. */
1465 /*------------------------------------------------------------.
1466 | yynewstate -- Push a new state, which is found in yystate. |
1467 `------------------------------------------------------------*/
1469 /* In all cases, when you get here, the value and location stacks
1470 have just been pushed. So pushing a state here evens the stacks. */
1476 if (yyss + yystacksize - 1 <= yyssp)
1478 /* Get the current used size of the three stacks, in elements. */
1479 YYSIZE_T yysize = yyssp - yyss + 1;
1483 /* Give user a chance to reallocate the stack. Use copies of
1484 these so that the &'s don't force the real ones into
1486 YYSTYPE *yyvs1 = yyvs;
1487 yytype_int16 *yyss1 = yyss;
1489 /* Each stack pointer address is followed by the size of the
1490 data in use in that stack, in bytes. This used to be a
1491 conditional around just the two extra args, but that might
1492 be undefined if yyoverflow is a macro. */
1493 yyoverflow (YY_("memory exhausted"),
1494 &yyss1, yysize * sizeof (*yyssp),
1495 &yyvs1, yysize * sizeof (*yyvsp),
1501 #else /* no yyoverflow */
1502 # ifndef YYSTACK_RELOCATE
1503 goto yyexhaustedlab;
1505 /* Extend the stack our own way. */
1506 if (YYMAXDEPTH <= yystacksize)
1507 goto yyexhaustedlab;
1509 if (YYMAXDEPTH < yystacksize)
1510 yystacksize = YYMAXDEPTH;
1513 yytype_int16 *yyss1 = yyss;
1514 union yyalloc *yyptr =
1515 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1517 goto yyexhaustedlab;
1518 YYSTACK_RELOCATE (yyss_alloc, yyss);
1519 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1520 # undef YYSTACK_RELOCATE
1522 YYSTACK_FREE (yyss1);
1525 #endif /* no yyoverflow */
1527 yyssp = yyss + yysize - 1;
1528 yyvsp = yyvs + yysize - 1;
1530 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1531 (unsigned long int) yystacksize));
1533 if (yyss + yystacksize - 1 <= yyssp)
1537 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1539 if (yystate == YYFINAL)
1549 /* Do appropriate processing given the current state. Read a
1550 lookahead token if we need one and don't already have one. */
1552 /* First try to decide what to do without reference to lookahead token. */
1553 yyn = yypact[yystate];
1554 if (yyn == YYPACT_NINF)
1557 /* Not known => get a lookahead token if don't already have one. */
1559 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1560 if (yychar == YYEMPTY)
1562 YYDPRINTF ((stderr, "Reading a token: "));
1566 if (yychar <= YYEOF)
1568 yychar = yytoken = YYEOF;
1569 YYDPRINTF ((stderr, "Now at end of input.\n"));
1573 yytoken = YYTRANSLATE (yychar);
1574 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1577 /* If the proper action on seeing token YYTOKEN is to reduce or to
1578 detect an error, take that action. */
1580 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1585 if (yyn == 0 || yyn == YYTABLE_NINF)
1591 /* Count tokens shifted since error; after three, turn off error
1596 /* Shift the lookahead token. */
1597 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1599 /* Discard the shifted token. */
1608 /*-----------------------------------------------------------.
1609 | yydefault -- do the default action for the current state. |
1610 `-----------------------------------------------------------*/
1612 yyn = yydefact[yystate];
1618 /*-----------------------------.
1619 | yyreduce -- Do a reduction. |
1620 `-----------------------------*/
1622 /* yyn is the number of a rule to reduce with. */
1625 /* If YYLEN is nonzero, implement the default value of the action:
1628 Otherwise, the following line sets YYVAL to garbage.
1629 This behavior is undocumented and Bison
1630 users should not rely upon it. Assigning to YYVAL
1631 unconditionally makes the parser a bit smaller, and it avoids a
1632 GCC warning that YYVAL may be used uninitialized. */
1633 yyval = yyvsp[1-yylen];
1636 YY_REDUCE_PRINT (yyn);
1641 { zconf_error("unexpected end statement"); ;}
1646 { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;}
1652 zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
1658 { zconf_error("invalid statement"); ;}
1663 { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;}
1668 { zconf_error("invalid option"); ;}
1674 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
1675 sym->flags |= SYMBOL_OPTIONAL;
1676 menu_add_entry(sym);
1677 printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1685 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1692 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
1693 sym->flags |= SYMBOL_OPTIONAL;
1694 menu_add_entry(sym);
1695 printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1702 if (current_entry->prompt)
1703 current_entry->prompt->type = P_MENU;
1705 zconfprint("warning: menuconfig statement without prompt");
1707 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1714 menu_set_type((yyvsp[(1) - (3)].id)->stype);
1715 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1716 zconf_curname(), zconf_lineno(),
1717 (yyvsp[(1) - (3)].id)->stype);
1724 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
1725 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1732 menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr));
1733 if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN)
1734 menu_set_type((yyvsp[(1) - (4)].id)->stype);
1735 printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
1736 zconf_curname(), zconf_lineno(),
1737 (yyvsp[(1) - (4)].id)->stype);
1744 menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
1745 printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1752 menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr));
1753 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1760 const struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
1761 if (id && id->flags & TF_OPTION)
1762 menu_add_option(id->token, (yyvsp[(3) - (3)].string));
1764 zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string));
1765 free((yyvsp[(2) - (3)].string));
1771 { (yyval.string) = NULL; ;}
1776 { (yyval.string) = (yyvsp[(2) - (2)].string); ;}
1782 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE);
1783 sym->flags |= SYMBOL_AUTO;
1784 menu_add_entry(sym);
1785 menu_add_expr(P_CHOICE, NULL, NULL);
1786 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1793 (yyval.menu) = menu_add_menu();
1800 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) {
1802 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
1810 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
1811 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1818 if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) {
1819 menu_set_type((yyvsp[(1) - (3)].id)->stype);
1820 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1821 zconf_curname(), zconf_lineno(),
1822 (yyvsp[(1) - (3)].id)->stype);
1831 current_entry->sym->flags |= SYMBOL_OPTIONAL;
1832 printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1839 if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) {
1840 menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
1841 printd(DEBUG_PARSE, "%s:%d:default\n",
1842 zconf_curname(), zconf_lineno());
1851 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
1852 menu_add_entry(NULL);
1853 menu_add_dep((yyvsp[(2) - (3)].expr));
1854 (yyval.menu) = menu_add_menu();
1861 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) {
1863 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
1871 menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1878 menu_add_entry(NULL);
1879 menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1880 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1887 (yyval.menu) = menu_add_menu();
1894 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) {
1896 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
1904 printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1905 zconf_nextfile((yyvsp[(2) - (3)].string));
1912 menu_add_entry(NULL);
1913 menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL);
1914 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1928 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
1936 current_entry->help = (yyvsp[(2) - (2)].string);
1943 menu_add_dep((yyvsp[(3) - (4)].expr));
1944 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
1951 menu_add_visibility((yyvsp[(2) - (2)].expr));
1958 menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
1964 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1969 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1974 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1979 { (yyval.expr) = NULL; ;}
1984 { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;}
1989 { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;}
1994 { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
1999 { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
2004 { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;}
2009 { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;}
2014 { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2019 { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2024 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;}
2029 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;}
2034 { (yyval.string) = NULL; ;}
2041 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2045 YY_STACK_PRINT (yyss, yyssp);
2049 /* Now `shift' the result of the reduction. Determine what state
2050 that goes to, based on the state we popped back to and the rule
2051 number reduced by. */
2055 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2056 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2057 yystate = yytable[yystate];
2059 yystate = yydefgoto[yyn - YYNTOKENS];
2064 /*------------------------------------.
2065 | yyerrlab -- here on detecting error |
2066 `------------------------------------*/
2068 /* If not already recovering from an error, report this error. */
2072 #if ! YYERROR_VERBOSE
2073 yyerror (YY_("syntax error"));
2076 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2077 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2079 YYSIZE_T yyalloc = 2 * yysize;
2080 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2081 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2082 if (yymsg != yymsgbuf)
2083 YYSTACK_FREE (yymsg);
2084 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2086 yymsg_alloc = yyalloc;
2090 yymsg_alloc = sizeof yymsgbuf;
2094 if (0 < yysize && yysize <= yymsg_alloc)
2096 (void) yysyntax_error (yymsg, yystate, yychar);
2101 yyerror (YY_("syntax error"));
2103 goto yyexhaustedlab;
2111 if (yyerrstatus == 3)
2113 /* If just tried and failed to reuse lookahead token after an
2114 error, discard it. */
2116 if (yychar <= YYEOF)
2118 /* Return failure if at end of input. */
2119 if (yychar == YYEOF)
2124 yydestruct ("Error: discarding",
2130 /* Else will try to reuse lookahead token after shifting the error
2135 /*---------------------------------------------------.
2136 | yyerrorlab -- error raised explicitly by YYERROR. |
2137 `---------------------------------------------------*/
2140 /* Pacify compilers like GCC when the user code never invokes
2141 YYERROR and the label yyerrorlab therefore never appears in user
2143 if (/*CONSTCOND*/ 0)
2146 /* Do not reclaim the symbols of the rule which action triggered
2150 YY_STACK_PRINT (yyss, yyssp);
2155 /*-------------------------------------------------------------.
2156 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2157 `-------------------------------------------------------------*/
2159 yyerrstatus = 3; /* Each real token shifted decrements this. */
2163 yyn = yypact[yystate];
2164 if (yyn != YYPACT_NINF)
2167 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2175 /* Pop the current state because it cannot handle the error token. */
2180 yydestruct ("Error: popping",
2181 yystos[yystate], yyvsp);
2184 YY_STACK_PRINT (yyss, yyssp);
2190 /* Shift the error token. */
2191 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2197 /*-------------------------------------.
2198 | yyacceptlab -- YYACCEPT comes here. |
2199 `-------------------------------------*/
2204 /*-----------------------------------.
2205 | yyabortlab -- YYABORT comes here. |
2206 `-----------------------------------*/
2211 #if !defined(yyoverflow) || YYERROR_VERBOSE
2212 /*-------------------------------------------------.
2213 | yyexhaustedlab -- memory exhaustion comes here. |
2214 `-------------------------------------------------*/
2216 yyerror (YY_("memory exhausted"));
2222 if (yychar != YYEMPTY)
2223 yydestruct ("Cleanup: discarding lookahead",
2225 /* Do not reclaim the symbols of the rule which action triggered
2226 this YYABORT or YYACCEPT. */
2228 YY_STACK_PRINT (yyss, yyssp);
2229 while (yyssp != yyss)
2231 yydestruct ("Cleanup: popping",
2232 yystos[*yyssp], yyvsp);
2237 YYSTACK_FREE (yyss);
2240 if (yymsg != yymsgbuf)
2241 YYSTACK_FREE (yymsg);
2243 /* Make sure YYID is used. */
2244 return YYID (yyresult);
2251 void conf_parse(const char *name)
2256 zconf_initscan(name);
2260 modules_sym = sym_lookup(NULL, 0);
2261 modules_sym->type = S_BOOLEAN;
2262 modules_sym->flags |= SYMBOL_AUTO;
2263 rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
2265 if (getenv("ZCONF_DEBUG"))
2270 if (!modules_sym->prop) {
2271 struct property *prop;
2273 prop = prop_alloc(P_DEFAULT, modules_sym);
2274 prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
2277 rootmenu.prompt->text = _(rootmenu.prompt->text);
2278 rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
2280 menu_finalize(&rootmenu);
2281 for_all_symbols(i, sym) {
2282 if (sym_check_deps(sym))
2287 sym_set_change_count(1);
2290 static const char *zconf_tokenname(int token)
2293 case T_MENU: return "menu";
2294 case T_ENDMENU: return "endmenu";
2295 case T_CHOICE: return "choice";
2296 case T_ENDCHOICE: return "endchoice";
2297 case T_IF: return "if";
2298 case T_ENDIF: return "endif";
2299 case T_DEPENDS: return "depends";
2300 case T_VISIBLE: return "visible";
2305 static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken)
2307 if (id->token != endtoken) {
2308 zconf_error("unexpected '%s' within %s block",
2309 kconf_id_strings + id->name, zconf_tokenname(starttoken));
2313 if (current_menu->file != current_file) {
2314 zconf_error("'%s' in different file than '%s'",
2315 kconf_id_strings + id->name, zconf_tokenname(starttoken));
2316 fprintf(stderr, "%s:%d: location of the '%s'\n",
2317 current_menu->file->name, current_menu->lineno,
2318 zconf_tokenname(starttoken));
2325 static void zconfprint(const char *err, ...)
2329 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
2331 vfprintf(stderr, err, ap);
2333 fprintf(stderr, "\n");
2336 static void zconf_error(const char *err, ...)
2341 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
2343 vfprintf(stderr, err, ap);
2345 fprintf(stderr, "\n");
2348 static void zconferror(const char *err)
2350 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
2353 static void print_quoted_string(FILE *out, const char *str)
2359 while ((p = strchr(str, '"'))) {
2362 fprintf(out, "%.*s", len, str);
2370 static void print_symbol(FILE *out, struct menu *menu)
2372 struct symbol *sym = menu->sym;
2373 struct property *prop;
2375 if (sym_is_choice(sym))
2376 fprintf(out, "\nchoice\n");
2378 fprintf(out, "\nconfig %s\n", sym->name);
2379 switch (sym->type) {
2381 fputs(" boolean\n", out);
2384 fputs(" tristate\n", out);
2387 fputs(" string\n", out);
2390 fputs(" integer\n", out);
2393 fputs(" hex\n", out);
2396 fputs(" ???\n", out);
2399 for (prop = sym->prop; prop; prop = prop->next) {
2400 if (prop->menu != menu)
2402 switch (prop->type) {
2404 fputs(" prompt ", out);
2405 print_quoted_string(out, prop->text);
2406 if (!expr_is_yes(prop->visible.expr)) {
2408 expr_fprint(prop->visible.expr, out);
2413 fputs( " default ", out);
2414 expr_fprint(prop->expr, out);
2415 if (!expr_is_yes(prop->visible.expr)) {
2417 expr_fprint(prop->visible.expr, out);
2422 fputs(" #choice value\n", out);
2425 fputs( " select ", out);
2426 expr_fprint(prop->expr, out);
2430 fputs( " range ", out);
2431 expr_fprint(prop->expr, out);
2435 fputs( " menu ", out);
2436 print_quoted_string(out, prop->text);
2440 fprintf(out, " unknown prop %d!\n", prop->type);
2445 int len = strlen(menu->help);
2446 while (menu->help[--len] == '\n')
2447 menu->help[len] = 0;
2448 fprintf(out, " help\n%s\n", menu->help);
2452 void zconfdump(FILE *out)
2454 struct property *prop;
2458 menu = rootmenu.list;
2460 if ((sym = menu->sym))
2461 print_symbol(out, menu);
2462 else if ((prop = menu->prompt)) {
2463 switch (prop->type) {
2465 fputs("\ncomment ", out);
2466 print_quoted_string(out, prop->text);
2470 fputs("\nmenu ", out);
2471 print_quoted_string(out, prop->text);
2477 if (!expr_is_yes(prop->visible.expr)) {
2478 fputs(" depends ", out);
2479 expr_fprint(prop->visible.expr, out);
2486 else if (menu->next)
2488 else while ((menu = menu->parent)) {
2489 if (menu->prompt && menu->prompt->type == P_MENU)
2490 fputs("\nendmenu\n", out);
2499 #include "zconf.lex.c"
2501 #include "confdata.c"