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