blob: c42b439c5cc0e5f05e9d5c3f5d69605e536893f1 [file] [log] [blame]
Josh Triplett1456edb2009-10-15 11:03:20 -07001
2/* A Bison parser, made by GNU Bison 2.4.1. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003
Sam Ravnborg14f31562007-09-26 20:15:39 +02004/* Skeleton implementation for Bison's Yacc-like parsers in C
Josh Triplett1456edb2009-10-15 11:03:20 -07005
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Sam Ravnborg14f31562007-09-26 20:15:39 +02007 Free Software Foundation, Inc.
Josh Triplett1456edb2009-10-15 11:03:20 -07008
9 This program is free software: you can redistribute it and/or modify
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 it under the terms of the GNU General Public License as published by
Josh Triplett1456edb2009-10-15 11:03:20 -070011 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
Linus Torvalds1da177e2005-04-16 15:20:36 -070014 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
Josh Triplett1456edb2009-10-15 11:03:20 -070018
Linus Torvalds1da177e2005-04-16 15:20:36 -070019 You should have received a copy of the GNU General Public License
Josh Triplett1456edb2009-10-15 11:03:20 -070020 along with this program. If not, see <http://www.gnu.org/licenses/>. */
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
Sam Ravnborg14f31562007-09-26 20:15:39 +020022/* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
Josh Triplett1456edb2009-10-15 11:03:20 -070031
Sam Ravnborg14f31562007-09-26 20:15:39 +020032 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
34
35/* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
38/* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
44
45/* Identify Bison output. */
46#define YYBISON 1
47
Roman Zippelf6a88aa2006-06-08 22:12:44 -070048/* Bison version. */
Josh Triplett1456edb2009-10-15 11:03:20 -070049#define YYBISON_VERSION "2.4.1"
Roman Zippelf6a88aa2006-06-08 22:12:44 -070050
Linus Torvalds1da177e2005-04-16 15:20:36 -070051/* Skeleton name. */
52#define YYSKELETON_NAME "yacc.c"
53
54/* Pure parsers. */
55#define YYPURE 0
56
Josh Triplett1456edb2009-10-15 11:03:20 -070057/* Push parsers. */
58#define YYPUSH 0
59
60/* Pull parsers. */
61#define YYPULL 1
62
Linus Torvalds1da177e2005-04-16 15:20:36 -070063/* Using locations. */
64#define YYLSP_NEEDED 0
65
Roman Zippel7a884882005-11-08 21:34:51 -080066/* Substitute the variable and function names. */
Josh Triplett1456edb2009-10-15 11:03:20 -070067#define yyparse zconfparse
68#define yylex zconflex
69#define yyerror zconferror
70#define yylval zconflval
71#define yychar zconfchar
72#define yydebug zconfdebug
73#define yynerrs zconfnerrs
74
75
76/* Copy the first part of user declarations. */
77
78
79/*
80 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
81 * Released under the terms of the GNU GPL v2.0.
82 */
83
84#include <ctype.h>
85#include <stdarg.h>
86#include <stdio.h>
87#include <stdlib.h>
88#include <string.h>
89#include <stdbool.h>
90
91#define LKC_DIRECT_LINK
92#include "lkc.h"
93
94#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
95
96#define PRINTD 0x0001
97#define DEBUG_PARSE 0x0002
98
99int cdebug = PRINTD;
100
101extern int zconflex(void);
102static void zconfprint(const char *err, ...);
103static void zconf_error(const char *err, ...);
104static void zconferror(const char *err);
105static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken);
106
107struct symbol *symbol_hash[257];
108
109static struct menu *current_menu, *current_entry;
110
111#define YYDEBUG 0
112#if YYDEBUG
113#define YYERROR_VERBOSE
114#endif
115
116
117
118/* Enabling traces. */
119#ifndef YYDEBUG
120# define YYDEBUG 0
121#endif
122
123/* Enabling verbose error messages. */
124#ifdef YYERROR_VERBOSE
125# undef YYERROR_VERBOSE
126# define YYERROR_VERBOSE 1
127#else
128# define YYERROR_VERBOSE 0
129#endif
130
131/* Enabling the token table. */
132#ifndef YYTOKEN_TABLE
133# define YYTOKEN_TABLE 0
134#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135
136
137/* Tokens. */
138#ifndef YYTOKENTYPE
139# define YYTOKENTYPE
140 /* Put the tokens into the symbol table, so that GDB and other debuggers
141 know about them. */
142 enum yytokentype {
143 T_MAINMENU = 258,
144 T_MENU = 259,
145 T_ENDMENU = 260,
146 T_SOURCE = 261,
147 T_CHOICE = 262,
148 T_ENDCHOICE = 263,
149 T_COMMENT = 264,
150 T_CONFIG = 265,
151 T_MENUCONFIG = 266,
152 T_HELP = 267,
153 T_HELPTEXT = 268,
154 T_IF = 269,
155 T_ENDIF = 270,
156 T_DEPENDS = 271,
Sam Ravnborg14f31562007-09-26 20:15:39 +0200157 T_OPTIONAL = 272,
158 T_PROMPT = 273,
159 T_TYPE = 274,
160 T_DEFAULT = 275,
161 T_SELECT = 276,
162 T_RANGE = 277,
163 T_OPTION = 278,
164 T_ON = 279,
165 T_WORD = 280,
166 T_WORD_QUOTE = 281,
167 T_UNEQUAL = 282,
168 T_CLOSE_PAREN = 283,
169 T_OPEN_PAREN = 284,
170 T_EOL = 285,
171 T_OR = 286,
172 T_AND = 287,
173 T_EQUAL = 288,
174 T_NOT = 289
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175 };
176#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177
178
179
Sam Ravnborg14f31562007-09-26 20:15:39 +0200180#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
181typedef union YYSTYPE
Sam Ravnborg14f31562007-09-26 20:15:39 +0200182{
Josh Triplett1456edb2009-10-15 11:03:20 -0700183
184
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185 char *string;
Roman Zippela02f0572005-11-08 21:34:53 -0800186 struct file *file;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187 struct symbol *symbol;
188 struct expr *expr;
189 struct menu *menu;
Roman Zippel3370f9f2005-11-08 21:34:52 -0800190 struct kconf_id *id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700191
Josh Triplett1456edb2009-10-15 11:03:20 -0700192
193
194} YYSTYPE;
195# define YYSTYPE_IS_TRIVIAL 1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196# define yystype YYSTYPE /* obsolescent; will be withdrawn */
197# define YYSTYPE_IS_DECLARED 1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198#endif
199
200
Linus Torvalds1da177e2005-04-16 15:20:36 -0700201/* Copy the second part of user declarations. */
202
203
Josh Triplett1456edb2009-10-15 11:03:20 -0700204/* Include zconf.hash.c here so it can see the token constants. */
205#include "zconf.hash.c"
206
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207
208
Sam Ravnborg14f31562007-09-26 20:15:39 +0200209#ifdef short
210# undef short
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700211#endif
Sam Ravnborg14f31562007-09-26 20:15:39 +0200212
213#ifdef YYTYPE_UINT8
214typedef YYTYPE_UINT8 yytype_uint8;
215#else
216typedef unsigned char yytype_uint8;
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700217#endif
Sam Ravnborg14f31562007-09-26 20:15:39 +0200218
219#ifdef YYTYPE_INT8
220typedef YYTYPE_INT8 yytype_int8;
221#elif (defined __STDC__ || defined __C99__FUNC__ \
222 || defined __cplusplus || defined _MSC_VER)
223typedef signed char yytype_int8;
224#else
225typedef short int yytype_int8;
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700226#endif
Sam Ravnborg14f31562007-09-26 20:15:39 +0200227
228#ifdef YYTYPE_UINT16
229typedef YYTYPE_UINT16 yytype_uint16;
230#else
231typedef unsigned short int yytype_uint16;
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700232#endif
233
Sam Ravnborg14f31562007-09-26 20:15:39 +0200234#ifdef YYTYPE_INT16
235typedef YYTYPE_INT16 yytype_int16;
236#else
237typedef short int yytype_int16;
238#endif
239
240#ifndef YYSIZE_T
241# ifdef __SIZE_TYPE__
242# define YYSIZE_T __SIZE_TYPE__
243# elif defined size_t
244# define YYSIZE_T size_t
245# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
246 || defined __cplusplus || defined _MSC_VER)
247# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
248# define YYSIZE_T size_t
249# else
250# define YYSIZE_T unsigned int
251# endif
252#endif
253
254#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
255
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700256#ifndef YY_
257# if YYENABLE_NLS
258# if ENABLE_NLS
259# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
260# define YY_(msgid) dgettext ("bison-runtime", msgid)
261# endif
262# endif
263# ifndef YY_
264# define YY_(msgid) msgid
265# endif
266#endif
267
Sam Ravnborg14f31562007-09-26 20:15:39 +0200268/* Suppress unused-variable warnings by "using" E. */
269#if ! defined lint || defined __GNUC__
270# define YYUSE(e) ((void) (e))
271#else
272# define YYUSE(e) /* empty */
273#endif
274
275/* Identity function, used to suppress warnings about constant conditions. */
276#ifndef lint
277# define YYID(n) (n)
278#else
279#if (defined __STDC__ || defined __C99__FUNC__ \
280 || defined __cplusplus || defined _MSC_VER)
281static int
Josh Triplett1456edb2009-10-15 11:03:20 -0700282YYID (int yyi)
Sam Ravnborg14f31562007-09-26 20:15:39 +0200283#else
284static int
Josh Triplett1456edb2009-10-15 11:03:20 -0700285YYID (yyi)
286 int yyi;
Sam Ravnborg14f31562007-09-26 20:15:39 +0200287#endif
288{
Josh Triplett1456edb2009-10-15 11:03:20 -0700289 return yyi;
Sam Ravnborg14f31562007-09-26 20:15:39 +0200290}
291#endif
292
293#if ! defined yyoverflow || YYERROR_VERBOSE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700294
295/* The parser invokes alloca or malloc; define the necessary symbols. */
296
Roman Zippel7a884882005-11-08 21:34:51 -0800297# ifdef YYSTACK_USE_ALLOCA
298# if YYSTACK_USE_ALLOCA
299# ifdef __GNUC__
300# define YYSTACK_ALLOC __builtin_alloca
Sam Ravnborg14f31562007-09-26 20:15:39 +0200301# elif defined __BUILTIN_VA_ARG_INCR
302# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
303# elif defined _AIX
304# define YYSTACK_ALLOC __alloca
305# elif defined _MSC_VER
306# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
307# define alloca _alloca
Linus Torvalds1da177e2005-04-16 15:20:36 -0700308# else
Roman Zippel7a884882005-11-08 21:34:51 -0800309# define YYSTACK_ALLOC alloca
Sam Ravnborg14f31562007-09-26 20:15:39 +0200310# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
311 || defined __cplusplus || defined _MSC_VER)
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700312# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200313# ifndef _STDLIB_H
314# define _STDLIB_H 1
315# endif
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700316# endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317# endif
318# endif
319# endif
320
321# ifdef YYSTACK_ALLOC
Sam Ravnborg14f31562007-09-26 20:15:39 +0200322 /* Pacify GCC's `empty if-body' warning. */
323# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700324# ifndef YYSTACK_ALLOC_MAXIMUM
325 /* The OS might guarantee only one guard page at the bottom of the stack,
326 and a page size can be as small as 4096 bytes. So we cannot safely
327 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
328 to allow for a few compiler-allocated temporary stack slots. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200329# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700330# endif
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700331# else
Roman Zippel7a884882005-11-08 21:34:51 -0800332# define YYSTACK_ALLOC YYMALLOC
333# define YYSTACK_FREE YYFREE
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700334# ifndef YYSTACK_ALLOC_MAXIMUM
Sam Ravnborg14f31562007-09-26 20:15:39 +0200335# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700336# endif
Sam Ravnborg14f31562007-09-26 20:15:39 +0200337# if (defined __cplusplus && ! defined _STDLIB_H \
338 && ! ((defined YYMALLOC || defined malloc) \
339 && (defined YYFREE || defined free)))
340# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
341# ifndef _STDLIB_H
342# define _STDLIB_H 1
343# endif
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700344# endif
345# ifndef YYMALLOC
346# define YYMALLOC malloc
Sam Ravnborg14f31562007-09-26 20:15:39 +0200347# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
348 || defined __cplusplus || defined _MSC_VER)
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700349void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
350# endif
351# endif
352# ifndef YYFREE
353# define YYFREE free
Sam Ravnborg14f31562007-09-26 20:15:39 +0200354# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
355 || defined __cplusplus || defined _MSC_VER)
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700356void free (void *); /* INFRINGES ON USER NAME SPACE */
357# endif
358# endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700359# endif
Sam Ravnborg14f31562007-09-26 20:15:39 +0200360#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700361
362
Sam Ravnborg14f31562007-09-26 20:15:39 +0200363#if (! defined yyoverflow \
364 && (! defined __cplusplus \
365 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366
367/* A type that is properly aligned for any stack member. */
368union yyalloc
369{
Josh Triplett1456edb2009-10-15 11:03:20 -0700370 yytype_int16 yyss_alloc;
371 YYSTYPE yyvs_alloc;
372};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373
374/* The size of the maximum gap between one aligned stack and the next. */
375# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
376
377/* The size of an array large to enough to hold all stacks, each with
378 N elements. */
379# define YYSTACK_BYTES(N) \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200380 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381 + YYSTACK_GAP_MAXIMUM)
382
383/* Copy COUNT objects from FROM to TO. The source and destination do
384 not overlap. */
385# ifndef YYCOPY
Sam Ravnborg14f31562007-09-26 20:15:39 +0200386# if defined __GNUC__ && 1 < __GNUC__
Linus Torvalds1da177e2005-04-16 15:20:36 -0700387# define YYCOPY(To, From, Count) \
388 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
389# else
390# define YYCOPY(To, From, Count) \
391 do \
392 { \
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700393 YYSIZE_T yyi; \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700394 for (yyi = 0; yyi < (Count); yyi++) \
395 (To)[yyi] = (From)[yyi]; \
396 } \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200397 while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700398# endif
399# endif
400
401/* Relocate STACK from its old location to the new one. The
402 local variables YYSIZE and YYSTACKSIZE give the old and new number of
403 elements in the stack, and YYPTR gives the new location of the
404 stack. Advance YYPTR to a properly aligned location for the next
405 stack. */
Josh Triplett1456edb2009-10-15 11:03:20 -0700406# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407 do \
408 { \
409 YYSIZE_T yynewbytes; \
Josh Triplett1456edb2009-10-15 11:03:20 -0700410 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
411 Stack = &yyptr->Stack_alloc; \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700412 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
413 yyptr += yynewbytes / sizeof (*yyptr); \
414 } \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200415 while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700416
417#endif
418
Sam Ravnborg14f31562007-09-26 20:15:39 +0200419/* YYFINAL -- State number of the termination state. */
Roman Zippela02f0572005-11-08 21:34:53 -0800420#define YYFINAL 3
Linus Torvalds1da177e2005-04-16 15:20:36 -0700421/* YYLAST -- Last index in YYTABLE. */
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100422#define YYLAST 259
Linus Torvalds1da177e2005-04-16 15:20:36 -0700423
Sam Ravnborg14f31562007-09-26 20:15:39 +0200424/* YYNTOKENS -- Number of terminals. */
425#define YYNTOKENS 35
426/* YYNNTS -- Number of nonterminals. */
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100427#define YYNNTS 46
Sam Ravnborg14f31562007-09-26 20:15:39 +0200428/* YYNRULES -- Number of rules. */
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100429#define YYNRULES 110
Sam Ravnborg14f31562007-09-26 20:15:39 +0200430/* YYNRULES -- Number of states. */
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100431#define YYNSTATES 180
Linus Torvalds1da177e2005-04-16 15:20:36 -0700432
433/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
434#define YYUNDEFTOK 2
Sam Ravnborg14f31562007-09-26 20:15:39 +0200435#define YYMAXUTOK 289
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700437#define YYTRANSLATE(YYX) \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700438 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
439
440/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200441static const yytype_uint8 yytranslate[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700442{
443 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
469 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
470 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
Sam Ravnborg14f31562007-09-26 20:15:39 +0200471 25, 26, 27, 28, 29, 30, 31, 32, 33, 34
Linus Torvalds1da177e2005-04-16 15:20:36 -0700472};
473
474#if YYDEBUG
475/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
476 YYRHS. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200477static const yytype_uint16 yyprhs[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700478{
Roman Zippela02f0572005-11-08 21:34:53 -0800479 0, 0, 3, 5, 6, 9, 12, 15, 20, 23,
480 28, 33, 37, 39, 41, 43, 45, 47, 49, 51,
481 53, 55, 57, 59, 61, 63, 67, 70, 74, 77,
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700482 81, 84, 85, 88, 91, 94, 97, 100, 103, 107,
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100483 112, 117, 122, 128, 132, 133, 137, 138, 141, 145,
484 148, 150, 154, 155, 158, 161, 164, 167, 170, 175,
485 179, 182, 187, 188, 191, 195, 197, 201, 202, 205,
486 208, 211, 215, 218, 220, 224, 225, 228, 231, 234,
487 238, 242, 245, 248, 251, 252, 255, 258, 261, 266,
488 267, 270, 272, 274, 277, 280, 283, 285, 288, 289,
489 292, 294, 298, 302, 306, 309, 313, 317, 319, 321,
490 322
Linus Torvalds1da177e2005-04-16 15:20:36 -0700491};
492
Sam Ravnborg14f31562007-09-26 20:15:39 +0200493/* YYRHS -- A `-1'-separated list of the rules' RHS. */
494static const yytype_int8 yyrhs[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700495{
Sam Ravnborg14f31562007-09-26 20:15:39 +0200496 36, 0, -1, 37, -1, -1, 37, 39, -1, 37,
497 53, -1, 37, 64, -1, 37, 3, 74, 76, -1,
498 37, 75, -1, 37, 25, 1, 30, -1, 37, 38,
499 1, 30, -1, 37, 1, 30, -1, 16, -1, 18,
500 -1, 19, -1, 21, -1, 17, -1, 22, -1, 20,
501 -1, 30, -1, 59, -1, 68, -1, 42, -1, 44,
502 -1, 66, -1, 25, 1, 30, -1, 1, 30, -1,
503 10, 25, 30, -1, 41, 45, -1, 11, 25, 30,
504 -1, 43, 45, -1, -1, 45, 46, -1, 45, 47,
505 -1, 45, 72, -1, 45, 70, -1, 45, 40, -1,
506 45, 30, -1, 19, 73, 30, -1, 18, 74, 77,
507 30, -1, 20, 78, 77, 30, -1, 21, 25, 77,
508 30, -1, 22, 79, 79, 77, 30, -1, 23, 48,
509 30, -1, -1, 48, 25, 49, -1, -1, 33, 74,
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100510 -1, 7, 80, 30, -1, 50, 54, -1, 75, -1,
511 51, 56, 52, -1, -1, 54, 55, -1, 54, 72,
512 -1, 54, 70, -1, 54, 30, -1, 54, 40, -1,
513 18, 74, 77, 30, -1, 19, 73, 30, -1, 17,
514 30, -1, 20, 25, 77, 30, -1, -1, 56, 39,
515 -1, 14, 78, 76, -1, 75, -1, 57, 60, 58,
516 -1, -1, 60, 39, -1, 60, 64, -1, 60, 53,
517 -1, 4, 74, 30, -1, 61, 71, -1, 75, -1,
518 62, 65, 63, -1, -1, 65, 39, -1, 65, 64,
519 -1, 65, 53, -1, 6, 74, 30, -1, 9, 74,
520 30, -1, 67, 71, -1, 12, 30, -1, 69, 13,
521 -1, -1, 71, 72, -1, 71, 30, -1, 71, 40,
522 -1, 16, 24, 78, 30, -1, -1, 74, 77, -1,
523 25, -1, 26, -1, 5, 30, -1, 8, 30, -1,
524 15, 30, -1, 30, -1, 76, 30, -1, -1, 14,
525 78, -1, 79, -1, 79, 33, 79, -1, 79, 27,
526 79, -1, 29, 78, 28, -1, 34, 78, -1, 78,
527 31, 78, -1, 78, 32, 78, -1, 25, -1, 26,
528 -1, -1, 25, -1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700529};
530
531/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200532static const yytype_uint16 yyrline[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700533{
Josh Triplett1456edb2009-10-15 11:03:20 -0700534 0, 107, 107, 109, 111, 112, 113, 114, 115, 116,
535 117, 121, 125, 125, 125, 125, 125, 125, 125, 129,
536 130, 131, 132, 133, 134, 138, 139, 145, 153, 159,
537 167, 177, 179, 180, 181, 182, 183, 184, 187, 195,
538 201, 211, 217, 223, 226, 228, 239, 240, 245, 254,
539 259, 267, 270, 272, 273, 274, 275, 276, 279, 285,
540 296, 302, 312, 314, 319, 327, 335, 338, 340, 341,
541 342, 347, 354, 359, 367, 370, 372, 373, 374, 377,
542 385, 392, 399, 405, 412, 414, 415, 416, 419, 427,
543 429, 434, 435, 438, 439, 440, 444, 445, 448, 449,
544 452, 453, 454, 455, 456, 457, 458, 461, 462, 465,
545 466
Linus Torvalds1da177e2005-04-16 15:20:36 -0700546};
547#endif
548
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700549#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
550/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
Sam Ravnborg14f31562007-09-26 20:15:39 +0200551 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700552static const char *const yytname[] =
553{
Roman Zippel7a884882005-11-08 21:34:51 -0800554 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
555 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
556 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
Sam Ravnborg14f31562007-09-26 20:15:39 +0200557 "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE",
558 "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
559 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
560 "T_NOT", "$accept", "input", "stmt_list", "option_name", "common_stmt",
561 "option_error", "config_entry_start", "config_stmt",
Roman Zippela02f0572005-11-08 21:34:53 -0800562 "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700563 "config_option", "symbol_option", "symbol_option_list",
564 "symbol_option_arg", "choice", "choice_entry", "choice_end",
565 "choice_stmt", "choice_option_list", "choice_option", "choice_block",
566 "if_entry", "if_end", "if_stmt", "if_block", "menu", "menu_entry",
567 "menu_end", "menu_stmt", "menu_block", "source_stmt", "comment",
568 "comment_stmt", "help_start", "help", "depends_list", "depends",
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100569 "prompt_stmt_opt", "prompt", "end", "nl", "if_expr", "expr", "symbol",
570 "word_opt", 0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700571};
572#endif
573
574# ifdef YYPRINT
575/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
576 token YYLEX-NUM. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200577static const yytype_uint16 yytoknum[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700578{
579 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
580 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
581 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
Sam Ravnborg14f31562007-09-26 20:15:39 +0200582 285, 286, 287, 288, 289
Linus Torvalds1da177e2005-04-16 15:20:36 -0700583};
584# endif
585
586/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200587static const yytype_uint8 yyr1[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700588{
Sam Ravnborg14f31562007-09-26 20:15:39 +0200589 0, 35, 36, 37, 37, 37, 37, 37, 37, 37,
590 37, 37, 38, 38, 38, 38, 38, 38, 38, 39,
591 39, 39, 39, 39, 39, 40, 40, 41, 42, 43,
592 44, 45, 45, 45, 45, 45, 45, 45, 46, 46,
593 46, 46, 46, 47, 48, 48, 49, 49, 50, 51,
594 52, 53, 54, 54, 54, 54, 54, 54, 55, 55,
595 55, 55, 56, 56, 57, 58, 59, 60, 60, 60,
596 60, 61, 62, 63, 64, 65, 65, 65, 65, 66,
597 67, 68, 69, 70, 71, 71, 71, 71, 72, 73,
598 73, 74, 74, 75, 75, 75, 76, 76, 77, 77,
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100599 78, 78, 78, 78, 78, 78, 78, 79, 79, 80,
600 80
Linus Torvalds1da177e2005-04-16 15:20:36 -0700601};
602
603/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200604static const yytype_uint8 yyr2[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700605{
Roman Zippela02f0572005-11-08 21:34:53 -0800606 0, 2, 1, 0, 2, 2, 2, 4, 2, 4,
607 4, 3, 1, 1, 1, 1, 1, 1, 1, 1,
608 1, 1, 1, 1, 1, 3, 2, 3, 2, 3,
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700609 2, 0, 2, 2, 2, 2, 2, 2, 3, 4,
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100610 4, 4, 5, 3, 0, 3, 0, 2, 3, 2,
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700611 1, 3, 0, 2, 2, 2, 2, 2, 4, 3,
612 2, 4, 0, 2, 3, 1, 3, 0, 2, 2,
613 2, 3, 2, 1, 3, 0, 2, 2, 2, 3,
Sam Ravnborg14f31562007-09-26 20:15:39 +0200614 3, 2, 2, 2, 0, 2, 2, 2, 4, 0,
615 2, 1, 1, 2, 2, 2, 1, 2, 0, 2,
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100616 1, 3, 3, 3, 2, 3, 3, 1, 1, 0,
617 1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700618};
619
620/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
621 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
622 means the default is an error. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200623static const yytype_uint8 yydefact[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700624{
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100625 3, 0, 0, 1, 0, 0, 0, 0, 0, 109,
Roman Zippela02f0572005-11-08 21:34:53 -0800626 0, 0, 0, 0, 0, 0, 12, 16, 13, 14,
627 18, 15, 17, 0, 19, 0, 4, 31, 22, 31,
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700628 23, 52, 62, 5, 67, 20, 84, 75, 6, 24,
Sam Ravnborg14f31562007-09-26 20:15:39 +0200629 84, 21, 8, 11, 91, 92, 0, 0, 93, 0,
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100630 110, 0, 94, 0, 0, 0, 107, 108, 0, 0,
631 0, 100, 95, 0, 0, 0, 0, 0, 0, 0,
632 0, 0, 0, 96, 7, 71, 79, 48, 80, 27,
633 29, 0, 104, 0, 0, 64, 0, 0, 9, 10,
634 0, 0, 0, 0, 89, 0, 0, 0, 44, 0,
635 37, 36, 32, 33, 0, 35, 34, 0, 0, 89,
636 0, 56, 57, 53, 55, 54, 63, 51, 50, 68,
637 70, 66, 69, 65, 86, 87, 85, 76, 78, 74,
638 77, 73, 97, 103, 105, 106, 102, 101, 26, 82,
639 0, 98, 0, 98, 98, 98, 0, 0, 0, 83,
640 60, 98, 0, 98, 0, 0, 0, 38, 90, 0,
641 0, 98, 46, 43, 25, 0, 59, 0, 88, 99,
642 39, 40, 41, 0, 0, 45, 58, 61, 42, 47
Linus Torvalds1da177e2005-04-16 15:20:36 -0700643};
644
Sam Ravnborg14f31562007-09-26 20:15:39 +0200645/* YYDEFGOTO[NTERM-NUM]. */
646static const yytype_int16 yydefgoto[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700647{
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100648 -1, 1, 2, 25, 26, 101, 27, 28, 29, 30,
649 65, 102, 103, 147, 175, 31, 32, 117, 33, 67,
650 113, 68, 34, 121, 35, 69, 36, 37, 129, 38,
651 71, 39, 40, 41, 104, 105, 70, 106, 142, 143,
652 42, 74, 156, 60, 61, 51
Linus Torvalds1da177e2005-04-16 15:20:36 -0700653};
654
655/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
656 STATE-NUM. */
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100657#define YYPACT_NINF -80
Sam Ravnborg14f31562007-09-26 20:15:39 +0200658static const yytype_int16 yypact[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700659{
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100660 -80, 2, 132, -80, -13, -1, -1, -2, -1, 9,
661 33, -1, 27, 40, -3, 38, -80, -80, -80, -80,
662 -80, -80, -80, 71, -80, 77, -80, -80, -80, -80,
663 -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
664 -80, -80, -80, -80, -80, -80, 57, 61, -80, 63,
665 -80, 76, -80, 87, 101, 133, -80, -80, -3, -3,
666 195, -6, -80, 136, 149, 39, 104, 65, 150, 5,
667 194, 5, 167, -80, 176, -80, -80, -80, -80, -80,
668 -80, 68, -80, -3, -3, 176, 72, 72, -80, -80,
669 177, 187, 78, -1, -1, -3, 196, 72, -80, 222,
670 -80, -80, -80, -80, 221, -80, -80, 205, -1, -1,
671 211, -80, -80, -80, -80, -80, -80, -80, -80, -80,
672 -80, -80, -80, -80, -80, -80, -80, -80, -80, -80,
673 -80, -80, -80, -80, 206, -80, -80, -80, -80, -80,
674 -3, 223, 209, 223, 197, 223, 72, 7, 210, -80,
675 -80, 223, 212, 223, 201, -3, 213, -80, -80, 214,
676 215, 223, 208, -80, -80, 216, -80, 217, -80, 113,
677 -80, -80, -80, 218, -1, -80, -80, -80, -80, -80
Linus Torvalds1da177e2005-04-16 15:20:36 -0700678};
679
680/* YYPGOTO[NTERM-NUM]. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200681static const yytype_int16 yypgoto[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700682{
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100683 -80, -80, -80, -80, 122, -34, -80, -80, -80, -80,
684 220, -80, -80, -80, -80, -80, -80, -80, 59, -80,
685 -80, -80, -80, -80, -80, -80, -80, -80, -80, 125,
686 -80, -80, -80, -80, -80, 183, 219, 22, 142, -5,
687 147, 192, 69, -54, -79, -80
Linus Torvalds1da177e2005-04-16 15:20:36 -0700688};
689
690/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
691 positive, shift that token. If negative, reduce the rule which
692 number is the opposite. If zero, do what YYDEFACT says.
693 If YYTABLE_NINF, syntax error. */
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700694#define YYTABLE_NINF -82
Sam Ravnborg14f31562007-09-26 20:15:39 +0200695static const yytype_int16 yytable[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700696{
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100697 46, 47, 3, 49, 81, 82, 53, 136, 137, 6,
698 7, 8, 9, 10, 11, 12, 13, 43, 146, 14,
699 15, 86, 56, 57, 44, 45, 58, 87, 48, 134,
700 135, 59, 162, 112, 50, 24, 125, 163, 125, -28,
701 90, 144, -28, -28, -28, -28, -28, -28, -28, -28,
702 -28, 91, 54, -28, -28, 92, -28, 93, 94, 95,
703 96, 97, 98, 52, 99, 55, 90, 161, 62, 100,
704 -49, -49, 63, -49, -49, -49, -49, 91, 64, -49,
705 -49, 92, 107, 108, 109, 110, 154, 73, 141, 115,
706 99, 75, 126, 76, 126, 111, 133, 56, 57, 83,
707 84, 169, 140, 151, -30, 90, 77, -30, -30, -30,
708 -30, -30, -30, -30, -30, -30, 91, 78, -30, -30,
709 92, -30, 93, 94, 95, 96, 97, 98, 120, 99,
710 128, 79, -2, 4, 100, 5, 6, 7, 8, 9,
711 10, 11, 12, 13, 83, 84, 14, 15, 16, 17,
712 18, 19, 20, 21, 22, 7, 8, 23, 10, 11,
713 12, 13, 24, 80, 14, 15, 88, -81, 90, 179,
714 -81, -81, -81, -81, -81, -81, -81, -81, -81, 89,
715 24, -81, -81, 92, -81, -81, -81, -81, -81, -81,
716 116, 119, 99, 127, 122, 90, 130, 124, -72, -72,
717 -72, -72, -72, -72, -72, -72, 132, 138, -72, -72,
718 92, 155, 158, 159, 160, 118, 123, 139, 131, 99,
719 165, 145, 167, 148, 124, 73, 83, 84, 83, 84,
720 173, 168, 83, 84, 149, 150, 153, 155, 84, 157,
721 164, 174, 166, 170, 171, 172, 176, 177, 178, 66,
722 114, 152, 85, 0, 0, 0, 0, 0, 0, 72
Linus Torvalds1da177e2005-04-16 15:20:36 -0700723};
724
Sam Ravnborg14f31562007-09-26 20:15:39 +0200725static const yytype_int16 yycheck[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700726{
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100727 5, 6, 0, 8, 58, 59, 11, 86, 87, 4,
728 5, 6, 7, 8, 9, 10, 11, 30, 97, 14,
729 15, 27, 25, 26, 25, 26, 29, 33, 30, 83,
730 84, 34, 25, 67, 25, 30, 70, 30, 72, 0,
731 1, 95, 3, 4, 5, 6, 7, 8, 9, 10,
732 11, 12, 25, 14, 15, 16, 17, 18, 19, 20,
733 21, 22, 23, 30, 25, 25, 1, 146, 30, 30,
734 5, 6, 1, 8, 9, 10, 11, 12, 1, 14,
735 15, 16, 17, 18, 19, 20, 140, 30, 93, 67,
736 25, 30, 70, 30, 72, 30, 28, 25, 26, 31,
737 32, 155, 24, 108, 0, 1, 30, 3, 4, 5,
738 6, 7, 8, 9, 10, 11, 12, 30, 14, 15,
739 16, 17, 18, 19, 20, 21, 22, 23, 69, 25,
740 71, 30, 0, 1, 30, 3, 4, 5, 6, 7,
741 8, 9, 10, 11, 31, 32, 14, 15, 16, 17,
742 18, 19, 20, 21, 22, 5, 6, 25, 8, 9,
743 10, 11, 30, 30, 14, 15, 30, 0, 1, 174,
744 3, 4, 5, 6, 7, 8, 9, 10, 11, 30,
745 30, 14, 15, 16, 17, 18, 19, 20, 21, 22,
746 68, 69, 25, 71, 69, 1, 71, 30, 4, 5,
747 6, 7, 8, 9, 10, 11, 30, 30, 14, 15,
748 16, 14, 143, 144, 145, 68, 69, 30, 71, 25,
749 151, 25, 153, 1, 30, 30, 31, 32, 31, 32,
750 161, 30, 31, 32, 13, 30, 25, 14, 32, 30,
751 30, 33, 30, 30, 30, 30, 30, 30, 30, 29,
752 67, 109, 60, -1, -1, -1, -1, -1, -1, 40
Linus Torvalds1da177e2005-04-16 15:20:36 -0700753};
754
755/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
756 symbol of state STATE-NUM. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200757static const yytype_uint8 yystos[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700758{
Sam Ravnborg14f31562007-09-26 20:15:39 +0200759 0, 36, 37, 0, 1, 3, 4, 5, 6, 7,
760 8, 9, 10, 11, 14, 15, 16, 17, 18, 19,
761 20, 21, 22, 25, 30, 38, 39, 41, 42, 43,
762 44, 50, 51, 53, 57, 59, 61, 62, 64, 66,
763 67, 68, 75, 30, 25, 26, 74, 74, 30, 74,
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100764 25, 80, 30, 74, 25, 25, 25, 26, 29, 34,
765 78, 79, 30, 1, 1, 45, 45, 54, 56, 60,
766 71, 65, 71, 30, 76, 30, 30, 30, 30, 30,
767 30, 78, 78, 31, 32, 76, 27, 33, 30, 30,
768 1, 12, 16, 18, 19, 20, 21, 22, 23, 25,
769 30, 40, 46, 47, 69, 70, 72, 17, 18, 19,
770 20, 30, 40, 55, 70, 72, 39, 52, 75, 39,
771 53, 58, 64, 75, 30, 40, 72, 39, 53, 63,
772 64, 75, 30, 28, 78, 78, 79, 79, 30, 30,
773 24, 74, 73, 74, 78, 25, 79, 48, 1, 13,
774 30, 74, 73, 25, 78, 14, 77, 30, 77, 77,
775 77, 79, 25, 30, 30, 77, 30, 77, 30, 78,
776 30, 30, 30, 77, 33, 49, 30, 30, 30, 74
Linus Torvalds1da177e2005-04-16 15:20:36 -0700777};
778
Linus Torvalds1da177e2005-04-16 15:20:36 -0700779#define yyerrok (yyerrstatus = 0)
780#define yyclearin (yychar = YYEMPTY)
781#define YYEMPTY (-2)
782#define YYEOF 0
783
784#define YYACCEPT goto yyacceptlab
785#define YYABORT goto yyabortlab
Roman Zippel7a884882005-11-08 21:34:51 -0800786#define YYERROR goto yyerrorlab
Linus Torvalds1da177e2005-04-16 15:20:36 -0700787
788
789/* Like YYERROR except do call yyerror. This remains here temporarily
790 to ease the transition to the new meaning of YYERROR, for GCC.
791 Once GCC version 2 has supplanted version 1, this can go. */
792
793#define YYFAIL goto yyerrlab
794
795#define YYRECOVERING() (!!yyerrstatus)
796
797#define YYBACKUP(Token, Value) \
798do \
799 if (yychar == YYEMPTY && yylen == 1) \
800 { \
801 yychar = (Token); \
802 yylval = (Value); \
803 yytoken = YYTRANSLATE (yychar); \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200804 YYPOPSTACK (1); \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700805 goto yybackup; \
806 } \
807 else \
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700808 { \
809 yyerror (YY_("syntax error: cannot back up")); \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700810 YYERROR; \
811 } \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200812while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700813
Roman Zippel7a884882005-11-08 21:34:51 -0800814
Linus Torvalds1da177e2005-04-16 15:20:36 -0700815#define YYTERROR 1
816#define YYERRCODE 256
817
Linus Torvalds1da177e2005-04-16 15:20:36 -0700818
Roman Zippel7a884882005-11-08 21:34:51 -0800819/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
820 If N is 0, then set CURRENT to the empty location which ends
821 the previous symbol: RHS[0] (always defined). */
822
823#define YYRHSLOC(Rhs, K) ((Rhs)[K])
Linus Torvalds1da177e2005-04-16 15:20:36 -0700824#ifndef YYLLOC_DEFAULT
Roman Zippel7a884882005-11-08 21:34:51 -0800825# define YYLLOC_DEFAULT(Current, Rhs, N) \
826 do \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200827 if (YYID (N)) \
Roman Zippel7a884882005-11-08 21:34:51 -0800828 { \
829 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
830 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
831 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
832 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
833 } \
834 else \
835 { \
836 (Current).first_line = (Current).last_line = \
837 YYRHSLOC (Rhs, 0).last_line; \
838 (Current).first_column = (Current).last_column = \
839 YYRHSLOC (Rhs, 0).last_column; \
840 } \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200841 while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700842#endif
843
Roman Zippel7a884882005-11-08 21:34:51 -0800844
845/* YY_LOCATION_PRINT -- Print the location on the stream.
846 This macro was not mandated originally: define only if we know
847 we won't break user code: when these are the locations we know. */
848
849#ifndef YY_LOCATION_PRINT
850# if YYLTYPE_IS_TRIVIAL
851# define YY_LOCATION_PRINT(File, Loc) \
852 fprintf (File, "%d.%d-%d.%d", \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200853 (Loc).first_line, (Loc).first_column, \
854 (Loc).last_line, (Loc).last_column)
Roman Zippel7a884882005-11-08 21:34:51 -0800855# else
856# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
857# endif
858#endif
859
860
Linus Torvalds1da177e2005-04-16 15:20:36 -0700861/* YYLEX -- calling `yylex' with the right arguments. */
862
863#ifdef YYLEX_PARAM
864# define YYLEX yylex (YYLEX_PARAM)
865#else
866# define YYLEX yylex ()
867#endif
868
869/* Enable debugging if requested. */
870#if YYDEBUG
871
872# ifndef YYFPRINTF
873# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
874# define YYFPRINTF fprintf
875# endif
876
877# define YYDPRINTF(Args) \
878do { \
879 if (yydebug) \
880 YYFPRINTF Args; \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200881} while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700882
Sam Ravnborg14f31562007-09-26 20:15:39 +0200883# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
884do { \
885 if (yydebug) \
886 { \
887 YYFPRINTF (stderr, "%s ", Title); \
888 yy_symbol_print (stderr, \
889 Type, Value); \
890 YYFPRINTF (stderr, "\n"); \
891 } \
892} while (YYID (0))
893
894
895/*--------------------------------.
896| Print this symbol on YYOUTPUT. |
897`--------------------------------*/
898
899/*ARGSUSED*/
900#if (defined __STDC__ || defined __C99__FUNC__ \
901 || defined __cplusplus || defined _MSC_VER)
902static void
903yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
904#else
905static void
906yy_symbol_value_print (yyoutput, yytype, yyvaluep)
907 FILE *yyoutput;
908 int yytype;
909 YYSTYPE const * const yyvaluep;
910#endif
911{
912 if (!yyvaluep)
913 return;
914# ifdef YYPRINT
915 if (yytype < YYNTOKENS)
916 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
917# else
918 YYUSE (yyoutput);
919# endif
920 switch (yytype)
921 {
922 default:
923 break;
924 }
925}
926
927
928/*--------------------------------.
929| Print this symbol on YYOUTPUT. |
930`--------------------------------*/
931
932#if (defined __STDC__ || defined __C99__FUNC__ \
933 || defined __cplusplus || defined _MSC_VER)
934static void
935yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
936#else
937static void
938yy_symbol_print (yyoutput, yytype, yyvaluep)
939 FILE *yyoutput;
940 int yytype;
941 YYSTYPE const * const yyvaluep;
942#endif
943{
944 if (yytype < YYNTOKENS)
945 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
946 else
947 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
948
949 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
950 YYFPRINTF (yyoutput, ")");
951}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700952
953/*------------------------------------------------------------------.
954| yy_stack_print -- Print the state stack from its BOTTOM up to its |
Roman Zippel7a884882005-11-08 21:34:51 -0800955| TOP (included). |
Linus Torvalds1da177e2005-04-16 15:20:36 -0700956`------------------------------------------------------------------*/
957
Sam Ravnborg14f31562007-09-26 20:15:39 +0200958#if (defined __STDC__ || defined __C99__FUNC__ \
959 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700960static void
Josh Triplett1456edb2009-10-15 11:03:20 -0700961yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700962#else
963static void
Josh Triplett1456edb2009-10-15 11:03:20 -0700964yy_stack_print (yybottom, yytop)
965 yytype_int16 *yybottom;
966 yytype_int16 *yytop;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700967#endif
968{
969 YYFPRINTF (stderr, "Stack now");
Josh Triplett1456edb2009-10-15 11:03:20 -0700970 for (; yybottom <= yytop; yybottom++)
971 {
972 int yybot = *yybottom;
973 YYFPRINTF (stderr, " %d", yybot);
974 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700975 YYFPRINTF (stderr, "\n");
976}
977
978# define YY_STACK_PRINT(Bottom, Top) \
979do { \
980 if (yydebug) \
981 yy_stack_print ((Bottom), (Top)); \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200982} while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700983
984
985/*------------------------------------------------.
986| Report that the YYRULE is going to be reduced. |
987`------------------------------------------------*/
988
Sam Ravnborg14f31562007-09-26 20:15:39 +0200989#if (defined __STDC__ || defined __C99__FUNC__ \
990 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700991static void
Sam Ravnborg14f31562007-09-26 20:15:39 +0200992yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700993#else
994static void
Sam Ravnborg14f31562007-09-26 20:15:39 +0200995yy_reduce_print (yyvsp, yyrule)
996 YYSTYPE *yyvsp;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700997 int yyrule;
998#endif
999{
Sam Ravnborg14f31562007-09-26 20:15:39 +02001000 int yynrhs = yyr2[yyrule];
Linus Torvalds1da177e2005-04-16 15:20:36 -07001001 int yyi;
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001002 unsigned long int yylno = yyrline[yyrule];
Sam Ravnborg14f31562007-09-26 20:15:39 +02001003 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1004 yyrule - 1, yylno);
1005 /* The symbols being reduced. */
1006 for (yyi = 0; yyi < yynrhs; yyi++)
1007 {
Josh Triplett1456edb2009-10-15 11:03:20 -07001008 YYFPRINTF (stderr, " $%d = ", yyi + 1);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001009 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1010 &(yyvsp[(yyi + 1) - (yynrhs)])
1011 );
Josh Triplett1456edb2009-10-15 11:03:20 -07001012 YYFPRINTF (stderr, "\n");
Sam Ravnborg14f31562007-09-26 20:15:39 +02001013 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07001014}
1015
1016# define YY_REDUCE_PRINT(Rule) \
1017do { \
1018 if (yydebug) \
Sam Ravnborg14f31562007-09-26 20:15:39 +02001019 yy_reduce_print (yyvsp, Rule); \
1020} while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -07001021
1022/* Nonzero means print parse trace. It is left uninitialized so that
1023 multiple parsers can coexist. */
1024int yydebug;
1025#else /* !YYDEBUG */
1026# define YYDPRINTF(Args)
Roman Zippel7a884882005-11-08 21:34:51 -08001027# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001028# define YY_STACK_PRINT(Bottom, Top)
1029# define YY_REDUCE_PRINT(Rule)
1030#endif /* !YYDEBUG */
1031
1032
1033/* YYINITDEPTH -- initial size of the parser's stacks. */
1034#ifndef YYINITDEPTH
1035# define YYINITDEPTH 200
1036#endif
1037
1038/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1039 if the built-in stack extension method is used).
1040
1041 Do not make this value too large; the results are undefined if
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001042 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001043 evaluated with infinite-precision integer arithmetic. */
1044
Linus Torvalds1da177e2005-04-16 15:20:36 -07001045#ifndef YYMAXDEPTH
1046# define YYMAXDEPTH 10000
1047#endif
1048
1049
1050
1051#if YYERROR_VERBOSE
1052
1053# ifndef yystrlen
Sam Ravnborg14f31562007-09-26 20:15:39 +02001054# if defined __GLIBC__ && defined _STRING_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07001055# define yystrlen strlen
1056# else
1057/* Return the length of YYSTR. */
Sam Ravnborg14f31562007-09-26 20:15:39 +02001058#if (defined __STDC__ || defined __C99__FUNC__ \
1059 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001060static YYSIZE_T
Linus Torvalds1da177e2005-04-16 15:20:36 -07001061yystrlen (const char *yystr)
Sam Ravnborg14f31562007-09-26 20:15:39 +02001062#else
1063static YYSIZE_T
Linus Torvalds1da177e2005-04-16 15:20:36 -07001064yystrlen (yystr)
Sam Ravnborg14f31562007-09-26 20:15:39 +02001065 const char *yystr;
1066#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001067{
Sam Ravnborg14f31562007-09-26 20:15:39 +02001068 YYSIZE_T yylen;
1069 for (yylen = 0; yystr[yylen]; yylen++)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001070 continue;
Sam Ravnborg14f31562007-09-26 20:15:39 +02001071 return yylen;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001072}
1073# endif
1074# endif
1075
1076# ifndef yystpcpy
Sam Ravnborg14f31562007-09-26 20:15:39 +02001077# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
Linus Torvalds1da177e2005-04-16 15:20:36 -07001078# define yystpcpy stpcpy
1079# else
1080/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1081 YYDEST. */
Sam Ravnborg14f31562007-09-26 20:15:39 +02001082#if (defined __STDC__ || defined __C99__FUNC__ \
1083 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001084static char *
Linus Torvalds1da177e2005-04-16 15:20:36 -07001085yystpcpy (char *yydest, const char *yysrc)
Sam Ravnborg14f31562007-09-26 20:15:39 +02001086#else
1087static char *
Linus Torvalds1da177e2005-04-16 15:20:36 -07001088yystpcpy (yydest, yysrc)
Sam Ravnborg14f31562007-09-26 20:15:39 +02001089 char *yydest;
1090 const char *yysrc;
1091#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001092{
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001093 char *yyd = yydest;
1094 const char *yys = yysrc;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001095
1096 while ((*yyd++ = *yys++) != '\0')
1097 continue;
1098
1099 return yyd - 1;
1100}
1101# endif
1102# endif
1103
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001104# ifndef yytnamerr
1105/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1106 quotes and backslashes, so that it's suitable for yyerror. The
1107 heuristic is that double-quoting is unnecessary unless the string
1108 contains an apostrophe, a comma, or backslash (other than
1109 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1110 null, do not copy; instead, return the length of what the result
1111 would have been. */
1112static YYSIZE_T
1113yytnamerr (char *yyres, const char *yystr)
1114{
1115 if (*yystr == '"')
1116 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001117 YYSIZE_T yyn = 0;
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001118 char const *yyp = yystr;
1119
1120 for (;;)
1121 switch (*++yyp)
1122 {
1123 case '\'':
1124 case ',':
1125 goto do_not_strip_quotes;
1126
1127 case '\\':
1128 if (*++yyp != '\\')
1129 goto do_not_strip_quotes;
1130 /* Fall through. */
1131 default:
1132 if (yyres)
1133 yyres[yyn] = *yyp;
1134 yyn++;
1135 break;
1136
1137 case '"':
1138 if (yyres)
1139 yyres[yyn] = '\0';
1140 return yyn;
1141 }
1142 do_not_strip_quotes: ;
1143 }
1144
1145 if (! yyres)
1146 return yystrlen (yystr);
1147
1148 return yystpcpy (yyres, yystr) - yyres;
1149}
1150# endif
1151
Sam Ravnborg14f31562007-09-26 20:15:39 +02001152/* Copy into YYRESULT an error message about the unexpected token
1153 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1154 including the terminating null byte. If YYRESULT is null, do not
1155 copy anything; just return the number of bytes that would be
1156 copied. As a special case, return 0 if an ordinary "syntax error"
1157 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1158 size calculation. */
1159static YYSIZE_T
1160yysyntax_error (char *yyresult, int yystate, int yychar)
1161{
1162 int yyn = yypact[yystate];
Linus Torvalds1da177e2005-04-16 15:20:36 -07001163
Sam Ravnborg14f31562007-09-26 20:15:39 +02001164 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1165 return 0;
1166 else
1167 {
1168 int yytype = YYTRANSLATE (yychar);
1169 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1170 YYSIZE_T yysize = yysize0;
1171 YYSIZE_T yysize1;
1172 int yysize_overflow = 0;
1173 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1174 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1175 int yyx;
1176
1177# if 0
1178 /* This is so xgettext sees the translatable formats that are
1179 constructed on the fly. */
1180 YY_("syntax error, unexpected %s");
1181 YY_("syntax error, unexpected %s, expecting %s");
1182 YY_("syntax error, unexpected %s, expecting %s or %s");
1183 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1184 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1185# endif
1186 char *yyfmt;
1187 char const *yyf;
1188 static char const yyunexpected[] = "syntax error, unexpected %s";
1189 static char const yyexpecting[] = ", expecting %s";
1190 static char const yyor[] = " or %s";
1191 char yyformat[sizeof yyunexpected
1192 + sizeof yyexpecting - 1
1193 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1194 * (sizeof yyor - 1))];
1195 char const *yyprefix = yyexpecting;
1196
1197 /* Start YYX at -YYN if negative to avoid negative indexes in
1198 YYCHECK. */
1199 int yyxbegin = yyn < 0 ? -yyn : 0;
1200
1201 /* Stay within bounds of both yycheck and yytname. */
1202 int yychecklim = YYLAST - yyn + 1;
1203 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1204 int yycount = 1;
1205
1206 yyarg[0] = yytname[yytype];
1207 yyfmt = yystpcpy (yyformat, yyunexpected);
1208
1209 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1210 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1211 {
1212 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1213 {
1214 yycount = 1;
1215 yysize = yysize0;
1216 yyformat[sizeof yyunexpected - 1] = '\0';
1217 break;
1218 }
1219 yyarg[yycount++] = yytname[yyx];
1220 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1221 yysize_overflow |= (yysize1 < yysize);
1222 yysize = yysize1;
1223 yyfmt = yystpcpy (yyfmt, yyprefix);
1224 yyprefix = yyor;
1225 }
1226
1227 yyf = YY_(yyformat);
1228 yysize1 = yysize + yystrlen (yyf);
1229 yysize_overflow |= (yysize1 < yysize);
1230 yysize = yysize1;
1231
1232 if (yysize_overflow)
1233 return YYSIZE_MAXIMUM;
1234
1235 if (yyresult)
1236 {
1237 /* Avoid sprintf, as that infringes on the user's name space.
1238 Don't have undefined behavior even if the translation
1239 produced a string with the wrong number of "%s"s. */
1240 char *yyp = yyresult;
1241 int yyi = 0;
1242 while ((*yyp = *yyf) != '\0')
1243 {
1244 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1245 {
1246 yyp += yytnamerr (yyp, yyarg[yyi++]);
1247 yyf += 2;
1248 }
1249 else
1250 {
1251 yyp++;
1252 yyf++;
1253 }
1254 }
1255 }
1256 return yysize;
1257 }
1258}
1259#endif /* YYERROR_VERBOSE */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001260
1261
Linus Torvalds1da177e2005-04-16 15:20:36 -07001262/*-----------------------------------------------.
1263| Release the memory associated to this symbol. |
1264`-----------------------------------------------*/
1265
Sam Ravnborg14f31562007-09-26 20:15:39 +02001266/*ARGSUSED*/
1267#if (defined __STDC__ || defined __C99__FUNC__ \
1268 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001269static void
Roman Zippel7a884882005-11-08 21:34:51 -08001270yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001271#else
1272static void
Roman Zippel7a884882005-11-08 21:34:51 -08001273yydestruct (yymsg, yytype, yyvaluep)
1274 const char *yymsg;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001275 int yytype;
1276 YYSTYPE *yyvaluep;
1277#endif
1278{
Sam Ravnborg14f31562007-09-26 20:15:39 +02001279 YYUSE (yyvaluep);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001280
Roman Zippel7a884882005-11-08 21:34:51 -08001281 if (!yymsg)
1282 yymsg = "Deleting";
1283 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1284
Linus Torvalds1da177e2005-04-16 15:20:36 -07001285 switch (yytype)
1286 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001287 case 51: /* "choice_entry" */
Roman Zippela02f0572005-11-08 21:34:53 -08001288
Sam Ravnborg14f31562007-09-26 20:15:39 +02001289 {
Roman Zippela02f0572005-11-08 21:34:53 -08001290 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1291 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1292 if (current_menu == (yyvaluep->menu))
1293 menu_end_menu();
1294};
1295
Sam Ravnborg14f31562007-09-26 20:15:39 +02001296 break;
1297 case 57: /* "if_entry" */
Roman Zippela02f0572005-11-08 21:34:53 -08001298
Sam Ravnborg14f31562007-09-26 20:15:39 +02001299 {
Roman Zippela02f0572005-11-08 21:34:53 -08001300 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1301 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1302 if (current_menu == (yyvaluep->menu))
1303 menu_end_menu();
1304};
1305
Sam Ravnborg14f31562007-09-26 20:15:39 +02001306 break;
1307 case 62: /* "menu_entry" */
Roman Zippela02f0572005-11-08 21:34:53 -08001308
Sam Ravnborg14f31562007-09-26 20:15:39 +02001309 {
Roman Zippela02f0572005-11-08 21:34:53 -08001310 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1311 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1312 if (current_menu == (yyvaluep->menu))
1313 menu_end_menu();
1314};
1315
Sam Ravnborg14f31562007-09-26 20:15:39 +02001316 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001317
1318 default:
Sam Ravnborg14f31562007-09-26 20:15:39 +02001319 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001320 }
1321}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001322
1323/* Prevent warnings from -Wmissing-prototypes. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001324#ifdef YYPARSE_PARAM
Sam Ravnborg14f31562007-09-26 20:15:39 +02001325#if defined __STDC__ || defined __cplusplus
Linus Torvalds1da177e2005-04-16 15:20:36 -07001326int yyparse (void *YYPARSE_PARAM);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001327#else
Linus Torvalds1da177e2005-04-16 15:20:36 -07001328int yyparse ();
Sam Ravnborg14f31562007-09-26 20:15:39 +02001329#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001330#else /* ! YYPARSE_PARAM */
Sam Ravnborg14f31562007-09-26 20:15:39 +02001331#if defined __STDC__ || defined __cplusplus
Linus Torvalds1da177e2005-04-16 15:20:36 -07001332int yyparse (void);
1333#else
1334int yyparse ();
1335#endif
1336#endif /* ! YYPARSE_PARAM */
1337
1338
Josh Triplett1456edb2009-10-15 11:03:20 -07001339/* The lookahead symbol. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001340int yychar;
1341
Josh Triplett1456edb2009-10-15 11:03:20 -07001342/* The semantic value of the lookahead symbol. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001343YYSTYPE yylval;
1344
1345/* Number of syntax errors so far. */
1346int yynerrs;
1347
1348
1349
Josh Triplett1456edb2009-10-15 11:03:20 -07001350/*-------------------------.
1351| yyparse or yypush_parse. |
1352`-------------------------*/
Linus Torvalds1da177e2005-04-16 15:20:36 -07001353
1354#ifdef YYPARSE_PARAM
Sam Ravnborg14f31562007-09-26 20:15:39 +02001355#if (defined __STDC__ || defined __C99__FUNC__ \
1356 || defined __cplusplus || defined _MSC_VER)
1357int
1358yyparse (void *YYPARSE_PARAM)
1359#else
1360int
1361yyparse (YYPARSE_PARAM)
1362 void *YYPARSE_PARAM;
1363#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001364#else /* ! YYPARSE_PARAM */
Sam Ravnborg14f31562007-09-26 20:15:39 +02001365#if (defined __STDC__ || defined __C99__FUNC__ \
1366 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001367int
1368yyparse (void)
1369#else
1370int
1371yyparse ()
Sam Ravnborg14f31562007-09-26 20:15:39 +02001372
Linus Torvalds1da177e2005-04-16 15:20:36 -07001373#endif
1374#endif
1375{
Josh Triplett1456edb2009-10-15 11:03:20 -07001376
1377
1378 int yystate;
1379 /* Number of tokens to shift before error messages enabled. */
1380 int yyerrstatus;
1381
1382 /* The stacks and their tools:
1383 `yyss': related to states.
1384 `yyvs': related to semantic values.
1385
1386 Refer to the stacks thru separate pointers, to allow yyoverflow
1387 to reallocate them elsewhere. */
1388
1389 /* The state stack. */
1390 yytype_int16 yyssa[YYINITDEPTH];
1391 yytype_int16 *yyss;
1392 yytype_int16 *yyssp;
1393
1394 /* The semantic value stack. */
1395 YYSTYPE yyvsa[YYINITDEPTH];
1396 YYSTYPE *yyvs;
1397 YYSTYPE *yyvsp;
1398
1399 YYSIZE_T yystacksize;
1400
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001401 int yyn;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001402 int yyresult;
Josh Triplett1456edb2009-10-15 11:03:20 -07001403 /* Lookahead token as an internal (translated) token number. */
1404 int yytoken;
1405 /* The variables used to return semantic value and location from the
1406 action routines. */
1407 YYSTYPE yyval;
1408
Sam Ravnborg14f31562007-09-26 20:15:39 +02001409#if YYERROR_VERBOSE
1410 /* Buffer for error messages, and its allocated size. */
1411 char yymsgbuf[128];
1412 char *yymsg = yymsgbuf;
1413 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1414#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001415
Sam Ravnborg14f31562007-09-26 20:15:39 +02001416#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
Linus Torvalds1da177e2005-04-16 15:20:36 -07001417
Sam Ravnborg14f31562007-09-26 20:15:39 +02001418 /* The number of symbols on the RHS of the reduced rule.
1419 Keep to zero when no symbol should be popped. */
1420 int yylen = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001421
Josh Triplett1456edb2009-10-15 11:03:20 -07001422 yytoken = 0;
1423 yyss = yyssa;
1424 yyvs = yyvsa;
1425 yystacksize = YYINITDEPTH;
1426
Linus Torvalds1da177e2005-04-16 15:20:36 -07001427 YYDPRINTF ((stderr, "Starting parse\n"));
1428
1429 yystate = 0;
1430 yyerrstatus = 0;
1431 yynerrs = 0;
Josh Triplett1456edb2009-10-15 11:03:20 -07001432 yychar = YYEMPTY; /* Cause a token to be read. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001433
1434 /* Initialize stack pointers.
1435 Waste one element of value and location stack
1436 so that they stay on the same level as the state stack.
1437 The wasted elements are never initialized. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001438 yyssp = yyss;
1439 yyvsp = yyvs;
1440
1441 goto yysetstate;
1442
1443/*------------------------------------------------------------.
1444| yynewstate -- Push a new state, which is found in yystate. |
1445`------------------------------------------------------------*/
1446 yynewstate:
1447 /* In all cases, when you get here, the value and location stacks
Sam Ravnborg14f31562007-09-26 20:15:39 +02001448 have just been pushed. So pushing a state here evens the stacks. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001449 yyssp++;
1450
1451 yysetstate:
1452 *yyssp = yystate;
1453
1454 if (yyss + yystacksize - 1 <= yyssp)
1455 {
1456 /* Get the current used size of the three stacks, in elements. */
1457 YYSIZE_T yysize = yyssp - yyss + 1;
1458
1459#ifdef yyoverflow
1460 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001461 /* Give user a chance to reallocate the stack. Use copies of
Linus Torvalds1da177e2005-04-16 15:20:36 -07001462 these so that the &'s don't force the real ones into
1463 memory. */
1464 YYSTYPE *yyvs1 = yyvs;
Sam Ravnborg14f31562007-09-26 20:15:39 +02001465 yytype_int16 *yyss1 = yyss;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001466
Linus Torvalds1da177e2005-04-16 15:20:36 -07001467 /* Each stack pointer address is followed by the size of the
1468 data in use in that stack, in bytes. This used to be a
1469 conditional around just the two extra args, but that might
1470 be undefined if yyoverflow is a macro. */
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001471 yyoverflow (YY_("memory exhausted"),
Linus Torvalds1da177e2005-04-16 15:20:36 -07001472 &yyss1, yysize * sizeof (*yyssp),
1473 &yyvs1, yysize * sizeof (*yyvsp),
Linus Torvalds1da177e2005-04-16 15:20:36 -07001474 &yystacksize);
1475
1476 yyss = yyss1;
1477 yyvs = yyvs1;
1478 }
1479#else /* no yyoverflow */
1480# ifndef YYSTACK_RELOCATE
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001481 goto yyexhaustedlab;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001482# else
1483 /* Extend the stack our own way. */
1484 if (YYMAXDEPTH <= yystacksize)
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001485 goto yyexhaustedlab;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001486 yystacksize *= 2;
1487 if (YYMAXDEPTH < yystacksize)
1488 yystacksize = YYMAXDEPTH;
1489
1490 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001491 yytype_int16 *yyss1 = yyss;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001492 union yyalloc *yyptr =
1493 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1494 if (! yyptr)
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001495 goto yyexhaustedlab;
Josh Triplett1456edb2009-10-15 11:03:20 -07001496 YYSTACK_RELOCATE (yyss_alloc, yyss);
1497 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001498# undef YYSTACK_RELOCATE
1499 if (yyss1 != yyssa)
1500 YYSTACK_FREE (yyss1);
1501 }
1502# endif
1503#endif /* no yyoverflow */
1504
1505 yyssp = yyss + yysize - 1;
1506 yyvsp = yyvs + yysize - 1;
1507
Linus Torvalds1da177e2005-04-16 15:20:36 -07001508 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1509 (unsigned long int) yystacksize));
1510
1511 if (yyss + yystacksize - 1 <= yyssp)
1512 YYABORT;
1513 }
1514
1515 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1516
Josh Triplett1456edb2009-10-15 11:03:20 -07001517 if (yystate == YYFINAL)
1518 YYACCEPT;
1519
Linus Torvalds1da177e2005-04-16 15:20:36 -07001520 goto yybackup;
1521
1522/*-----------.
1523| yybackup. |
1524`-----------*/
1525yybackup:
1526
Sam Ravnborg14f31562007-09-26 20:15:39 +02001527 /* Do appropriate processing given the current state. Read a
Josh Triplett1456edb2009-10-15 11:03:20 -07001528 lookahead token if we need one and don't already have one. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001529
Josh Triplett1456edb2009-10-15 11:03:20 -07001530 /* First try to decide what to do without reference to lookahead token. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001531 yyn = yypact[yystate];
1532 if (yyn == YYPACT_NINF)
1533 goto yydefault;
1534
Josh Triplett1456edb2009-10-15 11:03:20 -07001535 /* Not known => get a lookahead token if don't already have one. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001536
Josh Triplett1456edb2009-10-15 11:03:20 -07001537 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001538 if (yychar == YYEMPTY)
1539 {
1540 YYDPRINTF ((stderr, "Reading a token: "));
1541 yychar = YYLEX;
1542 }
1543
1544 if (yychar <= YYEOF)
1545 {
1546 yychar = yytoken = YYEOF;
1547 YYDPRINTF ((stderr, "Now at end of input.\n"));
1548 }
1549 else
1550 {
1551 yytoken = YYTRANSLATE (yychar);
Roman Zippel7a884882005-11-08 21:34:51 -08001552 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001553 }
1554
1555 /* If the proper action on seeing token YYTOKEN is to reduce or to
1556 detect an error, take that action. */
1557 yyn += yytoken;
1558 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1559 goto yydefault;
1560 yyn = yytable[yyn];
1561 if (yyn <= 0)
1562 {
1563 if (yyn == 0 || yyn == YYTABLE_NINF)
1564 goto yyerrlab;
1565 yyn = -yyn;
1566 goto yyreduce;
1567 }
1568
Linus Torvalds1da177e2005-04-16 15:20:36 -07001569 /* Count tokens shifted since error; after three, turn off error
1570 status. */
1571 if (yyerrstatus)
1572 yyerrstatus--;
1573
Josh Triplett1456edb2009-10-15 11:03:20 -07001574 /* Shift the lookahead token. */
Sam Ravnborg14f31562007-09-26 20:15:39 +02001575 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1576
Josh Triplett1456edb2009-10-15 11:03:20 -07001577 /* Discard the shifted token. */
1578 yychar = YYEMPTY;
Sam Ravnborg14f31562007-09-26 20:15:39 +02001579
Linus Torvalds1da177e2005-04-16 15:20:36 -07001580 yystate = yyn;
Sam Ravnborg14f31562007-09-26 20:15:39 +02001581 *++yyvsp = yylval;
1582
Linus Torvalds1da177e2005-04-16 15:20:36 -07001583 goto yynewstate;
1584
1585
1586/*-----------------------------------------------------------.
1587| yydefault -- do the default action for the current state. |
1588`-----------------------------------------------------------*/
1589yydefault:
1590 yyn = yydefact[yystate];
1591 if (yyn == 0)
1592 goto yyerrlab;
1593 goto yyreduce;
1594
1595
1596/*-----------------------------.
1597| yyreduce -- Do a reduction. |
1598`-----------------------------*/
1599yyreduce:
1600 /* yyn is the number of a rule to reduce with. */
1601 yylen = yyr2[yyn];
1602
1603 /* If YYLEN is nonzero, implement the default value of the action:
1604 `$$ = $1'.
1605
1606 Otherwise, the following line sets YYVAL to garbage.
1607 This behavior is undocumented and Bison
1608 users should not rely upon it. Assigning to YYVAL
1609 unconditionally makes the parser a bit smaller, and it avoids a
1610 GCC warning that YYVAL may be used uninitialized. */
1611 yyval = yyvsp[1-yylen];
1612
1613
1614 YY_REDUCE_PRINT (yyn);
1615 switch (yyn)
1616 {
1617 case 8:
1618
Roman Zippela02f0572005-11-08 21:34:53 -08001619 { zconf_error("unexpected end statement"); ;}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001620 break;
1621
1622 case 9:
1623
Sam Ravnborg14f31562007-09-26 20:15:39 +02001624 { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001625 break;
1626
1627 case 10:
1628
Roman Zippela02f0572005-11-08 21:34:53 -08001629 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001630 zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
Roman Zippela02f0572005-11-08 21:34:53 -08001631;}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001632 break;
1633
1634 case 11:
1635
Roman Zippela02f0572005-11-08 21:34:53 -08001636 { zconf_error("invalid statement"); ;}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001637 break;
1638
Roman Zippela02f0572005-11-08 21:34:53 -08001639 case 25:
1640
Sam Ravnborg14f31562007-09-26 20:15:39 +02001641 { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;}
Roman Zippela02f0572005-11-08 21:34:53 -08001642 break;
1643
1644 case 26:
1645
1646 { zconf_error("invalid option"); ;}
1647 break;
1648
1649 case 27:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001650
1651 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001652 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001653 sym->flags |= SYMBOL_OPTIONAL;
1654 menu_add_entry(sym);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001655 printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001656;}
1657 break;
1658
Roman Zippela02f0572005-11-08 21:34:53 -08001659 case 28:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001660
1661 {
1662 menu_end_entry();
1663 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1664;}
1665 break;
1666
Roman Zippela02f0572005-11-08 21:34:53 -08001667 case 29:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001668
1669 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001670 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001671 sym->flags |= SYMBOL_OPTIONAL;
1672 menu_add_entry(sym);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001673 printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001674;}
1675 break;
1676
Roman Zippela02f0572005-11-08 21:34:53 -08001677 case 30:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001678
1679 {
1680 if (current_entry->prompt)
1681 current_entry->prompt->type = P_MENU;
1682 else
1683 zconfprint("warning: menuconfig statement without prompt");
1684 menu_end_entry();
1685 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1686;}
1687 break;
1688
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001689 case 38:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001690
1691 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001692 menu_set_type((yyvsp[(1) - (3)].id)->stype);
Roman Zippel3370f9f2005-11-08 21:34:52 -08001693 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1694 zconf_curname(), zconf_lineno(),
Sam Ravnborg14f31562007-09-26 20:15:39 +02001695 (yyvsp[(1) - (3)].id)->stype);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001696;}
1697 break;
1698
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001699 case 39:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001700
1701 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001702 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001703 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1704;}
1705 break;
1706
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001707 case 40:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001708
1709 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001710 menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr));
1711 if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN)
1712 menu_set_type((yyvsp[(1) - (4)].id)->stype);
Roman Zippel3370f9f2005-11-08 21:34:52 -08001713 printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
1714 zconf_curname(), zconf_lineno(),
Sam Ravnborg14f31562007-09-26 20:15:39 +02001715 (yyvsp[(1) - (4)].id)->stype);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001716;}
1717 break;
1718
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001719 case 41:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001720
1721 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001722 menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001723 printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1724;}
1725 break;
1726
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001727 case 42:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001728
1729 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001730 menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001731 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1732;}
1733 break;
1734
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001735 case 45:
1736
1737 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001738 struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001739 if (id && id->flags & TF_OPTION)
Sam Ravnborg14f31562007-09-26 20:15:39 +02001740 menu_add_option(id->token, (yyvsp[(3) - (3)].string));
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001741 else
Sam Ravnborg14f31562007-09-26 20:15:39 +02001742 zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string));
1743 free((yyvsp[(2) - (3)].string));
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001744;}
1745 break;
1746
1747 case 46:
1748
1749 { (yyval.string) = NULL; ;}
1750 break;
1751
1752 case 47:
1753
Sam Ravnborg14f31562007-09-26 20:15:39 +02001754 { (yyval.string) = (yyvsp[(2) - (2)].string); ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001755 break;
1756
1757 case 48:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001758
1759 {
Roman Zippel5a1aa8a2008-02-29 05:11:50 +01001760 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE);
1761 sym->flags |= SYMBOL_AUTO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001762 menu_add_entry(sym);
1763 menu_add_expr(P_CHOICE, NULL, NULL);
1764 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1765;}
1766 break;
1767
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001768 case 49:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001769
1770 {
Roman Zippela02f0572005-11-08 21:34:53 -08001771 (yyval.menu) = menu_add_menu();
Linus Torvalds1da177e2005-04-16 15:20:36 -07001772;}
1773 break;
1774
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001775 case 50:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001776
1777 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001778 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001779 menu_end_menu();
1780 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
1781 }
1782;}
1783 break;
1784
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001785 case 58:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001786
1787 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001788 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001789 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1790;}
1791 break;
1792
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001793 case 59:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001794
1795 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001796 if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) {
1797 menu_set_type((yyvsp[(1) - (3)].id)->stype);
Roman Zippel3370f9f2005-11-08 21:34:52 -08001798 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1799 zconf_curname(), zconf_lineno(),
Sam Ravnborg14f31562007-09-26 20:15:39 +02001800 (yyvsp[(1) - (3)].id)->stype);
Roman Zippel3370f9f2005-11-08 21:34:52 -08001801 } else
1802 YYERROR;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001803;}
1804 break;
1805
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001806 case 60:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001807
1808 {
1809 current_entry->sym->flags |= SYMBOL_OPTIONAL;
1810 printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1811;}
1812 break;
1813
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001814 case 61:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001815
1816 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001817 if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) {
1818 menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
Roman Zippel3370f9f2005-11-08 21:34:52 -08001819 printd(DEBUG_PARSE, "%s:%d:default\n",
1820 zconf_curname(), zconf_lineno());
1821 } else
1822 YYERROR;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001823;}
1824 break;
1825
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001826 case 64:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001827
1828 {
1829 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
1830 menu_add_entry(NULL);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001831 menu_add_dep((yyvsp[(2) - (3)].expr));
Roman Zippela02f0572005-11-08 21:34:53 -08001832 (yyval.menu) = menu_add_menu();
Linus Torvalds1da177e2005-04-16 15:20:36 -07001833;}
1834 break;
1835
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001836 case 65:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001837
1838 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001839 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001840 menu_end_menu();
1841 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
1842 }
1843;}
1844 break;
1845
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001846 case 71:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001847
1848 {
1849 menu_add_entry(NULL);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001850 menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001851 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1852;}
1853 break;
1854
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001855 case 72:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001856
1857 {
Roman Zippela02f0572005-11-08 21:34:53 -08001858 (yyval.menu) = menu_add_menu();
Linus Torvalds1da177e2005-04-16 15:20:36 -07001859;}
1860 break;
1861
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001862 case 73:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001863
1864 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001865 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) {
Roman Zippela02f0572005-11-08 21:34:53 -08001866 menu_end_menu();
1867 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
1868 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07001869;}
1870 break;
1871
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001872 case 79:
Roman Zippela02f0572005-11-08 21:34:53 -08001873
1874 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001875 printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1876 zconf_nextfile((yyvsp[(2) - (3)].string));
Roman Zippela02f0572005-11-08 21:34:53 -08001877;}
1878 break;
1879
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001880 case 80:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001881
1882 {
1883 menu_add_entry(NULL);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001884 menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001885 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1886;}
1887 break;
1888
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001889 case 81:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001890
1891 {
1892 menu_end_entry();
1893;}
1894 break;
1895
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001896 case 82:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001897
1898 {
1899 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
1900 zconf_starthelp();
1901;}
1902 break;
1903
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001904 case 83:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001905
1906 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001907 current_entry->help = (yyvsp[(2) - (2)].string);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001908;}
1909 break;
1910
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001911 case 88:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001912
1913 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001914 menu_add_dep((yyvsp[(3) - (4)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001915 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
1916;}
1917 break;
1918
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001919 case 90:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001920
1921 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001922 menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001923;}
1924 break;
1925
Sam Ravnborg14f31562007-09-26 20:15:39 +02001926 case 93:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001927
Sam Ravnborg14f31562007-09-26 20:15:39 +02001928 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1929 break;
1930
1931 case 94:
1932
1933 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001934 break;
1935
Roman Zippel3370f9f2005-11-08 21:34:52 -08001936 case 95:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001937
Sam Ravnborg14f31562007-09-26 20:15:39 +02001938 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001939 break;
1940
Sam Ravnborg14f31562007-09-26 20:15:39 +02001941 case 98:
Roman Zippela02f0572005-11-08 21:34:53 -08001942
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001943 { (yyval.expr) = NULL; ;}
Roman Zippela02f0572005-11-08 21:34:53 -08001944 break;
1945
Sam Ravnborg14f31562007-09-26 20:15:39 +02001946 case 99:
1947
1948 { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;}
1949 break;
1950
1951 case 100:
1952
1953 { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;}
1954 break;
1955
Roman Zippela02f0572005-11-08 21:34:53 -08001956 case 101:
1957
Sam Ravnborg14f31562007-09-26 20:15:39 +02001958 { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
Roman Zippela02f0572005-11-08 21:34:53 -08001959 break;
1960
1961 case 102:
1962
Sam Ravnborg14f31562007-09-26 20:15:39 +02001963 { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
Roman Zippela02f0572005-11-08 21:34:53 -08001964 break;
1965
1966 case 103:
1967
Sam Ravnborg14f31562007-09-26 20:15:39 +02001968 { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;}
Roman Zippela02f0572005-11-08 21:34:53 -08001969 break;
1970
1971 case 104:
1972
Sam Ravnborg14f31562007-09-26 20:15:39 +02001973 { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001974 break;
1975
1976 case 105:
1977
Sam Ravnborg14f31562007-09-26 20:15:39 +02001978 { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001979 break;
1980
1981 case 106:
1982
Sam Ravnborg14f31562007-09-26 20:15:39 +02001983 { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001984 break;
1985
1986 case 107:
1987
Sam Ravnborg14f31562007-09-26 20:15:39 +02001988 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001989 break;
1990
1991 case 108:
1992
Roman Zippel5a1aa8a2008-02-29 05:11:50 +01001993 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;}
1994 break;
1995
1996 case 109:
1997
1998 { (yyval.string) = NULL; ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001999 break;
2000
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002001
Linus Torvalds1da177e2005-04-16 15:20:36 -07002002
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002003 default: break;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002004 }
Sam Ravnborg14f31562007-09-26 20:15:39 +02002005 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002006
Sam Ravnborg14f31562007-09-26 20:15:39 +02002007 YYPOPSTACK (yylen);
2008 yylen = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002009 YY_STACK_PRINT (yyss, yyssp);
2010
2011 *++yyvsp = yyval;
2012
Linus Torvalds1da177e2005-04-16 15:20:36 -07002013 /* Now `shift' the result of the reduction. Determine what state
2014 that goes to, based on the state we popped back to and the rule
2015 number reduced by. */
2016
2017 yyn = yyr1[yyn];
2018
2019 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2020 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2021 yystate = yytable[yystate];
2022 else
2023 yystate = yydefgoto[yyn - YYNTOKENS];
2024
2025 goto yynewstate;
2026
2027
2028/*------------------------------------.
2029| yyerrlab -- here on detecting error |
2030`------------------------------------*/
2031yyerrlab:
2032 /* If not already recovering from an error, report this error. */
2033 if (!yyerrstatus)
2034 {
2035 ++yynerrs;
Sam Ravnborg14f31562007-09-26 20:15:39 +02002036#if ! YYERROR_VERBOSE
2037 yyerror (YY_("syntax error"));
2038#else
2039 {
2040 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2041 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2042 {
2043 YYSIZE_T yyalloc = 2 * yysize;
2044 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2045 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2046 if (yymsg != yymsgbuf)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002047 YYSTACK_FREE (yymsg);
Sam Ravnborg14f31562007-09-26 20:15:39 +02002048 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2049 if (yymsg)
2050 yymsg_alloc = yyalloc;
2051 else
2052 {
2053 yymsg = yymsgbuf;
2054 yymsg_alloc = sizeof yymsgbuf;
2055 }
2056 }
2057
2058 if (0 < yysize && yysize <= yymsg_alloc)
2059 {
2060 (void) yysyntax_error (yymsg, yystate, yychar);
2061 yyerror (yymsg);
2062 }
2063 else
2064 {
2065 yyerror (YY_("syntax error"));
2066 if (yysize != 0)
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002067 goto yyexhaustedlab;
Sam Ravnborg14f31562007-09-26 20:15:39 +02002068 }
2069 }
2070#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07002071 }
2072
2073
2074
2075 if (yyerrstatus == 3)
2076 {
Josh Triplett1456edb2009-10-15 11:03:20 -07002077 /* If just tried and failed to reuse lookahead token after an
Linus Torvalds1da177e2005-04-16 15:20:36 -07002078 error, discard it. */
2079
Roman Zippel7a884882005-11-08 21:34:51 -08002080 if (yychar <= YYEOF)
Sam Ravnborg14f31562007-09-26 20:15:39 +02002081 {
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002082 /* Return failure if at end of input. */
Roman Zippel7a884882005-11-08 21:34:51 -08002083 if (yychar == YYEOF)
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002084 YYABORT;
Sam Ravnborg14f31562007-09-26 20:15:39 +02002085 }
Roman Zippel7a884882005-11-08 21:34:51 -08002086 else
2087 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02002088 yydestruct ("Error: discarding",
2089 yytoken, &yylval);
Roman Zippel7a884882005-11-08 21:34:51 -08002090 yychar = YYEMPTY;
2091 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07002092 }
2093
Josh Triplett1456edb2009-10-15 11:03:20 -07002094 /* Else will try to reuse lookahead token after shifting the error
Linus Torvalds1da177e2005-04-16 15:20:36 -07002095 token. */
2096 goto yyerrlab1;
2097
2098
Roman Zippel7a884882005-11-08 21:34:51 -08002099/*---------------------------------------------------.
2100| yyerrorlab -- error raised explicitly by YYERROR. |
2101`---------------------------------------------------*/
2102yyerrorlab:
2103
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002104 /* Pacify compilers like GCC when the user code never invokes
2105 YYERROR and the label yyerrorlab therefore never appears in user
2106 code. */
Sam Ravnborg14f31562007-09-26 20:15:39 +02002107 if (/*CONSTCOND*/ 0)
Roman Zippel7a884882005-11-08 21:34:51 -08002108 goto yyerrorlab;
Roman Zippel7a884882005-11-08 21:34:51 -08002109
Sam Ravnborg14f31562007-09-26 20:15:39 +02002110 /* Do not reclaim the symbols of the rule which action triggered
2111 this YYERROR. */
2112 YYPOPSTACK (yylen);
2113 yylen = 0;
2114 YY_STACK_PRINT (yyss, yyssp);
Roman Zippel7a884882005-11-08 21:34:51 -08002115 yystate = *yyssp;
2116 goto yyerrlab1;
2117
2118
2119/*-------------------------------------------------------------.
2120| yyerrlab1 -- common code for both syntax error and YYERROR. |
2121`-------------------------------------------------------------*/
Linus Torvalds1da177e2005-04-16 15:20:36 -07002122yyerrlab1:
2123 yyerrstatus = 3; /* Each real token shifted decrements this. */
2124
2125 for (;;)
2126 {
2127 yyn = yypact[yystate];
2128 if (yyn != YYPACT_NINF)
2129 {
2130 yyn += YYTERROR;
2131 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2132 {
2133 yyn = yytable[yyn];
2134 if (0 < yyn)
2135 break;
2136 }
2137 }
2138
2139 /* Pop the current state because it cannot handle the error token. */
2140 if (yyssp == yyss)
2141 YYABORT;
2142
Linus Torvalds1da177e2005-04-16 15:20:36 -07002143
Sam Ravnborg14f31562007-09-26 20:15:39 +02002144 yydestruct ("Error: popping",
2145 yystos[yystate], yyvsp);
2146 YYPOPSTACK (1);
Roman Zippel7a884882005-11-08 21:34:51 -08002147 yystate = *yyssp;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002148 YY_STACK_PRINT (yyss, yyssp);
2149 }
2150
Linus Torvalds1da177e2005-04-16 15:20:36 -07002151 *++yyvsp = yylval;
2152
2153
Sam Ravnborg14f31562007-09-26 20:15:39 +02002154 /* Shift the error token. */
Roman Zippel7a884882005-11-08 21:34:51 -08002155 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2156
Linus Torvalds1da177e2005-04-16 15:20:36 -07002157 yystate = yyn;
2158 goto yynewstate;
2159
2160
2161/*-------------------------------------.
2162| yyacceptlab -- YYACCEPT comes here. |
2163`-------------------------------------*/
2164yyacceptlab:
2165 yyresult = 0;
2166 goto yyreturn;
2167
2168/*-----------------------------------.
2169| yyabortlab -- YYABORT comes here. |
2170`-----------------------------------*/
2171yyabortlab:
2172 yyresult = 1;
2173 goto yyreturn;
2174
Josh Triplett1456edb2009-10-15 11:03:20 -07002175#if !defined(yyoverflow) || YYERROR_VERBOSE
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002176/*-------------------------------------------------.
2177| yyexhaustedlab -- memory exhaustion comes here. |
2178`-------------------------------------------------*/
2179yyexhaustedlab:
2180 yyerror (YY_("memory exhausted"));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002181 yyresult = 2;
2182 /* Fall through. */
2183#endif
2184
2185yyreturn:
Josh Triplett1456edb2009-10-15 11:03:20 -07002186 if (yychar != YYEMPTY)
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002187 yydestruct ("Cleanup: discarding lookahead",
2188 yytoken, &yylval);
Sam Ravnborg14f31562007-09-26 20:15:39 +02002189 /* Do not reclaim the symbols of the rule which action triggered
2190 this YYABORT or YYACCEPT. */
2191 YYPOPSTACK (yylen);
2192 YY_STACK_PRINT (yyss, yyssp);
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002193 while (yyssp != yyss)
2194 {
2195 yydestruct ("Cleanup: popping",
2196 yystos[*yyssp], yyvsp);
Sam Ravnborg14f31562007-09-26 20:15:39 +02002197 YYPOPSTACK (1);
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002198 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07002199#ifndef yyoverflow
2200 if (yyss != yyssa)
2201 YYSTACK_FREE (yyss);
2202#endif
Sam Ravnborg14f31562007-09-26 20:15:39 +02002203#if YYERROR_VERBOSE
2204 if (yymsg != yymsgbuf)
2205 YYSTACK_FREE (yymsg);
2206#endif
2207 /* Make sure YYID is used. */
2208 return YYID (yyresult);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002209}
2210
2211
2212
2213
2214
2215void conf_parse(const char *name)
2216{
2217 struct symbol *sym;
2218 int i;
2219
2220 zconf_initscan(name);
2221
2222 sym_init();
2223 menu_init();
Roman Zippelface4372006-06-08 22:12:45 -07002224 modules_sym = sym_lookup(NULL, 0);
2225 modules_sym->type = S_BOOLEAN;
2226 modules_sym->flags |= SYMBOL_AUTO;
blaisorblade@yahoo.itfb7f6ff2005-07-28 17:56:25 +02002227 rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002228
Roman Zippela02f0572005-11-08 21:34:53 -08002229#if YYDEBUG
2230 if (getenv("ZCONF_DEBUG"))
2231 zconfdebug = 1;
2232#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07002233 zconfparse();
2234 if (zconfnerrs)
2235 exit(1);
Roman Zippelface4372006-06-08 22:12:45 -07002236 if (!modules_sym->prop) {
2237 struct property *prop;
2238
2239 prop = prop_alloc(P_DEFAULT, modules_sym);
2240 prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
2241 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07002242 menu_finalize(&rootmenu);
2243 for_all_symbols(i, sym) {
Sam Ravnborg5447d342007-05-06 09:20:10 +02002244 if (sym_check_deps(sym))
2245 zconfnerrs++;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002246 }
Sam Ravnborg5447d342007-05-06 09:20:10 +02002247 if (zconfnerrs)
2248 exit(1);
Karsten Wiesebfc10002006-12-13 00:34:07 -08002249 sym_set_change_count(1);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002250}
2251
2252const char *zconf_tokenname(int token)
2253{
2254 switch (token) {
2255 case T_MENU: return "menu";
2256 case T_ENDMENU: return "endmenu";
2257 case T_CHOICE: return "choice";
2258 case T_ENDCHOICE: return "endchoice";
2259 case T_IF: return "if";
2260 case T_ENDIF: return "endif";
Roman Zippela02f0572005-11-08 21:34:53 -08002261 case T_DEPENDS: return "depends";
Linus Torvalds1da177e2005-04-16 15:20:36 -07002262 }
2263 return "<token>";
2264}
2265
Roman Zippela02f0572005-11-08 21:34:53 -08002266static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002267{
Roman Zippela02f0572005-11-08 21:34:53 -08002268 if (id->token != endtoken) {
2269 zconf_error("unexpected '%s' within %s block",
2270 kconf_id_strings + id->name, zconf_tokenname(starttoken));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002271 zconfnerrs++;
2272 return false;
2273 }
2274 if (current_menu->file != current_file) {
Roman Zippela02f0572005-11-08 21:34:53 -08002275 zconf_error("'%s' in different file than '%s'",
2276 kconf_id_strings + id->name, zconf_tokenname(starttoken));
2277 fprintf(stderr, "%s:%d: location of the '%s'\n",
2278 current_menu->file->name, current_menu->lineno,
2279 zconf_tokenname(starttoken));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002280 zconfnerrs++;
2281 return false;
2282 }
2283 return true;
2284}
2285
2286static void zconfprint(const char *err, ...)
2287{
2288 va_list ap;
2289
Roman Zippela02f0572005-11-08 21:34:53 -08002290 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
2291 va_start(ap, err);
2292 vfprintf(stderr, err, ap);
2293 va_end(ap);
2294 fprintf(stderr, "\n");
2295}
2296
2297static void zconf_error(const char *err, ...)
2298{
2299 va_list ap;
2300
2301 zconfnerrs++;
2302 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
Linus Torvalds1da177e2005-04-16 15:20:36 -07002303 va_start(ap, err);
2304 vfprintf(stderr, err, ap);
2305 va_end(ap);
2306 fprintf(stderr, "\n");
2307}
2308
2309static void zconferror(const char *err)
2310{
Roman Zippela02f0572005-11-08 21:34:53 -08002311#if YYDEBUG
Linus Torvalds1da177e2005-04-16 15:20:36 -07002312 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
Roman Zippela02f0572005-11-08 21:34:53 -08002313#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07002314}
2315
2316void print_quoted_string(FILE *out, const char *str)
2317{
2318 const char *p;
2319 int len;
2320
2321 putc('"', out);
2322 while ((p = strchr(str, '"'))) {
2323 len = p - str;
2324 if (len)
2325 fprintf(out, "%.*s", len, str);
2326 fputs("\\\"", out);
2327 str = p + 1;
2328 }
2329 fputs(str, out);
2330 putc('"', out);
2331}
2332
2333void print_symbol(FILE *out, struct menu *menu)
2334{
2335 struct symbol *sym = menu->sym;
2336 struct property *prop;
2337
2338 if (sym_is_choice(sym))
2339 fprintf(out, "choice\n");
2340 else
2341 fprintf(out, "config %s\n", sym->name);
2342 switch (sym->type) {
2343 case S_BOOLEAN:
2344 fputs(" boolean\n", out);
2345 break;
2346 case S_TRISTATE:
2347 fputs(" tristate\n", out);
2348 break;
2349 case S_STRING:
2350 fputs(" string\n", out);
2351 break;
2352 case S_INT:
2353 fputs(" integer\n", out);
2354 break;
2355 case S_HEX:
2356 fputs(" hex\n", out);
2357 break;
2358 default:
2359 fputs(" ???\n", out);
2360 break;
2361 }
2362 for (prop = sym->prop; prop; prop = prop->next) {
2363 if (prop->menu != menu)
2364 continue;
2365 switch (prop->type) {
2366 case P_PROMPT:
2367 fputs(" prompt ", out);
2368 print_quoted_string(out, prop->text);
2369 if (!expr_is_yes(prop->visible.expr)) {
2370 fputs(" if ", out);
2371 expr_fprint(prop->visible.expr, out);
2372 }
2373 fputc('\n', out);
2374 break;
2375 case P_DEFAULT:
2376 fputs( " default ", out);
2377 expr_fprint(prop->expr, out);
2378 if (!expr_is_yes(prop->visible.expr)) {
2379 fputs(" if ", out);
2380 expr_fprint(prop->visible.expr, out);
2381 }
2382 fputc('\n', out);
2383 break;
2384 case P_CHOICE:
2385 fputs(" #choice value\n", out);
2386 break;
2387 default:
2388 fprintf(out, " unknown prop %d!\n", prop->type);
2389 break;
2390 }
2391 }
Sam Ravnborg03d29122007-07-21 00:00:36 +02002392 if (menu->help) {
2393 int len = strlen(menu->help);
2394 while (menu->help[--len] == '\n')
2395 menu->help[len] = 0;
2396 fprintf(out, " help\n%s\n", menu->help);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002397 }
2398 fputc('\n', out);
2399}
2400
2401void zconfdump(FILE *out)
2402{
2403 struct property *prop;
2404 struct symbol *sym;
2405 struct menu *menu;
2406
2407 menu = rootmenu.list;
2408 while (menu) {
2409 if ((sym = menu->sym))
2410 print_symbol(out, menu);
2411 else if ((prop = menu->prompt)) {
2412 switch (prop->type) {
2413 case P_COMMENT:
2414 fputs("\ncomment ", out);
2415 print_quoted_string(out, prop->text);
2416 fputs("\n", out);
2417 break;
2418 case P_MENU:
2419 fputs("\nmenu ", out);
2420 print_quoted_string(out, prop->text);
2421 fputs("\n", out);
2422 break;
2423 default:
2424 ;
2425 }
2426 if (!expr_is_yes(prop->visible.expr)) {
2427 fputs(" depends ", out);
2428 expr_fprint(prop->visible.expr, out);
2429 fputc('\n', out);
2430 }
2431 fputs("\n", out);
2432 }
2433
2434 if (menu->list)
2435 menu = menu->list;
2436 else if (menu->next)
2437 menu = menu->next;
2438 else while ((menu = menu->parent)) {
2439 if (menu->prompt && menu->prompt->type == P_MENU)
2440 fputs("\nendmenu\n", out);
2441 if (menu->next) {
2442 menu = menu->next;
2443 break;
2444 }
2445 }
2446 }
2447}
2448
2449#include "lex.zconf.c"
2450#include "util.c"
2451#include "confdata.c"
2452#include "expr.c"
2453#include "symbol.c"
2454#include "menu.c"
2455