www.usr.com/support/gpl/USR9113_release1.0.tar.gz
[bcm963xx.git] / kernel / linux / scripts / kconfig / zconf.tab.c_shipped
1 /* A Bison parser, made by GNU Bison 1.875a.  */
2
3 /* Skeleton parser for Yacc-like parsing with Bison,
4    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5
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)
9    any later version.
10
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.
15
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.  */
20
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.  */
25
26 /* Written by Richard Stallman by simplifying the original so called
27    ``semantic'' parser.  */
28
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.  */
35
36 /* Identify Bison output.  */
37 #define YYBISON 1
38
39 /* Skeleton name.  */
40 #define YYSKELETON_NAME "yacc.c"
41
42 /* Pure parsers.  */
43 #define YYPURE 0
44
45 /* Using locations.  */
46 #define YYLSP_NEEDED 0
47
48 /* If NAME_PREFIX is specified substitute the variables and functions
49    names.  */
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
57
58
59 /* Tokens.  */
60 #ifndef YYTOKENTYPE
61 # define YYTOKENTYPE
62    /* Put the tokens into the symbol table, so that GDB and other debuggers
63       know about them.  */
64    enum yytokentype {
65      T_MAINMENU = 258,
66      T_MENU = 259,
67      T_ENDMENU = 260,
68      T_SOURCE = 261,
69      T_CHOICE = 262,
70      T_ENDCHOICE = 263,
71      T_COMMENT = 264,
72      T_CONFIG = 265,
73      T_MENUCONFIG = 266,
74      T_HELP = 267,
75      T_HELPTEXT = 268,
76      T_IF = 269,
77      T_ENDIF = 270,
78      T_DEPENDS = 271,
79      T_REQUIRES = 272,
80      T_OPTIONAL = 273,
81      T_PROMPT = 274,
82      T_DEFAULT = 275,
83      T_TRISTATE = 276,
84      T_DEF_TRISTATE = 277,
85      T_BOOLEAN = 278,
86      T_DEF_BOOLEAN = 279,
87      T_STRING = 280,
88      T_INT = 281,
89      T_HEX = 282,
90      T_WORD = 283,
91      T_WORD_QUOTE = 284,
92      T_UNEQUAL = 285,
93      T_EOF = 286,
94      T_EOL = 287,
95      T_CLOSE_PAREN = 288,
96      T_OPEN_PAREN = 289,
97      T_ON = 290,
98      T_SELECT = 291,
99      T_RANGE = 292,
100      T_OR = 293,
101      T_AND = 294,
102      T_EQUAL = 295,
103      T_NOT = 296
104    };
105 #endif
106 #define T_MAINMENU 258
107 #define T_MENU 259
108 #define T_ENDMENU 260
109 #define T_SOURCE 261
110 #define T_CHOICE 262
111 #define T_ENDCHOICE 263
112 #define T_COMMENT 264
113 #define T_CONFIG 265
114 #define T_MENUCONFIG 266
115 #define T_HELP 267
116 #define T_HELPTEXT 268
117 #define T_IF 269
118 #define T_ENDIF 270
119 #define T_DEPENDS 271
120 #define T_REQUIRES 272
121 #define T_OPTIONAL 273
122 #define T_PROMPT 274
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
128 #define T_STRING 280
129 #define T_INT 281
130 #define T_HEX 282
131 #define T_WORD 283
132 #define T_WORD_QUOTE 284
133 #define T_UNEQUAL 285
134 #define T_EOF 286
135 #define T_EOL 287
136 #define T_CLOSE_PAREN 288
137 #define T_OPEN_PAREN 289
138 #define T_ON 290
139 #define T_SELECT 291
140 #define T_RANGE 292
141 #define T_OR 293
142 #define T_AND 294
143 #define T_EQUAL 295
144 #define T_NOT 296
145
146
147
148
149 /* Copy the first part of user declarations.  */
150
151
152 /*
153  * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
154  * Released under the terms of the GNU GPL v2.0.
155  */
156
157 #include <ctype.h>
158 #include <stdarg.h>
159 #include <stdio.h>
160 #include <stdlib.h>
161 #include <string.h>
162 #include <stdbool.h>
163
164 #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
165
166 #define PRINTD          0x0001
167 #define DEBUG_PARSE     0x0002
168
169 int cdebug = PRINTD;
170
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);
175
176 struct symbol *symbol_hash[257];
177
178 /* CONFIG_MIPS_BRCM Begin Broadcom changed code. */
179 /* These variables must be moved here from menu.c to make
180  * GCC4.0 happy.  See CRDDB00016084 */
181 static struct menu *current_menu, *current_entry;
182 /* CONFIG_MIPS_BRCM end Broadcom changed code. */
183
184 #define YYERROR_VERBOSE
185
186
187 /* Enabling traces.  */
188 #ifndef YYDEBUG
189 # define YYDEBUG 0
190 #endif
191
192 /* Enabling verbose error messages.  */
193 #ifdef YYERROR_VERBOSE
194 # undef YYERROR_VERBOSE
195 # define YYERROR_VERBOSE 1
196 #else
197 # define YYERROR_VERBOSE 0
198 #endif
199
200 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
201
202 typedef union YYSTYPE {
203         int token;
204         char *string;
205         struct symbol *symbol;
206         struct expr *expr;
207         struct menu *menu;
208 } YYSTYPE;
209 /* Line 191 of yacc.c.  */
210
211 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
212 # define YYSTYPE_IS_DECLARED 1
213 # define YYSTYPE_IS_TRIVIAL 1
214 #endif
215
216
217
218 /* Copy the second part of user declarations.  */
219
220
221 #define LKC_DIRECT_LINK
222 #include "lkc.h"
223
224
225 /* Line 214 of yacc.c.  */
226
227
228 #if ! defined (yyoverflow) || YYERROR_VERBOSE
229
230 /* The parser invokes alloca or malloc; define the necessary symbols.  */
231
232 # if YYSTACK_USE_ALLOCA
233 #  define YYSTACK_ALLOC alloca
234 # else
235 #  ifndef YYSTACK_USE_ALLOCA
236 #   if defined (alloca) || defined (_ALLOCA_H)
237 #    define YYSTACK_ALLOC alloca
238 #   else
239 #    ifdef __GNUC__
240 #     define YYSTACK_ALLOC __builtin_alloca
241 #    endif
242 #   endif
243 #  endif
244 # endif
245
246 # ifdef YYSTACK_ALLOC
247    /* Pacify GCC's `empty if-body' warning. */
248 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
249 # else
250 #  if defined (__STDC__) || defined (__cplusplus)
251 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
252 #   define YYSIZE_T size_t
253 #  endif
254 #  define YYSTACK_ALLOC malloc
255 #  define YYSTACK_FREE free
256 # endif
257 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
258
259
260 #if (! defined (yyoverflow) \
261      && (! defined (__cplusplus) \
262          || (YYSTYPE_IS_TRIVIAL)))
263
264 /* A type that is properly aligned for any stack member.  */
265 union yyalloc
266 {
267   short yyss;
268   YYSTYPE yyvs;
269   };
270
271 /* The size of the maximum gap between one aligned stack and the next.  */
272 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
273
274 /* The size of an array large to enough to hold all stacks, each with
275    N elements.  */
276 # define YYSTACK_BYTES(N) \
277      ((N) * (sizeof (short) + sizeof (YYSTYPE))                         \
278       + YYSTACK_GAP_MAXIMUM)
279
280 /* Copy COUNT objects from FROM to TO.  The source and destination do
281    not overlap.  */
282 # ifndef YYCOPY
283 #  if 1 < __GNUC__
284 #   define YYCOPY(To, From, Count) \
285       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
286 #  else
287 #   define YYCOPY(To, From, Count)              \
288       do                                        \
289         {                                       \
290           register YYSIZE_T yyi;                \
291           for (yyi = 0; yyi < (Count); yyi++)   \
292             (To)[yyi] = (From)[yyi];            \
293         }                                       \
294       while (0)
295 #  endif
296 # endif
297
298 /* Relocate STACK from its old location to the new one.  The
299    local variables YYSIZE and YYSTACKSIZE give the old and new number of
300    elements in the stack, and YYPTR gives the new location of the
301    stack.  Advance YYPTR to a properly aligned location for the next
302    stack.  */
303 # define YYSTACK_RELOCATE(Stack)                                        \
304     do                                                                  \
305       {                                                                 \
306         YYSIZE_T yynewbytes;                                            \
307         YYCOPY (&yyptr->Stack, Stack, yysize);                          \
308         Stack = &yyptr->Stack;                                          \
309         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
310         yyptr += yynewbytes / sizeof (*yyptr);                          \
311       }                                                                 \
312     while (0)
313
314 #endif
315
316 #if defined (__STDC__) || defined (__cplusplus)
317    typedef signed char yysigned_char;
318 #else
319    typedef short yysigned_char;
320 #endif
321
322 /* YYFINAL -- State number of the termination state. */
323 #define YYFINAL  2
324 /* YYLAST -- Last index in YYTABLE.  */
325 #define YYLAST   201
326
327 /* YYNTOKENS -- Number of terminals. */
328 #define YYNTOKENS  42
329 /* YYNNTS -- Number of nonterminals. */
330 #define YYNNTS  41
331 /* YYNRULES -- Number of rules. */
332 #define YYNRULES  104
333 /* YYNRULES -- Number of states. */
334 #define YYNSTATES  182
335
336 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
337 #define YYUNDEFTOK  2
338 #define YYMAXUTOK   296
339
340 #define YYTRANSLATE(YYX)                                                \
341   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
342
343 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
344 static const unsigned char yytranslate[] =
345 {
346        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
347        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
348        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
349        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
350        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
351        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
352        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
353        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
354        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
355        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
356        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
357        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
358        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
359        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
360        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
361        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
362        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
363        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
364        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
365        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
366        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
367        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
368        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
369        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
370        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
371        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
372        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
373       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
374       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
375       35,    36,    37,    38,    39,    40,    41
376 };
377
378 #if YYDEBUG
379 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
380    YYRHS.  */
381 static const unsigned short yyprhs[] =
382 {
383        0,     0,     3,     4,     7,     9,    11,    13,    17,    19,
384       21,    23,    26,    28,    30,    32,    34,    36,    38,    42,
385       45,    49,    52,    53,    56,    59,    62,    65,    69,    74,
386       78,    83,    87,    91,    95,   100,   105,   110,   116,   119,
387      122,   124,   128,   131,   132,   135,   138,   141,   144,   149,
388      153,   157,   160,   165,   166,   169,   173,   175,   179,   182,
389      183,   186,   189,   192,   196,   199,   201,   205,   208,   209,
390      212,   215,   218,   222,   226,   228,   232,   235,   238,   241,
391      242,   245,   248,   253,   257,   261,   262,   265,   267,   269,
392      272,   275,   278,   280,   282,   283,   286,   288,   292,   296,
393      300,   303,   307,   311,   313
394 };
395
396 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
397 static const yysigned_char yyrhs[] =
398 {
399       43,     0,    -1,    -1,    43,    44,    -1,    45,    -1,    55,
400       -1,    66,    -1,     3,    77,    79,    -1,     5,    -1,    15,
401       -1,     8,    -1,     1,    79,    -1,    61,    -1,    71,    -1,
402       47,    -1,    49,    -1,    69,    -1,    79,    -1,    10,    28,
403       32,    -1,    46,    50,    -1,    11,    28,    32,    -1,    48,
404       50,    -1,    -1,    50,    51,    -1,    50,    75,    -1,    50,
405       73,    -1,    50,    32,    -1,    21,    76,    32,    -1,    22,
406       81,    80,    32,    -1,    23,    76,    32,    -1,    24,    81,
407       80,    32,    -1,    26,    76,    32,    -1,    27,    76,    32,
408       -1,    25,    76,    32,    -1,    19,    77,    80,    32,    -1,
409       20,    81,    80,    32,    -1,    36,    28,    80,    32,    -1,
410       37,    82,    82,    80,    32,    -1,     7,    32,    -1,    52,
411       56,    -1,    78,    -1,    53,    58,    54,    -1,    53,    58,
412       -1,    -1,    56,    57,    -1,    56,    75,    -1,    56,    73,
413       -1,    56,    32,    -1,    19,    77,    80,    32,    -1,    21,
414       76,    32,    -1,    23,    76,    32,    -1,    18,    32,    -1,
415       20,    28,    80,    32,    -1,    -1,    58,    45,    -1,    14,
416       81,    32,    -1,    78,    -1,    59,    62,    60,    -1,    59,
417       62,    -1,    -1,    62,    45,    -1,    62,    66,    -1,    62,
418       55,    -1,     4,    77,    32,    -1,    63,    74,    -1,    78,
419       -1,    64,    67,    65,    -1,    64,    67,    -1,    -1,    67,
420       45,    -1,    67,    66,    -1,    67,    55,    -1,    67,     1,
421       32,    -1,     6,    77,    32,    -1,    68,    -1,     9,    77,
422       32,    -1,    70,    74,    -1,    12,    32,    -1,    72,    13,
423       -1,    -1,    74,    75,    -1,    74,    32,    -1,    16,    35,
424       81,    32,    -1,    16,    81,    32,    -1,    17,    81,    32,
425       -1,    -1,    77,    80,    -1,    28,    -1,    29,    -1,     5,
426       79,    -1,     8,    79,    -1,    15,    79,    -1,    32,    -1,
427       31,    -1,    -1,    14,    81,    -1,    82,    -1,    82,    40,
428       82,    -1,    82,    30,    82,    -1,    34,    81,    33,    -1,
429       41,    81,    -1,    81,    38,    81,    -1,    81,    39,    81,
430       -1,    28,    -1,    29,    -1
431 };
432
433 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
434 static const unsigned short yyrline[] =
435 {
436        0,    94,    94,    95,    98,    99,   100,   101,   102,   103,
437      104,   105,   109,   110,   111,   112,   113,   114,   120,   128,
438      134,   142,   152,   154,   155,   156,   157,   160,   166,   173,
439      179,   186,   192,   198,   204,   210,   216,   222,   230,   239,
440      245,   254,   255,   261,   263,   264,   265,   266,   269,   275,
441      281,   287,   293,   299,   301,   306,   315,   324,   325,   331,
442      333,   334,   335,   340,   347,   353,   362,   363,   369,   371,
443      372,   373,   374,   377,   383,   390,   397,   404,   410,   417,
444      418,   419,   422,   427,   432,   440,   442,   447,   448,   451,
445      452,   453,   457,   457,   459,   460,   463,   464,   465,   466,
446      467,   468,   469,   472,   473
447 };
448 #endif
449
450 #if YYDEBUG || YYERROR_VERBOSE
451 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
452    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
453 static const char *const yytname[] =
454 {
455   "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU", 
456   "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", 
457   "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", 
458   "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE", 
459   "T_DEF_TRISTATE", "T_BOOLEAN", "T_DEF_BOOLEAN", "T_STRING", "T_INT", 
460   "T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_EOF", "T_EOL", 
461   "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_SELECT", "T_RANGE", "T_OR", 
462   "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block", 
463   "common_block", "config_entry_start", "config_stmt", 
464   "menuconfig_entry_start", "menuconfig_stmt", "config_option_list", 
465   "config_option", "choice", "choice_entry", "choice_end", "choice_stmt", 
466   "choice_option_list", "choice_option", "choice_block", "if", "if_end", 
467   "if_stmt", "if_block", "menu", "menu_entry", "menu_end", "menu_stmt", 
468   "menu_block", "source", "source_stmt", "comment", "comment_stmt", 
469   "help_start", "help", "depends_list", "depends", "prompt_stmt_opt", 
470   "prompt", "end", "nl_or_eof", "if_expr", "expr", "symbol", 0
471 };
472 #endif
473
474 # ifdef YYPRINT
475 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
476    token YYLEX-NUM.  */
477 static const unsigned short yytoknum[] =
478 {
479        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
480      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
481      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
482      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
483      295,   296
484 };
485 # endif
486
487 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
488 static const unsigned char yyr1[] =
489 {
490        0,    42,    43,    43,    44,    44,    44,    44,    44,    44,
491       44,    44,    45,    45,    45,    45,    45,    45,    46,    47,
492       48,    49,    50,    50,    50,    50,    50,    51,    51,    51,
493       51,    51,    51,    51,    51,    51,    51,    51,    52,    53,
494       54,    55,    55,    56,    56,    56,    56,    56,    57,    57,
495       57,    57,    57,    58,    58,    59,    60,    61,    61,    62,
496       62,    62,    62,    63,    64,    65,    66,    66,    67,    67,
497       67,    67,    67,    68,    69,    70,    71,    72,    73,    74,
498       74,    74,    75,    75,    75,    76,    76,    77,    77,    78,
499       78,    78,    79,    79,    80,    80,    81,    81,    81,    81,
500       81,    81,    81,    82,    82
501 };
502
503 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
504 static const unsigned char yyr2[] =
505 {
506        0,     2,     0,     2,     1,     1,     1,     3,     1,     1,
507        1,     2,     1,     1,     1,     1,     1,     1,     3,     2,
508        3,     2,     0,     2,     2,     2,     2,     3,     4,     3,
509        4,     3,     3,     3,     4,     4,     4,     5,     2,     2,
510        1,     3,     2,     0,     2,     2,     2,     2,     4,     3,
511        3,     2,     4,     0,     2,     3,     1,     3,     2,     0,
512        2,     2,     2,     3,     2,     1,     3,     2,     0,     2,
513        2,     2,     3,     3,     1,     3,     2,     2,     2,     0,
514        2,     2,     4,     3,     3,     0,     2,     1,     1,     2,
515        2,     2,     1,     1,     0,     2,     1,     3,     3,     3,
516        2,     3,     3,     1,     1
517 };
518
519 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
520    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
521    means the default is an error.  */
522 static const unsigned char yydefact[] =
523 {
524        2,     0,     1,     0,     0,     0,     8,     0,     0,    10,
525        0,     0,     0,     0,     9,    93,    92,     3,     4,    22,
526       14,    22,    15,    43,    53,     5,    59,    12,    79,    68,
527        6,    74,    16,    79,    13,    17,    11,    87,    88,     0,
528        0,     0,    38,     0,     0,     0,   103,   104,     0,     0,
529        0,    96,    19,    21,    39,    42,    58,    64,     0,    76,
530        7,    63,    73,    75,    18,    20,     0,   100,    55,     0,
531        0,     0,     0,     0,     0,     0,     0,     0,    85,     0,
532       85,     0,    85,    85,    85,    26,     0,     0,    23,     0,
533       25,    24,     0,     0,     0,    85,    85,    47,    44,    46,
534       45,     0,     0,     0,    54,    41,    40,    60,    62,    57,
535       61,    56,    81,    80,     0,    69,    71,    66,    70,    65,
536       99,   101,   102,    98,    97,    77,     0,     0,     0,    94,
537       94,     0,    94,    94,     0,    94,     0,     0,     0,    94,
538        0,    78,    51,    94,    94,     0,     0,    89,    90,    91,
539       72,     0,    83,    84,     0,     0,     0,    27,    86,     0,
540       29,     0,    33,    31,    32,     0,    94,     0,     0,    49,
541       50,    82,    95,    34,    35,    28,    30,    36,     0,    48,
542       52,    37
543 };
544
545 /* YYDEFGOTO[NTERM-NUM]. */
546 static const short yydefgoto[] =
547 {
548       -1,     1,    17,    18,    19,    20,    21,    22,    52,    88,
549       23,    24,   105,    25,    54,    98,    55,    26,   109,    27,
550       56,    28,    29,   117,    30,    58,    31,    32,    33,    34,
551       89,    90,    57,    91,   131,   132,   106,    35,   155,    50,
552       51
553 };
554
555 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
556    STATE-NUM.  */
557 #define YYPACT_NINF -99
558 static const short yypact[] =
559 {
560      -99,    48,   -99,    38,    46,    46,   -99,    46,   -29,   -99,
561       46,   -17,    -3,   -11,   -99,   -99,   -99,   -99,   -99,   -99,
562      -99,   -99,   -99,   -99,   -99,   -99,   -99,   -99,   -99,   -99,
563      -99,   -99,   -99,   -99,   -99,   -99,   -99,   -99,   -99,    38,
564       12,    15,   -99,    18,    51,    62,   -99,   -99,   -11,   -11,
565        4,   -24,   138,   138,   160,   121,   110,    -4,    81,    -4,
566      -99,   -99,   -99,   -99,   -99,   -99,   -19,   -99,   -99,   -11,
567      -11,    70,    70,    73,    32,   -11,    46,   -11,    46,   -11,
568       46,   -11,    46,    46,    46,   -99,    36,    70,   -99,    95,
569      -99,   -99,    96,    46,   106,    46,    46,   -99,   -99,   -99,
570      -99,    38,    38,    38,   -99,   -99,   -99,   -99,   -99,   -99,
571      -99,   -99,   -99,   -99,   112,   -99,   -99,   -99,   -99,   -99,
572      -99,   117,   -99,   -99,   -99,   -99,   -11,    33,    65,   131,
573        1,   119,   131,     1,   136,     1,   153,   154,   155,   131,
574       70,   -99,   -99,   131,   131,   156,   157,   -99,   -99,   -99,
575      -99,   101,   -99,   -99,   -11,   158,   159,   -99,   -99,   161,
576      -99,   162,   -99,   -99,   -99,   163,   131,   164,   165,   -99,
577      -99,   -99,    99,   -99,   -99,   -99,   -99,   -99,   166,   -99,
578      -99,   -99
579 };
580
581 /* YYPGOTO[NTERM-NUM].  */
582 static const short yypgoto[] =
583 {
584      -99,   -99,   -99,   111,   -99,   -99,   -99,   -99,   178,   -99,
585      -99,   -99,   -99,    91,   -99,   -99,   -99,   -99,   -99,   -99,
586      -99,   -99,   -99,   -99,   115,   -99,   -99,   -99,   -99,   -99,
587      -99,   146,   168,    89,    27,     0,   126,    -1,   -98,   -48,
588      -63
589 };
590
591 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
592    positive, shift that token.  If negative, reduce the rule which
593    number is the opposite.  If zero, do what YYDEFACT says.
594    If YYTABLE_NINF, syntax error.  */
595 #define YYTABLE_NINF -68
596 static const short yytable[] =
597 {
598       66,    67,    36,    42,    39,    40,    71,    41,   123,   124,
599       43,    44,    74,    75,   120,   154,    72,    46,    47,    69,
600       70,   121,   122,    48,   140,    45,   127,   128,   112,   130,
601       49,   133,   156,   135,   158,   159,    68,   161,    60,    69,
602       70,   165,    69,    70,    61,   167,   168,    62,     2,     3,
603       63,     4,     5,     6,     7,     8,     9,    10,    11,    12,
604       46,    47,    13,    14,   139,   152,    48,   126,   178,    15,
605       16,    69,    70,    49,    37,    38,   129,   166,   151,    15,
606       16,   -67,   114,    64,   -67,     5,   101,     7,     8,   102,
607       10,    11,    12,   143,    65,    13,   103,   153,    46,    47,
608      147,   148,   149,    69,    70,   125,   172,   134,   141,   136,
609      137,   138,    15,    16,     5,   101,     7,     8,   102,    10,
610       11,    12,   145,   146,    13,   103,   101,     7,   142,   102,
611       10,    11,    12,   171,   144,    13,   103,    69,    70,    69,
612       70,    15,    16,   100,   150,   154,   113,   108,   113,   116,
613       73,   157,    15,    16,    74,    75,    70,    76,    77,    78,
614       79,    80,    81,    82,    83,    84,   104,   107,   160,   115,
615       85,   110,    73,   118,    86,    87,    74,    75,    92,    93,
616       94,    95,   111,    96,   119,   162,   163,   164,   169,   170,
617      173,   174,    97,   175,   176,   177,   179,   180,   181,    53,
618       99,    59
619 };
620
621 static const unsigned char yycheck[] =
622 {
623       48,    49,     3,    32,     4,     5,    30,     7,    71,    72,
624       10,    28,    16,    17,    33,    14,    40,    28,    29,    38,
625       39,    69,    70,    34,    87,    28,    74,    75,    32,    77,
626       41,    79,   130,    81,   132,   133,    32,   135,    39,    38,
627       39,   139,    38,    39,    32,   143,   144,    32,     0,     1,
628       32,     3,     4,     5,     6,     7,     8,     9,    10,    11,
629       28,    29,    14,    15,    28,    32,    34,    35,   166,    31,
630       32,    38,    39,    41,    28,    29,    76,   140,   126,    31,
631       32,     0,     1,    32,     3,     4,     5,     6,     7,     8,
632        9,    10,    11,    93,    32,    14,    15,    32,    28,    29,
633      101,   102,   103,    38,    39,    32,   154,    80,    13,    82,
634       83,    84,    31,    32,     4,     5,     6,     7,     8,     9,
635       10,    11,    95,    96,    14,    15,     5,     6,    32,     8,
636        9,    10,    11,    32,    28,    14,    15,    38,    39,    38,
637       39,    31,    32,    54,    32,    14,    57,    56,    59,    58,
638       12,    32,    31,    32,    16,    17,    39,    19,    20,    21,
639       22,    23,    24,    25,    26,    27,    55,    56,    32,    58,
640       32,    56,    12,    58,    36,    37,    16,    17,    18,    19,
641       20,    21,    56,    23,    58,    32,    32,    32,    32,    32,
642       32,    32,    32,    32,    32,    32,    32,    32,    32,    21,
643       54,    33
644 };
645
646 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
647    symbol of state STATE-NUM.  */
648 static const unsigned char yystos[] =
649 {
650        0,    43,     0,     1,     3,     4,     5,     6,     7,     8,
651        9,    10,    11,    14,    15,    31,    32,    44,    45,    46,
652       47,    48,    49,    52,    53,    55,    59,    61,    63,    64,
653       66,    68,    69,    70,    71,    79,    79,    28,    29,    77,
654       77,    77,    32,    77,    28,    28,    28,    29,    34,    41,
655       81,    82,    50,    50,    56,    58,    62,    74,    67,    74,
656       79,    32,    32,    32,    32,    32,    81,    81,    32,    38,
657       39,    30,    40,    12,    16,    17,    19,    20,    21,    22,
658       23,    24,    25,    26,    27,    32,    36,    37,    51,    72,
659       73,    75,    18,    19,    20,    21,    23,    32,    57,    73,
660       75,     5,     8,    15,    45,    54,    78,    45,    55,    60,
661       66,    78,    32,    75,     1,    45,    55,    65,    66,    78,
662       33,    81,    81,    82,    82,    32,    35,    81,    81,    77,
663       81,    76,    77,    81,    76,    81,    76,    76,    76,    28,
664       82,    13,    32,    77,    28,    76,    76,    79,    79,    79,
665       32,    81,    32,    32,    14,    80,    80,    32,    80,    80,
666       32,    80,    32,    32,    32,    80,    82,    80,    80,    32,
667       32,    32,    81,    32,    32,    32,    32,    32,    80,    32,
668       32,    32
669 };
670
671 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
672 # define YYSIZE_T __SIZE_TYPE__
673 #endif
674 #if ! defined (YYSIZE_T) && defined (size_t)
675 # define YYSIZE_T size_t
676 #endif
677 #if ! defined (YYSIZE_T)
678 # if defined (__STDC__) || defined (__cplusplus)
679 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
680 #  define YYSIZE_T size_t
681 # endif
682 #endif
683 #if ! defined (YYSIZE_T)
684 # define YYSIZE_T unsigned int
685 #endif
686
687 #define yyerrok         (yyerrstatus = 0)
688 #define yyclearin       (yychar = YYEMPTY)
689 #define YYEMPTY         (-2)
690 #define YYEOF           0
691
692 #define YYACCEPT        goto yyacceptlab
693 #define YYABORT         goto yyabortlab
694 #define YYERROR         goto yyerrlab1
695
696
697 /* Like YYERROR except do call yyerror.  This remains here temporarily
698    to ease the transition to the new meaning of YYERROR, for GCC.
699    Once GCC version 2 has supplanted version 1, this can go.  */
700
701 #define YYFAIL          goto yyerrlab
702
703 #define YYRECOVERING()  (!!yyerrstatus)
704
705 #define YYBACKUP(Token, Value)                                  \
706 do                                                              \
707   if (yychar == YYEMPTY && yylen == 1)                          \
708     {                                                           \
709       yychar = (Token);                                         \
710       yylval = (Value);                                         \
711       yytoken = YYTRANSLATE (yychar);                           \
712       YYPOPSTACK;                                               \
713       goto yybackup;                                            \
714     }                                                           \
715   else                                                          \
716     {                                                           \
717       yyerror ("syntax error: cannot back up");\
718       YYERROR;                                                  \
719     }                                                           \
720 while (0)
721
722 #define YYTERROR        1
723 #define YYERRCODE       256
724
725 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
726    are run).  */
727
728 #ifndef YYLLOC_DEFAULT
729 # define YYLLOC_DEFAULT(Current, Rhs, N)         \
730   Current.first_line   = Rhs[1].first_line;      \
731   Current.first_column = Rhs[1].first_column;    \
732   Current.last_line    = Rhs[N].last_line;       \
733   Current.last_column  = Rhs[N].last_column;
734 #endif
735
736 /* YYLEX -- calling `yylex' with the right arguments.  */
737
738 #ifdef YYLEX_PARAM
739 # define YYLEX yylex (YYLEX_PARAM)
740 #else
741 # define YYLEX yylex ()
742 #endif
743
744 /* Enable debugging if requested.  */
745 #if YYDEBUG
746
747 # ifndef YYFPRINTF
748 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
749 #  define YYFPRINTF fprintf
750 # endif
751
752 # define YYDPRINTF(Args)                        \
753 do {                                            \
754   if (yydebug)                                  \
755     YYFPRINTF Args;                             \
756 } while (0)
757
758 # define YYDSYMPRINT(Args)                      \
759 do {                                            \
760   if (yydebug)                                  \
761     yysymprint Args;                            \
762 } while (0)
763
764 # define YYDSYMPRINTF(Title, Token, Value, Location)            \
765 do {                                                            \
766   if (yydebug)                                                  \
767     {                                                           \
768       YYFPRINTF (stderr, "%s ", Title);                         \
769       yysymprint (stderr,                                       \
770                   Token, Value);        \
771       YYFPRINTF (stderr, "\n");                                 \
772     }                                                           \
773 } while (0)
774
775 /*------------------------------------------------------------------.
776 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
777 | TOP (cinluded).                                                   |
778 `------------------------------------------------------------------*/
779
780 #if defined (__STDC__) || defined (__cplusplus)
781 static void
782 yy_stack_print (short *bottom, short *top)
783 #else
784 static void
785 yy_stack_print (bottom, top)
786     short *bottom;
787     short *top;
788 #endif
789 {
790   YYFPRINTF (stderr, "Stack now");
791   for (/* Nothing. */; bottom <= top; ++bottom)
792     YYFPRINTF (stderr, " %d", *bottom);
793   YYFPRINTF (stderr, "\n");
794 }
795
796 # define YY_STACK_PRINT(Bottom, Top)                            \
797 do {                                                            \
798   if (yydebug)                                                  \
799     yy_stack_print ((Bottom), (Top));                           \
800 } while (0)
801
802
803 /*------------------------------------------------.
804 | Report that the YYRULE is going to be reduced.  |
805 `------------------------------------------------*/
806
807 #if defined (__STDC__) || defined (__cplusplus)
808 static void
809 yy_reduce_print (int yyrule)
810 #else
811 static void
812 yy_reduce_print (yyrule)
813     int yyrule;
814 #endif
815 {
816   int yyi;
817   unsigned int yylineno = yyrline[yyrule];
818   YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
819              yyrule - 1, yylineno);
820   /* Print the symbols being reduced, and their result.  */
821   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
822     YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
823   YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
824 }
825
826 # define YY_REDUCE_PRINT(Rule)          \
827 do {                                    \
828   if (yydebug)                          \
829     yy_reduce_print (Rule);             \
830 } while (0)
831
832 /* Nonzero means print parse trace.  It is left uninitialized so that
833    multiple parsers can coexist.  */
834 int yydebug;
835 #else /* !YYDEBUG */
836 # define YYDPRINTF(Args)
837 # define YYDSYMPRINT(Args)
838 # define YYDSYMPRINTF(Title, Token, Value, Location)
839 # define YY_STACK_PRINT(Bottom, Top)
840 # define YY_REDUCE_PRINT(Rule)
841 #endif /* !YYDEBUG */
842
843
844 /* YYINITDEPTH -- initial size of the parser's stacks.  */
845 #ifndef YYINITDEPTH
846 # define YYINITDEPTH 200
847 #endif
848
849 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
850    if the built-in stack extension method is used).
851
852    Do not make this value too large; the results are undefined if
853    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
854    evaluated with infinite-precision integer arithmetic.  */
855
856 #if YYMAXDEPTH == 0
857 # undef YYMAXDEPTH
858 #endif
859
860 #ifndef YYMAXDEPTH
861 # define YYMAXDEPTH 10000
862 #endif
863
864 \f
865
866 #if YYERROR_VERBOSE
867
868 # ifndef yystrlen
869 #  if defined (__GLIBC__) && defined (_STRING_H)
870 #   define yystrlen strlen
871 #  else
872 /* Return the length of YYSTR.  */
873 static YYSIZE_T
874 #   if defined (__STDC__) || defined (__cplusplus)
875 yystrlen (const char *yystr)
876 #   else
877 yystrlen (yystr)
878      const char *yystr;
879 #   endif
880 {
881   register const char *yys = yystr;
882
883   while (*yys++ != '\0')
884     continue;
885
886   return yys - yystr - 1;
887 }
888 #  endif
889 # endif
890
891 # ifndef yystpcpy
892 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
893 #   define yystpcpy stpcpy
894 #  else
895 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
896    YYDEST.  */
897 static char *
898 #   if defined (__STDC__) || defined (__cplusplus)
899 yystpcpy (char *yydest, const char *yysrc)
900 #   else
901 yystpcpy (yydest, yysrc)
902      char *yydest;
903      const char *yysrc;
904 #   endif
905 {
906   register char *yyd = yydest;
907   register const char *yys = yysrc;
908
909   while ((*yyd++ = *yys++) != '\0')
910     continue;
911
912   return yyd - 1;
913 }
914 #  endif
915 # endif
916
917 #endif /* !YYERROR_VERBOSE */
918
919 \f
920
921 #if YYDEBUG
922 /*--------------------------------.
923 | Print this symbol on YYOUTPUT.  |
924 `--------------------------------*/
925
926 #if defined (__STDC__) || defined (__cplusplus)
927 static void
928 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
929 #else
930 static void
931 yysymprint (yyoutput, yytype, yyvaluep)
932     FILE *yyoutput;
933     int yytype;
934     YYSTYPE *yyvaluep;
935 #endif
936 {
937   /* Pacify ``unused variable'' warnings.  */
938   (void) yyvaluep;
939
940   if (yytype < YYNTOKENS)
941     {
942       YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
943 # ifdef YYPRINT
944       YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
945 # endif
946     }
947   else
948     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
949
950   switch (yytype)
951     {
952       default:
953         break;
954     }
955   YYFPRINTF (yyoutput, ")");
956 }
957
958 #endif /* ! YYDEBUG */
959 /*-----------------------------------------------.
960 | Release the memory associated to this symbol.  |
961 `-----------------------------------------------*/
962
963 #if defined (__STDC__) || defined (__cplusplus)
964 static void
965 yydestruct (int yytype, YYSTYPE *yyvaluep)
966 #else
967 static void
968 yydestruct (yytype, yyvaluep)
969     int yytype;
970     YYSTYPE *yyvaluep;
971 #endif
972 {
973   /* Pacify ``unused variable'' warnings.  */
974   (void) yyvaluep;
975
976   switch (yytype)
977     {
978
979       default:
980         break;
981     }
982 }
983 \f
984
985 /* Prevent warnings from -Wmissing-prototypes.  */
986
987 #ifdef YYPARSE_PARAM
988 # if defined (__STDC__) || defined (__cplusplus)
989 int yyparse (void *YYPARSE_PARAM);
990 # else
991 int yyparse ();
992 # endif
993 #else /* ! YYPARSE_PARAM */
994 #if defined (__STDC__) || defined (__cplusplus)
995 int yyparse (void);
996 #else
997 int yyparse ();
998 #endif
999 #endif /* ! YYPARSE_PARAM */
1000
1001
1002
1003 /* The lookahead symbol.  */
1004 int yychar;
1005
1006 /* The semantic value of the lookahead symbol.  */
1007 YYSTYPE yylval;
1008
1009 /* Number of syntax errors so far.  */
1010 int yynerrs;
1011
1012
1013
1014 /*----------.
1015 | yyparse.  |
1016 `----------*/
1017
1018 #ifdef YYPARSE_PARAM
1019 # if defined (__STDC__) || defined (__cplusplus)
1020 int yyparse (void *YYPARSE_PARAM)
1021 # else
1022 int yyparse (YYPARSE_PARAM)
1023   void *YYPARSE_PARAM;
1024 # endif
1025 #else /* ! YYPARSE_PARAM */
1026 #if defined (__STDC__) || defined (__cplusplus)
1027 int
1028 yyparse (void)
1029 #else
1030 int
1031 yyparse ()
1032
1033 #endif
1034 #endif
1035 {
1036   
1037   register int yystate;
1038   register int yyn;
1039   int yyresult;
1040   /* Number of tokens to shift before error messages enabled.  */
1041   int yyerrstatus;
1042   /* Lookahead token as an internal (translated) token number.  */
1043   int yytoken = 0;
1044
1045   /* Three stacks and their tools:
1046      `yyss': related to states,
1047      `yyvs': related to semantic values,
1048      `yyls': related to locations.
1049
1050      Refer to the stacks thru separate pointers, to allow yyoverflow
1051      to reallocate them elsewhere.  */
1052
1053   /* The state stack.  */
1054   short yyssa[YYINITDEPTH];
1055   short *yyss = yyssa;
1056   register short *yyssp;
1057
1058   /* The semantic value stack.  */
1059   YYSTYPE yyvsa[YYINITDEPTH];
1060   YYSTYPE *yyvs = yyvsa;
1061   register YYSTYPE *yyvsp;
1062
1063
1064
1065 #define YYPOPSTACK   (yyvsp--, yyssp--)
1066
1067   YYSIZE_T yystacksize = YYINITDEPTH;
1068
1069   /* The variables used to return semantic value and location from the
1070      action routines.  */
1071   YYSTYPE yyval;
1072
1073
1074   /* When reducing, the number of symbols on the RHS of the reduced
1075      rule.  */
1076   int yylen;
1077
1078   YYDPRINTF ((stderr, "Starting parse\n"));
1079
1080   yystate = 0;
1081   yyerrstatus = 0;
1082   yynerrs = 0;
1083   yychar = YYEMPTY;             /* Cause a token to be read.  */
1084
1085   /* Initialize stack pointers.
1086      Waste one element of value and location stack
1087      so that they stay on the same level as the state stack.
1088      The wasted elements are never initialized.  */
1089
1090   yyssp = yyss;
1091   yyvsp = yyvs;
1092
1093   goto yysetstate;
1094
1095 /*------------------------------------------------------------.
1096 | yynewstate -- Push a new state, which is found in yystate.  |
1097 `------------------------------------------------------------*/
1098  yynewstate:
1099   /* In all cases, when you get here, the value and location stacks
1100      have just been pushed. so pushing a state here evens the stacks.
1101      */
1102   yyssp++;
1103
1104  yysetstate:
1105   *yyssp = yystate;
1106
1107   if (yyss + yystacksize - 1 <= yyssp)
1108     {
1109       /* Get the current used size of the three stacks, in elements.  */
1110       YYSIZE_T yysize = yyssp - yyss + 1;
1111
1112 #ifdef yyoverflow
1113       {
1114         /* Give user a chance to reallocate the stack. Use copies of
1115            these so that the &'s don't force the real ones into
1116            memory.  */
1117         YYSTYPE *yyvs1 = yyvs;
1118         short *yyss1 = yyss;
1119
1120
1121         /* Each stack pointer address is followed by the size of the
1122            data in use in that stack, in bytes.  This used to be a
1123            conditional around just the two extra args, but that might
1124            be undefined if yyoverflow is a macro.  */
1125         yyoverflow ("parser stack overflow",
1126                     &yyss1, yysize * sizeof (*yyssp),
1127                     &yyvs1, yysize * sizeof (*yyvsp),
1128
1129                     &yystacksize);
1130
1131         yyss = yyss1;
1132         yyvs = yyvs1;
1133       }
1134 #else /* no yyoverflow */
1135 # ifndef YYSTACK_RELOCATE
1136       goto yyoverflowlab;
1137 # else
1138       /* Extend the stack our own way.  */
1139       if (YYMAXDEPTH <= yystacksize)
1140         goto yyoverflowlab;
1141       yystacksize *= 2;
1142       if (YYMAXDEPTH < yystacksize)
1143         yystacksize = YYMAXDEPTH;
1144
1145       {
1146         short *yyss1 = yyss;
1147         union yyalloc *yyptr =
1148           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1149         if (! yyptr)
1150           goto yyoverflowlab;
1151         YYSTACK_RELOCATE (yyss);
1152         YYSTACK_RELOCATE (yyvs);
1153
1154 #  undef YYSTACK_RELOCATE
1155         if (yyss1 != yyssa)
1156           YYSTACK_FREE (yyss1);
1157       }
1158 # endif
1159 #endif /* no yyoverflow */
1160
1161       yyssp = yyss + yysize - 1;
1162       yyvsp = yyvs + yysize - 1;
1163
1164
1165       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1166                   (unsigned long int) yystacksize));
1167
1168       if (yyss + yystacksize - 1 <= yyssp)
1169         YYABORT;
1170     }
1171
1172   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1173
1174   goto yybackup;
1175
1176 /*-----------.
1177 | yybackup.  |
1178 `-----------*/
1179 yybackup:
1180
1181 /* Do appropriate processing given the current state.  */
1182 /* Read a lookahead token if we need one and don't already have one.  */
1183 /* yyresume: */
1184
1185   /* First try to decide what to do without reference to lookahead token.  */
1186
1187   yyn = yypact[yystate];
1188   if (yyn == YYPACT_NINF)
1189     goto yydefault;
1190
1191   /* Not known => get a lookahead token if don't already have one.  */
1192
1193   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1194   if (yychar == YYEMPTY)
1195     {
1196       YYDPRINTF ((stderr, "Reading a token: "));
1197       yychar = YYLEX;
1198     }
1199
1200   if (yychar <= YYEOF)
1201     {
1202       yychar = yytoken = YYEOF;
1203       YYDPRINTF ((stderr, "Now at end of input.\n"));
1204     }
1205   else
1206     {
1207       yytoken = YYTRANSLATE (yychar);
1208       YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1209     }
1210
1211   /* If the proper action on seeing token YYTOKEN is to reduce or to
1212      detect an error, take that action.  */
1213   yyn += yytoken;
1214   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1215     goto yydefault;
1216   yyn = yytable[yyn];
1217   if (yyn <= 0)
1218     {
1219       if (yyn == 0 || yyn == YYTABLE_NINF)
1220         goto yyerrlab;
1221       yyn = -yyn;
1222       goto yyreduce;
1223     }
1224
1225   if (yyn == YYFINAL)
1226     YYACCEPT;
1227
1228   /* Shift the lookahead token.  */
1229   YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1230
1231   /* Discard the token being shifted unless it is eof.  */
1232   if (yychar != YYEOF)
1233     yychar = YYEMPTY;
1234
1235   *++yyvsp = yylval;
1236
1237
1238   /* Count tokens shifted since error; after three, turn off error
1239      status.  */
1240   if (yyerrstatus)
1241     yyerrstatus--;
1242
1243   yystate = yyn;
1244   goto yynewstate;
1245
1246
1247 /*-----------------------------------------------------------.
1248 | yydefault -- do the default action for the current state.  |
1249 `-----------------------------------------------------------*/
1250 yydefault:
1251   yyn = yydefact[yystate];
1252   if (yyn == 0)
1253     goto yyerrlab;
1254   goto yyreduce;
1255
1256
1257 /*-----------------------------.
1258 | yyreduce -- Do a reduction.  |
1259 `-----------------------------*/
1260 yyreduce:
1261   /* yyn is the number of a rule to reduce with.  */
1262   yylen = yyr2[yyn];
1263
1264   /* If YYLEN is nonzero, implement the default value of the action:
1265      `$$ = $1'.
1266
1267      Otherwise, the following line sets YYVAL to garbage.
1268      This behavior is undocumented and Bison
1269      users should not rely upon it.  Assigning to YYVAL
1270      unconditionally makes the parser a bit smaller, and it avoids a
1271      GCC warning that YYVAL may be used uninitialized.  */
1272   yyval = yyvsp[1-yylen];
1273
1274
1275   YY_REDUCE_PRINT (yyn);
1276   switch (yyn)
1277     {
1278         case 8:
1279
1280     { zconfprint("unexpected 'endmenu' statement"); ;}
1281     break;
1282
1283   case 9:
1284
1285     { zconfprint("unexpected 'endif' statement"); ;}
1286     break;
1287
1288   case 10:
1289
1290     { zconfprint("unexpected 'endchoice' statement"); ;}
1291     break;
1292
1293   case 11:
1294
1295     { zconfprint("syntax error"); yyerrok; ;}
1296     break;
1297
1298   case 18:
1299
1300     {
1301         struct symbol *sym = sym_lookup(yyvsp[-1].string, 0);
1302         sym->flags |= SYMBOL_OPTIONAL;
1303         menu_add_entry(sym);
1304         printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
1305 ;}
1306     break;
1307
1308   case 19:
1309
1310     {
1311         menu_end_entry();
1312         printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1313 ;}
1314     break;
1315
1316   case 20:
1317
1318     {
1319         struct symbol *sym = sym_lookup(yyvsp[-1].string, 0);
1320         sym->flags |= SYMBOL_OPTIONAL;
1321         menu_add_entry(sym);
1322         printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
1323 ;}
1324     break;
1325
1326   case 21:
1327
1328     {
1329         if (current_entry->prompt)
1330                 current_entry->prompt->type = P_MENU;
1331         else
1332                 zconfprint("warning: menuconfig statement without prompt");
1333         menu_end_entry();
1334         printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1335 ;}
1336     break;
1337
1338   case 27:
1339
1340     {
1341         menu_set_type(S_TRISTATE);
1342         printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
1343 ;}
1344     break;
1345
1346   case 28:
1347
1348     {
1349         menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
1350         menu_set_type(S_TRISTATE);
1351         printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
1352 ;}
1353     break;
1354
1355   case 29:
1356
1357     {
1358         menu_set_type(S_BOOLEAN);
1359         printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
1360 ;}
1361     break;
1362
1363   case 30:
1364
1365     {
1366         menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
1367         menu_set_type(S_BOOLEAN);
1368         printd(DEBUG_PARSE, "%s:%d:def_boolean\n", zconf_curname(), zconf_lineno());
1369 ;}
1370     break;
1371
1372   case 31:
1373
1374     {
1375         menu_set_type(S_INT);
1376         printd(DEBUG_PARSE, "%s:%d:int\n", zconf_curname(), zconf_lineno());
1377 ;}
1378     break;
1379
1380   case 32:
1381
1382     {
1383         menu_set_type(S_HEX);
1384         printd(DEBUG_PARSE, "%s:%d:hex\n", zconf_curname(), zconf_lineno());
1385 ;}
1386     break;
1387
1388   case 33:
1389
1390     {
1391         menu_set_type(S_STRING);
1392         printd(DEBUG_PARSE, "%s:%d:string\n", zconf_curname(), zconf_lineno());
1393 ;}
1394     break;
1395
1396   case 34:
1397
1398     {
1399         menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr);
1400         printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1401 ;}
1402     break;
1403
1404   case 35:
1405
1406     {
1407         menu_add_expr(P_DEFAULT, yyvsp[-2].expr, yyvsp[-1].expr);
1408         printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
1409 ;}
1410     break;
1411
1412   case 36:
1413
1414     {
1415         menu_add_symbol(P_SELECT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr);
1416         printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1417 ;}
1418     break;
1419
1420   case 37:
1421
1422     {
1423         menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,yyvsp[-3].symbol, yyvsp[-2].symbol), yyvsp[-1].expr);
1424         printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1425 ;}
1426     break;
1427
1428   case 38:
1429
1430     {
1431         struct symbol *sym = sym_lookup(NULL, 0);
1432         sym->flags |= SYMBOL_CHOICE;
1433         menu_add_entry(sym);
1434         menu_add_expr(P_CHOICE, NULL, NULL);
1435         printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1436 ;}
1437     break;
1438
1439   case 39:
1440
1441     {
1442         menu_end_entry();
1443         menu_add_menu();
1444 ;}
1445     break;
1446
1447   case 40:
1448
1449     {
1450         if (zconf_endtoken(yyvsp[0].token, T_CHOICE, T_ENDCHOICE)) {
1451                 menu_end_menu();
1452                 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
1453         }
1454 ;}
1455     break;
1456
1457   case 42:
1458
1459     {
1460         printf("%s:%d: missing 'endchoice' for this 'choice' statement\n", current_menu->file->name, current_menu->lineno);
1461         zconfnerrs++;
1462 ;}
1463     break;
1464
1465   case 48:
1466
1467     {
1468         menu_add_prompt(P_PROMPT, yyvsp[-2].string, yyvsp[-1].expr);
1469         printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1470 ;}
1471     break;
1472
1473   case 49:
1474
1475     {
1476         menu_set_type(S_TRISTATE);
1477         printd(DEBUG_PARSE, "%s:%d:tristate\n", zconf_curname(), zconf_lineno());
1478 ;}
1479     break;
1480
1481   case 50:
1482
1483     {
1484         menu_set_type(S_BOOLEAN);
1485         printd(DEBUG_PARSE, "%s:%d:boolean\n", zconf_curname(), zconf_lineno());
1486 ;}
1487     break;
1488
1489   case 51:
1490
1491     {
1492         current_entry->sym->flags |= SYMBOL_OPTIONAL;
1493         printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1494 ;}
1495     break;
1496
1497   case 52:
1498
1499     {
1500         menu_add_symbol(P_DEFAULT, sym_lookup(yyvsp[-2].string, 0), yyvsp[-1].expr);
1501         printd(DEBUG_PARSE, "%s:%d:default\n", zconf_curname(), zconf_lineno());
1502 ;}
1503     break;
1504
1505   case 55:
1506
1507     {
1508         printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
1509         menu_add_entry(NULL);
1510         menu_add_dep(yyvsp[-1].expr);
1511         menu_end_entry();
1512         menu_add_menu();
1513 ;}
1514     break;
1515
1516   case 56:
1517
1518     {
1519         if (zconf_endtoken(yyvsp[0].token, T_IF, T_ENDIF)) {
1520                 menu_end_menu();
1521                 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
1522         }
1523 ;}
1524     break;
1525
1526   case 58:
1527
1528     {
1529         printf("%s:%d: missing 'endif' for this 'if' statement\n", current_menu->file->name, current_menu->lineno);
1530         zconfnerrs++;
1531 ;}
1532     break;
1533
1534   case 63:
1535
1536     {
1537         menu_add_entry(NULL);
1538         menu_add_prop(P_MENU, yyvsp[-1].string, NULL, NULL);
1539         printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1540 ;}
1541     break;
1542
1543   case 64:
1544
1545     {
1546         menu_end_entry();
1547         menu_add_menu();
1548 ;}
1549     break;
1550
1551   case 65:
1552
1553     {
1554         if (zconf_endtoken(yyvsp[0].token, T_MENU, T_ENDMENU)) {
1555                 menu_end_menu();
1556                 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
1557         }
1558 ;}
1559     break;
1560
1561   case 67:
1562
1563     {
1564         printf("%s:%d: missing 'endmenu' for this 'menu' statement\n", current_menu->file->name, current_menu->lineno);
1565         zconfnerrs++;
1566 ;}
1567     break;
1568
1569   case 72:
1570
1571     { zconfprint("invalid menu option"); yyerrok; ;}
1572     break;
1573
1574   case 73:
1575
1576     {
1577         yyval.string = yyvsp[-1].string;
1578         printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), yyvsp[-1].string);
1579 ;}
1580     break;
1581
1582   case 74:
1583
1584     {
1585         zconf_nextfile(yyvsp[0].string);
1586 ;}
1587     break;
1588
1589   case 75:
1590
1591     {
1592         menu_add_entry(NULL);
1593         menu_add_prop(P_COMMENT, yyvsp[-1].string, NULL, NULL);
1594         printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1595 ;}
1596     break;
1597
1598   case 76:
1599
1600     {
1601         menu_end_entry();
1602 ;}
1603     break;
1604
1605   case 77:
1606
1607     {
1608         printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
1609         zconf_starthelp();
1610 ;}
1611     break;
1612
1613   case 78:
1614
1615     {
1616         current_entry->sym->help = yyvsp[0].string;
1617 ;}
1618     break;
1619
1620   case 82:
1621
1622     {
1623         menu_add_dep(yyvsp[-1].expr);
1624         printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
1625 ;}
1626     break;
1627
1628   case 83:
1629
1630     {
1631         menu_add_dep(yyvsp[-1].expr);
1632         printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno());
1633 ;}
1634     break;
1635
1636   case 84:
1637
1638     {
1639         menu_add_dep(yyvsp[-1].expr);
1640         printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno());
1641 ;}
1642     break;
1643
1644   case 86:
1645
1646     {
1647         menu_add_prop(P_PROMPT, yyvsp[-1].string, NULL, yyvsp[0].expr);
1648 ;}
1649     break;
1650
1651   case 89:
1652
1653     { yyval.token = T_ENDMENU; ;}
1654     break;
1655
1656   case 90:
1657
1658     { yyval.token = T_ENDCHOICE; ;}
1659     break;
1660
1661   case 91:
1662
1663     { yyval.token = T_ENDIF; ;}
1664     break;
1665
1666   case 94:
1667
1668     { yyval.expr = NULL; ;}
1669     break;
1670
1671   case 95:
1672
1673     { yyval.expr = yyvsp[0].expr; ;}
1674     break;
1675
1676   case 96:
1677
1678     { yyval.expr = expr_alloc_symbol(yyvsp[0].symbol); ;}
1679     break;
1680
1681   case 97:
1682
1683     { yyval.expr = expr_alloc_comp(E_EQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;}
1684     break;
1685
1686   case 98:
1687
1688     { yyval.expr = expr_alloc_comp(E_UNEQUAL, yyvsp[-2].symbol, yyvsp[0].symbol); ;}
1689     break;
1690
1691   case 99:
1692
1693     { yyval.expr = yyvsp[-1].expr; ;}
1694     break;
1695
1696   case 100:
1697
1698     { yyval.expr = expr_alloc_one(E_NOT, yyvsp[0].expr); ;}
1699     break;
1700
1701   case 101:
1702
1703     { yyval.expr = expr_alloc_two(E_OR, yyvsp[-2].expr, yyvsp[0].expr); ;}
1704     break;
1705
1706   case 102:
1707
1708     { yyval.expr = expr_alloc_two(E_AND, yyvsp[-2].expr, yyvsp[0].expr); ;}
1709     break;
1710
1711   case 103:
1712
1713     { yyval.symbol = sym_lookup(yyvsp[0].string, 0); free(yyvsp[0].string); ;}
1714     break;
1715
1716   case 104:
1717
1718     { yyval.symbol = sym_lookup(yyvsp[0].string, 1); free(yyvsp[0].string); ;}
1719     break;
1720
1721
1722     }
1723
1724 /* Line 999 of yacc.c.  */
1725
1726 \f
1727   yyvsp -= yylen;
1728   yyssp -= yylen;
1729
1730
1731   YY_STACK_PRINT (yyss, yyssp);
1732
1733   *++yyvsp = yyval;
1734
1735
1736   /* Now `shift' the result of the reduction.  Determine what state
1737      that goes to, based on the state we popped back to and the rule
1738      number reduced by.  */
1739
1740   yyn = yyr1[yyn];
1741
1742   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1743   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1744     yystate = yytable[yystate];
1745   else
1746     yystate = yydefgoto[yyn - YYNTOKENS];
1747
1748   goto yynewstate;
1749
1750
1751 /*------------------------------------.
1752 | yyerrlab -- here on detecting error |
1753 `------------------------------------*/
1754 yyerrlab:
1755   /* If not already recovering from an error, report this error.  */
1756   if (!yyerrstatus)
1757     {
1758       ++yynerrs;
1759 #if YYERROR_VERBOSE
1760       yyn = yypact[yystate];
1761
1762       if (YYPACT_NINF < yyn && yyn < YYLAST)
1763         {
1764           YYSIZE_T yysize = 0;
1765           int yytype = YYTRANSLATE (yychar);
1766           char *yymsg;
1767           int yyx, yycount;
1768
1769           yycount = 0;
1770           /* Start YYX at -YYN if negative to avoid negative indexes in
1771              YYCHECK.  */
1772           for (yyx = yyn < 0 ? -yyn : 0;
1773                yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1774             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1775               yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1776           yysize += yystrlen ("syntax error, unexpected ") + 1;
1777           yysize += yystrlen (yytname[yytype]);
1778           yymsg = (char *) YYSTACK_ALLOC (yysize);
1779           if (yymsg != 0)
1780             {
1781               char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1782               yyp = yystpcpy (yyp, yytname[yytype]);
1783
1784               if (yycount < 5)
1785                 {
1786                   yycount = 0;
1787                   for (yyx = yyn < 0 ? -yyn : 0;
1788                        yyx < (int) (sizeof (yytname) / sizeof (char *));
1789                        yyx++)
1790                     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1791                       {
1792                         const char *yyq = ! yycount ? ", expecting " : " or ";
1793                         yyp = yystpcpy (yyp, yyq);
1794                         yyp = yystpcpy (yyp, yytname[yyx]);
1795                         yycount++;
1796                       }
1797                 }
1798               yyerror (yymsg);
1799               YYSTACK_FREE (yymsg);
1800             }
1801           else
1802             yyerror ("syntax error; also virtual memory exhausted");
1803         }
1804       else
1805 #endif /* YYERROR_VERBOSE */
1806         yyerror ("syntax error");
1807     }
1808
1809
1810
1811   if (yyerrstatus == 3)
1812     {
1813       /* If just tried and failed to reuse lookahead token after an
1814          error, discard it.  */
1815
1816       /* Return failure if at end of input.  */
1817       if (yychar == YYEOF)
1818         {
1819           /* Pop the error token.  */
1820           YYPOPSTACK;
1821           /* Pop the rest of the stack.  */
1822           while (yyss < yyssp)
1823             {
1824               YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1825               yydestruct (yystos[*yyssp], yyvsp);
1826               YYPOPSTACK;
1827             }
1828           YYABORT;
1829         }
1830
1831       YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1832       yydestruct (yytoken, &yylval);
1833       yychar = YYEMPTY;
1834
1835     }
1836
1837   /* Else will try to reuse lookahead token after shifting the error
1838      token.  */
1839   goto yyerrlab1;
1840
1841
1842 /*----------------------------------------------------.
1843 | yyerrlab1 -- error raised explicitly by an action.  |
1844 `----------------------------------------------------*/
1845 yyerrlab1:
1846   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1847
1848   for (;;)
1849     {
1850       yyn = yypact[yystate];
1851       if (yyn != YYPACT_NINF)
1852         {
1853           yyn += YYTERROR;
1854           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1855             {
1856               yyn = yytable[yyn];
1857               if (0 < yyn)
1858                 break;
1859             }
1860         }
1861
1862       /* Pop the current state because it cannot handle the error token.  */
1863       if (yyssp == yyss)
1864         YYABORT;
1865
1866       YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1867       yydestruct (yystos[yystate], yyvsp);
1868       yyvsp--;
1869       yystate = *--yyssp;
1870
1871       YY_STACK_PRINT (yyss, yyssp);
1872     }
1873
1874   if (yyn == YYFINAL)
1875     YYACCEPT;
1876
1877   YYDPRINTF ((stderr, "Shifting error token, "));
1878
1879   *++yyvsp = yylval;
1880
1881
1882   yystate = yyn;
1883   goto yynewstate;
1884
1885
1886 /*-------------------------------------.
1887 | yyacceptlab -- YYACCEPT comes here.  |
1888 `-------------------------------------*/
1889 yyacceptlab:
1890   yyresult = 0;
1891   goto yyreturn;
1892
1893 /*-----------------------------------.
1894 | yyabortlab -- YYABORT comes here.  |
1895 `-----------------------------------*/
1896 yyabortlab:
1897   yyresult = 1;
1898   goto yyreturn;
1899
1900 #ifndef yyoverflow
1901 /*----------------------------------------------.
1902 | yyoverflowlab -- parser overflow comes here.  |
1903 `----------------------------------------------*/
1904 yyoverflowlab:
1905   yyerror ("parser stack overflow");
1906   yyresult = 2;
1907   /* Fall through.  */
1908 #endif
1909
1910 yyreturn:
1911 #ifndef yyoverflow
1912   if (yyss != yyssa)
1913     YYSTACK_FREE (yyss);
1914 #endif
1915   return yyresult;
1916 }
1917
1918
1919
1920
1921
1922 void conf_parse(const char *name)
1923 {
1924         struct symbol *sym;
1925         int i;
1926
1927         zconf_initscan(name);
1928
1929         sym_init();
1930         menu_init();
1931         modules_sym = sym_lookup("MODULES", 0);
1932         rootmenu.prompt = menu_add_prop(P_MENU, "Linux Kernel Configuration", NULL, NULL);
1933
1934         //zconfdebug = 1;
1935         zconfparse();
1936         if (zconfnerrs)
1937                 exit(1);
1938         menu_finalize(&rootmenu);
1939         for_all_symbols(i, sym) {
1940                 if (!(sym->flags & SYMBOL_CHECKED) && sym_check_deps(sym))
1941                         printf("\n");
1942                 else
1943                         sym->flags |= SYMBOL_CHECK_DONE;
1944         }
1945
1946         sym_change_count = 1;
1947 }
1948
1949 const char *zconf_tokenname(int token)
1950 {
1951         switch (token) {
1952         case T_MENU:            return "menu";
1953         case T_ENDMENU:         return "endmenu";
1954         case T_CHOICE:          return "choice";
1955         case T_ENDCHOICE:       return "endchoice";
1956         case T_IF:              return "if";
1957         case T_ENDIF:           return "endif";
1958         }
1959         return "<token>";
1960 }
1961
1962 static bool zconf_endtoken(int token, int starttoken, int endtoken)
1963 {
1964         if (token != endtoken) {
1965                 zconfprint("unexpected '%s' within %s block", zconf_tokenname(token), zconf_tokenname(starttoken));
1966                 zconfnerrs++;
1967                 return false;
1968         }
1969         if (current_menu->file != current_file) {
1970                 zconfprint("'%s' in different file than '%s'", zconf_tokenname(token), zconf_tokenname(starttoken));
1971                 zconfprint("location of the '%s'", zconf_tokenname(starttoken));
1972                 zconfnerrs++;
1973                 return false;
1974         }
1975         return true;
1976 }
1977
1978 static void zconfprint(const char *err, ...)
1979 {
1980         va_list ap;
1981
1982         fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno() + 1);
1983         va_start(ap, err);
1984         vfprintf(stderr, err, ap);
1985         va_end(ap);
1986         fprintf(stderr, "\n");
1987 }
1988
1989 static void zconferror(const char *err)
1990 {
1991         fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
1992 }
1993
1994 void print_quoted_string(FILE *out, const char *str)
1995 {
1996         const char *p;
1997         int len;
1998
1999         putc('"', out);
2000         while ((p = strchr(str, '"'))) {
2001                 len = p - str;
2002                 if (len)
2003                         fprintf(out, "%.*s", len, str);
2004                 fputs("\\\"", out);
2005                 str = p + 1;
2006         }
2007         fputs(str, out);
2008         putc('"', out);
2009 }
2010
2011 void print_symbol(FILE *out, struct menu *menu)
2012 {
2013         struct symbol *sym = menu->sym;
2014         struct property *prop;
2015
2016         if (sym_is_choice(sym))
2017                 fprintf(out, "choice\n");
2018         else
2019                 fprintf(out, "config %s\n", sym->name);
2020         switch (sym->type) {
2021         case S_BOOLEAN:
2022                 fputs("  boolean\n", out);
2023                 break;
2024         case S_TRISTATE:
2025                 fputs("  tristate\n", out);
2026                 break;
2027         case S_STRING:
2028                 fputs("  string\n", out);
2029                 break;
2030         case S_INT:
2031                 fputs("  integer\n", out);
2032                 break;
2033         case S_HEX:
2034                 fputs("  hex\n", out);
2035                 break;
2036         default:
2037                 fputs("  ???\n", out);
2038                 break;
2039         }
2040         for (prop = sym->prop; prop; prop = prop->next) {
2041                 if (prop->menu != menu)
2042                         continue;
2043                 switch (prop->type) {
2044                 case P_PROMPT:
2045                         fputs("  prompt ", out);
2046                         print_quoted_string(out, prop->text);
2047                         if (!expr_is_yes(prop->visible.expr)) {
2048                                 fputs(" if ", out);
2049                                 expr_fprint(prop->visible.expr, out);
2050                         }
2051                         fputc('\n', out);
2052                         break;
2053                 case P_DEFAULT:
2054                         fputs( "  default ", out);
2055                         expr_fprint(prop->expr, out);
2056                         if (!expr_is_yes(prop->visible.expr)) {
2057                                 fputs(" if ", out);
2058                                 expr_fprint(prop->visible.expr, out);
2059                         }
2060                         fputc('\n', out);
2061                         break;
2062                 case P_CHOICE:
2063                         fputs("  #choice value\n", out);
2064                         break;
2065                 default:
2066                         fprintf(out, "  unknown prop %d!\n", prop->type);
2067                         break;
2068                 }
2069         }
2070         if (sym->help) {
2071                 int len = strlen(sym->help);
2072                 while (sym->help[--len] == '\n')
2073                         sym->help[len] = 0;
2074                 fprintf(out, "  help\n%s\n", sym->help);
2075         }
2076         fputc('\n', out);
2077 }
2078
2079 void zconfdump(FILE *out)
2080 {
2081         struct property *prop;
2082         struct symbol *sym;
2083         struct menu *menu;
2084
2085         menu = rootmenu.list;
2086         while (menu) {
2087                 if ((sym = menu->sym))
2088                         print_symbol(out, menu);
2089                 else if ((prop = menu->prompt)) {
2090                         switch (prop->type) {
2091                         case P_COMMENT:
2092                                 fputs("\ncomment ", out);
2093                                 print_quoted_string(out, prop->text);
2094                                 fputs("\n", out);
2095                                 break;
2096                         case P_MENU:
2097                                 fputs("\nmenu ", out);
2098                                 print_quoted_string(out, prop->text);
2099                                 fputs("\n", out);
2100                                 break;
2101                         default:
2102                                 ;
2103                         }
2104                         if (!expr_is_yes(prop->visible.expr)) {
2105                                 fputs("  depends ", out);
2106                                 expr_fprint(prop->visible.expr, out);
2107                                 fputc('\n', out);
2108                         }
2109                         fputs("\n", out);
2110                 }
2111
2112                 if (menu->list)
2113                         menu = menu->list;
2114                 else if (menu->next)
2115                         menu = menu->next;
2116                 else while ((menu = menu->parent)) {
2117                         if (menu->prompt && menu->prompt->type == P_MENU)
2118                                 fputs("\nendmenu\n", out);
2119                         if (menu->next) {
2120                                 menu = menu->next;
2121                                 break;
2122                         }
2123                 }
2124         }
2125 }
2126
2127 #include "lex.zconf.c"
2128 #include "confdata.c"
2129 #include "expr.c"
2130 #include "symbol.c"
2131 #include "menu.c"
2132
2133