blob: 211e1a277037f813aa8c4fb83d4a7aecb300b5ab [file] [log] [blame]
Arnaud Lacombe2f76b352011-05-23 01:08:19 -04001/* A Bison parser, made by GNU Bison 2.4.3. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002
Sam Ravnborg14f31562007-09-26 20:15:39 +02003/* Skeleton implementation for Bison's Yacc-like parsers in C
Josh Triplett1456edb2009-10-15 11:03:20 -07004
Arnaud Lacombe2f76b352011-05-23 01:08:19 -04005 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
6 2009, 2010 Free Software Foundation, Inc.
Josh Triplett1456edb2009-10-15 11:03:20 -07007
8 This program is free software: you can redistribute it and/or modify
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 it under the terms of the GNU General Public License as published by
Josh Triplett1456edb2009-10-15 11:03:20 -070010 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
Linus Torvalds1da177e2005-04-16 15:20:36 -070013 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
Josh Triplett1456edb2009-10-15 11:03:20 -070017
Linus Torvalds1da177e2005-04-16 15:20:36 -070018 You should have received a copy of the GNU General Public License
Josh Triplett1456edb2009-10-15 11:03:20 -070019 along with this program. If not, see <http://www.gnu.org/licenses/>. */
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
Sam Ravnborg14f31562007-09-26 20:15:39 +020021/* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
Josh Triplett1456edb2009-10-15 11:03:20 -070030
Sam Ravnborg14f31562007-09-26 20:15:39 +020031 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34/* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
Linus Torvalds1da177e2005-04-16 15:20:36 -070036
37/* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
43
44/* Identify Bison output. */
45#define YYBISON 1
46
Roman Zippelf6a88aa2006-06-08 22:12:44 -070047/* Bison version. */
Arnaud Lacombe2f76b352011-05-23 01:08:19 -040048#define YYBISON_VERSION "2.4.3"
Roman Zippelf6a88aa2006-06-08 22:12:44 -070049
Linus Torvalds1da177e2005-04-16 15:20:36 -070050/* Skeleton name. */
51#define YYSKELETON_NAME "yacc.c"
52
53/* Pure parsers. */
54#define YYPURE 0
55
Josh Triplett1456edb2009-10-15 11:03:20 -070056/* Push parsers. */
57#define YYPUSH 0
58
59/* Pull parsers. */
60#define YYPULL 1
61
Linus Torvalds1da177e2005-04-16 15:20:36 -070062/* Using locations. */
63#define YYLSP_NEEDED 0
64
Roman Zippel7a884882005-11-08 21:34:51 -080065/* Substitute the variable and function names. */
Josh Triplett1456edb2009-10-15 11:03:20 -070066#define yyparse zconfparse
67#define yylex zconflex
68#define yyerror zconferror
69#define yylval zconflval
70#define yychar zconfchar
71#define yydebug zconfdebug
72#define yynerrs zconfnerrs
73
74
75/* Copy the first part of user declarations. */
76
77
78/*
79 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
80 * Released under the terms of the GNU GPL v2.0.
81 */
82
83#include <ctype.h>
84#include <stdarg.h>
85#include <stdio.h>
86#include <stdlib.h>
87#include <string.h>
88#include <stdbool.h>
89
90#define LKC_DIRECT_LINK
91#include "lkc.h"
92
93#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
94
95#define PRINTD 0x0001
96#define DEBUG_PARSE 0x0002
97
98int cdebug = PRINTD;
99
100extern int zconflex(void);
101static void zconfprint(const char *err, ...);
102static void zconf_error(const char *err, ...);
103static void zconferror(const char *err);
Arnaud Lacombe2f76b352011-05-23 01:08:19 -0400104static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
Josh Triplett1456edb2009-10-15 11:03:20 -0700105
Andi Kleene66f25d2010-01-13 17:02:44 +0100106struct symbol *symbol_hash[SYMBOL_HASHSIZE];
Josh Triplett1456edb2009-10-15 11:03:20 -0700107
108static struct menu *current_menu, *current_entry;
109
Josh Triplett1456edb2009-10-15 11:03:20 -0700110
111
112
113/* Enabling traces. */
114#ifndef YYDEBUG
Arnaud Lacombe2f76b352011-05-23 01:08:19 -0400115# define YYDEBUG 1
Josh Triplett1456edb2009-10-15 11:03:20 -0700116#endif
117
118/* Enabling verbose error messages. */
119#ifdef YYERROR_VERBOSE
120# undef YYERROR_VERBOSE
121# define YYERROR_VERBOSE 1
122#else
123# define YYERROR_VERBOSE 0
124#endif
125
126/* Enabling the token table. */
127#ifndef YYTOKEN_TABLE
128# define YYTOKEN_TABLE 0
129#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130
131
132/* Tokens. */
133#ifndef YYTOKENTYPE
134# define YYTOKENTYPE
135 /* Put the tokens into the symbol table, so that GDB and other debuggers
136 know about them. */
137 enum yytokentype {
138 T_MAINMENU = 258,
139 T_MENU = 259,
140 T_ENDMENU = 260,
141 T_SOURCE = 261,
142 T_CHOICE = 262,
143 T_ENDCHOICE = 263,
144 T_COMMENT = 264,
145 T_CONFIG = 265,
146 T_MENUCONFIG = 266,
147 T_HELP = 267,
148 T_HELPTEXT = 268,
149 T_IF = 269,
150 T_ENDIF = 270,
151 T_DEPENDS = 271,
Sam Ravnborg14f31562007-09-26 20:15:39 +0200152 T_OPTIONAL = 272,
153 T_PROMPT = 273,
154 T_TYPE = 274,
155 T_DEFAULT = 275,
156 T_SELECT = 276,
157 T_RANGE = 277,
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300158 T_VISIBLE = 278,
159 T_OPTION = 279,
160 T_ON = 280,
161 T_WORD = 281,
162 T_WORD_QUOTE = 282,
163 T_UNEQUAL = 283,
164 T_CLOSE_PAREN = 284,
165 T_OPEN_PAREN = 285,
166 T_EOL = 286,
167 T_OR = 287,
168 T_AND = 288,
169 T_EQUAL = 289,
170 T_NOT = 290
Linus Torvalds1da177e2005-04-16 15:20:36 -0700171 };
172#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173
174
175
Sam Ravnborg14f31562007-09-26 20:15:39 +0200176#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
177typedef union YYSTYPE
Sam Ravnborg14f31562007-09-26 20:15:39 +0200178{
Josh Triplett1456edb2009-10-15 11:03:20 -0700179
180
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181 char *string;
Roman Zippela02f0572005-11-08 21:34:53 -0800182 struct file *file;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183 struct symbol *symbol;
184 struct expr *expr;
185 struct menu *menu;
Arnaud Lacombe2f76b352011-05-23 01:08:19 -0400186 const struct kconf_id *id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187
Josh Triplett1456edb2009-10-15 11:03:20 -0700188
189
190} YYSTYPE;
191# define YYSTYPE_IS_TRIVIAL 1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192# define yystype YYSTYPE /* obsolescent; will be withdrawn */
193# define YYSTYPE_IS_DECLARED 1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194#endif
195
196
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197/* Copy the second part of user declarations. */
198
199
Josh Triplett1456edb2009-10-15 11:03:20 -0700200/* Include zconf.hash.c here so it can see the token constants. */
201#include "zconf.hash.c"
202
Linus Torvalds1da177e2005-04-16 15:20:36 -0700203
204
Sam Ravnborg14f31562007-09-26 20:15:39 +0200205#ifdef short
206# undef short
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700207#endif
Sam Ravnborg14f31562007-09-26 20:15:39 +0200208
209#ifdef YYTYPE_UINT8
210typedef YYTYPE_UINT8 yytype_uint8;
211#else
212typedef unsigned char yytype_uint8;
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700213#endif
Sam Ravnborg14f31562007-09-26 20:15:39 +0200214
215#ifdef YYTYPE_INT8
216typedef YYTYPE_INT8 yytype_int8;
217#elif (defined __STDC__ || defined __C99__FUNC__ \
218 || defined __cplusplus || defined _MSC_VER)
219typedef signed char yytype_int8;
220#else
221typedef short int yytype_int8;
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700222#endif
Sam Ravnborg14f31562007-09-26 20:15:39 +0200223
224#ifdef YYTYPE_UINT16
225typedef YYTYPE_UINT16 yytype_uint16;
226#else
227typedef unsigned short int yytype_uint16;
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700228#endif
229
Sam Ravnborg14f31562007-09-26 20:15:39 +0200230#ifdef YYTYPE_INT16
231typedef YYTYPE_INT16 yytype_int16;
232#else
233typedef short int yytype_int16;
234#endif
235
236#ifndef YYSIZE_T
237# ifdef __SIZE_TYPE__
238# define YYSIZE_T __SIZE_TYPE__
239# elif defined size_t
240# define YYSIZE_T size_t
241# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
242 || defined __cplusplus || defined _MSC_VER)
243# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
244# define YYSIZE_T size_t
245# else
246# define YYSIZE_T unsigned int
247# endif
248#endif
249
250#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
251
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700252#ifndef YY_
Arnaud Lacombe2f76b352011-05-23 01:08:19 -0400253# if defined YYENABLE_NLS && YYENABLE_NLS
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700254# if ENABLE_NLS
255# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
256# define YY_(msgid) dgettext ("bison-runtime", msgid)
257# endif
258# endif
259# ifndef YY_
260# define YY_(msgid) msgid
261# endif
262#endif
263
Sam Ravnborg14f31562007-09-26 20:15:39 +0200264/* Suppress unused-variable warnings by "using" E. */
265#if ! defined lint || defined __GNUC__
266# define YYUSE(e) ((void) (e))
267#else
268# define YYUSE(e) /* empty */
269#endif
270
271/* Identity function, used to suppress warnings about constant conditions. */
272#ifndef lint
273# define YYID(n) (n)
274#else
275#if (defined __STDC__ || defined __C99__FUNC__ \
276 || defined __cplusplus || defined _MSC_VER)
277static int
Josh Triplett1456edb2009-10-15 11:03:20 -0700278YYID (int yyi)
Sam Ravnborg14f31562007-09-26 20:15:39 +0200279#else
280static int
Josh Triplett1456edb2009-10-15 11:03:20 -0700281YYID (yyi)
282 int yyi;
Sam Ravnborg14f31562007-09-26 20:15:39 +0200283#endif
284{
Josh Triplett1456edb2009-10-15 11:03:20 -0700285 return yyi;
Sam Ravnborg14f31562007-09-26 20:15:39 +0200286}
287#endif
288
289#if ! defined yyoverflow || YYERROR_VERBOSE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700290
291/* The parser invokes alloca or malloc; define the necessary symbols. */
292
Roman Zippel7a884882005-11-08 21:34:51 -0800293# ifdef YYSTACK_USE_ALLOCA
294# if YYSTACK_USE_ALLOCA
295# ifdef __GNUC__
296# define YYSTACK_ALLOC __builtin_alloca
Sam Ravnborg14f31562007-09-26 20:15:39 +0200297# elif defined __BUILTIN_VA_ARG_INCR
298# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
299# elif defined _AIX
300# define YYSTACK_ALLOC __alloca
301# elif defined _MSC_VER
302# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
303# define alloca _alloca
Linus Torvalds1da177e2005-04-16 15:20:36 -0700304# else
Roman Zippel7a884882005-11-08 21:34:51 -0800305# define YYSTACK_ALLOC alloca
Sam Ravnborg14f31562007-09-26 20:15:39 +0200306# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
307 || defined __cplusplus || defined _MSC_VER)
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700308# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200309# ifndef _STDLIB_H
310# define _STDLIB_H 1
311# endif
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700312# endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313# endif
314# endif
315# endif
316
317# ifdef YYSTACK_ALLOC
Sam Ravnborg14f31562007-09-26 20:15:39 +0200318 /* Pacify GCC's `empty if-body' warning. */
319# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700320# ifndef YYSTACK_ALLOC_MAXIMUM
321 /* The OS might guarantee only one guard page at the bottom of the stack,
322 and a page size can be as small as 4096 bytes. So we cannot safely
323 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
324 to allow for a few compiler-allocated temporary stack slots. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200325# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326# endif
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700327# else
Roman Zippel7a884882005-11-08 21:34:51 -0800328# define YYSTACK_ALLOC YYMALLOC
329# define YYSTACK_FREE YYFREE
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700330# ifndef YYSTACK_ALLOC_MAXIMUM
Sam Ravnborg14f31562007-09-26 20:15:39 +0200331# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700332# endif
Sam Ravnborg14f31562007-09-26 20:15:39 +0200333# if (defined __cplusplus && ! defined _STDLIB_H \
334 && ! ((defined YYMALLOC || defined malloc) \
335 && (defined YYFREE || defined free)))
336# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
337# ifndef _STDLIB_H
338# define _STDLIB_H 1
339# endif
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700340# endif
341# ifndef YYMALLOC
342# define YYMALLOC malloc
Sam Ravnborg14f31562007-09-26 20:15:39 +0200343# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
344 || defined __cplusplus || defined _MSC_VER)
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700345void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
346# endif
347# endif
348# ifndef YYFREE
349# define YYFREE free
Sam Ravnborg14f31562007-09-26 20:15:39 +0200350# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
351 || defined __cplusplus || defined _MSC_VER)
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700352void free (void *); /* INFRINGES ON USER NAME SPACE */
353# endif
354# endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700355# endif
Sam Ravnborg14f31562007-09-26 20:15:39 +0200356#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700357
358
Sam Ravnborg14f31562007-09-26 20:15:39 +0200359#if (! defined yyoverflow \
360 && (! defined __cplusplus \
361 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700362
363/* A type that is properly aligned for any stack member. */
364union yyalloc
365{
Josh Triplett1456edb2009-10-15 11:03:20 -0700366 yytype_int16 yyss_alloc;
367 YYSTYPE yyvs_alloc;
368};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369
370/* The size of the maximum gap between one aligned stack and the next. */
371# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
372
373/* The size of an array large to enough to hold all stacks, each with
374 N elements. */
375# define YYSTACK_BYTES(N) \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200376 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377 + YYSTACK_GAP_MAXIMUM)
378
379/* Copy COUNT objects from FROM to TO. The source and destination do
380 not overlap. */
381# ifndef YYCOPY
Sam Ravnborg14f31562007-09-26 20:15:39 +0200382# if defined __GNUC__ && 1 < __GNUC__
Linus Torvalds1da177e2005-04-16 15:20:36 -0700383# define YYCOPY(To, From, Count) \
384 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
385# else
386# define YYCOPY(To, From, Count) \
387 do \
388 { \
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700389 YYSIZE_T yyi; \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700390 for (yyi = 0; yyi < (Count); yyi++) \
391 (To)[yyi] = (From)[yyi]; \
392 } \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200393 while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700394# endif
395# endif
396
397/* Relocate STACK from its old location to the new one. The
398 local variables YYSIZE and YYSTACKSIZE give the old and new number of
399 elements in the stack, and YYPTR gives the new location of the
400 stack. Advance YYPTR to a properly aligned location for the next
401 stack. */
Josh Triplett1456edb2009-10-15 11:03:20 -0700402# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700403 do \
404 { \
405 YYSIZE_T yynewbytes; \
Josh Triplett1456edb2009-10-15 11:03:20 -0700406 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
407 Stack = &yyptr->Stack_alloc; \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700408 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
409 yyptr += yynewbytes / sizeof (*yyptr); \
410 } \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200411 while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700412
413#endif
414
Sam Ravnborg14f31562007-09-26 20:15:39 +0200415/* YYFINAL -- State number of the termination state. */
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400416#define YYFINAL 11
Linus Torvalds1da177e2005-04-16 15:20:36 -0700417/* YYLAST -- Last index in YYTABLE. */
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300418#define YYLAST 290
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419
Sam Ravnborg14f31562007-09-26 20:15:39 +0200420/* YYNTOKENS -- Number of terminals. */
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300421#define YYNTOKENS 36
Sam Ravnborg14f31562007-09-26 20:15:39 +0200422/* YYNNTS -- Number of nonterminals. */
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300423#define YYNNTS 50
Sam Ravnborg14f31562007-09-26 20:15:39 +0200424/* YYNRULES -- Number of rules. */
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300425#define YYNRULES 118
Sam Ravnborg14f31562007-09-26 20:15:39 +0200426/* YYNRULES -- Number of states. */
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300427#define YYNSTATES 191
Linus Torvalds1da177e2005-04-16 15:20:36 -0700428
429/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
430#define YYUNDEFTOK 2
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300431#define YYMAXUTOK 290
Linus Torvalds1da177e2005-04-16 15:20:36 -0700432
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700433#define YYTRANSLATE(YYX) \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700434 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
435
436/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200437static const yytype_uint8 yytranslate[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700438{
439 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
465 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
466 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300467 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
468 35
Linus Torvalds1da177e2005-04-16 15:20:36 -0700469};
470
471#if YYDEBUG
472/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
473 YYRHS. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200474static const yytype_uint16 yyprhs[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700475{
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400476 0, 0, 3, 6, 8, 11, 13, 14, 17, 20,
477 23, 26, 31, 36, 40, 42, 44, 46, 48, 50,
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300478 52, 54, 56, 58, 60, 62, 64, 66, 68, 72,
479 75, 79, 82, 86, 89, 90, 93, 96, 99, 102,
480 105, 108, 112, 117, 122, 127, 133, 137, 138, 142,
481 143, 146, 150, 153, 155, 159, 160, 163, 166, 169,
482 172, 175, 180, 184, 187, 192, 193, 196, 200, 202,
483 206, 207, 210, 213, 216, 220, 224, 228, 230, 234,
484 235, 238, 241, 244, 248, 252, 255, 258, 261, 262,
485 265, 268, 271, 276, 277, 280, 283, 286, 287, 290,
486 292, 294, 297, 300, 303, 305, 308, 309, 312, 314,
487 318, 322, 326, 329, 333, 337, 339, 341, 342
Linus Torvalds1da177e2005-04-16 15:20:36 -0700488};
489
Sam Ravnborg14f31562007-09-26 20:15:39 +0200490/* YYRHS -- A `-1'-separated list of the rules' RHS. */
491static const yytype_int8 yyrhs[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700492{
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300493 37, 0, -1, 81, 38, -1, 38, -1, 63, 39,
494 -1, 39, -1, -1, 39, 41, -1, 39, 55, -1,
495 39, 67, -1, 39, 80, -1, 39, 26, 1, 31,
496 -1, 39, 40, 1, 31, -1, 39, 1, 31, -1,
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400497 16, -1, 18, -1, 19, -1, 21, -1, 17, -1,
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300498 22, -1, 20, -1, 23, -1, 31, -1, 61, -1,
499 71, -1, 44, -1, 46, -1, 69, -1, 26, 1,
500 31, -1, 1, 31, -1, 10, 26, 31, -1, 43,
501 47, -1, 11, 26, 31, -1, 45, 47, -1, -1,
502 47, 48, -1, 47, 49, -1, 47, 75, -1, 47,
503 73, -1, 47, 42, -1, 47, 31, -1, 19, 78,
504 31, -1, 18, 79, 82, 31, -1, 20, 83, 82,
505 31, -1, 21, 26, 82, 31, -1, 22, 84, 84,
506 82, 31, -1, 24, 50, 31, -1, -1, 50, 26,
507 51, -1, -1, 34, 79, -1, 7, 85, 31, -1,
508 52, 56, -1, 80, -1, 53, 58, 54, -1, -1,
509 56, 57, -1, 56, 75, -1, 56, 73, -1, 56,
510 31, -1, 56, 42, -1, 18, 79, 82, 31, -1,
511 19, 78, 31, -1, 17, 31, -1, 20, 26, 82,
512 31, -1, -1, 58, 41, -1, 14, 83, 81, -1,
513 80, -1, 59, 62, 60, -1, -1, 62, 41, -1,
514 62, 67, -1, 62, 55, -1, 3, 79, 81, -1,
515 4, 79, 31, -1, 64, 76, 74, -1, 80, -1,
516 65, 68, 66, -1, -1, 68, 41, -1, 68, 67,
517 -1, 68, 55, -1, 6, 79, 31, -1, 9, 79,
518 31, -1, 70, 74, -1, 12, 31, -1, 72, 13,
519 -1, -1, 74, 75, -1, 74, 31, -1, 74, 42,
520 -1, 16, 25, 83, 31, -1, -1, 76, 77, -1,
521 76, 31, -1, 23, 82, -1, -1, 79, 82, -1,
522 26, -1, 27, -1, 5, 31, -1, 8, 31, -1,
523 15, 31, -1, 31, -1, 81, 31, -1, -1, 14,
524 83, -1, 84, -1, 84, 34, 84, -1, 84, 28,
525 84, -1, 30, 83, 29, -1, 35, 83, -1, 83,
526 32, 83, -1, 83, 33, 83, -1, 26, -1, 27,
527 -1, -1, 26, -1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700528};
529
530/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200531static const yytype_uint16 yyrline[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700532{
Arnaud Lacombe2f76b352011-05-23 01:08:19 -0400533 0, 104, 104, 104, 106, 106, 108, 110, 111, 112,
534 113, 114, 115, 119, 123, 123, 123, 123, 123, 123,
535 123, 123, 127, 128, 129, 130, 131, 132, 136, 137,
536 143, 151, 157, 165, 175, 177, 178, 179, 180, 181,
537 182, 185, 193, 199, 209, 215, 221, 224, 226, 237,
538 238, 243, 252, 257, 265, 268, 270, 271, 272, 273,
539 274, 277, 283, 294, 300, 310, 312, 317, 325, 333,
540 336, 338, 339, 340, 345, 352, 359, 364, 372, 375,
541 377, 378, 379, 382, 390, 397, 404, 410, 417, 419,
542 420, 421, 424, 432, 434, 435, 438, 445, 447, 452,
543 453, 456, 457, 458, 462, 463, 466, 467, 470, 471,
544 472, 473, 474, 475, 476, 479, 480, 483, 484
Linus Torvalds1da177e2005-04-16 15:20:36 -0700545};
546#endif
547
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700548#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
549/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
Sam Ravnborg14f31562007-09-26 20:15:39 +0200550 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700551static const char *const yytname[] =
552{
Roman Zippel7a884882005-11-08 21:34:51 -0800553 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
554 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
555 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
Sam Ravnborg14f31562007-09-26 20:15:39 +0200556 "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE",
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300557 "T_VISIBLE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
Sam Ravnborg14f31562007-09-26 20:15:39 +0200558 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400559 "T_NOT", "$accept", "input", "start", "stmt_list", "option_name",
560 "common_stmt", "option_error", "config_entry_start", "config_stmt",
Roman Zippela02f0572005-11-08 21:34:53 -0800561 "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700562 "config_option", "symbol_option", "symbol_option_list",
563 "symbol_option_arg", "choice", "choice_entry", "choice_end",
564 "choice_stmt", "choice_option_list", "choice_option", "choice_block",
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400565 "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu",
566 "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt",
567 "comment", "comment_stmt", "help_start", "help", "depends_list",
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300568 "depends", "visibility_list", "visible", "prompt_stmt_opt", "prompt",
569 "end", "nl", "if_expr", "expr", "symbol", "word_opt", 0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700570};
571#endif
572
573# ifdef YYPRINT
574/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
575 token YYLEX-NUM. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200576static const yytype_uint16 yytoknum[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700577{
578 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
579 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
580 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300581 285, 286, 287, 288, 289, 290
Linus Torvalds1da177e2005-04-16 15:20:36 -0700582};
583# endif
584
585/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200586static const yytype_uint8 yyr1[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700587{
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300588 0, 36, 37, 37, 38, 38, 39, 39, 39, 39,
589 39, 39, 39, 39, 40, 40, 40, 40, 40, 40,
590 40, 40, 41, 41, 41, 41, 41, 41, 42, 42,
591 43, 44, 45, 46, 47, 47, 47, 47, 47, 47,
592 47, 48, 48, 48, 48, 48, 49, 50, 50, 51,
593 51, 52, 53, 54, 55, 56, 56, 56, 56, 56,
594 56, 57, 57, 57, 57, 58, 58, 59, 60, 61,
595 62, 62, 62, 62, 63, 64, 65, 66, 67, 68,
596 68, 68, 68, 69, 70, 71, 72, 73, 74, 74,
597 74, 74, 75, 76, 76, 76, 77, 78, 78, 79,
598 79, 80, 80, 80, 81, 81, 82, 82, 83, 83,
599 83, 83, 83, 83, 83, 84, 84, 85, 85
Linus Torvalds1da177e2005-04-16 15:20:36 -0700600};
601
602/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200603static const yytype_uint8 yyr2[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700604{
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400605 0, 2, 2, 1, 2, 1, 0, 2, 2, 2,
606 2, 4, 4, 3, 1, 1, 1, 1, 1, 1,
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300607 1, 1, 1, 1, 1, 1, 1, 1, 3, 2,
608 3, 2, 3, 2, 0, 2, 2, 2, 2, 2,
609 2, 3, 4, 4, 4, 5, 3, 0, 3, 0,
610 2, 3, 2, 1, 3, 0, 2, 2, 2, 2,
611 2, 4, 3, 2, 4, 0, 2, 3, 1, 3,
612 0, 2, 2, 2, 3, 3, 3, 1, 3, 0,
613 2, 2, 2, 3, 3, 2, 2, 2, 0, 2,
614 2, 2, 4, 0, 2, 2, 2, 0, 2, 1,
615 1, 2, 2, 2, 1, 2, 0, 2, 1, 3,
616 3, 3, 2, 3, 3, 1, 1, 0, 1
Linus Torvalds1da177e2005-04-16 15:20:36 -0700617};
618
619/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
620 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
621 means the default is an error. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200622static const yytype_uint8 yydefact[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700623{
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300624 6, 0, 104, 0, 3, 0, 6, 6, 99, 100,
625 0, 1, 0, 0, 0, 0, 117, 0, 0, 0,
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400626 0, 0, 0, 14, 18, 15, 16, 20, 17, 19,
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300627 21, 0, 22, 0, 7, 34, 25, 34, 26, 55,
628 65, 8, 70, 23, 93, 79, 9, 27, 88, 24,
629 10, 0, 105, 2, 74, 13, 0, 101, 0, 118,
630 0, 102, 0, 0, 0, 115, 116, 0, 0, 0,
631 108, 103, 0, 0, 0, 0, 0, 0, 0, 88,
632 0, 0, 75, 83, 51, 84, 30, 32, 0, 112,
633 0, 0, 67, 0, 0, 11, 12, 0, 0, 0,
634 0, 97, 0, 0, 0, 47, 0, 40, 39, 35,
635 36, 0, 38, 37, 0, 0, 97, 0, 59, 60,
636 56, 58, 57, 66, 54, 53, 71, 73, 69, 72,
637 68, 106, 95, 0, 94, 80, 82, 78, 81, 77,
638 90, 91, 89, 111, 113, 114, 110, 109, 29, 86,
639 0, 106, 0, 106, 106, 106, 0, 0, 0, 87,
640 63, 106, 0, 106, 0, 96, 0, 0, 41, 98,
641 0, 0, 106, 49, 46, 28, 0, 62, 0, 107,
642 92, 42, 43, 44, 0, 0, 48, 61, 64, 45,
643 50
Linus Torvalds1da177e2005-04-16 15:20:36 -0700644};
645
Sam Ravnborg14f31562007-09-26 20:15:39 +0200646/* YYDEFGOTO[NTERM-NUM]. */
647static const yytype_int16 yydefgoto[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700648{
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300649 -1, 3, 4, 5, 33, 34, 108, 35, 36, 37,
650 38, 74, 109, 110, 157, 186, 39, 40, 124, 41,
651 76, 120, 77, 42, 128, 43, 78, 6, 44, 45,
652 137, 46, 80, 47, 48, 49, 111, 112, 81, 113,
653 79, 134, 152, 153, 50, 7, 165, 69, 70, 60
Linus Torvalds1da177e2005-04-16 15:20:36 -0700654};
655
656/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
657 STATE-NUM. */
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300658#define YYPACT_NINF -90
Sam Ravnborg14f31562007-09-26 20:15:39 +0200659static const yytype_int16 yypact[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700660{
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300661 4, 42, -90, 96, -90, 111, -90, 15, -90, -90,
662 75, -90, 82, 42, 104, 42, 110, 107, 42, 115,
663 125, -4, 121, -90, -90, -90, -90, -90, -90, -90,
664 -90, 162, -90, 163, -90, -90, -90, -90, -90, -90,
665 -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
666 -90, 139, -90, -90, 138, -90, 142, -90, 143, -90,
667 152, -90, 164, 167, 168, -90, -90, -4, -4, 77,
668 -18, -90, 177, 185, 33, 71, 195, 247, 236, -2,
669 236, 171, -90, -90, -90, -90, -90, -90, 41, -90,
670 -4, -4, 138, 97, 97, -90, -90, 186, 187, 194,
671 42, 42, -4, 196, 97, -90, 219, -90, -90, -90,
672 -90, 210, -90, -90, 204, 42, 42, 199, -90, -90,
673 -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
674 -90, 222, -90, 223, -90, -90, -90, -90, -90, -90,
675 -90, -90, -90, -90, 215, -90, -90, -90, -90, -90,
676 -4, 222, 228, 222, -5, 222, 97, 35, 229, -90,
677 -90, 222, 232, 222, -4, -90, 135, 233, -90, -90,
678 234, 235, 222, 240, -90, -90, 237, -90, 239, -13,
679 -90, -90, -90, -90, 244, 42, -90, -90, -90, -90,
680 -90
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 Lacombe09899c92010-11-06 18:30:24 -0300686 -90, -90, 269, 271, -90, 23, -70, -90, -90, -90,
687 -90, 243, -90, -90, -90, -90, -90, -90, -90, -48,
688 -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
689 -90, -20, -90, -90, -90, -90, -90, 206, 205, -68,
690 -90, -90, 169, -1, 27, -7, 118, -66, -89, -90
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 Lacombe09899c92010-11-06 18:30:24 -0300697#define YYTABLE_NINF -86
Sam Ravnborg14f31562007-09-26 20:15:39 +0200698static const yytype_int16 yytable[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700699{
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300700 10, 88, 89, 54, 146, 147, 119, 1, 122, 164,
701 93, 141, 56, 142, 58, 156, 94, 62, 1, 90,
702 91, 131, 65, 66, 144, 145, 67, 90, 91, 132,
703 127, 68, 136, -31, 97, 2, 154, -31, -31, -31,
704 -31, -31, -31, -31, -31, 98, 52, -31, -31, 99,
705 -31, 100, 101, 102, 103, 104, -31, 105, 129, 106,
706 138, 173, 92, 141, 107, 142, 174, 172, 8, 9,
707 143, -33, 97, 90, 91, -33, -33, -33, -33, -33,
708 -33, -33, -33, 98, 166, -33, -33, 99, -33, 100,
709 101, 102, 103, 104, -33, 105, 11, 106, 179, 151,
710 123, 126, 107, 135, 125, 130, 2, 139, 2, 90,
711 91, -5, 12, 55, 161, 13, 14, 15, 16, 17,
712 18, 19, 20, 65, 66, 21, 22, 23, 24, 25,
713 26, 27, 28, 29, 30, 57, 59, 31, 61, -4,
714 12, 63, 32, 13, 14, 15, 16, 17, 18, 19,
715 20, 64, 71, 21, 22, 23, 24, 25, 26, 27,
716 28, 29, 30, 72, 73, 31, 180, 90, 91, 52,
717 32, -85, 97, 82, 83, -85, -85, -85, -85, -85,
718 -85, -85, -85, 84, 190, -85, -85, 99, -85, -85,
719 -85, -85, -85, -85, -85, 85, 97, 106, 86, 87,
720 -52, -52, 140, -52, -52, -52, -52, 98, 95, -52,
721 -52, 99, 114, 115, 116, 117, 96, 148, 149, 150,
722 158, 106, 155, 159, 97, 163, 118, -76, -76, -76,
723 -76, -76, -76, -76, -76, 160, 164, -76, -76, 99,
724 13, 14, 15, 16, 17, 18, 19, 20, 91, 106,
725 21, 22, 14, 15, 140, 17, 18, 19, 20, 168,
726 175, 21, 22, 177, 181, 182, 183, 32, 187, 167,
727 188, 169, 170, 171, 185, 189, 53, 51, 32, 176,
728 75, 178, 121, 0, 133, 162, 0, 0, 0, 0,
729 184
Linus Torvalds1da177e2005-04-16 15:20:36 -0700730};
731
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300732static const yytype_int16 yycheck[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700733{
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300734 1, 67, 68, 10, 93, 94, 76, 3, 76, 14,
735 28, 81, 13, 81, 15, 104, 34, 18, 3, 32,
736 33, 23, 26, 27, 90, 91, 30, 32, 33, 31,
737 78, 35, 80, 0, 1, 31, 102, 4, 5, 6,
738 7, 8, 9, 10, 11, 12, 31, 14, 15, 16,
739 17, 18, 19, 20, 21, 22, 23, 24, 78, 26,
740 80, 26, 69, 133, 31, 133, 31, 156, 26, 27,
741 29, 0, 1, 32, 33, 4, 5, 6, 7, 8,
742 9, 10, 11, 12, 150, 14, 15, 16, 17, 18,
743 19, 20, 21, 22, 23, 24, 0, 26, 164, 100,
744 77, 78, 31, 80, 77, 78, 31, 80, 31, 32,
745 33, 0, 1, 31, 115, 4, 5, 6, 7, 8,
746 9, 10, 11, 26, 27, 14, 15, 16, 17, 18,
747 19, 20, 21, 22, 23, 31, 26, 26, 31, 0,
748 1, 26, 31, 4, 5, 6, 7, 8, 9, 10,
749 11, 26, 31, 14, 15, 16, 17, 18, 19, 20,
750 21, 22, 23, 1, 1, 26, 31, 32, 33, 31,
751 31, 0, 1, 31, 31, 4, 5, 6, 7, 8,
752 9, 10, 11, 31, 185, 14, 15, 16, 17, 18,
753 19, 20, 21, 22, 23, 31, 1, 26, 31, 31,
754 5, 6, 31, 8, 9, 10, 11, 12, 31, 14,
755 15, 16, 17, 18, 19, 20, 31, 31, 31, 25,
756 1, 26, 26, 13, 1, 26, 31, 4, 5, 6,
757 7, 8, 9, 10, 11, 31, 14, 14, 15, 16,
758 4, 5, 6, 7, 8, 9, 10, 11, 33, 26,
759 14, 15, 5, 6, 31, 8, 9, 10, 11, 31,
760 31, 14, 15, 31, 31, 31, 31, 31, 31, 151,
761 31, 153, 154, 155, 34, 31, 7, 6, 31, 161,
762 37, 163, 76, -1, 79, 116, -1, -1, -1, -1,
763 172
Linus Torvalds1da177e2005-04-16 15:20:36 -0700764};
765
766/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
767 symbol of state STATE-NUM. */
Sam Ravnborg14f31562007-09-26 20:15:39 +0200768static const yytype_uint8 yystos[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700769{
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300770 0, 3, 31, 37, 38, 39, 63, 81, 26, 27,
771 79, 0, 1, 4, 5, 6, 7, 8, 9, 10,
Arnaud Lacombec0920a12010-09-10 21:23:28 -0400772 11, 14, 15, 16, 17, 18, 19, 20, 21, 22,
Arnaud Lacombe09899c92010-11-06 18:30:24 -0300773 23, 26, 31, 40, 41, 43, 44, 45, 46, 52,
774 53, 55, 59, 61, 64, 65, 67, 69, 70, 71,
775 80, 39, 31, 38, 81, 31, 79, 31, 79, 26,
776 85, 31, 79, 26, 26, 26, 27, 30, 35, 83,
777 84, 31, 1, 1, 47, 47, 56, 58, 62, 76,
778 68, 74, 31, 31, 31, 31, 31, 31, 83, 83,
779 32, 33, 81, 28, 34, 31, 31, 1, 12, 16,
780 18, 19, 20, 21, 22, 24, 26, 31, 42, 48,
781 49, 72, 73, 75, 17, 18, 19, 20, 31, 42,
782 57, 73, 75, 41, 54, 80, 41, 55, 60, 67,
783 80, 23, 31, 74, 77, 41, 55, 66, 67, 80,
784 31, 42, 75, 29, 83, 83, 84, 84, 31, 31,
785 25, 79, 78, 79, 83, 26, 84, 50, 1, 13,
786 31, 79, 78, 26, 14, 82, 83, 82, 31, 82,
787 82, 82, 84, 26, 31, 31, 82, 31, 82, 83,
788 31, 31, 31, 31, 82, 34, 51, 31, 31, 31,
789 79
Linus Torvalds1da177e2005-04-16 15:20:36 -0700790};
791
Linus Torvalds1da177e2005-04-16 15:20:36 -0700792#define yyerrok (yyerrstatus = 0)
793#define yyclearin (yychar = YYEMPTY)
794#define YYEMPTY (-2)
795#define YYEOF 0
796
797#define YYACCEPT goto yyacceptlab
798#define YYABORT goto yyabortlab
Roman Zippel7a884882005-11-08 21:34:51 -0800799#define YYERROR goto yyerrorlab
Linus Torvalds1da177e2005-04-16 15:20:36 -0700800
801
802/* Like YYERROR except do call yyerror. This remains here temporarily
803 to ease the transition to the new meaning of YYERROR, for GCC.
Arnaud Lacombe2f76b352011-05-23 01:08:19 -0400804 Once GCC version 2 has supplanted version 1, this can go. However,
805 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
806 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
807 discussed. */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700808
809#define YYFAIL goto yyerrlab
Arnaud Lacombe2f76b352011-05-23 01:08:19 -0400810#if defined YYFAIL
811 /* This is here to suppress warnings from the GCC cpp's
812 -Wunused-macros. Normally we don't worry about that warning, but
813 some users do, and we want to make it easy for users to remove
814 YYFAIL uses, which will produce warnings from Bison 2.5. */
815#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700816
817#define YYRECOVERING() (!!yyerrstatus)
818
819#define YYBACKUP(Token, Value) \
820do \
821 if (yychar == YYEMPTY && yylen == 1) \
822 { \
823 yychar = (Token); \
824 yylval = (Value); \
825 yytoken = YYTRANSLATE (yychar); \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200826 YYPOPSTACK (1); \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700827 goto yybackup; \
828 } \
829 else \
Roman Zippelf6a88aa2006-06-08 22:12:44 -0700830 { \
831 yyerror (YY_("syntax error: cannot back up")); \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700832 YYERROR; \
833 } \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200834while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700835
Roman Zippel7a884882005-11-08 21:34:51 -0800836
Linus Torvalds1da177e2005-04-16 15:20:36 -0700837#define YYTERROR 1
838#define YYERRCODE 256
839
Linus Torvalds1da177e2005-04-16 15:20:36 -0700840
Roman Zippel7a884882005-11-08 21:34:51 -0800841/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
842 If N is 0, then set CURRENT to the empty location which ends
843 the previous symbol: RHS[0] (always defined). */
844
845#define YYRHSLOC(Rhs, K) ((Rhs)[K])
Linus Torvalds1da177e2005-04-16 15:20:36 -0700846#ifndef YYLLOC_DEFAULT
Roman Zippel7a884882005-11-08 21:34:51 -0800847# define YYLLOC_DEFAULT(Current, Rhs, N) \
848 do \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200849 if (YYID (N)) \
Roman Zippel7a884882005-11-08 21:34:51 -0800850 { \
851 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
852 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
853 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
854 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
855 } \
856 else \
857 { \
858 (Current).first_line = (Current).last_line = \
859 YYRHSLOC (Rhs, 0).last_line; \
860 (Current).first_column = (Current).last_column = \
861 YYRHSLOC (Rhs, 0).last_column; \
862 } \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200863 while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700864#endif
865
Roman Zippel7a884882005-11-08 21:34:51 -0800866
867/* YY_LOCATION_PRINT -- Print the location on the stream.
868 This macro was not mandated originally: define only if we know
869 we won't break user code: when these are the locations we know. */
870
871#ifndef YY_LOCATION_PRINT
Arnaud Lacombe2f76b352011-05-23 01:08:19 -0400872# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
Roman Zippel7a884882005-11-08 21:34:51 -0800873# define YY_LOCATION_PRINT(File, Loc) \
874 fprintf (File, "%d.%d-%d.%d", \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200875 (Loc).first_line, (Loc).first_column, \
876 (Loc).last_line, (Loc).last_column)
Roman Zippel7a884882005-11-08 21:34:51 -0800877# else
878# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
879# endif
880#endif
881
882
Linus Torvalds1da177e2005-04-16 15:20:36 -0700883/* YYLEX -- calling `yylex' with the right arguments. */
884
885#ifdef YYLEX_PARAM
886# define YYLEX yylex (YYLEX_PARAM)
887#else
888# define YYLEX yylex ()
889#endif
890
891/* Enable debugging if requested. */
892#if YYDEBUG
893
894# ifndef YYFPRINTF
895# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
896# define YYFPRINTF fprintf
897# endif
898
899# define YYDPRINTF(Args) \
900do { \
901 if (yydebug) \
902 YYFPRINTF Args; \
Sam Ravnborg14f31562007-09-26 20:15:39 +0200903} while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700904
Sam Ravnborg14f31562007-09-26 20:15:39 +0200905# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
906do { \
907 if (yydebug) \
908 { \
909 YYFPRINTF (stderr, "%s ", Title); \
910 yy_symbol_print (stderr, \
911 Type, Value); \
912 YYFPRINTF (stderr, "\n"); \
913 } \
914} while (YYID (0))
915
916
917/*--------------------------------.
918| Print this symbol on YYOUTPUT. |
919`--------------------------------*/
920
921/*ARGSUSED*/
922#if (defined __STDC__ || defined __C99__FUNC__ \
923 || defined __cplusplus || defined _MSC_VER)
924static void
925yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
926#else
927static void
928yy_symbol_value_print (yyoutput, yytype, yyvaluep)
929 FILE *yyoutput;
930 int yytype;
931 YYSTYPE const * const yyvaluep;
932#endif
933{
934 if (!yyvaluep)
935 return;
936# ifdef YYPRINT
937 if (yytype < YYNTOKENS)
938 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
939# else
940 YYUSE (yyoutput);
941# endif
942 switch (yytype)
943 {
944 default:
945 break;
946 }
947}
948
949
950/*--------------------------------.
951| Print this symbol on YYOUTPUT. |
952`--------------------------------*/
953
954#if (defined __STDC__ || defined __C99__FUNC__ \
955 || defined __cplusplus || defined _MSC_VER)
956static void
957yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
958#else
959static void
960yy_symbol_print (yyoutput, yytype, yyvaluep)
961 FILE *yyoutput;
962 int yytype;
963 YYSTYPE const * const yyvaluep;
964#endif
965{
966 if (yytype < YYNTOKENS)
967 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
968 else
969 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
970
971 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
972 YYFPRINTF (yyoutput, ")");
973}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700974
975/*------------------------------------------------------------------.
976| yy_stack_print -- Print the state stack from its BOTTOM up to its |
Roman Zippel7a884882005-11-08 21:34:51 -0800977| TOP (included). |
Linus Torvalds1da177e2005-04-16 15:20:36 -0700978`------------------------------------------------------------------*/
979
Sam Ravnborg14f31562007-09-26 20:15:39 +0200980#if (defined __STDC__ || defined __C99__FUNC__ \
981 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700982static void
Josh Triplett1456edb2009-10-15 11:03:20 -0700983yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700984#else
985static void
Josh Triplett1456edb2009-10-15 11:03:20 -0700986yy_stack_print (yybottom, yytop)
987 yytype_int16 *yybottom;
988 yytype_int16 *yytop;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700989#endif
990{
991 YYFPRINTF (stderr, "Stack now");
Josh Triplett1456edb2009-10-15 11:03:20 -0700992 for (; yybottom <= yytop; yybottom++)
993 {
994 int yybot = *yybottom;
995 YYFPRINTF (stderr, " %d", yybot);
996 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700997 YYFPRINTF (stderr, "\n");
998}
999
1000# define YY_STACK_PRINT(Bottom, Top) \
1001do { \
1002 if (yydebug) \
1003 yy_stack_print ((Bottom), (Top)); \
Sam Ravnborg14f31562007-09-26 20:15:39 +02001004} while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -07001005
1006
1007/*------------------------------------------------.
1008| Report that the YYRULE is going to be reduced. |
1009`------------------------------------------------*/
1010
Sam Ravnborg14f31562007-09-26 20:15:39 +02001011#if (defined __STDC__ || defined __C99__FUNC__ \
1012 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001013static void
Sam Ravnborg14f31562007-09-26 20:15:39 +02001014yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001015#else
1016static void
Sam Ravnborg14f31562007-09-26 20:15:39 +02001017yy_reduce_print (yyvsp, yyrule)
1018 YYSTYPE *yyvsp;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001019 int yyrule;
1020#endif
1021{
Sam Ravnborg14f31562007-09-26 20:15:39 +02001022 int yynrhs = yyr2[yyrule];
Linus Torvalds1da177e2005-04-16 15:20:36 -07001023 int yyi;
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001024 unsigned long int yylno = yyrline[yyrule];
Sam Ravnborg14f31562007-09-26 20:15:39 +02001025 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1026 yyrule - 1, yylno);
1027 /* The symbols being reduced. */
1028 for (yyi = 0; yyi < yynrhs; yyi++)
1029 {
Josh Triplett1456edb2009-10-15 11:03:20 -07001030 YYFPRINTF (stderr, " $%d = ", yyi + 1);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001031 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1032 &(yyvsp[(yyi + 1) - (yynrhs)])
1033 );
Josh Triplett1456edb2009-10-15 11:03:20 -07001034 YYFPRINTF (stderr, "\n");
Sam Ravnborg14f31562007-09-26 20:15:39 +02001035 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07001036}
1037
1038# define YY_REDUCE_PRINT(Rule) \
1039do { \
1040 if (yydebug) \
Sam Ravnborg14f31562007-09-26 20:15:39 +02001041 yy_reduce_print (yyvsp, Rule); \
1042} while (YYID (0))
Linus Torvalds1da177e2005-04-16 15:20:36 -07001043
1044/* Nonzero means print parse trace. It is left uninitialized so that
1045 multiple parsers can coexist. */
1046int yydebug;
1047#else /* !YYDEBUG */
1048# define YYDPRINTF(Args)
Roman Zippel7a884882005-11-08 21:34:51 -08001049# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001050# define YY_STACK_PRINT(Bottom, Top)
1051# define YY_REDUCE_PRINT(Rule)
1052#endif /* !YYDEBUG */
1053
1054
1055/* YYINITDEPTH -- initial size of the parser's stacks. */
1056#ifndef YYINITDEPTH
1057# define YYINITDEPTH 200
1058#endif
1059
1060/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1061 if the built-in stack extension method is used).
1062
1063 Do not make this value too large; the results are undefined if
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001064 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001065 evaluated with infinite-precision integer arithmetic. */
1066
Linus Torvalds1da177e2005-04-16 15:20:36 -07001067#ifndef YYMAXDEPTH
1068# define YYMAXDEPTH 10000
1069#endif
1070
1071
1072
1073#if YYERROR_VERBOSE
1074
1075# ifndef yystrlen
Sam Ravnborg14f31562007-09-26 20:15:39 +02001076# if defined __GLIBC__ && defined _STRING_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07001077# define yystrlen strlen
1078# else
1079/* Return the length of YYSTR. */
Sam Ravnborg14f31562007-09-26 20:15:39 +02001080#if (defined __STDC__ || defined __C99__FUNC__ \
1081 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001082static YYSIZE_T
Linus Torvalds1da177e2005-04-16 15:20:36 -07001083yystrlen (const char *yystr)
Sam Ravnborg14f31562007-09-26 20:15:39 +02001084#else
1085static YYSIZE_T
Linus Torvalds1da177e2005-04-16 15:20:36 -07001086yystrlen (yystr)
Sam Ravnborg14f31562007-09-26 20:15:39 +02001087 const char *yystr;
1088#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001089{
Sam Ravnborg14f31562007-09-26 20:15:39 +02001090 YYSIZE_T yylen;
1091 for (yylen = 0; yystr[yylen]; yylen++)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001092 continue;
Sam Ravnborg14f31562007-09-26 20:15:39 +02001093 return yylen;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001094}
1095# endif
1096# endif
1097
1098# ifndef yystpcpy
Sam Ravnborg14f31562007-09-26 20:15:39 +02001099# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
Linus Torvalds1da177e2005-04-16 15:20:36 -07001100# define yystpcpy stpcpy
1101# else
1102/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1103 YYDEST. */
Sam Ravnborg14f31562007-09-26 20:15:39 +02001104#if (defined __STDC__ || defined __C99__FUNC__ \
1105 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001106static char *
Linus Torvalds1da177e2005-04-16 15:20:36 -07001107yystpcpy (char *yydest, const char *yysrc)
Sam Ravnborg14f31562007-09-26 20:15:39 +02001108#else
1109static char *
Linus Torvalds1da177e2005-04-16 15:20:36 -07001110yystpcpy (yydest, yysrc)
Sam Ravnborg14f31562007-09-26 20:15:39 +02001111 char *yydest;
1112 const char *yysrc;
1113#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001114{
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001115 char *yyd = yydest;
1116 const char *yys = yysrc;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001117
1118 while ((*yyd++ = *yys++) != '\0')
1119 continue;
1120
1121 return yyd - 1;
1122}
1123# endif
1124# endif
1125
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001126# ifndef yytnamerr
1127/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1128 quotes and backslashes, so that it's suitable for yyerror. The
1129 heuristic is that double-quoting is unnecessary unless the string
1130 contains an apostrophe, a comma, or backslash (other than
1131 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1132 null, do not copy; instead, return the length of what the result
1133 would have been. */
1134static YYSIZE_T
1135yytnamerr (char *yyres, const char *yystr)
1136{
1137 if (*yystr == '"')
1138 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001139 YYSIZE_T yyn = 0;
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001140 char const *yyp = yystr;
1141
1142 for (;;)
1143 switch (*++yyp)
1144 {
1145 case '\'':
1146 case ',':
1147 goto do_not_strip_quotes;
1148
1149 case '\\':
1150 if (*++yyp != '\\')
1151 goto do_not_strip_quotes;
1152 /* Fall through. */
1153 default:
1154 if (yyres)
1155 yyres[yyn] = *yyp;
1156 yyn++;
1157 break;
1158
1159 case '"':
1160 if (yyres)
1161 yyres[yyn] = '\0';
1162 return yyn;
1163 }
1164 do_not_strip_quotes: ;
1165 }
1166
1167 if (! yyres)
1168 return yystrlen (yystr);
1169
1170 return yystpcpy (yyres, yystr) - yyres;
1171}
1172# endif
1173
Sam Ravnborg14f31562007-09-26 20:15:39 +02001174/* Copy into YYRESULT an error message about the unexpected token
1175 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1176 including the terminating null byte. If YYRESULT is null, do not
1177 copy anything; just return the number of bytes that would be
1178 copied. As a special case, return 0 if an ordinary "syntax error"
1179 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1180 size calculation. */
1181static YYSIZE_T
1182yysyntax_error (char *yyresult, int yystate, int yychar)
1183{
1184 int yyn = yypact[yystate];
Linus Torvalds1da177e2005-04-16 15:20:36 -07001185
Sam Ravnborg14f31562007-09-26 20:15:39 +02001186 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1187 return 0;
1188 else
1189 {
1190 int yytype = YYTRANSLATE (yychar);
1191 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1192 YYSIZE_T yysize = yysize0;
1193 YYSIZE_T yysize1;
1194 int yysize_overflow = 0;
1195 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1196 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1197 int yyx;
1198
1199# if 0
1200 /* This is so xgettext sees the translatable formats that are
1201 constructed on the fly. */
1202 YY_("syntax error, unexpected %s");
1203 YY_("syntax error, unexpected %s, expecting %s");
1204 YY_("syntax error, unexpected %s, expecting %s or %s");
1205 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1206 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1207# endif
1208 char *yyfmt;
1209 char const *yyf;
1210 static char const yyunexpected[] = "syntax error, unexpected %s";
1211 static char const yyexpecting[] = ", expecting %s";
1212 static char const yyor[] = " or %s";
1213 char yyformat[sizeof yyunexpected
1214 + sizeof yyexpecting - 1
1215 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1216 * (sizeof yyor - 1))];
1217 char const *yyprefix = yyexpecting;
1218
1219 /* Start YYX at -YYN if negative to avoid negative indexes in
1220 YYCHECK. */
1221 int yyxbegin = yyn < 0 ? -yyn : 0;
1222
1223 /* Stay within bounds of both yycheck and yytname. */
1224 int yychecklim = YYLAST - yyn + 1;
1225 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1226 int yycount = 1;
1227
1228 yyarg[0] = yytname[yytype];
1229 yyfmt = yystpcpy (yyformat, yyunexpected);
1230
1231 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1232 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1233 {
1234 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1235 {
1236 yycount = 1;
1237 yysize = yysize0;
1238 yyformat[sizeof yyunexpected - 1] = '\0';
1239 break;
1240 }
1241 yyarg[yycount++] = yytname[yyx];
1242 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1243 yysize_overflow |= (yysize1 < yysize);
1244 yysize = yysize1;
1245 yyfmt = yystpcpy (yyfmt, yyprefix);
1246 yyprefix = yyor;
1247 }
1248
1249 yyf = YY_(yyformat);
1250 yysize1 = yysize + yystrlen (yyf);
1251 yysize_overflow |= (yysize1 < yysize);
1252 yysize = yysize1;
1253
1254 if (yysize_overflow)
1255 return YYSIZE_MAXIMUM;
1256
1257 if (yyresult)
1258 {
1259 /* Avoid sprintf, as that infringes on the user's name space.
1260 Don't have undefined behavior even if the translation
1261 produced a string with the wrong number of "%s"s. */
1262 char *yyp = yyresult;
1263 int yyi = 0;
1264 while ((*yyp = *yyf) != '\0')
1265 {
1266 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1267 {
1268 yyp += yytnamerr (yyp, yyarg[yyi++]);
1269 yyf += 2;
1270 }
1271 else
1272 {
1273 yyp++;
1274 yyf++;
1275 }
1276 }
1277 }
1278 return yysize;
1279 }
1280}
1281#endif /* YYERROR_VERBOSE */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001282
1283
Linus Torvalds1da177e2005-04-16 15:20:36 -07001284/*-----------------------------------------------.
1285| Release the memory associated to this symbol. |
1286`-----------------------------------------------*/
1287
Sam Ravnborg14f31562007-09-26 20:15:39 +02001288/*ARGSUSED*/
1289#if (defined __STDC__ || defined __C99__FUNC__ \
1290 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001291static void
Roman Zippel7a884882005-11-08 21:34:51 -08001292yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001293#else
1294static void
Roman Zippel7a884882005-11-08 21:34:51 -08001295yydestruct (yymsg, yytype, yyvaluep)
1296 const char *yymsg;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001297 int yytype;
1298 YYSTYPE *yyvaluep;
1299#endif
1300{
Sam Ravnborg14f31562007-09-26 20:15:39 +02001301 YYUSE (yyvaluep);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001302
Roman Zippel7a884882005-11-08 21:34:51 -08001303 if (!yymsg)
1304 yymsg = "Deleting";
1305 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1306
Linus Torvalds1da177e2005-04-16 15:20:36 -07001307 switch (yytype)
1308 {
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001309 case 53: /* "choice_entry" */
Roman Zippela02f0572005-11-08 21:34:53 -08001310
Sam Ravnborg14f31562007-09-26 20:15:39 +02001311 {
Roman Zippela02f0572005-11-08 21:34:53 -08001312 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1313 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1314 if (current_menu == (yyvaluep->menu))
1315 menu_end_menu();
1316};
1317
Sam Ravnborg14f31562007-09-26 20:15:39 +02001318 break;
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001319 case 59: /* "if_entry" */
Roman Zippela02f0572005-11-08 21:34:53 -08001320
Sam Ravnborg14f31562007-09-26 20:15:39 +02001321 {
Roman Zippela02f0572005-11-08 21:34:53 -08001322 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1323 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1324 if (current_menu == (yyvaluep->menu))
1325 menu_end_menu();
1326};
1327
Sam Ravnborg14f31562007-09-26 20:15:39 +02001328 break;
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001329 case 65: /* "menu_entry" */
Roman Zippela02f0572005-11-08 21:34:53 -08001330
Sam Ravnborg14f31562007-09-26 20:15:39 +02001331 {
Roman Zippela02f0572005-11-08 21:34:53 -08001332 fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1333 (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1334 if (current_menu == (yyvaluep->menu))
1335 menu_end_menu();
1336};
1337
Sam Ravnborg14f31562007-09-26 20:15:39 +02001338 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001339
1340 default:
Sam Ravnborg14f31562007-09-26 20:15:39 +02001341 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001342 }
1343}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001344
1345/* Prevent warnings from -Wmissing-prototypes. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001346#ifdef YYPARSE_PARAM
Sam Ravnborg14f31562007-09-26 20:15:39 +02001347#if defined __STDC__ || defined __cplusplus
Linus Torvalds1da177e2005-04-16 15:20:36 -07001348int yyparse (void *YYPARSE_PARAM);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001349#else
Linus Torvalds1da177e2005-04-16 15:20:36 -07001350int yyparse ();
Sam Ravnborg14f31562007-09-26 20:15:39 +02001351#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001352#else /* ! YYPARSE_PARAM */
Sam Ravnborg14f31562007-09-26 20:15:39 +02001353#if defined __STDC__ || defined __cplusplus
Linus Torvalds1da177e2005-04-16 15:20:36 -07001354int yyparse (void);
1355#else
1356int yyparse ();
1357#endif
1358#endif /* ! YYPARSE_PARAM */
1359
1360
Josh Triplett1456edb2009-10-15 11:03:20 -07001361/* The lookahead symbol. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001362int yychar;
1363
Josh Triplett1456edb2009-10-15 11:03:20 -07001364/* The semantic value of the lookahead symbol. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001365YYSTYPE yylval;
1366
1367/* Number of syntax errors so far. */
1368int yynerrs;
1369
1370
1371
Josh Triplett1456edb2009-10-15 11:03:20 -07001372/*-------------------------.
1373| yyparse or yypush_parse. |
1374`-------------------------*/
Linus Torvalds1da177e2005-04-16 15:20:36 -07001375
1376#ifdef YYPARSE_PARAM
Sam Ravnborg14f31562007-09-26 20:15:39 +02001377#if (defined __STDC__ || defined __C99__FUNC__ \
1378 || defined __cplusplus || defined _MSC_VER)
1379int
1380yyparse (void *YYPARSE_PARAM)
1381#else
1382int
1383yyparse (YYPARSE_PARAM)
1384 void *YYPARSE_PARAM;
1385#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001386#else /* ! YYPARSE_PARAM */
Sam Ravnborg14f31562007-09-26 20:15:39 +02001387#if (defined __STDC__ || defined __C99__FUNC__ \
1388 || defined __cplusplus || defined _MSC_VER)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001389int
1390yyparse (void)
1391#else
1392int
1393yyparse ()
Sam Ravnborg14f31562007-09-26 20:15:39 +02001394
Linus Torvalds1da177e2005-04-16 15:20:36 -07001395#endif
1396#endif
1397{
Josh Triplett1456edb2009-10-15 11:03:20 -07001398
1399
1400 int yystate;
1401 /* Number of tokens to shift before error messages enabled. */
1402 int yyerrstatus;
1403
1404 /* The stacks and their tools:
1405 `yyss': related to states.
1406 `yyvs': related to semantic values.
1407
1408 Refer to the stacks thru separate pointers, to allow yyoverflow
1409 to reallocate them elsewhere. */
1410
1411 /* The state stack. */
1412 yytype_int16 yyssa[YYINITDEPTH];
1413 yytype_int16 *yyss;
1414 yytype_int16 *yyssp;
1415
1416 /* The semantic value stack. */
1417 YYSTYPE yyvsa[YYINITDEPTH];
1418 YYSTYPE *yyvs;
1419 YYSTYPE *yyvsp;
1420
1421 YYSIZE_T yystacksize;
1422
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001423 int yyn;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001424 int yyresult;
Josh Triplett1456edb2009-10-15 11:03:20 -07001425 /* Lookahead token as an internal (translated) token number. */
1426 int yytoken;
1427 /* The variables used to return semantic value and location from the
1428 action routines. */
1429 YYSTYPE yyval;
1430
Sam Ravnborg14f31562007-09-26 20:15:39 +02001431#if YYERROR_VERBOSE
1432 /* Buffer for error messages, and its allocated size. */
1433 char yymsgbuf[128];
1434 char *yymsg = yymsgbuf;
1435 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1436#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07001437
Sam Ravnborg14f31562007-09-26 20:15:39 +02001438#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
Linus Torvalds1da177e2005-04-16 15:20:36 -07001439
Sam Ravnborg14f31562007-09-26 20:15:39 +02001440 /* The number of symbols on the RHS of the reduced rule.
1441 Keep to zero when no symbol should be popped. */
1442 int yylen = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001443
Josh Triplett1456edb2009-10-15 11:03:20 -07001444 yytoken = 0;
1445 yyss = yyssa;
1446 yyvs = yyvsa;
1447 yystacksize = YYINITDEPTH;
1448
Linus Torvalds1da177e2005-04-16 15:20:36 -07001449 YYDPRINTF ((stderr, "Starting parse\n"));
1450
1451 yystate = 0;
1452 yyerrstatus = 0;
1453 yynerrs = 0;
Josh Triplett1456edb2009-10-15 11:03:20 -07001454 yychar = YYEMPTY; /* Cause a token to be read. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001455
1456 /* Initialize stack pointers.
1457 Waste one element of value and location stack
1458 so that they stay on the same level as the state stack.
1459 The wasted elements are never initialized. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001460 yyssp = yyss;
1461 yyvsp = yyvs;
1462
1463 goto yysetstate;
1464
1465/*------------------------------------------------------------.
1466| yynewstate -- Push a new state, which is found in yystate. |
1467`------------------------------------------------------------*/
1468 yynewstate:
1469 /* In all cases, when you get here, the value and location stacks
Sam Ravnborg14f31562007-09-26 20:15:39 +02001470 have just been pushed. So pushing a state here evens the stacks. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001471 yyssp++;
1472
1473 yysetstate:
1474 *yyssp = yystate;
1475
1476 if (yyss + yystacksize - 1 <= yyssp)
1477 {
1478 /* Get the current used size of the three stacks, in elements. */
1479 YYSIZE_T yysize = yyssp - yyss + 1;
1480
1481#ifdef yyoverflow
1482 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001483 /* Give user a chance to reallocate the stack. Use copies of
Linus Torvalds1da177e2005-04-16 15:20:36 -07001484 these so that the &'s don't force the real ones into
1485 memory. */
1486 YYSTYPE *yyvs1 = yyvs;
Sam Ravnborg14f31562007-09-26 20:15:39 +02001487 yytype_int16 *yyss1 = yyss;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001488
Linus Torvalds1da177e2005-04-16 15:20:36 -07001489 /* Each stack pointer address is followed by the size of the
1490 data in use in that stack, in bytes. This used to be a
1491 conditional around just the two extra args, but that might
1492 be undefined if yyoverflow is a macro. */
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001493 yyoverflow (YY_("memory exhausted"),
Linus Torvalds1da177e2005-04-16 15:20:36 -07001494 &yyss1, yysize * sizeof (*yyssp),
1495 &yyvs1, yysize * sizeof (*yyvsp),
Linus Torvalds1da177e2005-04-16 15:20:36 -07001496 &yystacksize);
1497
1498 yyss = yyss1;
1499 yyvs = yyvs1;
1500 }
1501#else /* no yyoverflow */
1502# ifndef YYSTACK_RELOCATE
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001503 goto yyexhaustedlab;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001504# else
1505 /* Extend the stack our own way. */
1506 if (YYMAXDEPTH <= yystacksize)
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001507 goto yyexhaustedlab;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001508 yystacksize *= 2;
1509 if (YYMAXDEPTH < yystacksize)
1510 yystacksize = YYMAXDEPTH;
1511
1512 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001513 yytype_int16 *yyss1 = yyss;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001514 union yyalloc *yyptr =
1515 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1516 if (! yyptr)
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001517 goto yyexhaustedlab;
Josh Triplett1456edb2009-10-15 11:03:20 -07001518 YYSTACK_RELOCATE (yyss_alloc, yyss);
1519 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001520# undef YYSTACK_RELOCATE
1521 if (yyss1 != yyssa)
1522 YYSTACK_FREE (yyss1);
1523 }
1524# endif
1525#endif /* no yyoverflow */
1526
1527 yyssp = yyss + yysize - 1;
1528 yyvsp = yyvs + yysize - 1;
1529
Linus Torvalds1da177e2005-04-16 15:20:36 -07001530 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1531 (unsigned long int) yystacksize));
1532
1533 if (yyss + yystacksize - 1 <= yyssp)
1534 YYABORT;
1535 }
1536
1537 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1538
Josh Triplett1456edb2009-10-15 11:03:20 -07001539 if (yystate == YYFINAL)
1540 YYACCEPT;
1541
Linus Torvalds1da177e2005-04-16 15:20:36 -07001542 goto yybackup;
1543
1544/*-----------.
1545| yybackup. |
1546`-----------*/
1547yybackup:
1548
Sam Ravnborg14f31562007-09-26 20:15:39 +02001549 /* Do appropriate processing given the current state. Read a
Josh Triplett1456edb2009-10-15 11:03:20 -07001550 lookahead token if we need one and don't already have one. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001551
Josh Triplett1456edb2009-10-15 11:03:20 -07001552 /* First try to decide what to do without reference to lookahead token. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001553 yyn = yypact[yystate];
1554 if (yyn == YYPACT_NINF)
1555 goto yydefault;
1556
Josh Triplett1456edb2009-10-15 11:03:20 -07001557 /* Not known => get a lookahead token if don't already have one. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001558
Josh Triplett1456edb2009-10-15 11:03:20 -07001559 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001560 if (yychar == YYEMPTY)
1561 {
1562 YYDPRINTF ((stderr, "Reading a token: "));
1563 yychar = YYLEX;
1564 }
1565
1566 if (yychar <= YYEOF)
1567 {
1568 yychar = yytoken = YYEOF;
1569 YYDPRINTF ((stderr, "Now at end of input.\n"));
1570 }
1571 else
1572 {
1573 yytoken = YYTRANSLATE (yychar);
Roman Zippel7a884882005-11-08 21:34:51 -08001574 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001575 }
1576
1577 /* If the proper action on seeing token YYTOKEN is to reduce or to
1578 detect an error, take that action. */
1579 yyn += yytoken;
1580 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1581 goto yydefault;
1582 yyn = yytable[yyn];
1583 if (yyn <= 0)
1584 {
1585 if (yyn == 0 || yyn == YYTABLE_NINF)
1586 goto yyerrlab;
1587 yyn = -yyn;
1588 goto yyreduce;
1589 }
1590
Linus Torvalds1da177e2005-04-16 15:20:36 -07001591 /* Count tokens shifted since error; after three, turn off error
1592 status. */
1593 if (yyerrstatus)
1594 yyerrstatus--;
1595
Josh Triplett1456edb2009-10-15 11:03:20 -07001596 /* Shift the lookahead token. */
Sam Ravnborg14f31562007-09-26 20:15:39 +02001597 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1598
Josh Triplett1456edb2009-10-15 11:03:20 -07001599 /* Discard the shifted token. */
1600 yychar = YYEMPTY;
Sam Ravnborg14f31562007-09-26 20:15:39 +02001601
Linus Torvalds1da177e2005-04-16 15:20:36 -07001602 yystate = yyn;
Sam Ravnborg14f31562007-09-26 20:15:39 +02001603 *++yyvsp = yylval;
1604
Linus Torvalds1da177e2005-04-16 15:20:36 -07001605 goto yynewstate;
1606
1607
1608/*-----------------------------------------------------------.
1609| yydefault -- do the default action for the current state. |
1610`-----------------------------------------------------------*/
1611yydefault:
1612 yyn = yydefact[yystate];
1613 if (yyn == 0)
1614 goto yyerrlab;
1615 goto yyreduce;
1616
1617
1618/*-----------------------------.
1619| yyreduce -- Do a reduction. |
1620`-----------------------------*/
1621yyreduce:
1622 /* yyn is the number of a rule to reduce with. */
1623 yylen = yyr2[yyn];
1624
1625 /* If YYLEN is nonzero, implement the default value of the action:
1626 `$$ = $1'.
1627
1628 Otherwise, the following line sets YYVAL to garbage.
1629 This behavior is undocumented and Bison
1630 users should not rely upon it. Assigning to YYVAL
1631 unconditionally makes the parser a bit smaller, and it avoids a
1632 GCC warning that YYVAL may be used uninitialized. */
1633 yyval = yyvsp[1-yylen];
1634
1635
1636 YY_REDUCE_PRINT (yyn);
1637 switch (yyn)
1638 {
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001639 case 10:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001640
Roman Zippela02f0572005-11-08 21:34:53 -08001641 { zconf_error("unexpected end statement"); ;}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001642 break;
1643
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001644 case 11:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001645
Sam Ravnborg14f31562007-09-26 20:15:39 +02001646 { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001647 break;
1648
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001649 case 12:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001650
Roman Zippela02f0572005-11-08 21:34:53 -08001651 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001652 zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
Roman Zippela02f0572005-11-08 21:34:53 -08001653;}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001654 break;
1655
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001656 case 13:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001657
Roman Zippela02f0572005-11-08 21:34:53 -08001658 { zconf_error("invalid statement"); ;}
Linus Torvalds1da177e2005-04-16 15:20:36 -07001659 break;
1660
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001661 case 28:
Roman Zippela02f0572005-11-08 21:34:53 -08001662
Sam Ravnborg14f31562007-09-26 20:15:39 +02001663 { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;}
Roman Zippela02f0572005-11-08 21:34:53 -08001664 break;
1665
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001666 case 29:
Roman Zippela02f0572005-11-08 21:34:53 -08001667
1668 { zconf_error("invalid option"); ;}
1669 break;
1670
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001671 case 30:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001672
1673 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001674 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001675 sym->flags |= SYMBOL_OPTIONAL;
1676 menu_add_entry(sym);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001677 printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001678;}
1679 break;
1680
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001681 case 31:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001682
1683 {
1684 menu_end_entry();
1685 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1686;}
1687 break;
1688
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001689 case 32:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001690
1691 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001692 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001693 sym->flags |= SYMBOL_OPTIONAL;
1694 menu_add_entry(sym);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001695 printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001696;}
1697 break;
1698
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001699 case 33:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001700
1701 {
1702 if (current_entry->prompt)
1703 current_entry->prompt->type = P_MENU;
1704 else
1705 zconfprint("warning: menuconfig statement without prompt");
1706 menu_end_entry();
1707 printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1708;}
1709 break;
1710
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001711 case 41:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001712
1713 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001714 menu_set_type((yyvsp[(1) - (3)].id)->stype);
Roman Zippel3370f9f2005-11-08 21:34:52 -08001715 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1716 zconf_curname(), zconf_lineno(),
Sam Ravnborg14f31562007-09-26 20:15:39 +02001717 (yyvsp[(1) - (3)].id)->stype);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001718;}
1719 break;
1720
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001721 case 42:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001722
1723 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001724 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001725 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1726;}
1727 break;
1728
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001729 case 43:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001730
1731 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001732 menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr));
1733 if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN)
1734 menu_set_type((yyvsp[(1) - (4)].id)->stype);
Roman Zippel3370f9f2005-11-08 21:34:52 -08001735 printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
1736 zconf_curname(), zconf_lineno(),
Sam Ravnborg14f31562007-09-26 20:15:39 +02001737 (yyvsp[(1) - (4)].id)->stype);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001738;}
1739 break;
1740
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001741 case 44:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001742
1743 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001744 menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001745 printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1746;}
1747 break;
1748
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001749 case 45:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001750
1751 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001752 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 -07001753 printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1754;}
1755 break;
1756
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001757 case 48:
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001758
1759 {
Arnaud Lacombe2f76b352011-05-23 01:08:19 -04001760 const struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001761 if (id && id->flags & TF_OPTION)
Sam Ravnborg14f31562007-09-26 20:15:39 +02001762 menu_add_option(id->token, (yyvsp[(3) - (3)].string));
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001763 else
Sam Ravnborg14f31562007-09-26 20:15:39 +02001764 zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string));
1765 free((yyvsp[(2) - (3)].string));
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001766;}
1767 break;
1768
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001769 case 49:
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001770
1771 { (yyval.string) = NULL; ;}
1772 break;
1773
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001774 case 50:
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001775
Sam Ravnborg14f31562007-09-26 20:15:39 +02001776 { (yyval.string) = (yyvsp[(2) - (2)].string); ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001777 break;
1778
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001779 case 51:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001780
1781 {
Roman Zippel5a1aa8a2008-02-29 05:11:50 +01001782 struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE);
1783 sym->flags |= SYMBOL_AUTO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001784 menu_add_entry(sym);
1785 menu_add_expr(P_CHOICE, NULL, NULL);
1786 printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1787;}
1788 break;
1789
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001790 case 52:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001791
1792 {
Roman Zippela02f0572005-11-08 21:34:53 -08001793 (yyval.menu) = menu_add_menu();
Linus Torvalds1da177e2005-04-16 15:20:36 -07001794;}
1795 break;
1796
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001797 case 53:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001798
1799 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001800 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001801 menu_end_menu();
1802 printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
1803 }
1804;}
1805 break;
1806
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001807 case 61:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001808
1809 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001810 menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001811 printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1812;}
1813 break;
1814
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001815 case 62:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001816
1817 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001818 if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) {
1819 menu_set_type((yyvsp[(1) - (3)].id)->stype);
Roman Zippel3370f9f2005-11-08 21:34:52 -08001820 printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1821 zconf_curname(), zconf_lineno(),
Sam Ravnborg14f31562007-09-26 20:15:39 +02001822 (yyvsp[(1) - (3)].id)->stype);
Roman Zippel3370f9f2005-11-08 21:34:52 -08001823 } else
1824 YYERROR;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001825;}
1826 break;
1827
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001828 case 63:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001829
1830 {
1831 current_entry->sym->flags |= SYMBOL_OPTIONAL;
1832 printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1833;}
1834 break;
1835
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001836 case 64:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001837
1838 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001839 if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) {
1840 menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
Roman Zippel3370f9f2005-11-08 21:34:52 -08001841 printd(DEBUG_PARSE, "%s:%d:default\n",
1842 zconf_curname(), zconf_lineno());
1843 } else
1844 YYERROR;
Linus Torvalds1da177e2005-04-16 15:20:36 -07001845;}
1846 break;
1847
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001848 case 67:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001849
1850 {
1851 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
1852 menu_add_entry(NULL);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001853 menu_add_dep((yyvsp[(2) - (3)].expr));
Roman Zippela02f0572005-11-08 21:34:53 -08001854 (yyval.menu) = menu_add_menu();
Linus Torvalds1da177e2005-04-16 15:20:36 -07001855;}
1856 break;
1857
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001858 case 68:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001859
1860 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001861 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07001862 menu_end_menu();
1863 printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
1864 }
1865;}
1866 break;
1867
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001868 case 74:
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001869
1870 {
1871 menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1872;}
1873 break;
1874
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001875 case 75:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001876
1877 {
1878 menu_add_entry(NULL);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001879 menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001880 printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1881;}
1882 break;
1883
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001884 case 76:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001885
1886 {
Roman Zippela02f0572005-11-08 21:34:53 -08001887 (yyval.menu) = menu_add_menu();
Linus Torvalds1da177e2005-04-16 15:20:36 -07001888;}
1889 break;
1890
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001891 case 77:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001892
1893 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001894 if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) {
Roman Zippela02f0572005-11-08 21:34:53 -08001895 menu_end_menu();
1896 printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
1897 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07001898;}
1899 break;
1900
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001901 case 83:
Roman Zippela02f0572005-11-08 21:34:53 -08001902
1903 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001904 printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1905 zconf_nextfile((yyvsp[(2) - (3)].string));
Roman Zippela02f0572005-11-08 21:34:53 -08001906;}
1907 break;
1908
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001909 case 84:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001910
1911 {
1912 menu_add_entry(NULL);
Sam Ravnborg14f31562007-09-26 20:15:39 +02001913 menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001914 printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1915;}
1916 break;
1917
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001918 case 85:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001919
1920 {
1921 menu_end_entry();
1922;}
1923 break;
1924
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001925 case 86:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001926
1927 {
1928 printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
1929 zconf_starthelp();
1930;}
1931 break;
1932
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001933 case 87:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001934
1935 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001936 current_entry->help = (yyvsp[(2) - (2)].string);
Linus Torvalds1da177e2005-04-16 15:20:36 -07001937;}
1938 break;
1939
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001940 case 92:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001941
1942 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001943 menu_add_dep((yyvsp[(3) - (4)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001944 printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
1945;}
1946 break;
1947
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001948 case 96:
1949
1950 {
1951 menu_add_visibility((yyvsp[(2) - (2)].expr));
1952;}
1953 break;
1954
1955 case 98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001956
1957 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02001958 menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
Linus Torvalds1da177e2005-04-16 15:20:36 -07001959;}
1960 break;
1961
Roman Zippela02f0572005-11-08 21:34:53 -08001962 case 101:
1963
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001964 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
Roman Zippela02f0572005-11-08 21:34:53 -08001965 break;
1966
1967 case 102:
1968
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001969 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
Roman Zippela02f0572005-11-08 21:34:53 -08001970 break;
1971
1972 case 103:
1973
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001974 { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001975 break;
1976
1977 case 106:
1978
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001979 { (yyval.expr) = NULL; ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001980 break;
1981
1982 case 107:
1983
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001984 { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07001985 break;
1986
1987 case 108:
1988
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001989 { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;}
Roman Zippel5a1aa8a2008-02-29 05:11:50 +01001990 break;
1991
1992 case 109:
1993
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001994 { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
Arnaud Lacombec0920a12010-09-10 21:23:28 -04001995 break;
1996
1997 case 110:
1998
Arnaud Lacombe09899c92010-11-06 18:30:24 -03001999 { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
Arnaud Lacombec0920a12010-09-10 21:23:28 -04002000 break;
2001
2002 case 111:
2003
Arnaud Lacombe09899c92010-11-06 18:30:24 -03002004 { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;}
Arnaud Lacombec0920a12010-09-10 21:23:28 -04002005 break;
2006
2007 case 112:
2008
Arnaud Lacombe09899c92010-11-06 18:30:24 -03002009 { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;}
2010 break;
2011
2012 case 113:
2013
2014 { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2015 break;
2016
2017 case 114:
2018
2019 { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
2020 break;
2021
2022 case 115:
2023
2024 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;}
2025 break;
2026
2027 case 116:
2028
2029 { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;}
2030 break;
2031
2032 case 117:
2033
Roman Zippel5a1aa8a2008-02-29 05:11:50 +01002034 { (yyval.string) = NULL; ;}
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002035 break;
2036
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002037
Linus Torvalds1da177e2005-04-16 15:20:36 -07002038
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002039 default: break;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002040 }
Sam Ravnborg14f31562007-09-26 20:15:39 +02002041 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002042
Sam Ravnborg14f31562007-09-26 20:15:39 +02002043 YYPOPSTACK (yylen);
2044 yylen = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002045 YY_STACK_PRINT (yyss, yyssp);
2046
2047 *++yyvsp = yyval;
2048
Linus Torvalds1da177e2005-04-16 15:20:36 -07002049 /* Now `shift' the result of the reduction. Determine what state
2050 that goes to, based on the state we popped back to and the rule
2051 number reduced by. */
2052
2053 yyn = yyr1[yyn];
2054
2055 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2056 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2057 yystate = yytable[yystate];
2058 else
2059 yystate = yydefgoto[yyn - YYNTOKENS];
2060
2061 goto yynewstate;
2062
2063
2064/*------------------------------------.
2065| yyerrlab -- here on detecting error |
2066`------------------------------------*/
2067yyerrlab:
2068 /* If not already recovering from an error, report this error. */
2069 if (!yyerrstatus)
2070 {
2071 ++yynerrs;
Sam Ravnborg14f31562007-09-26 20:15:39 +02002072#if ! YYERROR_VERBOSE
2073 yyerror (YY_("syntax error"));
2074#else
2075 {
2076 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2077 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2078 {
2079 YYSIZE_T yyalloc = 2 * yysize;
2080 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2081 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2082 if (yymsg != yymsgbuf)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002083 YYSTACK_FREE (yymsg);
Sam Ravnborg14f31562007-09-26 20:15:39 +02002084 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2085 if (yymsg)
2086 yymsg_alloc = yyalloc;
2087 else
2088 {
2089 yymsg = yymsgbuf;
2090 yymsg_alloc = sizeof yymsgbuf;
2091 }
2092 }
2093
2094 if (0 < yysize && yysize <= yymsg_alloc)
2095 {
2096 (void) yysyntax_error (yymsg, yystate, yychar);
2097 yyerror (yymsg);
2098 }
2099 else
2100 {
2101 yyerror (YY_("syntax error"));
2102 if (yysize != 0)
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002103 goto yyexhaustedlab;
Sam Ravnborg14f31562007-09-26 20:15:39 +02002104 }
2105 }
2106#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07002107 }
2108
2109
2110
2111 if (yyerrstatus == 3)
2112 {
Josh Triplett1456edb2009-10-15 11:03:20 -07002113 /* If just tried and failed to reuse lookahead token after an
Linus Torvalds1da177e2005-04-16 15:20:36 -07002114 error, discard it. */
2115
Roman Zippel7a884882005-11-08 21:34:51 -08002116 if (yychar <= YYEOF)
Sam Ravnborg14f31562007-09-26 20:15:39 +02002117 {
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002118 /* Return failure if at end of input. */
Roman Zippel7a884882005-11-08 21:34:51 -08002119 if (yychar == YYEOF)
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002120 YYABORT;
Sam Ravnborg14f31562007-09-26 20:15:39 +02002121 }
Roman Zippel7a884882005-11-08 21:34:51 -08002122 else
2123 {
Sam Ravnborg14f31562007-09-26 20:15:39 +02002124 yydestruct ("Error: discarding",
2125 yytoken, &yylval);
Roman Zippel7a884882005-11-08 21:34:51 -08002126 yychar = YYEMPTY;
2127 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07002128 }
2129
Josh Triplett1456edb2009-10-15 11:03:20 -07002130 /* Else will try to reuse lookahead token after shifting the error
Linus Torvalds1da177e2005-04-16 15:20:36 -07002131 token. */
2132 goto yyerrlab1;
2133
2134
Roman Zippel7a884882005-11-08 21:34:51 -08002135/*---------------------------------------------------.
2136| yyerrorlab -- error raised explicitly by YYERROR. |
2137`---------------------------------------------------*/
2138yyerrorlab:
2139
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002140 /* Pacify compilers like GCC when the user code never invokes
2141 YYERROR and the label yyerrorlab therefore never appears in user
2142 code. */
Sam Ravnborg14f31562007-09-26 20:15:39 +02002143 if (/*CONSTCOND*/ 0)
Roman Zippel7a884882005-11-08 21:34:51 -08002144 goto yyerrorlab;
Roman Zippel7a884882005-11-08 21:34:51 -08002145
Sam Ravnborg14f31562007-09-26 20:15:39 +02002146 /* Do not reclaim the symbols of the rule which action triggered
2147 this YYERROR. */
2148 YYPOPSTACK (yylen);
2149 yylen = 0;
2150 YY_STACK_PRINT (yyss, yyssp);
Roman Zippel7a884882005-11-08 21:34:51 -08002151 yystate = *yyssp;
2152 goto yyerrlab1;
2153
2154
2155/*-------------------------------------------------------------.
2156| yyerrlab1 -- common code for both syntax error and YYERROR. |
2157`-------------------------------------------------------------*/
Linus Torvalds1da177e2005-04-16 15:20:36 -07002158yyerrlab1:
2159 yyerrstatus = 3; /* Each real token shifted decrements this. */
2160
2161 for (;;)
2162 {
2163 yyn = yypact[yystate];
2164 if (yyn != YYPACT_NINF)
2165 {
2166 yyn += YYTERROR;
2167 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2168 {
2169 yyn = yytable[yyn];
2170 if (0 < yyn)
2171 break;
2172 }
2173 }
2174
2175 /* Pop the current state because it cannot handle the error token. */
2176 if (yyssp == yyss)
2177 YYABORT;
2178
Linus Torvalds1da177e2005-04-16 15:20:36 -07002179
Sam Ravnborg14f31562007-09-26 20:15:39 +02002180 yydestruct ("Error: popping",
2181 yystos[yystate], yyvsp);
2182 YYPOPSTACK (1);
Roman Zippel7a884882005-11-08 21:34:51 -08002183 yystate = *yyssp;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002184 YY_STACK_PRINT (yyss, yyssp);
2185 }
2186
Linus Torvalds1da177e2005-04-16 15:20:36 -07002187 *++yyvsp = yylval;
2188
2189
Sam Ravnborg14f31562007-09-26 20:15:39 +02002190 /* Shift the error token. */
Roman Zippel7a884882005-11-08 21:34:51 -08002191 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2192
Linus Torvalds1da177e2005-04-16 15:20:36 -07002193 yystate = yyn;
2194 goto yynewstate;
2195
2196
2197/*-------------------------------------.
2198| yyacceptlab -- YYACCEPT comes here. |
2199`-------------------------------------*/
2200yyacceptlab:
2201 yyresult = 0;
2202 goto yyreturn;
2203
2204/*-----------------------------------.
2205| yyabortlab -- YYABORT comes here. |
2206`-----------------------------------*/
2207yyabortlab:
2208 yyresult = 1;
2209 goto yyreturn;
2210
Josh Triplett1456edb2009-10-15 11:03:20 -07002211#if !defined(yyoverflow) || YYERROR_VERBOSE
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002212/*-------------------------------------------------.
2213| yyexhaustedlab -- memory exhaustion comes here. |
2214`-------------------------------------------------*/
2215yyexhaustedlab:
2216 yyerror (YY_("memory exhausted"));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002217 yyresult = 2;
2218 /* Fall through. */
2219#endif
2220
2221yyreturn:
Josh Triplett1456edb2009-10-15 11:03:20 -07002222 if (yychar != YYEMPTY)
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002223 yydestruct ("Cleanup: discarding lookahead",
2224 yytoken, &yylval);
Sam Ravnborg14f31562007-09-26 20:15:39 +02002225 /* Do not reclaim the symbols of the rule which action triggered
2226 this YYABORT or YYACCEPT. */
2227 YYPOPSTACK (yylen);
2228 YY_STACK_PRINT (yyss, yyssp);
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002229 while (yyssp != yyss)
2230 {
2231 yydestruct ("Cleanup: popping",
2232 yystos[*yyssp], yyvsp);
Sam Ravnborg14f31562007-09-26 20:15:39 +02002233 YYPOPSTACK (1);
Roman Zippelf6a88aa2006-06-08 22:12:44 -07002234 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07002235#ifndef yyoverflow
2236 if (yyss != yyssa)
2237 YYSTACK_FREE (yyss);
2238#endif
Sam Ravnborg14f31562007-09-26 20:15:39 +02002239#if YYERROR_VERBOSE
2240 if (yymsg != yymsgbuf)
2241 YYSTACK_FREE (yymsg);
2242#endif
2243 /* Make sure YYID is used. */
2244 return YYID (yyresult);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002245}
2246
2247
2248
2249
2250
2251void conf_parse(const char *name)
2252{
2253 struct symbol *sym;
2254 int i;
2255
2256 zconf_initscan(name);
2257
2258 sym_init();
nir.tzachar@gmail.com692d97c2009-11-25 12:28:43 +02002259 _menu_init();
Roman Zippelface4372006-06-08 22:12:45 -07002260 modules_sym = sym_lookup(NULL, 0);
2261 modules_sym->type = S_BOOLEAN;
2262 modules_sym->flags |= SYMBOL_AUTO;
blaisorblade@yahoo.itfb7f6ff2005-07-28 17:56:25 +02002263 rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002264
Roman Zippela02f0572005-11-08 21:34:53 -08002265 if (getenv("ZCONF_DEBUG"))
2266 zconfdebug = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002267 zconfparse();
2268 if (zconfnerrs)
2269 exit(1);
Roman Zippelface4372006-06-08 22:12:45 -07002270 if (!modules_sym->prop) {
2271 struct property *prop;
2272
2273 prop = prop_alloc(P_DEFAULT, modules_sym);
2274 prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
2275 }
Arnaud Lacombec0920a12010-09-10 21:23:28 -04002276
2277 rootmenu.prompt->text = _(rootmenu.prompt->text);
2278 rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
2279
Linus Torvalds1da177e2005-04-16 15:20:36 -07002280 menu_finalize(&rootmenu);
2281 for_all_symbols(i, sym) {
Sam Ravnborg5447d342007-05-06 09:20:10 +02002282 if (sym_check_deps(sym))
2283 zconfnerrs++;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002284 }
Sam Ravnborg5447d342007-05-06 09:20:10 +02002285 if (zconfnerrs)
2286 exit(1);
Karsten Wiesebfc10002006-12-13 00:34:07 -08002287 sym_set_change_count(1);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002288}
2289
Josh Triplett65166572009-10-15 12:13:36 -07002290static const char *zconf_tokenname(int token)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002291{
2292 switch (token) {
2293 case T_MENU: return "menu";
2294 case T_ENDMENU: return "endmenu";
2295 case T_CHOICE: return "choice";
2296 case T_ENDCHOICE: return "endchoice";
2297 case T_IF: return "if";
2298 case T_ENDIF: return "endif";
Roman Zippela02f0572005-11-08 21:34:53 -08002299 case T_DEPENDS: return "depends";
Arnaud Lacombe09899c92010-11-06 18:30:24 -03002300 case T_VISIBLE: return "visible";
Linus Torvalds1da177e2005-04-16 15:20:36 -07002301 }
2302 return "<token>";
2303}
2304
Arnaud Lacombe2f76b352011-05-23 01:08:19 -04002305static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002306{
Roman Zippela02f0572005-11-08 21:34:53 -08002307 if (id->token != endtoken) {
2308 zconf_error("unexpected '%s' within %s block",
2309 kconf_id_strings + id->name, zconf_tokenname(starttoken));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002310 zconfnerrs++;
2311 return false;
2312 }
2313 if (current_menu->file != current_file) {
Roman Zippela02f0572005-11-08 21:34:53 -08002314 zconf_error("'%s' in different file than '%s'",
2315 kconf_id_strings + id->name, zconf_tokenname(starttoken));
2316 fprintf(stderr, "%s:%d: location of the '%s'\n",
2317 current_menu->file->name, current_menu->lineno,
2318 zconf_tokenname(starttoken));
Linus Torvalds1da177e2005-04-16 15:20:36 -07002319 zconfnerrs++;
2320 return false;
2321 }
2322 return true;
2323}
2324
2325static void zconfprint(const char *err, ...)
2326{
2327 va_list ap;
2328
Roman Zippela02f0572005-11-08 21:34:53 -08002329 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
2330 va_start(ap, err);
2331 vfprintf(stderr, err, ap);
2332 va_end(ap);
2333 fprintf(stderr, "\n");
2334}
2335
2336static void zconf_error(const char *err, ...)
2337{
2338 va_list ap;
2339
2340 zconfnerrs++;
2341 fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
Linus Torvalds1da177e2005-04-16 15:20:36 -07002342 va_start(ap, err);
2343 vfprintf(stderr, err, ap);
2344 va_end(ap);
2345 fprintf(stderr, "\n");
2346}
2347
2348static void zconferror(const char *err)
2349{
2350 fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002351}
2352
Josh Triplett65166572009-10-15 12:13:36 -07002353static void print_quoted_string(FILE *out, const char *str)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002354{
2355 const char *p;
2356 int len;
2357
2358 putc('"', out);
2359 while ((p = strchr(str, '"'))) {
2360 len = p - str;
2361 if (len)
2362 fprintf(out, "%.*s", len, str);
2363 fputs("\\\"", out);
2364 str = p + 1;
2365 }
2366 fputs(str, out);
2367 putc('"', out);
2368}
2369
Josh Triplett65166572009-10-15 12:13:36 -07002370static void print_symbol(FILE *out, struct menu *menu)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002371{
2372 struct symbol *sym = menu->sym;
2373 struct property *prop;
2374
2375 if (sym_is_choice(sym))
Li Zefanc6ccc302010-04-14 11:44:20 +08002376 fprintf(out, "\nchoice\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07002377 else
Li Zefanc6ccc302010-04-14 11:44:20 +08002378 fprintf(out, "\nconfig %s\n", sym->name);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002379 switch (sym->type) {
2380 case S_BOOLEAN:
2381 fputs(" boolean\n", out);
2382 break;
2383 case S_TRISTATE:
2384 fputs(" tristate\n", out);
2385 break;
2386 case S_STRING:
2387 fputs(" string\n", out);
2388 break;
2389 case S_INT:
2390 fputs(" integer\n", out);
2391 break;
2392 case S_HEX:
2393 fputs(" hex\n", out);
2394 break;
2395 default:
2396 fputs(" ???\n", out);
2397 break;
2398 }
2399 for (prop = sym->prop; prop; prop = prop->next) {
2400 if (prop->menu != menu)
2401 continue;
2402 switch (prop->type) {
2403 case P_PROMPT:
2404 fputs(" prompt ", out);
2405 print_quoted_string(out, prop->text);
2406 if (!expr_is_yes(prop->visible.expr)) {
2407 fputs(" if ", out);
2408 expr_fprint(prop->visible.expr, out);
2409 }
2410 fputc('\n', out);
2411 break;
2412 case P_DEFAULT:
2413 fputs( " default ", out);
2414 expr_fprint(prop->expr, out);
2415 if (!expr_is_yes(prop->visible.expr)) {
2416 fputs(" if ", out);
2417 expr_fprint(prop->visible.expr, out);
2418 }
2419 fputc('\n', out);
2420 break;
2421 case P_CHOICE:
2422 fputs(" #choice value\n", out);
2423 break;
Li Zefanc6ccc302010-04-14 11:44:20 +08002424 case P_SELECT:
2425 fputs( " select ", out);
2426 expr_fprint(prop->expr, out);
2427 fputc('\n', out);
2428 break;
2429 case P_RANGE:
2430 fputs( " range ", out);
2431 expr_fprint(prop->expr, out);
2432 fputc('\n', out);
2433 break;
2434 case P_MENU:
2435 fputs( " menu ", out);
2436 print_quoted_string(out, prop->text);
2437 fputc('\n', out);
2438 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002439 default:
2440 fprintf(out, " unknown prop %d!\n", prop->type);
2441 break;
2442 }
2443 }
Sam Ravnborg03d29122007-07-21 00:00:36 +02002444 if (menu->help) {
2445 int len = strlen(menu->help);
2446 while (menu->help[--len] == '\n')
2447 menu->help[len] = 0;
2448 fprintf(out, " help\n%s\n", menu->help);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002449 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07002450}
2451
2452void zconfdump(FILE *out)
2453{
2454 struct property *prop;
2455 struct symbol *sym;
2456 struct menu *menu;
2457
2458 menu = rootmenu.list;
2459 while (menu) {
2460 if ((sym = menu->sym))
2461 print_symbol(out, menu);
2462 else if ((prop = menu->prompt)) {
2463 switch (prop->type) {
2464 case P_COMMENT:
2465 fputs("\ncomment ", out);
2466 print_quoted_string(out, prop->text);
2467 fputs("\n", out);
2468 break;
2469 case P_MENU:
2470 fputs("\nmenu ", out);
2471 print_quoted_string(out, prop->text);
2472 fputs("\n", out);
2473 break;
2474 default:
2475 ;
2476 }
2477 if (!expr_is_yes(prop->visible.expr)) {
2478 fputs(" depends ", out);
2479 expr_fprint(prop->visible.expr, out);
2480 fputc('\n', out);
2481 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07002482 }
2483
2484 if (menu->list)
2485 menu = menu->list;
2486 else if (menu->next)
2487 menu = menu->next;
2488 else while ((menu = menu->parent)) {
2489 if (menu->prompt && menu->prompt->type == P_MENU)
2490 fputs("\nendmenu\n", out);
2491 if (menu->next) {
2492 menu = menu->next;
2493 break;
2494 }
2495 }
2496 }
2497}
2498
Arnaud Lacombe2f76b352011-05-23 01:08:19 -04002499#include "zconf.lex.c"
Linus Torvalds1da177e2005-04-16 15:20:36 -07002500#include "util.c"
2501#include "confdata.c"
2502#include "expr.c"
2503#include "symbol.c"
2504#include "menu.c"
2505