Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs...
[pandora-kernel.git] / scripts / kconfig / zconf.tab.c_shipped
1 /* A Bison parser, made by GNU Bison 2.4.3.  */
2
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
4    
5       Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6    2009, 2010 Free Software Foundation, Inc.
7    
8    This program is free software: you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation, either version 3 of the License, or
11    (at your option) any later version.
12    
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17    
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
20
21 /* As a special exception, you may create a larger work that contains
22    part or all of the Bison parser skeleton and distribute that work
23    under terms of your choice, so long as that work isn't itself a
24    parser generator using the skeleton or a modified version thereof
25    as a parser skeleton.  Alternatively, if you modify or redistribute
26    the parser skeleton itself, you may (at your option) remove this
27    special exception, which will cause the skeleton and the resulting
28    Bison output files to be licensed under the GNU General Public
29    License without this special exception.
30    
31    This special exception was added by the Free Software Foundation in
32    version 2.2 of Bison.  */
33
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35    simplifying the original so-called "semantic" parser.  */
36
37 /* All symbols defined below should begin with yy or YY, to avoid
38    infringing on user name space.  This should be done even for local
39    variables, as they might otherwise be expanded by user macros.
40    There are some unavoidable exceptions within include files to
41    define necessary library symbols; they are noted "INFRINGES ON
42    USER NAME SPACE" below.  */
43
44 /* Identify Bison output.  */
45 #define YYBISON 1
46
47 /* Bison version.  */
48 #define YYBISON_VERSION "2.4.3"
49
50 /* Skeleton name.  */
51 #define YYSKELETON_NAME "yacc.c"
52
53 /* Pure parsers.  */
54 #define YYPURE 0
55
56 /* Push parsers.  */
57 #define YYPUSH 0
58
59 /* Pull parsers.  */
60 #define YYPULL 1
61
62 /* Using locations.  */
63 #define YYLSP_NEEDED 0
64
65 /* Substitute the variable and function names.  */
66 #define yyparse         zconfparse
67 #define yylex           zconflex
68 #define yyerror         zconferror
69 #define yylval          zconflval
70 #define yychar          zconfchar
71 #define yydebug         zconfdebug
72 #define yynerrs         zconfnerrs
73
74
75 /* Copy the first part of user declarations.  */
76
77
78 /*
79  * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
80  * Released under the terms of the GNU GPL v2.0.
81  */
82
83 #include <ctype.h>
84 #include <stdarg.h>
85 #include <stdio.h>
86 #include <stdlib.h>
87 #include <string.h>
88 #include <stdbool.h>
89
90 #define LKC_DIRECT_LINK
91 #include "lkc.h"
92
93 #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
94
95 #define PRINTD          0x0001
96 #define DEBUG_PARSE     0x0002
97
98 int cdebug = PRINTD;
99
100 extern int zconflex(void);
101 static void zconfprint(const char *err, ...);
102 static void zconf_error(const char *err, ...);
103 static void zconferror(const char *err);
104 static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
105
106 struct symbol *symbol_hash[SYMBOL_HASHSIZE];
107
108 static struct menu *current_menu, *current_entry;
109
110
111
112
113 /* Enabling traces.  */
114 #ifndef YYDEBUG
115 # define YYDEBUG 1
116 #endif
117
118 /* Enabling verbose error messages.  */
119 #ifdef YYERROR_VERBOSE
120 # undef YYERROR_VERBOSE
121 # define YYERROR_VERBOSE 1
122 #else
123 # define YYERROR_VERBOSE 0
124 #endif
125
126 /* Enabling the token table.  */
127 #ifndef YYTOKEN_TABLE
128 # define YYTOKEN_TABLE 0
129 #endif
130
131
132 /* Tokens.  */
133 #ifndef YYTOKENTYPE
134 # define YYTOKENTYPE
135    /* Put the tokens into the symbol table, so that GDB and other debuggers
136       know about them.  */
137    enum yytokentype {
138      T_MAINMENU = 258,
139      T_MENU = 259,
140      T_ENDMENU = 260,
141      T_SOURCE = 261,
142      T_CHOICE = 262,
143      T_ENDCHOICE = 263,
144      T_COMMENT = 264,
145      T_CONFIG = 265,
146      T_MENUCONFIG = 266,
147      T_HELP = 267,
148      T_HELPTEXT = 268,
149      T_IF = 269,
150      T_ENDIF = 270,
151      T_DEPENDS = 271,
152      T_OPTIONAL = 272,
153      T_PROMPT = 273,
154      T_TYPE = 274,
155      T_DEFAULT = 275,
156      T_SELECT = 276,
157      T_RANGE = 277,
158      T_VISIBLE = 278,
159      T_OPTION = 279,
160      T_ON = 280,
161      T_WORD = 281,
162      T_WORD_QUOTE = 282,
163      T_UNEQUAL = 283,
164      T_CLOSE_PAREN = 284,
165      T_OPEN_PAREN = 285,
166      T_EOL = 286,
167      T_OR = 287,
168      T_AND = 288,
169      T_EQUAL = 289,
170      T_NOT = 290
171    };
172 #endif
173
174
175
176 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
177 typedef union YYSTYPE
178 {
179
180
181         char *string;
182         struct file *file;
183         struct symbol *symbol;
184         struct expr *expr;
185         struct menu *menu;
186         const struct kconf_id *id;
187
188
189
190 } YYSTYPE;
191 # define YYSTYPE_IS_TRIVIAL 1
192 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
193 # define YYSTYPE_IS_DECLARED 1
194 #endif
195
196
197 /* Copy the second part of user declarations.  */
198
199
200 /* Include zconf.hash.c here so it can see the token constants. */
201 #include "zconf.hash.c"
202
203
204
205 #ifdef short
206 # undef short
207 #endif
208
209 #ifdef YYTYPE_UINT8
210 typedef YYTYPE_UINT8 yytype_uint8;
211 #else
212 typedef unsigned char yytype_uint8;
213 #endif
214
215 #ifdef YYTYPE_INT8
216 typedef YYTYPE_INT8 yytype_int8;
217 #elif (defined __STDC__ || defined __C99__FUNC__ \
218      || defined __cplusplus || defined _MSC_VER)
219 typedef signed char yytype_int8;
220 #else
221 typedef short int yytype_int8;
222 #endif
223
224 #ifdef YYTYPE_UINT16
225 typedef YYTYPE_UINT16 yytype_uint16;
226 #else
227 typedef unsigned short int yytype_uint16;
228 #endif
229
230 #ifdef YYTYPE_INT16
231 typedef YYTYPE_INT16 yytype_int16;
232 #else
233 typedef short int yytype_int16;
234 #endif
235
236 #ifndef YYSIZE_T
237 # ifdef __SIZE_TYPE__
238 #  define YYSIZE_T __SIZE_TYPE__
239 # elif defined size_t
240 #  define YYSIZE_T size_t
241 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
242      || defined __cplusplus || defined _MSC_VER)
243 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
244 #  define YYSIZE_T size_t
245 # else
246 #  define YYSIZE_T unsigned int
247 # endif
248 #endif
249
250 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
251
252 #ifndef YY_
253 # if defined YYENABLE_NLS && YYENABLE_NLS
254 #  if ENABLE_NLS
255 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
256 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
257 #  endif
258 # endif
259 # ifndef YY_
260 #  define YY_(msgid) msgid
261 # endif
262 #endif
263
264 /* Suppress unused-variable warnings by "using" E.  */
265 #if ! defined lint || defined __GNUC__
266 # define YYUSE(e) ((void) (e))
267 #else
268 # define YYUSE(e) /* empty */
269 #endif
270
271 /* Identity function, used to suppress warnings about constant conditions.  */
272 #ifndef lint
273 # define YYID(n) (n)
274 #else
275 #if (defined __STDC__ || defined __C99__FUNC__ \
276      || defined __cplusplus || defined _MSC_VER)
277 static int
278 YYID (int yyi)
279 #else
280 static int
281 YYID (yyi)
282     int yyi;
283 #endif
284 {
285   return yyi;
286 }
287 #endif
288
289 #if ! defined yyoverflow || YYERROR_VERBOSE
290
291 /* The parser invokes alloca or malloc; define the necessary symbols.  */
292
293 # ifdef YYSTACK_USE_ALLOCA
294 #  if YYSTACK_USE_ALLOCA
295 #   ifdef __GNUC__
296 #    define YYSTACK_ALLOC __builtin_alloca
297 #   elif defined __BUILTIN_VA_ARG_INCR
298 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
299 #   elif defined _AIX
300 #    define YYSTACK_ALLOC __alloca
301 #   elif defined _MSC_VER
302 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
303 #    define alloca _alloca
304 #   else
305 #    define YYSTACK_ALLOC alloca
306 #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
307      || defined __cplusplus || defined _MSC_VER)
308 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
309 #     ifndef _STDLIB_H
310 #      define _STDLIB_H 1
311 #     endif
312 #    endif
313 #   endif
314 #  endif
315 # endif
316
317 # ifdef YYSTACK_ALLOC
318    /* Pacify GCC's `empty if-body' warning.  */
319 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
320 #  ifndef YYSTACK_ALLOC_MAXIMUM
321     /* The OS might guarantee only one guard page at the bottom of the stack,
322        and a page size can be as small as 4096 bytes.  So we cannot safely
323        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
324        to allow for a few compiler-allocated temporary stack slots.  */
325 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
326 #  endif
327 # else
328 #  define YYSTACK_ALLOC YYMALLOC
329 #  define YYSTACK_FREE YYFREE
330 #  ifndef YYSTACK_ALLOC_MAXIMUM
331 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
332 #  endif
333 #  if (defined __cplusplus && ! defined _STDLIB_H \
334        && ! ((defined YYMALLOC || defined malloc) \
335              && (defined YYFREE || defined free)))
336 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
337 #   ifndef _STDLIB_H
338 #    define _STDLIB_H 1
339 #   endif
340 #  endif
341 #  ifndef YYMALLOC
342 #   define YYMALLOC malloc
343 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
344      || defined __cplusplus || defined _MSC_VER)
345 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
346 #   endif
347 #  endif
348 #  ifndef YYFREE
349 #   define YYFREE free
350 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
351      || defined __cplusplus || defined _MSC_VER)
352 void free (void *); /* INFRINGES ON USER NAME SPACE */
353 #   endif
354 #  endif
355 # endif
356 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
357
358
359 #if (! defined yyoverflow \
360      && (! defined __cplusplus \
361          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
362
363 /* A type that is properly aligned for any stack member.  */
364 union yyalloc
365 {
366   yytype_int16 yyss_alloc;
367   YYSTYPE yyvs_alloc;
368 };
369
370 /* The size of the maximum gap between one aligned stack and the next.  */
371 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
372
373 /* The size of an array large to enough to hold all stacks, each with
374    N elements.  */
375 # define YYSTACK_BYTES(N) \
376      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
377       + YYSTACK_GAP_MAXIMUM)
378
379 /* Copy COUNT objects from FROM to TO.  The source and destination do
380    not overlap.  */
381 # ifndef YYCOPY
382 #  if defined __GNUC__ && 1 < __GNUC__
383 #   define YYCOPY(To, From, Count) \
384       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
385 #  else
386 #   define YYCOPY(To, From, Count)              \
387       do                                        \
388         {                                       \
389           YYSIZE_T yyi;                         \
390           for (yyi = 0; yyi < (Count); yyi++)   \
391             (To)[yyi] = (From)[yyi];            \
392         }                                       \
393       while (YYID (0))
394 #  endif
395 # endif
396
397 /* Relocate STACK from its old location to the new one.  The
398    local variables YYSIZE and YYSTACKSIZE give the old and new number of
399    elements in the stack, and YYPTR gives the new location of the
400    stack.  Advance YYPTR to a properly aligned location for the next
401    stack.  */
402 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
403     do                                                                  \
404       {                                                                 \
405         YYSIZE_T yynewbytes;                                            \
406         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
407         Stack = &yyptr->Stack_alloc;                                    \
408         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
409         yyptr += yynewbytes / sizeof (*yyptr);                          \
410       }                                                                 \
411     while (YYID (0))
412
413 #endif
414
415 /* YYFINAL -- State number of the termination state.  */
416 #define YYFINAL  11
417 /* YYLAST -- Last index in YYTABLE.  */
418 #define YYLAST   290
419
420 /* YYNTOKENS -- Number of terminals.  */
421 #define YYNTOKENS  36
422 /* YYNNTS -- Number of nonterminals.  */
423 #define YYNNTS  50
424 /* YYNRULES -- Number of rules.  */
425 #define YYNRULES  118
426 /* YYNRULES -- Number of states.  */
427 #define YYNSTATES  191
428
429 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
430 #define YYUNDEFTOK  2
431 #define YYMAXUTOK   290
432
433 #define YYTRANSLATE(YYX)                                                \
434   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
435
436 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
437 static const yytype_uint8 yytranslate[] =
438 {
439        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
440        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
441        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
442        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
443        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
444        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
445        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
446        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
447        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
448        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
449        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
450        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
451        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
452        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
453        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
454        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
455        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
456        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
457        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
458        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
459        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
460        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
461        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
462        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
463        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
464        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
465        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
466       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
467       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
468       35
469 };
470
471 #if YYDEBUG
472 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
473    YYRHS.  */
474 static const yytype_uint16 yyprhs[] =
475 {
476        0,     0,     3,     6,     8,    11,    13,    14,    17,    20,
477       23,    26,    31,    36,    40,    42,    44,    46,    48,    50,
478       52,    54,    56,    58,    60,    62,    64,    66,    68,    72,
479       75,    79,    82,    86,    89,    90,    93,    96,    99,   102,
480      105,   108,   112,   117,   122,   127,   133,   137,   138,   142,
481      143,   146,   150,   153,   155,   159,   160,   163,   166,   169,
482      172,   175,   180,   184,   187,   192,   193,   196,   200,   202,
483      206,   207,   210,   213,   216,   220,   224,   228,   230,   234,
484      235,   238,   241,   244,   248,   252,   255,   258,   261,   262,
485      265,   268,   271,   276,   277,   280,   283,   286,   287,   290,
486      292,   294,   297,   300,   303,   305,   308,   309,   312,   314,
487      318,   322,   326,   329,   333,   337,   339,   341,   342
488 };
489
490 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
491 static const yytype_int8 yyrhs[] =
492 {
493       37,     0,    -1,    81,    38,    -1,    38,    -1,    63,    39,
494       -1,    39,    -1,    -1,    39,    41,    -1,    39,    55,    -1,
495       39,    67,    -1,    39,    80,    -1,    39,    26,     1,    31,
496       -1,    39,    40,     1,    31,    -1,    39,     1,    31,    -1,
497       16,    -1,    18,    -1,    19,    -1,    21,    -1,    17,    -1,
498       22,    -1,    20,    -1,    23,    -1,    31,    -1,    61,    -1,
499       71,    -1,    44,    -1,    46,    -1,    69,    -1,    26,     1,
500       31,    -1,     1,    31,    -1,    10,    26,    31,    -1,    43,
501       47,    -1,    11,    26,    31,    -1,    45,    47,    -1,    -1,
502       47,    48,    -1,    47,    49,    -1,    47,    75,    -1,    47,
503       73,    -1,    47,    42,    -1,    47,    31,    -1,    19,    78,
504       31,    -1,    18,    79,    82,    31,    -1,    20,    83,    82,
505       31,    -1,    21,    26,    82,    31,    -1,    22,    84,    84,
506       82,    31,    -1,    24,    50,    31,    -1,    -1,    50,    26,
507       51,    -1,    -1,    34,    79,    -1,     7,    85,    31,    -1,
508       52,    56,    -1,    80,    -1,    53,    58,    54,    -1,    -1,
509       56,    57,    -1,    56,    75,    -1,    56,    73,    -1,    56,
510       31,    -1,    56,    42,    -1,    18,    79,    82,    31,    -1,
511       19,    78,    31,    -1,    17,    31,    -1,    20,    26,    82,
512       31,    -1,    -1,    58,    41,    -1,    14,    83,    81,    -1,
513       80,    -1,    59,    62,    60,    -1,    -1,    62,    41,    -1,
514       62,    67,    -1,    62,    55,    -1,     3,    79,    81,    -1,
515        4,    79,    31,    -1,    64,    76,    74,    -1,    80,    -1,
516       65,    68,    66,    -1,    -1,    68,    41,    -1,    68,    67,
517       -1,    68,    55,    -1,     6,    79,    31,    -1,     9,    79,
518       31,    -1,    70,    74,    -1,    12,    31,    -1,    72,    13,
519       -1,    -1,    74,    75,    -1,    74,    31,    -1,    74,    42,
520       -1,    16,    25,    83,    31,    -1,    -1,    76,    77,    -1,
521       76,    31,    -1,    23,    82,    -1,    -1,    79,    82,    -1,
522       26,    -1,    27,    -1,     5,    31,    -1,     8,    31,    -1,
523       15,    31,    -1,    31,    -1,    81,    31,    -1,    -1,    14,
524       83,    -1,    84,    -1,    84,    34,    84,    -1,    84,    28,
525       84,    -1,    30,    83,    29,    -1,    35,    83,    -1,    83,
526       32,    83,    -1,    83,    33,    83,    -1,    26,    -1,    27,
527       -1,    -1,    26,    -1
528 };
529
530 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
531 static const yytype_uint16 yyrline[] =
532 {
533        0,   104,   104,   104,   106,   106,   108,   110,   111,   112,
534      113,   114,   115,   119,   123,   123,   123,   123,   123,   123,
535      123,   123,   127,   128,   129,   130,   131,   132,   136,   137,
536      143,   151,   157,   165,   175,   177,   178,   179,   180,   181,
537      182,   185,   193,   199,   209,   215,   221,   224,   226,   237,
538      238,   243,   252,   257,   265,   268,   270,   271,   272,   273,
539      274,   277,   283,   294,   300,   310,   312,   317,   325,   333,
540      336,   338,   339,   340,   345,   352,   359,   364,   372,   375,
541      377,   378,   379,   382,   390,   397,   404,   410,   417,   419,
542      420,   421,   424,   432,   434,   435,   438,   445,   447,   452,
543      453,   456,   457,   458,   462,   463,   466,   467,   470,   471,
544      472,   473,   474,   475,   476,   479,   480,   483,   484
545 };
546 #endif
547
548 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
549 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
550    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
551 static const char *const yytname[] =
552 {
553   "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
554   "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
555   "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
556   "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE",
557   "T_VISIBLE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
558   "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
559   "T_NOT", "$accept", "input", "start", "stmt_list", "option_name",
560   "common_stmt", "option_error", "config_entry_start", "config_stmt",
561   "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
562   "config_option", "symbol_option", "symbol_option_list",
563   "symbol_option_arg", "choice", "choice_entry", "choice_end",
564   "choice_stmt", "choice_option_list", "choice_option", "choice_block",
565   "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu",
566   "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt",
567   "comment", "comment_stmt", "help_start", "help", "depends_list",
568   "depends", "visibility_list", "visible", "prompt_stmt_opt", "prompt",
569   "end", "nl", "if_expr", "expr", "symbol", "word_opt", 0
570 };
571 #endif
572
573 # ifdef YYPRINT
574 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
575    token YYLEX-NUM.  */
576 static const yytype_uint16 yytoknum[] =
577 {
578        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
579      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
580      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
581      285,   286,   287,   288,   289,   290
582 };
583 # endif
584
585 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
586 static const yytype_uint8 yyr1[] =
587 {
588        0,    36,    37,    37,    38,    38,    39,    39,    39,    39,
589       39,    39,    39,    39,    40,    40,    40,    40,    40,    40,
590       40,    40,    41,    41,    41,    41,    41,    41,    42,    42,
591       43,    44,    45,    46,    47,    47,    47,    47,    47,    47,
592       47,    48,    48,    48,    48,    48,    49,    50,    50,    51,
593       51,    52,    53,    54,    55,    56,    56,    56,    56,    56,
594       56,    57,    57,    57,    57,    58,    58,    59,    60,    61,
595       62,    62,    62,    62,    63,    64,    65,    66,    67,    68,
596       68,    68,    68,    69,    70,    71,    72,    73,    74,    74,
597       74,    74,    75,    76,    76,    76,    77,    78,    78,    79,
598       79,    80,    80,    80,    81,    81,    82,    82,    83,    83,
599       83,    83,    83,    83,    83,    84,    84,    85,    85
600 };
601
602 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
603 static const yytype_uint8 yyr2[] =
604 {
605        0,     2,     2,     1,     2,     1,     0,     2,     2,     2,
606        2,     4,     4,     3,     1,     1,     1,     1,     1,     1,
607        1,     1,     1,     1,     1,     1,     1,     1,     3,     2,
608        3,     2,     3,     2,     0,     2,     2,     2,     2,     2,
609        2,     3,     4,     4,     4,     5,     3,     0,     3,     0,
610        2,     3,     2,     1,     3,     0,     2,     2,     2,     2,
611        2,     4,     3,     2,     4,     0,     2,     3,     1,     3,
612        0,     2,     2,     2,     3,     3,     3,     1,     3,     0,
613        2,     2,     2,     3,     3,     2,     2,     2,     0,     2,
614        2,     2,     4,     0,     2,     2,     2,     0,     2,     1,
615        1,     2,     2,     2,     1,     2,     0,     2,     1,     3,
616        3,     3,     2,     3,     3,     1,     1,     0,     1
617 };
618
619 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
620    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
621    means the default is an error.  */
622 static const yytype_uint8 yydefact[] =
623 {
624        6,     0,   104,     0,     3,     0,     6,     6,    99,   100,
625        0,     1,     0,     0,     0,     0,   117,     0,     0,     0,
626        0,     0,     0,    14,    18,    15,    16,    20,    17,    19,
627       21,     0,    22,     0,     7,    34,    25,    34,    26,    55,
628       65,     8,    70,    23,    93,    79,     9,    27,    88,    24,
629       10,     0,   105,     2,    74,    13,     0,   101,     0,   118,
630        0,   102,     0,     0,     0,   115,   116,     0,     0,     0,
631      108,   103,     0,     0,     0,     0,     0,     0,     0,    88,
632        0,     0,    75,    83,    51,    84,    30,    32,     0,   112,
633        0,     0,    67,     0,     0,    11,    12,     0,     0,     0,
634        0,    97,     0,     0,     0,    47,     0,    40,    39,    35,
635       36,     0,    38,    37,     0,     0,    97,     0,    59,    60,
636       56,    58,    57,    66,    54,    53,    71,    73,    69,    72,
637       68,   106,    95,     0,    94,    80,    82,    78,    81,    77,
638       90,    91,    89,   111,   113,   114,   110,   109,    29,    86,
639        0,   106,     0,   106,   106,   106,     0,     0,     0,    87,
640       63,   106,     0,   106,     0,    96,     0,     0,    41,    98,
641        0,     0,   106,    49,    46,    28,     0,    62,     0,   107,
642       92,    42,    43,    44,     0,     0,    48,    61,    64,    45,
643       50
644 };
645
646 /* YYDEFGOTO[NTERM-NUM].  */
647 static const yytype_int16 yydefgoto[] =
648 {
649       -1,     3,     4,     5,    33,    34,   108,    35,    36,    37,
650       38,    74,   109,   110,   157,   186,    39,    40,   124,    41,
651       76,   120,    77,    42,   128,    43,    78,     6,    44,    45,
652      137,    46,    80,    47,    48,    49,   111,   112,    81,   113,
653       79,   134,   152,   153,    50,     7,   165,    69,    70,    60
654 };
655
656 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
657    STATE-NUM.  */
658 #define YYPACT_NINF -90
659 static const yytype_int16 yypact[] =
660 {
661        4,    42,   -90,    96,   -90,   111,   -90,    15,   -90,   -90,
662       75,   -90,    82,    42,   104,    42,   110,   107,    42,   115,
663      125,    -4,   121,   -90,   -90,   -90,   -90,   -90,   -90,   -90,
664      -90,   162,   -90,   163,   -90,   -90,   -90,   -90,   -90,   -90,
665      -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,
666      -90,   139,   -90,   -90,   138,   -90,   142,   -90,   143,   -90,
667      152,   -90,   164,   167,   168,   -90,   -90,    -4,    -4,    77,
668      -18,   -90,   177,   185,    33,    71,   195,   247,   236,    -2,
669      236,   171,   -90,   -90,   -90,   -90,   -90,   -90,    41,   -90,
670       -4,    -4,   138,    97,    97,   -90,   -90,   186,   187,   194,
671       42,    42,    -4,   196,    97,   -90,   219,   -90,   -90,   -90,
672      -90,   210,   -90,   -90,   204,    42,    42,   199,   -90,   -90,
673      -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,
674      -90,   222,   -90,   223,   -90,   -90,   -90,   -90,   -90,   -90,
675      -90,   -90,   -90,   -90,   215,   -90,   -90,   -90,   -90,   -90,
676       -4,   222,   228,   222,    -5,   222,    97,    35,   229,   -90,
677      -90,   222,   232,   222,    -4,   -90,   135,   233,   -90,   -90,
678      234,   235,   222,   240,   -90,   -90,   237,   -90,   239,   -13,
679      -90,   -90,   -90,   -90,   244,    42,   -90,   -90,   -90,   -90,
680      -90
681 };
682
683 /* YYPGOTO[NTERM-NUM].  */
684 static const yytype_int16 yypgoto[] =
685 {
686      -90,   -90,   269,   271,   -90,    23,   -70,   -90,   -90,   -90,
687      -90,   243,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -48,
688      -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,   -90,
689      -90,   -20,   -90,   -90,   -90,   -90,   -90,   206,   205,   -68,
690      -90,   -90,   169,    -1,    27,    -7,   118,   -66,   -89,   -90
691 };
692
693 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
694    positive, shift that token.  If negative, reduce the rule which
695    number is the opposite.  If zero, do what YYDEFACT says.
696    If YYTABLE_NINF, syntax error.  */
697 #define YYTABLE_NINF -86
698 static const yytype_int16 yytable[] =
699 {
700       10,    88,    89,    54,   146,   147,   119,     1,   122,   164,
701       93,   141,    56,   142,    58,   156,    94,    62,     1,    90,
702       91,   131,    65,    66,   144,   145,    67,    90,    91,   132,
703      127,    68,   136,   -31,    97,     2,   154,   -31,   -31,   -31,
704      -31,   -31,   -31,   -31,   -31,    98,    52,   -31,   -31,    99,
705      -31,   100,   101,   102,   103,   104,   -31,   105,   129,   106,
706      138,   173,    92,   141,   107,   142,   174,   172,     8,     9,
707      143,   -33,    97,    90,    91,   -33,   -33,   -33,   -33,   -33,
708      -33,   -33,   -33,    98,   166,   -33,   -33,    99,   -33,   100,
709      101,   102,   103,   104,   -33,   105,    11,   106,   179,   151,
710      123,   126,   107,   135,   125,   130,     2,   139,     2,    90,
711       91,    -5,    12,    55,   161,    13,    14,    15,    16,    17,
712       18,    19,    20,    65,    66,    21,    22,    23,    24,    25,
713       26,    27,    28,    29,    30,    57,    59,    31,    61,    -4,
714       12,    63,    32,    13,    14,    15,    16,    17,    18,    19,
715       20,    64,    71,    21,    22,    23,    24,    25,    26,    27,
716       28,    29,    30,    72,    73,    31,   180,    90,    91,    52,
717       32,   -85,    97,    82,    83,   -85,   -85,   -85,   -85,   -85,
718      -85,   -85,   -85,    84,   190,   -85,   -85,    99,   -85,   -85,
719      -85,   -85,   -85,   -85,   -85,    85,    97,   106,    86,    87,
720      -52,   -52,   140,   -52,   -52,   -52,   -52,    98,    95,   -52,
721      -52,    99,   114,   115,   116,   117,    96,   148,   149,   150,
722      158,   106,   155,   159,    97,   163,   118,   -76,   -76,   -76,
723      -76,   -76,   -76,   -76,   -76,   160,   164,   -76,   -76,    99,
724       13,    14,    15,    16,    17,    18,    19,    20,    91,   106,
725       21,    22,    14,    15,   140,    17,    18,    19,    20,   168,
726      175,    21,    22,   177,   181,   182,   183,    32,   187,   167,
727      188,   169,   170,   171,   185,   189,    53,    51,    32,   176,
728       75,   178,   121,     0,   133,   162,     0,     0,     0,     0,
729      184
730 };
731
732 static const yytype_int16 yycheck[] =
733 {
734        1,    67,    68,    10,    93,    94,    76,     3,    76,    14,
735       28,    81,    13,    81,    15,   104,    34,    18,     3,    32,
736       33,    23,    26,    27,    90,    91,    30,    32,    33,    31,
737       78,    35,    80,     0,     1,    31,   102,     4,     5,     6,
738        7,     8,     9,    10,    11,    12,    31,    14,    15,    16,
739       17,    18,    19,    20,    21,    22,    23,    24,    78,    26,
740       80,    26,    69,   133,    31,   133,    31,   156,    26,    27,
741       29,     0,     1,    32,    33,     4,     5,     6,     7,     8,
742        9,    10,    11,    12,   150,    14,    15,    16,    17,    18,
743       19,    20,    21,    22,    23,    24,     0,    26,   164,   100,
744       77,    78,    31,    80,    77,    78,    31,    80,    31,    32,
745       33,     0,     1,    31,   115,     4,     5,     6,     7,     8,
746        9,    10,    11,    26,    27,    14,    15,    16,    17,    18,
747       19,    20,    21,    22,    23,    31,    26,    26,    31,     0,
748        1,    26,    31,     4,     5,     6,     7,     8,     9,    10,
749       11,    26,    31,    14,    15,    16,    17,    18,    19,    20,
750       21,    22,    23,     1,     1,    26,    31,    32,    33,    31,
751       31,     0,     1,    31,    31,     4,     5,     6,     7,     8,
752        9,    10,    11,    31,   185,    14,    15,    16,    17,    18,
753       19,    20,    21,    22,    23,    31,     1,    26,    31,    31,
754        5,     6,    31,     8,     9,    10,    11,    12,    31,    14,
755       15,    16,    17,    18,    19,    20,    31,    31,    31,    25,
756        1,    26,    26,    13,     1,    26,    31,     4,     5,     6,
757        7,     8,     9,    10,    11,    31,    14,    14,    15,    16,
758        4,     5,     6,     7,     8,     9,    10,    11,    33,    26,
759       14,    15,     5,     6,    31,     8,     9,    10,    11,    31,
760       31,    14,    15,    31,    31,    31,    31,    31,    31,   151,
761       31,   153,   154,   155,    34,    31,     7,     6,    31,   161,
762       37,   163,    76,    -1,    79,   116,    -1,    -1,    -1,    -1,
763      172
764 };
765
766 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
767    symbol of state STATE-NUM.  */
768 static const yytype_uint8 yystos[] =
769 {
770        0,     3,    31,    37,    38,    39,    63,    81,    26,    27,
771       79,     0,     1,     4,     5,     6,     7,     8,     9,    10,
772       11,    14,    15,    16,    17,    18,    19,    20,    21,    22,
773       23,    26,    31,    40,    41,    43,    44,    45,    46,    52,
774       53,    55,    59,    61,    64,    65,    67,    69,    70,    71,
775       80,    39,    31,    38,    81,    31,    79,    31,    79,    26,
776       85,    31,    79,    26,    26,    26,    27,    30,    35,    83,
777       84,    31,     1,     1,    47,    47,    56,    58,    62,    76,
778       68,    74,    31,    31,    31,    31,    31,    31,    83,    83,
779       32,    33,    81,    28,    34,    31,    31,     1,    12,    16,
780       18,    19,    20,    21,    22,    24,    26,    31,    42,    48,
781       49,    72,    73,    75,    17,    18,    19,    20,    31,    42,
782       57,    73,    75,    41,    54,    80,    41,    55,    60,    67,
783       80,    23,    31,    74,    77,    41,    55,    66,    67,    80,
784       31,    42,    75,    29,    83,    83,    84,    84,    31,    31,
785       25,    79,    78,    79,    83,    26,    84,    50,     1,    13,
786       31,    79,    78,    26,    14,    82,    83,    82,    31,    82,
787       82,    82,    84,    26,    31,    31,    82,    31,    82,    83,
788       31,    31,    31,    31,    82,    34,    51,    31,    31,    31,
789       79
790 };
791
792 #define yyerrok         (yyerrstatus = 0)
793 #define yyclearin       (yychar = YYEMPTY)
794 #define YYEMPTY         (-2)
795 #define YYEOF           0
796
797 #define YYACCEPT        goto yyacceptlab
798 #define YYABORT         goto yyabortlab
799 #define YYERROR         goto yyerrorlab
800
801
802 /* Like YYERROR except do call yyerror.  This remains here temporarily
803    to ease the transition to the new meaning of YYERROR, for GCC.
804    Once GCC version 2 has supplanted version 1, this can go.  However,
805    YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
806    in Bison 2.4.2's NEWS entry, where a plan to phase it out is
807    discussed.  */
808
809 #define YYFAIL          goto yyerrlab
810 #if defined YYFAIL
811   /* This is here to suppress warnings from the GCC cpp's
812      -Wunused-macros.  Normally we don't worry about that warning, but
813      some users do, and we want to make it easy for users to remove
814      YYFAIL uses, which will produce warnings from Bison 2.5.  */
815 #endif
816
817 #define YYRECOVERING()  (!!yyerrstatus)
818
819 #define YYBACKUP(Token, Value)                                  \
820 do                                                              \
821   if (yychar == YYEMPTY && yylen == 1)                          \
822     {                                                           \
823       yychar = (Token);                                         \
824       yylval = (Value);                                         \
825       yytoken = YYTRANSLATE (yychar);                           \
826       YYPOPSTACK (1);                                           \
827       goto yybackup;                                            \
828     }                                                           \
829   else                                                          \
830     {                                                           \
831       yyerror (YY_("syntax error: cannot back up")); \
832       YYERROR;                                                  \
833     }                                                           \
834 while (YYID (0))
835
836
837 #define YYTERROR        1
838 #define YYERRCODE       256
839
840
841 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
842    If N is 0, then set CURRENT to the empty location which ends
843    the previous symbol: RHS[0] (always defined).  */
844
845 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
846 #ifndef YYLLOC_DEFAULT
847 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
848     do                                                                  \
849       if (YYID (N))                                                    \
850         {                                                               \
851           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
852           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
853           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
854           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
855         }                                                               \
856       else                                                              \
857         {                                                               \
858           (Current).first_line   = (Current).last_line   =              \
859             YYRHSLOC (Rhs, 0).last_line;                                \
860           (Current).first_column = (Current).last_column =              \
861             YYRHSLOC (Rhs, 0).last_column;                              \
862         }                                                               \
863     while (YYID (0))
864 #endif
865
866
867 /* YY_LOCATION_PRINT -- Print the location on the stream.
868    This macro was not mandated originally: define only if we know
869    we won't break user code: when these are the locations we know.  */
870
871 #ifndef YY_LOCATION_PRINT
872 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
873 #  define YY_LOCATION_PRINT(File, Loc)                  \
874      fprintf (File, "%d.%d-%d.%d",                      \
875               (Loc).first_line, (Loc).first_column,     \
876               (Loc).last_line,  (Loc).last_column)
877 # else
878 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
879 # endif
880 #endif
881
882
883 /* YYLEX -- calling `yylex' with the right arguments.  */
884
885 #ifdef YYLEX_PARAM
886 # define YYLEX yylex (YYLEX_PARAM)
887 #else
888 # define YYLEX yylex ()
889 #endif
890
891 /* Enable debugging if requested.  */
892 #if YYDEBUG
893
894 # ifndef YYFPRINTF
895 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
896 #  define YYFPRINTF fprintf
897 # endif
898
899 # define YYDPRINTF(Args)                        \
900 do {                                            \
901   if (yydebug)                                  \
902     YYFPRINTF Args;                             \
903 } while (YYID (0))
904
905 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
906 do {                                                                      \
907   if (yydebug)                                                            \
908     {                                                                     \
909       YYFPRINTF (stderr, "%s ", Title);                                   \
910       yy_symbol_print (stderr,                                            \
911                   Type, Value); \
912       YYFPRINTF (stderr, "\n");                                           \
913     }                                                                     \
914 } while (YYID (0))
915
916
917 /*--------------------------------.
918 | Print this symbol on YYOUTPUT.  |
919 `--------------------------------*/
920
921 /*ARGSUSED*/
922 #if (defined __STDC__ || defined __C99__FUNC__ \
923      || defined __cplusplus || defined _MSC_VER)
924 static void
925 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
926 #else
927 static void
928 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
929     FILE *yyoutput;
930     int yytype;
931     YYSTYPE const * const yyvaluep;
932 #endif
933 {
934   if (!yyvaluep)
935     return;
936 # ifdef YYPRINT
937   if (yytype < YYNTOKENS)
938     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
939 # else
940   YYUSE (yyoutput);
941 # endif
942   switch (yytype)
943     {
944       default:
945         break;
946     }
947 }
948
949
950 /*--------------------------------.
951 | Print this symbol on YYOUTPUT.  |
952 `--------------------------------*/
953
954 #if (defined __STDC__ || defined __C99__FUNC__ \
955      || defined __cplusplus || defined _MSC_VER)
956 static void
957 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
958 #else
959 static void
960 yy_symbol_print (yyoutput, yytype, yyvaluep)
961     FILE *yyoutput;
962     int yytype;
963     YYSTYPE const * const yyvaluep;
964 #endif
965 {
966   if (yytype < YYNTOKENS)
967     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
968   else
969     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
970
971   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
972   YYFPRINTF (yyoutput, ")");
973 }
974
975 /*------------------------------------------------------------------.
976 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
977 | TOP (included).                                                   |
978 `------------------------------------------------------------------*/
979
980 #if (defined __STDC__ || defined __C99__FUNC__ \
981      || defined __cplusplus || defined _MSC_VER)
982 static void
983 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
984 #else
985 static void
986 yy_stack_print (yybottom, yytop)
987     yytype_int16 *yybottom;
988     yytype_int16 *yytop;
989 #endif
990 {
991   YYFPRINTF (stderr, "Stack now");
992   for (; yybottom <= yytop; yybottom++)
993     {
994       int yybot = *yybottom;
995       YYFPRINTF (stderr, " %d", yybot);
996     }
997   YYFPRINTF (stderr, "\n");
998 }
999
1000 # define YY_STACK_PRINT(Bottom, Top)                            \
1001 do {                                                            \
1002   if (yydebug)                                                  \
1003     yy_stack_print ((Bottom), (Top));                           \
1004 } while (YYID (0))
1005
1006
1007 /*------------------------------------------------.
1008 | Report that the YYRULE is going to be reduced.  |
1009 `------------------------------------------------*/
1010
1011 #if (defined __STDC__ || defined __C99__FUNC__ \
1012      || defined __cplusplus || defined _MSC_VER)
1013 static void
1014 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1015 #else
1016 static void
1017 yy_reduce_print (yyvsp, yyrule)
1018     YYSTYPE *yyvsp;
1019     int yyrule;
1020 #endif
1021 {
1022   int yynrhs = yyr2[yyrule];
1023   int yyi;
1024   unsigned long int yylno = yyrline[yyrule];
1025   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1026              yyrule - 1, yylno);
1027   /* The symbols being reduced.  */
1028   for (yyi = 0; yyi < yynrhs; yyi++)
1029     {
1030       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1031       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1032                        &(yyvsp[(yyi + 1) - (yynrhs)])
1033                                        );
1034       YYFPRINTF (stderr, "\n");
1035     }
1036 }
1037
1038 # define YY_REDUCE_PRINT(Rule)          \
1039 do {                                    \
1040   if (yydebug)                          \
1041     yy_reduce_print (yyvsp, Rule); \
1042 } while (YYID (0))
1043
1044 /* Nonzero means print parse trace.  It is left uninitialized so that
1045    multiple parsers can coexist.  */
1046 int yydebug;
1047 #else /* !YYDEBUG */
1048 # define YYDPRINTF(Args)
1049 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1050 # define YY_STACK_PRINT(Bottom, Top)
1051 # define YY_REDUCE_PRINT(Rule)
1052 #endif /* !YYDEBUG */
1053
1054
1055 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1056 #ifndef YYINITDEPTH
1057 # define YYINITDEPTH 200
1058 #endif
1059
1060 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1061    if the built-in stack extension method is used).
1062
1063    Do not make this value too large; the results are undefined if
1064    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1065    evaluated with infinite-precision integer arithmetic.  */
1066
1067 #ifndef YYMAXDEPTH
1068 # define YYMAXDEPTH 10000
1069 #endif
1070
1071 \f
1072
1073 #if YYERROR_VERBOSE
1074
1075 # ifndef yystrlen
1076 #  if defined __GLIBC__ && defined _STRING_H
1077 #   define yystrlen strlen
1078 #  else
1079 /* Return the length of YYSTR.  */
1080 #if (defined __STDC__ || defined __C99__FUNC__ \
1081      || defined __cplusplus || defined _MSC_VER)
1082 static YYSIZE_T
1083 yystrlen (const char *yystr)
1084 #else
1085 static YYSIZE_T
1086 yystrlen (yystr)
1087     const char *yystr;
1088 #endif
1089 {
1090   YYSIZE_T yylen;
1091   for (yylen = 0; yystr[yylen]; yylen++)
1092     continue;
1093   return yylen;
1094 }
1095 #  endif
1096 # endif
1097
1098 # ifndef yystpcpy
1099 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1100 #   define yystpcpy stpcpy
1101 #  else
1102 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1103    YYDEST.  */
1104 #if (defined __STDC__ || defined __C99__FUNC__ \
1105      || defined __cplusplus || defined _MSC_VER)
1106 static char *
1107 yystpcpy (char *yydest, const char *yysrc)
1108 #else
1109 static char *
1110 yystpcpy (yydest, yysrc)
1111     char *yydest;
1112     const char *yysrc;
1113 #endif
1114 {
1115   char *yyd = yydest;
1116   const char *yys = yysrc;
1117
1118   while ((*yyd++ = *yys++) != '\0')
1119     continue;
1120
1121   return yyd - 1;
1122 }
1123 #  endif
1124 # endif
1125
1126 # ifndef yytnamerr
1127 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1128    quotes and backslashes, so that it's suitable for yyerror.  The
1129    heuristic is that double-quoting is unnecessary unless the string
1130    contains an apostrophe, a comma, or backslash (other than
1131    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1132    null, do not copy; instead, return the length of what the result
1133    would have been.  */
1134 static YYSIZE_T
1135 yytnamerr (char *yyres, const char *yystr)
1136 {
1137   if (*yystr == '"')
1138     {
1139       YYSIZE_T yyn = 0;
1140       char const *yyp = yystr;
1141
1142       for (;;)
1143         switch (*++yyp)
1144           {
1145           case '\'':
1146           case ',':
1147             goto do_not_strip_quotes;
1148
1149           case '\\':
1150             if (*++yyp != '\\')
1151               goto do_not_strip_quotes;
1152             /* Fall through.  */
1153           default:
1154             if (yyres)
1155               yyres[yyn] = *yyp;
1156             yyn++;
1157             break;
1158
1159           case '"':
1160             if (yyres)
1161               yyres[yyn] = '\0';
1162             return yyn;
1163           }
1164     do_not_strip_quotes: ;
1165     }
1166
1167   if (! yyres)
1168     return yystrlen (yystr);
1169
1170   return yystpcpy (yyres, yystr) - yyres;
1171 }
1172 # endif
1173
1174 /* Copy into YYRESULT an error message about the unexpected token
1175    YYCHAR while in state YYSTATE.  Return the number of bytes copied,
1176    including the terminating null byte.  If YYRESULT is null, do not
1177    copy anything; just return the number of bytes that would be
1178    copied.  As a special case, return 0 if an ordinary "syntax error"
1179    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
1180    size calculation.  */
1181 static YYSIZE_T
1182 yysyntax_error (char *yyresult, int yystate, int yychar)
1183 {
1184   int yyn = yypact[yystate];
1185
1186   if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1187     return 0;
1188   else
1189     {
1190       int yytype = YYTRANSLATE (yychar);
1191       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1192       YYSIZE_T yysize = yysize0;
1193       YYSIZE_T yysize1;
1194       int yysize_overflow = 0;
1195       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1196       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1197       int yyx;
1198
1199 # if 0
1200       /* This is so xgettext sees the translatable formats that are
1201          constructed on the fly.  */
1202       YY_("syntax error, unexpected %s");
1203       YY_("syntax error, unexpected %s, expecting %s");
1204       YY_("syntax error, unexpected %s, expecting %s or %s");
1205       YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1206       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1207 # endif
1208       char *yyfmt;
1209       char const *yyf;
1210       static char const yyunexpected[] = "syntax error, unexpected %s";
1211       static char const yyexpecting[] = ", expecting %s";
1212       static char const yyor[] = " or %s";
1213       char yyformat[sizeof yyunexpected
1214                     + sizeof yyexpecting - 1
1215                     + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1216                        * (sizeof yyor - 1))];
1217       char const *yyprefix = yyexpecting;
1218
1219       /* Start YYX at -YYN if negative to avoid negative indexes in
1220          YYCHECK.  */
1221       int yyxbegin = yyn < 0 ? -yyn : 0;
1222
1223       /* Stay within bounds of both yycheck and yytname.  */
1224       int yychecklim = YYLAST - yyn + 1;
1225       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1226       int yycount = 1;
1227
1228       yyarg[0] = yytname[yytype];
1229       yyfmt = yystpcpy (yyformat, yyunexpected);
1230
1231       for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1232         if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1233           {
1234             if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1235               {
1236                 yycount = 1;
1237                 yysize = yysize0;
1238                 yyformat[sizeof yyunexpected - 1] = '\0';
1239                 break;
1240               }
1241             yyarg[yycount++] = yytname[yyx];
1242             yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1243             yysize_overflow |= (yysize1 < yysize);
1244             yysize = yysize1;
1245             yyfmt = yystpcpy (yyfmt, yyprefix);
1246             yyprefix = yyor;
1247           }
1248
1249       yyf = YY_(yyformat);
1250       yysize1 = yysize + yystrlen (yyf);
1251       yysize_overflow |= (yysize1 < yysize);
1252       yysize = yysize1;
1253
1254       if (yysize_overflow)
1255         return YYSIZE_MAXIMUM;
1256
1257       if (yyresult)
1258         {
1259           /* Avoid sprintf, as that infringes on the user's name space.
1260              Don't have undefined behavior even if the translation
1261              produced a string with the wrong number of "%s"s.  */
1262           char *yyp = yyresult;
1263           int yyi = 0;
1264           while ((*yyp = *yyf) != '\0')
1265             {
1266               if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1267                 {
1268                   yyp += yytnamerr (yyp, yyarg[yyi++]);
1269                   yyf += 2;
1270                 }
1271               else
1272                 {
1273                   yyp++;
1274                   yyf++;
1275                 }
1276             }
1277         }
1278       return yysize;
1279     }
1280 }
1281 #endif /* YYERROR_VERBOSE */
1282 \f
1283
1284 /*-----------------------------------------------.
1285 | Release the memory associated to this symbol.  |
1286 `-----------------------------------------------*/
1287
1288 /*ARGSUSED*/
1289 #if (defined __STDC__ || defined __C99__FUNC__ \
1290      || defined __cplusplus || defined _MSC_VER)
1291 static void
1292 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1293 #else
1294 static void
1295 yydestruct (yymsg, yytype, yyvaluep)
1296     const char *yymsg;
1297     int yytype;
1298     YYSTYPE *yyvaluep;
1299 #endif
1300 {
1301   YYUSE (yyvaluep);
1302
1303   if (!yymsg)
1304     yymsg = "Deleting";
1305   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1306
1307   switch (yytype)
1308     {
1309       case 53: /* "choice_entry" */
1310
1311         {
1312         fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1313                 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1314         if (current_menu == (yyvaluep->menu))
1315                 menu_end_menu();
1316 };
1317
1318         break;
1319       case 59: /* "if_entry" */
1320
1321         {
1322         fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1323                 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1324         if (current_menu == (yyvaluep->menu))
1325                 menu_end_menu();
1326 };
1327
1328         break;
1329       case 65: /* "menu_entry" */
1330
1331         {
1332         fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1333                 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1334         if (current_menu == (yyvaluep->menu))
1335                 menu_end_menu();
1336 };
1337
1338         break;
1339
1340       default:
1341         break;
1342     }
1343 }
1344
1345 /* Prevent warnings from -Wmissing-prototypes.  */
1346 #ifdef YYPARSE_PARAM
1347 #if defined __STDC__ || defined __cplusplus
1348 int yyparse (void *YYPARSE_PARAM);
1349 #else
1350 int yyparse ();
1351 #endif
1352 #else /* ! YYPARSE_PARAM */
1353 #if defined __STDC__ || defined __cplusplus
1354 int yyparse (void);
1355 #else
1356 int yyparse ();
1357 #endif
1358 #endif /* ! YYPARSE_PARAM */
1359
1360
1361 /* The lookahead symbol.  */
1362 int yychar;
1363
1364 /* The semantic value of the lookahead symbol.  */
1365 YYSTYPE yylval;
1366
1367 /* Number of syntax errors so far.  */
1368 int yynerrs;
1369
1370
1371
1372 /*-------------------------.
1373 | yyparse or yypush_parse.  |
1374 `-------------------------*/
1375
1376 #ifdef YYPARSE_PARAM
1377 #if (defined __STDC__ || defined __C99__FUNC__ \
1378      || defined __cplusplus || defined _MSC_VER)
1379 int
1380 yyparse (void *YYPARSE_PARAM)
1381 #else
1382 int
1383 yyparse (YYPARSE_PARAM)
1384     void *YYPARSE_PARAM;
1385 #endif
1386 #else /* ! YYPARSE_PARAM */
1387 #if (defined __STDC__ || defined __C99__FUNC__ \
1388      || defined __cplusplus || defined _MSC_VER)
1389 int
1390 yyparse (void)
1391 #else
1392 int
1393 yyparse ()
1394
1395 #endif
1396 #endif
1397 {
1398
1399
1400     int yystate;
1401     /* Number of tokens to shift before error messages enabled.  */
1402     int yyerrstatus;
1403
1404     /* The stacks and their tools:
1405        `yyss': related to states.
1406        `yyvs': related to semantic values.
1407
1408        Refer to the stacks thru separate pointers, to allow yyoverflow
1409        to reallocate them elsewhere.  */
1410
1411     /* The state stack.  */
1412     yytype_int16 yyssa[YYINITDEPTH];
1413     yytype_int16 *yyss;
1414     yytype_int16 *yyssp;
1415
1416     /* The semantic value stack.  */
1417     YYSTYPE yyvsa[YYINITDEPTH];
1418     YYSTYPE *yyvs;
1419     YYSTYPE *yyvsp;
1420
1421     YYSIZE_T yystacksize;
1422
1423   int yyn;
1424   int yyresult;
1425   /* Lookahead token as an internal (translated) token number.  */
1426   int yytoken;
1427   /* The variables used to return semantic value and location from the
1428      action routines.  */
1429   YYSTYPE yyval;
1430
1431 #if YYERROR_VERBOSE
1432   /* Buffer for error messages, and its allocated size.  */
1433   char yymsgbuf[128];
1434   char *yymsg = yymsgbuf;
1435   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1436 #endif
1437
1438 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1439
1440   /* The number of symbols on the RHS of the reduced rule.
1441      Keep to zero when no symbol should be popped.  */
1442   int yylen = 0;
1443
1444   yytoken = 0;
1445   yyss = yyssa;
1446   yyvs = yyvsa;
1447   yystacksize = YYINITDEPTH;
1448
1449   YYDPRINTF ((stderr, "Starting parse\n"));
1450
1451   yystate = 0;
1452   yyerrstatus = 0;
1453   yynerrs = 0;
1454   yychar = YYEMPTY; /* Cause a token to be read.  */
1455
1456   /* Initialize stack pointers.
1457      Waste one element of value and location stack
1458      so that they stay on the same level as the state stack.
1459      The wasted elements are never initialized.  */
1460   yyssp = yyss;
1461   yyvsp = yyvs;
1462
1463   goto yysetstate;
1464
1465 /*------------------------------------------------------------.
1466 | yynewstate -- Push a new state, which is found in yystate.  |
1467 `------------------------------------------------------------*/
1468  yynewstate:
1469   /* In all cases, when you get here, the value and location stacks
1470      have just been pushed.  So pushing a state here evens the stacks.  */
1471   yyssp++;
1472
1473  yysetstate:
1474   *yyssp = yystate;
1475
1476   if (yyss + yystacksize - 1 <= yyssp)
1477     {
1478       /* Get the current used size of the three stacks, in elements.  */
1479       YYSIZE_T yysize = yyssp - yyss + 1;
1480
1481 #ifdef yyoverflow
1482       {
1483         /* Give user a chance to reallocate the stack.  Use copies of
1484            these so that the &'s don't force the real ones into
1485            memory.  */
1486         YYSTYPE *yyvs1 = yyvs;
1487         yytype_int16 *yyss1 = yyss;
1488
1489         /* Each stack pointer address is followed by the size of the
1490            data in use in that stack, in bytes.  This used to be a
1491            conditional around just the two extra args, but that might
1492            be undefined if yyoverflow is a macro.  */
1493         yyoverflow (YY_("memory exhausted"),
1494                     &yyss1, yysize * sizeof (*yyssp),
1495                     &yyvs1, yysize * sizeof (*yyvsp),
1496                     &yystacksize);
1497
1498         yyss = yyss1;
1499         yyvs = yyvs1;
1500       }
1501 #else /* no yyoverflow */
1502 # ifndef YYSTACK_RELOCATE
1503       goto yyexhaustedlab;
1504 # else
1505       /* Extend the stack our own way.  */
1506       if (YYMAXDEPTH <= yystacksize)
1507         goto yyexhaustedlab;
1508       yystacksize *= 2;
1509       if (YYMAXDEPTH < yystacksize)
1510         yystacksize = YYMAXDEPTH;
1511
1512       {
1513         yytype_int16 *yyss1 = yyss;
1514         union yyalloc *yyptr =
1515           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1516         if (! yyptr)
1517           goto yyexhaustedlab;
1518         YYSTACK_RELOCATE (yyss_alloc, yyss);
1519         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1520 #  undef YYSTACK_RELOCATE
1521         if (yyss1 != yyssa)
1522           YYSTACK_FREE (yyss1);
1523       }
1524 # endif
1525 #endif /* no yyoverflow */
1526
1527       yyssp = yyss + yysize - 1;
1528       yyvsp = yyvs + yysize - 1;
1529
1530       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1531                   (unsigned long int) yystacksize));
1532
1533       if (yyss + yystacksize - 1 <= yyssp)
1534         YYABORT;
1535     }
1536
1537   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1538
1539   if (yystate == YYFINAL)
1540     YYACCEPT;
1541
1542   goto yybackup;
1543
1544 /*-----------.
1545 | yybackup.  |
1546 `-----------*/
1547 yybackup:
1548
1549   /* Do appropriate processing given the current state.  Read a
1550      lookahead token if we need one and don't already have one.  */
1551
1552   /* First try to decide what to do without reference to lookahead token.  */
1553   yyn = yypact[yystate];
1554   if (yyn == YYPACT_NINF)
1555     goto yydefault;
1556
1557   /* Not known => get a lookahead token if don't already have one.  */
1558
1559   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1560   if (yychar == YYEMPTY)
1561     {
1562       YYDPRINTF ((stderr, "Reading a token: "));
1563       yychar = YYLEX;
1564     }
1565
1566   if (yychar <= YYEOF)
1567     {
1568       yychar = yytoken = YYEOF;
1569       YYDPRINTF ((stderr, "Now at end of input.\n"));
1570     }
1571   else
1572     {
1573       yytoken = YYTRANSLATE (yychar);
1574       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1575     }
1576
1577   /* If the proper action on seeing token YYTOKEN is to reduce or to
1578      detect an error, take that action.  */
1579   yyn += yytoken;
1580   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1581     goto yydefault;
1582   yyn = yytable[yyn];
1583   if (yyn <= 0)
1584     {
1585       if (yyn == 0 || yyn == YYTABLE_NINF)
1586         goto yyerrlab;
1587       yyn = -yyn;
1588       goto yyreduce;
1589     }
1590
1591   /* Count tokens shifted since error; after three, turn off error
1592      status.  */
1593   if (yyerrstatus)
1594     yyerrstatus--;
1595
1596   /* Shift the lookahead token.  */
1597   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1598
1599   /* Discard the shifted token.  */
1600   yychar = YYEMPTY;
1601
1602   yystate = yyn;
1603   *++yyvsp = yylval;
1604
1605   goto yynewstate;
1606
1607
1608 /*-----------------------------------------------------------.
1609 | yydefault -- do the default action for the current state.  |
1610 `-----------------------------------------------------------*/
1611 yydefault:
1612   yyn = yydefact[yystate];
1613   if (yyn == 0)
1614     goto yyerrlab;
1615   goto yyreduce;
1616
1617
1618 /*-----------------------------.
1619 | yyreduce -- Do a reduction.  |
1620 `-----------------------------*/
1621 yyreduce:
1622   /* yyn is the number of a rule to reduce with.  */
1623   yylen = yyr2[yyn];
1624
1625   /* If YYLEN is nonzero, implement the default value of the action:
1626      `$$ = $1'.
1627
1628      Otherwise, the following line sets YYVAL to garbage.
1629      This behavior is undocumented and Bison
1630      users should not rely upon it.  Assigning to YYVAL
1631      unconditionally makes the parser a bit smaller, and it avoids a
1632      GCC warning that YYVAL may be used uninitialized.  */
1633   yyval = yyvsp[1-yylen];
1634
1635
1636   YY_REDUCE_PRINT (yyn);
1637   switch (yyn)
1638     {
1639         case 10:
1640
1641     { zconf_error("unexpected end statement"); ;}
1642     break;
1643
1644   case 11:
1645
1646     { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;}
1647     break;
1648
1649   case 12:
1650
1651     {
1652         zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
1653 ;}
1654     break;
1655
1656   case 13:
1657
1658     { zconf_error("invalid statement"); ;}
1659     break;
1660
1661   case 28:
1662
1663     { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;}
1664     break;
1665
1666   case 29:
1667
1668     { zconf_error("invalid option"); ;}
1669     break;
1670
1671   case 30:
1672
1673     {
1674         struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
1675         sym->flags |= SYMBOL_OPTIONAL;
1676         menu_add_entry(sym);
1677         printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1678 ;}
1679     break;
1680
1681   case 31:
1682
1683     {
1684         menu_end_entry();
1685         printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1686 ;}
1687     break;
1688
1689   case 32:
1690
1691     {
1692         struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
1693         sym->flags |= SYMBOL_OPTIONAL;
1694         menu_add_entry(sym);
1695         printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1696 ;}
1697     break;
1698
1699   case 33:
1700
1701     {
1702         if (current_entry->prompt)
1703                 current_entry->prompt->type = P_MENU;
1704         else
1705                 zconfprint("warning: menuconfig statement without prompt");
1706         menu_end_entry();
1707         printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1708 ;}
1709     break;
1710
1711   case 41:
1712
1713     {
1714         menu_set_type((yyvsp[(1) - (3)].id)->stype);
1715         printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1716                 zconf_curname(), zconf_lineno(),
1717                 (yyvsp[(1) - (3)].id)->stype);
1718 ;}
1719     break;
1720
1721   case 42:
1722
1723     {
1724         menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
1725         printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1726 ;}
1727     break;
1728
1729   case 43:
1730
1731     {
1732         menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr));
1733         if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN)
1734                 menu_set_type((yyvsp[(1) - (4)].id)->stype);
1735         printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
1736                 zconf_curname(), zconf_lineno(),
1737                 (yyvsp[(1) - (4)].id)->stype);
1738 ;}
1739     break;
1740
1741   case 44:
1742
1743     {
1744         menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
1745         printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1746 ;}
1747     break;
1748
1749   case 45:
1750
1751     {
1752         menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr));
1753         printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1754 ;}
1755     break;
1756
1757   case 48:
1758
1759     {
1760         const struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
1761         if (id && id->flags & TF_OPTION)
1762                 menu_add_option(id->token, (yyvsp[(3) - (3)].string));
1763         else
1764                 zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string));
1765         free((yyvsp[(2) - (3)].string));
1766 ;}
1767     break;
1768
1769   case 49:
1770
1771     { (yyval.string) = NULL; ;}
1772     break;
1773
1774   case 50:
1775
1776     { (yyval.string) = (yyvsp[(2) - (2)].string); ;}
1777     break;
1778
1779   case 51:
1780
1781     {
1782         struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE);
1783         sym->flags |= SYMBOL_AUTO;
1784         menu_add_entry(sym);
1785         menu_add_expr(P_CHOICE, NULL, NULL);
1786         printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1787 ;}
1788     break;
1789
1790   case 52:
1791
1792     {
1793         (yyval.menu) = menu_add_menu();
1794 ;}
1795     break;
1796
1797   case 53:
1798
1799     {
1800         if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) {
1801                 menu_end_menu();
1802                 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
1803         }
1804 ;}
1805     break;
1806
1807   case 61:
1808
1809     {
1810         menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
1811         printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1812 ;}
1813     break;
1814
1815   case 62:
1816
1817     {
1818         if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) {
1819                 menu_set_type((yyvsp[(1) - (3)].id)->stype);
1820                 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1821                         zconf_curname(), zconf_lineno(),
1822                         (yyvsp[(1) - (3)].id)->stype);
1823         } else
1824                 YYERROR;
1825 ;}
1826     break;
1827
1828   case 63:
1829
1830     {
1831         current_entry->sym->flags |= SYMBOL_OPTIONAL;
1832         printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1833 ;}
1834     break;
1835
1836   case 64:
1837
1838     {
1839         if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) {
1840                 menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
1841                 printd(DEBUG_PARSE, "%s:%d:default\n",
1842                         zconf_curname(), zconf_lineno());
1843         } else
1844                 YYERROR;
1845 ;}
1846     break;
1847
1848   case 67:
1849
1850     {
1851         printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
1852         menu_add_entry(NULL);
1853         menu_add_dep((yyvsp[(2) - (3)].expr));
1854         (yyval.menu) = menu_add_menu();
1855 ;}
1856     break;
1857
1858   case 68:
1859
1860     {
1861         if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) {
1862                 menu_end_menu();
1863                 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
1864         }
1865 ;}
1866     break;
1867
1868   case 74:
1869
1870     {
1871         menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1872 ;}
1873     break;
1874
1875   case 75:
1876
1877     {
1878         menu_add_entry(NULL);
1879         menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1880         printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1881 ;}
1882     break;
1883
1884   case 76:
1885
1886     {
1887         (yyval.menu) = menu_add_menu();
1888 ;}
1889     break;
1890
1891   case 77:
1892
1893     {
1894         if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) {
1895                 menu_end_menu();
1896                 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
1897         }
1898 ;}
1899     break;
1900
1901   case 83:
1902
1903     {
1904         printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1905         zconf_nextfile((yyvsp[(2) - (3)].string));
1906 ;}
1907     break;
1908
1909   case 84:
1910
1911     {
1912         menu_add_entry(NULL);
1913         menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL);
1914         printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1915 ;}
1916     break;
1917
1918   case 85:
1919
1920     {
1921         menu_end_entry();
1922 ;}
1923     break;
1924
1925   case 86:
1926
1927     {
1928         printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
1929         zconf_starthelp();
1930 ;}
1931     break;
1932
1933   case 87:
1934
1935     {
1936         current_entry->help = (yyvsp[(2) - (2)].string);
1937 ;}
1938     break;
1939
1940   case 92:
1941
1942     {
1943         menu_add_dep((yyvsp[(3) - (4)].expr));
1944         printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
1945 ;}
1946     break;
1947
1948   case 96:
1949
1950     {
1951         menu_add_visibility((yyvsp[(2) - (2)].expr));
1952 ;}
1953     break;
1954
1955   case 98:
1956
1957     {
1958         menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
1959 ;}
1960     break;
1961
1962   case 101:
1963
1964     { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1965     break;
1966
1967   case 102:
1968
1969     { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1970     break;
1971
1972   case 103:
1973
1974     { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1975     break;
1976
1977   case 106:
1978
1979     { (yyval.expr) = NULL; ;}
1980     break;
1981
1982   case 107:
1983
1984     { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;}
1985     break;
1986
1987   case 108:
1988
1989     { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;}
1990     break;
1991
1992   case 109:
1993
1994     { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
1995     break;
1996
1997   case 110:
1998
1999     { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
2000     break;
2001
2002   case 111:
2003
2004     { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;}
2005     break;
2006
2007   case 112:
2008
2009     { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;}
2010     break;
2011
2012   case 113:
2013
2014     { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2015     break;
2016
2017   case 114:
2018
2019     { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2020     break;
2021
2022   case 115:
2023
2024     { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;}
2025     break;
2026
2027   case 116:
2028
2029     { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;}
2030     break;
2031
2032   case 117:
2033
2034     { (yyval.string) = NULL; ;}
2035     break;
2036
2037
2038
2039       default: break;
2040     }
2041   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2042
2043   YYPOPSTACK (yylen);
2044   yylen = 0;
2045   YY_STACK_PRINT (yyss, yyssp);
2046
2047   *++yyvsp = yyval;
2048
2049   /* Now `shift' the result of the reduction.  Determine what state
2050      that goes to, based on the state we popped back to and the rule
2051      number reduced by.  */
2052
2053   yyn = yyr1[yyn];
2054
2055   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2056   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2057     yystate = yytable[yystate];
2058   else
2059     yystate = yydefgoto[yyn - YYNTOKENS];
2060
2061   goto yynewstate;
2062
2063
2064 /*------------------------------------.
2065 | yyerrlab -- here on detecting error |
2066 `------------------------------------*/
2067 yyerrlab:
2068   /* If not already recovering from an error, report this error.  */
2069   if (!yyerrstatus)
2070     {
2071       ++yynerrs;
2072 #if ! YYERROR_VERBOSE
2073       yyerror (YY_("syntax error"));
2074 #else
2075       {
2076         YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2077         if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2078           {
2079             YYSIZE_T yyalloc = 2 * yysize;
2080             if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2081               yyalloc = YYSTACK_ALLOC_MAXIMUM;
2082             if (yymsg != yymsgbuf)
2083               YYSTACK_FREE (yymsg);
2084             yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2085             if (yymsg)
2086               yymsg_alloc = yyalloc;
2087             else
2088               {
2089                 yymsg = yymsgbuf;
2090                 yymsg_alloc = sizeof yymsgbuf;
2091               }
2092           }
2093
2094         if (0 < yysize && yysize <= yymsg_alloc)
2095           {
2096             (void) yysyntax_error (yymsg, yystate, yychar);
2097             yyerror (yymsg);
2098           }
2099         else
2100           {
2101             yyerror (YY_("syntax error"));
2102             if (yysize != 0)
2103               goto yyexhaustedlab;
2104           }
2105       }
2106 #endif
2107     }
2108
2109
2110
2111   if (yyerrstatus == 3)
2112     {
2113       /* If just tried and failed to reuse lookahead token after an
2114          error, discard it.  */
2115
2116       if (yychar <= YYEOF)
2117         {
2118           /* Return failure if at end of input.  */
2119           if (yychar == YYEOF)
2120             YYABORT;
2121         }
2122       else
2123         {
2124           yydestruct ("Error: discarding",
2125                       yytoken, &yylval);
2126           yychar = YYEMPTY;
2127         }
2128     }
2129
2130   /* Else will try to reuse lookahead token after shifting the error
2131      token.  */
2132   goto yyerrlab1;
2133
2134
2135 /*---------------------------------------------------.
2136 | yyerrorlab -- error raised explicitly by YYERROR.  |
2137 `---------------------------------------------------*/
2138 yyerrorlab:
2139
2140   /* Pacify compilers like GCC when the user code never invokes
2141      YYERROR and the label yyerrorlab therefore never appears in user
2142      code.  */
2143   if (/*CONSTCOND*/ 0)
2144      goto yyerrorlab;
2145
2146   /* Do not reclaim the symbols of the rule which action triggered
2147      this YYERROR.  */
2148   YYPOPSTACK (yylen);
2149   yylen = 0;
2150   YY_STACK_PRINT (yyss, yyssp);
2151   yystate = *yyssp;
2152   goto yyerrlab1;
2153
2154
2155 /*-------------------------------------------------------------.
2156 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
2157 `-------------------------------------------------------------*/
2158 yyerrlab1:
2159   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2160
2161   for (;;)
2162     {
2163       yyn = yypact[yystate];
2164       if (yyn != YYPACT_NINF)
2165         {
2166           yyn += YYTERROR;
2167           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2168             {
2169               yyn = yytable[yyn];
2170               if (0 < yyn)
2171                 break;
2172             }
2173         }
2174
2175       /* Pop the current state because it cannot handle the error token.  */
2176       if (yyssp == yyss)
2177         YYABORT;
2178
2179
2180       yydestruct ("Error: popping",
2181                   yystos[yystate], yyvsp);
2182       YYPOPSTACK (1);
2183       yystate = *yyssp;
2184       YY_STACK_PRINT (yyss, yyssp);
2185     }
2186
2187   *++yyvsp = yylval;
2188
2189
2190   /* Shift the error token.  */
2191   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2192
2193   yystate = yyn;
2194   goto yynewstate;
2195
2196
2197 /*-------------------------------------.
2198 | yyacceptlab -- YYACCEPT comes here.  |
2199 `-------------------------------------*/
2200 yyacceptlab:
2201   yyresult = 0;
2202   goto yyreturn;
2203
2204 /*-----------------------------------.
2205 | yyabortlab -- YYABORT comes here.  |
2206 `-----------------------------------*/
2207 yyabortlab:
2208   yyresult = 1;
2209   goto yyreturn;
2210
2211 #if !defined(yyoverflow) || YYERROR_VERBOSE
2212 /*-------------------------------------------------.
2213 | yyexhaustedlab -- memory exhaustion comes here.  |
2214 `-------------------------------------------------*/
2215 yyexhaustedlab:
2216   yyerror (YY_("memory exhausted"));
2217   yyresult = 2;
2218   /* Fall through.  */
2219 #endif
2220
2221 yyreturn:
2222   if (yychar != YYEMPTY)
2223      yydestruct ("Cleanup: discarding lookahead",
2224                  yytoken, &yylval);
2225   /* Do not reclaim the symbols of the rule which action triggered
2226      this YYABORT or YYACCEPT.  */
2227   YYPOPSTACK (yylen);
2228   YY_STACK_PRINT (yyss, yyssp);
2229   while (yyssp != yyss)
2230     {
2231       yydestruct ("Cleanup: popping",
2232                   yystos[*yyssp], yyvsp);
2233       YYPOPSTACK (1);
2234     }
2235 #ifndef yyoverflow
2236   if (yyss != yyssa)
2237     YYSTACK_FREE (yyss);
2238 #endif
2239 #if YYERROR_VERBOSE
2240   if (yymsg != yymsgbuf)
2241     YYSTACK_FREE (yymsg);
2242 #endif
2243   /* Make sure YYID is used.  */
2244   return YYID (yyresult);
2245 }
2246
2247
2248
2249
2250
2251 void conf_parse(const char *name)
2252 {
2253         struct symbol *sym;
2254         int i;
2255
2256         zconf_initscan(name);
2257
2258         sym_init();
2259         _menu_init();
2260         modules_sym = sym_lookup(NULL, 0);
2261         modules_sym->type = S_BOOLEAN;
2262         modules_sym->flags |= SYMBOL_AUTO;
2263         rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
2264
2265         if (getenv("ZCONF_DEBUG"))
2266                 zconfdebug = 1;
2267         zconfparse();
2268         if (zconfnerrs)
2269                 exit(1);
2270         if (!modules_sym->prop) {
2271                 struct property *prop;
2272
2273                 prop = prop_alloc(P_DEFAULT, modules_sym);
2274                 prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
2275         }
2276
2277         rootmenu.prompt->text = _(rootmenu.prompt->text);
2278         rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
2279
2280         menu_finalize(&rootmenu);
2281         for_all_symbols(i, sym) {
2282                 if (sym_check_deps(sym))
2283                         zconfnerrs++;
2284         }
2285         if (zconfnerrs)
2286                 exit(1);
2287         sym_set_change_count(1);
2288 }
2289
2290 static const char *zconf_tokenname(int token)
2291 {
2292         switch (token) {
2293         case T_MENU:            return "menu";
2294         case T_ENDMENU:         return "endmenu";
2295         case T_CHOICE:          return "choice";
2296         case T_ENDCHOICE:       return "endchoice";
2297         case T_IF:              return "if";
2298         case T_ENDIF:           return "endif";
2299         case T_DEPENDS:         return "depends";
2300         case T_VISIBLE:         return "visible";
2301         }
2302         return "<token>";
2303 }
2304
2305 static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken)
2306 {
2307         if (id->token != endtoken) {
2308                 zconf_error("unexpected '%s' within %s block",
2309                         kconf_id_strings + id->name, zconf_tokenname(starttoken));
2310                 zconfnerrs++;
2311                 return false;
2312         }
2313         if (current_menu->file != current_file) {
2314                 zconf_error("'%s' in different file than '%s'",
2315                         kconf_id_strings + id->name, zconf_tokenname(starttoken));
2316                 fprintf(stderr, "%s:%d: location of the '%s'\n",
2317                         current_menu->file->name, current_menu->lineno,
2318                         zconf_tokenname(starttoken));
2319                 zconfnerrs++;
2320                 return false;
2321         }
2322         return true;
2323 }
2324
2325 static void zconfprint(const char *err, ...)
2326 {
2327         va_list ap;
2328
2329         fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
2330         va_start(ap, err);
2331         vfprintf(stderr, err, ap);
2332         va_end(ap);
2333         fprintf(stderr, "\n");
2334 }
2335
2336 static void zconf_error(const char *err, ...)
2337 {
2338         va_list ap;
2339
2340         zconfnerrs++;
2341         fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
2342         va_start(ap, err);
2343         vfprintf(stderr, err, ap);
2344         va_end(ap);
2345         fprintf(stderr, "\n");
2346 }
2347
2348 static void zconferror(const char *err)
2349 {
2350         fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
2351 }
2352
2353 static void print_quoted_string(FILE *out, const char *str)
2354 {
2355         const char *p;
2356         int len;
2357
2358         putc('"', out);
2359         while ((p = strchr(str, '"'))) {
2360                 len = p - str;
2361                 if (len)
2362                         fprintf(out, "%.*s", len, str);
2363                 fputs("\\\"", out);
2364                 str = p + 1;
2365         }
2366         fputs(str, out);
2367         putc('"', out);
2368 }
2369
2370 static void print_symbol(FILE *out, struct menu *menu)
2371 {
2372         struct symbol *sym = menu->sym;
2373         struct property *prop;
2374
2375         if (sym_is_choice(sym))
2376                 fprintf(out, "\nchoice\n");
2377         else
2378                 fprintf(out, "\nconfig %s\n", sym->name);
2379         switch (sym->type) {
2380         case S_BOOLEAN:
2381                 fputs("  boolean\n", out);
2382                 break;
2383         case S_TRISTATE:
2384                 fputs("  tristate\n", out);
2385                 break;
2386         case S_STRING:
2387                 fputs("  string\n", out);
2388                 break;
2389         case S_INT:
2390                 fputs("  integer\n", out);
2391                 break;
2392         case S_HEX:
2393                 fputs("  hex\n", out);
2394                 break;
2395         default:
2396                 fputs("  ???\n", out);
2397                 break;
2398         }
2399         for (prop = sym->prop; prop; prop = prop->next) {
2400                 if (prop->menu != menu)
2401                         continue;
2402                 switch (prop->type) {
2403                 case P_PROMPT:
2404                         fputs("  prompt ", out);
2405                         print_quoted_string(out, prop->text);
2406                         if (!expr_is_yes(prop->visible.expr)) {
2407                                 fputs(" if ", out);
2408                                 expr_fprint(prop->visible.expr, out);
2409                         }
2410                         fputc('\n', out);
2411                         break;
2412                 case P_DEFAULT:
2413                         fputs( "  default ", out);
2414                         expr_fprint(prop->expr, out);
2415                         if (!expr_is_yes(prop->visible.expr)) {
2416                                 fputs(" if ", out);
2417                                 expr_fprint(prop->visible.expr, out);
2418                         }
2419                         fputc('\n', out);
2420                         break;
2421                 case P_CHOICE:
2422                         fputs("  #choice value\n", out);
2423                         break;
2424                 case P_SELECT:
2425                         fputs( "  select ", out);
2426                         expr_fprint(prop->expr, out);
2427                         fputc('\n', out);
2428                         break;
2429                 case P_RANGE:
2430                         fputs( "  range ", out);
2431                         expr_fprint(prop->expr, out);
2432                         fputc('\n', out);
2433                         break;
2434                 case P_MENU:
2435                         fputs( "  menu ", out);
2436                         print_quoted_string(out, prop->text);
2437                         fputc('\n', out);
2438                         break;
2439                 default:
2440                         fprintf(out, "  unknown prop %d!\n", prop->type);
2441                         break;
2442                 }
2443         }
2444         if (menu->help) {
2445                 int len = strlen(menu->help);
2446                 while (menu->help[--len] == '\n')
2447                         menu->help[len] = 0;
2448                 fprintf(out, "  help\n%s\n", menu->help);
2449         }
2450 }
2451
2452 void zconfdump(FILE *out)
2453 {
2454         struct property *prop;
2455         struct symbol *sym;
2456         struct menu *menu;
2457
2458         menu = rootmenu.list;
2459         while (menu) {
2460                 if ((sym = menu->sym))
2461                         print_symbol(out, menu);
2462                 else if ((prop = menu->prompt)) {
2463                         switch (prop->type) {
2464                         case P_COMMENT:
2465                                 fputs("\ncomment ", out);
2466                                 print_quoted_string(out, prop->text);
2467                                 fputs("\n", out);
2468                                 break;
2469                         case P_MENU:
2470                                 fputs("\nmenu ", out);
2471                                 print_quoted_string(out, prop->text);
2472                                 fputs("\n", out);
2473                                 break;
2474                         default:
2475                                 ;
2476                         }
2477                         if (!expr_is_yes(prop->visible.expr)) {
2478                                 fputs("  depends ", out);
2479                                 expr_fprint(prop->visible.expr, out);
2480                                 fputc('\n', out);
2481                         }
2482                 }
2483
2484                 if (menu->list)
2485                         menu = menu->list;
2486                 else if (menu->next)
2487                         menu = menu->next;
2488                 else while ((menu = menu->parent)) {
2489                         if (menu->prompt && menu->prompt->type == P_MENU)
2490                                 fputs("\nendmenu\n", out);
2491                         if (menu->next) {
2492                                 menu = menu->next;
2493                                 break;
2494                         }
2495                 }
2496         }
2497 }
2498
2499 #include "zconf.lex.c"
2500 #include "util.c"
2501 #include "confdata.c"
2502 #include "expr.c"
2503 #include "symbol.c"
2504 #include "menu.c"
2505