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