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 #define YYERROR_VERBOSE
181 /* Enabling traces. */
186 /* Enabling verbose error messages. */
187 #ifdef YYERROR_VERBOSE
188 # undef YYERROR_VERBOSE
189 # define YYERROR_VERBOSE 1
191 # define YYERROR_VERBOSE 0
194 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
196 typedef union YYSTYPE {
199 struct symbol *symbol;
203 /* Line 191 of yacc.c. */
205 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
206 # define YYSTYPE_IS_DECLARED 1
207 # define YYSTYPE_IS_TRIVIAL 1
212 /* Copy the second part of user declarations. */
215 #define LKC_DIRECT_LINK
219 /* Line 214 of yacc.c. */
222 #if ! defined (yyoverflow) || YYERROR_VERBOSE
224 /* The parser invokes alloca or malloc; define the necessary symbols. */
226 # if YYSTACK_USE_ALLOCA
227 # define YYSTACK_ALLOC alloca
229 # ifndef YYSTACK_USE_ALLOCA
230 # if defined (alloca) || defined (_ALLOCA_H)
231 # define YYSTACK_ALLOC alloca
234 # define YYSTACK_ALLOC __builtin_alloca
240 # ifdef YYSTACK_ALLOC
241 /* Pacify GCC's `empty if-body' warning. */
242 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
244 # if defined (__STDC__) || defined (__cplusplus)
245 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
246 # define YYSIZE_T size_t
248 # define YYSTACK_ALLOC malloc
249 # define YYSTACK_FREE free
251 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
254 #if (! defined (yyoverflow) \
255 && (! defined (__cplusplus) \
256 || (YYSTYPE_IS_TRIVIAL)))
258 /* A type that is properly aligned for any stack member. */
265 /* The size of the maximum gap between one aligned stack and the next. */
266 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
268 /* The size of an array large to enough to hold all stacks, each with
270 # define YYSTACK_BYTES(N) \
271 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
272 + YYSTACK_GAP_MAXIMUM)
274 /* Copy COUNT objects from FROM to TO. The source and destination do
278 # define YYCOPY(To, From, Count) \
279 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
281 # define YYCOPY(To, From, Count) \
284 register YYSIZE_T yyi; \
285 for (yyi = 0; yyi < (Count); yyi++) \
286 (To)[yyi] = (From)[yyi]; \
292 /* Relocate STACK from its old location to the new one. The
293 local variables YYSIZE and YYSTACKSIZE give the old and new number of
294 elements in the stack, and YYPTR gives the new location of the
295 stack. Advance YYPTR to a properly aligned location for the next
297 # define YYSTACK_RELOCATE(Stack) \
300 YYSIZE_T yynewbytes; \
301 YYCOPY (&yyptr->Stack, Stack, yysize); \
302 Stack = &yyptr->Stack; \
303 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
304 yyptr += yynewbytes / sizeof (*yyptr); \
310 #if defined (__STDC__) || defined (__cplusplus)
311 typedef signed char yysigned_char;
313 typedef short yysigned_char;
316 /* YYFINAL -- State number of the termination state. */
318 /* YYLAST -- Last index in YYTABLE. */
321 /* YYNTOKENS -- Number of terminals. */
323 /* YYNNTS -- Number of nonterminals. */
325 /* YYNRULES -- Number of rules. */
327 /* YYNRULES -- Number of states. */
328 #define YYNSTATES 182
330 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
332 #define YYMAXUTOK 296
334 #define YYTRANSLATE(YYX) \
335 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
337 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
338 static const unsigned char yytranslate[] =
340 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
341 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
342 2, 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, 1, 2, 3, 4,
366 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
367 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
368 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
369 35, 36, 37, 38, 39, 40, 41
373 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
375 static const unsigned short yyprhs[] =
377 0, 0, 3, 4, 7, 9, 11, 13, 17, 19,
378 21, 23, 26, 28, 30, 32, 34, 36, 38, 42,
379 45, 49, 52, 53, 56, 59, 62, 65, 69, 74,
380 78, 83, 87, 91, 95, 100, 105, 110, 116, 119,
381 122, 124, 128, 131, 132, 135, 138, 141, 144, 149,
382 153, 157, 160, 165, 166, 169, 173, 175, 179, 182,
383 183, 186, 189, 192, 196, 199, 201, 205, 208, 209,
384 212, 215, 218, 222, 226, 228, 232, 235, 238, 241,
385 242, 245, 248, 253, 257, 261, 262, 265, 267, 269,
386 272, 275, 278, 280, 282, 283, 286, 288, 292, 296,
387 300, 303, 307, 311, 313
390 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
391 static const yysigned_char yyrhs[] =
393 43, 0, -1, -1, 43, 44, -1, 45, -1, 55,
394 -1, 66, -1, 3, 77, 79, -1, 5, -1, 15,
395 -1, 8, -1, 1, 79, -1, 61, -1, 71, -1,
396 47, -1, 49, -1, 69, -1, 79, -1, 10, 28,
397 32, -1, 46, 50, -1, 11, 28, 32, -1, 48,
398 50, -1, -1, 50, 51, -1, 50, 75, -1, 50,
399 73, -1, 50, 32, -1, 21, 76, 32, -1, 22,
400 81, 80, 32, -1, 23, 76, 32, -1, 24, 81,
401 80, 32, -1, 26, 76, 32, -1, 27, 76, 32,
402 -1, 25, 76, 32, -1, 19, 77, 80, 32, -1,
403 20, 81, 80, 32, -1, 36, 28, 80, 32, -1,
404 37, 82, 82, 80, 32, -1, 7, 32, -1, 52,
405 56, -1, 78, -1, 53, 58, 54, -1, 53, 58,
406 -1, -1, 56, 57, -1, 56, 75, -1, 56, 73,
407 -1, 56, 32, -1, 19, 77, 80, 32, -1, 21,
408 76, 32, -1, 23, 76, 32, -1, 18, 32, -1,
409 20, 28, 80, 32, -1, -1, 58, 45, -1, 14,
410 81, 32, -1, 78, -1, 59, 62, 60, -1, 59,
411 62, -1, -1, 62, 45, -1, 62, 66, -1, 62,
412 55, -1, 4, 77, 32, -1, 63, 74, -1, 78,
413 -1, 64, 67, 65, -1, 64, 67, -1, -1, 67,
414 45, -1, 67, 66, -1, 67, 55, -1, 67, 1,
415 32, -1, 6, 77, 32, -1, 68, -1, 9, 77,
416 32, -1, 70, 74, -1, 12, 32, -1, 72, 13,
417 -1, -1, 74, 75, -1, 74, 32, -1, 16, 35,
418 81, 32, -1, 16, 81, 32, -1, 17, 81, 32,
419 -1, -1, 77, 80, -1, 28, -1, 29, -1, 5,
420 79, -1, 8, 79, -1, 15, 79, -1, 32, -1,
421 31, -1, -1, 14, 81, -1, 82, -1, 82, 40,
422 82, -1, 82, 30, 82, -1, 34, 81, 33, -1,
423 41, 81, -1, 81, 38, 81, -1, 81, 39, 81,
427 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
428 static const unsigned short yyrline[] =
430 0, 94, 94, 95, 98, 99, 100, 101, 102, 103,
431 104, 105, 109, 110, 111, 112, 113, 114, 120, 128,
432 134, 142, 152, 154, 155, 156, 157, 160, 166, 173,
433 179, 186, 192, 198, 204, 210, 216, 222, 230, 239,
434 245, 254, 255, 261, 263, 264, 265, 266, 269, 275,
435 281, 287, 293, 299, 301, 306, 315, 324, 325, 331,
436 333, 334, 335, 340, 347, 353, 362, 363, 369, 371,
437 372, 373, 374, 377, 383, 390, 397, 404, 410, 417,
438 418, 419, 422, 427, 432, 440, 442, 447, 448, 451,
439 452, 453, 457, 457, 459, 460, 463, 464, 465, 466,
440 467, 468, 469, 472, 473
444 #if YYDEBUG || YYERROR_VERBOSE
445 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
446 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
447 static const char *const yytname[] =
449 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
450 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
451 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
452 "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE",
453 "T_DEF_TRISTATE", "T_BOOLEAN", "T_DEF_BOOLEAN", "T_STRING", "T_INT",
454 "T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_EOF", "T_EOL",
455 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_SELECT", "T_RANGE", "T_OR",
456 "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block",
457 "common_block", "config_entry_start", "config_stmt",
458 "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
459 "config_option", "choice", "choice_entry", "choice_end", "choice_stmt",
460 "choice_option_list", "choice_option", "choice_block", "if", "if_end",
461 "if_stmt", "if_block", "menu", "menu_entry", "menu_end", "menu_stmt",
462 "menu_block", "source", "source_stmt", "comment", "comment_stmt",
463 "help_start", "help", "depends_list", "depends", "prompt_stmt_opt",
464 "prompt", "end", "nl_or_eof", "if_expr", "expr", "symbol", 0
469 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
471 static const unsigned short yytoknum[] =
473 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
474 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
475 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
476 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
481 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
482 static const unsigned char yyr1[] =
484 0, 42, 43, 43, 44, 44, 44, 44, 44, 44,
485 44, 44, 45, 45, 45, 45, 45, 45, 46, 47,
486 48, 49, 50, 50, 50, 50, 50, 51, 51, 51,
487 51, 51, 51, 51, 51, 51, 51, 51, 52, 53,
488 54, 55, 55, 56, 56, 56, 56, 56, 57, 57,
489 57, 57, 57, 58, 58, 59, 60, 61, 61, 62,
490 62, 62, 62, 63, 64, 65, 66, 66, 67, 67,
491 67, 67, 67, 68, 69, 70, 71, 72, 73, 74,
492 74, 74, 75, 75, 75, 76, 76, 77, 77, 78,
493 78, 78, 79, 79, 80, 80, 81, 81, 81, 81,
497 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
498 static const unsigned char yyr2[] =
500 0, 2, 0, 2, 1, 1, 1, 3, 1, 1,
501 1, 2, 1, 1, 1, 1, 1, 1, 3, 2,
502 3, 2, 0, 2, 2, 2, 2, 3, 4, 3,
503 4, 3, 3, 3, 4, 4, 4, 5, 2, 2,
504 1, 3, 2, 0, 2, 2, 2, 2, 4, 3,
505 3, 2, 4, 0, 2, 3, 1, 3, 2, 0,
506 2, 2, 2, 3, 2, 1, 3, 2, 0, 2,
507 2, 2, 3, 3, 1, 3, 2, 2, 2, 0,
508 2, 2, 4, 3, 3, 0, 2, 1, 1, 2,
509 2, 2, 1, 1, 0, 2, 1, 3, 3, 3,
513 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
514 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
515 means the default is an error. */
516 static const unsigned char yydefact[] =
518 2, 0, 1, 0, 0, 0, 8, 0, 0, 10,
519 0, 0, 0, 0, 9, 93, 92, 3, 4, 22,
520 14, 22, 15, 43, 53, 5, 59, 12, 79, 68,
521 6, 74, 16, 79, 13, 17, 11, 87, 88, 0,
522 0, 0, 38, 0, 0, 0, 103, 104, 0, 0,
523 0, 96, 19, 21, 39, 42, 58, 64, 0, 76,
524 7, 63, 73, 75, 18, 20, 0, 100, 55, 0,
525 0, 0, 0, 0, 0, 0, 0, 0, 85, 0,
526 85, 0, 85, 85, 85, 26, 0, 0, 23, 0,
527 25, 24, 0, 0, 0, 85, 85, 47, 44, 46,
528 45, 0, 0, 0, 54, 41, 40, 60, 62, 57,
529 61, 56, 81, 80, 0, 69, 71, 66, 70, 65,
530 99, 101, 102, 98, 97, 77, 0, 0, 0, 94,
531 94, 0, 94, 94, 0, 94, 0, 0, 0, 94,
532 0, 78, 51, 94, 94, 0, 0, 89, 90, 91,
533 72, 0, 83, 84, 0, 0, 0, 27, 86, 0,
534 29, 0, 33, 31, 32, 0, 94, 0, 0, 49,
535 50, 82, 95, 34, 35, 28, 30, 36, 0, 48,
539 /* YYDEFGOTO[NTERM-NUM]. */
540 static const short yydefgoto[] =
542 -1, 1, 17, 18, 19, 20, 21, 22, 52, 88,
543 23, 24, 105, 25, 54, 98, 55, 26, 109, 27,
544 56, 28, 29, 117, 30, 58, 31, 32, 33, 34,
545 89, 90, 57, 91, 131, 132, 106, 35, 155, 50,
549 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
551 #define YYPACT_NINF -99
552 static const short yypact[] =
554 -99, 48, -99, 38, 46, 46, -99, 46, -29, -99,
555 46, -17, -3, -11, -99, -99, -99, -99, -99, -99,
556 -99, -99, -99, -99, -99, -99, -99, -99, -99, -99,
557 -99, -99, -99, -99, -99, -99, -99, -99, -99, 38,
558 12, 15, -99, 18, 51, 62, -99, -99, -11, -11,
559 4, -24, 138, 138, 160, 121, 110, -4, 81, -4,
560 -99, -99, -99, -99, -99, -99, -19, -99, -99, -11,
561 -11, 70, 70, 73, 32, -11, 46, -11, 46, -11,
562 46, -11, 46, 46, 46, -99, 36, 70, -99, 95,
563 -99, -99, 96, 46, 106, 46, 46, -99, -99, -99,
564 -99, 38, 38, 38, -99, -99, -99, -99, -99, -99,
565 -99, -99, -99, -99, 112, -99, -99, -99, -99, -99,
566 -99, 117, -99, -99, -99, -99, -11, 33, 65, 131,
567 1, 119, 131, 1, 136, 1, 153, 154, 155, 131,
568 70, -99, -99, 131, 131, 156, 157, -99, -99, -99,
569 -99, 101, -99, -99, -11, 158, 159, -99, -99, 161,
570 -99, 162, -99, -99, -99, 163, 131, 164, 165, -99,
571 -99, -99, 99, -99, -99, -99, -99, -99, 166, -99,
575 /* YYPGOTO[NTERM-NUM]. */
576 static const short yypgoto[] =
578 -99, -99, -99, 111, -99, -99, -99, -99, 178, -99,
579 -99, -99, -99, 91, -99, -99, -99, -99, -99, -99,
580 -99, -99, -99, -99, 115, -99, -99, -99, -99, -99,
581 -99, 146, 168, 89, 27, 0, 126, -1, -98, -48,
585 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
586 positive, shift that token. If negative, reduce the rule which
587 number is the opposite. If zero, do what YYDEFACT says.
588 If YYTABLE_NINF, syntax error. */
589 #define YYTABLE_NINF -68
590 static const short yytable[] =
592 66, 67, 36, 42, 39, 40, 71, 41, 123, 124,
593 43, 44, 74, 75, 120, 154, 72, 46, 47, 69,
594 70, 121, 122, 48, 140, 45, 127, 128, 112, 130,
595 49, 133, 156, 135, 158, 159, 68, 161, 60, 69,
596 70, 165, 69, 70, 61, 167, 168, 62, 2, 3,
597 63, 4, 5, 6, 7, 8, 9, 10, 11, 12,
598 46, 47, 13, 14, 139, 152, 48, 126, 178, 15,
599 16, 69, 70, 49, 37, 38, 129, 166, 151, 15,
600 16, -67, 114, 64, -67, 5, 101, 7, 8, 102,
601 10, 11, 12, 143, 65, 13, 103, 153, 46, 47,
602 147, 148, 149, 69, 70, 125, 172, 134, 141, 136,
603 137, 138, 15, 16, 5, 101, 7, 8, 102, 10,
604 11, 12, 145, 146, 13, 103, 101, 7, 142, 102,
605 10, 11, 12, 171, 144, 13, 103, 69, 70, 69,
606 70, 15, 16, 100, 150, 154, 113, 108, 113, 116,
607 73, 157, 15, 16, 74, 75, 70, 76, 77, 78,
608 79, 80, 81, 82, 83, 84, 104, 107, 160, 115,
609 85, 110, 73, 118, 86, 87, 74, 75, 92, 93,
610 94, 95, 111, 96, 119, 162, 163, 164, 169, 170,
611 173, 174, 97, 175, 176, 177, 179, 180, 181, 53,
615 static const unsigned char yycheck[] =
617 48, 49, 3, 32, 4, 5, 30, 7, 71, 72,
618 10, 28, 16, 17, 33, 14, 40, 28, 29, 38,
619 39, 69, 70, 34, 87, 28, 74, 75, 32, 77,
620 41, 79, 130, 81, 132, 133, 32, 135, 39, 38,
621 39, 139, 38, 39, 32, 143, 144, 32, 0, 1,
622 32, 3, 4, 5, 6, 7, 8, 9, 10, 11,
623 28, 29, 14, 15, 28, 32, 34, 35, 166, 31,
624 32, 38, 39, 41, 28, 29, 76, 140, 126, 31,
625 32, 0, 1, 32, 3, 4, 5, 6, 7, 8,
626 9, 10, 11, 93, 32, 14, 15, 32, 28, 29,
627 101, 102, 103, 38, 39, 32, 154, 80, 13, 82,
628 83, 84, 31, 32, 4, 5, 6, 7, 8, 9,
629 10, 11, 95, 96, 14, 15, 5, 6, 32, 8,
630 9, 10, 11, 32, 28, 14, 15, 38, 39, 38,
631 39, 31, 32, 54, 32, 14, 57, 56, 59, 58,
632 12, 32, 31, 32, 16, 17, 39, 19, 20, 21,
633 22, 23, 24, 25, 26, 27, 55, 56, 32, 58,
634 32, 56, 12, 58, 36, 37, 16, 17, 18, 19,
635 20, 21, 56, 23, 58, 32, 32, 32, 32, 32,
636 32, 32, 32, 32, 32, 32, 32, 32, 32, 21,
640 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
641 symbol of state STATE-NUM. */
642 static const unsigned char yystos[] =
644 0, 43, 0, 1, 3, 4, 5, 6, 7, 8,
645 9, 10, 11, 14, 15, 31, 32, 44, 45, 46,
646 47, 48, 49, 52, 53, 55, 59, 61, 63, 64,
647 66, 68, 69, 70, 71, 79, 79, 28, 29, 77,
648 77, 77, 32, 77, 28, 28, 28, 29, 34, 41,
649 81, 82, 50, 50, 56, 58, 62, 74, 67, 74,
650 79, 32, 32, 32, 32, 32, 81, 81, 32, 38,
651 39, 30, 40, 12, 16, 17, 19, 20, 21, 22,
652 23, 24, 25, 26, 27, 32, 36, 37, 51, 72,
653 73, 75, 18, 19, 20, 21, 23, 32, 57, 73,
654 75, 5, 8, 15, 45, 54, 78, 45, 55, 60,
655 66, 78, 32, 75, 1, 45, 55, 65, 66, 78,
656 33, 81, 81, 82, 82, 32, 35, 81, 81, 77,
657 81, 76, 77, 81, 76, 81, 76, 76, 76, 28,
658 82, 13, 32, 77, 28, 76, 76, 79, 79, 79,
659 32, 81, 32, 32, 14, 80, 80, 32, 80, 80,
660 32, 80, 32, 32, 32, 80, 82, 80, 80, 32,
661 32, 32, 81, 32, 32, 32, 32, 32, 80, 32,
665 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
666 # define YYSIZE_T __SIZE_TYPE__
668 #if ! defined (YYSIZE_T) && defined (size_t)
669 # define YYSIZE_T size_t
671 #if ! defined (YYSIZE_T)
672 # if defined (__STDC__) || defined (__cplusplus)
673 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
674 # define YYSIZE_T size_t
677 #if ! defined (YYSIZE_T)
678 # define YYSIZE_T unsigned int
681 #define yyerrok (yyerrstatus = 0)
682 #define yyclearin (yychar = YYEMPTY)
686 #define YYACCEPT goto yyacceptlab
687 #define YYABORT goto yyabortlab
688 #define YYERROR goto yyerrlab1
691 /* Like YYERROR except do call yyerror. This remains here temporarily
692 to ease the transition to the new meaning of YYERROR, for GCC.
693 Once GCC version 2 has supplanted version 1, this can go. */
695 #define YYFAIL goto yyerrlab
697 #define YYRECOVERING() (!!yyerrstatus)
699 #define YYBACKUP(Token, Value) \
701 if (yychar == YYEMPTY && yylen == 1) \
705 yytoken = YYTRANSLATE (yychar); \
711 yyerror ("syntax error: cannot back up");\
717 #define YYERRCODE 256
719 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
722 #ifndef YYLLOC_DEFAULT
723 # define YYLLOC_DEFAULT(Current, Rhs, N) \
724 Current.first_line = Rhs[1].first_line; \
725 Current.first_column = Rhs[1].first_column; \
726 Current.last_line = Rhs[N].last_line; \
727 Current.last_column = Rhs[N].last_column;
730 /* YYLEX -- calling `yylex' with the right arguments. */
733 # define YYLEX yylex (YYLEX_PARAM)
735 # define YYLEX yylex ()
738 /* Enable debugging if requested. */
742 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
743 # define YYFPRINTF fprintf
746 # define YYDPRINTF(Args) \
752 # define YYDSYMPRINT(Args) \
758 # define YYDSYMPRINTF(Title, Token, Value, Location) \
762 YYFPRINTF (stderr, "%s ", Title); \
763 yysymprint (stderr, \
765 YYFPRINTF (stderr, "\n"); \
769 /*------------------------------------------------------------------.
770 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
772 `------------------------------------------------------------------*/
774 #if defined (__STDC__) || defined (__cplusplus)
776 yy_stack_print (short *bottom, short *top)
779 yy_stack_print (bottom, top)
784 YYFPRINTF (stderr, "Stack now");
785 for (/* Nothing. */; bottom <= top; ++bottom)
786 YYFPRINTF (stderr, " %d", *bottom);
787 YYFPRINTF (stderr, "\n");
790 # define YY_STACK_PRINT(Bottom, Top) \
793 yy_stack_print ((Bottom), (Top)); \
797 /*------------------------------------------------.
798 | Report that the YYRULE is going to be reduced. |
799 `------------------------------------------------*/
801 #if defined (__STDC__) || defined (__cplusplus)
803 yy_reduce_print (int yyrule)
806 yy_reduce_print (yyrule)
811 unsigned int yylineno = yyrline[yyrule];
812 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
813 yyrule - 1, yylineno);
814 /* Print the symbols being reduced, and their result. */
815 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
816 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
817 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
820 # define YY_REDUCE_PRINT(Rule) \
823 yy_reduce_print (Rule); \
826 /* Nonzero means print parse trace. It is left uninitialized so that
827 multiple parsers can coexist. */
830 # define YYDPRINTF(Args)
831 # define YYDSYMPRINT(Args)
832 # define YYDSYMPRINTF(Title, Token, Value, Location)
833 # define YY_STACK_PRINT(Bottom, Top)
834 # define YY_REDUCE_PRINT(Rule)
835 #endif /* !YYDEBUG */
838 /* YYINITDEPTH -- initial size of the parser's stacks. */
840 # define YYINITDEPTH 200
843 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
844 if the built-in stack extension method is used).
846 Do not make this value too large; the results are undefined if
847 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
848 evaluated with infinite-precision integer arithmetic. */
855 # define YYMAXDEPTH 10000
863 # if defined (__GLIBC__) && defined (_STRING_H)
864 # define yystrlen strlen
866 /* Return the length of YYSTR. */
868 # if defined (__STDC__) || defined (__cplusplus)
869 yystrlen (const char *yystr)
875 register const char *yys = yystr;
877 while (*yys++ != '\0')
880 return yys - yystr - 1;
886 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
887 # define yystpcpy stpcpy
889 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
892 # if defined (__STDC__) || defined (__cplusplus)
893 yystpcpy (char *yydest, const char *yysrc)
895 yystpcpy (yydest, yysrc)
900 register char *yyd = yydest;
901 register const char *yys = yysrc;
903 while ((*yyd++ = *yys++) != '\0')
911 #endif /* !YYERROR_VERBOSE */
916 /*--------------------------------.
917 | Print this symbol on YYOUTPUT. |
918 `--------------------------------*/
920 #if defined (__STDC__) || defined (__cplusplus)
922 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
925 yysymprint (yyoutput, yytype, yyvaluep)
931 /* Pacify ``unused variable'' warnings. */
934 if (yytype < YYNTOKENS)
936 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
938 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
942 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
949 YYFPRINTF (yyoutput, ")");
952 #endif /* ! YYDEBUG */
953 /*-----------------------------------------------.
954 | Release the memory associated to this symbol. |
955 `-----------------------------------------------*/
957 #if defined (__STDC__) || defined (__cplusplus)
959 yydestruct (int yytype, YYSTYPE *yyvaluep)
962 yydestruct (yytype, yyvaluep)
967 /* Pacify ``unused variable'' warnings. */
979 /* Prevent warnings from -Wmissing-prototypes. */
982 # if defined (__STDC__) || defined (__cplusplus)
983 int yyparse (void *YYPARSE_PARAM);
987 #else /* ! YYPARSE_PARAM */
988 #if defined (__STDC__) || defined (__cplusplus)
993 #endif /* ! YYPARSE_PARAM */
997 /* The lookahead symbol. */
1000 /* The semantic value of the lookahead symbol. */
1003 /* Number of syntax errors so far. */
1012 #ifdef YYPARSE_PARAM
1013 # if defined (__STDC__) || defined (__cplusplus)
1014 int yyparse (void *YYPARSE_PARAM)
1016 int yyparse (YYPARSE_PARAM)
1017 void *YYPARSE_PARAM;
1019 #else /* ! YYPARSE_PARAM */
1020 #if defined (__STDC__) || defined (__cplusplus)
1031 register int yystate;
1034 /* Number of tokens to shift before error messages enabled. */
1036 /* Lookahead token as an internal (translated) token number. */
1039 /* Three stacks and their tools:
1040 `yyss': related to states,
1041 `yyvs': related to semantic values,
1042 `yyls': related to locations.
1044 Refer to the stacks thru separate pointers, to allow yyoverflow
1045 to reallocate them elsewhere. */
1047 /* The state stack. */
1048 short yyssa[YYINITDEPTH];
1049 short *yyss = yyssa;
1050 register short *yyssp;
1052 /* The semantic value stack. */
1053 YYSTYPE yyvsa[YYINITDEPTH];
1054 YYSTYPE *yyvs = yyvsa;
1055 register YYSTYPE *yyvsp;
1059 #define YYPOPSTACK (yyvsp--, yyssp--)
1061 YYSIZE_T yystacksize = YYINITDEPTH;
1063 /* The variables used to return semantic value and location from the
1068 /* When reducing, the number of symbols on the RHS of the reduced
1072 YYDPRINTF ((stderr, "Starting parse\n"));
1077 yychar = YYEMPTY; /* Cause a token to be read. */
1079 /* Initialize stack pointers.
1080 Waste one element of value and location stack
1081 so that they stay on the same level as the state stack.
1082 The wasted elements are never initialized. */
1089 /*------------------------------------------------------------.
1090 | yynewstate -- Push a new state, which is found in yystate. |
1091 `------------------------------------------------------------*/
1093 /* In all cases, when you get here, the value and location stacks
1094 have just been pushed. so pushing a state here evens the stacks.
1101 if (yyss + yystacksize - 1 <= yyssp)
1103 /* Get the current used size of the three stacks, in elements. */
1104 YYSIZE_T yysize = yyssp - yyss + 1;
1108 /* Give user a chance to reallocate the stack. Use copies of
1109 these so that the &'s don't force the real ones into
1111 YYSTYPE *yyvs1 = yyvs;
1112 short *yyss1 = yyss;
1115 /* Each stack pointer address is followed by the size of the
1116 data in use in that stack, in bytes. This used to be a
1117 conditional around just the two extra args, but that might
1118 be undefined if yyoverflow is a macro. */
1119 yyoverflow ("parser stack overflow",
1120 &yyss1, yysize * sizeof (*yyssp),
1121 &yyvs1, yysize * sizeof (*yyvsp),
1128 #else /* no yyoverflow */
1129 # ifndef YYSTACK_RELOCATE
1132 /* Extend the stack our own way. */
1133 if (YYMAXDEPTH <= yystacksize)
1136 if (YYMAXDEPTH < yystacksize)
1137 yystacksize = YYMAXDEPTH;
1140 short *yyss1 = yyss;
1141 union yyalloc *yyptr =
1142 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1145 YYSTACK_RELOCATE (yyss);
1146 YYSTACK_RELOCATE (yyvs);
1148 # undef YYSTACK_RELOCATE
1150 YYSTACK_FREE (yyss1);
1153 #endif /* no yyoverflow */
1155 yyssp = yyss + yysize - 1;
1156 yyvsp = yyvs + yysize - 1;
1159 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1160 (unsigned long int) yystacksize));
1162 if (yyss + yystacksize - 1 <= yyssp)
1166 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1175 /* Do appropriate processing given the current state. */
1176 /* Read a lookahead token if we need one and don't already have one. */
1179 /* First try to decide what to do without reference to lookahead token. */
1181 yyn = yypact[yystate];
1182 if (yyn == YYPACT_NINF)
1185 /* Not known => get a lookahead token if don't already have one. */
1187 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1188 if (yychar == YYEMPTY)
1190 YYDPRINTF ((stderr, "Reading a token: "));
1194 if (yychar <= YYEOF)
1196 yychar = yytoken = YYEOF;
1197 YYDPRINTF ((stderr, "Now at end of input.\n"));
1201 yytoken = YYTRANSLATE (yychar);
1202 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1205 /* If the proper action on seeing token YYTOKEN is to reduce or to
1206 detect an error, take that action. */
1208 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1213 if (yyn == 0 || yyn == YYTABLE_NINF)
1222 /* Shift the lookahead token. */
1223 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1225 /* Discard the token being shifted unless it is eof. */
1226 if (yychar != YYEOF)
1232 /* Count tokens shifted since error; after three, turn off error
1241 /*-----------------------------------------------------------.
1242 | yydefault -- do the default action for the current state. |
1243 `-----------------------------------------------------------*/
1245 yyn = yydefact[yystate];
1251 /*-----------------------------.
1252 | yyreduce -- Do a reduction. |
1253 `-----------------------------*/
1255 /* yyn is the number of a rule to reduce with. */
1258 /* If YYLEN is nonzero, implement the default value of the action:
1261 Otherwise, the following line sets YYVAL to garbage.
1262 This behavior is undocumented and Bison
1263 users should not rely upon it. Assigning to YYVAL
1264 unconditionally makes the parser a bit smaller, and it avoids a
1265 GCC warning that YYVAL may be used uninitialized. */
1266 yyval = yyvsp[1-yylen];
1269 YY_REDUCE_PRINT (yyn);
1274 { zconfprint("unexpected 'endmenu' statement"); ;}
1279 { zconfprint("unexpected 'endif' statement"); ;}
1284 { zconfprint("unexpected 'endchoice' statement"); ;}
1289 { zconfprint("syntax error"); yyerrok; ;}
1295 struct symbol *sym = sym_lookup(yyvsp[-1].string, 0);
1296 sym->flags |= SYMBOL_OPTIONAL;
1297 menu_add_entry(sym);
1298 printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
1306 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1313 struct symbol *sym = sym_lookup(yyvsp[-1].string, 0);
1314 sym->flags |= SYMBOL_OPTIONAL;
1315 menu_add_entry(sym);
1316 printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
1323 if (current_entry->prompt)
1324 current_entry->prompt->type = P_MENU;
1326 zconfprint("warning: menuconfig statement without prompt");
1328 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1335 menu_set_type(S_TRISTATE);
1336 printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
1343 menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
1344 menu_set_type(S_TRISTATE);
1345 printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
1352 menu_set_type(S_BOOLEAN);
1353 printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
1360 menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
1361 menu_set_type(S_BOOLEAN);
1362 printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
1369 menu_set_type(S_INT);
1370 printd(DEBUG_PARSE, "%s:%d:int\n", zconf_curname(), zconf_lineno());
1377 menu_set_type(S_HEX);
1378 printd(DEBUG_PARSE, "%s:%d:hex\n", zconf_curname(), zconf_lineno());
1385 menu_set_type(S_STRING);
1386 printd(DEBUG_PARSE, "%s:%d:string\n", zconf_curname(), zconf_lineno());
1393 menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr);
1394 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1401 menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
1402 printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
1409 menu_add_symbol(P_SELECT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr);
1410 printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1417 menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,yyvsp[-3].symbol, yyvsp[-2].symbol), yyvsp[-1].expr);
1418 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1425 struct symbol *sym = sym_lookup(NULL, 0);
1426 sym->flags |= SYMBOL_CHOICE;
1427 menu_add_entry(sym);
1428 menu_add_expr(P_CHOICE, NULL, NULL);
1429 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1444 if (zconf_endtoken(yyvsp[0].token, T_CHOICE, T_ENDCHOICE)) {
1446 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
1454 printf("%s:%d: missing 'endchoice' for this 'choice' statement\n", current_menu->file->name, current_menu->lineno);
1462 menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr);
1463 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1470 menu_set_type(S_TRISTATE);
1471 printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
1478 menu_set_type(S_BOOLEAN);
1479 printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
1486 current_entry->sym->flags |= SYMBOL_OPTIONAL;
1487 printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1494 menu_add_symbol(P_DEFAULT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr);
1495 printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
1502 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
1503 menu_add_entry(NULL);
1504 menu_add_dep(yyvsp[-1].expr);
1513 if (zconf_endtoken(yyvsp[0].token, T_IF, T_ENDIF)) {
1515 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
1523 printf("%s:%d: missing 'endif' for this 'if' statement\n", current_menu->file->name, current_menu->lineno);
1531 menu_add_entry(NULL);
1532 menu_add_prop(P_MENU, yyvsp[-1].string, NULL, NULL);
1533 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1548 if (zconf_endtoken(yyvsp[0].token, T_MENU, T_ENDMENU)) {
1550 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
1558 printf("%s:%d: missing 'endmenu' for this 'menu' statement\n", current_menu->file->name, current_menu->lineno);
1565 { zconfprint("invalid menu option"); yyerrok; ;}
1571 yyval.string = yyvsp[-1].string;
1572 printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
1579 zconf_nextfile(yyvsp[0].string);
1586 menu_add_entry(NULL);
1587 menu_add_prop(P_COMMENT, yyvsp[-1].string, NULL, NULL);
1588 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1602 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
1610 current_entry->sym->help = yyvsp[0].string;
1617 menu_add_dep(yyvsp[-1].expr);
1618 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
1625 menu_add_dep(yyvsp[-1].expr);
1626 printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno());
1633 menu_add_dep(yyvsp[-1].expr);
1634 printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno());
1641 menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr);
1647 { yyval.token = T_ENDMENU; ;}
1652 { yyval.token = T_ENDCHOICE; ;}
1657 { yyval.token = T_ENDIF; ;}
1662 { yyval.expr = NULL; ;}
1667 { yyval.expr = yyvsp[0].expr; ;}
1672 { yyval.expr = expr_alloc_symbol(yyvsp[0].symbol); ;}
1677 { yyval.expr = expr_alloc_comp(E_EQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;}
1682 { yyval.expr = expr_alloc_comp(E_UNEQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;}
1687 { yyval.expr = yyvsp[-1].expr; ;}
1692 { yyval.expr = expr_alloc_one(E_NOT, yyvsp[0].expr); ;}
1697 { yyval.expr = expr_alloc_two(E_OR, yyvsp[-2].expr, yyvsp[0].expr); ;}
1702 { yyval.expr = expr_alloc_two(E_AND, yyvsp[-2].expr, yyvsp[0].expr); ;}
1707 { yyval.symbol = sym_lookup(yyvsp[0].string, 0); free(yyvsp[0].string); ;}
1712 { yyval.symbol = sym_lookup(yyvsp[0].string, 1); free(yyvsp[0].string); ;}
1718 /* Line 999 of yacc.c. */
1725 YY_STACK_PRINT (yyss, yyssp);
1730 /* Now `shift' the result of the reduction. Determine what state
1731 that goes to, based on the state we popped back to and the rule
1732 number reduced by. */
1736 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1737 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1738 yystate = yytable[yystate];
1740 yystate = yydefgoto[yyn - YYNTOKENS];
1745 /*------------------------------------.
1746 | yyerrlab -- here on detecting error |
1747 `------------------------------------*/
1749 /* If not already recovering from an error, report this error. */
1754 yyn = yypact[yystate];
1756 if (YYPACT_NINF < yyn && yyn < YYLAST)
1758 YYSIZE_T yysize = 0;
1759 int yytype = YYTRANSLATE (yychar);
1764 /* Start YYX at -YYN if negative to avoid negative indexes in
1766 for (yyx = yyn < 0 ? -yyn : 0;
1767 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1768 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1769 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1770 yysize += yystrlen ("syntax error, unexpected ") + 1;
1771 yysize += yystrlen (yytname[yytype]);
1772 yymsg = (char *) YYSTACK_ALLOC (yysize);
1775 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1776 yyp = yystpcpy (yyp, yytname[yytype]);
1781 for (yyx = yyn < 0 ? -yyn : 0;
1782 yyx < (int) (sizeof (yytname) / sizeof (char *));
1784 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1786 const char *yyq = ! yycount ? ", expecting " : " or ";
1787 yyp = yystpcpy (yyp, yyq);
1788 yyp = yystpcpy (yyp, yytname[yyx]);
1793 YYSTACK_FREE (yymsg);
1796 yyerror ("syntax error; also virtual memory exhausted");
1799 #endif /* YYERROR_VERBOSE */
1800 yyerror ("syntax error");
1805 if (yyerrstatus == 3)
1807 /* If just tried and failed to reuse lookahead token after an
1808 error, discard it. */
1810 /* Return failure if at end of input. */
1811 if (yychar == YYEOF)
1813 /* Pop the error token. */
1815 /* Pop the rest of the stack. */
1816 while (yyss < yyssp)
1818 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1819 yydestruct (yystos[*yyssp], yyvsp);
1825 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1826 yydestruct (yytoken, &yylval);
1831 /* Else will try to reuse lookahead token after shifting the error
1836 /*----------------------------------------------------.
1837 | yyerrlab1 -- error raised explicitly by an action. |
1838 `----------------------------------------------------*/
1840 yyerrstatus = 3; /* Each real token shifted decrements this. */
1844 yyn = yypact[yystate];
1845 if (yyn != YYPACT_NINF)
1848 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1856 /* Pop the current state because it cannot handle the error token. */
1860 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1861 yydestruct (yystos[yystate], yyvsp);
1865 YY_STACK_PRINT (yyss, yyssp);
1871 YYDPRINTF ((stderr, "Shifting error token, "));
1880 /*-------------------------------------.
1881 | yyacceptlab -- YYACCEPT comes here. |
1882 `-------------------------------------*/
1887 /*-----------------------------------.
1888 | yyabortlab -- YYABORT comes here. |
1889 `-----------------------------------*/
1895 /*----------------------------------------------.
1896 | yyoverflowlab -- parser overflow comes here. |
1897 `----------------------------------------------*/
1899 yyerror ("parser stack overflow");
1907 YYSTACK_FREE (yyss);
1916 void conf_parse(const char *name)
1921 zconf_initscan(name);
1925 modules_sym = sym_lookup("MODULES", 0);
1926 rootmenu.prompt = menu_add_prop(P_MENU, "Buildroot Configuration", NULL, NULL);
1932 menu_finalize(&rootmenu);
1933 for_all_symbols(i, sym) {
1934 if (!(sym->flags & SYMBOL_CHECKED) && sym_check_deps(sym))
1937 sym->flags |= SYMBOL_CHECK_DONE;
1940 sym_change_count = 1;
1943 const char *zconf_tokenname(int token)
1946 case T_MENU: return "menu";
1947 case T_ENDMENU: return "endmenu";
1948 case T_CHOICE: return "choice";
1949 case T_ENDCHOICE: return "endchoice";
1950 case T_IF: return "if";
1951 case T_ENDIF: return "endif";
1956 static bool zconf_endtoken(int token, int starttoken, int endtoken)
1958 if (token != endtoken) {
1959 zconfprint("unexpected '%s' within %s block", zconf_tokenname(token), zconf_tokenname(starttoken));
1963 if (current_menu->file != current_file) {
1964 zconfprint("'%s' in different file than '%s'", zconf_tokenname(token), zconf_tokenname(starttoken));
1965 zconfprint("location of the '%s'", zconf_tokenname(starttoken));
1972 static void zconfprint(const char *err, ...)
1976 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno() + 1);
1978 vfprintf(stderr, err, ap);
1980 fprintf(stderr, "\n");
1983 static void zconferror(const char *err)
1985 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
1988 void print_quoted_string(FILE *out, const char *str)
1994 while ((p = strchr(str, '"'))) {
1997 fprintf(out, "%.*s", len, str);
2005 void print_symbol(FILE *out, struct menu *menu)
2007 struct symbol *sym = menu->sym;
2008 struct property *prop;
2010 if (sym_is_choice(sym))
2011 fprintf(out, "choice\n");
2013 fprintf(out, "config %s\n", sym->name);
2014 switch (sym->type) {
2016 fputs(" boolean\n", out);
2019 fputs(" tristate\n", out);
2022 fputs(" string\n", out);
2025 fputs(" integer\n", out);
2028 fputs(" hex\n", out);
2031 fputs(" ???\n", out);
2034 for (prop = sym->prop; prop; prop = prop->next) {
2035 if (prop->menu != menu)
2037 switch (prop->type) {
2039 fputs(" prompt ", out);
2040 print_quoted_string(out, prop->text);
2041 if (!expr_is_yes(prop->visible.expr)) {
2043 expr_fprint(prop->visible.expr, out);
2048 fputs( " default ", out);
2049 expr_fprint(prop->expr, out);
2050 if (!expr_is_yes(prop->visible.expr)) {
2052 expr_fprint(prop->visible.expr, out);
2057 fputs(" #choice value\n", out);
2060 fprintf(out, " unknown prop %d!\n", prop->type);
2065 int len = strlen(sym->help);
2066 while (sym->help[--len] == '\n')
2068 fprintf(out, " help\n%s\n", sym->help);
2073 void zconfdump(FILE *out)
2075 struct property *prop;
2079 menu = rootmenu.list;
2081 if ((sym = menu->sym))
2082 print_symbol(out, menu);
2083 else if ((prop = menu->prompt)) {
2084 switch (prop->type) {
2086 fputs("\ncomment ", out);
2087 print_quoted_string(out, prop->text);
2091 fputs("\nmenu ", out);
2092 print_quoted_string(out, prop->text);
2098 if (!expr_is_yes(prop->visible.expr)) {
2099 fputs(" depends ", out);
2100 expr_fprint(prop->visible.expr, out);
2108 else if (menu->next)
2110 else while ((menu = menu->parent)) {
2111 if (menu->prompt && menu->prompt->type == P_MENU)
2112 fputs("\nendmenu\n", out);
2121 #include "lex.zconf.c"
2122 #include "confdata.c"