blob: 699d4b2651865cdb218951e211a131cda69020fc [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
Andi Kleene66f25d2010-01-13 17:02:44 +0100107struct symbol *symbol_hash[SYMBOL_HASHSIZE];
Josh Triplett1456edb2009-10-15 11:03:20 -0700108
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. */
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400420#define YYFINAL 11
Linus Torvalds1da177e2005-04-16 15:20:36 -0700421/* YYLAST -- Last index in YYTABLE. */
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400422#define YYLAST 277
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. */
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400427#define YYNNTS 48
Sam Ravnborg14f31562007-09-26 20:15:39 +0200428/* YYNRULES -- Number of rules. */
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400429#define YYNRULES 113
Sam Ravnborg14f31562007-09-26 20:15:39 +0200430/* YYNRULES -- Number of states. */
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400431#define YYNSTATES 185
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{
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400479 0, 0, 3, 6, 8, 11, 13, 14, 17, 20,
480 23, 26, 31, 36, 40, 42, 44, 46, 48, 50,
481 52, 54, 56, 58, 60, 62, 64, 66, 70, 73,
482 77, 80, 84, 87, 88, 91, 94, 97, 100, 103,
483 106, 110, 115, 120, 125, 131, 135, 136, 140, 141,
484 144, 148, 151, 153, 157, 158, 161, 164, 167, 170,
485 173, 178, 182, 185, 190, 191, 194, 198, 200, 204,
486 205, 208, 211, 214, 218, 222, 225, 227, 231, 232,
487 235, 238, 241, 245, 249, 252, 255, 258, 259, 262,
488 265, 268, 273, 274, 277, 279, 281, 284, 287, 290,
489 292, 295, 296, 299, 301, 305, 309, 313, 316, 320,
490 324, 326, 328, 329
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{
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400496 36, 0, -1, 78, 37, -1, 37, -1, 62, 38,
497 -1, 38, -1, -1, 38, 40, -1, 38, 54, -1,
498 38, 66, -1, 38, 77, -1, 38, 25, 1, 30,
499 -1, 38, 39, 1, 30, -1, 38, 1, 30, -1,
500 16, -1, 18, -1, 19, -1, 21, -1, 17, -1,
501 22, -1, 20, -1, 30, -1, 60, -1, 70, -1,
502 43, -1, 45, -1, 68, -1, 25, 1, 30, -1,
503 1, 30, -1, 10, 25, 30, -1, 42, 46, -1,
504 11, 25, 30, -1, 44, 46, -1, -1, 46, 47,
505 -1, 46, 48, -1, 46, 74, -1, 46, 72, -1,
506 46, 41, -1, 46, 30, -1, 19, 75, 30, -1,
507 18, 76, 79, 30, -1, 20, 80, 79, 30, -1,
508 21, 25, 79, 30, -1, 22, 81, 81, 79, 30,
509 -1, 23, 49, 30, -1, -1, 49, 25, 50, -1,
510 -1, 33, 76, -1, 7, 82, 30, -1, 51, 55,
511 -1, 77, -1, 52, 57, 53, -1, -1, 55, 56,
512 -1, 55, 74, -1, 55, 72, -1, 55, 30, -1,
513 55, 41, -1, 18, 76, 79, 30, -1, 19, 75,
514 30, -1, 17, 30, -1, 20, 25, 79, 30, -1,
515 -1, 57, 40, -1, 14, 80, 78, -1, 77, -1,
516 58, 61, 59, -1, -1, 61, 40, -1, 61, 66,
517 -1, 61, 54, -1, 3, 76, 78, -1, 4, 76,
518 30, -1, 63, 73, -1, 77, -1, 64, 67, 65,
519 -1, -1, 67, 40, -1, 67, 66, -1, 67, 54,
520 -1, 6, 76, 30, -1, 9, 76, 30, -1, 69,
521 73, -1, 12, 30, -1, 71, 13, -1, -1, 73,
522 74, -1, 73, 30, -1, 73, 41, -1, 16, 24,
523 80, 30, -1, -1, 76, 79, -1, 25, -1, 26,
524 -1, 5, 30, -1, 8, 30, -1, 15, 30, -1,
525 30, -1, 78, 30, -1, -1, 14, 80, -1, 81,
526 -1, 81, 33, 81, -1, 81, 27, 81, -1, 29,
527 80, 28, -1, 34, 80, -1, 80, 31, 80, -1,
528 80, 32, 80, -1, 25, -1, 26, -1, -1, 25,
529 -1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700530};
531
532/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200533static const yytype_uint16 yyrline[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700534{
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400535 0, 107, 107, 107, 109, 109, 111, 113, 114, 115,
536 116, 117, 118, 122, 126, 126, 126, 126, 126, 126,
537 126, 130, 131, 132, 133, 134, 135, 139, 140, 146,
538 154, 160, 168, 178, 180, 181, 182, 183, 184, 185,
539 188, 196, 202, 212, 218, 224, 227, 229, 240, 241,
540 246, 255, 260, 268, 271, 273, 274, 275, 276, 277,
541 280, 286, 297, 303, 313, 315, 320, 328, 336, 339,
542 341, 342, 343, 348, 355, 362, 367, 375, 378, 380,
543 381, 382, 385, 393, 400, 407, 413, 420, 422, 423,
544 424, 427, 435, 437, 442, 443, 446, 447, 448, 452,
545 453, 456, 457, 460, 461, 462, 463, 464, 465, 466,
546 469, 470, 473, 474
Linus Torvalds1da177e2005-04-16 15:20:36 -0700547};
548#endif
549
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700550#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
551/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
Sam Ravnborg14f31562007-09-26 20:15:39 +0200552 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700553static const char *const yytname[] =
554{
Roman Zippel7a884882005-11-08 21:34:51 -0800555 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
556 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
557 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
Sam Ravnborg14f31562007-09-26 20:15:39 +0200558 "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE",
559 "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
560 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400561 "T_NOT", "$accept", "input", "start", "stmt_list", "option_name",
562 "common_stmt", "option_error", "config_entry_start", "config_stmt",
Roman Zippela02f0572005-11-08 21:34:53 -0800563 "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700564 "config_option", "symbol_option", "symbol_option_list",
565 "symbol_option_arg", "choice", "choice_entry", "choice_end",
566 "choice_stmt", "choice_option_list", "choice_option", "choice_block",
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400567 "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu",
568 "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt",
569 "comment", "comment_stmt", "help_start", "help", "depends_list",
570 "depends", "prompt_stmt_opt", "prompt", "end", "nl", "if_expr", "expr",
571 "symbol", "word_opt", 0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700572};
573#endif
574
575# ifdef YYPRINT
576/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
577 token YYLEX-NUM. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200578static const yytype_uint16 yytoknum[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700579{
580 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
581 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
582 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
Sam Ravnborg14f31562007-09-26 20:15:39 +0200583 285, 286, 287, 288, 289
Linus Torvalds1da177e2005-04-16 15:20:36 -0700584};
585# endif
586
587/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200588static const yytype_uint8 yyr1[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700589{
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400590 0, 35, 36, 36, 37, 37, 38, 38, 38, 38,
591 38, 38, 38, 38, 39, 39, 39, 39, 39, 39,
592 39, 40, 40, 40, 40, 40, 40, 41, 41, 42,
593 43, 44, 45, 46, 46, 46, 46, 46, 46, 46,
594 47, 47, 47, 47, 47, 48, 49, 49, 50, 50,
595 51, 52, 53, 54, 55, 55, 55, 55, 55, 55,
596 56, 56, 56, 56, 57, 57, 58, 59, 60, 61,
597 61, 61, 61, 62, 63, 64, 65, 66, 67, 67,
598 67, 67, 68, 69, 70, 71, 72, 73, 73, 73,
599 73, 74, 75, 75, 76, 76, 77, 77, 77, 78,
600 78, 79, 79, 80, 80, 80, 80, 80, 80, 80,
601 81, 81, 82, 82
Linus Torvalds1da177e2005-04-16 15:20:36 -0700602};
603
604/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200605static const yytype_uint8 yyr2[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700606{
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400607 0, 2, 2, 1, 2, 1, 0, 2, 2, 2,
608 2, 4, 4, 3, 1, 1, 1, 1, 1, 1,
609 1, 1, 1, 1, 1, 1, 1, 3, 2, 3,
610 2, 3, 2, 0, 2, 2, 2, 2, 2, 2,
611 3, 4, 4, 4, 5, 3, 0, 3, 0, 2,
612 3, 2, 1, 3, 0, 2, 2, 2, 2, 2,
613 4, 3, 2, 4, 0, 2, 3, 1, 3, 0,
614 2, 2, 2, 3, 3, 2, 1, 3, 0, 2,
615 2, 2, 3, 3, 2, 2, 2, 0, 2, 2,
616 2, 4, 0, 2, 1, 1, 2, 2, 2, 1,
617 2, 0, 2, 1, 3, 3, 3, 2, 3, 3,
618 1, 1, 0, 1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700619};
620
621/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
622 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
623 means the default is an error. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200624static const yytype_uint8 yydefact[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700625{
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400626 6, 0, 99, 0, 3, 0, 6, 6, 94, 95,
627 0, 1, 0, 0, 0, 0, 112, 0, 0, 0,
628 0, 0, 0, 14, 18, 15, 16, 20, 17, 19,
629 0, 21, 0, 7, 33, 24, 33, 25, 54, 64,
630 8, 69, 22, 87, 78, 9, 26, 87, 23, 10,
631 0, 100, 2, 73, 13, 0, 96, 0, 113, 0,
632 97, 0, 0, 0, 110, 111, 0, 0, 0, 103,
633 98, 0, 0, 0, 0, 0, 0, 0, 0, 0,
634 0, 74, 82, 50, 83, 29, 31, 0, 107, 0,
635 0, 66, 0, 0, 11, 12, 0, 0, 0, 0,
636 92, 0, 0, 0, 46, 0, 39, 38, 34, 35,
637 0, 37, 36, 0, 0, 92, 0, 58, 59, 55,
638 57, 56, 65, 53, 52, 70, 72, 68, 71, 67,
639 89, 90, 88, 79, 81, 77, 80, 76, 106, 108,
640 109, 105, 104, 28, 85, 0, 101, 0, 101, 101,
641 101, 0, 0, 0, 86, 62, 101, 0, 101, 0,
642 0, 0, 40, 93, 0, 0, 101, 48, 45, 27,
643 0, 61, 0, 91, 102, 41, 42, 43, 0, 0,
644 47, 60, 63, 44, 49
Linus Torvalds1da177e2005-04-16 15:20:36 -0700645};
646
Sam Ravnborg14f31562007-09-26 20:15:39 +0200647/* YYDEFGOTO[NTERM-NUM]. */
648static const yytype_int16 yydefgoto[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700649{
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400650 -1, 3, 4, 5, 32, 33, 107, 34, 35, 36,
651 37, 73, 108, 109, 152, 180, 38, 39, 123, 40,
652 75, 119, 76, 41, 127, 42, 77, 6, 43, 44,
653 135, 45, 79, 46, 47, 48, 110, 111, 78, 112,
654 147, 148, 49, 7, 161, 68, 69, 59
Linus Torvalds1da177e2005-04-16 15:20:36 -0700655};
656
657/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
658 STATE-NUM. */
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400659#define YYPACT_NINF -89
Sam Ravnborg14f31562007-09-26 20:15:39 +0200660static const yytype_int16 yypact[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700661{
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400662 3, 4, -89, 20, -89, 100, -89, 7, -89, -89,
663 -8, -89, 17, 4, 28, 4, 37, 36, 4, 68,
664 87, -18, 69, -89, -89, -89, -89, -89, -89, -89,
665 128, -89, 138, -89, -89, -89, -89, -89, -89, -89,
666 -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
667 127, -89, -89, 110, -89, 126, -89, 136, -89, 137,
668 -89, 147, 150, 152, -89, -89, -18, -18, 171, -14,
669 -89, 153, 157, 34, 67, 180, 233, 220, 207, 220,
670 154, -89, -89, -89, -89, -89, -89, 0, -89, -18,
671 -18, 110, 44, 44, -89, -89, 163, 174, 182, 4,
672 4, -18, 194, 44, -89, 219, -89, -89, -89, -89,
673 223, -89, -89, 203, 4, 4, 215, -89, -89, -89,
674 -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
675 -89, -89, -89, -89, -89, -89, -89, -89, -89, 213,
676 -89, -89, -89, -89, -89, -18, 232, 227, 232, -5,
677 232, 44, 35, 234, -89, -89, 232, 235, 232, 224,
678 -18, 236, -89, -89, 237, 238, 232, 216, -89, -89,
679 240, -89, 241, -89, 71, -89, -89, -89, 242, 4,
680 -89, -89, -89, -89, -89
Linus Torvalds1da177e2005-04-16 15:20:36 -0700681};
682
683/* YYPGOTO[NTERM-NUM]. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200684static const yytype_int16 yypgoto[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700685{
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400686 -89, -89, 255, 267, -89, 47, -57, -89, -89, -89,
687 -89, 239, -89, -89, -89, -89, -89, -89, -89, 130,
688 -89, -89, -89, -89, -89, -89, -89, -89, -89, -89,
689 -89, 181, -89, -89, -89, -89, -89, 199, 229, 16,
690 162, -1, 74, -7, 103, -65, -88, -89
Linus Torvalds1da177e2005-04-16 15:20:36 -0700691};
692
693/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
694 positive, shift that token. If negative, reduce the rule which
695 number is the opposite. If zero, do what YYDEFACT says.
696 If YYTABLE_NINF, syntax error. */
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400697#define YYTABLE_NINF -85
Sam Ravnborg14f31562007-09-26 20:15:39 +0200698static const yytype_int16 yytable[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700699{
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400700 10, 87, 88, 53, 141, 142, 1, 64, 65, 160,
701 1, 66, 55, 92, 57, 151, 67, 61, 118, 93,
702 11, 131, 2, 131, 139, 140, 89, 90, 138, 8,
703 9, 89, 90, 2, -30, 96, 149, 51, -30, -30,
704 -30, -30, -30, -30, -30, -30, 97, 54, -30, -30,
705 98, -30, 99, 100, 101, 102, 103, 104, 56, 105,
706 167, 91, 58, 166, 106, 168, 60, -32, 96, 64,
707 65, -32, -32, -32, -32, -32, -32, -32, -32, 97,
708 159, -32, -32, 98, -32, 99, 100, 101, 102, 103,
709 104, 121, 105, 62, 132, 174, 132, 106, 146, 70,
710 -5, 12, 89, 90, 13, 14, 15, 16, 17, 18,
711 19, 20, 63, 156, 21, 22, 23, 24, 25, 26,
712 27, 28, 29, 122, 125, 30, 133, -4, 12, 71,
713 31, 13, 14, 15, 16, 17, 18, 19, 20, 72,
714 51, 21, 22, 23, 24, 25, 26, 27, 28, 29,
715 124, 129, 30, 137, -84, 96, 81, 31, -84, -84,
716 -84, -84, -84, -84, -84, -84, 82, 83, -84, -84,
717 98, -84, -84, -84, -84, -84, -84, 84, 184, 105,
718 85, 96, 86, 94, 130, -51, -51, 95, -51, -51,
719 -51, -51, 97, 143, -51, -51, 98, 113, 114, 115,
720 116, 2, 89, 90, 144, 105, 145, 126, 96, 134,
721 117, -75, -75, -75, -75, -75, -75, -75, -75, 150,
722 153, -75, -75, 98, 13, 14, 15, 16, 17, 18,
723 19, 20, 105, 155, 21, 22, 154, 130, 14, 15,
724 158, 17, 18, 19, 20, 90, 160, 21, 22, 179,
725 31, 163, 164, 165, 173, 89, 90, 162, 128, 170,
726 136, 172, 52, 31, 169, 171, 175, 176, 177, 178,
727 181, 182, 183, 50, 120, 74, 80, 157
Linus Torvalds1da177e2005-04-16 15:20:36 -0700728};
729
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400730static const yytype_uint8 yycheck[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700731{
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400732 1, 66, 67, 10, 92, 93, 3, 25, 26, 14,
733 3, 29, 13, 27, 15, 103, 34, 18, 75, 33,
734 0, 78, 30, 80, 89, 90, 31, 32, 28, 25,
735 26, 31, 32, 30, 0, 1, 101, 30, 4, 5,
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100736 6, 7, 8, 9, 10, 11, 12, 30, 14, 15,
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400737 16, 17, 18, 19, 20, 21, 22, 23, 30, 25,
738 25, 68, 25, 151, 30, 30, 30, 0, 1, 25,
739 26, 4, 5, 6, 7, 8, 9, 10, 11, 12,
740 145, 14, 15, 16, 17, 18, 19, 20, 21, 22,
741 23, 75, 25, 25, 78, 160, 80, 30, 99, 30,
742 0, 1, 31, 32, 4, 5, 6, 7, 8, 9,
743 10, 11, 25, 114, 14, 15, 16, 17, 18, 19,
744 20, 21, 22, 76, 77, 25, 79, 0, 1, 1,
745 30, 4, 5, 6, 7, 8, 9, 10, 11, 1,
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100746 30, 14, 15, 16, 17, 18, 19, 20, 21, 22,
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400747 76, 77, 25, 79, 0, 1, 30, 30, 4, 5,
Roman Zippel5a1aa8a2008-02-29 05:11:50 +0100748 6, 7, 8, 9, 10, 11, 30, 30, 14, 15,
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400749 16, 17, 18, 19, 20, 21, 22, 30, 179, 25,
750 30, 1, 30, 30, 30, 5, 6, 30, 8, 9,
751 10, 11, 12, 30, 14, 15, 16, 17, 18, 19,
752 20, 30, 31, 32, 30, 25, 24, 77, 1, 79,
753 30, 4, 5, 6, 7, 8, 9, 10, 11, 25,
754 1, 14, 15, 16, 4, 5, 6, 7, 8, 9,
755 10, 11, 25, 30, 14, 15, 13, 30, 5, 6,
756 25, 8, 9, 10, 11, 32, 14, 14, 15, 33,
757 30, 148, 149, 150, 30, 31, 32, 30, 77, 156,
758 79, 158, 7, 30, 30, 30, 30, 30, 30, 166,
759 30, 30, 30, 6, 75, 36, 47, 115
Linus Torvalds1da177e2005-04-16 15:20:36 -0700760};
761
762/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
763 symbol of state STATE-NUM. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200764static const yytype_uint8 yystos[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700765{
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400766 0, 3, 30, 36, 37, 38, 62, 78, 25, 26,
767 76, 0, 1, 4, 5, 6, 7, 8, 9, 10,
768 11, 14, 15, 16, 17, 18, 19, 20, 21, 22,
769 25, 30, 39, 40, 42, 43, 44, 45, 51, 52,
770 54, 58, 60, 63, 64, 66, 68, 69, 70, 77,
771 38, 30, 37, 78, 30, 76, 30, 76, 25, 82,
772 30, 76, 25, 25, 25, 26, 29, 34, 80, 81,
773 30, 1, 1, 46, 46, 55, 57, 61, 73, 67,
774 73, 30, 30, 30, 30, 30, 30, 80, 80, 31,
775 32, 78, 27, 33, 30, 30, 1, 12, 16, 18,
776 19, 20, 21, 22, 23, 25, 30, 41, 47, 48,
777 71, 72, 74, 17, 18, 19, 20, 30, 41, 56,
778 72, 74, 40, 53, 77, 40, 54, 59, 66, 77,
779 30, 41, 74, 40, 54, 65, 66, 77, 28, 80,
780 80, 81, 81, 30, 30, 24, 76, 75, 76, 80,
781 25, 81, 49, 1, 13, 30, 76, 75, 25, 80,
782 14, 79, 30, 79, 79, 79, 81, 25, 30, 30,
783 79, 30, 79, 30, 80, 30, 30, 30, 79, 33,
784 50, 30, 30, 30, 76
Linus Torvalds1da177e2005-04-16 15:20:36 -0700785};
786
Linus Torvalds1da177e2005-04-16 15:20:36 -0700787#define yyerrok (yyerrstatus = 0)
788#define yyclearin (yychar = YYEMPTY)
789#define YYEMPTY (-2)
790#define YYEOF 0
791
792#define YYACCEPT goto yyacceptlab
793#define YYABORT goto yyabortlab
Roman Zippel7a884882005-11-08 21:34:51 -0800794#define YYERROR goto yyerrorlab
Linus Torvalds1da177e2005-04-16 15:20:36 -0700795
796
797/* Like YYERROR except do call yyerror. This remains here temporarily
798 to ease the transition to the new meaning of YYERROR, for GCC.
799 Once GCC version 2 has supplanted version 1, this can go. */
800
801#define YYFAIL goto yyerrlab
802
803#define YYRECOVERING() (!!yyerrstatus)
804
805#define YYBACKUP(Token, Value) \
806do \
807 if (yychar == YYEMPTY && yylen == 1) \
808 { \
809 yychar = (Token); \
810 yylval = (Value); \
811 yytoken = YYTRANSLATE (yychar); \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200812 YYPOPSTACK (1); \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700813 goto yybackup; \
814 } \
815 else \
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700816 { \
817 yyerror (YY_("syntax error: cannot back up")); \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700818 YYERROR; \
819 } \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200820while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700821
Roman Zippel7a884882005-11-08 21:34:51 -0800822
Linus Torvalds1da177e2005-04-16 15:20:36 -0700823#define YYTERROR 1
824#define YYERRCODE 256
825
Linus Torvalds1da177e2005-04-16 15:20:36 -0700826
Roman Zippel7a884882005-11-08 21:34:51 -0800827/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
828 If N is 0, then set CURRENT to the empty location which ends
829 the previous symbol: RHS[0] (always defined). */
830
831#define YYRHSLOC(Rhs, K) ((Rhs)[K])
Linus Torvalds1da177e2005-04-16 15:20:36 -0700832#ifndef YYLLOC_DEFAULT
Roman Zippel7a884882005-11-08 21:34:51 -0800833# define YYLLOC_DEFAULT(Current, Rhs, N) \
834 do \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200835 if (YYID (N)) \
Roman Zippel7a884882005-11-08 21:34:51 -0800836 { \
837 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
838 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
839 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
840 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
841 } \
842 else \
843 { \
844 (Current).first_line = (Current).last_line = \
845 YYRHSLOC (Rhs, 0).last_line; \
846 (Current).first_column = (Current).last_column = \
847 YYRHSLOC (Rhs, 0).last_column; \
848 } \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200849 while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700850#endif
851
Roman Zippel7a884882005-11-08 21:34:51 -0800852
853/* YY_LOCATION_PRINT -- Print the location on the stream.
854 This macro was not mandated originally: define only if we know
855 we won't break user code: when these are the locations we know. */
856
857#ifndef YY_LOCATION_PRINT
858# if YYLTYPE_IS_TRIVIAL
859# define YY_LOCATION_PRINT(File, Loc) \
860 fprintf (File, "%d.%d-%d.%d", \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200861 (Loc).first_line, (Loc).first_column, \
862 (Loc).last_line, (Loc).last_column)
Roman Zippel7a884882005-11-08 21:34:51 -0800863# else
864# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
865# endif
866#endif
867
868
Linus Torvalds1da177e2005-04-16 15:20:36 -0700869/* YYLEX -- calling `yylex' with the right arguments. */
870
871#ifdef YYLEX_PARAM
872# define YYLEX yylex (YYLEX_PARAM)
873#else
874# define YYLEX yylex ()
875#endif
876
877/* Enable debugging if requested. */
878#if YYDEBUG
879
880# ifndef YYFPRINTF
881# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
882# define YYFPRINTF fprintf
883# endif
884
885# define YYDPRINTF(Args) \
886do { \
887 if (yydebug) \
888 YYFPRINTF Args; \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200889} while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700890
Sam Ravnborg14f31562007-09-26 20:15:39 +0200891# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
892do { \
893 if (yydebug) \
894 { \
895 YYFPRINTF (stderr, "%s ", Title); \
896 yy_symbol_print (stderr, \
897 Type, Value); \
898 YYFPRINTF (stderr, "\n"); \
899 } \
900} while (YYID (0))
901
902
903/*--------------------------------.
904| Print this symbol on YYOUTPUT. |
905`--------------------------------*/
906
907/*ARGSUSED*/
908#if (defined __STDC__ || defined __C99__FUNC__ \
909 || defined __cplusplus || defined _MSC_VER)
910static void
911yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
912#else
913static void
914yy_symbol_value_print (yyoutput, yytype, yyvaluep)
915 FILE *yyoutput;
916 int yytype;
917 YYSTYPE const * const yyvaluep;
918#endif
919{
920 if (!yyvaluep)
921 return;
922# ifdef YYPRINT
923 if (yytype < YYNTOKENS)
924 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
925# else
926 YYUSE (yyoutput);
927# endif
928 switch (yytype)
929 {
930 default:
931 break;
932 }
933}
934
935
936/*--------------------------------.
937| Print this symbol on YYOUTPUT. |
938`--------------------------------*/
939
940#if (defined __STDC__ || defined __C99__FUNC__ \
941 || defined __cplusplus || defined _MSC_VER)
942static void
943yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
944#else
945static void
946yy_symbol_print (yyoutput, yytype, yyvaluep)
947 FILE *yyoutput;
948 int yytype;
949 YYSTYPE const * const yyvaluep;
950#endif
951{
952 if (yytype < YYNTOKENS)
953 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
954 else
955 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
956
957 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
958 YYFPRINTF (yyoutput, ")");
959}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700960
961/*------------------------------------------------------------------.
962| yy_stack_print -- Print the state stack from its BOTTOM up to its |
Roman Zippel7a884882005-11-08 21:34:51 -0800963| TOP (included). |
Linus Torvalds1da177e2005-04-16 15:20:36 -0700964`------------------------------------------------------------------*/
965
Sam Ravnborg14f31562007-09-26 20:15:39 +0200966#if (defined __STDC__ || defined __C99__FUNC__ \
967 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700968static void
Josh Triplett1456edb2009-10-15 11:03:20 -0700969yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700970#else
971static void
Josh Triplett1456edb2009-10-15 11:03:20 -0700972yy_stack_print (yybottom, yytop)
973 yytype_int16 *yybottom;
974 yytype_int16 *yytop;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700975#endif
976{
977 YYFPRINTF (stderr, "Stack now");
Josh Triplett1456edb2009-10-15 11:03:20 -0700978 for (; yybottom <= yytop; yybottom++)
979 {
980 int yybot = *yybottom;
981 YYFPRINTF (stderr, " %d", yybot);
982 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700983 YYFPRINTF (stderr, "\n");
984}
985
986# define YY_STACK_PRINT(Bottom, Top) \
987do { \
988 if (yydebug) \
989 yy_stack_print ((Bottom), (Top)); \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200990} while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700991
992
993/*------------------------------------------------.
994| Report that the YYRULE is going to be reduced. |
995`------------------------------------------------*/
996
Sam Ravnborg14f31562007-09-26 20:15:39 +0200997#if (defined __STDC__ || defined __C99__FUNC__ \
998 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700999static void
Sam Ravnborg14f31562007-09-26 20:15:39 +02001000yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001001#else
1002static void
Sam Ravnborg14f31562007-09-26 20:15:39 +02001003yy_reduce_print (yyvsp, yyrule)
1004 YYSTYPE *yyvsp;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001005 int yyrule;
1006#endif
1007{
Sam Ravnborg14f31562007-09-26 20:15:39 +02001008 int yynrhs = yyr2[yyrule];
Linus Torvalds1da177e2005-04-16 15:20:36 -07001009 int yyi;
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001010 unsigned long int yylno = yyrline[yyrule];
Sam Ravnborg14f31562007-09-26 20:15:39 +02001011 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1012 yyrule - 1, yylno);
1013 /* The symbols being reduced. */
1014 for (yyi = 0; yyi < yynrhs; yyi++)
1015 {
Josh Triplett1456edb2009-10-15 11:03:20 -07001016 YYFPRINTF (stderr, " $%d = ", yyi + 1);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001017 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1018 &(yyvsp[(yyi + 1) - (yynrhs)])
1019 );
Josh Triplett1456edb2009-10-15 11:03:20 -07001020 YYFPRINTF (stderr, "\n");
Sam Ravnborg14f31562007-09-26 20:15:39 +02001021 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07001022}
1023
1024# define YY_REDUCE_PRINT(Rule) \
1025do { \
1026 if (yydebug) \
Sam Ravnborg14f31562007-09-26 20:15:39 +02001027 yy_reduce_print (yyvsp, Rule); \
1028} while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -07001029
1030/* Nonzero means print parse trace. It is left uninitialized so that
1031 multiple parsers can coexist. */
1032int yydebug;
1033#else /* !YYDEBUG */
1034# define YYDPRINTF(Args)
Roman Zippel7a884882005-11-08 21:34:51 -08001035# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001036# define YY_STACK_PRINT(Bottom, Top)
1037# define YY_REDUCE_PRINT(Rule)
1038#endif /* !YYDEBUG */
1039
1040
1041/* YYINITDEPTH -- initial size of the parser's stacks. */
1042#ifndef YYINITDEPTH
1043# define YYINITDEPTH 200
1044#endif
1045
1046/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1047 if the built-in stack extension method is used).
1048
1049 Do not make this value too large; the results are undefined if
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001050 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001051 evaluated with infinite-precision integer arithmetic. */
1052
Linus Torvalds1da177e2005-04-16 15:20:36 -07001053#ifndef YYMAXDEPTH
1054# define YYMAXDEPTH 10000
1055#endif
1056
1057
1058
1059#if YYERROR_VERBOSE
1060
1061# ifndef yystrlen
Sam Ravnborg14f31562007-09-26 20:15:39 +02001062# if defined __GLIBC__ && defined _STRING_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07001063# define yystrlen strlen
1064# else
1065/* Return the length of YYSTR. */
Sam Ravnborg14f31562007-09-26 20:15:39 +02001066#if (defined __STDC__ || defined __C99__FUNC__ \
1067 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001068static YYSIZE_T
Linus Torvalds1da177e2005-04-16 15:20:36 -07001069yystrlen (const char *yystr)
Sam Ravnborg14f31562007-09-26 20:15:39 +02001070#else
1071static YYSIZE_T
Linus Torvalds1da177e2005-04-16 15:20:36 -07001072yystrlen (yystr)
Sam Ravnborg14f31562007-09-26 20:15:39 +02001073 const char *yystr;
1074#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001075{
Sam Ravnborg14f31562007-09-26 20:15:39 +02001076 YYSIZE_T yylen;
1077 for (yylen = 0; yystr[yylen]; yylen++)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001078 continue;
Sam Ravnborg14f31562007-09-26 20:15:39 +02001079 return yylen;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001080}
1081# endif
1082# endif
1083
1084# ifndef yystpcpy
Sam Ravnborg14f31562007-09-26 20:15:39 +02001085# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
Linus Torvalds1da177e2005-04-16 15:20:36 -07001086# define yystpcpy stpcpy
1087# else
1088/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1089 YYDEST. */
Sam Ravnborg14f31562007-09-26 20:15:39 +02001090#if (defined __STDC__ || defined __C99__FUNC__ \
1091 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001092static char *
Linus Torvalds1da177e2005-04-16 15:20:36 -07001093yystpcpy (char *yydest, const char *yysrc)
Sam Ravnborg14f31562007-09-26 20:15:39 +02001094#else
1095static char *
Linus Torvalds1da177e2005-04-16 15:20:36 -07001096yystpcpy (yydest, yysrc)
Sam Ravnborg14f31562007-09-26 20:15:39 +02001097 char *yydest;
1098 const char *yysrc;
1099#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001100{
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001101 char *yyd = yydest;
1102 const char *yys = yysrc;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001103
1104 while ((*yyd++ = *yys++) != '\0')
1105 continue;
1106
1107 return yyd - 1;
1108}
1109# endif
1110# endif
1111
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001112# ifndef yytnamerr
1113/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1114 quotes and backslashes, so that it's suitable for yyerror. The
1115 heuristic is that double-quoting is unnecessary unless the string
1116 contains an apostrophe, a comma, or backslash (other than
1117 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1118 null, do not copy; instead, return the length of what the result
1119 would have been. */
1120static YYSIZE_T
1121yytnamerr (char *yyres, const char *yystr)
1122{
1123 if (*yystr == '"')
1124 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001125 YYSIZE_T yyn = 0;
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001126 char const *yyp = yystr;
1127
1128 for (;;)
1129 switch (*++yyp)
1130 {
1131 case '\'':
1132 case ',':
1133 goto do_not_strip_quotes;
1134
1135 case '\\':
1136 if (*++yyp != '\\')
1137 goto do_not_strip_quotes;
1138 /* Fall through. */
1139 default:
1140 if (yyres)
1141 yyres[yyn] = *yyp;
1142 yyn++;
1143 break;
1144
1145 case '"':
1146 if (yyres)
1147 yyres[yyn] = '\0';
1148 return yyn;
1149 }
1150 do_not_strip_quotes: ;
1151 }
1152
1153 if (! yyres)
1154 return yystrlen (yystr);
1155
1156 return yystpcpy (yyres, yystr) - yyres;
1157}
1158# endif
1159
Sam Ravnborg14f31562007-09-26 20:15:39 +02001160/* Copy into YYRESULT an error message about the unexpected token
1161 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1162 including the terminating null byte. If YYRESULT is null, do not
1163 copy anything; just return the number of bytes that would be
1164 copied. As a special case, return 0 if an ordinary "syntax error"
1165 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1166 size calculation. */
1167static YYSIZE_T
1168yysyntax_error (char *yyresult, int yystate, int yychar)
1169{
1170 int yyn = yypact[yystate];
Linus Torvalds1da177e2005-04-16 15:20:36 -07001171
Sam Ravnborg14f31562007-09-26 20:15:39 +02001172 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1173 return 0;
1174 else
1175 {
1176 int yytype = YYTRANSLATE (yychar);
1177 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1178 YYSIZE_T yysize = yysize0;
1179 YYSIZE_T yysize1;
1180 int yysize_overflow = 0;
1181 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1182 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1183 int yyx;
1184
1185# if 0
1186 /* This is so xgettext sees the translatable formats that are
1187 constructed on the fly. */
1188 YY_("syntax error, unexpected %s");
1189 YY_("syntax error, unexpected %s, expecting %s");
1190 YY_("syntax error, unexpected %s, expecting %s or %s");
1191 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1192 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1193# endif
1194 char *yyfmt;
1195 char const *yyf;
1196 static char const yyunexpected[] = "syntax error, unexpected %s";
1197 static char const yyexpecting[] = ", expecting %s";
1198 static char const yyor[] = " or %s";
1199 char yyformat[sizeof yyunexpected
1200 + sizeof yyexpecting - 1
1201 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1202 * (sizeof yyor - 1))];
1203 char const *yyprefix = yyexpecting;
1204
1205 /* Start YYX at -YYN if negative to avoid negative indexes in
1206 YYCHECK. */
1207 int yyxbegin = yyn < 0 ? -yyn : 0;
1208
1209 /* Stay within bounds of both yycheck and yytname. */
1210 int yychecklim = YYLAST - yyn + 1;
1211 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1212 int yycount = 1;
1213
1214 yyarg[0] = yytname[yytype];
1215 yyfmt = yystpcpy (yyformat, yyunexpected);
1216
1217 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1218 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1219 {
1220 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1221 {
1222 yycount = 1;
1223 yysize = yysize0;
1224 yyformat[sizeof yyunexpected - 1] = '\0';
1225 break;
1226 }
1227 yyarg[yycount++] = yytname[yyx];
1228 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1229 yysize_overflow |= (yysize1 < yysize);
1230 yysize = yysize1;
1231 yyfmt = yystpcpy (yyfmt, yyprefix);
1232 yyprefix = yyor;
1233 }
1234
1235 yyf = YY_(yyformat);
1236 yysize1 = yysize + yystrlen (yyf);
1237 yysize_overflow |= (yysize1 < yysize);
1238 yysize = yysize1;
1239
1240 if (yysize_overflow)
1241 return YYSIZE_MAXIMUM;
1242
1243 if (yyresult)
1244 {
1245 /* Avoid sprintf, as that infringes on the user's name space.
1246 Don't have undefined behavior even if the translation
1247 produced a string with the wrong number of "%s"s. */
1248 char *yyp = yyresult;
1249 int yyi = 0;
1250 while ((*yyp = *yyf) != '\0')
1251 {
1252 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1253 {
1254 yyp += yytnamerr (yyp, yyarg[yyi++]);
1255 yyf += 2;
1256 }
1257 else
1258 {
1259 yyp++;
1260 yyf++;
1261 }
1262 }
1263 }
1264 return yysize;
1265 }
1266}
1267#endif /* YYERROR_VERBOSE */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001268
1269
Linus Torvalds1da177e2005-04-16 15:20:36 -07001270/*-----------------------------------------------.
1271| Release the memory associated to this symbol. |
1272`-----------------------------------------------*/
1273
Sam Ravnborg14f31562007-09-26 20:15:39 +02001274/*ARGSUSED*/
1275#if (defined __STDC__ || defined __C99__FUNC__ \
1276 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001277static void
Roman Zippel7a884882005-11-08 21:34:51 -08001278yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001279#else
1280static void
Roman Zippel7a884882005-11-08 21:34:51 -08001281yydestruct (yymsg, yytype, yyvaluep)
1282 const char *yymsg;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001283 int yytype;
1284 YYSTYPE *yyvaluep;
1285#endif
1286{
Sam Ravnborg14f31562007-09-26 20:15:39 +02001287 YYUSE (yyvaluep);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001288
Roman Zippel7a884882005-11-08 21:34:51 -08001289 if (!yymsg)
1290 yymsg = "Deleting";
1291 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1292
Linus Torvalds1da177e2005-04-16 15:20:36 -07001293 switch (yytype)
1294 {
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001295 case 52: /* "choice_entry" */
Roman Zippela02f0572005-11-08 21:34:53 -08001296
Sam Ravnborg14f31562007-09-26 20:15:39 +02001297 {
Roman Zippela02f0572005-11-08 21:34:53 -08001298 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1299 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1300 if (current_menu == (yyvaluep->menu))
1301 menu_end_menu();
1302};
1303
Sam Ravnborg14f31562007-09-26 20:15:39 +02001304 break;
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001305 case 58: /* "if_entry" */
Roman Zippela02f0572005-11-08 21:34:53 -08001306
Sam Ravnborg14f31562007-09-26 20:15:39 +02001307 {
Roman Zippela02f0572005-11-08 21:34:53 -08001308 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1309 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1310 if (current_menu == (yyvaluep->menu))
1311 menu_end_menu();
1312};
1313
Sam Ravnborg14f31562007-09-26 20:15:39 +02001314 break;
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001315 case 64: /* "menu_entry" */
Roman Zippela02f0572005-11-08 21:34:53 -08001316
Sam Ravnborg14f31562007-09-26 20:15:39 +02001317 {
Roman Zippela02f0572005-11-08 21:34:53 -08001318 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1319 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1320 if (current_menu == (yyvaluep->menu))
1321 menu_end_menu();
1322};
1323
Sam Ravnborg14f31562007-09-26 20:15:39 +02001324 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001325
1326 default:
Sam Ravnborg14f31562007-09-26 20:15:39 +02001327 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001328 }
1329}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001330
1331/* Prevent warnings from -Wmissing-prototypes. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001332#ifdef YYPARSE_PARAM
Sam Ravnborg14f31562007-09-26 20:15:39 +02001333#if defined __STDC__ || defined __cplusplus
Linus Torvalds1da177e2005-04-16 15:20:36 -07001334int yyparse (void *YYPARSE_PARAM);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001335#else
Linus Torvalds1da177e2005-04-16 15:20:36 -07001336int yyparse ();
Sam Ravnborg14f31562007-09-26 20:15:39 +02001337#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001338#else /* ! YYPARSE_PARAM */
Sam Ravnborg14f31562007-09-26 20:15:39 +02001339#if defined __STDC__ || defined __cplusplus
Linus Torvalds1da177e2005-04-16 15:20:36 -07001340int yyparse (void);
1341#else
1342int yyparse ();
1343#endif
1344#endif /* ! YYPARSE_PARAM */
1345
1346
Josh Triplett1456edb2009-10-15 11:03:20 -07001347/* The lookahead symbol. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001348int yychar;
1349
Josh Triplett1456edb2009-10-15 11:03:20 -07001350/* The semantic value of the lookahead symbol. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001351YYSTYPE yylval;
1352
1353/* Number of syntax errors so far. */
1354int yynerrs;
1355
1356
1357
Josh Triplett1456edb2009-10-15 11:03:20 -07001358/*-------------------------.
1359| yyparse or yypush_parse. |
1360`-------------------------*/
Linus Torvalds1da177e2005-04-16 15:20:36 -07001361
1362#ifdef YYPARSE_PARAM
Sam Ravnborg14f31562007-09-26 20:15:39 +02001363#if (defined __STDC__ || defined __C99__FUNC__ \
1364 || defined __cplusplus || defined _MSC_VER)
1365int
1366yyparse (void *YYPARSE_PARAM)
1367#else
1368int
1369yyparse (YYPARSE_PARAM)
1370 void *YYPARSE_PARAM;
1371#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001372#else /* ! YYPARSE_PARAM */
Sam Ravnborg14f31562007-09-26 20:15:39 +02001373#if (defined __STDC__ || defined __C99__FUNC__ \
1374 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001375int
1376yyparse (void)
1377#else
1378int
1379yyparse ()
Sam Ravnborg14f31562007-09-26 20:15:39 +02001380
Linus Torvalds1da177e2005-04-16 15:20:36 -07001381#endif
1382#endif
1383{
Josh Triplett1456edb2009-10-15 11:03:20 -07001384
1385
1386 int yystate;
1387 /* Number of tokens to shift before error messages enabled. */
1388 int yyerrstatus;
1389
1390 /* The stacks and their tools:
1391 `yyss': related to states.
1392 `yyvs': related to semantic values.
1393
1394 Refer to the stacks thru separate pointers, to allow yyoverflow
1395 to reallocate them elsewhere. */
1396
1397 /* The state stack. */
1398 yytype_int16 yyssa[YYINITDEPTH];
1399 yytype_int16 *yyss;
1400 yytype_int16 *yyssp;
1401
1402 /* The semantic value stack. */
1403 YYSTYPE yyvsa[YYINITDEPTH];
1404 YYSTYPE *yyvs;
1405 YYSTYPE *yyvsp;
1406
1407 YYSIZE_T yystacksize;
1408
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001409 int yyn;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001410 int yyresult;
Josh Triplett1456edb2009-10-15 11:03:20 -07001411 /* Lookahead token as an internal (translated) token number. */
1412 int yytoken;
1413 /* The variables used to return semantic value and location from the
1414 action routines. */
1415 YYSTYPE yyval;
1416
Sam Ravnborg14f31562007-09-26 20:15:39 +02001417#if YYERROR_VERBOSE
1418 /* Buffer for error messages, and its allocated size. */
1419 char yymsgbuf[128];
1420 char *yymsg = yymsgbuf;
1421 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1422#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001423
Sam Ravnborg14f31562007-09-26 20:15:39 +02001424#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
Linus Torvalds1da177e2005-04-16 15:20:36 -07001425
Sam Ravnborg14f31562007-09-26 20:15:39 +02001426 /* The number of symbols on the RHS of the reduced rule.
1427 Keep to zero when no symbol should be popped. */
1428 int yylen = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001429
Josh Triplett1456edb2009-10-15 11:03:20 -07001430 yytoken = 0;
1431 yyss = yyssa;
1432 yyvs = yyvsa;
1433 yystacksize = YYINITDEPTH;
1434
Linus Torvalds1da177e2005-04-16 15:20:36 -07001435 YYDPRINTF ((stderr, "Starting parse\n"));
1436
1437 yystate = 0;
1438 yyerrstatus = 0;
1439 yynerrs = 0;
Josh Triplett1456edb2009-10-15 11:03:20 -07001440 yychar = YYEMPTY; /* Cause a token to be read. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001441
1442 /* Initialize stack pointers.
1443 Waste one element of value and location stack
1444 so that they stay on the same level as the state stack.
1445 The wasted elements are never initialized. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001446 yyssp = yyss;
1447 yyvsp = yyvs;
1448
1449 goto yysetstate;
1450
1451/*------------------------------------------------------------.
1452| yynewstate -- Push a new state, which is found in yystate. |
1453`------------------------------------------------------------*/
1454 yynewstate:
1455 /* In all cases, when you get here, the value and location stacks
Sam Ravnborg14f31562007-09-26 20:15:39 +02001456 have just been pushed. So pushing a state here evens the stacks. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001457 yyssp++;
1458
1459 yysetstate:
1460 *yyssp = yystate;
1461
1462 if (yyss + yystacksize - 1 <= yyssp)
1463 {
1464 /* Get the current used size of the three stacks, in elements. */
1465 YYSIZE_T yysize = yyssp - yyss + 1;
1466
1467#ifdef yyoverflow
1468 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001469 /* Give user a chance to reallocate the stack. Use copies of
Linus Torvalds1da177e2005-04-16 15:20:36 -07001470 these so that the &'s don't force the real ones into
1471 memory. */
1472 YYSTYPE *yyvs1 = yyvs;
Sam Ravnborg14f31562007-09-26 20:15:39 +02001473 yytype_int16 *yyss1 = yyss;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001474
Linus Torvalds1da177e2005-04-16 15:20:36 -07001475 /* Each stack pointer address is followed by the size of the
1476 data in use in that stack, in bytes. This used to be a
1477 conditional around just the two extra args, but that might
1478 be undefined if yyoverflow is a macro. */
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001479 yyoverflow (YY_("memory exhausted"),
Linus Torvalds1da177e2005-04-16 15:20:36 -07001480 &yyss1, yysize * sizeof (*yyssp),
1481 &yyvs1, yysize * sizeof (*yyvsp),
Linus Torvalds1da177e2005-04-16 15:20:36 -07001482 &yystacksize);
1483
1484 yyss = yyss1;
1485 yyvs = yyvs1;
1486 }
1487#else /* no yyoverflow */
1488# ifndef YYSTACK_RELOCATE
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001489 goto yyexhaustedlab;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001490# else
1491 /* Extend the stack our own way. */
1492 if (YYMAXDEPTH <= yystacksize)
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001493 goto yyexhaustedlab;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001494 yystacksize *= 2;
1495 if (YYMAXDEPTH < yystacksize)
1496 yystacksize = YYMAXDEPTH;
1497
1498 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001499 yytype_int16 *yyss1 = yyss;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001500 union yyalloc *yyptr =
1501 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1502 if (! yyptr)
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001503 goto yyexhaustedlab;
Josh Triplett1456edb2009-10-15 11:03:20 -07001504 YYSTACK_RELOCATE (yyss_alloc, yyss);
1505 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001506# undef YYSTACK_RELOCATE
1507 if (yyss1 != yyssa)
1508 YYSTACK_FREE (yyss1);
1509 }
1510# endif
1511#endif /* no yyoverflow */
1512
1513 yyssp = yyss + yysize - 1;
1514 yyvsp = yyvs + yysize - 1;
1515
Linus Torvalds1da177e2005-04-16 15:20:36 -07001516 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1517 (unsigned long int) yystacksize));
1518
1519 if (yyss + yystacksize - 1 <= yyssp)
1520 YYABORT;
1521 }
1522
1523 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1524
Josh Triplett1456edb2009-10-15 11:03:20 -07001525 if (yystate == YYFINAL)
1526 YYACCEPT;
1527
Linus Torvalds1da177e2005-04-16 15:20:36 -07001528 goto yybackup;
1529
1530/*-----------.
1531| yybackup. |
1532`-----------*/
1533yybackup:
1534
Sam Ravnborg14f31562007-09-26 20:15:39 +02001535 /* Do appropriate processing given the current state. Read a
Josh Triplett1456edb2009-10-15 11:03:20 -07001536 lookahead token if we need one and don't already have one. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001537
Josh Triplett1456edb2009-10-15 11:03:20 -07001538 /* First try to decide what to do without reference to lookahead token. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001539 yyn = yypact[yystate];
1540 if (yyn == YYPACT_NINF)
1541 goto yydefault;
1542
Josh Triplett1456edb2009-10-15 11:03:20 -07001543 /* Not known => get a lookahead token if don't already have one. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001544
Josh Triplett1456edb2009-10-15 11:03:20 -07001545 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001546 if (yychar == YYEMPTY)
1547 {
1548 YYDPRINTF ((stderr, "Reading a token: "));
1549 yychar = YYLEX;
1550 }
1551
1552 if (yychar <= YYEOF)
1553 {
1554 yychar = yytoken = YYEOF;
1555 YYDPRINTF ((stderr, "Now at end of input.\n"));
1556 }
1557 else
1558 {
1559 yytoken = YYTRANSLATE (yychar);
Roman Zippel7a884882005-11-08 21:34:51 -08001560 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001561 }
1562
1563 /* If the proper action on seeing token YYTOKEN is to reduce or to
1564 detect an error, take that action. */
1565 yyn += yytoken;
1566 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1567 goto yydefault;
1568 yyn = yytable[yyn];
1569 if (yyn <= 0)
1570 {
1571 if (yyn == 0 || yyn == YYTABLE_NINF)
1572 goto yyerrlab;
1573 yyn = -yyn;
1574 goto yyreduce;
1575 }
1576
Linus Torvalds1da177e2005-04-16 15:20:36 -07001577 /* Count tokens shifted since error; after three, turn off error
1578 status. */
1579 if (yyerrstatus)
1580 yyerrstatus--;
1581
Josh Triplett1456edb2009-10-15 11:03:20 -07001582 /* Shift the lookahead token. */
Sam Ravnborg14f31562007-09-26 20:15:39 +02001583 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1584
Josh Triplett1456edb2009-10-15 11:03:20 -07001585 /* Discard the shifted token. */
1586 yychar = YYEMPTY;
Sam Ravnborg14f31562007-09-26 20:15:39 +02001587
Linus Torvalds1da177e2005-04-16 15:20:36 -07001588 yystate = yyn;
Sam Ravnborg14f31562007-09-26 20:15:39 +02001589 *++yyvsp = yylval;
1590
Linus Torvalds1da177e2005-04-16 15:20:36 -07001591 goto yynewstate;
1592
1593
1594/*-----------------------------------------------------------.
1595| yydefault -- do the default action for the current state. |
1596`-----------------------------------------------------------*/
1597yydefault:
1598 yyn = yydefact[yystate];
1599 if (yyn == 0)
1600 goto yyerrlab;
1601 goto yyreduce;
1602
1603
1604/*-----------------------------.
1605| yyreduce -- Do a reduction. |
1606`-----------------------------*/
1607yyreduce:
1608 /* yyn is the number of a rule to reduce with. */
1609 yylen = yyr2[yyn];
1610
1611 /* If YYLEN is nonzero, implement the default value of the action:
1612 `$$ = $1'.
1613
1614 Otherwise, the following line sets YYVAL to garbage.
1615 This behavior is undocumented and Bison
1616 users should not rely upon it. Assigning to YYVAL
1617 unconditionally makes the parser a bit smaller, and it avoids a
1618 GCC warning that YYVAL may be used uninitialized. */
1619 yyval = yyvsp[1-yylen];
1620
1621
1622 YY_REDUCE_PRINT (yyn);
1623 switch (yyn)
1624 {
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001625 case 10:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001626
Roman Zippela02f0572005-11-08 21:34:53 -08001627 { zconf_error("unexpected end statement"); ;}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001628 break;
1629
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001630 case 11:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001631
Sam Ravnborg14f31562007-09-26 20:15:39 +02001632 { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001633 break;
1634
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001635 case 12:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001636
Roman Zippela02f0572005-11-08 21:34:53 -08001637 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001638 zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
Roman Zippela02f0572005-11-08 21:34:53 -08001639;}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001640 break;
1641
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001642 case 13:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001643
Roman Zippela02f0572005-11-08 21:34:53 -08001644 { zconf_error("invalid statement"); ;}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001645 break;
1646
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001647 case 27:
Roman Zippela02f0572005-11-08 21:34:53 -08001648
Sam Ravnborg14f31562007-09-26 20:15:39 +02001649 { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;}
Roman Zippela02f0572005-11-08 21:34:53 -08001650 break;
1651
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001652 case 28:
Roman Zippela02f0572005-11-08 21:34:53 -08001653
1654 { zconf_error("invalid option"); ;}
1655 break;
1656
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001657 case 29:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001658
1659 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001660 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001661 sym->flags |= SYMBOL_OPTIONAL;
1662 menu_add_entry(sym);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001663 printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001664;}
1665 break;
1666
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001667 case 30:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001668
1669 {
1670 menu_end_entry();
1671 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1672;}
1673 break;
1674
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001675 case 31:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001676
1677 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001678 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001679 sym->flags |= SYMBOL_OPTIONAL;
1680 menu_add_entry(sym);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001681 printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001682;}
1683 break;
1684
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001685 case 32:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001686
1687 {
1688 if (current_entry->prompt)
1689 current_entry->prompt->type = P_MENU;
1690 else
1691 zconfprint("warning: menuconfig statement without prompt");
1692 menu_end_entry();
1693 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1694;}
1695 break;
1696
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001697 case 40:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001698
1699 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001700 menu_set_type((yyvsp[(1) - (3)].id)->stype);
Roman Zippel3370f9f2005-11-08 21:34:52 -08001701 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1702 zconf_curname(), zconf_lineno(),
Sam Ravnborg14f31562007-09-26 20:15:39 +02001703 (yyvsp[(1) - (3)].id)->stype);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001704;}
1705 break;
1706
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001707 case 41:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001708
1709 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001710 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001711 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1712;}
1713 break;
1714
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001715 case 42:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001716
1717 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001718 menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr));
1719 if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN)
1720 menu_set_type((yyvsp[(1) - (4)].id)->stype);
Roman Zippel3370f9f2005-11-08 21:34:52 -08001721 printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
1722 zconf_curname(), zconf_lineno(),
Sam Ravnborg14f31562007-09-26 20:15:39 +02001723 (yyvsp[(1) - (4)].id)->stype);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001724;}
1725 break;
1726
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001727 case 43:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001728
1729 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001730 menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001731 printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1732;}
1733 break;
1734
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001735 case 44:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001736
1737 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001738 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 -07001739 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1740;}
1741 break;
1742
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001743 case 47:
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001744
1745 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001746 struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001747 if (id && id->flags & TF_OPTION)
Sam Ravnborg14f31562007-09-26 20:15:39 +02001748 menu_add_option(id->token, (yyvsp[(3) - (3)].string));
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001749 else
Sam Ravnborg14f31562007-09-26 20:15:39 +02001750 zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string));
1751 free((yyvsp[(2) - (3)].string));
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001752;}
1753 break;
1754
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001755 case 48:
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001756
1757 { (yyval.string) = NULL; ;}
1758 break;
1759
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001760 case 49:
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001761
Sam Ravnborg14f31562007-09-26 20:15:39 +02001762 { (yyval.string) = (yyvsp[(2) - (2)].string); ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001763 break;
1764
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001765 case 50:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001766
1767 {
Roman Zippel5a1aa8a2008-02-29 05:11:50 +01001768 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE);
1769 sym->flags |= SYMBOL_AUTO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001770 menu_add_entry(sym);
1771 menu_add_expr(P_CHOICE, NULL, NULL);
1772 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1773;}
1774 break;
1775
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001776 case 51:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001777
1778 {
Roman Zippela02f0572005-11-08 21:34:53 -08001779 (yyval.menu) = menu_add_menu();
Linus Torvalds1da177e2005-04-16 15:20:36 -07001780;}
1781 break;
1782
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001783 case 52:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001784
1785 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001786 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001787 menu_end_menu();
1788 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
1789 }
1790;}
1791 break;
1792
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001793 case 60:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001794
1795 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001796 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001797 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1798;}
1799 break;
1800
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001801 case 61:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001802
1803 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001804 if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) {
1805 menu_set_type((yyvsp[(1) - (3)].id)->stype);
Roman Zippel3370f9f2005-11-08 21:34:52 -08001806 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1807 zconf_curname(), zconf_lineno(),
Sam Ravnborg14f31562007-09-26 20:15:39 +02001808 (yyvsp[(1) - (3)].id)->stype);
Roman Zippel3370f9f2005-11-08 21:34:52 -08001809 } else
1810 YYERROR;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001811;}
1812 break;
1813
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001814 case 62:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001815
1816 {
1817 current_entry->sym->flags |= SYMBOL_OPTIONAL;
1818 printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1819;}
1820 break;
1821
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001822 case 63:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001823
1824 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001825 if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) {
1826 menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
Roman Zippel3370f9f2005-11-08 21:34:52 -08001827 printd(DEBUG_PARSE, "%s:%d:default\n",
1828 zconf_curname(), zconf_lineno());
1829 } else
1830 YYERROR;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001831;}
1832 break;
1833
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001834 case 66:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001835
1836 {
1837 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
1838 menu_add_entry(NULL);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001839 menu_add_dep((yyvsp[(2) - (3)].expr));
Roman Zippela02f0572005-11-08 21:34:53 -08001840 (yyval.menu) = menu_add_menu();
Linus Torvalds1da177e2005-04-16 15:20:36 -07001841;}
1842 break;
1843
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001844 case 67:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001845
1846 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001847 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001848 menu_end_menu();
1849 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
1850 }
1851;}
1852 break;
1853
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001854 case 73:
1855
1856 {
1857 menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1858;}
1859 break;
1860
1861 case 74:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001862
1863 {
1864 menu_add_entry(NULL);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001865 menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001866 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1867;}
1868 break;
1869
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001870 case 75:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001871
1872 {
Roman Zippela02f0572005-11-08 21:34:53 -08001873 (yyval.menu) = menu_add_menu();
Linus Torvalds1da177e2005-04-16 15:20:36 -07001874;}
1875 break;
1876
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001877 case 76:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001878
1879 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001880 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) {
Roman Zippela02f0572005-11-08 21:34:53 -08001881 menu_end_menu();
1882 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
1883 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07001884;}
1885 break;
1886
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001887 case 82:
Roman Zippela02f0572005-11-08 21:34:53 -08001888
1889 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001890 printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1891 zconf_nextfile((yyvsp[(2) - (3)].string));
Roman Zippela02f0572005-11-08 21:34:53 -08001892;}
1893 break;
1894
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001895 case 83:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001896
1897 {
1898 menu_add_entry(NULL);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001899 menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001900 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1901;}
1902 break;
1903
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001904 case 84:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001905
1906 {
1907 menu_end_entry();
1908;}
1909 break;
1910
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001911 case 85:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001912
1913 {
1914 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
1915 zconf_starthelp();
1916;}
1917 break;
1918
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001919 case 86:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001920
1921 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001922 current_entry->help = (yyvsp[(2) - (2)].string);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001923;}
1924 break;
1925
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001926 case 91:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001927
1928 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001929 menu_add_dep((yyvsp[(3) - (4)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001930 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
1931;}
1932 break;
1933
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001934 case 93:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001935
1936 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001937 menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001938;}
1939 break;
1940
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001941 case 96:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001942
Sam Ravnborg14f31562007-09-26 20:15:39 +02001943 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1944 break;
1945
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001946 case 97:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001947
Sam Ravnborg14f31562007-09-26 20:15:39 +02001948 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001949 break;
1950
Sam Ravnborg14f31562007-09-26 20:15:39 +02001951 case 98:
Roman Zippela02f0572005-11-08 21:34:53 -08001952
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001953 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
Sam Ravnborg14f31562007-09-26 20:15:39 +02001954 break;
1955
Roman Zippela02f0572005-11-08 21:34:53 -08001956 case 101:
1957
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001958 { (yyval.expr) = NULL; ;}
Roman Zippela02f0572005-11-08 21:34:53 -08001959 break;
1960
1961 case 102:
1962
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001963 { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;}
Roman Zippela02f0572005-11-08 21:34:53 -08001964 break;
1965
1966 case 103:
1967
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001968 { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;}
Roman Zippela02f0572005-11-08 21:34:53 -08001969 break;
1970
1971 case 104:
1972
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001973 { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001974 break;
1975
1976 case 105:
1977
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001978 { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001979 break;
1980
1981 case 106:
1982
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001983 { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001984 break;
1985
1986 case 107:
1987
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001988 { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001989 break;
1990
1991 case 108:
1992
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001993 { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
Roman Zippel5a1aa8a2008-02-29 05:11:50 +01001994 break;
1995
1996 case 109:
1997
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001998 { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
1999 break;
2000
2001 case 110:
2002
2003 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;}
2004 break;
2005
2006 case 111:
2007
2008 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;}
2009 break;
2010
2011 case 112:
2012
Roman Zippel5a1aa8a2008-02-29 05:11:50 +01002013 { (yyval.string) = NULL; ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002014 break;
2015
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002016
Linus Torvalds1da177e2005-04-16 15:20:36 -07002017
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002018 default: break;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002019 }
Sam Ravnborg14f31562007-09-26 20:15:39 +02002020 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002021
Sam Ravnborg14f31562007-09-26 20:15:39 +02002022 YYPOPSTACK (yylen);
2023 yylen = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002024 YY_STACK_PRINT (yyss, yyssp);
2025
2026 *++yyvsp = yyval;
2027
Linus Torvalds1da177e2005-04-16 15:20:36 -07002028 /* Now `shift' the result of the reduction. Determine what state
2029 that goes to, based on the state we popped back to and the rule
2030 number reduced by. */
2031
2032 yyn = yyr1[yyn];
2033
2034 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2035 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2036 yystate = yytable[yystate];
2037 else
2038 yystate = yydefgoto[yyn - YYNTOKENS];
2039
2040 goto yynewstate;
2041
2042
2043/*------------------------------------.
2044| yyerrlab -- here on detecting error |
2045`------------------------------------*/
2046yyerrlab:
2047 /* If not already recovering from an error, report this error. */
2048 if (!yyerrstatus)
2049 {
2050 ++yynerrs;
Sam Ravnborg14f31562007-09-26 20:15:39 +02002051#if ! YYERROR_VERBOSE
2052 yyerror (YY_("syntax error"));
2053#else
2054 {
2055 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2056 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2057 {
2058 YYSIZE_T yyalloc = 2 * yysize;
2059 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2060 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2061 if (yymsg != yymsgbuf)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002062 YYSTACK_FREE (yymsg);
Sam Ravnborg14f31562007-09-26 20:15:39 +02002063 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2064 if (yymsg)
2065 yymsg_alloc = yyalloc;
2066 else
2067 {
2068 yymsg = yymsgbuf;
2069 yymsg_alloc = sizeof yymsgbuf;
2070 }
2071 }
2072
2073 if (0 < yysize && yysize <= yymsg_alloc)
2074 {
2075 (void) yysyntax_error (yymsg, yystate, yychar);
2076 yyerror (yymsg);
2077 }
2078 else
2079 {
2080 yyerror (YY_("syntax error"));
2081 if (yysize != 0)
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002082 goto yyexhaustedlab;
Sam Ravnborg14f31562007-09-26 20:15:39 +02002083 }
2084 }
2085#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07002086 }
2087
2088
2089
2090 if (yyerrstatus == 3)
2091 {
Josh Triplett1456edb2009-10-15 11:03:20 -07002092 /* If just tried and failed to reuse lookahead token after an
Linus Torvalds1da177e2005-04-16 15:20:36 -07002093 error, discard it. */
2094
Roman Zippel7a884882005-11-08 21:34:51 -08002095 if (yychar <= YYEOF)
Sam Ravnborg14f31562007-09-26 20:15:39 +02002096 {
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002097 /* Return failure if at end of input. */
Roman Zippel7a884882005-11-08 21:34:51 -08002098 if (yychar == YYEOF)
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002099 YYABORT;
Sam Ravnborg14f31562007-09-26 20:15:39 +02002100 }
Roman Zippel7a884882005-11-08 21:34:51 -08002101 else
2102 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02002103 yydestruct ("Error: discarding",
2104 yytoken, &yylval);
Roman Zippel7a884882005-11-08 21:34:51 -08002105 yychar = YYEMPTY;
2106 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07002107 }
2108
Josh Triplett1456edb2009-10-15 11:03:20 -07002109 /* Else will try to reuse lookahead token after shifting the error
Linus Torvalds1da177e2005-04-16 15:20:36 -07002110 token. */
2111 goto yyerrlab1;
2112
2113
Roman Zippel7a884882005-11-08 21:34:51 -08002114/*---------------------------------------------------.
2115| yyerrorlab -- error raised explicitly by YYERROR. |
2116`---------------------------------------------------*/
2117yyerrorlab:
2118
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002119 /* Pacify compilers like GCC when the user code never invokes
2120 YYERROR and the label yyerrorlab therefore never appears in user
2121 code. */
Sam Ravnborg14f31562007-09-26 20:15:39 +02002122 if (/*CONSTCOND*/ 0)
Roman Zippel7a884882005-11-08 21:34:51 -08002123 goto yyerrorlab;
Roman Zippel7a884882005-11-08 21:34:51 -08002124
Sam Ravnborg14f31562007-09-26 20:15:39 +02002125 /* Do not reclaim the symbols of the rule which action triggered
2126 this YYERROR. */
2127 YYPOPSTACK (yylen);
2128 yylen = 0;
2129 YY_STACK_PRINT (yyss, yyssp);
Roman Zippel7a884882005-11-08 21:34:51 -08002130 yystate = *yyssp;
2131 goto yyerrlab1;
2132
2133
2134/*-------------------------------------------------------------.
2135| yyerrlab1 -- common code for both syntax error and YYERROR. |
2136`-------------------------------------------------------------*/
Linus Torvalds1da177e2005-04-16 15:20:36 -07002137yyerrlab1:
2138 yyerrstatus = 3; /* Each real token shifted decrements this. */
2139
2140 for (;;)
2141 {
2142 yyn = yypact[yystate];
2143 if (yyn != YYPACT_NINF)
2144 {
2145 yyn += YYTERROR;
2146 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2147 {
2148 yyn = yytable[yyn];
2149 if (0 < yyn)
2150 break;
2151 }
2152 }
2153
2154 /* Pop the current state because it cannot handle the error token. */
2155 if (yyssp == yyss)
2156 YYABORT;
2157
Linus Torvalds1da177e2005-04-16 15:20:36 -07002158
Sam Ravnborg14f31562007-09-26 20:15:39 +02002159 yydestruct ("Error: popping",
2160 yystos[yystate], yyvsp);
2161 YYPOPSTACK (1);
Roman Zippel7a884882005-11-08 21:34:51 -08002162 yystate = *yyssp;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002163 YY_STACK_PRINT (yyss, yyssp);
2164 }
2165
Linus Torvalds1da177e2005-04-16 15:20:36 -07002166 *++yyvsp = yylval;
2167
2168
Sam Ravnborg14f31562007-09-26 20:15:39 +02002169 /* Shift the error token. */
Roman Zippel7a884882005-11-08 21:34:51 -08002170 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2171
Linus Torvalds1da177e2005-04-16 15:20:36 -07002172 yystate = yyn;
2173 goto yynewstate;
2174
2175
2176/*-------------------------------------.
2177| yyacceptlab -- YYACCEPT comes here. |
2178`-------------------------------------*/
2179yyacceptlab:
2180 yyresult = 0;
2181 goto yyreturn;
2182
2183/*-----------------------------------.
2184| yyabortlab -- YYABORT comes here. |
2185`-----------------------------------*/
2186yyabortlab:
2187 yyresult = 1;
2188 goto yyreturn;
2189
Josh Triplett1456edb2009-10-15 11:03:20 -07002190#if !defined(yyoverflow) || YYERROR_VERBOSE
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002191/*-------------------------------------------------.
2192| yyexhaustedlab -- memory exhaustion comes here. |
2193`-------------------------------------------------*/
2194yyexhaustedlab:
2195 yyerror (YY_("memory exhausted"));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002196 yyresult = 2;
2197 /* Fall through. */
2198#endif
2199
2200yyreturn:
Josh Triplett1456edb2009-10-15 11:03:20 -07002201 if (yychar != YYEMPTY)
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002202 yydestruct ("Cleanup: discarding lookahead",
2203 yytoken, &yylval);
Sam Ravnborg14f31562007-09-26 20:15:39 +02002204 /* Do not reclaim the symbols of the rule which action triggered
2205 this YYABORT or YYACCEPT. */
2206 YYPOPSTACK (yylen);
2207 YY_STACK_PRINT (yyss, yyssp);
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002208 while (yyssp != yyss)
2209 {
2210 yydestruct ("Cleanup: popping",
2211 yystos[*yyssp], yyvsp);
Sam Ravnborg14f31562007-09-26 20:15:39 +02002212 YYPOPSTACK (1);
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002213 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07002214#ifndef yyoverflow
2215 if (yyss != yyssa)
2216 YYSTACK_FREE (yyss);
2217#endif
Sam Ravnborg14f31562007-09-26 20:15:39 +02002218#if YYERROR_VERBOSE
2219 if (yymsg != yymsgbuf)
2220 YYSTACK_FREE (yymsg);
2221#endif
2222 /* Make sure YYID is used. */
2223 return YYID (yyresult);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002224}
2225
2226
2227
2228
2229
2230void conf_parse(const char *name)
2231{
2232 struct symbol *sym;
2233 int i;
2234
2235 zconf_initscan(name);
2236
2237 sym_init();
nir.tzachar@gmail.com692d97c2009-11-25 12:28:43 +02002238 _menu_init();
Roman Zippelface4372006-06-08 22:12:45 -07002239 modules_sym = sym_lookup(NULL, 0);
2240 modules_sym->type = S_BOOLEAN;
2241 modules_sym->flags |= SYMBOL_AUTO;
blaisorblade@yahoo.itfb7f6ff2005-07-28 17:56:25 +02002242 rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002243
Roman Zippela02f0572005-11-08 21:34:53 -08002244#if YYDEBUG
2245 if (getenv("ZCONF_DEBUG"))
2246 zconfdebug = 1;
2247#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07002248 zconfparse();
2249 if (zconfnerrs)
2250 exit(1);
Roman Zippelface4372006-06-08 22:12:45 -07002251 if (!modules_sym->prop) {
2252 struct property *prop;
2253
2254 prop = prop_alloc(P_DEFAULT, modules_sym);
2255 prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
2256 }
Arnaud Lacombec0920a12010-09-10 21:23:28 -04002257
2258 rootmenu.prompt->text = _(rootmenu.prompt->text);
2259 rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
2260
Linus Torvalds1da177e2005-04-16 15:20:36 -07002261 menu_finalize(&rootmenu);
2262 for_all_symbols(i, sym) {
Sam Ravnborg5447d342007-05-06 09:20:10 +02002263 if (sym_check_deps(sym))
2264 zconfnerrs++;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002265 }
Sam Ravnborg5447d342007-05-06 09:20:10 +02002266 if (zconfnerrs)
2267 exit(1);
Karsten Wiesebfc10002006-12-13 00:34:07 -08002268 sym_set_change_count(1);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002269}
2270
Josh Triplett65166572009-10-15 12:13:36 -07002271static const char *zconf_tokenname(int token)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002272{
2273 switch (token) {
2274 case T_MENU: return "menu";
2275 case T_ENDMENU: return "endmenu";
2276 case T_CHOICE: return "choice";
2277 case T_ENDCHOICE: return "endchoice";
2278 case T_IF: return "if";
2279 case T_ENDIF: return "endif";
Roman Zippela02f0572005-11-08 21:34:53 -08002280 case T_DEPENDS: return "depends";
Linus Torvalds1da177e2005-04-16 15:20:36 -07002281 }
2282 return "<token>";
2283}
2284
Roman Zippela02f0572005-11-08 21:34:53 -08002285static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002286{
Roman Zippela02f0572005-11-08 21:34:53 -08002287 if (id->token != endtoken) {
2288 zconf_error("unexpected '%s' within %s block",
2289 kconf_id_strings + id->name, zconf_tokenname(starttoken));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002290 zconfnerrs++;
2291 return false;
2292 }
2293 if (current_menu->file != current_file) {
Roman Zippela02f0572005-11-08 21:34:53 -08002294 zconf_error("'%s' in different file than '%s'",
2295 kconf_id_strings + id->name, zconf_tokenname(starttoken));
2296 fprintf(stderr, "%s:%d: location of the '%s'\n",
2297 current_menu->file->name, current_menu->lineno,
2298 zconf_tokenname(starttoken));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002299 zconfnerrs++;
2300 return false;
2301 }
2302 return true;
2303}
2304
2305static void zconfprint(const char *err, ...)
2306{
2307 va_list ap;
2308
Roman Zippela02f0572005-11-08 21:34:53 -08002309 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
2310 va_start(ap, err);
2311 vfprintf(stderr, err, ap);
2312 va_end(ap);
2313 fprintf(stderr, "\n");
2314}
2315
2316static void zconf_error(const char *err, ...)
2317{
2318 va_list ap;
2319
2320 zconfnerrs++;
2321 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
Linus Torvalds1da177e2005-04-16 15:20:36 -07002322 va_start(ap, err);
2323 vfprintf(stderr, err, ap);
2324 va_end(ap);
2325 fprintf(stderr, "\n");
2326}
2327
2328static void zconferror(const char *err)
2329{
Roman Zippela02f0572005-11-08 21:34:53 -08002330#if YYDEBUG
Linus Torvalds1da177e2005-04-16 15:20:36 -07002331 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
Roman Zippela02f0572005-11-08 21:34:53 -08002332#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07002333}
2334
Josh Triplett65166572009-10-15 12:13:36 -07002335static void print_quoted_string(FILE *out, const char *str)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002336{
2337 const char *p;
2338 int len;
2339
2340 putc('"', out);
2341 while ((p = strchr(str, '"'))) {
2342 len = p - str;
2343 if (len)
2344 fprintf(out, "%.*s", len, str);
2345 fputs("\\\"", out);
2346 str = p + 1;
2347 }
2348 fputs(str, out);
2349 putc('"', out);
2350}
2351
Josh Triplett65166572009-10-15 12:13:36 -07002352static void print_symbol(FILE *out, struct menu *menu)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002353{
2354 struct symbol *sym = menu->sym;
2355 struct property *prop;
2356
2357 if (sym_is_choice(sym))
Li Zefanc6ccc302010-04-14 11:44:20 +08002358 fprintf(out, "\nchoice\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07002359 else
Li Zefanc6ccc302010-04-14 11:44:20 +08002360 fprintf(out, "\nconfig %s\n", sym->name);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002361 switch (sym->type) {
2362 case S_BOOLEAN:
2363 fputs(" boolean\n", out);
2364 break;
2365 case S_TRISTATE:
2366 fputs(" tristate\n", out);
2367 break;
2368 case S_STRING:
2369 fputs(" string\n", out);
2370 break;
2371 case S_INT:
2372 fputs(" integer\n", out);
2373 break;
2374 case S_HEX:
2375 fputs(" hex\n", out);
2376 break;
2377 default:
2378 fputs(" ???\n", out);
2379 break;
2380 }
2381 for (prop = sym->prop; prop; prop = prop->next) {
2382 if (prop->menu != menu)
2383 continue;
2384 switch (prop->type) {
2385 case P_PROMPT:
2386 fputs(" prompt ", out);
2387 print_quoted_string(out, prop->text);
2388 if (!expr_is_yes(prop->visible.expr)) {
2389 fputs(" if ", out);
2390 expr_fprint(prop->visible.expr, out);
2391 }
2392 fputc('\n', out);
2393 break;
2394 case P_DEFAULT:
2395 fputs( " default ", out);
2396 expr_fprint(prop->expr, out);
2397 if (!expr_is_yes(prop->visible.expr)) {
2398 fputs(" if ", out);
2399 expr_fprint(prop->visible.expr, out);
2400 }
2401 fputc('\n', out);
2402 break;
2403 case P_CHOICE:
2404 fputs(" #choice value\n", out);
2405 break;
Li Zefanc6ccc302010-04-14 11:44:20 +08002406 case P_SELECT:
2407 fputs( " select ", out);
2408 expr_fprint(prop->expr, out);
2409 fputc('\n', out);
2410 break;
2411 case P_RANGE:
2412 fputs( " range ", out);
2413 expr_fprint(prop->expr, out);
2414 fputc('\n', out);
2415 break;
2416 case P_MENU:
2417 fputs( " menu ", out);
2418 print_quoted_string(out, prop->text);
2419 fputc('\n', out);
2420 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002421 default:
2422 fprintf(out, " unknown prop %d!\n", prop->type);
2423 break;
2424 }
2425 }
Sam Ravnborg03d29122007-07-21 00:00:36 +02002426 if (menu->help) {
2427 int len = strlen(menu->help);
2428 while (menu->help[--len] == '\n')
2429 menu->help[len] = 0;
2430 fprintf(out, " help\n%s\n", menu->help);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002431 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07002432}
2433
2434void zconfdump(FILE *out)
2435{
2436 struct property *prop;
2437 struct symbol *sym;
2438 struct menu *menu;
2439
2440 menu = rootmenu.list;
2441 while (menu) {
2442 if ((sym = menu->sym))
2443 print_symbol(out, menu);
2444 else if ((prop = menu->prompt)) {
2445 switch (prop->type) {
2446 case P_COMMENT:
2447 fputs("\ncomment ", out);
2448 print_quoted_string(out, prop->text);
2449 fputs("\n", out);
2450 break;
2451 case P_MENU:
2452 fputs("\nmenu ", out);
2453 print_quoted_string(out, prop->text);
2454 fputs("\n", out);
2455 break;
2456 default:
2457 ;
2458 }
2459 if (!expr_is_yes(prop->visible.expr)) {
2460 fputs(" depends ", out);
2461 expr_fprint(prop->visible.expr, out);
2462 fputc('\n', out);
2463 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07002464 }
2465
2466 if (menu->list)
2467 menu = menu->list;
2468 else if (menu->next)
2469 menu = menu->next;
2470 else while ((menu = menu->parent)) {
2471 if (menu->prompt && menu->prompt->type == P_MENU)
2472 fputs("\nendmenu\n", out);
2473 if (menu->next) {
2474 menu = menu->next;
2475 break;
2476 }
2477 }
2478 }
2479}
2480
2481#include "lex.zconf.c"
2482#include "util.c"
2483#include "confdata.c"
2484#include "expr.c"
2485#include "symbol.c"
2486#include "menu.c"
2487