xref: /OK3568_Linux_fs/u-boot/scripts/kconfig/zconf.tab.c_shipped (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun/* A Bison parser, made by GNU Bison 3.0.4.  */
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun/* Bison implementation for Yacc-like parsers in C
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun   This program is free software: you can redistribute it and/or modify
8*4882a593Smuzhiyun   it under the terms of the GNU General Public License as published by
9*4882a593Smuzhiyun   the Free Software Foundation, either version 3 of the License, or
10*4882a593Smuzhiyun   (at your option) any later version.
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun   This program is distributed in the hope that it will be useful,
13*4882a593Smuzhiyun   but WITHOUT ANY WARRANTY; without even the implied warranty of
14*4882a593Smuzhiyun   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15*4882a593Smuzhiyun   GNU General Public License for more details.
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun   You should have received a copy of the GNU General Public License
18*4882a593Smuzhiyun   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun/* As a special exception, you may create a larger work that contains
21*4882a593Smuzhiyun   part or all of the Bison parser skeleton and distribute that work
22*4882a593Smuzhiyun   under terms of your choice, so long as that work isn't itself a
23*4882a593Smuzhiyun   parser generator using the skeleton or a modified version thereof
24*4882a593Smuzhiyun   as a parser skeleton.  Alternatively, if you modify or redistribute
25*4882a593Smuzhiyun   the parser skeleton itself, you may (at your option) remove this
26*4882a593Smuzhiyun   special exception, which will cause the skeleton and the resulting
27*4882a593Smuzhiyun   Bison output files to be licensed under the GNU General Public
28*4882a593Smuzhiyun   License without this special exception.
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun   This special exception was added by the Free Software Foundation in
31*4882a593Smuzhiyun   version 2.2 of Bison.  */
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun/* C LALR(1) parser skeleton written by Richard Stallman, by
34*4882a593Smuzhiyun   simplifying the original so-called "semantic" parser.  */
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun/* All symbols defined below should begin with yy or YY, to avoid
37*4882a593Smuzhiyun   infringing on user name space.  This should be done even for local
38*4882a593Smuzhiyun   variables, as they might otherwise be expanded by user macros.
39*4882a593Smuzhiyun   There are some unavoidable exceptions within include files to
40*4882a593Smuzhiyun   define necessary library symbols; they are noted "INFRINGES ON
41*4882a593Smuzhiyun   USER NAME SPACE" below.  */
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun/* Identify Bison output.  */
44*4882a593Smuzhiyun#define YYBISON 1
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun/* Bison version.  */
47*4882a593Smuzhiyun#define YYBISON_VERSION "3.0.4"
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun/* Skeleton name.  */
50*4882a593Smuzhiyun#define YYSKELETON_NAME "yacc.c"
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun/* Pure parsers.  */
53*4882a593Smuzhiyun#define YYPURE 0
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun/* Push parsers.  */
56*4882a593Smuzhiyun#define YYPUSH 0
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun/* Pull parsers.  */
59*4882a593Smuzhiyun#define YYPULL 1
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun
62*4882a593Smuzhiyun/* Substitute the variable and function names.  */
63*4882a593Smuzhiyun#define yyparse         zconfparse
64*4882a593Smuzhiyun#define yylex           zconflex
65*4882a593Smuzhiyun#define yyerror         zconferror
66*4882a593Smuzhiyun#define yydebug         zconfdebug
67*4882a593Smuzhiyun#define yynerrs         zconfnerrs
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun#define yylval          zconflval
70*4882a593Smuzhiyun#define yychar          zconfchar
71*4882a593Smuzhiyun
72*4882a593Smuzhiyun/* Copy the first part of user declarations.  */
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun
75*4882a593Smuzhiyun/*
76*4882a593Smuzhiyun * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
77*4882a593Smuzhiyun * Released under the terms of the GNU GPL v2.0.
78*4882a593Smuzhiyun */
79*4882a593Smuzhiyun
80*4882a593Smuzhiyun#include <ctype.h>
81*4882a593Smuzhiyun#include <stdarg.h>
82*4882a593Smuzhiyun#include <stdio.h>
83*4882a593Smuzhiyun#include <stdlib.h>
84*4882a593Smuzhiyun#include <string.h>
85*4882a593Smuzhiyun#include <stdbool.h>
86*4882a593Smuzhiyun
87*4882a593Smuzhiyun#include "lkc.h"
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
90*4882a593Smuzhiyun
91*4882a593Smuzhiyun#define PRINTD		0x0001
92*4882a593Smuzhiyun#define DEBUG_PARSE	0x0002
93*4882a593Smuzhiyun
94*4882a593Smuzhiyunint cdebug = PRINTD;
95*4882a593Smuzhiyun
96*4882a593Smuzhiyunextern int zconflex(void);
97*4882a593Smuzhiyunstatic void zconfprint(const char *err, ...);
98*4882a593Smuzhiyunstatic void zconf_error(const char *err, ...);
99*4882a593Smuzhiyunstatic void zconferror(const char *err);
100*4882a593Smuzhiyunstatic bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken);
101*4882a593Smuzhiyun
102*4882a593Smuzhiyunstruct symbol *symbol_hash[SYMBOL_HASHSIZE];
103*4882a593Smuzhiyun
104*4882a593Smuzhiyunstatic struct menu *current_menu, *current_entry;
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun
107*4882a593Smuzhiyun
108*4882a593Smuzhiyun
109*4882a593Smuzhiyun# ifndef YY_NULLPTR
110*4882a593Smuzhiyun#  if defined __cplusplus && 201103L <= __cplusplus
111*4882a593Smuzhiyun#   define YY_NULLPTR nullptr
112*4882a593Smuzhiyun#  else
113*4882a593Smuzhiyun#   define YY_NULLPTR 0
114*4882a593Smuzhiyun#  endif
115*4882a593Smuzhiyun# endif
116*4882a593Smuzhiyun
117*4882a593Smuzhiyun/* Enabling verbose error messages.  */
118*4882a593Smuzhiyun#ifdef YYERROR_VERBOSE
119*4882a593Smuzhiyun# undef YYERROR_VERBOSE
120*4882a593Smuzhiyun# define YYERROR_VERBOSE 1
121*4882a593Smuzhiyun#else
122*4882a593Smuzhiyun# define YYERROR_VERBOSE 0
123*4882a593Smuzhiyun#endif
124*4882a593Smuzhiyun
125*4882a593Smuzhiyun
126*4882a593Smuzhiyun/* Debug traces.  */
127*4882a593Smuzhiyun#ifndef YYDEBUG
128*4882a593Smuzhiyun# define YYDEBUG 1
129*4882a593Smuzhiyun#endif
130*4882a593Smuzhiyun#if YYDEBUG
131*4882a593Smuzhiyunextern int zconfdebug;
132*4882a593Smuzhiyun#endif
133*4882a593Smuzhiyun
134*4882a593Smuzhiyun/* Token type.  */
135*4882a593Smuzhiyun#ifndef YYTOKENTYPE
136*4882a593Smuzhiyun# define YYTOKENTYPE
137*4882a593Smuzhiyun  enum yytokentype
138*4882a593Smuzhiyun  {
139*4882a593Smuzhiyun    T_MAINMENU = 258,
140*4882a593Smuzhiyun    T_MENU = 259,
141*4882a593Smuzhiyun    T_ENDMENU = 260,
142*4882a593Smuzhiyun    T_SOURCE = 261,
143*4882a593Smuzhiyun    T_CHOICE = 262,
144*4882a593Smuzhiyun    T_ENDCHOICE = 263,
145*4882a593Smuzhiyun    T_COMMENT = 264,
146*4882a593Smuzhiyun    T_CONFIG = 265,
147*4882a593Smuzhiyun    T_MENUCONFIG = 266,
148*4882a593Smuzhiyun    T_HELP = 267,
149*4882a593Smuzhiyun    T_HELPTEXT = 268,
150*4882a593Smuzhiyun    T_IF = 269,
151*4882a593Smuzhiyun    T_ENDIF = 270,
152*4882a593Smuzhiyun    T_DEPENDS = 271,
153*4882a593Smuzhiyun    T_OPTIONAL = 272,
154*4882a593Smuzhiyun    T_PROMPT = 273,
155*4882a593Smuzhiyun    T_TYPE = 274,
156*4882a593Smuzhiyun    T_DEFAULT = 275,
157*4882a593Smuzhiyun    T_SELECT = 276,
158*4882a593Smuzhiyun    T_IMPLY = 277,
159*4882a593Smuzhiyun    T_RANGE = 278,
160*4882a593Smuzhiyun    T_VISIBLE = 279,
161*4882a593Smuzhiyun    T_OPTION = 280,
162*4882a593Smuzhiyun    T_ON = 281,
163*4882a593Smuzhiyun    T_WORD = 282,
164*4882a593Smuzhiyun    T_WORD_QUOTE = 283,
165*4882a593Smuzhiyun    T_UNEQUAL = 284,
166*4882a593Smuzhiyun    T_LESS = 285,
167*4882a593Smuzhiyun    T_LESS_EQUAL = 286,
168*4882a593Smuzhiyun    T_GREATER = 287,
169*4882a593Smuzhiyun    T_GREATER_EQUAL = 288,
170*4882a593Smuzhiyun    T_CLOSE_PAREN = 289,
171*4882a593Smuzhiyun    T_OPEN_PAREN = 290,
172*4882a593Smuzhiyun    T_EOL = 291,
173*4882a593Smuzhiyun    T_OR = 292,
174*4882a593Smuzhiyun    T_AND = 293,
175*4882a593Smuzhiyun    T_EQUAL = 294,
176*4882a593Smuzhiyun    T_NOT = 295
177*4882a593Smuzhiyun  };
178*4882a593Smuzhiyun#endif
179*4882a593Smuzhiyun
180*4882a593Smuzhiyun/* Value type.  */
181*4882a593Smuzhiyun#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
182*4882a593Smuzhiyun
183*4882a593Smuzhiyununion YYSTYPE
184*4882a593Smuzhiyun{
185*4882a593Smuzhiyun
186*4882a593Smuzhiyun
187*4882a593Smuzhiyun	char *string;
188*4882a593Smuzhiyun	struct file *file;
189*4882a593Smuzhiyun	struct symbol *symbol;
190*4882a593Smuzhiyun	struct expr *expr;
191*4882a593Smuzhiyun	struct menu *menu;
192*4882a593Smuzhiyun	const struct kconf_id *id;
193*4882a593Smuzhiyun
194*4882a593Smuzhiyun
195*4882a593Smuzhiyun};
196*4882a593Smuzhiyun
197*4882a593Smuzhiyuntypedef union YYSTYPE YYSTYPE;
198*4882a593Smuzhiyun# define YYSTYPE_IS_TRIVIAL 1
199*4882a593Smuzhiyun# define YYSTYPE_IS_DECLARED 1
200*4882a593Smuzhiyun#endif
201*4882a593Smuzhiyun
202*4882a593Smuzhiyun
203*4882a593Smuzhiyunextern YYSTYPE zconflval;
204*4882a593Smuzhiyun
205*4882a593Smuzhiyunint zconfparse (void);
206*4882a593Smuzhiyun
207*4882a593Smuzhiyun
208*4882a593Smuzhiyun
209*4882a593Smuzhiyun/* Copy the second part of user declarations.  */
210*4882a593Smuzhiyun
211*4882a593Smuzhiyun
212*4882a593Smuzhiyun/* Include zconf.hash.c here so it can see the token constants. */
213*4882a593Smuzhiyun#include "zconf.hash.c"
214*4882a593Smuzhiyun
215*4882a593Smuzhiyun
216*4882a593Smuzhiyun
217*4882a593Smuzhiyun#ifdef short
218*4882a593Smuzhiyun# undef short
219*4882a593Smuzhiyun#endif
220*4882a593Smuzhiyun
221*4882a593Smuzhiyun#ifdef YYTYPE_UINT8
222*4882a593Smuzhiyuntypedef YYTYPE_UINT8 yytype_uint8;
223*4882a593Smuzhiyun#else
224*4882a593Smuzhiyuntypedef unsigned char yytype_uint8;
225*4882a593Smuzhiyun#endif
226*4882a593Smuzhiyun
227*4882a593Smuzhiyun#ifdef YYTYPE_INT8
228*4882a593Smuzhiyuntypedef YYTYPE_INT8 yytype_int8;
229*4882a593Smuzhiyun#else
230*4882a593Smuzhiyuntypedef signed char yytype_int8;
231*4882a593Smuzhiyun#endif
232*4882a593Smuzhiyun
233*4882a593Smuzhiyun#ifdef YYTYPE_UINT16
234*4882a593Smuzhiyuntypedef YYTYPE_UINT16 yytype_uint16;
235*4882a593Smuzhiyun#else
236*4882a593Smuzhiyuntypedef unsigned short int yytype_uint16;
237*4882a593Smuzhiyun#endif
238*4882a593Smuzhiyun
239*4882a593Smuzhiyun#ifdef YYTYPE_INT16
240*4882a593Smuzhiyuntypedef YYTYPE_INT16 yytype_int16;
241*4882a593Smuzhiyun#else
242*4882a593Smuzhiyuntypedef short int yytype_int16;
243*4882a593Smuzhiyun#endif
244*4882a593Smuzhiyun
245*4882a593Smuzhiyun#ifndef YYSIZE_T
246*4882a593Smuzhiyun# ifdef __SIZE_TYPE__
247*4882a593Smuzhiyun#  define YYSIZE_T __SIZE_TYPE__
248*4882a593Smuzhiyun# elif defined size_t
249*4882a593Smuzhiyun#  define YYSIZE_T size_t
250*4882a593Smuzhiyun# elif ! defined YYSIZE_T
251*4882a593Smuzhiyun#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
252*4882a593Smuzhiyun#  define YYSIZE_T size_t
253*4882a593Smuzhiyun# else
254*4882a593Smuzhiyun#  define YYSIZE_T unsigned int
255*4882a593Smuzhiyun# endif
256*4882a593Smuzhiyun#endif
257*4882a593Smuzhiyun
258*4882a593Smuzhiyun#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
259*4882a593Smuzhiyun
260*4882a593Smuzhiyun#ifndef YY_
261*4882a593Smuzhiyun# if defined YYENABLE_NLS && YYENABLE_NLS
262*4882a593Smuzhiyun#  if ENABLE_NLS
263*4882a593Smuzhiyun#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
264*4882a593Smuzhiyun#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
265*4882a593Smuzhiyun#  endif
266*4882a593Smuzhiyun# endif
267*4882a593Smuzhiyun# ifndef YY_
268*4882a593Smuzhiyun#  define YY_(Msgid) Msgid
269*4882a593Smuzhiyun# endif
270*4882a593Smuzhiyun#endif
271*4882a593Smuzhiyun
272*4882a593Smuzhiyun#ifndef YY_ATTRIBUTE
273*4882a593Smuzhiyun# if (defined __GNUC__                                               \
274*4882a593Smuzhiyun      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
275*4882a593Smuzhiyun     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
276*4882a593Smuzhiyun#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
277*4882a593Smuzhiyun# else
278*4882a593Smuzhiyun#  define YY_ATTRIBUTE(Spec) /* empty */
279*4882a593Smuzhiyun# endif
280*4882a593Smuzhiyun#endif
281*4882a593Smuzhiyun
282*4882a593Smuzhiyun#ifndef YY_ATTRIBUTE_PURE
283*4882a593Smuzhiyun# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
284*4882a593Smuzhiyun#endif
285*4882a593Smuzhiyun
286*4882a593Smuzhiyun#ifndef YY_ATTRIBUTE_UNUSED
287*4882a593Smuzhiyun# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
288*4882a593Smuzhiyun#endif
289*4882a593Smuzhiyun
290*4882a593Smuzhiyun#if !defined _Noreturn \
291*4882a593Smuzhiyun     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
292*4882a593Smuzhiyun# if defined _MSC_VER && 1200 <= _MSC_VER
293*4882a593Smuzhiyun#  define _Noreturn __declspec (noreturn)
294*4882a593Smuzhiyun# else
295*4882a593Smuzhiyun#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
296*4882a593Smuzhiyun# endif
297*4882a593Smuzhiyun#endif
298*4882a593Smuzhiyun
299*4882a593Smuzhiyun/* Suppress unused-variable warnings by "using" E.  */
300*4882a593Smuzhiyun#if ! defined lint || defined __GNUC__
301*4882a593Smuzhiyun# define YYUSE(E) ((void) (E))
302*4882a593Smuzhiyun#else
303*4882a593Smuzhiyun# define YYUSE(E) /* empty */
304*4882a593Smuzhiyun#endif
305*4882a593Smuzhiyun
306*4882a593Smuzhiyun#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
307*4882a593Smuzhiyun/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
308*4882a593Smuzhiyun# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
309*4882a593Smuzhiyun    _Pragma ("GCC diagnostic push") \
310*4882a593Smuzhiyun    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
311*4882a593Smuzhiyun    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
312*4882a593Smuzhiyun# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
313*4882a593Smuzhiyun    _Pragma ("GCC diagnostic pop")
314*4882a593Smuzhiyun#else
315*4882a593Smuzhiyun# define YY_INITIAL_VALUE(Value) Value
316*4882a593Smuzhiyun#endif
317*4882a593Smuzhiyun#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
318*4882a593Smuzhiyun# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
319*4882a593Smuzhiyun# define YY_IGNORE_MAYBE_UNINITIALIZED_END
320*4882a593Smuzhiyun#endif
321*4882a593Smuzhiyun#ifndef YY_INITIAL_VALUE
322*4882a593Smuzhiyun# define YY_INITIAL_VALUE(Value) /* Nothing. */
323*4882a593Smuzhiyun#endif
324*4882a593Smuzhiyun
325*4882a593Smuzhiyun
326*4882a593Smuzhiyun#if ! defined yyoverflow || YYERROR_VERBOSE
327*4882a593Smuzhiyun
328*4882a593Smuzhiyun/* The parser invokes alloca or malloc; define the necessary symbols.  */
329*4882a593Smuzhiyun
330*4882a593Smuzhiyun# ifdef YYSTACK_USE_ALLOCA
331*4882a593Smuzhiyun#  if YYSTACK_USE_ALLOCA
332*4882a593Smuzhiyun#   ifdef __GNUC__
333*4882a593Smuzhiyun#    define YYSTACK_ALLOC __builtin_alloca
334*4882a593Smuzhiyun#   elif defined __BUILTIN_VA_ARG_INCR
335*4882a593Smuzhiyun#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
336*4882a593Smuzhiyun#   elif defined _AIX
337*4882a593Smuzhiyun#    define YYSTACK_ALLOC __alloca
338*4882a593Smuzhiyun#   elif defined _MSC_VER
339*4882a593Smuzhiyun#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
340*4882a593Smuzhiyun#    define alloca _alloca
341*4882a593Smuzhiyun#   else
342*4882a593Smuzhiyun#    define YYSTACK_ALLOC alloca
343*4882a593Smuzhiyun#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
344*4882a593Smuzhiyun#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
345*4882a593Smuzhiyun      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
346*4882a593Smuzhiyun#     ifndef EXIT_SUCCESS
347*4882a593Smuzhiyun#      define EXIT_SUCCESS 0
348*4882a593Smuzhiyun#     endif
349*4882a593Smuzhiyun#    endif
350*4882a593Smuzhiyun#   endif
351*4882a593Smuzhiyun#  endif
352*4882a593Smuzhiyun# endif
353*4882a593Smuzhiyun
354*4882a593Smuzhiyun# ifdef YYSTACK_ALLOC
355*4882a593Smuzhiyun   /* Pacify GCC's 'empty if-body' warning.  */
356*4882a593Smuzhiyun#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
357*4882a593Smuzhiyun#  ifndef YYSTACK_ALLOC_MAXIMUM
358*4882a593Smuzhiyun    /* The OS might guarantee only one guard page at the bottom of the stack,
359*4882a593Smuzhiyun       and a page size can be as small as 4096 bytes.  So we cannot safely
360*4882a593Smuzhiyun       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
361*4882a593Smuzhiyun       to allow for a few compiler-allocated temporary stack slots.  */
362*4882a593Smuzhiyun#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
363*4882a593Smuzhiyun#  endif
364*4882a593Smuzhiyun# else
365*4882a593Smuzhiyun#  define YYSTACK_ALLOC YYMALLOC
366*4882a593Smuzhiyun#  define YYSTACK_FREE YYFREE
367*4882a593Smuzhiyun#  ifndef YYSTACK_ALLOC_MAXIMUM
368*4882a593Smuzhiyun#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
369*4882a593Smuzhiyun#  endif
370*4882a593Smuzhiyun#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
371*4882a593Smuzhiyun       && ! ((defined YYMALLOC || defined malloc) \
372*4882a593Smuzhiyun             && (defined YYFREE || defined free)))
373*4882a593Smuzhiyun#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
374*4882a593Smuzhiyun#   ifndef EXIT_SUCCESS
375*4882a593Smuzhiyun#    define EXIT_SUCCESS 0
376*4882a593Smuzhiyun#   endif
377*4882a593Smuzhiyun#  endif
378*4882a593Smuzhiyun#  ifndef YYMALLOC
379*4882a593Smuzhiyun#   define YYMALLOC malloc
380*4882a593Smuzhiyun#   if ! defined malloc && ! defined EXIT_SUCCESS
381*4882a593Smuzhiyunvoid *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
382*4882a593Smuzhiyun#   endif
383*4882a593Smuzhiyun#  endif
384*4882a593Smuzhiyun#  ifndef YYFREE
385*4882a593Smuzhiyun#   define YYFREE free
386*4882a593Smuzhiyun#   if ! defined free && ! defined EXIT_SUCCESS
387*4882a593Smuzhiyunvoid free (void *); /* INFRINGES ON USER NAME SPACE */
388*4882a593Smuzhiyun#   endif
389*4882a593Smuzhiyun#  endif
390*4882a593Smuzhiyun# endif
391*4882a593Smuzhiyun#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
392*4882a593Smuzhiyun
393*4882a593Smuzhiyun
394*4882a593Smuzhiyun#if (! defined yyoverflow \
395*4882a593Smuzhiyun     && (! defined __cplusplus \
396*4882a593Smuzhiyun         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
397*4882a593Smuzhiyun
398*4882a593Smuzhiyun/* A type that is properly aligned for any stack member.  */
399*4882a593Smuzhiyununion yyalloc
400*4882a593Smuzhiyun{
401*4882a593Smuzhiyun  yytype_int16 yyss_alloc;
402*4882a593Smuzhiyun  YYSTYPE yyvs_alloc;
403*4882a593Smuzhiyun};
404*4882a593Smuzhiyun
405*4882a593Smuzhiyun/* The size of the maximum gap between one aligned stack and the next.  */
406*4882a593Smuzhiyun# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
407*4882a593Smuzhiyun
408*4882a593Smuzhiyun/* The size of an array large to enough to hold all stacks, each with
409*4882a593Smuzhiyun   N elements.  */
410*4882a593Smuzhiyun# define YYSTACK_BYTES(N) \
411*4882a593Smuzhiyun     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
412*4882a593Smuzhiyun      + YYSTACK_GAP_MAXIMUM)
413*4882a593Smuzhiyun
414*4882a593Smuzhiyun# define YYCOPY_NEEDED 1
415*4882a593Smuzhiyun
416*4882a593Smuzhiyun/* Relocate STACK from its old location to the new one.  The
417*4882a593Smuzhiyun   local variables YYSIZE and YYSTACKSIZE give the old and new number of
418*4882a593Smuzhiyun   elements in the stack, and YYPTR gives the new location of the
419*4882a593Smuzhiyun   stack.  Advance YYPTR to a properly aligned location for the next
420*4882a593Smuzhiyun   stack.  */
421*4882a593Smuzhiyun# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
422*4882a593Smuzhiyun    do                                                                  \
423*4882a593Smuzhiyun      {                                                                 \
424*4882a593Smuzhiyun        YYSIZE_T yynewbytes;                                            \
425*4882a593Smuzhiyun        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
426*4882a593Smuzhiyun        Stack = &yyptr->Stack_alloc;                                    \
427*4882a593Smuzhiyun        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
428*4882a593Smuzhiyun        yyptr += yynewbytes / sizeof (*yyptr);                          \
429*4882a593Smuzhiyun      }                                                                 \
430*4882a593Smuzhiyun    while (0)
431*4882a593Smuzhiyun
432*4882a593Smuzhiyun#endif
433*4882a593Smuzhiyun
434*4882a593Smuzhiyun#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
435*4882a593Smuzhiyun/* Copy COUNT objects from SRC to DST.  The source and destination do
436*4882a593Smuzhiyun   not overlap.  */
437*4882a593Smuzhiyun# ifndef YYCOPY
438*4882a593Smuzhiyun#  if defined __GNUC__ && 1 < __GNUC__
439*4882a593Smuzhiyun#   define YYCOPY(Dst, Src, Count) \
440*4882a593Smuzhiyun      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
441*4882a593Smuzhiyun#  else
442*4882a593Smuzhiyun#   define YYCOPY(Dst, Src, Count)              \
443*4882a593Smuzhiyun      do                                        \
444*4882a593Smuzhiyun        {                                       \
445*4882a593Smuzhiyun          YYSIZE_T yyi;                         \
446*4882a593Smuzhiyun          for (yyi = 0; yyi < (Count); yyi++)   \
447*4882a593Smuzhiyun            (Dst)[yyi] = (Src)[yyi];            \
448*4882a593Smuzhiyun        }                                       \
449*4882a593Smuzhiyun      while (0)
450*4882a593Smuzhiyun#  endif
451*4882a593Smuzhiyun# endif
452*4882a593Smuzhiyun#endif /* !YYCOPY_NEEDED */
453*4882a593Smuzhiyun
454*4882a593Smuzhiyun/* YYFINAL -- State number of the termination state.  */
455*4882a593Smuzhiyun#define YYFINAL  11
456*4882a593Smuzhiyun/* YYLAST -- Last index in YYTABLE.  */
457*4882a593Smuzhiyun#define YYLAST   301
458*4882a593Smuzhiyun
459*4882a593Smuzhiyun/* YYNTOKENS -- Number of terminals.  */
460*4882a593Smuzhiyun#define YYNTOKENS  41
461*4882a593Smuzhiyun/* YYNNTS -- Number of nonterminals.  */
462*4882a593Smuzhiyun#define YYNNTS  50
463*4882a593Smuzhiyun/* YYNRULES -- Number of rules.  */
464*4882a593Smuzhiyun#define YYNRULES  124
465*4882a593Smuzhiyun/* YYNSTATES -- Number of states.  */
466*4882a593Smuzhiyun#define YYNSTATES  204
467*4882a593Smuzhiyun
468*4882a593Smuzhiyun/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
469*4882a593Smuzhiyun   by yylex, with out-of-bounds checking.  */
470*4882a593Smuzhiyun#define YYUNDEFTOK  2
471*4882a593Smuzhiyun#define YYMAXUTOK   295
472*4882a593Smuzhiyun
473*4882a593Smuzhiyun#define YYTRANSLATE(YYX)                                                \
474*4882a593Smuzhiyun  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
475*4882a593Smuzhiyun
476*4882a593Smuzhiyun/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
477*4882a593Smuzhiyun   as returned by yylex, without out-of-bounds checking.  */
478*4882a593Smuzhiyunstatic const yytype_uint8 yytranslate[] =
479*4882a593Smuzhiyun{
480*4882a593Smuzhiyun       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
481*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
482*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
483*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
484*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
485*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
486*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
487*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
488*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
489*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
490*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
491*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
492*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
493*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
494*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
495*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
496*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
497*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
498*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
499*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
500*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
501*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
502*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
503*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
504*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
505*4882a593Smuzhiyun       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
506*4882a593Smuzhiyun       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
507*4882a593Smuzhiyun      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
508*4882a593Smuzhiyun      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
509*4882a593Smuzhiyun      35,    36,    37,    38,    39,    40
510*4882a593Smuzhiyun};
511*4882a593Smuzhiyun
512*4882a593Smuzhiyun#if YYDEBUG
513*4882a593Smuzhiyun  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
514*4882a593Smuzhiyunstatic const yytype_uint16 yyrline[] =
515*4882a593Smuzhiyun{
516*4882a593Smuzhiyun       0,   109,   109,   109,   111,   111,   113,   115,   116,   117,
517*4882a593Smuzhiyun     118,   119,   120,   124,   128,   128,   128,   128,   128,   128,
518*4882a593Smuzhiyun     128,   128,   128,   132,   133,   134,   135,   136,   137,   141,
519*4882a593Smuzhiyun     142,   148,   156,   162,   170,   180,   182,   183,   184,   185,
520*4882a593Smuzhiyun     186,   187,   190,   198,   204,   214,   220,   226,   232,   235,
521*4882a593Smuzhiyun     237,   248,   249,   254,   263,   268,   276,   279,   281,   282,
522*4882a593Smuzhiyun     283,   284,   285,   288,   294,   305,   311,   321,   323,   328,
523*4882a593Smuzhiyun     336,   344,   347,   349,   350,   351,   356,   363,   370,   375,
524*4882a593Smuzhiyun     383,   386,   388,   389,   390,   393,   401,   408,   415,   421,
525*4882a593Smuzhiyun     428,   430,   431,   432,   435,   443,   445,   446,   449,   456,
526*4882a593Smuzhiyun     458,   463,   464,   467,   468,   469,   473,   474,   477,   478,
527*4882a593Smuzhiyun     481,   482,   483,   484,   485,   486,   487,   488,   489,   490,
528*4882a593Smuzhiyun     491,   494,   495,   498,   499
529*4882a593Smuzhiyun};
530*4882a593Smuzhiyun#endif
531*4882a593Smuzhiyun
532*4882a593Smuzhiyun#if YYDEBUG || YYERROR_VERBOSE || 0
533*4882a593Smuzhiyun/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
534*4882a593Smuzhiyun   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
535*4882a593Smuzhiyunstatic const char *const yytname[] =
536*4882a593Smuzhiyun{
537*4882a593Smuzhiyun  "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
538*4882a593Smuzhiyun  "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
539*4882a593Smuzhiyun  "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
540*4882a593Smuzhiyun  "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_IMPLY",
541*4882a593Smuzhiyun  "T_RANGE", "T_VISIBLE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE",
542*4882a593Smuzhiyun  "T_UNEQUAL", "T_LESS", "T_LESS_EQUAL", "T_GREATER", "T_GREATER_EQUAL",
543*4882a593Smuzhiyun  "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
544*4882a593Smuzhiyun  "T_NOT", "$accept", "input", "start", "stmt_list", "option_name",
545*4882a593Smuzhiyun  "common_stmt", "option_error", "config_entry_start", "config_stmt",
546*4882a593Smuzhiyun  "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
547*4882a593Smuzhiyun  "config_option", "symbol_option", "symbol_option_list",
548*4882a593Smuzhiyun  "symbol_option_arg", "choice", "choice_entry", "choice_end",
549*4882a593Smuzhiyun  "choice_stmt", "choice_option_list", "choice_option", "choice_block",
550*4882a593Smuzhiyun  "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu",
551*4882a593Smuzhiyun  "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt",
552*4882a593Smuzhiyun  "comment", "comment_stmt", "help_start", "help", "depends_list",
553*4882a593Smuzhiyun  "depends", "visibility_list", "visible", "prompt_stmt_opt", "prompt",
554*4882a593Smuzhiyun  "end", "nl", "if_expr", "expr", "symbol", "word_opt", YY_NULLPTR
555*4882a593Smuzhiyun};
556*4882a593Smuzhiyun#endif
557*4882a593Smuzhiyun
558*4882a593Smuzhiyun# ifdef YYPRINT
559*4882a593Smuzhiyun/* YYTOKNUM[NUM] -- (External) token number corresponding to the
560*4882a593Smuzhiyun   (internal) symbol number NUM (which must be that of a token).  */
561*4882a593Smuzhiyunstatic const yytype_uint16 yytoknum[] =
562*4882a593Smuzhiyun{
563*4882a593Smuzhiyun       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
564*4882a593Smuzhiyun     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
565*4882a593Smuzhiyun     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
566*4882a593Smuzhiyun     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
567*4882a593Smuzhiyun     295
568*4882a593Smuzhiyun};
569*4882a593Smuzhiyun# endif
570*4882a593Smuzhiyun
571*4882a593Smuzhiyun#define YYPACT_NINF -92
572*4882a593Smuzhiyun
573*4882a593Smuzhiyun#define yypact_value_is_default(Yystate) \
574*4882a593Smuzhiyun  (!!((Yystate) == (-92)))
575*4882a593Smuzhiyun
576*4882a593Smuzhiyun#define YYTABLE_NINF -88
577*4882a593Smuzhiyun
578*4882a593Smuzhiyun#define yytable_value_is_error(Yytable_value) \
579*4882a593Smuzhiyun  0
580*4882a593Smuzhiyun
581*4882a593Smuzhiyun  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
582*4882a593Smuzhiyun     STATE-NUM.  */
583*4882a593Smuzhiyunstatic const yytype_int16 yypact[] =
584*4882a593Smuzhiyun{
585*4882a593Smuzhiyun      17,    41,   -92,    15,   -92,   150,   -92,    19,   -92,   -92,
586*4882a593Smuzhiyun     -13,   -92,    28,    41,    38,    41,    50,    47,    41,    79,
587*4882a593Smuzhiyun      82,    44,    76,   -92,   -92,   -92,   -92,   -92,   -92,   -92,
588*4882a593Smuzhiyun     -92,   -92,   118,   -92,   129,   -92,   -92,   -92,   -92,   -92,
589*4882a593Smuzhiyun     -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,
590*4882a593Smuzhiyun     -92,   -92,   184,   -92,   -92,   107,   -92,   111,   -92,   113,
591*4882a593Smuzhiyun     -92,   116,   -92,   139,   140,   151,   -92,   -92,    44,    44,
592*4882a593Smuzhiyun     142,   256,   -92,   160,   173,    27,   117,    80,    51,   255,
593*4882a593Smuzhiyun     -15,   255,   217,   -92,   -92,   -92,   -92,   -92,   -92,    -8,
594*4882a593Smuzhiyun     -92,    44,    44,   107,    87,    87,    87,    87,    87,    87,
595*4882a593Smuzhiyun     -92,   -92,   174,   176,   187,    41,    41,    44,   188,   189,
596*4882a593Smuzhiyun      87,   -92,   213,   -92,   -92,   -92,   -92,   206,   -92,   -92,
597*4882a593Smuzhiyun     193,    41,    41,   203,   -92,   -92,   -92,   -92,   -92,   -92,
598*4882a593Smuzhiyun     -92,   -92,   -92,   -92,   -92,   -92,   -92,   229,   -92,   241,
599*4882a593Smuzhiyun     -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,
600*4882a593Smuzhiyun     216,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,
601*4882a593Smuzhiyun      44,   229,   222,   229,    64,   229,   229,    87,    31,   231,
602*4882a593Smuzhiyun     -92,   -92,   229,   236,   229,    44,   -92,   145,   242,   -92,
603*4882a593Smuzhiyun     -92,   243,   244,   245,   229,   251,   -92,   -92,   247,   -92,
604*4882a593Smuzhiyun     257,   125,   -92,   -92,   -92,   -92,   -92,   260,    41,   -92,
605*4882a593Smuzhiyun     -92,   -92,   -92,   -92
606*4882a593Smuzhiyun};
607*4882a593Smuzhiyun
608*4882a593Smuzhiyun  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
609*4882a593Smuzhiyun     Performed when YYTABLE does not specify something else to do.  Zero
610*4882a593Smuzhiyun     means the default is an error.  */
611*4882a593Smuzhiyunstatic const yytype_uint8 yydefact[] =
612*4882a593Smuzhiyun{
613*4882a593Smuzhiyun       6,     0,   106,     0,     3,     0,     6,     6,   101,   102,
614*4882a593Smuzhiyun       0,     1,     0,     0,     0,     0,   123,     0,     0,     0,
615*4882a593Smuzhiyun       0,     0,     0,    14,    19,    15,    16,    21,    17,    18,
616*4882a593Smuzhiyun      20,    22,     0,    23,     0,     7,    35,    26,    35,    27,
617*4882a593Smuzhiyun      57,    67,     8,    72,    24,    95,    81,     9,    28,    90,
618*4882a593Smuzhiyun      25,    10,     0,   107,     2,    76,    13,     0,   103,     0,
619*4882a593Smuzhiyun     124,     0,   104,     0,     0,     0,   121,   122,     0,     0,
620*4882a593Smuzhiyun       0,   110,   105,     0,     0,     0,     0,     0,     0,     0,
621*4882a593Smuzhiyun      90,     0,     0,    77,    85,    53,    86,    31,    33,     0,
622*4882a593Smuzhiyun     118,     0,     0,    69,     0,     0,     0,     0,     0,     0,
623*4882a593Smuzhiyun      11,    12,     0,     0,     0,     0,    99,     0,     0,     0,
624*4882a593Smuzhiyun       0,    49,     0,    41,    40,    36,    37,     0,    39,    38,
625*4882a593Smuzhiyun       0,     0,    99,     0,    61,    62,    58,    60,    59,    68,
626*4882a593Smuzhiyun      56,    55,    73,    75,    71,    74,    70,   108,    97,     0,
627*4882a593Smuzhiyun      96,    82,    84,    80,    83,    79,    92,    93,    91,   117,
628*4882a593Smuzhiyun     119,   120,   116,   111,   112,   113,   114,   115,    30,    88,
629*4882a593Smuzhiyun       0,   108,     0,   108,   108,   108,   108,     0,     0,     0,
630*4882a593Smuzhiyun      89,    65,   108,     0,   108,     0,    98,     0,     0,    42,
631*4882a593Smuzhiyun     100,     0,     0,     0,   108,    51,    48,    29,     0,    64,
632*4882a593Smuzhiyun       0,   109,    94,    43,    44,    45,    46,     0,     0,    50,
633*4882a593Smuzhiyun      63,    66,    47,    52
634*4882a593Smuzhiyun};
635*4882a593Smuzhiyun
636*4882a593Smuzhiyun  /* YYPGOTO[NTERM-NUM].  */
637*4882a593Smuzhiyunstatic const yytype_int16 yypgoto[] =
638*4882a593Smuzhiyun{
639*4882a593Smuzhiyun     -92,   -92,   285,   291,   -92,    32,   -66,   -92,   -92,   -92,
640*4882a593Smuzhiyun     -92,   261,   -92,   -92,   -92,   -92,   -92,   -92,   -92,     1,
641*4882a593Smuzhiyun     -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,   -92,
642*4882a593Smuzhiyun     -92,    24,   -92,   -92,   -92,   -92,   -92,   221,   220,   -64,
643*4882a593Smuzhiyun     -92,   -92,   179,    -1,    67,     0,   110,   -67,   -91,   -92
644*4882a593Smuzhiyun};
645*4882a593Smuzhiyun
646*4882a593Smuzhiyun  /* YYDEFGOTO[NTERM-NUM].  */
647*4882a593Smuzhiyunstatic const yytype_int16 yydefgoto[] =
648*4882a593Smuzhiyun{
649*4882a593Smuzhiyun      -1,     3,     4,     5,    34,    35,   114,    36,    37,    38,
650*4882a593Smuzhiyun      39,    75,   115,   116,   168,   199,    40,    41,   130,    42,
651*4882a593Smuzhiyun      77,   126,    78,    43,   134,    44,    79,     6,    45,    46,
652*4882a593Smuzhiyun     143,    47,    81,    48,    49,    50,   117,   118,    82,   119,
653*4882a593Smuzhiyun      80,   140,   162,   163,    51,     7,   176,    70,    71,    61
654*4882a593Smuzhiyun};
655*4882a593Smuzhiyun
656*4882a593Smuzhiyun  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
657*4882a593Smuzhiyun     positive, shift that token.  If negative, reduce the rule whose
658*4882a593Smuzhiyun     number is the opposite.  If YYTABLE_NINF, syntax error.  */
659*4882a593Smuzhiyunstatic const yytype_int16 yytable[] =
660*4882a593Smuzhiyun{
661*4882a593Smuzhiyun      10,    89,    90,   152,   153,   154,   155,   156,   157,   137,
662*4882a593Smuzhiyun      55,   125,    57,   128,    59,    11,   147,    63,   148,   167,
663*4882a593Smuzhiyun       1,   138,     1,     2,   150,   151,   149,   -32,   102,    91,
664*4882a593Smuzhiyun      92,   -32,   -32,   -32,   -32,   -32,   -32,   -32,   -32,   103,
665*4882a593Smuzhiyun     164,   -32,   -32,   104,   -32,   105,   106,   107,   108,   109,
666*4882a593Smuzhiyun     110,   -32,   111,     2,   112,    53,    14,    15,   185,    17,
667*4882a593Smuzhiyun      18,    19,    20,   113,    56,    21,    22,   186,     8,     9,
668*4882a593Smuzhiyun      93,    66,    67,   147,    58,   148,   184,    60,   175,    68,
669*4882a593Smuzhiyun     133,   102,   142,    62,    69,   -54,   -54,    33,   -54,   -54,
670*4882a593Smuzhiyun     -54,   -54,   103,   177,   -54,   -54,   104,   120,   121,   122,
671*4882a593Smuzhiyun     123,    91,    92,   135,   161,   144,    64,   112,   191,    65,
672*4882a593Smuzhiyun     129,   132,    72,   141,    66,    67,   124,   -34,   102,    73,
673*4882a593Smuzhiyun     172,   -34,   -34,   -34,   -34,   -34,   -34,   -34,   -34,   103,
674*4882a593Smuzhiyun      74,   -34,   -34,   104,   -34,   105,   106,   107,   108,   109,
675*4882a593Smuzhiyun     110,   -34,   111,    53,   112,   131,   136,    83,   145,    84,
676*4882a593Smuzhiyun      -5,    12,    85,   113,    13,    14,    15,    16,    17,    18,
677*4882a593Smuzhiyun      19,    20,    91,    92,    21,    22,    23,    24,    25,    26,
678*4882a593Smuzhiyun      27,    28,    29,    30,    31,    86,    87,    32,     2,    91,
679*4882a593Smuzhiyun      92,   192,    91,    92,    -4,    12,    33,    88,    13,    14,
680*4882a593Smuzhiyun      15,    16,    17,    18,    19,    20,   100,   203,    21,    22,
681*4882a593Smuzhiyun      23,    24,    25,    26,    27,    28,    29,    30,    31,   101,
682*4882a593Smuzhiyun     158,    32,   159,   160,   169,   165,   166,   -87,   102,   170,
683*4882a593Smuzhiyun      33,   -87,   -87,   -87,   -87,   -87,   -87,   -87,   -87,   171,
684*4882a593Smuzhiyun     174,   -87,   -87,   104,   -87,   -87,   -87,   -87,   -87,   -87,
685*4882a593Smuzhiyun     -87,   -87,   102,   175,   112,   -78,   -78,   -78,   -78,   -78,
686*4882a593Smuzhiyun     -78,   -78,   -78,   146,    92,   -78,   -78,   104,   179,    13,
687*4882a593Smuzhiyun      14,    15,    16,    17,    18,    19,    20,   187,   112,    21,
688*4882a593Smuzhiyun      22,   178,   189,   180,   181,   182,   183,   146,   193,   194,
689*4882a593Smuzhiyun     195,   196,   188,   200,   190,    94,    95,    96,    97,    98,
690*4882a593Smuzhiyun     198,    33,    54,   201,   197,    99,   202,    52,   127,    76,
691*4882a593Smuzhiyun     139,   173
692*4882a593Smuzhiyun};
693*4882a593Smuzhiyun
694*4882a593Smuzhiyunstatic const yytype_uint8 yycheck[] =
695*4882a593Smuzhiyun{
696*4882a593Smuzhiyun       1,    68,    69,    94,    95,    96,    97,    98,    99,    24,
697*4882a593Smuzhiyun      10,    77,    13,    77,    15,     0,    82,    18,    82,   110,
698*4882a593Smuzhiyun       3,    36,     3,    36,    91,    92,    34,     0,     1,    37,
699*4882a593Smuzhiyun      38,     4,     5,     6,     7,     8,     9,    10,    11,    12,
700*4882a593Smuzhiyun     107,    14,    15,    16,    17,    18,    19,    20,    21,    22,
701*4882a593Smuzhiyun      23,    24,    25,    36,    27,    36,     5,     6,    27,     8,
702*4882a593Smuzhiyun       9,    10,    11,    36,    36,    14,    15,    36,    27,    28,
703*4882a593Smuzhiyun      70,    27,    28,   139,    36,   139,   167,    27,    14,    35,
704*4882a593Smuzhiyun      79,     1,    81,    36,    40,     5,     6,    36,     8,     9,
705*4882a593Smuzhiyun      10,    11,    12,   160,    14,    15,    16,    17,    18,    19,
706*4882a593Smuzhiyun      20,    37,    38,    79,   105,    81,    27,    27,   175,    27,
707*4882a593Smuzhiyun      78,    79,    36,    81,    27,    28,    36,     0,     1,     1,
708*4882a593Smuzhiyun     121,     4,     5,     6,     7,     8,     9,    10,    11,    12,
709*4882a593Smuzhiyun       1,    14,    15,    16,    17,    18,    19,    20,    21,    22,
710*4882a593Smuzhiyun      23,    24,    25,    36,    27,    78,    79,    36,    81,    36,
711*4882a593Smuzhiyun       0,     1,    36,    36,     4,     5,     6,     7,     8,     9,
712*4882a593Smuzhiyun      10,    11,    37,    38,    14,    15,    16,    17,    18,    19,
713*4882a593Smuzhiyun      20,    21,    22,    23,    24,    36,    36,    27,    36,    37,
714*4882a593Smuzhiyun      38,    36,    37,    38,     0,     1,    36,    36,     4,     5,
715*4882a593Smuzhiyun       6,     7,     8,     9,    10,    11,    36,   198,    14,    15,
716*4882a593Smuzhiyun      16,    17,    18,    19,    20,    21,    22,    23,    24,    36,
717*4882a593Smuzhiyun      36,    27,    36,    26,     1,    27,    27,     0,     1,    13,
718*4882a593Smuzhiyun      36,     4,     5,     6,     7,     8,     9,    10,    11,    36,
719*4882a593Smuzhiyun      27,    14,    15,    16,    17,    18,    19,    20,    21,    22,
720*4882a593Smuzhiyun      23,    24,     1,    14,    27,     4,     5,     6,     7,     8,
721*4882a593Smuzhiyun       9,    10,    11,    36,    38,    14,    15,    16,    36,     4,
722*4882a593Smuzhiyun       5,     6,     7,     8,     9,    10,    11,    36,    27,    14,
723*4882a593Smuzhiyun      15,   161,    36,   163,   164,   165,   166,    36,    36,    36,
724*4882a593Smuzhiyun      36,    36,   172,    36,   174,    29,    30,    31,    32,    33,
725*4882a593Smuzhiyun      39,    36,     7,    36,   184,    39,    36,     6,    77,    38,
726*4882a593Smuzhiyun      80,   122
727*4882a593Smuzhiyun};
728*4882a593Smuzhiyun
729*4882a593Smuzhiyun  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
730*4882a593Smuzhiyun     symbol of state STATE-NUM.  */
731*4882a593Smuzhiyunstatic const yytype_uint8 yystos[] =
732*4882a593Smuzhiyun{
733*4882a593Smuzhiyun       0,     3,    36,    42,    43,    44,    68,    86,    27,    28,
734*4882a593Smuzhiyun      84,     0,     1,     4,     5,     6,     7,     8,     9,    10,
735*4882a593Smuzhiyun      11,    14,    15,    16,    17,    18,    19,    20,    21,    22,
736*4882a593Smuzhiyun      23,    24,    27,    36,    45,    46,    48,    49,    50,    51,
737*4882a593Smuzhiyun      57,    58,    60,    64,    66,    69,    70,    72,    74,    75,
738*4882a593Smuzhiyun      76,    85,    44,    36,    43,    86,    36,    84,    36,    84,
739*4882a593Smuzhiyun      27,    90,    36,    84,    27,    27,    27,    28,    35,    40,
740*4882a593Smuzhiyun      88,    89,    36,     1,     1,    52,    52,    61,    63,    67,
741*4882a593Smuzhiyun      81,    73,    79,    36,    36,    36,    36,    36,    36,    88,
742*4882a593Smuzhiyun      88,    37,    38,    86,    29,    30,    31,    32,    33,    39,
743*4882a593Smuzhiyun      36,    36,     1,    12,    16,    18,    19,    20,    21,    22,
744*4882a593Smuzhiyun      23,    25,    27,    36,    47,    53,    54,    77,    78,    80,
745*4882a593Smuzhiyun      17,    18,    19,    20,    36,    47,    62,    78,    80,    46,
746*4882a593Smuzhiyun      59,    85,    46,    60,    65,    72,    85,    24,    36,    79,
747*4882a593Smuzhiyun      82,    46,    60,    71,    72,    85,    36,    47,    80,    34,
748*4882a593Smuzhiyun      88,    88,    89,    89,    89,    89,    89,    89,    36,    36,
749*4882a593Smuzhiyun      26,    84,    83,    84,    88,    27,    27,    89,    55,     1,
750*4882a593Smuzhiyun      13,    36,    84,    83,    27,    14,    87,    88,    87,    36,
751*4882a593Smuzhiyun      87,    87,    87,    87,    89,    27,    36,    36,    87,    36,
752*4882a593Smuzhiyun      87,    88,    36,    36,    36,    36,    36,    87,    39,    56,
753*4882a593Smuzhiyun      36,    36,    36,    84
754*4882a593Smuzhiyun};
755*4882a593Smuzhiyun
756*4882a593Smuzhiyun  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
757*4882a593Smuzhiyunstatic const yytype_uint8 yyr1[] =
758*4882a593Smuzhiyun{
759*4882a593Smuzhiyun       0,    41,    42,    42,    43,    43,    44,    44,    44,    44,
760*4882a593Smuzhiyun      44,    44,    44,    44,    45,    45,    45,    45,    45,    45,
761*4882a593Smuzhiyun      45,    45,    45,    46,    46,    46,    46,    46,    46,    47,
762*4882a593Smuzhiyun      47,    48,    49,    50,    51,    52,    52,    52,    52,    52,
763*4882a593Smuzhiyun      52,    52,    53,    53,    53,    53,    53,    53,    54,    55,
764*4882a593Smuzhiyun      55,    56,    56,    57,    58,    59,    60,    61,    61,    61,
765*4882a593Smuzhiyun      61,    61,    61,    62,    62,    62,    62,    63,    63,    64,
766*4882a593Smuzhiyun      65,    66,    67,    67,    67,    67,    68,    69,    70,    71,
767*4882a593Smuzhiyun      72,    73,    73,    73,    73,    74,    75,    76,    77,    78,
768*4882a593Smuzhiyun      79,    79,    79,    79,    80,    81,    81,    81,    82,    83,
769*4882a593Smuzhiyun      83,    84,    84,    85,    85,    85,    86,    86,    87,    87,
770*4882a593Smuzhiyun      88,    88,    88,    88,    88,    88,    88,    88,    88,    88,
771*4882a593Smuzhiyun      88,    89,    89,    90,    90
772*4882a593Smuzhiyun};
773*4882a593Smuzhiyun
774*4882a593Smuzhiyun  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
775*4882a593Smuzhiyunstatic const yytype_uint8 yyr2[] =
776*4882a593Smuzhiyun{
777*4882a593Smuzhiyun       0,     2,     2,     1,     2,     1,     0,     2,     2,     2,
778*4882a593Smuzhiyun       2,     4,     4,     3,     1,     1,     1,     1,     1,     1,
779*4882a593Smuzhiyun       1,     1,     1,     1,     1,     1,     1,     1,     1,     3,
780*4882a593Smuzhiyun       2,     3,     2,     3,     2,     0,     2,     2,     2,     2,
781*4882a593Smuzhiyun       2,     2,     3,     4,     4,     4,     4,     5,     3,     0,
782*4882a593Smuzhiyun       3,     0,     2,     3,     2,     1,     3,     0,     2,     2,
783*4882a593Smuzhiyun       2,     2,     2,     4,     3,     2,     4,     0,     2,     3,
784*4882a593Smuzhiyun       1,     3,     0,     2,     2,     2,     3,     3,     3,     1,
785*4882a593Smuzhiyun       3,     0,     2,     2,     2,     3,     3,     2,     2,     2,
786*4882a593Smuzhiyun       0,     2,     2,     2,     4,     0,     2,     2,     2,     0,
787*4882a593Smuzhiyun       2,     1,     1,     2,     2,     2,     1,     2,     0,     2,
788*4882a593Smuzhiyun       1,     3,     3,     3,     3,     3,     3,     3,     2,     3,
789*4882a593Smuzhiyun       3,     1,     1,     0,     1
790*4882a593Smuzhiyun};
791*4882a593Smuzhiyun
792*4882a593Smuzhiyun
793*4882a593Smuzhiyun#define yyerrok         (yyerrstatus = 0)
794*4882a593Smuzhiyun#define yyclearin       (yychar = YYEMPTY)
795*4882a593Smuzhiyun#define YYEMPTY         (-2)
796*4882a593Smuzhiyun#define YYEOF           0
797*4882a593Smuzhiyun
798*4882a593Smuzhiyun#define YYACCEPT        goto yyacceptlab
799*4882a593Smuzhiyun#define YYABORT         goto yyabortlab
800*4882a593Smuzhiyun#define YYERROR         goto yyerrorlab
801*4882a593Smuzhiyun
802*4882a593Smuzhiyun
803*4882a593Smuzhiyun#define YYRECOVERING()  (!!yyerrstatus)
804*4882a593Smuzhiyun
805*4882a593Smuzhiyun#define YYBACKUP(Token, Value)                                  \
806*4882a593Smuzhiyundo                                                              \
807*4882a593Smuzhiyun  if (yychar == YYEMPTY)                                        \
808*4882a593Smuzhiyun    {                                                           \
809*4882a593Smuzhiyun      yychar = (Token);                                         \
810*4882a593Smuzhiyun      yylval = (Value);                                         \
811*4882a593Smuzhiyun      YYPOPSTACK (yylen);                                       \
812*4882a593Smuzhiyun      yystate = *yyssp;                                         \
813*4882a593Smuzhiyun      goto yybackup;                                            \
814*4882a593Smuzhiyun    }                                                           \
815*4882a593Smuzhiyun  else                                                          \
816*4882a593Smuzhiyun    {                                                           \
817*4882a593Smuzhiyun      yyerror (YY_("syntax error: cannot back up")); \
818*4882a593Smuzhiyun      YYERROR;                                                  \
819*4882a593Smuzhiyun    }                                                           \
820*4882a593Smuzhiyunwhile (0)
821*4882a593Smuzhiyun
822*4882a593Smuzhiyun/* Error token number */
823*4882a593Smuzhiyun#define YYTERROR        1
824*4882a593Smuzhiyun#define YYERRCODE       256
825*4882a593Smuzhiyun
826*4882a593Smuzhiyun
827*4882a593Smuzhiyun
828*4882a593Smuzhiyun/* Enable debugging if requested.  */
829*4882a593Smuzhiyun#if YYDEBUG
830*4882a593Smuzhiyun
831*4882a593Smuzhiyun# ifndef YYFPRINTF
832*4882a593Smuzhiyun#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
833*4882a593Smuzhiyun#  define YYFPRINTF fprintf
834*4882a593Smuzhiyun# endif
835*4882a593Smuzhiyun
836*4882a593Smuzhiyun# define YYDPRINTF(Args)                        \
837*4882a593Smuzhiyundo {                                            \
838*4882a593Smuzhiyun  if (yydebug)                                  \
839*4882a593Smuzhiyun    YYFPRINTF Args;                             \
840*4882a593Smuzhiyun} while (0)
841*4882a593Smuzhiyun
842*4882a593Smuzhiyun/* This macro is provided for backward compatibility. */
843*4882a593Smuzhiyun#ifndef YY_LOCATION_PRINT
844*4882a593Smuzhiyun# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
845*4882a593Smuzhiyun#endif
846*4882a593Smuzhiyun
847*4882a593Smuzhiyun
848*4882a593Smuzhiyun# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
849*4882a593Smuzhiyundo {                                                                      \
850*4882a593Smuzhiyun  if (yydebug)                                                            \
851*4882a593Smuzhiyun    {                                                                     \
852*4882a593Smuzhiyun      YYFPRINTF (stderr, "%s ", Title);                                   \
853*4882a593Smuzhiyun      yy_symbol_print (stderr,                                            \
854*4882a593Smuzhiyun                  Type, Value); \
855*4882a593Smuzhiyun      YYFPRINTF (stderr, "\n");                                           \
856*4882a593Smuzhiyun    }                                                                     \
857*4882a593Smuzhiyun} while (0)
858*4882a593Smuzhiyun
859*4882a593Smuzhiyun
860*4882a593Smuzhiyun/*----------------------------------------.
861*4882a593Smuzhiyun| Print this symbol's value on YYOUTPUT.  |
862*4882a593Smuzhiyun`----------------------------------------*/
863*4882a593Smuzhiyun
864*4882a593Smuzhiyunstatic void
865*4882a593Smuzhiyunyy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
866*4882a593Smuzhiyun{
867*4882a593Smuzhiyun  FILE *yyo = yyoutput;
868*4882a593Smuzhiyun  YYUSE (yyo);
869*4882a593Smuzhiyun  if (!yyvaluep)
870*4882a593Smuzhiyun    return;
871*4882a593Smuzhiyun# ifdef YYPRINT
872*4882a593Smuzhiyun  if (yytype < YYNTOKENS)
873*4882a593Smuzhiyun    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
874*4882a593Smuzhiyun# endif
875*4882a593Smuzhiyun  YYUSE (yytype);
876*4882a593Smuzhiyun}
877*4882a593Smuzhiyun
878*4882a593Smuzhiyun
879*4882a593Smuzhiyun/*--------------------------------.
880*4882a593Smuzhiyun| Print this symbol on YYOUTPUT.  |
881*4882a593Smuzhiyun`--------------------------------*/
882*4882a593Smuzhiyun
883*4882a593Smuzhiyunstatic void
884*4882a593Smuzhiyunyy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
885*4882a593Smuzhiyun{
886*4882a593Smuzhiyun  YYFPRINTF (yyoutput, "%s %s (",
887*4882a593Smuzhiyun             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
888*4882a593Smuzhiyun
889*4882a593Smuzhiyun  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
890*4882a593Smuzhiyun  YYFPRINTF (yyoutput, ")");
891*4882a593Smuzhiyun}
892*4882a593Smuzhiyun
893*4882a593Smuzhiyun/*------------------------------------------------------------------.
894*4882a593Smuzhiyun| yy_stack_print -- Print the state stack from its BOTTOM up to its |
895*4882a593Smuzhiyun| TOP (included).                                                   |
896*4882a593Smuzhiyun`------------------------------------------------------------------*/
897*4882a593Smuzhiyun
898*4882a593Smuzhiyunstatic void
899*4882a593Smuzhiyunyy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
900*4882a593Smuzhiyun{
901*4882a593Smuzhiyun  YYFPRINTF (stderr, "Stack now");
902*4882a593Smuzhiyun  for (; yybottom <= yytop; yybottom++)
903*4882a593Smuzhiyun    {
904*4882a593Smuzhiyun      int yybot = *yybottom;
905*4882a593Smuzhiyun      YYFPRINTF (stderr, " %d", yybot);
906*4882a593Smuzhiyun    }
907*4882a593Smuzhiyun  YYFPRINTF (stderr, "\n");
908*4882a593Smuzhiyun}
909*4882a593Smuzhiyun
910*4882a593Smuzhiyun# define YY_STACK_PRINT(Bottom, Top)                            \
911*4882a593Smuzhiyundo {                                                            \
912*4882a593Smuzhiyun  if (yydebug)                                                  \
913*4882a593Smuzhiyun    yy_stack_print ((Bottom), (Top));                           \
914*4882a593Smuzhiyun} while (0)
915*4882a593Smuzhiyun
916*4882a593Smuzhiyun
917*4882a593Smuzhiyun/*------------------------------------------------.
918*4882a593Smuzhiyun| Report that the YYRULE is going to be reduced.  |
919*4882a593Smuzhiyun`------------------------------------------------*/
920*4882a593Smuzhiyun
921*4882a593Smuzhiyunstatic void
922*4882a593Smuzhiyunyy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
923*4882a593Smuzhiyun{
924*4882a593Smuzhiyun  unsigned long int yylno = yyrline[yyrule];
925*4882a593Smuzhiyun  int yynrhs = yyr2[yyrule];
926*4882a593Smuzhiyun  int yyi;
927*4882a593Smuzhiyun  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
928*4882a593Smuzhiyun             yyrule - 1, yylno);
929*4882a593Smuzhiyun  /* The symbols being reduced.  */
930*4882a593Smuzhiyun  for (yyi = 0; yyi < yynrhs; yyi++)
931*4882a593Smuzhiyun    {
932*4882a593Smuzhiyun      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
933*4882a593Smuzhiyun      yy_symbol_print (stderr,
934*4882a593Smuzhiyun                       yystos[yyssp[yyi + 1 - yynrhs]],
935*4882a593Smuzhiyun                       &(yyvsp[(yyi + 1) - (yynrhs)])
936*4882a593Smuzhiyun                                              );
937*4882a593Smuzhiyun      YYFPRINTF (stderr, "\n");
938*4882a593Smuzhiyun    }
939*4882a593Smuzhiyun}
940*4882a593Smuzhiyun
941*4882a593Smuzhiyun# define YY_REDUCE_PRINT(Rule)          \
942*4882a593Smuzhiyundo {                                    \
943*4882a593Smuzhiyun  if (yydebug)                          \
944*4882a593Smuzhiyun    yy_reduce_print (yyssp, yyvsp, Rule); \
945*4882a593Smuzhiyun} while (0)
946*4882a593Smuzhiyun
947*4882a593Smuzhiyun/* Nonzero means print parse trace.  It is left uninitialized so that
948*4882a593Smuzhiyun   multiple parsers can coexist.  */
949*4882a593Smuzhiyunint yydebug;
950*4882a593Smuzhiyun#else /* !YYDEBUG */
951*4882a593Smuzhiyun# define YYDPRINTF(Args)
952*4882a593Smuzhiyun# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
953*4882a593Smuzhiyun# define YY_STACK_PRINT(Bottom, Top)
954*4882a593Smuzhiyun# define YY_REDUCE_PRINT(Rule)
955*4882a593Smuzhiyun#endif /* !YYDEBUG */
956*4882a593Smuzhiyun
957*4882a593Smuzhiyun
958*4882a593Smuzhiyun/* YYINITDEPTH -- initial size of the parser's stacks.  */
959*4882a593Smuzhiyun#ifndef YYINITDEPTH
960*4882a593Smuzhiyun# define YYINITDEPTH 200
961*4882a593Smuzhiyun#endif
962*4882a593Smuzhiyun
963*4882a593Smuzhiyun/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
964*4882a593Smuzhiyun   if the built-in stack extension method is used).
965*4882a593Smuzhiyun
966*4882a593Smuzhiyun   Do not make this value too large; the results are undefined if
967*4882a593Smuzhiyun   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
968*4882a593Smuzhiyun   evaluated with infinite-precision integer arithmetic.  */
969*4882a593Smuzhiyun
970*4882a593Smuzhiyun#ifndef YYMAXDEPTH
971*4882a593Smuzhiyun# define YYMAXDEPTH 10000
972*4882a593Smuzhiyun#endif
973*4882a593Smuzhiyun
974*4882a593Smuzhiyun
975*4882a593Smuzhiyun#if YYERROR_VERBOSE
976*4882a593Smuzhiyun
977*4882a593Smuzhiyun# ifndef yystrlen
978*4882a593Smuzhiyun#  if defined __GLIBC__ && defined _STRING_H
979*4882a593Smuzhiyun#   define yystrlen strlen
980*4882a593Smuzhiyun#  else
981*4882a593Smuzhiyun/* Return the length of YYSTR.  */
982*4882a593Smuzhiyunstatic YYSIZE_T
983*4882a593Smuzhiyunyystrlen (const char *yystr)
984*4882a593Smuzhiyun{
985*4882a593Smuzhiyun  YYSIZE_T yylen;
986*4882a593Smuzhiyun  for (yylen = 0; yystr[yylen]; yylen++)
987*4882a593Smuzhiyun    continue;
988*4882a593Smuzhiyun  return yylen;
989*4882a593Smuzhiyun}
990*4882a593Smuzhiyun#  endif
991*4882a593Smuzhiyun# endif
992*4882a593Smuzhiyun
993*4882a593Smuzhiyun# ifndef yystpcpy
994*4882a593Smuzhiyun#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
995*4882a593Smuzhiyun#   define yystpcpy stpcpy
996*4882a593Smuzhiyun#  else
997*4882a593Smuzhiyun/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
998*4882a593Smuzhiyun   YYDEST.  */
999*4882a593Smuzhiyunstatic char *
1000*4882a593Smuzhiyunyystpcpy (char *yydest, const char *yysrc)
1001*4882a593Smuzhiyun{
1002*4882a593Smuzhiyun  char *yyd = yydest;
1003*4882a593Smuzhiyun  const char *yys = yysrc;
1004*4882a593Smuzhiyun
1005*4882a593Smuzhiyun  while ((*yyd++ = *yys++) != '\0')
1006*4882a593Smuzhiyun    continue;
1007*4882a593Smuzhiyun
1008*4882a593Smuzhiyun  return yyd - 1;
1009*4882a593Smuzhiyun}
1010*4882a593Smuzhiyun#  endif
1011*4882a593Smuzhiyun# endif
1012*4882a593Smuzhiyun
1013*4882a593Smuzhiyun# ifndef yytnamerr
1014*4882a593Smuzhiyun/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1015*4882a593Smuzhiyun   quotes and backslashes, so that it's suitable for yyerror.  The
1016*4882a593Smuzhiyun   heuristic is that double-quoting is unnecessary unless the string
1017*4882a593Smuzhiyun   contains an apostrophe, a comma, or backslash (other than
1018*4882a593Smuzhiyun   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1019*4882a593Smuzhiyun   null, do not copy; instead, return the length of what the result
1020*4882a593Smuzhiyun   would have been.  */
1021*4882a593Smuzhiyunstatic YYSIZE_T
1022*4882a593Smuzhiyunyytnamerr (char *yyres, const char *yystr)
1023*4882a593Smuzhiyun{
1024*4882a593Smuzhiyun  if (*yystr == '"')
1025*4882a593Smuzhiyun    {
1026*4882a593Smuzhiyun      YYSIZE_T yyn = 0;
1027*4882a593Smuzhiyun      char const *yyp = yystr;
1028*4882a593Smuzhiyun
1029*4882a593Smuzhiyun      for (;;)
1030*4882a593Smuzhiyun        switch (*++yyp)
1031*4882a593Smuzhiyun          {
1032*4882a593Smuzhiyun          case '\'':
1033*4882a593Smuzhiyun          case ',':
1034*4882a593Smuzhiyun            goto do_not_strip_quotes;
1035*4882a593Smuzhiyun
1036*4882a593Smuzhiyun          case '\\':
1037*4882a593Smuzhiyun            if (*++yyp != '\\')
1038*4882a593Smuzhiyun              goto do_not_strip_quotes;
1039*4882a593Smuzhiyun            /* Fall through.  */
1040*4882a593Smuzhiyun          default:
1041*4882a593Smuzhiyun            if (yyres)
1042*4882a593Smuzhiyun              yyres[yyn] = *yyp;
1043*4882a593Smuzhiyun            yyn++;
1044*4882a593Smuzhiyun            break;
1045*4882a593Smuzhiyun
1046*4882a593Smuzhiyun          case '"':
1047*4882a593Smuzhiyun            if (yyres)
1048*4882a593Smuzhiyun              yyres[yyn] = '\0';
1049*4882a593Smuzhiyun            return yyn;
1050*4882a593Smuzhiyun          }
1051*4882a593Smuzhiyun    do_not_strip_quotes: ;
1052*4882a593Smuzhiyun    }
1053*4882a593Smuzhiyun
1054*4882a593Smuzhiyun  if (! yyres)
1055*4882a593Smuzhiyun    return yystrlen (yystr);
1056*4882a593Smuzhiyun
1057*4882a593Smuzhiyun  return yystpcpy (yyres, yystr) - yyres;
1058*4882a593Smuzhiyun}
1059*4882a593Smuzhiyun# endif
1060*4882a593Smuzhiyun
1061*4882a593Smuzhiyun/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1062*4882a593Smuzhiyun   about the unexpected token YYTOKEN for the state stack whose top is
1063*4882a593Smuzhiyun   YYSSP.
1064*4882a593Smuzhiyun
1065*4882a593Smuzhiyun   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1066*4882a593Smuzhiyun   not large enough to hold the message.  In that case, also set
1067*4882a593Smuzhiyun   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1068*4882a593Smuzhiyun   required number of bytes is too large to store.  */
1069*4882a593Smuzhiyunstatic int
1070*4882a593Smuzhiyunyysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1071*4882a593Smuzhiyun                yytype_int16 *yyssp, int yytoken)
1072*4882a593Smuzhiyun{
1073*4882a593Smuzhiyun  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1074*4882a593Smuzhiyun  YYSIZE_T yysize = yysize0;
1075*4882a593Smuzhiyun  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1076*4882a593Smuzhiyun  /* Internationalized format string. */
1077*4882a593Smuzhiyun  const char *yyformat = YY_NULLPTR;
1078*4882a593Smuzhiyun  /* Arguments of yyformat. */
1079*4882a593Smuzhiyun  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1080*4882a593Smuzhiyun  /* Number of reported tokens (one for the "unexpected", one per
1081*4882a593Smuzhiyun     "expected"). */
1082*4882a593Smuzhiyun  int yycount = 0;
1083*4882a593Smuzhiyun
1084*4882a593Smuzhiyun  /* There are many possibilities here to consider:
1085*4882a593Smuzhiyun     - If this state is a consistent state with a default action, then
1086*4882a593Smuzhiyun       the only way this function was invoked is if the default action
1087*4882a593Smuzhiyun       is an error action.  In that case, don't check for expected
1088*4882a593Smuzhiyun       tokens because there are none.
1089*4882a593Smuzhiyun     - The only way there can be no lookahead present (in yychar) is if
1090*4882a593Smuzhiyun       this state is a consistent state with a default action.  Thus,
1091*4882a593Smuzhiyun       detecting the absence of a lookahead is sufficient to determine
1092*4882a593Smuzhiyun       that there is no unexpected or expected token to report.  In that
1093*4882a593Smuzhiyun       case, just report a simple "syntax error".
1094*4882a593Smuzhiyun     - Don't assume there isn't a lookahead just because this state is a
1095*4882a593Smuzhiyun       consistent state with a default action.  There might have been a
1096*4882a593Smuzhiyun       previous inconsistent state, consistent state with a non-default
1097*4882a593Smuzhiyun       action, or user semantic action that manipulated yychar.
1098*4882a593Smuzhiyun     - Of course, the expected token list depends on states to have
1099*4882a593Smuzhiyun       correct lookahead information, and it depends on the parser not
1100*4882a593Smuzhiyun       to perform extra reductions after fetching a lookahead from the
1101*4882a593Smuzhiyun       scanner and before detecting a syntax error.  Thus, state merging
1102*4882a593Smuzhiyun       (from LALR or IELR) and default reductions corrupt the expected
1103*4882a593Smuzhiyun       token list.  However, the list is correct for canonical LR with
1104*4882a593Smuzhiyun       one exception: it will still contain any token that will not be
1105*4882a593Smuzhiyun       accepted due to an error action in a later state.
1106*4882a593Smuzhiyun  */
1107*4882a593Smuzhiyun  if (yytoken != YYEMPTY)
1108*4882a593Smuzhiyun    {
1109*4882a593Smuzhiyun      int yyn = yypact[*yyssp];
1110*4882a593Smuzhiyun      yyarg[yycount++] = yytname[yytoken];
1111*4882a593Smuzhiyun      if (!yypact_value_is_default (yyn))
1112*4882a593Smuzhiyun        {
1113*4882a593Smuzhiyun          /* Start YYX at -YYN if negative to avoid negative indexes in
1114*4882a593Smuzhiyun             YYCHECK.  In other words, skip the first -YYN actions for
1115*4882a593Smuzhiyun             this state because they are default actions.  */
1116*4882a593Smuzhiyun          int yyxbegin = yyn < 0 ? -yyn : 0;
1117*4882a593Smuzhiyun          /* Stay within bounds of both yycheck and yytname.  */
1118*4882a593Smuzhiyun          int yychecklim = YYLAST - yyn + 1;
1119*4882a593Smuzhiyun          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1120*4882a593Smuzhiyun          int yyx;
1121*4882a593Smuzhiyun
1122*4882a593Smuzhiyun          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1123*4882a593Smuzhiyun            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1124*4882a593Smuzhiyun                && !yytable_value_is_error (yytable[yyx + yyn]))
1125*4882a593Smuzhiyun              {
1126*4882a593Smuzhiyun                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1127*4882a593Smuzhiyun                  {
1128*4882a593Smuzhiyun                    yycount = 1;
1129*4882a593Smuzhiyun                    yysize = yysize0;
1130*4882a593Smuzhiyun                    break;
1131*4882a593Smuzhiyun                  }
1132*4882a593Smuzhiyun                yyarg[yycount++] = yytname[yyx];
1133*4882a593Smuzhiyun                {
1134*4882a593Smuzhiyun                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1135*4882a593Smuzhiyun                  if (! (yysize <= yysize1
1136*4882a593Smuzhiyun                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1137*4882a593Smuzhiyun                    return 2;
1138*4882a593Smuzhiyun                  yysize = yysize1;
1139*4882a593Smuzhiyun                }
1140*4882a593Smuzhiyun              }
1141*4882a593Smuzhiyun        }
1142*4882a593Smuzhiyun    }
1143*4882a593Smuzhiyun
1144*4882a593Smuzhiyun  switch (yycount)
1145*4882a593Smuzhiyun    {
1146*4882a593Smuzhiyun# define YYCASE_(N, S)                      \
1147*4882a593Smuzhiyun      case N:                               \
1148*4882a593Smuzhiyun        yyformat = S;                       \
1149*4882a593Smuzhiyun      break
1150*4882a593Smuzhiyun      YYCASE_(0, YY_("syntax error"));
1151*4882a593Smuzhiyun      YYCASE_(1, YY_("syntax error, unexpected %s"));
1152*4882a593Smuzhiyun      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1153*4882a593Smuzhiyun      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1154*4882a593Smuzhiyun      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1155*4882a593Smuzhiyun      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1156*4882a593Smuzhiyun# undef YYCASE_
1157*4882a593Smuzhiyun    }
1158*4882a593Smuzhiyun
1159*4882a593Smuzhiyun  {
1160*4882a593Smuzhiyun    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1161*4882a593Smuzhiyun    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1162*4882a593Smuzhiyun      return 2;
1163*4882a593Smuzhiyun    yysize = yysize1;
1164*4882a593Smuzhiyun  }
1165*4882a593Smuzhiyun
1166*4882a593Smuzhiyun  if (*yymsg_alloc < yysize)
1167*4882a593Smuzhiyun    {
1168*4882a593Smuzhiyun      *yymsg_alloc = 2 * yysize;
1169*4882a593Smuzhiyun      if (! (yysize <= *yymsg_alloc
1170*4882a593Smuzhiyun             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1171*4882a593Smuzhiyun        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1172*4882a593Smuzhiyun      return 1;
1173*4882a593Smuzhiyun    }
1174*4882a593Smuzhiyun
1175*4882a593Smuzhiyun  /* Avoid sprintf, as that infringes on the user's name space.
1176*4882a593Smuzhiyun     Don't have undefined behavior even if the translation
1177*4882a593Smuzhiyun     produced a string with the wrong number of "%s"s.  */
1178*4882a593Smuzhiyun  {
1179*4882a593Smuzhiyun    char *yyp = *yymsg;
1180*4882a593Smuzhiyun    int yyi = 0;
1181*4882a593Smuzhiyun    while ((*yyp = *yyformat) != '\0')
1182*4882a593Smuzhiyun      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1183*4882a593Smuzhiyun        {
1184*4882a593Smuzhiyun          yyp += yytnamerr (yyp, yyarg[yyi++]);
1185*4882a593Smuzhiyun          yyformat += 2;
1186*4882a593Smuzhiyun        }
1187*4882a593Smuzhiyun      else
1188*4882a593Smuzhiyun        {
1189*4882a593Smuzhiyun          yyp++;
1190*4882a593Smuzhiyun          yyformat++;
1191*4882a593Smuzhiyun        }
1192*4882a593Smuzhiyun  }
1193*4882a593Smuzhiyun  return 0;
1194*4882a593Smuzhiyun}
1195*4882a593Smuzhiyun#endif /* YYERROR_VERBOSE */
1196*4882a593Smuzhiyun
1197*4882a593Smuzhiyun/*-----------------------------------------------.
1198*4882a593Smuzhiyun| Release the memory associated to this symbol.  |
1199*4882a593Smuzhiyun`-----------------------------------------------*/
1200*4882a593Smuzhiyun
1201*4882a593Smuzhiyunstatic void
1202*4882a593Smuzhiyunyydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1203*4882a593Smuzhiyun{
1204*4882a593Smuzhiyun  YYUSE (yyvaluep);
1205*4882a593Smuzhiyun  if (!yymsg)
1206*4882a593Smuzhiyun    yymsg = "Deleting";
1207*4882a593Smuzhiyun  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1208*4882a593Smuzhiyun
1209*4882a593Smuzhiyun  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1210*4882a593Smuzhiyun  switch (yytype)
1211*4882a593Smuzhiyun    {
1212*4882a593Smuzhiyun          case 58: /* choice_entry  */
1213*4882a593Smuzhiyun
1214*4882a593Smuzhiyun      {
1215*4882a593Smuzhiyun	fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1216*4882a593Smuzhiyun		((*yyvaluep).menu)->file->name, ((*yyvaluep).menu)->lineno);
1217*4882a593Smuzhiyun	if (current_menu == ((*yyvaluep).menu))
1218*4882a593Smuzhiyun		menu_end_menu();
1219*4882a593Smuzhiyun}
1220*4882a593Smuzhiyun
1221*4882a593Smuzhiyun        break;
1222*4882a593Smuzhiyun
1223*4882a593Smuzhiyun    case 64: /* if_entry  */
1224*4882a593Smuzhiyun
1225*4882a593Smuzhiyun      {
1226*4882a593Smuzhiyun	fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1227*4882a593Smuzhiyun		((*yyvaluep).menu)->file->name, ((*yyvaluep).menu)->lineno);
1228*4882a593Smuzhiyun	if (current_menu == ((*yyvaluep).menu))
1229*4882a593Smuzhiyun		menu_end_menu();
1230*4882a593Smuzhiyun}
1231*4882a593Smuzhiyun
1232*4882a593Smuzhiyun        break;
1233*4882a593Smuzhiyun
1234*4882a593Smuzhiyun    case 70: /* menu_entry  */
1235*4882a593Smuzhiyun
1236*4882a593Smuzhiyun      {
1237*4882a593Smuzhiyun	fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1238*4882a593Smuzhiyun		((*yyvaluep).menu)->file->name, ((*yyvaluep).menu)->lineno);
1239*4882a593Smuzhiyun	if (current_menu == ((*yyvaluep).menu))
1240*4882a593Smuzhiyun		menu_end_menu();
1241*4882a593Smuzhiyun}
1242*4882a593Smuzhiyun
1243*4882a593Smuzhiyun        break;
1244*4882a593Smuzhiyun
1245*4882a593Smuzhiyun
1246*4882a593Smuzhiyun      default:
1247*4882a593Smuzhiyun        break;
1248*4882a593Smuzhiyun    }
1249*4882a593Smuzhiyun  YY_IGNORE_MAYBE_UNINITIALIZED_END
1250*4882a593Smuzhiyun}
1251*4882a593Smuzhiyun
1252*4882a593Smuzhiyun
1253*4882a593Smuzhiyun
1254*4882a593Smuzhiyun
1255*4882a593Smuzhiyun/* The lookahead symbol.  */
1256*4882a593Smuzhiyunint yychar;
1257*4882a593Smuzhiyun
1258*4882a593Smuzhiyun/* The semantic value of the lookahead symbol.  */
1259*4882a593SmuzhiyunYYSTYPE yylval;
1260*4882a593Smuzhiyun/* Number of syntax errors so far.  */
1261*4882a593Smuzhiyunint yynerrs;
1262*4882a593Smuzhiyun
1263*4882a593Smuzhiyun
1264*4882a593Smuzhiyun/*----------.
1265*4882a593Smuzhiyun| yyparse.  |
1266*4882a593Smuzhiyun`----------*/
1267*4882a593Smuzhiyun
1268*4882a593Smuzhiyunint
1269*4882a593Smuzhiyunyyparse (void)
1270*4882a593Smuzhiyun{
1271*4882a593Smuzhiyun    int yystate;
1272*4882a593Smuzhiyun    /* Number of tokens to shift before error messages enabled.  */
1273*4882a593Smuzhiyun    int yyerrstatus;
1274*4882a593Smuzhiyun
1275*4882a593Smuzhiyun    /* The stacks and their tools:
1276*4882a593Smuzhiyun       'yyss': related to states.
1277*4882a593Smuzhiyun       'yyvs': related to semantic values.
1278*4882a593Smuzhiyun
1279*4882a593Smuzhiyun       Refer to the stacks through separate pointers, to allow yyoverflow
1280*4882a593Smuzhiyun       to reallocate them elsewhere.  */
1281*4882a593Smuzhiyun
1282*4882a593Smuzhiyun    /* The state stack.  */
1283*4882a593Smuzhiyun    yytype_int16 yyssa[YYINITDEPTH];
1284*4882a593Smuzhiyun    yytype_int16 *yyss;
1285*4882a593Smuzhiyun    yytype_int16 *yyssp;
1286*4882a593Smuzhiyun
1287*4882a593Smuzhiyun    /* The semantic value stack.  */
1288*4882a593Smuzhiyun    YYSTYPE yyvsa[YYINITDEPTH];
1289*4882a593Smuzhiyun    YYSTYPE *yyvs;
1290*4882a593Smuzhiyun    YYSTYPE *yyvsp;
1291*4882a593Smuzhiyun
1292*4882a593Smuzhiyun    YYSIZE_T yystacksize;
1293*4882a593Smuzhiyun
1294*4882a593Smuzhiyun  int yyn;
1295*4882a593Smuzhiyun  int yyresult;
1296*4882a593Smuzhiyun  /* Lookahead token as an internal (translated) token number.  */
1297*4882a593Smuzhiyun  int yytoken = 0;
1298*4882a593Smuzhiyun  /* The variables used to return semantic value and location from the
1299*4882a593Smuzhiyun     action routines.  */
1300*4882a593Smuzhiyun  YYSTYPE yyval;
1301*4882a593Smuzhiyun
1302*4882a593Smuzhiyun#if YYERROR_VERBOSE
1303*4882a593Smuzhiyun  /* Buffer for error messages, and its allocated size.  */
1304*4882a593Smuzhiyun  char yymsgbuf[128];
1305*4882a593Smuzhiyun  char *yymsg = yymsgbuf;
1306*4882a593Smuzhiyun  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1307*4882a593Smuzhiyun#endif
1308*4882a593Smuzhiyun
1309*4882a593Smuzhiyun#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1310*4882a593Smuzhiyun
1311*4882a593Smuzhiyun  /* The number of symbols on the RHS of the reduced rule.
1312*4882a593Smuzhiyun     Keep to zero when no symbol should be popped.  */
1313*4882a593Smuzhiyun  int yylen = 0;
1314*4882a593Smuzhiyun
1315*4882a593Smuzhiyun  yyssp = yyss = yyssa;
1316*4882a593Smuzhiyun  yyvsp = yyvs = yyvsa;
1317*4882a593Smuzhiyun  yystacksize = YYINITDEPTH;
1318*4882a593Smuzhiyun
1319*4882a593Smuzhiyun  YYDPRINTF ((stderr, "Starting parse\n"));
1320*4882a593Smuzhiyun
1321*4882a593Smuzhiyun  yystate = 0;
1322*4882a593Smuzhiyun  yyerrstatus = 0;
1323*4882a593Smuzhiyun  yynerrs = 0;
1324*4882a593Smuzhiyun  yychar = YYEMPTY; /* Cause a token to be read.  */
1325*4882a593Smuzhiyun  goto yysetstate;
1326*4882a593Smuzhiyun
1327*4882a593Smuzhiyun/*------------------------------------------------------------.
1328*4882a593Smuzhiyun| yynewstate -- Push a new state, which is found in yystate.  |
1329*4882a593Smuzhiyun`------------------------------------------------------------*/
1330*4882a593Smuzhiyun yynewstate:
1331*4882a593Smuzhiyun  /* In all cases, when you get here, the value and location stacks
1332*4882a593Smuzhiyun     have just been pushed.  So pushing a state here evens the stacks.  */
1333*4882a593Smuzhiyun  yyssp++;
1334*4882a593Smuzhiyun
1335*4882a593Smuzhiyun yysetstate:
1336*4882a593Smuzhiyun  *yyssp = yystate;
1337*4882a593Smuzhiyun
1338*4882a593Smuzhiyun  if (yyss + yystacksize - 1 <= yyssp)
1339*4882a593Smuzhiyun    {
1340*4882a593Smuzhiyun      /* Get the current used size of the three stacks, in elements.  */
1341*4882a593Smuzhiyun      YYSIZE_T yysize = yyssp - yyss + 1;
1342*4882a593Smuzhiyun
1343*4882a593Smuzhiyun#ifdef yyoverflow
1344*4882a593Smuzhiyun      {
1345*4882a593Smuzhiyun        /* Give user a chance to reallocate the stack.  Use copies of
1346*4882a593Smuzhiyun           these so that the &'s don't force the real ones into
1347*4882a593Smuzhiyun           memory.  */
1348*4882a593Smuzhiyun        YYSTYPE *yyvs1 = yyvs;
1349*4882a593Smuzhiyun        yytype_int16 *yyss1 = yyss;
1350*4882a593Smuzhiyun
1351*4882a593Smuzhiyun        /* Each stack pointer address is followed by the size of the
1352*4882a593Smuzhiyun           data in use in that stack, in bytes.  This used to be a
1353*4882a593Smuzhiyun           conditional around just the two extra args, but that might
1354*4882a593Smuzhiyun           be undefined if yyoverflow is a macro.  */
1355*4882a593Smuzhiyun        yyoverflow (YY_("memory exhausted"),
1356*4882a593Smuzhiyun                    &yyss1, yysize * sizeof (*yyssp),
1357*4882a593Smuzhiyun                    &yyvs1, yysize * sizeof (*yyvsp),
1358*4882a593Smuzhiyun                    &yystacksize);
1359*4882a593Smuzhiyun
1360*4882a593Smuzhiyun        yyss = yyss1;
1361*4882a593Smuzhiyun        yyvs = yyvs1;
1362*4882a593Smuzhiyun      }
1363*4882a593Smuzhiyun#else /* no yyoverflow */
1364*4882a593Smuzhiyun# ifndef YYSTACK_RELOCATE
1365*4882a593Smuzhiyun      goto yyexhaustedlab;
1366*4882a593Smuzhiyun# else
1367*4882a593Smuzhiyun      /* Extend the stack our own way.  */
1368*4882a593Smuzhiyun      if (YYMAXDEPTH <= yystacksize)
1369*4882a593Smuzhiyun        goto yyexhaustedlab;
1370*4882a593Smuzhiyun      yystacksize *= 2;
1371*4882a593Smuzhiyun      if (YYMAXDEPTH < yystacksize)
1372*4882a593Smuzhiyun        yystacksize = YYMAXDEPTH;
1373*4882a593Smuzhiyun
1374*4882a593Smuzhiyun      {
1375*4882a593Smuzhiyun        yytype_int16 *yyss1 = yyss;
1376*4882a593Smuzhiyun        union yyalloc *yyptr =
1377*4882a593Smuzhiyun          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1378*4882a593Smuzhiyun        if (! yyptr)
1379*4882a593Smuzhiyun          goto yyexhaustedlab;
1380*4882a593Smuzhiyun        YYSTACK_RELOCATE (yyss_alloc, yyss);
1381*4882a593Smuzhiyun        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1382*4882a593Smuzhiyun#  undef YYSTACK_RELOCATE
1383*4882a593Smuzhiyun        if (yyss1 != yyssa)
1384*4882a593Smuzhiyun          YYSTACK_FREE (yyss1);
1385*4882a593Smuzhiyun      }
1386*4882a593Smuzhiyun# endif
1387*4882a593Smuzhiyun#endif /* no yyoverflow */
1388*4882a593Smuzhiyun
1389*4882a593Smuzhiyun      yyssp = yyss + yysize - 1;
1390*4882a593Smuzhiyun      yyvsp = yyvs + yysize - 1;
1391*4882a593Smuzhiyun
1392*4882a593Smuzhiyun      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1393*4882a593Smuzhiyun                  (unsigned long int) yystacksize));
1394*4882a593Smuzhiyun
1395*4882a593Smuzhiyun      if (yyss + yystacksize - 1 <= yyssp)
1396*4882a593Smuzhiyun        YYABORT;
1397*4882a593Smuzhiyun    }
1398*4882a593Smuzhiyun
1399*4882a593Smuzhiyun  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1400*4882a593Smuzhiyun
1401*4882a593Smuzhiyun  if (yystate == YYFINAL)
1402*4882a593Smuzhiyun    YYACCEPT;
1403*4882a593Smuzhiyun
1404*4882a593Smuzhiyun  goto yybackup;
1405*4882a593Smuzhiyun
1406*4882a593Smuzhiyun/*-----------.
1407*4882a593Smuzhiyun| yybackup.  |
1408*4882a593Smuzhiyun`-----------*/
1409*4882a593Smuzhiyunyybackup:
1410*4882a593Smuzhiyun
1411*4882a593Smuzhiyun  /* Do appropriate processing given the current state.  Read a
1412*4882a593Smuzhiyun     lookahead token if we need one and don't already have one.  */
1413*4882a593Smuzhiyun
1414*4882a593Smuzhiyun  /* First try to decide what to do without reference to lookahead token.  */
1415*4882a593Smuzhiyun  yyn = yypact[yystate];
1416*4882a593Smuzhiyun  if (yypact_value_is_default (yyn))
1417*4882a593Smuzhiyun    goto yydefault;
1418*4882a593Smuzhiyun
1419*4882a593Smuzhiyun  /* Not known => get a lookahead token if don't already have one.  */
1420*4882a593Smuzhiyun
1421*4882a593Smuzhiyun  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1422*4882a593Smuzhiyun  if (yychar == YYEMPTY)
1423*4882a593Smuzhiyun    {
1424*4882a593Smuzhiyun      YYDPRINTF ((stderr, "Reading a token: "));
1425*4882a593Smuzhiyun      yychar = yylex ();
1426*4882a593Smuzhiyun    }
1427*4882a593Smuzhiyun
1428*4882a593Smuzhiyun  if (yychar <= YYEOF)
1429*4882a593Smuzhiyun    {
1430*4882a593Smuzhiyun      yychar = yytoken = YYEOF;
1431*4882a593Smuzhiyun      YYDPRINTF ((stderr, "Now at end of input.\n"));
1432*4882a593Smuzhiyun    }
1433*4882a593Smuzhiyun  else
1434*4882a593Smuzhiyun    {
1435*4882a593Smuzhiyun      yytoken = YYTRANSLATE (yychar);
1436*4882a593Smuzhiyun      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1437*4882a593Smuzhiyun    }
1438*4882a593Smuzhiyun
1439*4882a593Smuzhiyun  /* If the proper action on seeing token YYTOKEN is to reduce or to
1440*4882a593Smuzhiyun     detect an error, take that action.  */
1441*4882a593Smuzhiyun  yyn += yytoken;
1442*4882a593Smuzhiyun  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1443*4882a593Smuzhiyun    goto yydefault;
1444*4882a593Smuzhiyun  yyn = yytable[yyn];
1445*4882a593Smuzhiyun  if (yyn <= 0)
1446*4882a593Smuzhiyun    {
1447*4882a593Smuzhiyun      if (yytable_value_is_error (yyn))
1448*4882a593Smuzhiyun        goto yyerrlab;
1449*4882a593Smuzhiyun      yyn = -yyn;
1450*4882a593Smuzhiyun      goto yyreduce;
1451*4882a593Smuzhiyun    }
1452*4882a593Smuzhiyun
1453*4882a593Smuzhiyun  /* Count tokens shifted since error; after three, turn off error
1454*4882a593Smuzhiyun     status.  */
1455*4882a593Smuzhiyun  if (yyerrstatus)
1456*4882a593Smuzhiyun    yyerrstatus--;
1457*4882a593Smuzhiyun
1458*4882a593Smuzhiyun  /* Shift the lookahead token.  */
1459*4882a593Smuzhiyun  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1460*4882a593Smuzhiyun
1461*4882a593Smuzhiyun  /* Discard the shifted token.  */
1462*4882a593Smuzhiyun  yychar = YYEMPTY;
1463*4882a593Smuzhiyun
1464*4882a593Smuzhiyun  yystate = yyn;
1465*4882a593Smuzhiyun  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1466*4882a593Smuzhiyun  *++yyvsp = yylval;
1467*4882a593Smuzhiyun  YY_IGNORE_MAYBE_UNINITIALIZED_END
1468*4882a593Smuzhiyun
1469*4882a593Smuzhiyun  goto yynewstate;
1470*4882a593Smuzhiyun
1471*4882a593Smuzhiyun
1472*4882a593Smuzhiyun/*-----------------------------------------------------------.
1473*4882a593Smuzhiyun| yydefault -- do the default action for the current state.  |
1474*4882a593Smuzhiyun`-----------------------------------------------------------*/
1475*4882a593Smuzhiyunyydefault:
1476*4882a593Smuzhiyun  yyn = yydefact[yystate];
1477*4882a593Smuzhiyun  if (yyn == 0)
1478*4882a593Smuzhiyun    goto yyerrlab;
1479*4882a593Smuzhiyun  goto yyreduce;
1480*4882a593Smuzhiyun
1481*4882a593Smuzhiyun
1482*4882a593Smuzhiyun/*-----------------------------.
1483*4882a593Smuzhiyun| yyreduce -- Do a reduction.  |
1484*4882a593Smuzhiyun`-----------------------------*/
1485*4882a593Smuzhiyunyyreduce:
1486*4882a593Smuzhiyun  /* yyn is the number of a rule to reduce with.  */
1487*4882a593Smuzhiyun  yylen = yyr2[yyn];
1488*4882a593Smuzhiyun
1489*4882a593Smuzhiyun  /* If YYLEN is nonzero, implement the default value of the action:
1490*4882a593Smuzhiyun     '$$ = $1'.
1491*4882a593Smuzhiyun
1492*4882a593Smuzhiyun     Otherwise, the following line sets YYVAL to garbage.
1493*4882a593Smuzhiyun     This behavior is undocumented and Bison
1494*4882a593Smuzhiyun     users should not rely upon it.  Assigning to YYVAL
1495*4882a593Smuzhiyun     unconditionally makes the parser a bit smaller, and it avoids a
1496*4882a593Smuzhiyun     GCC warning that YYVAL may be used uninitialized.  */
1497*4882a593Smuzhiyun  yyval = yyvsp[1-yylen];
1498*4882a593Smuzhiyun
1499*4882a593Smuzhiyun
1500*4882a593Smuzhiyun  YY_REDUCE_PRINT (yyn);
1501*4882a593Smuzhiyun  switch (yyn)
1502*4882a593Smuzhiyun    {
1503*4882a593Smuzhiyun        case 10:
1504*4882a593Smuzhiyun
1505*4882a593Smuzhiyun    { zconf_error("unexpected end statement"); }
1506*4882a593Smuzhiyun
1507*4882a593Smuzhiyun    break;
1508*4882a593Smuzhiyun
1509*4882a593Smuzhiyun  case 11:
1510*4882a593Smuzhiyun
1511*4882a593Smuzhiyun    { zconf_error("unknown statement \"%s\"", (yyvsp[-2].string)); }
1512*4882a593Smuzhiyun
1513*4882a593Smuzhiyun    break;
1514*4882a593Smuzhiyun
1515*4882a593Smuzhiyun  case 12:
1516*4882a593Smuzhiyun
1517*4882a593Smuzhiyun    {
1518*4882a593Smuzhiyun	zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[-2].id)->name);
1519*4882a593Smuzhiyun}
1520*4882a593Smuzhiyun
1521*4882a593Smuzhiyun    break;
1522*4882a593Smuzhiyun
1523*4882a593Smuzhiyun  case 13:
1524*4882a593Smuzhiyun
1525*4882a593Smuzhiyun    { zconf_error("invalid statement"); }
1526*4882a593Smuzhiyun
1527*4882a593Smuzhiyun    break;
1528*4882a593Smuzhiyun
1529*4882a593Smuzhiyun  case 29:
1530*4882a593Smuzhiyun
1531*4882a593Smuzhiyun    { zconf_error("unknown option \"%s\"", (yyvsp[-2].string)); }
1532*4882a593Smuzhiyun
1533*4882a593Smuzhiyun    break;
1534*4882a593Smuzhiyun
1535*4882a593Smuzhiyun  case 30:
1536*4882a593Smuzhiyun
1537*4882a593Smuzhiyun    { zconf_error("invalid option"); }
1538*4882a593Smuzhiyun
1539*4882a593Smuzhiyun    break;
1540*4882a593Smuzhiyun
1541*4882a593Smuzhiyun  case 31:
1542*4882a593Smuzhiyun
1543*4882a593Smuzhiyun    {
1544*4882a593Smuzhiyun	struct symbol *sym = sym_lookup((yyvsp[-1].string), 0);
1545*4882a593Smuzhiyun	sym->flags |= SYMBOL_OPTIONAL;
1546*4882a593Smuzhiyun	menu_add_entry(sym);
1547*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string));
1548*4882a593Smuzhiyun}
1549*4882a593Smuzhiyun
1550*4882a593Smuzhiyun    break;
1551*4882a593Smuzhiyun
1552*4882a593Smuzhiyun  case 32:
1553*4882a593Smuzhiyun
1554*4882a593Smuzhiyun    {
1555*4882a593Smuzhiyun	menu_end_entry();
1556*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1557*4882a593Smuzhiyun}
1558*4882a593Smuzhiyun
1559*4882a593Smuzhiyun    break;
1560*4882a593Smuzhiyun
1561*4882a593Smuzhiyun  case 33:
1562*4882a593Smuzhiyun
1563*4882a593Smuzhiyun    {
1564*4882a593Smuzhiyun	struct symbol *sym = sym_lookup((yyvsp[-1].string), 0);
1565*4882a593Smuzhiyun	sym->flags |= SYMBOL_OPTIONAL;
1566*4882a593Smuzhiyun	menu_add_entry(sym);
1567*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string));
1568*4882a593Smuzhiyun}
1569*4882a593Smuzhiyun
1570*4882a593Smuzhiyun    break;
1571*4882a593Smuzhiyun
1572*4882a593Smuzhiyun  case 34:
1573*4882a593Smuzhiyun
1574*4882a593Smuzhiyun    {
1575*4882a593Smuzhiyun	if (current_entry->prompt)
1576*4882a593Smuzhiyun		current_entry->prompt->type = P_MENU;
1577*4882a593Smuzhiyun	else
1578*4882a593Smuzhiyun		zconfprint("warning: menuconfig statement without prompt");
1579*4882a593Smuzhiyun	menu_end_entry();
1580*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1581*4882a593Smuzhiyun}
1582*4882a593Smuzhiyun
1583*4882a593Smuzhiyun    break;
1584*4882a593Smuzhiyun
1585*4882a593Smuzhiyun  case 42:
1586*4882a593Smuzhiyun
1587*4882a593Smuzhiyun    {
1588*4882a593Smuzhiyun	menu_set_type((yyvsp[-2].id)->stype);
1589*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1590*4882a593Smuzhiyun		zconf_curname(), zconf_lineno(),
1591*4882a593Smuzhiyun		(yyvsp[-2].id)->stype);
1592*4882a593Smuzhiyun}
1593*4882a593Smuzhiyun
1594*4882a593Smuzhiyun    break;
1595*4882a593Smuzhiyun
1596*4882a593Smuzhiyun  case 43:
1597*4882a593Smuzhiyun
1598*4882a593Smuzhiyun    {
1599*4882a593Smuzhiyun	menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr));
1600*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1601*4882a593Smuzhiyun}
1602*4882a593Smuzhiyun
1603*4882a593Smuzhiyun    break;
1604*4882a593Smuzhiyun
1605*4882a593Smuzhiyun  case 44:
1606*4882a593Smuzhiyun
1607*4882a593Smuzhiyun    {
1608*4882a593Smuzhiyun	menu_add_expr(P_DEFAULT, (yyvsp[-2].expr), (yyvsp[-1].expr));
1609*4882a593Smuzhiyun	if ((yyvsp[-3].id)->stype != S_UNKNOWN)
1610*4882a593Smuzhiyun		menu_set_type((yyvsp[-3].id)->stype);
1611*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
1612*4882a593Smuzhiyun		zconf_curname(), zconf_lineno(),
1613*4882a593Smuzhiyun		(yyvsp[-3].id)->stype);
1614*4882a593Smuzhiyun}
1615*4882a593Smuzhiyun
1616*4882a593Smuzhiyun    break;
1617*4882a593Smuzhiyun
1618*4882a593Smuzhiyun  case 45:
1619*4882a593Smuzhiyun
1620*4882a593Smuzhiyun    {
1621*4882a593Smuzhiyun	menu_add_symbol(P_SELECT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr));
1622*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1623*4882a593Smuzhiyun}
1624*4882a593Smuzhiyun
1625*4882a593Smuzhiyun    break;
1626*4882a593Smuzhiyun
1627*4882a593Smuzhiyun  case 46:
1628*4882a593Smuzhiyun
1629*4882a593Smuzhiyun    {
1630*4882a593Smuzhiyun	menu_add_symbol(P_IMPLY, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr));
1631*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:imply\n", zconf_curname(), zconf_lineno());
1632*4882a593Smuzhiyun}
1633*4882a593Smuzhiyun
1634*4882a593Smuzhiyun    break;
1635*4882a593Smuzhiyun
1636*4882a593Smuzhiyun  case 47:
1637*4882a593Smuzhiyun
1638*4882a593Smuzhiyun    {
1639*4882a593Smuzhiyun	menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[-3].symbol), (yyvsp[-2].symbol)), (yyvsp[-1].expr));
1640*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1641*4882a593Smuzhiyun}
1642*4882a593Smuzhiyun
1643*4882a593Smuzhiyun    break;
1644*4882a593Smuzhiyun
1645*4882a593Smuzhiyun  case 50:
1646*4882a593Smuzhiyun
1647*4882a593Smuzhiyun    {
1648*4882a593Smuzhiyun	const struct kconf_id *id = kconf_id_lookup((yyvsp[-1].string), strlen((yyvsp[-1].string)));
1649*4882a593Smuzhiyun	if (id && id->flags & TF_OPTION)
1650*4882a593Smuzhiyun		menu_add_option(id->token, (yyvsp[0].string));
1651*4882a593Smuzhiyun	else
1652*4882a593Smuzhiyun		zconfprint("warning: ignoring unknown option %s", (yyvsp[-1].string));
1653*4882a593Smuzhiyun	free((yyvsp[-1].string));
1654*4882a593Smuzhiyun}
1655*4882a593Smuzhiyun
1656*4882a593Smuzhiyun    break;
1657*4882a593Smuzhiyun
1658*4882a593Smuzhiyun  case 51:
1659*4882a593Smuzhiyun
1660*4882a593Smuzhiyun    { (yyval.string) = NULL; }
1661*4882a593Smuzhiyun
1662*4882a593Smuzhiyun    break;
1663*4882a593Smuzhiyun
1664*4882a593Smuzhiyun  case 52:
1665*4882a593Smuzhiyun
1666*4882a593Smuzhiyun    { (yyval.string) = (yyvsp[0].string); }
1667*4882a593Smuzhiyun
1668*4882a593Smuzhiyun    break;
1669*4882a593Smuzhiyun
1670*4882a593Smuzhiyun  case 53:
1671*4882a593Smuzhiyun
1672*4882a593Smuzhiyun    {
1673*4882a593Smuzhiyun	struct symbol *sym = sym_lookup((yyvsp[-1].string), SYMBOL_CHOICE);
1674*4882a593Smuzhiyun	sym->flags |= SYMBOL_AUTO;
1675*4882a593Smuzhiyun	menu_add_entry(sym);
1676*4882a593Smuzhiyun	menu_add_expr(P_CHOICE, NULL, NULL);
1677*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1678*4882a593Smuzhiyun}
1679*4882a593Smuzhiyun
1680*4882a593Smuzhiyun    break;
1681*4882a593Smuzhiyun
1682*4882a593Smuzhiyun  case 54:
1683*4882a593Smuzhiyun
1684*4882a593Smuzhiyun    {
1685*4882a593Smuzhiyun	(yyval.menu) = menu_add_menu();
1686*4882a593Smuzhiyun}
1687*4882a593Smuzhiyun
1688*4882a593Smuzhiyun    break;
1689*4882a593Smuzhiyun
1690*4882a593Smuzhiyun  case 55:
1691*4882a593Smuzhiyun
1692*4882a593Smuzhiyun    {
1693*4882a593Smuzhiyun	if (zconf_endtoken((yyvsp[0].id), T_CHOICE, T_ENDCHOICE)) {
1694*4882a593Smuzhiyun		menu_end_menu();
1695*4882a593Smuzhiyun		printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
1696*4882a593Smuzhiyun	}
1697*4882a593Smuzhiyun}
1698*4882a593Smuzhiyun
1699*4882a593Smuzhiyun    break;
1700*4882a593Smuzhiyun
1701*4882a593Smuzhiyun  case 63:
1702*4882a593Smuzhiyun
1703*4882a593Smuzhiyun    {
1704*4882a593Smuzhiyun	menu_add_prompt(P_PROMPT, (yyvsp[-2].string), (yyvsp[-1].expr));
1705*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1706*4882a593Smuzhiyun}
1707*4882a593Smuzhiyun
1708*4882a593Smuzhiyun    break;
1709*4882a593Smuzhiyun
1710*4882a593Smuzhiyun  case 64:
1711*4882a593Smuzhiyun
1712*4882a593Smuzhiyun    {
1713*4882a593Smuzhiyun	if ((yyvsp[-2].id)->stype == S_BOOLEAN || (yyvsp[-2].id)->stype == S_TRISTATE) {
1714*4882a593Smuzhiyun		menu_set_type((yyvsp[-2].id)->stype);
1715*4882a593Smuzhiyun		printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1716*4882a593Smuzhiyun			zconf_curname(), zconf_lineno(),
1717*4882a593Smuzhiyun			(yyvsp[-2].id)->stype);
1718*4882a593Smuzhiyun	} else
1719*4882a593Smuzhiyun		YYERROR;
1720*4882a593Smuzhiyun}
1721*4882a593Smuzhiyun
1722*4882a593Smuzhiyun    break;
1723*4882a593Smuzhiyun
1724*4882a593Smuzhiyun  case 65:
1725*4882a593Smuzhiyun
1726*4882a593Smuzhiyun    {
1727*4882a593Smuzhiyun	current_entry->sym->flags |= SYMBOL_OPTIONAL;
1728*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1729*4882a593Smuzhiyun}
1730*4882a593Smuzhiyun
1731*4882a593Smuzhiyun    break;
1732*4882a593Smuzhiyun
1733*4882a593Smuzhiyun  case 66:
1734*4882a593Smuzhiyun
1735*4882a593Smuzhiyun    {
1736*4882a593Smuzhiyun	if ((yyvsp[-3].id)->stype == S_UNKNOWN) {
1737*4882a593Smuzhiyun		menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[-2].string), 0), (yyvsp[-1].expr));
1738*4882a593Smuzhiyun		printd(DEBUG_PARSE, "%s:%d:default\n",
1739*4882a593Smuzhiyun			zconf_curname(), zconf_lineno());
1740*4882a593Smuzhiyun	} else
1741*4882a593Smuzhiyun		YYERROR;
1742*4882a593Smuzhiyun}
1743*4882a593Smuzhiyun
1744*4882a593Smuzhiyun    break;
1745*4882a593Smuzhiyun
1746*4882a593Smuzhiyun  case 69:
1747*4882a593Smuzhiyun
1748*4882a593Smuzhiyun    {
1749*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
1750*4882a593Smuzhiyun	menu_add_entry(NULL);
1751*4882a593Smuzhiyun	menu_add_dep((yyvsp[-1].expr));
1752*4882a593Smuzhiyun	(yyval.menu) = menu_add_menu();
1753*4882a593Smuzhiyun}
1754*4882a593Smuzhiyun
1755*4882a593Smuzhiyun    break;
1756*4882a593Smuzhiyun
1757*4882a593Smuzhiyun  case 70:
1758*4882a593Smuzhiyun
1759*4882a593Smuzhiyun    {
1760*4882a593Smuzhiyun	if (zconf_endtoken((yyvsp[0].id), T_IF, T_ENDIF)) {
1761*4882a593Smuzhiyun		menu_end_menu();
1762*4882a593Smuzhiyun		printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
1763*4882a593Smuzhiyun	}
1764*4882a593Smuzhiyun}
1765*4882a593Smuzhiyun
1766*4882a593Smuzhiyun    break;
1767*4882a593Smuzhiyun
1768*4882a593Smuzhiyun  case 76:
1769*4882a593Smuzhiyun
1770*4882a593Smuzhiyun    {
1771*4882a593Smuzhiyun	menu_add_prompt(P_MENU, (yyvsp[-1].string), NULL);
1772*4882a593Smuzhiyun}
1773*4882a593Smuzhiyun
1774*4882a593Smuzhiyun    break;
1775*4882a593Smuzhiyun
1776*4882a593Smuzhiyun  case 77:
1777*4882a593Smuzhiyun
1778*4882a593Smuzhiyun    {
1779*4882a593Smuzhiyun	menu_add_entry(NULL);
1780*4882a593Smuzhiyun	menu_add_prompt(P_MENU, (yyvsp[-1].string), NULL);
1781*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1782*4882a593Smuzhiyun}
1783*4882a593Smuzhiyun
1784*4882a593Smuzhiyun    break;
1785*4882a593Smuzhiyun
1786*4882a593Smuzhiyun  case 78:
1787*4882a593Smuzhiyun
1788*4882a593Smuzhiyun    {
1789*4882a593Smuzhiyun	(yyval.menu) = menu_add_menu();
1790*4882a593Smuzhiyun}
1791*4882a593Smuzhiyun
1792*4882a593Smuzhiyun    break;
1793*4882a593Smuzhiyun
1794*4882a593Smuzhiyun  case 79:
1795*4882a593Smuzhiyun
1796*4882a593Smuzhiyun    {
1797*4882a593Smuzhiyun	if (zconf_endtoken((yyvsp[0].id), T_MENU, T_ENDMENU)) {
1798*4882a593Smuzhiyun		menu_end_menu();
1799*4882a593Smuzhiyun		printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
1800*4882a593Smuzhiyun	}
1801*4882a593Smuzhiyun}
1802*4882a593Smuzhiyun
1803*4882a593Smuzhiyun    break;
1804*4882a593Smuzhiyun
1805*4882a593Smuzhiyun  case 85:
1806*4882a593Smuzhiyun
1807*4882a593Smuzhiyun    {
1808*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[-1].string));
1809*4882a593Smuzhiyun	zconf_nextfile((yyvsp[-1].string));
1810*4882a593Smuzhiyun}
1811*4882a593Smuzhiyun
1812*4882a593Smuzhiyun    break;
1813*4882a593Smuzhiyun
1814*4882a593Smuzhiyun  case 86:
1815*4882a593Smuzhiyun
1816*4882a593Smuzhiyun    {
1817*4882a593Smuzhiyun	menu_add_entry(NULL);
1818*4882a593Smuzhiyun	menu_add_prompt(P_COMMENT, (yyvsp[-1].string), NULL);
1819*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1820*4882a593Smuzhiyun}
1821*4882a593Smuzhiyun
1822*4882a593Smuzhiyun    break;
1823*4882a593Smuzhiyun
1824*4882a593Smuzhiyun  case 87:
1825*4882a593Smuzhiyun
1826*4882a593Smuzhiyun    {
1827*4882a593Smuzhiyun	menu_end_entry();
1828*4882a593Smuzhiyun}
1829*4882a593Smuzhiyun
1830*4882a593Smuzhiyun    break;
1831*4882a593Smuzhiyun
1832*4882a593Smuzhiyun  case 88:
1833*4882a593Smuzhiyun
1834*4882a593Smuzhiyun    {
1835*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
1836*4882a593Smuzhiyun	zconf_starthelp();
1837*4882a593Smuzhiyun}
1838*4882a593Smuzhiyun
1839*4882a593Smuzhiyun    break;
1840*4882a593Smuzhiyun
1841*4882a593Smuzhiyun  case 89:
1842*4882a593Smuzhiyun
1843*4882a593Smuzhiyun    {
1844*4882a593Smuzhiyun	current_entry->help = (yyvsp[0].string);
1845*4882a593Smuzhiyun}
1846*4882a593Smuzhiyun
1847*4882a593Smuzhiyun    break;
1848*4882a593Smuzhiyun
1849*4882a593Smuzhiyun  case 94:
1850*4882a593Smuzhiyun
1851*4882a593Smuzhiyun    {
1852*4882a593Smuzhiyun	menu_add_dep((yyvsp[-1].expr));
1853*4882a593Smuzhiyun	printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
1854*4882a593Smuzhiyun}
1855*4882a593Smuzhiyun
1856*4882a593Smuzhiyun    break;
1857*4882a593Smuzhiyun
1858*4882a593Smuzhiyun  case 98:
1859*4882a593Smuzhiyun
1860*4882a593Smuzhiyun    {
1861*4882a593Smuzhiyun	menu_add_visibility((yyvsp[0].expr));
1862*4882a593Smuzhiyun}
1863*4882a593Smuzhiyun
1864*4882a593Smuzhiyun    break;
1865*4882a593Smuzhiyun
1866*4882a593Smuzhiyun  case 100:
1867*4882a593Smuzhiyun
1868*4882a593Smuzhiyun    {
1869*4882a593Smuzhiyun	menu_add_prompt(P_PROMPT, (yyvsp[-1].string), (yyvsp[0].expr));
1870*4882a593Smuzhiyun}
1871*4882a593Smuzhiyun
1872*4882a593Smuzhiyun    break;
1873*4882a593Smuzhiyun
1874*4882a593Smuzhiyun  case 103:
1875*4882a593Smuzhiyun
1876*4882a593Smuzhiyun    { (yyval.id) = (yyvsp[-1].id); }
1877*4882a593Smuzhiyun
1878*4882a593Smuzhiyun    break;
1879*4882a593Smuzhiyun
1880*4882a593Smuzhiyun  case 104:
1881*4882a593Smuzhiyun
1882*4882a593Smuzhiyun    { (yyval.id) = (yyvsp[-1].id); }
1883*4882a593Smuzhiyun
1884*4882a593Smuzhiyun    break;
1885*4882a593Smuzhiyun
1886*4882a593Smuzhiyun  case 105:
1887*4882a593Smuzhiyun
1888*4882a593Smuzhiyun    { (yyval.id) = (yyvsp[-1].id); }
1889*4882a593Smuzhiyun
1890*4882a593Smuzhiyun    break;
1891*4882a593Smuzhiyun
1892*4882a593Smuzhiyun  case 108:
1893*4882a593Smuzhiyun
1894*4882a593Smuzhiyun    { (yyval.expr) = NULL; }
1895*4882a593Smuzhiyun
1896*4882a593Smuzhiyun    break;
1897*4882a593Smuzhiyun
1898*4882a593Smuzhiyun  case 109:
1899*4882a593Smuzhiyun
1900*4882a593Smuzhiyun    { (yyval.expr) = (yyvsp[0].expr); }
1901*4882a593Smuzhiyun
1902*4882a593Smuzhiyun    break;
1903*4882a593Smuzhiyun
1904*4882a593Smuzhiyun  case 110:
1905*4882a593Smuzhiyun
1906*4882a593Smuzhiyun    { (yyval.expr) = expr_alloc_symbol((yyvsp[0].symbol)); }
1907*4882a593Smuzhiyun
1908*4882a593Smuzhiyun    break;
1909*4882a593Smuzhiyun
1910*4882a593Smuzhiyun  case 111:
1911*4882a593Smuzhiyun
1912*4882a593Smuzhiyun    { (yyval.expr) = expr_alloc_comp(E_LTH, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
1913*4882a593Smuzhiyun
1914*4882a593Smuzhiyun    break;
1915*4882a593Smuzhiyun
1916*4882a593Smuzhiyun  case 112:
1917*4882a593Smuzhiyun
1918*4882a593Smuzhiyun    { (yyval.expr) = expr_alloc_comp(E_LEQ, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
1919*4882a593Smuzhiyun
1920*4882a593Smuzhiyun    break;
1921*4882a593Smuzhiyun
1922*4882a593Smuzhiyun  case 113:
1923*4882a593Smuzhiyun
1924*4882a593Smuzhiyun    { (yyval.expr) = expr_alloc_comp(E_GTH, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
1925*4882a593Smuzhiyun
1926*4882a593Smuzhiyun    break;
1927*4882a593Smuzhiyun
1928*4882a593Smuzhiyun  case 114:
1929*4882a593Smuzhiyun
1930*4882a593Smuzhiyun    { (yyval.expr) = expr_alloc_comp(E_GEQ, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
1931*4882a593Smuzhiyun
1932*4882a593Smuzhiyun    break;
1933*4882a593Smuzhiyun
1934*4882a593Smuzhiyun  case 115:
1935*4882a593Smuzhiyun
1936*4882a593Smuzhiyun    { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
1937*4882a593Smuzhiyun
1938*4882a593Smuzhiyun    break;
1939*4882a593Smuzhiyun
1940*4882a593Smuzhiyun  case 116:
1941*4882a593Smuzhiyun
1942*4882a593Smuzhiyun    { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[-2].symbol), (yyvsp[0].symbol)); }
1943*4882a593Smuzhiyun
1944*4882a593Smuzhiyun    break;
1945*4882a593Smuzhiyun
1946*4882a593Smuzhiyun  case 117:
1947*4882a593Smuzhiyun
1948*4882a593Smuzhiyun    { (yyval.expr) = (yyvsp[-1].expr); }
1949*4882a593Smuzhiyun
1950*4882a593Smuzhiyun    break;
1951*4882a593Smuzhiyun
1952*4882a593Smuzhiyun  case 118:
1953*4882a593Smuzhiyun
1954*4882a593Smuzhiyun    { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[0].expr)); }
1955*4882a593Smuzhiyun
1956*4882a593Smuzhiyun    break;
1957*4882a593Smuzhiyun
1958*4882a593Smuzhiyun  case 119:
1959*4882a593Smuzhiyun
1960*4882a593Smuzhiyun    { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[-2].expr), (yyvsp[0].expr)); }
1961*4882a593Smuzhiyun
1962*4882a593Smuzhiyun    break;
1963*4882a593Smuzhiyun
1964*4882a593Smuzhiyun  case 120:
1965*4882a593Smuzhiyun
1966*4882a593Smuzhiyun    { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); }
1967*4882a593Smuzhiyun
1968*4882a593Smuzhiyun    break;
1969*4882a593Smuzhiyun
1970*4882a593Smuzhiyun  case 121:
1971*4882a593Smuzhiyun
1972*4882a593Smuzhiyun    { (yyval.symbol) = sym_lookup((yyvsp[0].string), 0); free((yyvsp[0].string)); }
1973*4882a593Smuzhiyun
1974*4882a593Smuzhiyun    break;
1975*4882a593Smuzhiyun
1976*4882a593Smuzhiyun  case 122:
1977*4882a593Smuzhiyun
1978*4882a593Smuzhiyun    { (yyval.symbol) = sym_lookup((yyvsp[0].string), SYMBOL_CONST); free((yyvsp[0].string)); }
1979*4882a593Smuzhiyun
1980*4882a593Smuzhiyun    break;
1981*4882a593Smuzhiyun
1982*4882a593Smuzhiyun  case 123:
1983*4882a593Smuzhiyun
1984*4882a593Smuzhiyun    { (yyval.string) = NULL; }
1985*4882a593Smuzhiyun
1986*4882a593Smuzhiyun    break;
1987*4882a593Smuzhiyun
1988*4882a593Smuzhiyun
1989*4882a593Smuzhiyun
1990*4882a593Smuzhiyun      default: break;
1991*4882a593Smuzhiyun    }
1992*4882a593Smuzhiyun  /* User semantic actions sometimes alter yychar, and that requires
1993*4882a593Smuzhiyun     that yytoken be updated with the new translation.  We take the
1994*4882a593Smuzhiyun     approach of translating immediately before every use of yytoken.
1995*4882a593Smuzhiyun     One alternative is translating here after every semantic action,
1996*4882a593Smuzhiyun     but that translation would be missed if the semantic action invokes
1997*4882a593Smuzhiyun     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1998*4882a593Smuzhiyun     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1999*4882a593Smuzhiyun     incorrect destructor might then be invoked immediately.  In the
2000*4882a593Smuzhiyun     case of YYERROR or YYBACKUP, subsequent parser actions might lead
2001*4882a593Smuzhiyun     to an incorrect destructor call or verbose syntax error message
2002*4882a593Smuzhiyun     before the lookahead is translated.  */
2003*4882a593Smuzhiyun  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2004*4882a593Smuzhiyun
2005*4882a593Smuzhiyun  YYPOPSTACK (yylen);
2006*4882a593Smuzhiyun  yylen = 0;
2007*4882a593Smuzhiyun  YY_STACK_PRINT (yyss, yyssp);
2008*4882a593Smuzhiyun
2009*4882a593Smuzhiyun  *++yyvsp = yyval;
2010*4882a593Smuzhiyun
2011*4882a593Smuzhiyun  /* Now 'shift' the result of the reduction.  Determine what state
2012*4882a593Smuzhiyun     that goes to, based on the state we popped back to and the rule
2013*4882a593Smuzhiyun     number reduced by.  */
2014*4882a593Smuzhiyun
2015*4882a593Smuzhiyun  yyn = yyr1[yyn];
2016*4882a593Smuzhiyun
2017*4882a593Smuzhiyun  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2018*4882a593Smuzhiyun  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2019*4882a593Smuzhiyun    yystate = yytable[yystate];
2020*4882a593Smuzhiyun  else
2021*4882a593Smuzhiyun    yystate = yydefgoto[yyn - YYNTOKENS];
2022*4882a593Smuzhiyun
2023*4882a593Smuzhiyun  goto yynewstate;
2024*4882a593Smuzhiyun
2025*4882a593Smuzhiyun
2026*4882a593Smuzhiyun/*--------------------------------------.
2027*4882a593Smuzhiyun| yyerrlab -- here on detecting error.  |
2028*4882a593Smuzhiyun`--------------------------------------*/
2029*4882a593Smuzhiyunyyerrlab:
2030*4882a593Smuzhiyun  /* Make sure we have latest lookahead translation.  See comments at
2031*4882a593Smuzhiyun     user semantic actions for why this is necessary.  */
2032*4882a593Smuzhiyun  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2033*4882a593Smuzhiyun
2034*4882a593Smuzhiyun  /* If not already recovering from an error, report this error.  */
2035*4882a593Smuzhiyun  if (!yyerrstatus)
2036*4882a593Smuzhiyun    {
2037*4882a593Smuzhiyun      ++yynerrs;
2038*4882a593Smuzhiyun#if ! YYERROR_VERBOSE
2039*4882a593Smuzhiyun      yyerror (YY_("syntax error"));
2040*4882a593Smuzhiyun#else
2041*4882a593Smuzhiyun# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2042*4882a593Smuzhiyun                                        yyssp, yytoken)
2043*4882a593Smuzhiyun      {
2044*4882a593Smuzhiyun        char const *yymsgp = YY_("syntax error");
2045*4882a593Smuzhiyun        int yysyntax_error_status;
2046*4882a593Smuzhiyun        yysyntax_error_status = YYSYNTAX_ERROR;
2047*4882a593Smuzhiyun        if (yysyntax_error_status == 0)
2048*4882a593Smuzhiyun          yymsgp = yymsg;
2049*4882a593Smuzhiyun        else if (yysyntax_error_status == 1)
2050*4882a593Smuzhiyun          {
2051*4882a593Smuzhiyun            if (yymsg != yymsgbuf)
2052*4882a593Smuzhiyun              YYSTACK_FREE (yymsg);
2053*4882a593Smuzhiyun            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2054*4882a593Smuzhiyun            if (!yymsg)
2055*4882a593Smuzhiyun              {
2056*4882a593Smuzhiyun                yymsg = yymsgbuf;
2057*4882a593Smuzhiyun                yymsg_alloc = sizeof yymsgbuf;
2058*4882a593Smuzhiyun                yysyntax_error_status = 2;
2059*4882a593Smuzhiyun              }
2060*4882a593Smuzhiyun            else
2061*4882a593Smuzhiyun              {
2062*4882a593Smuzhiyun                yysyntax_error_status = YYSYNTAX_ERROR;
2063*4882a593Smuzhiyun                yymsgp = yymsg;
2064*4882a593Smuzhiyun              }
2065*4882a593Smuzhiyun          }
2066*4882a593Smuzhiyun        yyerror (yymsgp);
2067*4882a593Smuzhiyun        if (yysyntax_error_status == 2)
2068*4882a593Smuzhiyun          goto yyexhaustedlab;
2069*4882a593Smuzhiyun      }
2070*4882a593Smuzhiyun# undef YYSYNTAX_ERROR
2071*4882a593Smuzhiyun#endif
2072*4882a593Smuzhiyun    }
2073*4882a593Smuzhiyun
2074*4882a593Smuzhiyun
2075*4882a593Smuzhiyun
2076*4882a593Smuzhiyun  if (yyerrstatus == 3)
2077*4882a593Smuzhiyun    {
2078*4882a593Smuzhiyun      /* If just tried and failed to reuse lookahead token after an
2079*4882a593Smuzhiyun         error, discard it.  */
2080*4882a593Smuzhiyun
2081*4882a593Smuzhiyun      if (yychar <= YYEOF)
2082*4882a593Smuzhiyun        {
2083*4882a593Smuzhiyun          /* Return failure if at end of input.  */
2084*4882a593Smuzhiyun          if (yychar == YYEOF)
2085*4882a593Smuzhiyun            YYABORT;
2086*4882a593Smuzhiyun        }
2087*4882a593Smuzhiyun      else
2088*4882a593Smuzhiyun        {
2089*4882a593Smuzhiyun          yydestruct ("Error: discarding",
2090*4882a593Smuzhiyun                      yytoken, &yylval);
2091*4882a593Smuzhiyun          yychar = YYEMPTY;
2092*4882a593Smuzhiyun        }
2093*4882a593Smuzhiyun    }
2094*4882a593Smuzhiyun
2095*4882a593Smuzhiyun  /* Else will try to reuse lookahead token after shifting the error
2096*4882a593Smuzhiyun     token.  */
2097*4882a593Smuzhiyun  goto yyerrlab1;
2098*4882a593Smuzhiyun
2099*4882a593Smuzhiyun
2100*4882a593Smuzhiyun/*---------------------------------------------------.
2101*4882a593Smuzhiyun| yyerrorlab -- error raised explicitly by YYERROR.  |
2102*4882a593Smuzhiyun`---------------------------------------------------*/
2103*4882a593Smuzhiyunyyerrorlab:
2104*4882a593Smuzhiyun
2105*4882a593Smuzhiyun  /* Pacify compilers like GCC when the user code never invokes
2106*4882a593Smuzhiyun     YYERROR and the label yyerrorlab therefore never appears in user
2107*4882a593Smuzhiyun     code.  */
2108*4882a593Smuzhiyun  if (/*CONSTCOND*/ 0)
2109*4882a593Smuzhiyun     goto yyerrorlab;
2110*4882a593Smuzhiyun
2111*4882a593Smuzhiyun  /* Do not reclaim the symbols of the rule whose action triggered
2112*4882a593Smuzhiyun     this YYERROR.  */
2113*4882a593Smuzhiyun  YYPOPSTACK (yylen);
2114*4882a593Smuzhiyun  yylen = 0;
2115*4882a593Smuzhiyun  YY_STACK_PRINT (yyss, yyssp);
2116*4882a593Smuzhiyun  yystate = *yyssp;
2117*4882a593Smuzhiyun  goto yyerrlab1;
2118*4882a593Smuzhiyun
2119*4882a593Smuzhiyun
2120*4882a593Smuzhiyun/*-------------------------------------------------------------.
2121*4882a593Smuzhiyun| yyerrlab1 -- common code for both syntax error and YYERROR.  |
2122*4882a593Smuzhiyun`-------------------------------------------------------------*/
2123*4882a593Smuzhiyunyyerrlab1:
2124*4882a593Smuzhiyun  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
2125*4882a593Smuzhiyun
2126*4882a593Smuzhiyun  for (;;)
2127*4882a593Smuzhiyun    {
2128*4882a593Smuzhiyun      yyn = yypact[yystate];
2129*4882a593Smuzhiyun      if (!yypact_value_is_default (yyn))
2130*4882a593Smuzhiyun        {
2131*4882a593Smuzhiyun          yyn += YYTERROR;
2132*4882a593Smuzhiyun          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2133*4882a593Smuzhiyun            {
2134*4882a593Smuzhiyun              yyn = yytable[yyn];
2135*4882a593Smuzhiyun              if (0 < yyn)
2136*4882a593Smuzhiyun                break;
2137*4882a593Smuzhiyun            }
2138*4882a593Smuzhiyun        }
2139*4882a593Smuzhiyun
2140*4882a593Smuzhiyun      /* Pop the current state because it cannot handle the error token.  */
2141*4882a593Smuzhiyun      if (yyssp == yyss)
2142*4882a593Smuzhiyun        YYABORT;
2143*4882a593Smuzhiyun
2144*4882a593Smuzhiyun
2145*4882a593Smuzhiyun      yydestruct ("Error: popping",
2146*4882a593Smuzhiyun                  yystos[yystate], yyvsp);
2147*4882a593Smuzhiyun      YYPOPSTACK (1);
2148*4882a593Smuzhiyun      yystate = *yyssp;
2149*4882a593Smuzhiyun      YY_STACK_PRINT (yyss, yyssp);
2150*4882a593Smuzhiyun    }
2151*4882a593Smuzhiyun
2152*4882a593Smuzhiyun  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2153*4882a593Smuzhiyun  *++yyvsp = yylval;
2154*4882a593Smuzhiyun  YY_IGNORE_MAYBE_UNINITIALIZED_END
2155*4882a593Smuzhiyun
2156*4882a593Smuzhiyun
2157*4882a593Smuzhiyun  /* Shift the error token.  */
2158*4882a593Smuzhiyun  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2159*4882a593Smuzhiyun
2160*4882a593Smuzhiyun  yystate = yyn;
2161*4882a593Smuzhiyun  goto yynewstate;
2162*4882a593Smuzhiyun
2163*4882a593Smuzhiyun
2164*4882a593Smuzhiyun/*-------------------------------------.
2165*4882a593Smuzhiyun| yyacceptlab -- YYACCEPT comes here.  |
2166*4882a593Smuzhiyun`-------------------------------------*/
2167*4882a593Smuzhiyunyyacceptlab:
2168*4882a593Smuzhiyun  yyresult = 0;
2169*4882a593Smuzhiyun  goto yyreturn;
2170*4882a593Smuzhiyun
2171*4882a593Smuzhiyun/*-----------------------------------.
2172*4882a593Smuzhiyun| yyabortlab -- YYABORT comes here.  |
2173*4882a593Smuzhiyun`-----------------------------------*/
2174*4882a593Smuzhiyunyyabortlab:
2175*4882a593Smuzhiyun  yyresult = 1;
2176*4882a593Smuzhiyun  goto yyreturn;
2177*4882a593Smuzhiyun
2178*4882a593Smuzhiyun#if !defined yyoverflow || YYERROR_VERBOSE
2179*4882a593Smuzhiyun/*-------------------------------------------------.
2180*4882a593Smuzhiyun| yyexhaustedlab -- memory exhaustion comes here.  |
2181*4882a593Smuzhiyun`-------------------------------------------------*/
2182*4882a593Smuzhiyunyyexhaustedlab:
2183*4882a593Smuzhiyun  yyerror (YY_("memory exhausted"));
2184*4882a593Smuzhiyun  yyresult = 2;
2185*4882a593Smuzhiyun  /* Fall through.  */
2186*4882a593Smuzhiyun#endif
2187*4882a593Smuzhiyun
2188*4882a593Smuzhiyunyyreturn:
2189*4882a593Smuzhiyun  if (yychar != YYEMPTY)
2190*4882a593Smuzhiyun    {
2191*4882a593Smuzhiyun      /* Make sure we have latest lookahead translation.  See comments at
2192*4882a593Smuzhiyun         user semantic actions for why this is necessary.  */
2193*4882a593Smuzhiyun      yytoken = YYTRANSLATE (yychar);
2194*4882a593Smuzhiyun      yydestruct ("Cleanup: discarding lookahead",
2195*4882a593Smuzhiyun                  yytoken, &yylval);
2196*4882a593Smuzhiyun    }
2197*4882a593Smuzhiyun  /* Do not reclaim the symbols of the rule whose action triggered
2198*4882a593Smuzhiyun     this YYABORT or YYACCEPT.  */
2199*4882a593Smuzhiyun  YYPOPSTACK (yylen);
2200*4882a593Smuzhiyun  YY_STACK_PRINT (yyss, yyssp);
2201*4882a593Smuzhiyun  while (yyssp != yyss)
2202*4882a593Smuzhiyun    {
2203*4882a593Smuzhiyun      yydestruct ("Cleanup: popping",
2204*4882a593Smuzhiyun                  yystos[*yyssp], yyvsp);
2205*4882a593Smuzhiyun      YYPOPSTACK (1);
2206*4882a593Smuzhiyun    }
2207*4882a593Smuzhiyun#ifndef yyoverflow
2208*4882a593Smuzhiyun  if (yyss != yyssa)
2209*4882a593Smuzhiyun    YYSTACK_FREE (yyss);
2210*4882a593Smuzhiyun#endif
2211*4882a593Smuzhiyun#if YYERROR_VERBOSE
2212*4882a593Smuzhiyun  if (yymsg != yymsgbuf)
2213*4882a593Smuzhiyun    YYSTACK_FREE (yymsg);
2214*4882a593Smuzhiyun#endif
2215*4882a593Smuzhiyun  return yyresult;
2216*4882a593Smuzhiyun}
2217*4882a593Smuzhiyun
2218*4882a593Smuzhiyun
2219*4882a593Smuzhiyun
2220*4882a593Smuzhiyunvoid conf_parse(const char *name)
2221*4882a593Smuzhiyun{
2222*4882a593Smuzhiyun	struct symbol *sym;
2223*4882a593Smuzhiyun	int i;
2224*4882a593Smuzhiyun
2225*4882a593Smuzhiyun	zconf_initscan(name);
2226*4882a593Smuzhiyun
2227*4882a593Smuzhiyun	sym_init();
2228*4882a593Smuzhiyun	_menu_init();
2229*4882a593Smuzhiyun	rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL);
2230*4882a593Smuzhiyun
2231*4882a593Smuzhiyun	if (getenv("ZCONF_DEBUG"))
2232*4882a593Smuzhiyun		zconfdebug = 1;
2233*4882a593Smuzhiyun	zconfparse();
2234*4882a593Smuzhiyun	if (zconfnerrs)
2235*4882a593Smuzhiyun		exit(1);
2236*4882a593Smuzhiyun	if (!modules_sym)
2237*4882a593Smuzhiyun		modules_sym = sym_find( "n" );
2238*4882a593Smuzhiyun
2239*4882a593Smuzhiyun	rootmenu.prompt->text = _(rootmenu.prompt->text);
2240*4882a593Smuzhiyun	rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
2241*4882a593Smuzhiyun
2242*4882a593Smuzhiyun	menu_finalize(&rootmenu);
2243*4882a593Smuzhiyun	for_all_symbols(i, sym) {
2244*4882a593Smuzhiyun		if (sym_check_deps(sym))
2245*4882a593Smuzhiyun			zconfnerrs++;
2246*4882a593Smuzhiyun	}
2247*4882a593Smuzhiyun	if (zconfnerrs)
2248*4882a593Smuzhiyun		exit(1);
2249*4882a593Smuzhiyun	sym_set_change_count(1);
2250*4882a593Smuzhiyun}
2251*4882a593Smuzhiyun
2252*4882a593Smuzhiyunstatic const char *zconf_tokenname(int token)
2253*4882a593Smuzhiyun{
2254*4882a593Smuzhiyun	switch (token) {
2255*4882a593Smuzhiyun	case T_MENU:		return "menu";
2256*4882a593Smuzhiyun	case T_ENDMENU:		return "endmenu";
2257*4882a593Smuzhiyun	case T_CHOICE:		return "choice";
2258*4882a593Smuzhiyun	case T_ENDCHOICE:	return "endchoice";
2259*4882a593Smuzhiyun	case T_IF:		return "if";
2260*4882a593Smuzhiyun	case T_ENDIF:		return "endif";
2261*4882a593Smuzhiyun	case T_DEPENDS:		return "depends";
2262*4882a593Smuzhiyun	case T_VISIBLE:		return "visible";
2263*4882a593Smuzhiyun	}
2264*4882a593Smuzhiyun	return "<token>";
2265*4882a593Smuzhiyun}
2266*4882a593Smuzhiyun
2267*4882a593Smuzhiyunstatic bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken)
2268*4882a593Smuzhiyun{
2269*4882a593Smuzhiyun	if (id->token != endtoken) {
2270*4882a593Smuzhiyun		zconf_error("unexpected '%s' within %s block",
2271*4882a593Smuzhiyun			kconf_id_strings + id->name, zconf_tokenname(starttoken));
2272*4882a593Smuzhiyun		zconfnerrs++;
2273*4882a593Smuzhiyun		return false;
2274*4882a593Smuzhiyun	}
2275*4882a593Smuzhiyun	if (current_menu->file != current_file) {
2276*4882a593Smuzhiyun		zconf_error("'%s' in different file than '%s'",
2277*4882a593Smuzhiyun			kconf_id_strings + id->name, zconf_tokenname(starttoken));
2278*4882a593Smuzhiyun		fprintf(stderr, "%s:%d: location of the '%s'\n",
2279*4882a593Smuzhiyun			current_menu->file->name, current_menu->lineno,
2280*4882a593Smuzhiyun			zconf_tokenname(starttoken));
2281*4882a593Smuzhiyun		zconfnerrs++;
2282*4882a593Smuzhiyun		return false;
2283*4882a593Smuzhiyun	}
2284*4882a593Smuzhiyun	return true;
2285*4882a593Smuzhiyun}
2286*4882a593Smuzhiyun
2287*4882a593Smuzhiyunstatic void zconfprint(const char *err, ...)
2288*4882a593Smuzhiyun{
2289*4882a593Smuzhiyun	va_list ap;
2290*4882a593Smuzhiyun
2291*4882a593Smuzhiyun	fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
2292*4882a593Smuzhiyun	va_start(ap, err);
2293*4882a593Smuzhiyun	vfprintf(stderr, err, ap);
2294*4882a593Smuzhiyun	va_end(ap);
2295*4882a593Smuzhiyun	fprintf(stderr, "\n");
2296*4882a593Smuzhiyun}
2297*4882a593Smuzhiyun
2298*4882a593Smuzhiyunstatic void zconf_error(const char *err, ...)
2299*4882a593Smuzhiyun{
2300*4882a593Smuzhiyun	va_list ap;
2301*4882a593Smuzhiyun
2302*4882a593Smuzhiyun	zconfnerrs++;
2303*4882a593Smuzhiyun	fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
2304*4882a593Smuzhiyun	va_start(ap, err);
2305*4882a593Smuzhiyun	vfprintf(stderr, err, ap);
2306*4882a593Smuzhiyun	va_end(ap);
2307*4882a593Smuzhiyun	fprintf(stderr, "\n");
2308*4882a593Smuzhiyun}
2309*4882a593Smuzhiyun
2310*4882a593Smuzhiyunstatic void zconferror(const char *err)
2311*4882a593Smuzhiyun{
2312*4882a593Smuzhiyun	fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
2313*4882a593Smuzhiyun}
2314*4882a593Smuzhiyun
2315*4882a593Smuzhiyunstatic void print_quoted_string(FILE *out, const char *str)
2316*4882a593Smuzhiyun{
2317*4882a593Smuzhiyun	const char *p;
2318*4882a593Smuzhiyun	int len;
2319*4882a593Smuzhiyun
2320*4882a593Smuzhiyun	putc('"', out);
2321*4882a593Smuzhiyun	while ((p = strchr(str, '"'))) {
2322*4882a593Smuzhiyun		len = p - str;
2323*4882a593Smuzhiyun		if (len)
2324*4882a593Smuzhiyun			fprintf(out, "%.*s", len, str);
2325*4882a593Smuzhiyun		fputs("\\\"", out);
2326*4882a593Smuzhiyun		str = p + 1;
2327*4882a593Smuzhiyun	}
2328*4882a593Smuzhiyun	fputs(str, out);
2329*4882a593Smuzhiyun	putc('"', out);
2330*4882a593Smuzhiyun}
2331*4882a593Smuzhiyun
2332*4882a593Smuzhiyunstatic void print_symbol(FILE *out, struct menu *menu)
2333*4882a593Smuzhiyun{
2334*4882a593Smuzhiyun	struct symbol *sym = menu->sym;
2335*4882a593Smuzhiyun	struct property *prop;
2336*4882a593Smuzhiyun
2337*4882a593Smuzhiyun	if (sym_is_choice(sym))
2338*4882a593Smuzhiyun		fprintf(out, "\nchoice\n");
2339*4882a593Smuzhiyun	else
2340*4882a593Smuzhiyun		fprintf(out, "\nconfig %s\n", sym->name);
2341*4882a593Smuzhiyun	switch (sym->type) {
2342*4882a593Smuzhiyun	case S_BOOLEAN:
2343*4882a593Smuzhiyun		fputs("  boolean\n", out);
2344*4882a593Smuzhiyun		break;
2345*4882a593Smuzhiyun	case S_TRISTATE:
2346*4882a593Smuzhiyun		fputs("  tristate\n", out);
2347*4882a593Smuzhiyun		break;
2348*4882a593Smuzhiyun	case S_STRING:
2349*4882a593Smuzhiyun		fputs("  string\n", out);
2350*4882a593Smuzhiyun		break;
2351*4882a593Smuzhiyun	case S_INT:
2352*4882a593Smuzhiyun		fputs("  integer\n", out);
2353*4882a593Smuzhiyun		break;
2354*4882a593Smuzhiyun	case S_HEX:
2355*4882a593Smuzhiyun		fputs("  hex\n", out);
2356*4882a593Smuzhiyun		break;
2357*4882a593Smuzhiyun	default:
2358*4882a593Smuzhiyun		fputs("  ???\n", out);
2359*4882a593Smuzhiyun		break;
2360*4882a593Smuzhiyun	}
2361*4882a593Smuzhiyun	for (prop = sym->prop; prop; prop = prop->next) {
2362*4882a593Smuzhiyun		if (prop->menu != menu)
2363*4882a593Smuzhiyun			continue;
2364*4882a593Smuzhiyun		switch (prop->type) {
2365*4882a593Smuzhiyun		case P_PROMPT:
2366*4882a593Smuzhiyun			fputs("  prompt ", out);
2367*4882a593Smuzhiyun			print_quoted_string(out, prop->text);
2368*4882a593Smuzhiyun			if (!expr_is_yes(prop->visible.expr)) {
2369*4882a593Smuzhiyun				fputs(" if ", out);
2370*4882a593Smuzhiyun				expr_fprint(prop->visible.expr, out);
2371*4882a593Smuzhiyun			}
2372*4882a593Smuzhiyun			fputc('\n', out);
2373*4882a593Smuzhiyun			break;
2374*4882a593Smuzhiyun		case P_DEFAULT:
2375*4882a593Smuzhiyun			fputs( "  default ", out);
2376*4882a593Smuzhiyun			expr_fprint(prop->expr, out);
2377*4882a593Smuzhiyun			if (!expr_is_yes(prop->visible.expr)) {
2378*4882a593Smuzhiyun				fputs(" if ", out);
2379*4882a593Smuzhiyun				expr_fprint(prop->visible.expr, out);
2380*4882a593Smuzhiyun			}
2381*4882a593Smuzhiyun			fputc('\n', out);
2382*4882a593Smuzhiyun			break;
2383*4882a593Smuzhiyun		case P_CHOICE:
2384*4882a593Smuzhiyun			fputs("  #choice value\n", out);
2385*4882a593Smuzhiyun			break;
2386*4882a593Smuzhiyun		case P_SELECT:
2387*4882a593Smuzhiyun			fputs( "  select ", out);
2388*4882a593Smuzhiyun			expr_fprint(prop->expr, out);
2389*4882a593Smuzhiyun			fputc('\n', out);
2390*4882a593Smuzhiyun			break;
2391*4882a593Smuzhiyun		case P_IMPLY:
2392*4882a593Smuzhiyun			fputs( "  imply ", out);
2393*4882a593Smuzhiyun			expr_fprint(prop->expr, out);
2394*4882a593Smuzhiyun			fputc('\n', out);
2395*4882a593Smuzhiyun			break;
2396*4882a593Smuzhiyun		case P_RANGE:
2397*4882a593Smuzhiyun			fputs( "  range ", out);
2398*4882a593Smuzhiyun			expr_fprint(prop->expr, out);
2399*4882a593Smuzhiyun			fputc('\n', out);
2400*4882a593Smuzhiyun			break;
2401*4882a593Smuzhiyun		case P_MENU:
2402*4882a593Smuzhiyun			fputs( "  menu ", out);
2403*4882a593Smuzhiyun			print_quoted_string(out, prop->text);
2404*4882a593Smuzhiyun			fputc('\n', out);
2405*4882a593Smuzhiyun			break;
2406*4882a593Smuzhiyun		default:
2407*4882a593Smuzhiyun			fprintf(out, "  unknown prop %d!\n", prop->type);
2408*4882a593Smuzhiyun			break;
2409*4882a593Smuzhiyun		}
2410*4882a593Smuzhiyun	}
2411*4882a593Smuzhiyun	if (menu->help) {
2412*4882a593Smuzhiyun		int len = strlen(menu->help);
2413*4882a593Smuzhiyun		while (menu->help[--len] == '\n')
2414*4882a593Smuzhiyun			menu->help[len] = 0;
2415*4882a593Smuzhiyun		fprintf(out, "  help\n%s\n", menu->help);
2416*4882a593Smuzhiyun	}
2417*4882a593Smuzhiyun}
2418*4882a593Smuzhiyun
2419*4882a593Smuzhiyunvoid zconfdump(FILE *out)
2420*4882a593Smuzhiyun{
2421*4882a593Smuzhiyun	struct property *prop;
2422*4882a593Smuzhiyun	struct symbol *sym;
2423*4882a593Smuzhiyun	struct menu *menu;
2424*4882a593Smuzhiyun
2425*4882a593Smuzhiyun	menu = rootmenu.list;
2426*4882a593Smuzhiyun	while (menu) {
2427*4882a593Smuzhiyun		if ((sym = menu->sym))
2428*4882a593Smuzhiyun			print_symbol(out, menu);
2429*4882a593Smuzhiyun		else if ((prop = menu->prompt)) {
2430*4882a593Smuzhiyun			switch (prop->type) {
2431*4882a593Smuzhiyun			case P_COMMENT:
2432*4882a593Smuzhiyun				fputs("\ncomment ", out);
2433*4882a593Smuzhiyun				print_quoted_string(out, prop->text);
2434*4882a593Smuzhiyun				fputs("\n", out);
2435*4882a593Smuzhiyun				break;
2436*4882a593Smuzhiyun			case P_MENU:
2437*4882a593Smuzhiyun				fputs("\nmenu ", out);
2438*4882a593Smuzhiyun				print_quoted_string(out, prop->text);
2439*4882a593Smuzhiyun				fputs("\n", out);
2440*4882a593Smuzhiyun				break;
2441*4882a593Smuzhiyun			default:
2442*4882a593Smuzhiyun				;
2443*4882a593Smuzhiyun			}
2444*4882a593Smuzhiyun			if (!expr_is_yes(prop->visible.expr)) {
2445*4882a593Smuzhiyun				fputs("  depends ", out);
2446*4882a593Smuzhiyun				expr_fprint(prop->visible.expr, out);
2447*4882a593Smuzhiyun				fputc('\n', out);
2448*4882a593Smuzhiyun			}
2449*4882a593Smuzhiyun		}
2450*4882a593Smuzhiyun
2451*4882a593Smuzhiyun		if (menu->list)
2452*4882a593Smuzhiyun			menu = menu->list;
2453*4882a593Smuzhiyun		else if (menu->next)
2454*4882a593Smuzhiyun			menu = menu->next;
2455*4882a593Smuzhiyun		else while ((menu = menu->parent)) {
2456*4882a593Smuzhiyun			if (menu->prompt && menu->prompt->type == P_MENU)
2457*4882a593Smuzhiyun				fputs("\nendmenu\n", out);
2458*4882a593Smuzhiyun			if (menu->next) {
2459*4882a593Smuzhiyun				menu = menu->next;
2460*4882a593Smuzhiyun				break;
2461*4882a593Smuzhiyun			}
2462*4882a593Smuzhiyun		}
2463*4882a593Smuzhiyun	}
2464*4882a593Smuzhiyun}
2465*4882a593Smuzhiyun
2466*4882a593Smuzhiyun#include "zconf.lex.c"
2467*4882a593Smuzhiyun#include "util.c"
2468*4882a593Smuzhiyun#include "confdata.c"
2469*4882a593Smuzhiyun#include "expr.c"
2470*4882a593Smuzhiyun#include "symbol.c"
2471*4882a593Smuzhiyun#include "menu.c"
2472