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 static struct menu *current_menu, *current_entry;
180 #define YYERROR_VERBOSE
183 /* Enabling traces. */
188 /* Enabling verbose error messages. */
189 #ifdef YYERROR_VERBOSE
190 # undef YYERROR_VERBOSE
191 # define YYERROR_VERBOSE 1
193 # define YYERROR_VERBOSE 0
196 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
198 typedef union YYSTYPE {
201 struct symbol *symbol;
205 /* Line 191 of yacc.c. */
207 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
208 # define YYSTYPE_IS_DECLARED 1
209 # define YYSTYPE_IS_TRIVIAL 1
214 /* Copy the second part of user declarations. */
217 #define LKC_DIRECT_LINK
221 /* Line 214 of yacc.c. */
224 #if ! defined (yyoverflow) || YYERROR_VERBOSE
226 /* The parser invokes alloca or malloc; define the necessary symbols. */
228 # if YYSTACK_USE_ALLOCA
229 # define YYSTACK_ALLOC alloca
231 # ifndef YYSTACK_USE_ALLOCA
232 # if defined (alloca) || defined (_ALLOCA_H)
233 # define YYSTACK_ALLOC alloca
236 # define YYSTACK_ALLOC __builtin_alloca
242 # ifdef YYSTACK_ALLOC
243 /* Pacify GCC's `empty if-body' warning. */
244 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
246 # if defined (__STDC__) || defined (__cplusplus)
247 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
248 # define YYSIZE_T size_t
250 # define YYSTACK_ALLOC malloc
251 # define YYSTACK_FREE free
253 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
256 #if (! defined (yyoverflow) \
257 && (! defined (__cplusplus) \
258 || (YYSTYPE_IS_TRIVIAL)))
260 /* A type that is properly aligned for any stack member. */
267 /* The size of the maximum gap between one aligned stack and the next. */
268 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
270 /* The size of an array large to enough to hold all stacks, each with
272 # define YYSTACK_BYTES(N) \
273 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
274 + YYSTACK_GAP_MAXIMUM)
276 /* Copy COUNT objects from FROM to TO. The source and destination do
280 # define YYCOPY(To, From, Count) \
281 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
283 # define YYCOPY(To, From, Count) \
286 register YYSIZE_T yyi; \
287 for (yyi = 0; yyi < (Count); yyi++) \
288 (To)[yyi] = (From)[yyi]; \
294 /* Relocate STACK from its old location to the new one. The
295 local variables YYSIZE and YYSTACKSIZE give the old and new number of
296 elements in the stack, and YYPTR gives the new location of the
297 stack. Advance YYPTR to a properly aligned location for the next
299 # define YYSTACK_RELOCATE(Stack) \
302 YYSIZE_T yynewbytes; \
303 YYCOPY (&yyptr->Stack, Stack, yysize); \
304 Stack = &yyptr->Stack; \
305 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
306 yyptr += yynewbytes / sizeof (*yyptr); \
312 #if defined (__STDC__) || defined (__cplusplus)
313 typedef signed char yysigned_char;
315 typedef short yysigned_char;
318 /* YYFINAL -- State number of the termination state. */
320 /* YYLAST -- Last index in YYTABLE. */
323 /* YYNTOKENS -- Number of terminals. */
325 /* YYNNTS -- Number of nonterminals. */
327 /* YYNRULES -- Number of rules. */
329 /* YYNRULES -- Number of states. */
330 #define YYNSTATES 182
332 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
334 #define YYMAXUTOK 296
336 #define YYTRANSLATE(YYX) \
337 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
339 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
340 static const unsigned char yytranslate[] =
342 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
343 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
344 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
345 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
346 2, 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, 1, 2, 3, 4,
368 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
369 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
370 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
371 35, 36, 37, 38, 39, 40, 41
375 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
377 static const unsigned short yyprhs[] =
379 0, 0, 3, 4, 7, 9, 11, 13, 17, 19,
380 21, 23, 26, 28, 30, 32, 34, 36, 38, 42,
381 45, 49, 52, 53, 56, 59, 62, 65, 69, 74,
382 78, 83, 87, 91, 95, 100, 105, 110, 116, 119,
383 122, 124, 128, 131, 132, 135, 138, 141, 144, 149,
384 153, 157, 160, 165, 166, 169, 173, 175, 179, 182,
385 183, 186, 189, 192, 196, 199, 201, 205, 208, 209,
386 212, 215, 218, 222, 226, 228, 232, 235, 238, 241,
387 242, 245, 248, 253, 257, 261, 262, 265, 267, 269,
388 272, 275, 278, 280, 282, 283, 286, 288, 292, 296,
389 300, 303, 307, 311, 313
392 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
393 static const yysigned_char yyrhs[] =
395 43, 0, -1, -1, 43, 44, -1, 45, -1, 55,
396 -1, 66, -1, 3, 77, 79, -1, 5, -1, 15,
397 -1, 8, -1, 1, 79, -1, 61, -1, 71, -1,
398 47, -1, 49, -1, 69, -1, 79, -1, 10, 28,
399 32, -1, 46, 50, -1, 11, 28, 32, -1, 48,
400 50, -1, -1, 50, 51, -1, 50, 75, -1, 50,
401 73, -1, 50, 32, -1, 21, 76, 32, -1, 22,
402 81, 80, 32, -1, 23, 76, 32, -1, 24, 81,
403 80, 32, -1, 26, 76, 32, -1, 27, 76, 32,
404 -1, 25, 76, 32, -1, 19, 77, 80, 32, -1,
405 20, 81, 80, 32, -1, 36, 28, 80, 32, -1,
406 37, 82, 82, 80, 32, -1, 7, 32, -1, 52,
407 56, -1, 78, -1, 53, 58, 54, -1, 53, 58,
408 -1, -1, 56, 57, -1, 56, 75, -1, 56, 73,
409 -1, 56, 32, -1, 19, 77, 80, 32, -1, 21,
410 76, 32, -1, 23, 76, 32, -1, 18, 32, -1,
411 20, 28, 80, 32, -1, -1, 58, 45, -1, 14,
412 81, 32, -1, 78, -1, 59, 62, 60, -1, 59,
413 62, -1, -1, 62, 45, -1, 62, 66, -1, 62,
414 55, -1, 4, 77, 32, -1, 63, 74, -1, 78,
415 -1, 64, 67, 65, -1, 64, 67, -1, -1, 67,
416 45, -1, 67, 66, -1, 67, 55, -1, 67, 1,
417 32, -1, 6, 77, 32, -1, 68, -1, 9, 77,
418 32, -1, 70, 74, -1, 12, 32, -1, 72, 13,
419 -1, -1, 74, 75, -1, 74, 32, -1, 16, 35,
420 81, 32, -1, 16, 81, 32, -1, 17, 81, 32,
421 -1, -1, 77, 80, -1, 28, -1, 29, -1, 5,
422 79, -1, 8, 79, -1, 15, 79, -1, 32, -1,
423 31, -1, -1, 14, 81, -1, 82, -1, 82, 40,
424 82, -1, 82, 30, 82, -1, 34, 81, 33, -1,
425 41, 81, -1, 81, 38, 81, -1, 81, 39, 81,
429 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
430 static const unsigned short yyrline[] =
432 0, 94, 94, 95, 98, 99, 100, 101, 102, 103,
433 104, 105, 109, 110, 111, 112, 113, 114, 120, 128,
434 134, 142, 152, 154, 155, 156, 157, 160, 166, 173,
435 179, 186, 192, 198, 204, 210, 216, 222, 230, 239,
436 245, 254, 255, 261, 263, 264, 265, 266, 269, 275,
437 281, 287, 293, 299, 301, 306, 315, 324, 325, 331,
438 333, 334, 335, 340, 347, 353, 362, 363, 369, 371,
439 372, 373, 374, 377, 383, 390, 397, 404, 410, 417,
440 418, 419, 422, 427, 432, 440, 442, 447, 448, 451,
441 452, 453, 457, 457, 459, 460, 463, 464, 465, 466,
442 467, 468, 469, 472, 473
446 #if YYDEBUG || YYERROR_VERBOSE
447 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
448 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
449 static const char *const yytname[] =
451 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
452 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
453 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
454 "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE",
455 "T_DEF_TRISTATE", "T_BOOLEAN", "T_DEF_BOOLEAN", "T_STRING", "T_INT",
456 "T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_EOF", "T_EOL",
457 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_SELECT", "T_RANGE", "T_OR",
458 "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block",
459 "common_block", "config_entry_start", "config_stmt",
460 "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
461 "config_option", "choice", "choice_entry", "choice_end", "choice_stmt",
462 "choice_option_list", "choice_option", "choice_block", "if", "if_end",
463 "if_stmt", "if_block", "menu", "menu_entry", "menu_end", "menu_stmt",
464 "menu_block", "source", "source_stmt", "comment", "comment_stmt",
465 "help_start", "help", "depends_list", "depends", "prompt_stmt_opt",
466 "prompt", "end", "nl_or_eof", "if_expr", "expr", "symbol", 0
471 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
473 static const unsigned short yytoknum[] =
475 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
476 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
477 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
478 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
483 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
484 static const unsigned char yyr1[] =
486 0, 42, 43, 43, 44, 44, 44, 44, 44, 44,
487 44, 44, 45, 45, 45, 45, 45, 45, 46, 47,
488 48, 49, 50, 50, 50, 50, 50, 51, 51, 51,
489 51, 51, 51, 51, 51, 51, 51, 51, 52, 53,
490 54, 55, 55, 56, 56, 56, 56, 56, 57, 57,
491 57, 57, 57, 58, 58, 59, 60, 61, 61, 62,
492 62, 62, 62, 63, 64, 65, 66, 66, 67, 67,
493 67, 67, 67, 68, 69, 70, 71, 72, 73, 74,
494 74, 74, 75, 75, 75, 76, 76, 77, 77, 78,
495 78, 78, 79, 79, 80, 80, 81, 81, 81, 81,
499 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
500 static const unsigned char yyr2[] =
502 0, 2, 0, 2, 1, 1, 1, 3, 1, 1,
503 1, 2, 1, 1, 1, 1, 1, 1, 3, 2,
504 3, 2, 0, 2, 2, 2, 2, 3, 4, 3,
505 4, 3, 3, 3, 4, 4, 4, 5, 2, 2,
506 1, 3, 2, 0, 2, 2, 2, 2, 4, 3,
507 3, 2, 4, 0, 2, 3, 1, 3, 2, 0,
508 2, 2, 2, 3, 2, 1, 3, 2, 0, 2,
509 2, 2, 3, 3, 1, 3, 2, 2, 2, 0,
510 2, 2, 4, 3, 3, 0, 2, 1, 1, 2,
511 2, 2, 1, 1, 0, 2, 1, 3, 3, 3,
515 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
516 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
517 means the default is an error. */
518 static const unsigned char yydefact[] =
520 2, 0, 1, 0, 0, 0, 8, 0, 0, 10,
521 0, 0, 0, 0, 9, 93, 92, 3, 4, 22,
522 14, 22, 15, 43, 53, 5, 59, 12, 79, 68,
523 6, 74, 16, 79, 13, 17, 11, 87, 88, 0,
524 0, 0, 38, 0, 0, 0, 103, 104, 0, 0,
525 0, 96, 19, 21, 39, 42, 58, 64, 0, 76,
526 7, 63, 73, 75, 18, 20, 0, 100, 55, 0,
527 0, 0, 0, 0, 0, 0, 0, 0, 85, 0,
528 85, 0, 85, 85, 85, 26, 0, 0, 23, 0,
529 25, 24, 0, 0, 0, 85, 85, 47, 44, 46,
530 45, 0, 0, 0, 54, 41, 40, 60, 62, 57,
531 61, 56, 81, 80, 0, 69, 71, 66, 70, 65,
532 99, 101, 102, 98, 97, 77, 0, 0, 0, 94,
533 94, 0, 94, 94, 0, 94, 0, 0, 0, 94,
534 0, 78, 51, 94, 94, 0, 0, 89, 90, 91,
535 72, 0, 83, 84, 0, 0, 0, 27, 86, 0,
536 29, 0, 33, 31, 32, 0, 94, 0, 0, 49,
537 50, 82, 95, 34, 35, 28, 30, 36, 0, 48,
541 /* YYDEFGOTO[NTERM-NUM]. */
542 static const short yydefgoto[] =
544 -1, 1, 17, 18, 19, 20, 21, 22, 52, 88,
545 23, 24, 105, 25, 54, 98, 55, 26, 109, 27,
546 56, 28, 29, 117, 30, 58, 31, 32, 33, 34,
547 89, 90, 57, 91, 131, 132, 106, 35, 155, 50,
551 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
553 #define YYPACT_NINF -99
554 static const short yypact[] =
556 -99, 48, -99, 38, 46, 46, -99, 46, -29, -99,
557 46, -17, -3, -11, -99, -99, -99, -99, -99, -99,
558 -99, -99, -99, -99, -99, -99, -99, -99, -99, -99,
559 -99, -99, -99, -99, -99, -99, -99, -99, -99, 38,
560 12, 15, -99, 18, 51, 62, -99, -99, -11, -11,
561 4, -24, 138, 138, 160, 121, 110, -4, 81, -4,
562 -99, -99, -99, -99, -99, -99, -19, -99, -99, -11,
563 -11, 70, 70, 73, 32, -11, 46, -11, 46, -11,
564 46, -11, 46, 46, 46, -99, 36, 70, -99, 95,
565 -99, -99, 96, 46, 106, 46, 46, -99, -99, -99,
566 -99, 38, 38, 38, -99, -99, -99, -99, -99, -99,
567 -99, -99, -99, -99, 112, -99, -99, -99, -99, -99,
568 -99, 117, -99, -99, -99, -99, -11, 33, 65, 131,
569 1, 119, 131, 1, 136, 1, 153, 154, 155, 131,
570 70, -99, -99, 131, 131, 156, 157, -99, -99, -99,
571 -99, 101, -99, -99, -11, 158, 159, -99, -99, 161,
572 -99, 162, -99, -99, -99, 163, 131, 164, 165, -99,
573 -99, -99, 99, -99, -99, -99, -99, -99, 166, -99,
577 /* YYPGOTO[NTERM-NUM]. */
578 static const short yypgoto[] =
580 -99, -99, -99, 111, -99, -99, -99, -99, 178, -99,
581 -99, -99, -99, 91, -99, -99, -99, -99, -99, -99,
582 -99, -99, -99, -99, 115, -99, -99, -99, -99, -99,
583 -99, 146, 168, 89, 27, 0, 126, -1, -98, -48,
587 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
588 positive, shift that token. If negative, reduce the rule which
589 number is the opposite. If zero, do what YYDEFACT says.
590 If YYTABLE_NINF, syntax error. */
591 #define YYTABLE_NINF -68
592 static const short yytable[] =
594 66, 67, 36, 42, 39, 40, 71, 41, 123, 124,
595 43, 44, 74, 75, 120, 154, 72, 46, 47, 69,
596 70, 121, 122, 48, 140, 45, 127, 128, 112, 130,
597 49, 133, 156, 135, 158, 159, 68, 161, 60, 69,
598 70, 165, 69, 70, 61, 167, 168, 62, 2, 3,
599 63, 4, 5, 6, 7, 8, 9, 10, 11, 12,
600 46, 47, 13, 14, 139, 152, 48, 126, 178, 15,
601 16, 69, 70, 49, 37, 38, 129, 166, 151, 15,
602 16, -67, 114, 64, -67, 5, 101, 7, 8, 102,
603 10, 11, 12, 143, 65, 13, 103, 153, 46, 47,
604 147, 148, 149, 69, 70, 125, 172, 134, 141, 136,
605 137, 138, 15, 16, 5, 101, 7, 8, 102, 10,
606 11, 12, 145, 146, 13, 103, 101, 7, 142, 102,
607 10, 11, 12, 171, 144, 13, 103, 69, 70, 69,
608 70, 15, 16, 100, 150, 154, 113, 108, 113, 116,
609 73, 157, 15, 16, 74, 75, 70, 76, 77, 78,
610 79, 80, 81, 82, 83, 84, 104, 107, 160, 115,
611 85, 110, 73, 118, 86, 87, 74, 75, 92, 93,
612 94, 95, 111, 96, 119, 162, 163, 164, 169, 170,
613 173, 174, 97, 175, 176, 177, 179, 180, 181, 53,
617 static const unsigned char yycheck[] =
619 48, 49, 3, 32, 4, 5, 30, 7, 71, 72,
620 10, 28, 16, 17, 33, 14, 40, 28, 29, 38,
621 39, 69, 70, 34, 87, 28, 74, 75, 32, 77,
622 41, 79, 130, 81, 132, 133, 32, 135, 39, 38,
623 39, 139, 38, 39, 32, 143, 144, 32, 0, 1,
624 32, 3, 4, 5, 6, 7, 8, 9, 10, 11,
625 28, 29, 14, 15, 28, 32, 34, 35, 166, 31,
626 32, 38, 39, 41, 28, 29, 76, 140, 126, 31,
627 32, 0, 1, 32, 3, 4, 5, 6, 7, 8,
628 9, 10, 11, 93, 32, 14, 15, 32, 28, 29,
629 101, 102, 103, 38, 39, 32, 154, 80, 13, 82,
630 83, 84, 31, 32, 4, 5, 6, 7, 8, 9,
631 10, 11, 95, 96, 14, 15, 5, 6, 32, 8,
632 9, 10, 11, 32, 28, 14, 15, 38, 39, 38,
633 39, 31, 32, 54, 32, 14, 57, 56, 59, 58,
634 12, 32, 31, 32, 16, 17, 39, 19, 20, 21,
635 22, 23, 24, 25, 26, 27, 55, 56, 32, 58,
636 32, 56, 12, 58, 36, 37, 16, 17, 18, 19,
637 20, 21, 56, 23, 58, 32, 32, 32, 32, 32,
638 32, 32, 32, 32, 32, 32, 32, 32, 32, 21,
642 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
643 symbol of state STATE-NUM. */
644 static const unsigned char yystos[] =
646 0, 43, 0, 1, 3, 4, 5, 6, 7, 8,
647 9, 10, 11, 14, 15, 31, 32, 44, 45, 46,
648 47, 48, 49, 52, 53, 55, 59, 61, 63, 64,
649 66, 68, 69, 70, 71, 79, 79, 28, 29, 77,
650 77, 77, 32, 77, 28, 28, 28, 29, 34, 41,
651 81, 82, 50, 50, 56, 58, 62, 74, 67, 74,
652 79, 32, 32, 32, 32, 32, 81, 81, 32, 38,
653 39, 30, 40, 12, 16, 17, 19, 20, 21, 22,
654 23, 24, 25, 26, 27, 32, 36, 37, 51, 72,
655 73, 75, 18, 19, 20, 21, 23, 32, 57, 73,
656 75, 5, 8, 15, 45, 54, 78, 45, 55, 60,
657 66, 78, 32, 75, 1, 45, 55, 65, 66, 78,
658 33, 81, 81, 82, 82, 32, 35, 81, 81, 77,
659 81, 76, 77, 81, 76, 81, 76, 76, 76, 28,
660 82, 13, 32, 77, 28, 76, 76, 79, 79, 79,
661 32, 81, 32, 32, 14, 80, 80, 32, 80, 80,
662 32, 80, 32, 32, 32, 80, 82, 80, 80, 32,
663 32, 32, 81, 32, 32, 32, 32, 32, 80, 32,
667 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
668 # define YYSIZE_T __SIZE_TYPE__
670 #if ! defined (YYSIZE_T) && defined (size_t)
671 # define YYSIZE_T size_t
673 #if ! defined (YYSIZE_T)
674 # if defined (__STDC__) || defined (__cplusplus)
675 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
676 # define YYSIZE_T size_t
679 #if ! defined (YYSIZE_T)
680 # define YYSIZE_T unsigned int
683 #define yyerrok (yyerrstatus = 0)
684 #define yyclearin (yychar = YYEMPTY)
688 #define YYACCEPT goto yyacceptlab
689 #define YYABORT goto yyabortlab
690 #define YYERROR goto yyerrlab1
693 /* Like YYERROR except do call yyerror. This remains here temporarily
694 to ease the transition to the new meaning of YYERROR, for GCC.
695 Once GCC version 2 has supplanted version 1, this can go. */
697 #define YYFAIL goto yyerrlab
699 #define YYRECOVERING() (!!yyerrstatus)
701 #define YYBACKUP(Token, Value) \
703 if (yychar == YYEMPTY && yylen == 1) \
707 yytoken = YYTRANSLATE (yychar); \
713 yyerror ("syntax error: cannot back up");\
719 #define YYERRCODE 256
721 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
724 #ifndef YYLLOC_DEFAULT
725 # define YYLLOC_DEFAULT(Current, Rhs, N) \
726 Current.first_line = Rhs[1].first_line; \
727 Current.first_column = Rhs[1].first_column; \
728 Current.last_line = Rhs[N].last_line; \
729 Current.last_column = Rhs[N].last_column;
732 /* YYLEX -- calling `yylex' with the right arguments. */
735 # define YYLEX yylex (YYLEX_PARAM)
737 # define YYLEX yylex ()
740 /* Enable debugging if requested. */
744 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
745 # define YYFPRINTF fprintf
748 # define YYDPRINTF(Args) \
754 # define YYDSYMPRINT(Args) \
760 # define YYDSYMPRINTF(Title, Token, Value, Location) \
764 YYFPRINTF (stderr, "%s ", Title); \
765 yysymprint (stderr, \
767 YYFPRINTF (stderr, "\n"); \
771 /*------------------------------------------------------------------.
772 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
774 `------------------------------------------------------------------*/
776 #if defined (__STDC__) || defined (__cplusplus)
778 yy_stack_print (short *bottom, short *top)
781 yy_stack_print (bottom, top)
786 YYFPRINTF (stderr, "Stack now");
787 for (/* Nothing. */; bottom <= top; ++bottom)
788 YYFPRINTF (stderr, " %d", *bottom);
789 YYFPRINTF (stderr, "\n");
792 # define YY_STACK_PRINT(Bottom, Top) \
795 yy_stack_print ((Bottom), (Top)); \
799 /*------------------------------------------------.
800 | Report that the YYRULE is going to be reduced. |
801 `------------------------------------------------*/
803 #if defined (__STDC__) || defined (__cplusplus)
805 yy_reduce_print (int yyrule)
808 yy_reduce_print (yyrule)
813 unsigned int yylineno = yyrline[yyrule];
814 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
815 yyrule - 1, yylineno);
816 /* Print the symbols being reduced, and their result. */
817 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
818 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
819 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
822 # define YY_REDUCE_PRINT(Rule) \
825 yy_reduce_print (Rule); \
828 /* Nonzero means print parse trace. It is left uninitialized so that
829 multiple parsers can coexist. */
832 # define YYDPRINTF(Args)
833 # define YYDSYMPRINT(Args)
834 # define YYDSYMPRINTF(Title, Token, Value, Location)
835 # define YY_STACK_PRINT(Bottom, Top)
836 # define YY_REDUCE_PRINT(Rule)
837 #endif /* !YYDEBUG */
840 /* YYINITDEPTH -- initial size of the parser's stacks. */
842 # define YYINITDEPTH 200
845 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
846 if the built-in stack extension method is used).
848 Do not make this value too large; the results are undefined if
849 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
850 evaluated with infinite-precision integer arithmetic. */
857 # define YYMAXDEPTH 10000
865 # if defined (__GLIBC__) && defined (_STRING_H)
866 # define yystrlen strlen
868 /* Return the length of YYSTR. */
870 # if defined (__STDC__) || defined (__cplusplus)
871 yystrlen (const char *yystr)
877 register const char *yys = yystr;
879 while (*yys++ != '\0')
882 return yys - yystr - 1;
888 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
889 # define yystpcpy stpcpy
891 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
894 # if defined (__STDC__) || defined (__cplusplus)
895 yystpcpy (char *yydest, const char *yysrc)
897 yystpcpy (yydest, yysrc)
902 register char *yyd = yydest;
903 register const char *yys = yysrc;
905 while ((*yyd++ = *yys++) != '\0')
913 #endif /* !YYERROR_VERBOSE */
918 /*--------------------------------.
919 | Print this symbol on YYOUTPUT. |
920 `--------------------------------*/
922 #if defined (__STDC__) || defined (__cplusplus)
924 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
927 yysymprint (yyoutput, yytype, yyvaluep)
933 /* Pacify ``unused variable'' warnings. */
936 if (yytype < YYNTOKENS)
938 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
940 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
944 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
951 YYFPRINTF (yyoutput, ")");
954 #endif /* ! YYDEBUG */
955 /*-----------------------------------------------.
956 | Release the memory associated to this symbol. |
957 `-----------------------------------------------*/
959 #if defined (__STDC__) || defined (__cplusplus)
961 yydestruct (int yytype, YYSTYPE *yyvaluep)
964 yydestruct (yytype, yyvaluep)
969 /* Pacify ``unused variable'' warnings. */
981 /* Prevent warnings from -Wmissing-prototypes. */
984 # if defined (__STDC__) || defined (__cplusplus)
985 int yyparse (void *YYPARSE_PARAM);
989 #else /* ! YYPARSE_PARAM */
990 #if defined (__STDC__) || defined (__cplusplus)
995 #endif /* ! YYPARSE_PARAM */
999 /* The lookahead symbol. */
1002 /* The semantic value of the lookahead symbol. */
1005 /* Number of syntax errors so far. */
1014 #ifdef YYPARSE_PARAM
1015 # if defined (__STDC__) || defined (__cplusplus)
1016 int yyparse (void *YYPARSE_PARAM)
1018 int yyparse (YYPARSE_PARAM)
1019 void *YYPARSE_PARAM;
1021 #else /* ! YYPARSE_PARAM */
1022 #if defined (__STDC__) || defined (__cplusplus)
1033 register int yystate;
1036 /* Number of tokens to shift before error messages enabled. */
1038 /* Lookahead token as an internal (translated) token number. */
1041 /* Three stacks and their tools:
1042 `yyss': related to states,
1043 `yyvs': related to semantic values,
1044 `yyls': related to locations.
1046 Refer to the stacks thru separate pointers, to allow yyoverflow
1047 to reallocate them elsewhere. */
1049 /* The state stack. */
1050 short yyssa[YYINITDEPTH];
1051 short *yyss = yyssa;
1052 register short *yyssp;
1054 /* The semantic value stack. */
1055 YYSTYPE yyvsa[YYINITDEPTH];
1056 YYSTYPE *yyvs = yyvsa;
1057 register YYSTYPE *yyvsp;
1061 #define YYPOPSTACK (yyvsp--, yyssp--)
1063 YYSIZE_T yystacksize = YYINITDEPTH;
1065 /* The variables used to return semantic value and location from the
1070 /* When reducing, the number of symbols on the RHS of the reduced
1074 YYDPRINTF ((stderr, "Starting parse\n"));
1079 yychar = YYEMPTY; /* Cause a token to be read. */
1081 /* Initialize stack pointers.
1082 Waste one element of value and location stack
1083 so that they stay on the same level as the state stack.
1084 The wasted elements are never initialized. */
1091 /*------------------------------------------------------------.
1092 | yynewstate -- Push a new state, which is found in yystate. |
1093 `------------------------------------------------------------*/
1095 /* In all cases, when you get here, the value and location stacks
1096 have just been pushed. so pushing a state here evens the stacks.
1103 if (yyss + yystacksize - 1 <= yyssp)
1105 /* Get the current used size of the three stacks, in elements. */
1106 YYSIZE_T yysize = yyssp - yyss + 1;
1110 /* Give user a chance to reallocate the stack. Use copies of
1111 these so that the &'s don't force the real ones into
1113 YYSTYPE *yyvs1 = yyvs;
1114 short *yyss1 = yyss;
1117 /* Each stack pointer address is followed by the size of the
1118 data in use in that stack, in bytes. This used to be a
1119 conditional around just the two extra args, but that might
1120 be undefined if yyoverflow is a macro. */
1121 yyoverflow ("parser stack overflow",
1122 &yyss1, yysize * sizeof (*yyssp),
1123 &yyvs1, yysize * sizeof (*yyvsp),
1130 #else /* no yyoverflow */
1131 # ifndef YYSTACK_RELOCATE
1134 /* Extend the stack our own way. */
1135 if (YYMAXDEPTH <= yystacksize)
1138 if (YYMAXDEPTH < yystacksize)
1139 yystacksize = YYMAXDEPTH;
1142 short *yyss1 = yyss;
1143 union yyalloc *yyptr =
1144 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1147 YYSTACK_RELOCATE (yyss);
1148 YYSTACK_RELOCATE (yyvs);
1150 # undef YYSTACK_RELOCATE
1152 YYSTACK_FREE (yyss1);
1155 #endif /* no yyoverflow */
1157 yyssp = yyss + yysize - 1;
1158 yyvsp = yyvs + yysize - 1;
1161 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1162 (unsigned long int) yystacksize));
1164 if (yyss + yystacksize - 1 <= yyssp)
1168 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1177 /* Do appropriate processing given the current state. */
1178 /* Read a lookahead token if we need one and don't already have one. */
1181 /* First try to decide what to do without reference to lookahead token. */
1183 yyn = yypact[yystate];
1184 if (yyn == YYPACT_NINF)
1187 /* Not known => get a lookahead token if don't already have one. */
1189 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1190 if (yychar == YYEMPTY)
1192 YYDPRINTF ((stderr, "Reading a token: "));
1196 if (yychar <= YYEOF)
1198 yychar = yytoken = YYEOF;
1199 YYDPRINTF ((stderr, "Now at end of input.\n"));
1203 yytoken = YYTRANSLATE (yychar);
1204 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1207 /* If the proper action on seeing token YYTOKEN is to reduce or to
1208 detect an error, take that action. */
1210 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1215 if (yyn == 0 || yyn == YYTABLE_NINF)
1224 /* Shift the lookahead token. */
1225 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1227 /* Discard the token being shifted unless it is eof. */
1228 if (yychar != YYEOF)
1234 /* Count tokens shifted since error; after three, turn off error
1243 /*-----------------------------------------------------------.
1244 | yydefault -- do the default action for the current state. |
1245 `-----------------------------------------------------------*/
1247 yyn = yydefact[yystate];
1253 /*-----------------------------.
1254 | yyreduce -- Do a reduction. |
1255 `-----------------------------*/
1257 /* yyn is the number of a rule to reduce with. */
1260 /* If YYLEN is nonzero, implement the default value of the action:
1263 Otherwise, the following line sets YYVAL to garbage.
1264 This behavior is undocumented and Bison
1265 users should not rely upon it. Assigning to YYVAL
1266 unconditionally makes the parser a bit smaller, and it avoids a
1267 GCC warning that YYVAL may be used uninitialized. */
1268 yyval = yyvsp[1-yylen];
1271 YY_REDUCE_PRINT (yyn);
1276 { zconfprint("unexpected 'endmenu' statement"); ;}
1281 { zconfprint("unexpected 'endif' statement"); ;}
1286 { zconfprint("unexpected 'endchoice' statement"); ;}
1291 { zconfprint("syntax error"); yyerrok; ;}
1297 struct symbol *sym = sym_lookup(yyvsp[-1].string, 0);
1298 sym->flags |= SYMBOL_OPTIONAL;
1299 menu_add_entry(sym);
1300 printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
1308 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1315 struct symbol *sym = sym_lookup(yyvsp[-1].string, 0);
1316 sym->flags |= SYMBOL_OPTIONAL;
1317 menu_add_entry(sym);
1318 printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
1325 if (current_entry->prompt)
1326 current_entry->prompt->type = P_MENU;
1328 zconfprint("warning: menuconfig statement without prompt");
1330 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1337 menu_set_type(S_TRISTATE);
1338 printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
1345 menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
1346 menu_set_type(S_TRISTATE);
1347 printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
1354 menu_set_type(S_BOOLEAN);
1355 printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
1362 menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
1363 menu_set_type(S_BOOLEAN);
1364 printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
1371 menu_set_type(S_INT);
1372 printd(DEBUG_PARSE, "%s:%d:int\n", zconf_curname(), zconf_lineno());
1379 menu_set_type(S_HEX);
1380 printd(DEBUG_PARSE, "%s:%d:hex\n", zconf_curname(), zconf_lineno());
1387 menu_set_type(S_STRING);
1388 printd(DEBUG_PARSE, "%s:%d:string\n", zconf_curname(), zconf_lineno());
1395 menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr);
1396 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1403 menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
1404 printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
1411 menu_add_symbol(P_SELECT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr);
1412 printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1419 menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,yyvsp[-3].symbol, yyvsp[-2].symbol), yyvsp[-1].expr);
1420 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1427 struct symbol *sym = sym_lookup(NULL, 0);
1428 sym->flags |= SYMBOL_CHOICE;
1429 menu_add_entry(sym);
1430 menu_add_expr(P_CHOICE, NULL, NULL);
1431 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1446 if (zconf_endtoken(yyvsp[0].token, T_CHOICE, T_ENDCHOICE)) {
1448 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
1456 printf("%s:%d: missing 'endchoice' for this 'choice' statement\n", current_menu->file->name, current_menu->lineno);
1464 menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr);
1465 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1472 menu_set_type(S_TRISTATE);
1473 printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
1480 menu_set_type(S_BOOLEAN);
1481 printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
1488 current_entry->sym->flags |= SYMBOL_OPTIONAL;
1489 printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1496 menu_add_symbol(P_DEFAULT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr);
1497 printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
1504 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
1505 menu_add_entry(NULL);
1506 menu_add_dep(yyvsp[-1].expr);
1515 if (zconf_endtoken(yyvsp[0].token, T_IF, T_ENDIF)) {
1517 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
1525 printf("%s:%d: missing 'endif' for this 'if' statement\n", current_menu->file->name, current_menu->lineno);
1533 menu_add_entry(NULL);
1534 menu_add_prop(P_MENU, yyvsp[-1].string, NULL, NULL);
1535 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1550 if (zconf_endtoken(yyvsp[0].token, T_MENU, T_ENDMENU)) {
1552 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
1560 printf("%s:%d: missing 'endmenu' for this 'menu' statement\n", current_menu->file->name, current_menu->lineno);
1567 { zconfprint("invalid menu option"); yyerrok; ;}
1573 yyval.string = yyvsp[-1].string;
1574 printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
1581 zconf_nextfile(yyvsp[0].string);
1588 menu_add_entry(NULL);
1589 menu_add_prop(P_COMMENT, yyvsp[-1].string, NULL, NULL);
1590 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1604 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
1612 current_entry->sym->help = yyvsp[0].string;
1619 menu_add_dep(yyvsp[-1].expr);
1620 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
1627 menu_add_dep(yyvsp[-1].expr);
1628 printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno());
1635 menu_add_dep(yyvsp[-1].expr);
1636 printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno());
1643 menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr);
1649 { yyval.token = T_ENDMENU; ;}
1654 { yyval.token = T_ENDCHOICE; ;}
1659 { yyval.token = T_ENDIF; ;}
1664 { yyval.expr = NULL; ;}
1669 { yyval.expr = yyvsp[0].expr; ;}
1674 { yyval.expr = expr_alloc_symbol(yyvsp[0].symbol); ;}
1679 { yyval.expr = expr_alloc_comp(E_EQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;}
1684 { yyval.expr = expr_alloc_comp(E_UNEQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;}
1689 { yyval.expr = yyvsp[-1].expr; ;}
1694 { yyval.expr = expr_alloc_one(E_NOT, yyvsp[0].expr); ;}
1699 { yyval.expr = expr_alloc_two(E_OR, yyvsp[-2].expr, yyvsp[0].expr); ;}
1704 { yyval.expr = expr_alloc_two(E_AND, yyvsp[-2].expr, yyvsp[0].expr); ;}
1709 { yyval.symbol = sym_lookup(yyvsp[0].string, 0); free(yyvsp[0].string); ;}
1714 { yyval.symbol = sym_lookup(yyvsp[0].string, 1); free(yyvsp[0].string); ;}
1720 /* Line 999 of yacc.c. */
1727 YY_STACK_PRINT (yyss, yyssp);
1732 /* Now `shift' the result of the reduction. Determine what state
1733 that goes to, based on the state we popped back to and the rule
1734 number reduced by. */
1738 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1739 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1740 yystate = yytable[yystate];
1742 yystate = yydefgoto[yyn - YYNTOKENS];
1747 /*------------------------------------.
1748 | yyerrlab -- here on detecting error |
1749 `------------------------------------*/
1751 /* If not already recovering from an error, report this error. */
1756 yyn = yypact[yystate];
1758 if (YYPACT_NINF < yyn && yyn < YYLAST)
1760 YYSIZE_T yysize = 0;
1761 int yytype = YYTRANSLATE (yychar);
1766 /* Start YYX at -YYN if negative to avoid negative indexes in
1768 for (yyx = yyn < 0 ? -yyn : 0;
1769 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1770 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1771 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1772 yysize += yystrlen ("syntax error, unexpected ") + 1;
1773 yysize += yystrlen (yytname[yytype]);
1774 yymsg = (char *) YYSTACK_ALLOC (yysize);
1777 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1778 yyp = yystpcpy (yyp, yytname[yytype]);
1783 for (yyx = yyn < 0 ? -yyn : 0;
1784 yyx < (int) (sizeof (yytname) / sizeof (char *));
1786 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1788 const char *yyq = ! yycount ? ", expecting " : " or ";
1789 yyp = yystpcpy (yyp, yyq);
1790 yyp = yystpcpy (yyp, yytname[yyx]);
1795 YYSTACK_FREE (yymsg);
1798 yyerror ("syntax error; also virtual memory exhausted");
1801 #endif /* YYERROR_VERBOSE */
1802 yyerror ("syntax error");
1807 if (yyerrstatus == 3)
1809 /* If just tried and failed to reuse lookahead token after an
1810 error, discard it. */
1812 /* Return failure if at end of input. */
1813 if (yychar == YYEOF)
1815 /* Pop the error token. */
1817 /* Pop the rest of the stack. */
1818 while (yyss < yyssp)
1820 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1821 yydestruct (yystos[*yyssp], yyvsp);
1827 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1828 yydestruct (yytoken, &yylval);
1833 /* Else will try to reuse lookahead token after shifting the error
1838 /*----------------------------------------------------.
1839 | yyerrlab1 -- error raised explicitly by an action. |
1840 `----------------------------------------------------*/
1842 yyerrstatus = 3; /* Each real token shifted decrements this. */
1846 yyn = yypact[yystate];
1847 if (yyn != YYPACT_NINF)
1850 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1858 /* Pop the current state because it cannot handle the error token. */
1862 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1863 yydestruct (yystos[yystate], yyvsp);
1867 YY_STACK_PRINT (yyss, yyssp);
1873 YYDPRINTF ((stderr, "Shifting error token, "));
1882 /*-------------------------------------.
1883 | yyacceptlab -- YYACCEPT comes here. |
1884 `-------------------------------------*/
1889 /*-----------------------------------.
1890 | yyabortlab -- YYABORT comes here. |
1891 `-----------------------------------*/
1897 /*----------------------------------------------.
1898 | yyoverflowlab -- parser overflow comes here. |
1899 `----------------------------------------------*/
1901 yyerror ("parser stack overflow");
1909 YYSTACK_FREE (yyss);
1918 void conf_parse(const char *name)
1923 zconf_initscan(name);
1927 modules_sym = sym_lookup("MODULES", 0);
1928 rootmenu.prompt = menu_add_prop(P_MENU, "Buildroot Configuration", NULL, NULL);
1934 menu_finalize(&rootmenu);
1935 for_all_symbols(i, sym) {
1936 if (!(sym->flags & SYMBOL_CHECKED) && sym_check_deps(sym))
1939 sym->flags |= SYMBOL_CHECK_DONE;
1942 sym_change_count = 1;
1945 const char *zconf_tokenname(int token)
1948 case T_MENU: return "menu";
1949 case T_ENDMENU: return "endmenu";
1950 case T_CHOICE: return "choice";
1951 case T_ENDCHOICE: return "endchoice";
1952 case T_IF: return "if";
1953 case T_ENDIF: return "endif";
1958 static bool zconf_endtoken(int token, int starttoken, int endtoken)
1960 if (token != endtoken) {
1961 zconfprint("unexpected '%s' within %s block", zconf_tokenname(token), zconf_tokenname(starttoken));
1965 if (current_menu->file != current_file) {
1966 zconfprint("'%s' in different file than '%s'", zconf_tokenname(token), zconf_tokenname(starttoken));
1967 zconfprint("location of the '%s'", zconf_tokenname(starttoken));
1974 static void zconfprint(const char *err, ...)
1978 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno() + 1);
1980 vfprintf(stderr, err, ap);
1982 fprintf(stderr, "\n");
1985 static void zconferror(const char *err)
1987 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
1990 void print_quoted_string(FILE *out, const char *str)
1996 while ((p = strchr(str, '"'))) {
1999 fprintf(out, "%.*s", len, str);
2007 void print_symbol(FILE *out, struct menu *menu)
2009 struct symbol *sym = menu->sym;
2010 struct property *prop;
2012 if (sym_is_choice(sym))
2013 fprintf(out, "choice\n");
2015 fprintf(out, "config %s\n", sym->name);
2016 switch (sym->type) {
2018 fputs(" boolean\n", out);
2021 fputs(" tristate\n", out);
2024 fputs(" string\n", out);
2027 fputs(" integer\n", out);
2030 fputs(" hex\n", out);
2033 fputs(" ???\n", out);
2036 for (prop = sym->prop; prop; prop = prop->next) {
2037 if (prop->menu != menu)
2039 switch (prop->type) {
2041 fputs(" prompt ", out);
2042 print_quoted_string(out, prop->text);
2043 if (!expr_is_yes(prop->visible.expr)) {
2045 expr_fprint(prop->visible.expr, out);
2050 fputs( " default ", out);
2051 expr_fprint(prop->expr, out);
2052 if (!expr_is_yes(prop->visible.expr)) {
2054 expr_fprint(prop->visible.expr, out);
2059 fputs(" #choice value\n", out);
2062 fprintf(out, " unknown prop %d!\n", prop->type);
2067 int len = strlen(sym->help);
2068 while (sym->help[--len] == '\n')
2070 fprintf(out, " help\n%s\n", sym->help);
2075 void zconfdump(FILE *out)
2077 struct property *prop;
2081 menu = rootmenu.list;
2083 if ((sym = menu->sym))
2084 print_symbol(out, menu);
2085 else if ((prop = menu->prompt)) {
2086 switch (prop->type) {
2088 fputs("\ncomment ", out);
2089 print_quoted_string(out, prop->text);
2093 fputs("\nmenu ", out);
2094 print_quoted_string(out, prop->text);
2100 if (!expr_is_yes(prop->visible.expr)) {
2101 fputs(" depends ", out);
2102 expr_fprint(prop->visible.expr, out);
2110 else if (menu->next)
2112 else while ((menu = menu->parent)) {
2113 if (menu->prompt && menu->prompt->type == P_MENU)
2114 fputs("\nendmenu\n", out);
2123 #include "lex.zconf.c"
2125 #include "confdata.c"