1 /* A Bison parser, made by GNU Bison 1.875a. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
40 #define YYSKELETON_NAME "yacc.c"
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
48 /* If NAME_PREFIX is specified substitute the variables and functions
50 #define yyparse zconfparse
51 #define yylex zconflex
52 #define yyerror zconferror
53 #define yylval zconflval
54 #define yychar zconfchar
55 #define yydebug zconfdebug
56 #define yynerrs zconfnerrs
62 /* Put the tokens into the symbol table, so that GDB and other debuggers
106 #define T_MAINMENU 258
108 #define T_ENDMENU 260
111 #define T_ENDCHOICE 263
112 #define T_COMMENT 264
114 #define T_MENUCONFIG 266
116 #define T_HELPTEXT 268
119 #define T_DEPENDS 271
120 #define T_REQUIRES 272
121 #define T_OPTIONAL 273
123 #define T_DEFAULT 275
124 #define T_TRISTATE 276
125 #define T_DEF_TRISTATE 277
126 #define T_BOOLEAN 278
127 #define T_DEF_BOOLEAN 279
132 #define T_WORD_QUOTE 284
133 #define T_UNEQUAL 285
136 #define T_CLOSE_PAREN 288
137 #define T_OPEN_PAREN 289
149 /* Copy the first part of user declarations. */
153 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
154 * Released under the terms of the GNU GPL v2.0.
164 #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
166 #define PRINTD 0x0001
167 #define DEBUG_PARSE 0x0002
171 extern int zconflex(void);
172 static void zconfprint(const char *err, ...);
173 static void zconferror(const char *err);
174 static bool zconf_endtoken(int token, int starttoken, int endtoken);
176 struct symbol *symbol_hash[257];
178 /* CONFIG_MIPS_BRCM Begin Broadcom changed code. */
179 /* These variables must be moved here from menu.c to make
180 * GCC4.0 happy. See CRDDB00016084 */
181 static struct menu *current_menu, *current_entry;
182 /* CONFIG_MIPS_BRCM end Broadcom changed code. */
184 #define YYERROR_VERBOSE
187 /* Enabling traces. */
192 /* Enabling verbose error messages. */
193 #ifdef YYERROR_VERBOSE
194 # undef YYERROR_VERBOSE
195 # define YYERROR_VERBOSE 1
197 # define YYERROR_VERBOSE 0
200 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
202 typedef union YYSTYPE {
205 struct symbol *symbol;
209 /* Line 191 of yacc.c. */
211 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
212 # define YYSTYPE_IS_DECLARED 1
213 # define YYSTYPE_IS_TRIVIAL 1
218 /* Copy the second part of user declarations. */
221 #define LKC_DIRECT_LINK
225 /* Line 214 of yacc.c. */
228 #if ! defined (yyoverflow) || YYERROR_VERBOSE
230 /* The parser invokes alloca or malloc; define the necessary symbols. */
232 # if YYSTACK_USE_ALLOCA
233 # define YYSTACK_ALLOC alloca
235 # ifndef YYSTACK_USE_ALLOCA
236 # if defined (alloca) || defined (_ALLOCA_H)
237 # define YYSTACK_ALLOC alloca
240 # define YYSTACK_ALLOC __builtin_alloca
246 # ifdef YYSTACK_ALLOC
247 /* Pacify GCC's `empty if-body' warning. */
248 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
250 # if defined (__STDC__) || defined (__cplusplus)
251 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
252 # define YYSIZE_T size_t
254 # define YYSTACK_ALLOC malloc
255 # define YYSTACK_FREE free
257 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
260 #if (! defined (yyoverflow) \
261 && (! defined (__cplusplus) \
262 || (YYSTYPE_IS_TRIVIAL)))
264 /* A type that is properly aligned for any stack member. */
271 /* The size of the maximum gap between one aligned stack and the next. */
272 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
274 /* The size of an array large to enough to hold all stacks, each with
276 # define YYSTACK_BYTES(N) \
277 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
278 + YYSTACK_GAP_MAXIMUM)
280 /* Copy COUNT objects from FROM to TO. The source and destination do
284 # define YYCOPY(To, From, Count) \
285 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
287 # define YYCOPY(To, From, Count) \
290 register YYSIZE_T yyi; \
291 for (yyi = 0; yyi < (Count); yyi++) \
292 (To)[yyi] = (From)[yyi]; \
298 /* Relocate STACK from its old location to the new one. The
299 local variables YYSIZE and YYSTACKSIZE give the old and new number of
300 elements in the stack, and YYPTR gives the new location of the
301 stack. Advance YYPTR to a properly aligned location for the next
303 # define YYSTACK_RELOCATE(Stack) \
306 YYSIZE_T yynewbytes; \
307 YYCOPY (&yyptr->Stack, Stack, yysize); \
308 Stack = &yyptr->Stack; \
309 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
310 yyptr += yynewbytes / sizeof (*yyptr); \
316 #if defined (__STDC__) || defined (__cplusplus)
317 typedef signed char yysigned_char;
319 typedef short yysigned_char;
322 /* YYFINAL -- State number of the termination state. */
324 /* YYLAST -- Last index in YYTABLE. */
327 /* YYNTOKENS -- Number of terminals. */
329 /* YYNNTS -- Number of nonterminals. */
331 /* YYNRULES -- Number of rules. */
333 /* YYNRULES -- Number of states. */
334 #define YYNSTATES 182
336 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
338 #define YYMAXUTOK 296
340 #define YYTRANSLATE(YYX) \
341 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
343 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
344 static const unsigned char yytranslate[] =
346 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
347 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
348 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
349 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
350 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
351 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
352 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
353 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
354 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
355 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
356 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
357 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
358 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
359 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
360 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
361 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
362 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
363 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
364 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
365 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
366 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
367 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
368 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
369 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
370 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
371 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
372 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
373 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
374 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
375 35, 36, 37, 38, 39, 40, 41
379 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
381 static const unsigned short yyprhs[] =
383 0, 0, 3, 4, 7, 9, 11, 13, 17, 19,
384 21, 23, 26, 28, 30, 32, 34, 36, 38, 42,
385 45, 49, 52, 53, 56, 59, 62, 65, 69, 74,
386 78, 83, 87, 91, 95, 100, 105, 110, 116, 119,
387 122, 124, 128, 131, 132, 135, 138, 141, 144, 149,
388 153, 157, 160, 165, 166, 169, 173, 175, 179, 182,
389 183, 186, 189, 192, 196, 199, 201, 205, 208, 209,
390 212, 215, 218, 222, 226, 228, 232, 235, 238, 241,
391 242, 245, 248, 253, 257, 261, 262, 265, 267, 269,
392 272, 275, 278, 280, 282, 283, 286, 288, 292, 296,
393 300, 303, 307, 311, 313
396 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
397 static const yysigned_char yyrhs[] =
399 43, 0, -1, -1, 43, 44, -1, 45, -1, 55,
400 -1, 66, -1, 3, 77, 79, -1, 5, -1, 15,
401 -1, 8, -1, 1, 79, -1, 61, -1, 71, -1,
402 47, -1, 49, -1, 69, -1, 79, -1, 10, 28,
403 32, -1, 46, 50, -1, 11, 28, 32, -1, 48,
404 50, -1, -1, 50, 51, -1, 50, 75, -1, 50,
405 73, -1, 50, 32, -1, 21, 76, 32, -1, 22,
406 81, 80, 32, -1, 23, 76, 32, -1, 24, 81,
407 80, 32, -1, 26, 76, 32, -1, 27, 76, 32,
408 -1, 25, 76, 32, -1, 19, 77, 80, 32, -1,
409 20, 81, 80, 32, -1, 36, 28, 80, 32, -1,
410 37, 82, 82, 80, 32, -1, 7, 32, -1, 52,
411 56, -1, 78, -1, 53, 58, 54, -1, 53, 58,
412 -1, -1, 56, 57, -1, 56, 75, -1, 56, 73,
413 -1, 56, 32, -1, 19, 77, 80, 32, -1, 21,
414 76, 32, -1, 23, 76, 32, -1, 18, 32, -1,
415 20, 28, 80, 32, -1, -1, 58, 45, -1, 14,
416 81, 32, -1, 78, -1, 59, 62, 60, -1, 59,
417 62, -1, -1, 62, 45, -1, 62, 66, -1, 62,
418 55, -1, 4, 77, 32, -1, 63, 74, -1, 78,
419 -1, 64, 67, 65, -1, 64, 67, -1, -1, 67,
420 45, -1, 67, 66, -1, 67, 55, -1, 67, 1,
421 32, -1, 6, 77, 32, -1, 68, -1, 9, 77,
422 32, -1, 70, 74, -1, 12, 32, -1, 72, 13,
423 -1, -1, 74, 75, -1, 74, 32, -1, 16, 35,
424 81, 32, -1, 16, 81, 32, -1, 17, 81, 32,
425 -1, -1, 77, 80, -1, 28, -1, 29, -1, 5,
426 79, -1, 8, 79, -1, 15, 79, -1, 32, -1,
427 31, -1, -1, 14, 81, -1, 82, -1, 82, 40,
428 82, -1, 82, 30, 82, -1, 34, 81, 33, -1,
429 41, 81, -1, 81, 38, 81, -1, 81, 39, 81,
433 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
434 static const unsigned short yyrline[] =
436 0, 94, 94, 95, 98, 99, 100, 101, 102, 103,
437 104, 105, 109, 110, 111, 112, 113, 114, 120, 128,
438 134, 142, 152, 154, 155, 156, 157, 160, 166, 173,
439 179, 186, 192, 198, 204, 210, 216, 222, 230, 239,
440 245, 254, 255, 261, 263, 264, 265, 266, 269, 275,
441 281, 287, 293, 299, 301, 306, 315, 324, 325, 331,
442 333, 334, 335, 340, 347, 353, 362, 363, 369, 371,
443 372, 373, 374, 377, 383, 390, 397, 404, 410, 417,
444 418, 419, 422, 427, 432, 440, 442, 447, 448, 451,
445 452, 453, 457, 457, 459, 460, 463, 464, 465, 466,
446 467, 468, 469, 472, 473
450 #if YYDEBUG || YYERROR_VERBOSE
451 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
452 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
453 static const char *const yytname[] =
455 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
456 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
457 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
458 "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE",
459 "T_DEF_TRISTATE", "T_BOOLEAN", "T_DEF_BOOLEAN", "T_STRING", "T_INT",
460 "T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_EOF", "T_EOL",
461 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_SELECT", "T_RANGE", "T_OR",
462 "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block",
463 "common_block", "config_entry_start", "config_stmt",
464 "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
465 "config_option", "choice", "choice_entry", "choice_end", "choice_stmt",
466 "choice_option_list", "choice_option", "choice_block", "if", "if_end",
467 "if_stmt", "if_block", "menu", "menu_entry", "menu_end", "menu_stmt",
468 "menu_block", "source", "source_stmt", "comment", "comment_stmt",
469 "help_start", "help", "depends_list", "depends", "prompt_stmt_opt",
470 "prompt", "end", "nl_or_eof", "if_expr", "expr", "symbol", 0
475 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
477 static const unsigned short yytoknum[] =
479 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
480 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
481 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
482 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
487 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
488 static const unsigned char yyr1[] =
490 0, 42, 43, 43, 44, 44, 44, 44, 44, 44,
491 44, 44, 45, 45, 45, 45, 45, 45, 46, 47,
492 48, 49, 50, 50, 50, 50, 50, 51, 51, 51,
493 51, 51, 51, 51, 51, 51, 51, 51, 52, 53,
494 54, 55, 55, 56, 56, 56, 56, 56, 57, 57,
495 57, 57, 57, 58, 58, 59, 60, 61, 61, 62,
496 62, 62, 62, 63, 64, 65, 66, 66, 67, 67,
497 67, 67, 67, 68, 69, 70, 71, 72, 73, 74,
498 74, 74, 75, 75, 75, 76, 76, 77, 77, 78,
499 78, 78, 79, 79, 80, 80, 81, 81, 81, 81,
503 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
504 static const unsigned char yyr2[] =
506 0, 2, 0, 2, 1, 1, 1, 3, 1, 1,
507 1, 2, 1, 1, 1, 1, 1, 1, 3, 2,
508 3, 2, 0, 2, 2, 2, 2, 3, 4, 3,
509 4, 3, 3, 3, 4, 4, 4, 5, 2, 2,
510 1, 3, 2, 0, 2, 2, 2, 2, 4, 3,
511 3, 2, 4, 0, 2, 3, 1, 3, 2, 0,
512 2, 2, 2, 3, 2, 1, 3, 2, 0, 2,
513 2, 2, 3, 3, 1, 3, 2, 2, 2, 0,
514 2, 2, 4, 3, 3, 0, 2, 1, 1, 2,
515 2, 2, 1, 1, 0, 2, 1, 3, 3, 3,
519 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
520 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
521 means the default is an error. */
522 static const unsigned char yydefact[] =
524 2, 0, 1, 0, 0, 0, 8, 0, 0, 10,
525 0, 0, 0, 0, 9, 93, 92, 3, 4, 22,
526 14, 22, 15, 43, 53, 5, 59, 12, 79, 68,
527 6, 74, 16, 79, 13, 17, 11, 87, 88, 0,
528 0, 0, 38, 0, 0, 0, 103, 104, 0, 0,
529 0, 96, 19, 21, 39, 42, 58, 64, 0, 76,
530 7, 63, 73, 75, 18, 20, 0, 100, 55, 0,
531 0, 0, 0, 0, 0, 0, 0, 0, 85, 0,
532 85, 0, 85, 85, 85, 26, 0, 0, 23, 0,
533 25, 24, 0, 0, 0, 85, 85, 47, 44, 46,
534 45, 0, 0, 0, 54, 41, 40, 60, 62, 57,
535 61, 56, 81, 80, 0, 69, 71, 66, 70, 65,
536 99, 101, 102, 98, 97, 77, 0, 0, 0, 94,
537 94, 0, 94, 94, 0, 94, 0, 0, 0, 94,
538 0, 78, 51, 94, 94, 0, 0, 89, 90, 91,
539 72, 0, 83, 84, 0, 0, 0, 27, 86, 0,
540 29, 0, 33, 31, 32, 0, 94, 0, 0, 49,
541 50, 82, 95, 34, 35, 28, 30, 36, 0, 48,
545 /* YYDEFGOTO[NTERM-NUM]. */
546 static const short yydefgoto[] =
548 -1, 1, 17, 18, 19, 20, 21, 22, 52, 88,
549 23, 24, 105, 25, 54, 98, 55, 26, 109, 27,
550 56, 28, 29, 117, 30, 58, 31, 32, 33, 34,
551 89, 90, 57, 91, 131, 132, 106, 35, 155, 50,
555 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
557 #define YYPACT_NINF -99
558 static const short yypact[] =
560 -99, 48, -99, 38, 46, 46, -99, 46, -29, -99,
561 46, -17, -3, -11, -99, -99, -99, -99, -99, -99,
562 -99, -99, -99, -99, -99, -99, -99, -99, -99, -99,
563 -99, -99, -99, -99, -99, -99, -99, -99, -99, 38,
564 12, 15, -99, 18, 51, 62, -99, -99, -11, -11,
565 4, -24, 138, 138, 160, 121, 110, -4, 81, -4,
566 -99, -99, -99, -99, -99, -99, -19, -99, -99, -11,
567 -11, 70, 70, 73, 32, -11, 46, -11, 46, -11,
568 46, -11, 46, 46, 46, -99, 36, 70, -99, 95,
569 -99, -99, 96, 46, 106, 46, 46, -99, -99, -99,
570 -99, 38, 38, 38, -99, -99, -99, -99, -99, -99,
571 -99, -99, -99, -99, 112, -99, -99, -99, -99, -99,
572 -99, 117, -99, -99, -99, -99, -11, 33, 65, 131,
573 1, 119, 131, 1, 136, 1, 153, 154, 155, 131,
574 70, -99, -99, 131, 131, 156, 157, -99, -99, -99,
575 -99, 101, -99, -99, -11, 158, 159, -99, -99, 161,
576 -99, 162, -99, -99, -99, 163, 131, 164, 165, -99,
577 -99, -99, 99, -99, -99, -99, -99, -99, 166, -99,
581 /* YYPGOTO[NTERM-NUM]. */
582 static const short yypgoto[] =
584 -99, -99, -99, 111, -99, -99, -99, -99, 178, -99,
585 -99, -99, -99, 91, -99, -99, -99, -99, -99, -99,
586 -99, -99, -99, -99, 115, -99, -99, -99, -99, -99,
587 -99, 146, 168, 89, 27, 0, 126, -1, -98, -48,
591 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
592 positive, shift that token. If negative, reduce the rule which
593 number is the opposite. If zero, do what YYDEFACT says.
594 If YYTABLE_NINF, syntax error. */
595 #define YYTABLE_NINF -68
596 static const short yytable[] =
598 66, 67, 36, 42, 39, 40, 71, 41, 123, 124,
599 43, 44, 74, 75, 120, 154, 72, 46, 47, 69,
600 70, 121, 122, 48, 140, 45, 127, 128, 112, 130,
601 49, 133, 156, 135, 158, 159, 68, 161, 60, 69,
602 70, 165, 69, 70, 61, 167, 168, 62, 2, 3,
603 63, 4, 5, 6, 7, 8, 9, 10, 11, 12,
604 46, 47, 13, 14, 139, 152, 48, 126, 178, 15,
605 16, 69, 70, 49, 37, 38, 129, 166, 151, 15,
606 16, -67, 114, 64, -67, 5, 101, 7, 8, 102,
607 10, 11, 12, 143, 65, 13, 103, 153, 46, 47,
608 147, 148, 149, 69, 70, 125, 172, 134, 141, 136,
609 137, 138, 15, 16, 5, 101, 7, 8, 102, 10,
610 11, 12, 145, 146, 13, 103, 101, 7, 142, 102,
611 10, 11, 12, 171, 144, 13, 103, 69, 70, 69,
612 70, 15, 16, 100, 150, 154, 113, 108, 113, 116,
613 73, 157, 15, 16, 74, 75, 70, 76, 77, 78,
614 79, 80, 81, 82, 83, 84, 104, 107, 160, 115,
615 85, 110, 73, 118, 86, 87, 74, 75, 92, 93,
616 94, 95, 111, 96, 119, 162, 163, 164, 169, 170,
617 173, 174, 97, 175, 176, 177, 179, 180, 181, 53,
621 static const unsigned char yycheck[] =
623 48, 49, 3, 32, 4, 5, 30, 7, 71, 72,
624 10, 28, 16, 17, 33, 14, 40, 28, 29, 38,
625 39, 69, 70, 34, 87, 28, 74, 75, 32, 77,
626 41, 79, 130, 81, 132, 133, 32, 135, 39, 38,
627 39, 139, 38, 39, 32, 143, 144, 32, 0, 1,
628 32, 3, 4, 5, 6, 7, 8, 9, 10, 11,
629 28, 29, 14, 15, 28, 32, 34, 35, 166, 31,
630 32, 38, 39, 41, 28, 29, 76, 140, 126, 31,
631 32, 0, 1, 32, 3, 4, 5, 6, 7, 8,
632 9, 10, 11, 93, 32, 14, 15, 32, 28, 29,
633 101, 102, 103, 38, 39, 32, 154, 80, 13, 82,
634 83, 84, 31, 32, 4, 5, 6, 7, 8, 9,
635 10, 11, 95, 96, 14, 15, 5, 6, 32, 8,
636 9, 10, 11, 32, 28, 14, 15, 38, 39, 38,
637 39, 31, 32, 54, 32, 14, 57, 56, 59, 58,
638 12, 32, 31, 32, 16, 17, 39, 19, 20, 21,
639 22, 23, 24, 25, 26, 27, 55, 56, 32, 58,
640 32, 56, 12, 58, 36, 37, 16, 17, 18, 19,
641 20, 21, 56, 23, 58, 32, 32, 32, 32, 32,
642 32, 32, 32, 32, 32, 32, 32, 32, 32, 21,
646 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
647 symbol of state STATE-NUM. */
648 static const unsigned char yystos[] =
650 0, 43, 0, 1, 3, 4, 5, 6, 7, 8,
651 9, 10, 11, 14, 15, 31, 32, 44, 45, 46,
652 47, 48, 49, 52, 53, 55, 59, 61, 63, 64,
653 66, 68, 69, 70, 71, 79, 79, 28, 29, 77,
654 77, 77, 32, 77, 28, 28, 28, 29, 34, 41,
655 81, 82, 50, 50, 56, 58, 62, 74, 67, 74,
656 79, 32, 32, 32, 32, 32, 81, 81, 32, 38,
657 39, 30, 40, 12, 16, 17, 19, 20, 21, 22,
658 23, 24, 25, 26, 27, 32, 36, 37, 51, 72,
659 73, 75, 18, 19, 20, 21, 23, 32, 57, 73,
660 75, 5, 8, 15, 45, 54, 78, 45, 55, 60,
661 66, 78, 32, 75, 1, 45, 55, 65, 66, 78,
662 33, 81, 81, 82, 82, 32, 35, 81, 81, 77,
663 81, 76, 77, 81, 76, 81, 76, 76, 76, 28,
664 82, 13, 32, 77, 28, 76, 76, 79, 79, 79,
665 32, 81, 32, 32, 14, 80, 80, 32, 80, 80,
666 32, 80, 32, 32, 32, 80, 82, 80, 80, 32,
667 32, 32, 81, 32, 32, 32, 32, 32, 80, 32,
671 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
672 # define YYSIZE_T __SIZE_TYPE__
674 #if ! defined (YYSIZE_T) && defined (size_t)
675 # define YYSIZE_T size_t
677 #if ! defined (YYSIZE_T)
678 # if defined (__STDC__) || defined (__cplusplus)
679 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
680 # define YYSIZE_T size_t
683 #if ! defined (YYSIZE_T)
684 # define YYSIZE_T unsigned int
687 #define yyerrok (yyerrstatus = 0)
688 #define yyclearin (yychar = YYEMPTY)
692 #define YYACCEPT goto yyacceptlab
693 #define YYABORT goto yyabortlab
694 #define YYERROR goto yyerrlab1
697 /* Like YYERROR except do call yyerror. This remains here temporarily
698 to ease the transition to the new meaning of YYERROR, for GCC.
699 Once GCC version 2 has supplanted version 1, this can go. */
701 #define YYFAIL goto yyerrlab
703 #define YYRECOVERING() (!!yyerrstatus)
705 #define YYBACKUP(Token, Value) \
707 if (yychar == YYEMPTY && yylen == 1) \
711 yytoken = YYTRANSLATE (yychar); \
717 yyerror ("syntax error: cannot back up");\
723 #define YYERRCODE 256
725 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
728 #ifndef YYLLOC_DEFAULT
729 # define YYLLOC_DEFAULT(Current, Rhs, N) \
730 Current.first_line = Rhs[1].first_line; \
731 Current.first_column = Rhs[1].first_column; \
732 Current.last_line = Rhs[N].last_line; \
733 Current.last_column = Rhs[N].last_column;
736 /* YYLEX -- calling `yylex' with the right arguments. */
739 # define YYLEX yylex (YYLEX_PARAM)
741 # define YYLEX yylex ()
744 /* Enable debugging if requested. */
748 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
749 # define YYFPRINTF fprintf
752 # define YYDPRINTF(Args) \
758 # define YYDSYMPRINT(Args) \
764 # define YYDSYMPRINTF(Title, Token, Value, Location) \
768 YYFPRINTF (stderr, "%s ", Title); \
769 yysymprint (stderr, \
771 YYFPRINTF (stderr, "\n"); \
775 /*------------------------------------------------------------------.
776 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
778 `------------------------------------------------------------------*/
780 #if defined (__STDC__) || defined (__cplusplus)
782 yy_stack_print (short *bottom, short *top)
785 yy_stack_print (bottom, top)
790 YYFPRINTF (stderr, "Stack now");
791 for (/* Nothing. */; bottom <= top; ++bottom)
792 YYFPRINTF (stderr, " %d", *bottom);
793 YYFPRINTF (stderr, "\n");
796 # define YY_STACK_PRINT(Bottom, Top) \
799 yy_stack_print ((Bottom), (Top)); \
803 /*------------------------------------------------.
804 | Report that the YYRULE is going to be reduced. |
805 `------------------------------------------------*/
807 #if defined (__STDC__) || defined (__cplusplus)
809 yy_reduce_print (int yyrule)
812 yy_reduce_print (yyrule)
817 unsigned int yylineno = yyrline[yyrule];
818 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
819 yyrule - 1, yylineno);
820 /* Print the symbols being reduced, and their result. */
821 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
822 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
823 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
826 # define YY_REDUCE_PRINT(Rule) \
829 yy_reduce_print (Rule); \
832 /* Nonzero means print parse trace. It is left uninitialized so that
833 multiple parsers can coexist. */
836 # define YYDPRINTF(Args)
837 # define YYDSYMPRINT(Args)
838 # define YYDSYMPRINTF(Title, Token, Value, Location)
839 # define YY_STACK_PRINT(Bottom, Top)
840 # define YY_REDUCE_PRINT(Rule)
841 #endif /* !YYDEBUG */
844 /* YYINITDEPTH -- initial size of the parser's stacks. */
846 # define YYINITDEPTH 200
849 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
850 if the built-in stack extension method is used).
852 Do not make this value too large; the results are undefined if
853 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
854 evaluated with infinite-precision integer arithmetic. */
861 # define YYMAXDEPTH 10000
869 # if defined (__GLIBC__) && defined (_STRING_H)
870 # define yystrlen strlen
872 /* Return the length of YYSTR. */
874 # if defined (__STDC__) || defined (__cplusplus)
875 yystrlen (const char *yystr)
881 register const char *yys = yystr;
883 while (*yys++ != '\0')
886 return yys - yystr - 1;
892 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
893 # define yystpcpy stpcpy
895 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
898 # if defined (__STDC__) || defined (__cplusplus)
899 yystpcpy (char *yydest, const char *yysrc)
901 yystpcpy (yydest, yysrc)
906 register char *yyd = yydest;
907 register const char *yys = yysrc;
909 while ((*yyd++ = *yys++) != '\0')
917 #endif /* !YYERROR_VERBOSE */
922 /*--------------------------------.
923 | Print this symbol on YYOUTPUT. |
924 `--------------------------------*/
926 #if defined (__STDC__) || defined (__cplusplus)
928 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
931 yysymprint (yyoutput, yytype, yyvaluep)
937 /* Pacify ``unused variable'' warnings. */
940 if (yytype < YYNTOKENS)
942 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
944 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
948 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
955 YYFPRINTF (yyoutput, ")");
958 #endif /* ! YYDEBUG */
959 /*-----------------------------------------------.
960 | Release the memory associated to this symbol. |
961 `-----------------------------------------------*/
963 #if defined (__STDC__) || defined (__cplusplus)
965 yydestruct (int yytype, YYSTYPE *yyvaluep)
968 yydestruct (yytype, yyvaluep)
973 /* Pacify ``unused variable'' warnings. */
985 /* Prevent warnings from -Wmissing-prototypes. */
988 # if defined (__STDC__) || defined (__cplusplus)
989 int yyparse (void *YYPARSE_PARAM);
993 #else /* ! YYPARSE_PARAM */
994 #if defined (__STDC__) || defined (__cplusplus)
999 #endif /* ! YYPARSE_PARAM */
1003 /* The lookahead symbol. */
1006 /* The semantic value of the lookahead symbol. */
1009 /* Number of syntax errors so far. */
1018 #ifdef YYPARSE_PARAM
1019 # if defined (__STDC__) || defined (__cplusplus)
1020 int yyparse (void *YYPARSE_PARAM)
1022 int yyparse (YYPARSE_PARAM)
1023 void *YYPARSE_PARAM;
1025 #else /* ! YYPARSE_PARAM */
1026 #if defined (__STDC__) || defined (__cplusplus)
1037 register int yystate;
1040 /* Number of tokens to shift before error messages enabled. */
1042 /* Lookahead token as an internal (translated) token number. */
1045 /* Three stacks and their tools:
1046 `yyss': related to states,
1047 `yyvs': related to semantic values,
1048 `yyls': related to locations.
1050 Refer to the stacks thru separate pointers, to allow yyoverflow
1051 to reallocate them elsewhere. */
1053 /* The state stack. */
1054 short yyssa[YYINITDEPTH];
1055 short *yyss = yyssa;
1056 register short *yyssp;
1058 /* The semantic value stack. */
1059 YYSTYPE yyvsa[YYINITDEPTH];
1060 YYSTYPE *yyvs = yyvsa;
1061 register YYSTYPE *yyvsp;
1065 #define YYPOPSTACK (yyvsp--, yyssp--)
1067 YYSIZE_T yystacksize = YYINITDEPTH;
1069 /* The variables used to return semantic value and location from the
1074 /* When reducing, the number of symbols on the RHS of the reduced
1078 YYDPRINTF ((stderr, "Starting parse\n"));
1083 yychar = YYEMPTY; /* Cause a token to be read. */
1085 /* Initialize stack pointers.
1086 Waste one element of value and location stack
1087 so that they stay on the same level as the state stack.
1088 The wasted elements are never initialized. */
1095 /*------------------------------------------------------------.
1096 | yynewstate -- Push a new state, which is found in yystate. |
1097 `------------------------------------------------------------*/
1099 /* In all cases, when you get here, the value and location stacks
1100 have just been pushed. so pushing a state here evens the stacks.
1107 if (yyss + yystacksize - 1 <= yyssp)
1109 /* Get the current used size of the three stacks, in elements. */
1110 YYSIZE_T yysize = yyssp - yyss + 1;
1114 /* Give user a chance to reallocate the stack. Use copies of
1115 these so that the &'s don't force the real ones into
1117 YYSTYPE *yyvs1 = yyvs;
1118 short *yyss1 = yyss;
1121 /* Each stack pointer address is followed by the size of the
1122 data in use in that stack, in bytes. This used to be a
1123 conditional around just the two extra args, but that might
1124 be undefined if yyoverflow is a macro. */
1125 yyoverflow ("parser stack overflow",
1126 &yyss1, yysize * sizeof (*yyssp),
1127 &yyvs1, yysize * sizeof (*yyvsp),
1134 #else /* no yyoverflow */
1135 # ifndef YYSTACK_RELOCATE
1138 /* Extend the stack our own way. */
1139 if (YYMAXDEPTH <= yystacksize)
1142 if (YYMAXDEPTH < yystacksize)
1143 yystacksize = YYMAXDEPTH;
1146 short *yyss1 = yyss;
1147 union yyalloc *yyptr =
1148 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1151 YYSTACK_RELOCATE (yyss);
1152 YYSTACK_RELOCATE (yyvs);
1154 # undef YYSTACK_RELOCATE
1156 YYSTACK_FREE (yyss1);
1159 #endif /* no yyoverflow */
1161 yyssp = yyss + yysize - 1;
1162 yyvsp = yyvs + yysize - 1;
1165 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1166 (unsigned long int) yystacksize));
1168 if (yyss + yystacksize - 1 <= yyssp)
1172 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1181 /* Do appropriate processing given the current state. */
1182 /* Read a lookahead token if we need one and don't already have one. */
1185 /* First try to decide what to do without reference to lookahead token. */
1187 yyn = yypact[yystate];
1188 if (yyn == YYPACT_NINF)
1191 /* Not known => get a lookahead token if don't already have one. */
1193 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1194 if (yychar == YYEMPTY)
1196 YYDPRINTF ((stderr, "Reading a token: "));
1200 if (yychar <= YYEOF)
1202 yychar = yytoken = YYEOF;
1203 YYDPRINTF ((stderr, "Now at end of input.\n"));
1207 yytoken = YYTRANSLATE (yychar);
1208 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1211 /* If the proper action on seeing token YYTOKEN is to reduce or to
1212 detect an error, take that action. */
1214 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1219 if (yyn == 0 || yyn == YYTABLE_NINF)
1228 /* Shift the lookahead token. */
1229 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1231 /* Discard the token being shifted unless it is eof. */
1232 if (yychar != YYEOF)
1238 /* Count tokens shifted since error; after three, turn off error
1247 /*-----------------------------------------------------------.
1248 | yydefault -- do the default action for the current state. |
1249 `-----------------------------------------------------------*/
1251 yyn = yydefact[yystate];
1257 /*-----------------------------.
1258 | yyreduce -- Do a reduction. |
1259 `-----------------------------*/
1261 /* yyn is the number of a rule to reduce with. */
1264 /* If YYLEN is nonzero, implement the default value of the action:
1267 Otherwise, the following line sets YYVAL to garbage.
1268 This behavior is undocumented and Bison
1269 users should not rely upon it. Assigning to YYVAL
1270 unconditionally makes the parser a bit smaller, and it avoids a
1271 GCC warning that YYVAL may be used uninitialized. */
1272 yyval = yyvsp[1-yylen];
1275 YY_REDUCE_PRINT (yyn);
1280 { zconfprint("unexpected 'endmenu' statement"); ;}
1285 { zconfprint("unexpected 'endif' statement"); ;}
1290 { zconfprint("unexpected 'endchoice' statement"); ;}
1295 { zconfprint("syntax error"); yyerrok; ;}
1301 struct symbol *sym = sym_lookup(yyvsp[-1].string, 0);
1302 sym->flags |= SYMBOL_OPTIONAL;
1303 menu_add_entry(sym);
1304 printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
1312 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1319 struct symbol *sym = sym_lookup(yyvsp[-1].string, 0);
1320 sym->flags |= SYMBOL_OPTIONAL;
1321 menu_add_entry(sym);
1322 printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
1329 if (current_entry->prompt)
1330 current_entry->prompt->type = P_MENU;
1332 zconfprint("warning: menuconfig statement without prompt");
1334 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1341 menu_set_type(S_TRISTATE);
1342 printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
1349 menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
1350 menu_set_type(S_TRISTATE);
1351 printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
1358 menu_set_type(S_BOOLEAN);
1359 printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
1366 menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
1367 menu_set_type(S_BOOLEAN);
1368 printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
1375 menu_set_type(S_INT);
1376 printd(DEBUG_PARSE, "%s:%d:int\n", zconf_curname(), zconf_lineno());
1383 menu_set_type(S_HEX);
1384 printd(DEBUG_PARSE, "%s:%d:hex\n", zconf_curname(), zconf_lineno());
1391 menu_set_type(S_STRING);
1392 printd(DEBUG_PARSE, "%s:%d:string\n", zconf_curname(), zconf_lineno());
1399 menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr);
1400 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1407 menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
1408 printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
1415 menu_add_symbol(P_SELECT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr);
1416 printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1423 menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,yyvsp[-3].symbol, yyvsp[-2].symbol), yyvsp[-1].expr);
1424 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1431 struct symbol *sym = sym_lookup(NULL, 0);
1432 sym->flags |= SYMBOL_CHOICE;
1433 menu_add_entry(sym);
1434 menu_add_expr(P_CHOICE, NULL, NULL);
1435 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1450 if (zconf_endtoken(yyvsp[0].token, T_CHOICE, T_ENDCHOICE)) {
1452 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
1460 printf("%s:%d: missing 'endchoice' for this 'choice' statement\n", current_menu->file->name, current_menu->lineno);
1468 menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr);
1469 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1476 menu_set_type(S_TRISTATE);
1477 printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
1484 menu_set_type(S_BOOLEAN);
1485 printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
1492 current_entry->sym->flags |= SYMBOL_OPTIONAL;
1493 printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1500 menu_add_symbol(P_DEFAULT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr);
1501 printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
1508 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
1509 menu_add_entry(NULL);
1510 menu_add_dep(yyvsp[-1].expr);
1519 if (zconf_endtoken(yyvsp[0].token, T_IF, T_ENDIF)) {
1521 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
1529 printf("%s:%d: missing 'endif' for this 'if' statement\n", current_menu->file->name, current_menu->lineno);
1537 menu_add_entry(NULL);
1538 menu_add_prop(P_MENU, yyvsp[-1].string, NULL, NULL);
1539 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1554 if (zconf_endtoken(yyvsp[0].token, T_MENU, T_ENDMENU)) {
1556 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
1564 printf("%s:%d: missing 'endmenu' for this 'menu' statement\n", current_menu->file->name, current_menu->lineno);
1571 { zconfprint("invalid menu option"); yyerrok; ;}
1577 yyval.string = yyvsp[-1].string;
1578 printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
1585 zconf_nextfile(yyvsp[0].string);
1592 menu_add_entry(NULL);
1593 menu_add_prop(P_COMMENT, yyvsp[-1].string, NULL, NULL);
1594 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1608 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
1616 current_entry->sym->help = yyvsp[0].string;
1623 menu_add_dep(yyvsp[-1].expr);
1624 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
1631 menu_add_dep(yyvsp[-1].expr);
1632 printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno());
1639 menu_add_dep(yyvsp[-1].expr);
1640 printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno());
1647 menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr);
1653 { yyval.token = T_ENDMENU; ;}
1658 { yyval.token = T_ENDCHOICE; ;}
1663 { yyval.token = T_ENDIF; ;}
1668 { yyval.expr = NULL; ;}
1673 { yyval.expr = yyvsp[0].expr; ;}
1678 { yyval.expr = expr_alloc_symbol(yyvsp[0].symbol); ;}
1683 { yyval.expr = expr_alloc_comp(E_EQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;}
1688 { yyval.expr = expr_alloc_comp(E_UNEQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;}
1693 { yyval.expr = yyvsp[-1].expr; ;}
1698 { yyval.expr = expr_alloc_one(E_NOT, yyvsp[0].expr); ;}
1703 { yyval.expr = expr_alloc_two(E_OR, yyvsp[-2].expr, yyvsp[0].expr); ;}
1708 { yyval.expr = expr_alloc_two(E_AND, yyvsp[-2].expr, yyvsp[0].expr); ;}
1713 { yyval.symbol = sym_lookup(yyvsp[0].string, 0); free(yyvsp[0].string); ;}
1718 { yyval.symbol = sym_lookup(yyvsp[0].string, 1); free(yyvsp[0].string); ;}
1724 /* Line 999 of yacc.c. */
1731 YY_STACK_PRINT (yyss, yyssp);
1736 /* Now `shift' the result of the reduction. Determine what state
1737 that goes to, based on the state we popped back to and the rule
1738 number reduced by. */
1742 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1743 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1744 yystate = yytable[yystate];
1746 yystate = yydefgoto[yyn - YYNTOKENS];
1751 /*------------------------------------.
1752 | yyerrlab -- here on detecting error |
1753 `------------------------------------*/
1755 /* If not already recovering from an error, report this error. */
1760 yyn = yypact[yystate];
1762 if (YYPACT_NINF < yyn && yyn < YYLAST)
1764 YYSIZE_T yysize = 0;
1765 int yytype = YYTRANSLATE (yychar);
1770 /* Start YYX at -YYN if negative to avoid negative indexes in
1772 for (yyx = yyn < 0 ? -yyn : 0;
1773 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1774 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1775 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1776 yysize += yystrlen ("syntax error, unexpected ") + 1;
1777 yysize += yystrlen (yytname[yytype]);
1778 yymsg = (char *) YYSTACK_ALLOC (yysize);
1781 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1782 yyp = yystpcpy (yyp, yytname[yytype]);
1787 for (yyx = yyn < 0 ? -yyn : 0;
1788 yyx < (int) (sizeof (yytname) / sizeof (char *));
1790 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1792 const char *yyq = ! yycount ? ", expecting " : " or ";
1793 yyp = yystpcpy (yyp, yyq);
1794 yyp = yystpcpy (yyp, yytname[yyx]);
1799 YYSTACK_FREE (yymsg);
1802 yyerror ("syntax error; also virtual memory exhausted");
1805 #endif /* YYERROR_VERBOSE */
1806 yyerror ("syntax error");
1811 if (yyerrstatus == 3)
1813 /* If just tried and failed to reuse lookahead token after an
1814 error, discard it. */
1816 /* Return failure if at end of input. */
1817 if (yychar == YYEOF)
1819 /* Pop the error token. */
1821 /* Pop the rest of the stack. */
1822 while (yyss < yyssp)
1824 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1825 yydestruct (yystos[*yyssp], yyvsp);
1831 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1832 yydestruct (yytoken, &yylval);
1837 /* Else will try to reuse lookahead token after shifting the error
1842 /*----------------------------------------------------.
1843 | yyerrlab1 -- error raised explicitly by an action. |
1844 `----------------------------------------------------*/
1846 yyerrstatus = 3; /* Each real token shifted decrements this. */
1850 yyn = yypact[yystate];
1851 if (yyn != YYPACT_NINF)
1854 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1862 /* Pop the current state because it cannot handle the error token. */
1866 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1867 yydestruct (yystos[yystate], yyvsp);
1871 YY_STACK_PRINT (yyss, yyssp);
1877 YYDPRINTF ((stderr, "Shifting error token, "));
1886 /*-------------------------------------.
1887 | yyacceptlab -- YYACCEPT comes here. |
1888 `-------------------------------------*/
1893 /*-----------------------------------.
1894 | yyabortlab -- YYABORT comes here. |
1895 `-----------------------------------*/
1901 /*----------------------------------------------.
1902 | yyoverflowlab -- parser overflow comes here. |
1903 `----------------------------------------------*/
1905 yyerror ("parser stack overflow");
1913 YYSTACK_FREE (yyss);
1922 void conf_parse(const char *name)
1927 zconf_initscan(name);
1931 modules_sym = sym_lookup("MODULES", 0);
1932 rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL);
1938 menu_finalize(&rootmenu);
1939 for_all_symbols(i, sym) {
1940 if (!(sym->flags & SYMBOL_CHECKED) && sym_check_deps(sym))
1943 sym->flags |= SYMBOL_CHECK_DONE;
1946 sym_change_count = 1;
1949 const char *zconf_tokenname(int token)
1952 case T_MENU: return "menu";
1953 case T_ENDMENU: return "endmenu";
1954 case T_CHOICE: return "choice";
1955 case T_ENDCHOICE: return "endchoice";
1956 case T_IF: return "if";
1957 case T_ENDIF: return "endif";
1962 static bool zconf_endtoken(int token, int starttoken, int endtoken)
1964 if (token != endtoken) {
1965 zconfprint("unexpected '%s' within %s block", zconf_tokenname(token), zconf_tokenname(starttoken));
1969 if (current_menu->file != current_file) {
1970 zconfprint("'%s' in different file than '%s'", zconf_tokenname(token), zconf_tokenname(starttoken));
1971 zconfprint("location of the '%s'", zconf_tokenname(starttoken));
1978 static void zconfprint(const char *err, ...)
1982 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno() + 1);
1984 vfprintf(stderr, err, ap);
1986 fprintf(stderr, "\n");
1989 static void zconferror(const char *err)
1991 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
1994 void print_quoted_string(FILE *out, const char *str)
2000 while ((p = strchr(str, '"'))) {
2003 fprintf(out, "%.*s", len, str);
2011 void print_symbol(FILE *out, struct menu *menu)
2013 struct symbol *sym = menu->sym;
2014 struct property *prop;
2016 if (sym_is_choice(sym))
2017 fprintf(out, "choice\n");
2019 fprintf(out, "config %s\n", sym->name);
2020 switch (sym->type) {
2022 fputs(" boolean\n", out);
2025 fputs(" tristate\n", out);
2028 fputs(" string\n", out);
2031 fputs(" integer\n", out);
2034 fputs(" hex\n", out);
2037 fputs(" ???\n", out);
2040 for (prop = sym->prop; prop; prop = prop->next) {
2041 if (prop->menu != menu)
2043 switch (prop->type) {
2045 fputs(" prompt ", out);
2046 print_quoted_string(out, prop->text);
2047 if (!expr_is_yes(prop->visible.expr)) {
2049 expr_fprint(prop->visible.expr, out);
2054 fputs( " default ", out);
2055 expr_fprint(prop->expr, out);
2056 if (!expr_is_yes(prop->visible.expr)) {
2058 expr_fprint(prop->visible.expr, out);
2063 fputs(" #choice value\n", out);
2066 fprintf(out, " unknown prop %d!\n", prop->type);
2071 int len = strlen(sym->help);
2072 while (sym->help[--len] == '\n')
2074 fprintf(out, " help\n%s\n", sym->help);
2079 void zconfdump(FILE *out)
2081 struct property *prop;
2085 menu = rootmenu.list;
2087 if ((sym = menu->sym))
2088 print_symbol(out, menu);
2089 else if ((prop = menu->prompt)) {
2090 switch (prop->type) {
2092 fputs("\ncomment ", out);
2093 print_quoted_string(out, prop->text);
2097 fputs("\nmenu ", out);
2098 print_quoted_string(out, prop->text);
2104 if (!expr_is_yes(prop->visible.expr)) {
2105 fputs(" depends ", out);
2106 expr_fprint(prop->visible.expr, out);
2114 else if (menu->next)
2116 else while ((menu = menu->parent)) {
2117 if (menu->prompt && menu->prompt->type == P_MENU)
2118 fputs("\nendmenu\n", out);
2127 #include "lex.zconf.c"
2128 #include "confdata.c"