1.1 --- a/kconfig/zconf.tab.c Sat Jan 14 18:22:06 2012 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,2505 +0,0 @@
1.4 -
1.5 -/* A Bison parser, made by GNU Bison 2.4.1. */
1.6 -
1.7 -/* Skeleton implementation for Bison's Yacc-like parsers in C
1.8 -
1.9 - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
1.10 - Free Software Foundation, Inc.
1.11 -
1.12 - This program is free software: you can redistribute it and/or modify
1.13 - it under the terms of the GNU General Public License as published by
1.14 - the Free Software Foundation, either version 3 of the License, or
1.15 - (at your option) any later version.
1.16 -
1.17 - This program is distributed in the hope that it will be useful,
1.18 - but WITHOUT ANY WARRANTY; without even the implied warranty of
1.19 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.20 - GNU General Public License for more details.
1.21 -
1.22 - You should have received a copy of the GNU General Public License
1.23 - along with this program. If not, see <http://www.gnu.org/licenses/>. */
1.24 -
1.25 -/* As a special exception, you may create a larger work that contains
1.26 - part or all of the Bison parser skeleton and distribute that work
1.27 - under terms of your choice, so long as that work isn't itself a
1.28 - parser generator using the skeleton or a modified version thereof
1.29 - as a parser skeleton. Alternatively, if you modify or redistribute
1.30 - the parser skeleton itself, you may (at your option) remove this
1.31 - special exception, which will cause the skeleton and the resulting
1.32 - Bison output files to be licensed under the GNU General Public
1.33 - License without this special exception.
1.34 -
1.35 - This special exception was added by the Free Software Foundation in
1.36 - version 2.2 of Bison. */
1.37 -
1.38 -/* C LALR(1) parser skeleton written by Richard Stallman, by
1.39 - simplifying the original so-called "semantic" parser. */
1.40 -
1.41 -/* All symbols defined below should begin with yy or YY, to avoid
1.42 - infringing on user name space. This should be done even for local
1.43 - variables, as they might otherwise be expanded by user macros.
1.44 - There are some unavoidable exceptions within include files to
1.45 - define necessary library symbols; they are noted "INFRINGES ON
1.46 - USER NAME SPACE" below. */
1.47 -
1.48 -/* Identify Bison output. */
1.49 -#define YYBISON 1
1.50 -
1.51 -/* Bison version. */
1.52 -#define YYBISON_VERSION "2.4.1"
1.53 -
1.54 -/* Skeleton name. */
1.55 -#define YYSKELETON_NAME "yacc.c"
1.56 -
1.57 -/* Pure parsers. */
1.58 -#define YYPURE 0
1.59 -
1.60 -/* Push parsers. */
1.61 -#define YYPUSH 0
1.62 -
1.63 -/* Pull parsers. */
1.64 -#define YYPULL 1
1.65 -
1.66 -/* Using locations. */
1.67 -#define YYLSP_NEEDED 0
1.68 -
1.69 -/* Substitute the variable and function names. */
1.70 -#define yyparse zconfparse
1.71 -#define yylex zconflex
1.72 -#define yyerror zconferror
1.73 -#define yylval zconflval
1.74 -#define yychar zconfchar
1.75 -#define yydebug zconfdebug
1.76 -#define yynerrs zconfnerrs
1.77 -
1.78 -
1.79 -/* Copy the first part of user declarations. */
1.80 -
1.81 -
1.82 -/*
1.83 - * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
1.84 - * Released under the terms of the GNU GPL v2.0.
1.85 - */
1.86 -
1.87 -#include <ctype.h>
1.88 -#include <stdarg.h>
1.89 -#include <stdio.h>
1.90 -#include <stdlib.h>
1.91 -#include <string.h>
1.92 -#include <stdbool.h>
1.93 -
1.94 -#define LKC_DIRECT_LINK
1.95 -#include "lkc.h"
1.96 -
1.97 -#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
1.98 -
1.99 -#define PRINTD 0x0001
1.100 -#define DEBUG_PARSE 0x0002
1.101 -
1.102 -int cdebug = PRINTD;
1.103 -
1.104 -extern int zconflex(void);
1.105 -static void zconfprint(const char *err, ...);
1.106 -static void zconf_error(const char *err, ...);
1.107 -static void zconferror(const char *err);
1.108 -static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken);
1.109 -
1.110 -struct symbol *symbol_hash[SYMBOL_HASHSIZE];
1.111 -
1.112 -static struct menu *current_menu, *current_entry;
1.113 -
1.114 -#define YYDEBUG 0
1.115 -#if YYDEBUG
1.116 -#define YYERROR_VERBOSE
1.117 -#endif
1.118 -
1.119 -
1.120 -
1.121 -/* Enabling traces. */
1.122 -#ifndef YYDEBUG
1.123 -# define YYDEBUG 0
1.124 -#endif
1.125 -
1.126 -/* Enabling verbose error messages. */
1.127 -#ifdef YYERROR_VERBOSE
1.128 -# undef YYERROR_VERBOSE
1.129 -# define YYERROR_VERBOSE 1
1.130 -#else
1.131 -# define YYERROR_VERBOSE 0
1.132 -#endif
1.133 -
1.134 -/* Enabling the token table. */
1.135 -#ifndef YYTOKEN_TABLE
1.136 -# define YYTOKEN_TABLE 0
1.137 -#endif
1.138 -
1.139 -
1.140 -/* Tokens. */
1.141 -#ifndef YYTOKENTYPE
1.142 -# define YYTOKENTYPE
1.143 - /* Put the tokens into the symbol table, so that GDB and other debuggers
1.144 - know about them. */
1.145 - enum yytokentype {
1.146 - T_MAINMENU = 258,
1.147 - T_MENU = 259,
1.148 - T_ENDMENU = 260,
1.149 - T_SOURCE = 261,
1.150 - T_CHOICE = 262,
1.151 - T_ENDCHOICE = 263,
1.152 - T_COMMENT = 264,
1.153 - T_CONFIG = 265,
1.154 - T_MENUCONFIG = 266,
1.155 - T_HELP = 267,
1.156 - T_HELPTEXT = 268,
1.157 - T_IF = 269,
1.158 - T_ENDIF = 270,
1.159 - T_DEPENDS = 271,
1.160 - T_OPTIONAL = 272,
1.161 - T_PROMPT = 273,
1.162 - T_TYPE = 274,
1.163 - T_DEFAULT = 275,
1.164 - T_SELECT = 276,
1.165 - T_RANGE = 277,
1.166 - T_VISIBLE = 278,
1.167 - T_OPTION = 279,
1.168 - T_ON = 280,
1.169 - T_WORD = 281,
1.170 - T_WORD_QUOTE = 282,
1.171 - T_UNEQUAL = 283,
1.172 - T_CLOSE_PAREN = 284,
1.173 - T_OPEN_PAREN = 285,
1.174 - T_EOL = 286,
1.175 - T_OR = 287,
1.176 - T_AND = 288,
1.177 - T_EQUAL = 289,
1.178 - T_NOT = 290
1.179 - };
1.180 -#endif
1.181 -
1.182 -
1.183 -
1.184 -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1.185 -typedef union YYSTYPE
1.186 -{
1.187 -
1.188 -
1.189 - char *string;
1.190 - struct file *file;
1.191 - struct symbol *symbol;
1.192 - struct expr *expr;
1.193 - struct menu *menu;
1.194 - struct kconf_id *id;
1.195 -
1.196 -
1.197 -
1.198 -} YYSTYPE;
1.199 -# define YYSTYPE_IS_TRIVIAL 1
1.200 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */
1.201 -# define YYSTYPE_IS_DECLARED 1
1.202 -#endif
1.203 -
1.204 -
1.205 -/* Copy the second part of user declarations. */
1.206 -
1.207 -
1.208 -/* Include zconf.hash.c here so it can see the token constants. */
1.209 -#include "zconf.hash.c"
1.210 -
1.211 -
1.212 -
1.213 -#ifdef short
1.214 -# undef short
1.215 -#endif
1.216 -
1.217 -#ifdef YYTYPE_UINT8
1.218 -typedef YYTYPE_UINT8 yytype_uint8;
1.219 -#else
1.220 -typedef unsigned char yytype_uint8;
1.221 -#endif
1.222 -
1.223 -#ifdef YYTYPE_INT8
1.224 -typedef YYTYPE_INT8 yytype_int8;
1.225 -#elif (defined __STDC__ || defined __C99__FUNC__ \
1.226 - || defined __cplusplus || defined _MSC_VER)
1.227 -typedef signed char yytype_int8;
1.228 -#else
1.229 -typedef short int yytype_int8;
1.230 -#endif
1.231 -
1.232 -#ifdef YYTYPE_UINT16
1.233 -typedef YYTYPE_UINT16 yytype_uint16;
1.234 -#else
1.235 -typedef unsigned short int yytype_uint16;
1.236 -#endif
1.237 -
1.238 -#ifdef YYTYPE_INT16
1.239 -typedef YYTYPE_INT16 yytype_int16;
1.240 -#else
1.241 -typedef short int yytype_int16;
1.242 -#endif
1.243 -
1.244 -#ifndef YYSIZE_T
1.245 -# ifdef __SIZE_TYPE__
1.246 -# define YYSIZE_T __SIZE_TYPE__
1.247 -# elif defined size_t
1.248 -# define YYSIZE_T size_t
1.249 -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1.250 - || defined __cplusplus || defined _MSC_VER)
1.251 -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1.252 -# define YYSIZE_T size_t
1.253 -# else
1.254 -# define YYSIZE_T unsigned int
1.255 -# endif
1.256 -#endif
1.257 -
1.258 -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1.259 -
1.260 -#ifndef YY_
1.261 -# if YYENABLE_NLS
1.262 -# if ENABLE_NLS
1.263 -# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1.264 -# define YY_(msgid) dgettext ("bison-runtime", msgid)
1.265 -# endif
1.266 -# endif
1.267 -# ifndef YY_
1.268 -# define YY_(msgid) msgid
1.269 -# endif
1.270 -#endif
1.271 -
1.272 -/* Suppress unused-variable warnings by "using" E. */
1.273 -#if ! defined lint || defined __GNUC__
1.274 -# define YYUSE(e) ((void) (e))
1.275 -#else
1.276 -# define YYUSE(e) /* empty */
1.277 -#endif
1.278 -
1.279 -/* Identity function, used to suppress warnings about constant conditions. */
1.280 -#ifndef lint
1.281 -# define YYID(n) (n)
1.282 -#else
1.283 -#if (defined __STDC__ || defined __C99__FUNC__ \
1.284 - || defined __cplusplus || defined _MSC_VER)
1.285 -static int
1.286 -YYID (int yyi)
1.287 -#else
1.288 -static int
1.289 -YYID (yyi)
1.290 - int yyi;
1.291 -#endif
1.292 -{
1.293 - return yyi;
1.294 -}
1.295 -#endif
1.296 -
1.297 -#if ! defined yyoverflow || YYERROR_VERBOSE
1.298 -
1.299 -/* The parser invokes alloca or malloc; define the necessary symbols. */
1.300 -
1.301 -# ifdef YYSTACK_USE_ALLOCA
1.302 -# if YYSTACK_USE_ALLOCA
1.303 -# ifdef __GNUC__
1.304 -# define YYSTACK_ALLOC __builtin_alloca
1.305 -# elif defined __BUILTIN_VA_ARG_INCR
1.306 -# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1.307 -# elif defined _AIX
1.308 -# define YYSTACK_ALLOC __alloca
1.309 -# elif defined _MSC_VER
1.310 -# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1.311 -# define alloca _alloca
1.312 -# else
1.313 -# define YYSTACK_ALLOC alloca
1.314 -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1.315 - || defined __cplusplus || defined _MSC_VER)
1.316 -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1.317 -# ifndef _STDLIB_H
1.318 -# define _STDLIB_H 1
1.319 -# endif
1.320 -# endif
1.321 -# endif
1.322 -# endif
1.323 -# endif
1.324 -
1.325 -# ifdef YYSTACK_ALLOC
1.326 - /* Pacify GCC's `empty if-body' warning. */
1.327 -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1.328 -# ifndef YYSTACK_ALLOC_MAXIMUM
1.329 - /* The OS might guarantee only one guard page at the bottom of the stack,
1.330 - and a page size can be as small as 4096 bytes. So we cannot safely
1.331 - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1.332 - to allow for a few compiler-allocated temporary stack slots. */
1.333 -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1.334 -# endif
1.335 -# else
1.336 -# define YYSTACK_ALLOC YYMALLOC
1.337 -# define YYSTACK_FREE YYFREE
1.338 -# ifndef YYSTACK_ALLOC_MAXIMUM
1.339 -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1.340 -# endif
1.341 -# if (defined __cplusplus && ! defined _STDLIB_H \
1.342 - && ! ((defined YYMALLOC || defined malloc) \
1.343 - && (defined YYFREE || defined free)))
1.344 -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1.345 -# ifndef _STDLIB_H
1.346 -# define _STDLIB_H 1
1.347 -# endif
1.348 -# endif
1.349 -# ifndef YYMALLOC
1.350 -# define YYMALLOC malloc
1.351 -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1.352 - || defined __cplusplus || defined _MSC_VER)
1.353 -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1.354 -# endif
1.355 -# endif
1.356 -# ifndef YYFREE
1.357 -# define YYFREE free
1.358 -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1.359 - || defined __cplusplus || defined _MSC_VER)
1.360 -void free (void *); /* INFRINGES ON USER NAME SPACE */
1.361 -# endif
1.362 -# endif
1.363 -# endif
1.364 -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1.365 -
1.366 -
1.367 -#if (! defined yyoverflow \
1.368 - && (! defined __cplusplus \
1.369 - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1.370 -
1.371 -/* A type that is properly aligned for any stack member. */
1.372 -union yyalloc
1.373 -{
1.374 - yytype_int16 yyss_alloc;
1.375 - YYSTYPE yyvs_alloc;
1.376 -};
1.377 -
1.378 -/* The size of the maximum gap between one aligned stack and the next. */
1.379 -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1.380 -
1.381 -/* The size of an array large to enough to hold all stacks, each with
1.382 - N elements. */
1.383 -# define YYSTACK_BYTES(N) \
1.384 - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1.385 - + YYSTACK_GAP_MAXIMUM)
1.386 -
1.387 -/* Copy COUNT objects from FROM to TO. The source and destination do
1.388 - not overlap. */
1.389 -# ifndef YYCOPY
1.390 -# if defined __GNUC__ && 1 < __GNUC__
1.391 -# define YYCOPY(To, From, Count) \
1.392 - __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1.393 -# else
1.394 -# define YYCOPY(To, From, Count) \
1.395 - do \
1.396 - { \
1.397 - YYSIZE_T yyi; \
1.398 - for (yyi = 0; yyi < (Count); yyi++) \
1.399 - (To)[yyi] = (From)[yyi]; \
1.400 - } \
1.401 - while (YYID (0))
1.402 -# endif
1.403 -# endif
1.404 -
1.405 -/* Relocate STACK from its old location to the new one. The
1.406 - local variables YYSIZE and YYSTACKSIZE give the old and new number of
1.407 - elements in the stack, and YYPTR gives the new location of the
1.408 - stack. Advance YYPTR to a properly aligned location for the next
1.409 - stack. */
1.410 -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
1.411 - do \
1.412 - { \
1.413 - YYSIZE_T yynewbytes; \
1.414 - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
1.415 - Stack = &yyptr->Stack_alloc; \
1.416 - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1.417 - yyptr += yynewbytes / sizeof (*yyptr); \
1.418 - } \
1.419 - while (YYID (0))
1.420 -
1.421 -#endif
1.422 -
1.423 -/* YYFINAL -- State number of the termination state. */
1.424 -#define YYFINAL 11
1.425 -/* YYLAST -- Last index in YYTABLE. */
1.426 -#define YYLAST 290
1.427 -
1.428 -/* YYNTOKENS -- Number of terminals. */
1.429 -#define YYNTOKENS 36
1.430 -/* YYNNTS -- Number of nonterminals. */
1.431 -#define YYNNTS 50
1.432 -/* YYNRULES -- Number of rules. */
1.433 -#define YYNRULES 118
1.434 -/* YYNRULES -- Number of states. */
1.435 -#define YYNSTATES 191
1.436 -
1.437 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1.438 -#define YYUNDEFTOK 2
1.439 -#define YYMAXUTOK 290
1.440 -
1.441 -#define YYTRANSLATE(YYX) \
1.442 - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1.443 -
1.444 -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1.445 -static const yytype_uint8 yytranslate[] =
1.446 -{
1.447 - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.448 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.449 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.450 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.451 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.452 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.453 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.454 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.455 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.456 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.457 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.458 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.459 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.460 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.461 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.462 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.463 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.464 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.465 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.466 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.467 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.468 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.469 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.470 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.471 - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1.472 - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1.473 - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1.474 - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1.475 - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1.476 - 35
1.477 -};
1.478 -
1.479 -#if YYDEBUG
1.480 -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1.481 - YYRHS. */
1.482 -static const yytype_uint16 yyprhs[] =
1.483 -{
1.484 - 0, 0, 3, 6, 8, 11, 13, 14, 17, 20,
1.485 - 23, 26, 31, 36, 40, 42, 44, 46, 48, 50,
1.486 - 52, 54, 56, 58, 60, 62, 64, 66, 68, 72,
1.487 - 75, 79, 82, 86, 89, 90, 93, 96, 99, 102,
1.488 - 105, 108, 112, 117, 122, 127, 133, 137, 138, 142,
1.489 - 143, 146, 150, 153, 155, 159, 160, 163, 166, 169,
1.490 - 172, 175, 180, 184, 187, 192, 193, 196, 200, 202,
1.491 - 206, 207, 210, 213, 216, 220, 224, 228, 230, 234,
1.492 - 235, 238, 241, 244, 248, 252, 255, 258, 261, 262,
1.493 - 265, 268, 271, 276, 277, 280, 283, 286, 287, 290,
1.494 - 292, 294, 297, 300, 303, 305, 308, 309, 312, 314,
1.495 - 318, 322, 326, 329, 333, 337, 339, 341, 342
1.496 -};
1.497 -
1.498 -/* YYRHS -- A `-1'-separated list of the rules' RHS. */
1.499 -static const yytype_int8 yyrhs[] =
1.500 -{
1.501 - 37, 0, -1, 81, 38, -1, 38, -1, 63, 39,
1.502 - -1, 39, -1, -1, 39, 41, -1, 39, 55, -1,
1.503 - 39, 67, -1, 39, 80, -1, 39, 26, 1, 31,
1.504 - -1, 39, 40, 1, 31, -1, 39, 1, 31, -1,
1.505 - 16, -1, 18, -1, 19, -1, 21, -1, 17, -1,
1.506 - 22, -1, 20, -1, 23, -1, 31, -1, 61, -1,
1.507 - 71, -1, 44, -1, 46, -1, 69, -1, 26, 1,
1.508 - 31, -1, 1, 31, -1, 10, 26, 31, -1, 43,
1.509 - 47, -1, 11, 26, 31, -1, 45, 47, -1, -1,
1.510 - 47, 48, -1, 47, 49, -1, 47, 75, -1, 47,
1.511 - 73, -1, 47, 42, -1, 47, 31, -1, 19, 78,
1.512 - 31, -1, 18, 79, 82, 31, -1, 20, 83, 82,
1.513 - 31, -1, 21, 26, 82, 31, -1, 22, 84, 84,
1.514 - 82, 31, -1, 24, 50, 31, -1, -1, 50, 26,
1.515 - 51, -1, -1, 34, 79, -1, 7, 85, 31, -1,
1.516 - 52, 56, -1, 80, -1, 53, 58, 54, -1, -1,
1.517 - 56, 57, -1, 56, 75, -1, 56, 73, -1, 56,
1.518 - 31, -1, 56, 42, -1, 18, 79, 82, 31, -1,
1.519 - 19, 78, 31, -1, 17, 31, -1, 20, 26, 82,
1.520 - 31, -1, -1, 58, 41, -1, 14, 83, 81, -1,
1.521 - 80, -1, 59, 62, 60, -1, -1, 62, 41, -1,
1.522 - 62, 67, -1, 62, 55, -1, 3, 79, 81, -1,
1.523 - 4, 79, 31, -1, 64, 76, 74, -1, 80, -1,
1.524 - 65, 68, 66, -1, -1, 68, 41, -1, 68, 67,
1.525 - -1, 68, 55, -1, 6, 79, 31, -1, 9, 79,
1.526 - 31, -1, 70, 74, -1, 12, 31, -1, 72, 13,
1.527 - -1, -1, 74, 75, -1, 74, 31, -1, 74, 42,
1.528 - -1, 16, 25, 83, 31, -1, -1, 76, 77, -1,
1.529 - 76, 31, -1, 23, 82, -1, -1, 79, 82, -1,
1.530 - 26, -1, 27, -1, 5, 31, -1, 8, 31, -1,
1.531 - 15, 31, -1, 31, -1, 81, 31, -1, -1, 14,
1.532 - 83, -1, 84, -1, 84, 34, 84, -1, 84, 28,
1.533 - 84, -1, 30, 83, 29, -1, 35, 83, -1, 83,
1.534 - 32, 83, -1, 83, 33, 83, -1, 26, -1, 27,
1.535 - -1, -1, 26, -1
1.536 -};
1.537 -
1.538 -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1.539 -static const yytype_uint16 yyrline[] =
1.540 -{
1.541 - 0, 108, 108, 108, 110, 110, 112, 114, 115, 116,
1.542 - 117, 118, 119, 123, 127, 127, 127, 127, 127, 127,
1.543 - 127, 127, 131, 132, 133, 134, 135, 136, 140, 141,
1.544 - 147, 155, 161, 169, 179, 181, 182, 183, 184, 185,
1.545 - 186, 189, 197, 203, 213, 219, 225, 228, 230, 241,
1.546 - 242, 247, 256, 261, 269, 272, 274, 275, 276, 277,
1.547 - 278, 281, 287, 298, 304, 314, 316, 321, 329, 337,
1.548 - 340, 342, 343, 344, 349, 356, 363, 368, 376, 379,
1.549 - 381, 382, 383, 386, 394, 401, 408, 414, 421, 423,
1.550 - 424, 425, 428, 436, 438, 439, 442, 449, 451, 456,
1.551 - 457, 460, 461, 462, 466, 467, 470, 471, 474, 475,
1.552 - 476, 477, 478, 479, 480, 483, 484, 487, 488
1.553 -};
1.554 -#endif
1.555 -
1.556 -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1.557 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1.558 - First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1.559 -static const char *const yytname[] =
1.560 -{
1.561 - "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
1.562 - "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
1.563 - "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
1.564 - "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE",
1.565 - "T_VISIBLE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL",
1.566 - "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL",
1.567 - "T_NOT", "$accept", "input", "start", "stmt_list", "option_name",
1.568 - "common_stmt", "option_error", "config_entry_start", "config_stmt",
1.569 - "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
1.570 - "config_option", "symbol_option", "symbol_option_list",
1.571 - "symbol_option_arg", "choice", "choice_entry", "choice_end",
1.572 - "choice_stmt", "choice_option_list", "choice_option", "choice_block",
1.573 - "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu",
1.574 - "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt",
1.575 - "comment", "comment_stmt", "help_start", "help", "depends_list",
1.576 - "depends", "visibility_list", "visible", "prompt_stmt_opt", "prompt",
1.577 - "end", "nl", "if_expr", "expr", "symbol", "word_opt", 0
1.578 -};
1.579 -#endif
1.580 -
1.581 -# ifdef YYPRINT
1.582 -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1.583 - token YYLEX-NUM. */
1.584 -static const yytype_uint16 yytoknum[] =
1.585 -{
1.586 - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1.587 - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1.588 - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1.589 - 285, 286, 287, 288, 289, 290
1.590 -};
1.591 -# endif
1.592 -
1.593 -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1.594 -static const yytype_uint8 yyr1[] =
1.595 -{
1.596 - 0, 36, 37, 37, 38, 38, 39, 39, 39, 39,
1.597 - 39, 39, 39, 39, 40, 40, 40, 40, 40, 40,
1.598 - 40, 40, 41, 41, 41, 41, 41, 41, 42, 42,
1.599 - 43, 44, 45, 46, 47, 47, 47, 47, 47, 47,
1.600 - 47, 48, 48, 48, 48, 48, 49, 50, 50, 51,
1.601 - 51, 52, 53, 54, 55, 56, 56, 56, 56, 56,
1.602 - 56, 57, 57, 57, 57, 58, 58, 59, 60, 61,
1.603 - 62, 62, 62, 62, 63, 64, 65, 66, 67, 68,
1.604 - 68, 68, 68, 69, 70, 71, 72, 73, 74, 74,
1.605 - 74, 74, 75, 76, 76, 76, 77, 78, 78, 79,
1.606 - 79, 80, 80, 80, 81, 81, 82, 82, 83, 83,
1.607 - 83, 83, 83, 83, 83, 84, 84, 85, 85
1.608 -};
1.609 -
1.610 -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1.611 -static const yytype_uint8 yyr2[] =
1.612 -{
1.613 - 0, 2, 2, 1, 2, 1, 0, 2, 2, 2,
1.614 - 2, 4, 4, 3, 1, 1, 1, 1, 1, 1,
1.615 - 1, 1, 1, 1, 1, 1, 1, 1, 3, 2,
1.616 - 3, 2, 3, 2, 0, 2, 2, 2, 2, 2,
1.617 - 2, 3, 4, 4, 4, 5, 3, 0, 3, 0,
1.618 - 2, 3, 2, 1, 3, 0, 2, 2, 2, 2,
1.619 - 2, 4, 3, 2, 4, 0, 2, 3, 1, 3,
1.620 - 0, 2, 2, 2, 3, 3, 3, 1, 3, 0,
1.621 - 2, 2, 2, 3, 3, 2, 2, 2, 0, 2,
1.622 - 2, 2, 4, 0, 2, 2, 2, 0, 2, 1,
1.623 - 1, 2, 2, 2, 1, 2, 0, 2, 1, 3,
1.624 - 3, 3, 2, 3, 3, 1, 1, 0, 1
1.625 -};
1.626 -
1.627 -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
1.628 - STATE-NUM when YYTABLE doesn't specify something else to do. Zero
1.629 - means the default is an error. */
1.630 -static const yytype_uint8 yydefact[] =
1.631 -{
1.632 - 6, 0, 104, 0, 3, 0, 6, 6, 99, 100,
1.633 - 0, 1, 0, 0, 0, 0, 117, 0, 0, 0,
1.634 - 0, 0, 0, 14, 18, 15, 16, 20, 17, 19,
1.635 - 21, 0, 22, 0, 7, 34, 25, 34, 26, 55,
1.636 - 65, 8, 70, 23, 93, 79, 9, 27, 88, 24,
1.637 - 10, 0, 105, 2, 74, 13, 0, 101, 0, 118,
1.638 - 0, 102, 0, 0, 0, 115, 116, 0, 0, 0,
1.639 - 108, 103, 0, 0, 0, 0, 0, 0, 0, 88,
1.640 - 0, 0, 75, 83, 51, 84, 30, 32, 0, 112,
1.641 - 0, 0, 67, 0, 0, 11, 12, 0, 0, 0,
1.642 - 0, 97, 0, 0, 0, 47, 0, 40, 39, 35,
1.643 - 36, 0, 38, 37, 0, 0, 97, 0, 59, 60,
1.644 - 56, 58, 57, 66, 54, 53, 71, 73, 69, 72,
1.645 - 68, 106, 95, 0, 94, 80, 82, 78, 81, 77,
1.646 - 90, 91, 89, 111, 113, 114, 110, 109, 29, 86,
1.647 - 0, 106, 0, 106, 106, 106, 0, 0, 0, 87,
1.648 - 63, 106, 0, 106, 0, 96, 0, 0, 41, 98,
1.649 - 0, 0, 106, 49, 46, 28, 0, 62, 0, 107,
1.650 - 92, 42, 43, 44, 0, 0, 48, 61, 64, 45,
1.651 - 50
1.652 -};
1.653 -
1.654 -/* YYDEFGOTO[NTERM-NUM]. */
1.655 -static const yytype_int16 yydefgoto[] =
1.656 -{
1.657 - -1, 3, 4, 5, 33, 34, 108, 35, 36, 37,
1.658 - 38, 74, 109, 110, 157, 186, 39, 40, 124, 41,
1.659 - 76, 120, 77, 42, 128, 43, 78, 6, 44, 45,
1.660 - 137, 46, 80, 47, 48, 49, 111, 112, 81, 113,
1.661 - 79, 134, 152, 153, 50, 7, 165, 69, 70, 60
1.662 -};
1.663 -
1.664 -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1.665 - STATE-NUM. */
1.666 -#define YYPACT_NINF -90
1.667 -static const yytype_int16 yypact[] =
1.668 -{
1.669 - 4, 42, -90, 96, -90, 111, -90, 15, -90, -90,
1.670 - 75, -90, 82, 42, 104, 42, 110, 107, 42, 115,
1.671 - 125, -4, 121, -90, -90, -90, -90, -90, -90, -90,
1.672 - -90, 162, -90, 163, -90, -90, -90, -90, -90, -90,
1.673 - -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
1.674 - -90, 139, -90, -90, 138, -90, 142, -90, 143, -90,
1.675 - 152, -90, 164, 167, 168, -90, -90, -4, -4, 77,
1.676 - -18, -90, 177, 185, 33, 71, 195, 247, 236, -2,
1.677 - 236, 171, -90, -90, -90, -90, -90, -90, 41, -90,
1.678 - -4, -4, 138, 97, 97, -90, -90, 186, 187, 194,
1.679 - 42, 42, -4, 196, 97, -90, 219, -90, -90, -90,
1.680 - -90, 210, -90, -90, 204, 42, 42, 199, -90, -90,
1.681 - -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
1.682 - -90, 222, -90, 223, -90, -90, -90, -90, -90, -90,
1.683 - -90, -90, -90, -90, 215, -90, -90, -90, -90, -90,
1.684 - -4, 222, 228, 222, -5, 222, 97, 35, 229, -90,
1.685 - -90, 222, 232, 222, -4, -90, 135, 233, -90, -90,
1.686 - 234, 235, 222, 240, -90, -90, 237, -90, 239, -13,
1.687 - -90, -90, -90, -90, 244, 42, -90, -90, -90, -90,
1.688 - -90
1.689 -};
1.690 -
1.691 -/* YYPGOTO[NTERM-NUM]. */
1.692 -static const yytype_int16 yypgoto[] =
1.693 -{
1.694 - -90, -90, 269, 271, -90, 23, -70, -90, -90, -90,
1.695 - -90, 243, -90, -90, -90, -90, -90, -90, -90, -48,
1.696 - -90, -90, -90, -90, -90, -90, -90, -90, -90, -90,
1.697 - -90, -20, -90, -90, -90, -90, -90, 206, 205, -68,
1.698 - -90, -90, 169, -1, 27, -7, 118, -66, -89, -90
1.699 -};
1.700 -
1.701 -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1.702 - positive, shift that token. If negative, reduce the rule which
1.703 - number is the opposite. If zero, do what YYDEFACT says.
1.704 - If YYTABLE_NINF, syntax error. */
1.705 -#define YYTABLE_NINF -86
1.706 -static const yytype_int16 yytable[] =
1.707 -{
1.708 - 10, 88, 89, 54, 146, 147, 119, 1, 122, 164,
1.709 - 93, 141, 56, 142, 58, 156, 94, 62, 1, 90,
1.710 - 91, 131, 65, 66, 144, 145, 67, 90, 91, 132,
1.711 - 127, 68, 136, -31, 97, 2, 154, -31, -31, -31,
1.712 - -31, -31, -31, -31, -31, 98, 52, -31, -31, 99,
1.713 - -31, 100, 101, 102, 103, 104, -31, 105, 129, 106,
1.714 - 138, 173, 92, 141, 107, 142, 174, 172, 8, 9,
1.715 - 143, -33, 97, 90, 91, -33, -33, -33, -33, -33,
1.716 - -33, -33, -33, 98, 166, -33, -33, 99, -33, 100,
1.717 - 101, 102, 103, 104, -33, 105, 11, 106, 179, 151,
1.718 - 123, 126, 107, 135, 125, 130, 2, 139, 2, 90,
1.719 - 91, -5, 12, 55, 161, 13, 14, 15, 16, 17,
1.720 - 18, 19, 20, 65, 66, 21, 22, 23, 24, 25,
1.721 - 26, 27, 28, 29, 30, 57, 59, 31, 61, -4,
1.722 - 12, 63, 32, 13, 14, 15, 16, 17, 18, 19,
1.723 - 20, 64, 71, 21, 22, 23, 24, 25, 26, 27,
1.724 - 28, 29, 30, 72, 73, 31, 180, 90, 91, 52,
1.725 - 32, -85, 97, 82, 83, -85, -85, -85, -85, -85,
1.726 - -85, -85, -85, 84, 190, -85, -85, 99, -85, -85,
1.727 - -85, -85, -85, -85, -85, 85, 97, 106, 86, 87,
1.728 - -52, -52, 140, -52, -52, -52, -52, 98, 95, -52,
1.729 - -52, 99, 114, 115, 116, 117, 96, 148, 149, 150,
1.730 - 158, 106, 155, 159, 97, 163, 118, -76, -76, -76,
1.731 - -76, -76, -76, -76, -76, 160, 164, -76, -76, 99,
1.732 - 13, 14, 15, 16, 17, 18, 19, 20, 91, 106,
1.733 - 21, 22, 14, 15, 140, 17, 18, 19, 20, 168,
1.734 - 175, 21, 22, 177, 181, 182, 183, 32, 187, 167,
1.735 - 188, 169, 170, 171, 185, 189, 53, 51, 32, 176,
1.736 - 75, 178, 121, 0, 133, 162, 0, 0, 0, 0,
1.737 - 184
1.738 -};
1.739 -
1.740 -static const yytype_int16 yycheck[] =
1.741 -{
1.742 - 1, 67, 68, 10, 93, 94, 76, 3, 76, 14,
1.743 - 28, 81, 13, 81, 15, 104, 34, 18, 3, 32,
1.744 - 33, 23, 26, 27, 90, 91, 30, 32, 33, 31,
1.745 - 78, 35, 80, 0, 1, 31, 102, 4, 5, 6,
1.746 - 7, 8, 9, 10, 11, 12, 31, 14, 15, 16,
1.747 - 17, 18, 19, 20, 21, 22, 23, 24, 78, 26,
1.748 - 80, 26, 69, 133, 31, 133, 31, 156, 26, 27,
1.749 - 29, 0, 1, 32, 33, 4, 5, 6, 7, 8,
1.750 - 9, 10, 11, 12, 150, 14, 15, 16, 17, 18,
1.751 - 19, 20, 21, 22, 23, 24, 0, 26, 164, 100,
1.752 - 77, 78, 31, 80, 77, 78, 31, 80, 31, 32,
1.753 - 33, 0, 1, 31, 115, 4, 5, 6, 7, 8,
1.754 - 9, 10, 11, 26, 27, 14, 15, 16, 17, 18,
1.755 - 19, 20, 21, 22, 23, 31, 26, 26, 31, 0,
1.756 - 1, 26, 31, 4, 5, 6, 7, 8, 9, 10,
1.757 - 11, 26, 31, 14, 15, 16, 17, 18, 19, 20,
1.758 - 21, 22, 23, 1, 1, 26, 31, 32, 33, 31,
1.759 - 31, 0, 1, 31, 31, 4, 5, 6, 7, 8,
1.760 - 9, 10, 11, 31, 185, 14, 15, 16, 17, 18,
1.761 - 19, 20, 21, 22, 23, 31, 1, 26, 31, 31,
1.762 - 5, 6, 31, 8, 9, 10, 11, 12, 31, 14,
1.763 - 15, 16, 17, 18, 19, 20, 31, 31, 31, 25,
1.764 - 1, 26, 26, 13, 1, 26, 31, 4, 5, 6,
1.765 - 7, 8, 9, 10, 11, 31, 14, 14, 15, 16,
1.766 - 4, 5, 6, 7, 8, 9, 10, 11, 33, 26,
1.767 - 14, 15, 5, 6, 31, 8, 9, 10, 11, 31,
1.768 - 31, 14, 15, 31, 31, 31, 31, 31, 31, 151,
1.769 - 31, 153, 154, 155, 34, 31, 7, 6, 31, 161,
1.770 - 37, 163, 76, -1, 79, 116, -1, -1, -1, -1,
1.771 - 172
1.772 -};
1.773 -
1.774 -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1.775 - symbol of state STATE-NUM. */
1.776 -static const yytype_uint8 yystos[] =
1.777 -{
1.778 - 0, 3, 31, 37, 38, 39, 63, 81, 26, 27,
1.779 - 79, 0, 1, 4, 5, 6, 7, 8, 9, 10,
1.780 - 11, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1.781 - 23, 26, 31, 40, 41, 43, 44, 45, 46, 52,
1.782 - 53, 55, 59, 61, 64, 65, 67, 69, 70, 71,
1.783 - 80, 39, 31, 38, 81, 31, 79, 31, 79, 26,
1.784 - 85, 31, 79, 26, 26, 26, 27, 30, 35, 83,
1.785 - 84, 31, 1, 1, 47, 47, 56, 58, 62, 76,
1.786 - 68, 74, 31, 31, 31, 31, 31, 31, 83, 83,
1.787 - 32, 33, 81, 28, 34, 31, 31, 1, 12, 16,
1.788 - 18, 19, 20, 21, 22, 24, 26, 31, 42, 48,
1.789 - 49, 72, 73, 75, 17, 18, 19, 20, 31, 42,
1.790 - 57, 73, 75, 41, 54, 80, 41, 55, 60, 67,
1.791 - 80, 23, 31, 74, 77, 41, 55, 66, 67, 80,
1.792 - 31, 42, 75, 29, 83, 83, 84, 84, 31, 31,
1.793 - 25, 79, 78, 79, 83, 26, 84, 50, 1, 13,
1.794 - 31, 79, 78, 26, 14, 82, 83, 82, 31, 82,
1.795 - 82, 82, 84, 26, 31, 31, 82, 31, 82, 83,
1.796 - 31, 31, 31, 31, 82, 34, 51, 31, 31, 31,
1.797 - 79
1.798 -};
1.799 -
1.800 -#define yyerrok (yyerrstatus = 0)
1.801 -#define yyclearin (yychar = YYEMPTY)
1.802 -#define YYEMPTY (-2)
1.803 -#define YYEOF 0
1.804 -
1.805 -#define YYACCEPT goto yyacceptlab
1.806 -#define YYABORT goto yyabortlab
1.807 -#define YYERROR goto yyerrorlab
1.808 -
1.809 -
1.810 -/* Like YYERROR except do call yyerror. This remains here temporarily
1.811 - to ease the transition to the new meaning of YYERROR, for GCC.
1.812 - Once GCC version 2 has supplanted version 1, this can go. */
1.813 -
1.814 -#define YYFAIL goto yyerrlab
1.815 -
1.816 -#define YYRECOVERING() (!!yyerrstatus)
1.817 -
1.818 -#define YYBACKUP(Token, Value) \
1.819 -do \
1.820 - if (yychar == YYEMPTY && yylen == 1) \
1.821 - { \
1.822 - yychar = (Token); \
1.823 - yylval = (Value); \
1.824 - yytoken = YYTRANSLATE (yychar); \
1.825 - YYPOPSTACK (1); \
1.826 - goto yybackup; \
1.827 - } \
1.828 - else \
1.829 - { \
1.830 - yyerror (YY_("syntax error: cannot back up")); \
1.831 - YYERROR; \
1.832 - } \
1.833 -while (YYID (0))
1.834 -
1.835 -
1.836 -#define YYTERROR 1
1.837 -#define YYERRCODE 256
1.838 -
1.839 -
1.840 -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1.841 - If N is 0, then set CURRENT to the empty location which ends
1.842 - the previous symbol: RHS[0] (always defined). */
1.843 -
1.844 -#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1.845 -#ifndef YYLLOC_DEFAULT
1.846 -# define YYLLOC_DEFAULT(Current, Rhs, N) \
1.847 - do \
1.848 - if (YYID (N)) \
1.849 - { \
1.850 - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1.851 - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1.852 - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1.853 - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1.854 - } \
1.855 - else \
1.856 - { \
1.857 - (Current).first_line = (Current).last_line = \
1.858 - YYRHSLOC (Rhs, 0).last_line; \
1.859 - (Current).first_column = (Current).last_column = \
1.860 - YYRHSLOC (Rhs, 0).last_column; \
1.861 - } \
1.862 - while (YYID (0))
1.863 -#endif
1.864 -
1.865 -
1.866 -/* YY_LOCATION_PRINT -- Print the location on the stream.
1.867 - This macro was not mandated originally: define only if we know
1.868 - we won't break user code: when these are the locations we know. */
1.869 -
1.870 -#ifndef YY_LOCATION_PRINT
1.871 -# if YYLTYPE_IS_TRIVIAL
1.872 -# define YY_LOCATION_PRINT(File, Loc) \
1.873 - fprintf (File, "%d.%d-%d.%d", \
1.874 - (Loc).first_line, (Loc).first_column, \
1.875 - (Loc).last_line, (Loc).last_column)
1.876 -# else
1.877 -# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1.878 -# endif
1.879 -#endif
1.880 -
1.881 -
1.882 -/* YYLEX -- calling `yylex' with the right arguments. */
1.883 -
1.884 -#ifdef YYLEX_PARAM
1.885 -# define YYLEX yylex (YYLEX_PARAM)
1.886 -#else
1.887 -# define YYLEX yylex ()
1.888 -#endif
1.889 -
1.890 -/* Enable debugging if requested. */
1.891 -#if YYDEBUG
1.892 -
1.893 -# ifndef YYFPRINTF
1.894 -# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1.895 -# define YYFPRINTF fprintf
1.896 -# endif
1.897 -
1.898 -# define YYDPRINTF(Args) \
1.899 -do { \
1.900 - if (yydebug) \
1.901 - YYFPRINTF Args; \
1.902 -} while (YYID (0))
1.903 -
1.904 -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1.905 -do { \
1.906 - if (yydebug) \
1.907 - { \
1.908 - YYFPRINTF (stderr, "%s ", Title); \
1.909 - yy_symbol_print (stderr, \
1.910 - Type, Value); \
1.911 - YYFPRINTF (stderr, "\n"); \
1.912 - } \
1.913 -} while (YYID (0))
1.914 -
1.915 -
1.916 -/*--------------------------------.
1.917 -| Print this symbol on YYOUTPUT. |
1.918 -`--------------------------------*/
1.919 -
1.920 -/*ARGSUSED*/
1.921 -#if (defined __STDC__ || defined __C99__FUNC__ \
1.922 - || defined __cplusplus || defined _MSC_VER)
1.923 -static void
1.924 -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1.925 -#else
1.926 -static void
1.927 -yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1.928 - FILE *yyoutput;
1.929 - int yytype;
1.930 - YYSTYPE const * const yyvaluep;
1.931 -#endif
1.932 -{
1.933 - if (!yyvaluep)
1.934 - return;
1.935 -# ifdef YYPRINT
1.936 - if (yytype < YYNTOKENS)
1.937 - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1.938 -# else
1.939 - YYUSE (yyoutput);
1.940 -# endif
1.941 - switch (yytype)
1.942 - {
1.943 - default:
1.944 - break;
1.945 - }
1.946 -}
1.947 -
1.948 -
1.949 -/*--------------------------------.
1.950 -| Print this symbol on YYOUTPUT. |
1.951 -`--------------------------------*/
1.952 -
1.953 -#if (defined __STDC__ || defined __C99__FUNC__ \
1.954 - || defined __cplusplus || defined _MSC_VER)
1.955 -static void
1.956 -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1.957 -#else
1.958 -static void
1.959 -yy_symbol_print (yyoutput, yytype, yyvaluep)
1.960 - FILE *yyoutput;
1.961 - int yytype;
1.962 - YYSTYPE const * const yyvaluep;
1.963 -#endif
1.964 -{
1.965 - if (yytype < YYNTOKENS)
1.966 - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1.967 - else
1.968 - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1.969 -
1.970 - yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1.971 - YYFPRINTF (yyoutput, ")");
1.972 -}
1.973 -
1.974 -/*------------------------------------------------------------------.
1.975 -| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1.976 -| TOP (included). |
1.977 -`------------------------------------------------------------------*/
1.978 -
1.979 -#if (defined __STDC__ || defined __C99__FUNC__ \
1.980 - || defined __cplusplus || defined _MSC_VER)
1.981 -static void
1.982 -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1.983 -#else
1.984 -static void
1.985 -yy_stack_print (yybottom, yytop)
1.986 - yytype_int16 *yybottom;
1.987 - yytype_int16 *yytop;
1.988 -#endif
1.989 -{
1.990 - YYFPRINTF (stderr, "Stack now");
1.991 - for (; yybottom <= yytop; yybottom++)
1.992 - {
1.993 - int yybot = *yybottom;
1.994 - YYFPRINTF (stderr, " %d", yybot);
1.995 - }
1.996 - YYFPRINTF (stderr, "\n");
1.997 -}
1.998 -
1.999 -# define YY_STACK_PRINT(Bottom, Top) \
1.1000 -do { \
1.1001 - if (yydebug) \
1.1002 - yy_stack_print ((Bottom), (Top)); \
1.1003 -} while (YYID (0))
1.1004 -
1.1005 -
1.1006 -/*------------------------------------------------.
1.1007 -| Report that the YYRULE is going to be reduced. |
1.1008 -`------------------------------------------------*/
1.1009 -
1.1010 -#if (defined __STDC__ || defined __C99__FUNC__ \
1.1011 - || defined __cplusplus || defined _MSC_VER)
1.1012 -static void
1.1013 -yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1.1014 -#else
1.1015 -static void
1.1016 -yy_reduce_print (yyvsp, yyrule)
1.1017 - YYSTYPE *yyvsp;
1.1018 - int yyrule;
1.1019 -#endif
1.1020 -{
1.1021 - int yynrhs = yyr2[yyrule];
1.1022 - int yyi;
1.1023 - unsigned long int yylno = yyrline[yyrule];
1.1024 - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1.1025 - yyrule - 1, yylno);
1.1026 - /* The symbols being reduced. */
1.1027 - for (yyi = 0; yyi < yynrhs; yyi++)
1.1028 - {
1.1029 - YYFPRINTF (stderr, " $%d = ", yyi + 1);
1.1030 - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1.1031 - &(yyvsp[(yyi + 1) - (yynrhs)])
1.1032 - );
1.1033 - YYFPRINTF (stderr, "\n");
1.1034 - }
1.1035 -}
1.1036 -
1.1037 -# define YY_REDUCE_PRINT(Rule) \
1.1038 -do { \
1.1039 - if (yydebug) \
1.1040 - yy_reduce_print (yyvsp, Rule); \
1.1041 -} while (YYID (0))
1.1042 -
1.1043 -/* Nonzero means print parse trace. It is left uninitialized so that
1.1044 - multiple parsers can coexist. */
1.1045 -int yydebug;
1.1046 -#else /* !YYDEBUG */
1.1047 -# define YYDPRINTF(Args)
1.1048 -# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1.1049 -# define YY_STACK_PRINT(Bottom, Top)
1.1050 -# define YY_REDUCE_PRINT(Rule)
1.1051 -#endif /* !YYDEBUG */
1.1052 -
1.1053 -
1.1054 -/* YYINITDEPTH -- initial size of the parser's stacks. */
1.1055 -#ifndef YYINITDEPTH
1.1056 -# define YYINITDEPTH 200
1.1057 -#endif
1.1058 -
1.1059 -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1.1060 - if the built-in stack extension method is used).
1.1061 -
1.1062 - Do not make this value too large; the results are undefined if
1.1063 - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1.1064 - evaluated with infinite-precision integer arithmetic. */
1.1065 -
1.1066 -#ifndef YYMAXDEPTH
1.1067 -# define YYMAXDEPTH 10000
1.1068 -#endif
1.1069 -
1.1070 -
1.1071 -
1.1072 -#if YYERROR_VERBOSE
1.1073 -
1.1074 -# ifndef yystrlen
1.1075 -# if defined __GLIBC__ && defined _STRING_H
1.1076 -# define yystrlen strlen
1.1077 -# else
1.1078 -/* Return the length of YYSTR. */
1.1079 -#if (defined __STDC__ || defined __C99__FUNC__ \
1.1080 - || defined __cplusplus || defined _MSC_VER)
1.1081 -static YYSIZE_T
1.1082 -yystrlen (const char *yystr)
1.1083 -#else
1.1084 -static YYSIZE_T
1.1085 -yystrlen (yystr)
1.1086 - const char *yystr;
1.1087 -#endif
1.1088 -{
1.1089 - YYSIZE_T yylen;
1.1090 - for (yylen = 0; yystr[yylen]; yylen++)
1.1091 - continue;
1.1092 - return yylen;
1.1093 -}
1.1094 -# endif
1.1095 -# endif
1.1096 -
1.1097 -# ifndef yystpcpy
1.1098 -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1.1099 -# define yystpcpy stpcpy
1.1100 -# else
1.1101 -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1.1102 - YYDEST. */
1.1103 -#if (defined __STDC__ || defined __C99__FUNC__ \
1.1104 - || defined __cplusplus || defined _MSC_VER)
1.1105 -static char *
1.1106 -yystpcpy (char *yydest, const char *yysrc)
1.1107 -#else
1.1108 -static char *
1.1109 -yystpcpy (yydest, yysrc)
1.1110 - char *yydest;
1.1111 - const char *yysrc;
1.1112 -#endif
1.1113 -{
1.1114 - char *yyd = yydest;
1.1115 - const char *yys = yysrc;
1.1116 -
1.1117 - while ((*yyd++ = *yys++) != '\0')
1.1118 - continue;
1.1119 -
1.1120 - return yyd - 1;
1.1121 -}
1.1122 -# endif
1.1123 -# endif
1.1124 -
1.1125 -# ifndef yytnamerr
1.1126 -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1.1127 - quotes and backslashes, so that it's suitable for yyerror. The
1.1128 - heuristic is that double-quoting is unnecessary unless the string
1.1129 - contains an apostrophe, a comma, or backslash (other than
1.1130 - backslash-backslash). YYSTR is taken from yytname. If YYRES is
1.1131 - null, do not copy; instead, return the length of what the result
1.1132 - would have been. */
1.1133 -static YYSIZE_T
1.1134 -yytnamerr (char *yyres, const char *yystr)
1.1135 -{
1.1136 - if (*yystr == '"')
1.1137 - {
1.1138 - YYSIZE_T yyn = 0;
1.1139 - char const *yyp = yystr;
1.1140 -
1.1141 - for (;;)
1.1142 - switch (*++yyp)
1.1143 - {
1.1144 - case '\'':
1.1145 - case ',':
1.1146 - goto do_not_strip_quotes;
1.1147 -
1.1148 - case '\\':
1.1149 - if (*++yyp != '\\')
1.1150 - goto do_not_strip_quotes;
1.1151 - /* Fall through. */
1.1152 - default:
1.1153 - if (yyres)
1.1154 - yyres[yyn] = *yyp;
1.1155 - yyn++;
1.1156 - break;
1.1157 -
1.1158 - case '"':
1.1159 - if (yyres)
1.1160 - yyres[yyn] = '\0';
1.1161 - return yyn;
1.1162 - }
1.1163 - do_not_strip_quotes: ;
1.1164 - }
1.1165 -
1.1166 - if (! yyres)
1.1167 - return yystrlen (yystr);
1.1168 -
1.1169 - return yystpcpy (yyres, yystr) - yyres;
1.1170 -}
1.1171 -# endif
1.1172 -
1.1173 -/* Copy into YYRESULT an error message about the unexpected token
1.1174 - YYCHAR while in state YYSTATE. Return the number of bytes copied,
1.1175 - including the terminating null byte. If YYRESULT is null, do not
1.1176 - copy anything; just return the number of bytes that would be
1.1177 - copied. As a special case, return 0 if an ordinary "syntax error"
1.1178 - message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1.1179 - size calculation. */
1.1180 -static YYSIZE_T
1.1181 -yysyntax_error (char *yyresult, int yystate, int yychar)
1.1182 -{
1.1183 - int yyn = yypact[yystate];
1.1184 -
1.1185 - if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1.1186 - return 0;
1.1187 - else
1.1188 - {
1.1189 - int yytype = YYTRANSLATE (yychar);
1.1190 - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1.1191 - YYSIZE_T yysize = yysize0;
1.1192 - YYSIZE_T yysize1;
1.1193 - int yysize_overflow = 0;
1.1194 - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1.1195 - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1.1196 - int yyx;
1.1197 -
1.1198 -# if 0
1.1199 - /* This is so xgettext sees the translatable formats that are
1.1200 - constructed on the fly. */
1.1201 - YY_("syntax error, unexpected %s");
1.1202 - YY_("syntax error, unexpected %s, expecting %s");
1.1203 - YY_("syntax error, unexpected %s, expecting %s or %s");
1.1204 - YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1.1205 - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1.1206 -# endif
1.1207 - char *yyfmt;
1.1208 - char const *yyf;
1.1209 - static char const yyunexpected[] = "syntax error, unexpected %s";
1.1210 - static char const yyexpecting[] = ", expecting %s";
1.1211 - static char const yyor[] = " or %s";
1.1212 - char yyformat[sizeof yyunexpected
1.1213 - + sizeof yyexpecting - 1
1.1214 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1.1215 - * (sizeof yyor - 1))];
1.1216 - char const *yyprefix = yyexpecting;
1.1217 -
1.1218 - /* Start YYX at -YYN if negative to avoid negative indexes in
1.1219 - YYCHECK. */
1.1220 - int yyxbegin = yyn < 0 ? -yyn : 0;
1.1221 -
1.1222 - /* Stay within bounds of both yycheck and yytname. */
1.1223 - int yychecklim = YYLAST - yyn + 1;
1.1224 - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1.1225 - int yycount = 1;
1.1226 -
1.1227 - yyarg[0] = yytname[yytype];
1.1228 - yyfmt = yystpcpy (yyformat, yyunexpected);
1.1229 -
1.1230 - for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1.1231 - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1.1232 - {
1.1233 - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1.1234 - {
1.1235 - yycount = 1;
1.1236 - yysize = yysize0;
1.1237 - yyformat[sizeof yyunexpected - 1] = '\0';
1.1238 - break;
1.1239 - }
1.1240 - yyarg[yycount++] = yytname[yyx];
1.1241 - yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1.1242 - yysize_overflow |= (yysize1 < yysize);
1.1243 - yysize = yysize1;
1.1244 - yyfmt = yystpcpy (yyfmt, yyprefix);
1.1245 - yyprefix = yyor;
1.1246 - }
1.1247 -
1.1248 - yyf = YY_(yyformat);
1.1249 - yysize1 = yysize + yystrlen (yyf);
1.1250 - yysize_overflow |= (yysize1 < yysize);
1.1251 - yysize = yysize1;
1.1252 -
1.1253 - if (yysize_overflow)
1.1254 - return YYSIZE_MAXIMUM;
1.1255 -
1.1256 - if (yyresult)
1.1257 - {
1.1258 - /* Avoid sprintf, as that infringes on the user's name space.
1.1259 - Don't have undefined behavior even if the translation
1.1260 - produced a string with the wrong number of "%s"s. */
1.1261 - char *yyp = yyresult;
1.1262 - int yyi = 0;
1.1263 - while ((*yyp = *yyf) != '\0')
1.1264 - {
1.1265 - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1.1266 - {
1.1267 - yyp += yytnamerr (yyp, yyarg[yyi++]);
1.1268 - yyf += 2;
1.1269 - }
1.1270 - else
1.1271 - {
1.1272 - yyp++;
1.1273 - yyf++;
1.1274 - }
1.1275 - }
1.1276 - }
1.1277 - return yysize;
1.1278 - }
1.1279 -}
1.1280 -#endif /* YYERROR_VERBOSE */
1.1281 -
1.1282 -
1.1283 -/*-----------------------------------------------.
1.1284 -| Release the memory associated to this symbol. |
1.1285 -`-----------------------------------------------*/
1.1286 -
1.1287 -/*ARGSUSED*/
1.1288 -#if (defined __STDC__ || defined __C99__FUNC__ \
1.1289 - || defined __cplusplus || defined _MSC_VER)
1.1290 -static void
1.1291 -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1.1292 -#else
1.1293 -static void
1.1294 -yydestruct (yymsg, yytype, yyvaluep)
1.1295 - const char *yymsg;
1.1296 - int yytype;
1.1297 - YYSTYPE *yyvaluep;
1.1298 -#endif
1.1299 -{
1.1300 - YYUSE (yyvaluep);
1.1301 -
1.1302 - if (!yymsg)
1.1303 - yymsg = "Deleting";
1.1304 - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1.1305 -
1.1306 - switch (yytype)
1.1307 - {
1.1308 - case 53: /* "choice_entry" */
1.1309 -
1.1310 - {
1.1311 - fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1.1312 - (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1.1313 - if (current_menu == (yyvaluep->menu))
1.1314 - menu_end_menu();
1.1315 -};
1.1316 -
1.1317 - break;
1.1318 - case 59: /* "if_entry" */
1.1319 -
1.1320 - {
1.1321 - fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1.1322 - (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1.1323 - if (current_menu == (yyvaluep->menu))
1.1324 - menu_end_menu();
1.1325 -};
1.1326 -
1.1327 - break;
1.1328 - case 65: /* "menu_entry" */
1.1329 -
1.1330 - {
1.1331 - fprintf(stderr, "%s:%d: missing end statement for this entry\n",
1.1332 - (yyvaluep->menu)->file->name, (yyvaluep->menu)->lineno);
1.1333 - if (current_menu == (yyvaluep->menu))
1.1334 - menu_end_menu();
1.1335 -};
1.1336 -
1.1337 - break;
1.1338 -
1.1339 - default:
1.1340 - break;
1.1341 - }
1.1342 -}
1.1343 -
1.1344 -/* Prevent warnings from -Wmissing-prototypes. */
1.1345 -#ifdef YYPARSE_PARAM
1.1346 -#if defined __STDC__ || defined __cplusplus
1.1347 -int yyparse (void *YYPARSE_PARAM);
1.1348 -#else
1.1349 -int yyparse ();
1.1350 -#endif
1.1351 -#else /* ! YYPARSE_PARAM */
1.1352 -#if defined __STDC__ || defined __cplusplus
1.1353 -int yyparse (void);
1.1354 -#else
1.1355 -int yyparse ();
1.1356 -#endif
1.1357 -#endif /* ! YYPARSE_PARAM */
1.1358 -
1.1359 -
1.1360 -/* The lookahead symbol. */
1.1361 -int yychar;
1.1362 -
1.1363 -/* The semantic value of the lookahead symbol. */
1.1364 -YYSTYPE yylval;
1.1365 -
1.1366 -/* Number of syntax errors so far. */
1.1367 -int yynerrs;
1.1368 -
1.1369 -
1.1370 -
1.1371 -/*-------------------------.
1.1372 -| yyparse or yypush_parse. |
1.1373 -`-------------------------*/
1.1374 -
1.1375 -#ifdef YYPARSE_PARAM
1.1376 -#if (defined __STDC__ || defined __C99__FUNC__ \
1.1377 - || defined __cplusplus || defined _MSC_VER)
1.1378 -int
1.1379 -yyparse (void *YYPARSE_PARAM)
1.1380 -#else
1.1381 -int
1.1382 -yyparse (YYPARSE_PARAM)
1.1383 - void *YYPARSE_PARAM;
1.1384 -#endif
1.1385 -#else /* ! YYPARSE_PARAM */
1.1386 -#if (defined __STDC__ || defined __C99__FUNC__ \
1.1387 - || defined __cplusplus || defined _MSC_VER)
1.1388 -int
1.1389 -yyparse (void)
1.1390 -#else
1.1391 -int
1.1392 -yyparse ()
1.1393 -
1.1394 -#endif
1.1395 -#endif
1.1396 -{
1.1397 -
1.1398 -
1.1399 - int yystate;
1.1400 - /* Number of tokens to shift before error messages enabled. */
1.1401 - int yyerrstatus;
1.1402 -
1.1403 - /* The stacks and their tools:
1.1404 - `yyss': related to states.
1.1405 - `yyvs': related to semantic values.
1.1406 -
1.1407 - Refer to the stacks thru separate pointers, to allow yyoverflow
1.1408 - to reallocate them elsewhere. */
1.1409 -
1.1410 - /* The state stack. */
1.1411 - yytype_int16 yyssa[YYINITDEPTH];
1.1412 - yytype_int16 *yyss;
1.1413 - yytype_int16 *yyssp;
1.1414 -
1.1415 - /* The semantic value stack. */
1.1416 - YYSTYPE yyvsa[YYINITDEPTH];
1.1417 - YYSTYPE *yyvs;
1.1418 - YYSTYPE *yyvsp;
1.1419 -
1.1420 - YYSIZE_T yystacksize;
1.1421 -
1.1422 - int yyn;
1.1423 - int yyresult;
1.1424 - /* Lookahead token as an internal (translated) token number. */
1.1425 - int yytoken;
1.1426 - /* The variables used to return semantic value and location from the
1.1427 - action routines. */
1.1428 - YYSTYPE yyval;
1.1429 -
1.1430 -#if YYERROR_VERBOSE
1.1431 - /* Buffer for error messages, and its allocated size. */
1.1432 - char yymsgbuf[128];
1.1433 - char *yymsg = yymsgbuf;
1.1434 - YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1.1435 -#endif
1.1436 -
1.1437 -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1.1438 -
1.1439 - /* The number of symbols on the RHS of the reduced rule.
1.1440 - Keep to zero when no symbol should be popped. */
1.1441 - int yylen = 0;
1.1442 -
1.1443 - yytoken = 0;
1.1444 - yyss = yyssa;
1.1445 - yyvs = yyvsa;
1.1446 - yystacksize = YYINITDEPTH;
1.1447 -
1.1448 - YYDPRINTF ((stderr, "Starting parse\n"));
1.1449 -
1.1450 - yystate = 0;
1.1451 - yyerrstatus = 0;
1.1452 - yynerrs = 0;
1.1453 - yychar = YYEMPTY; /* Cause a token to be read. */
1.1454 -
1.1455 - /* Initialize stack pointers.
1.1456 - Waste one element of value and location stack
1.1457 - so that they stay on the same level as the state stack.
1.1458 - The wasted elements are never initialized. */
1.1459 - yyssp = yyss;
1.1460 - yyvsp = yyvs;
1.1461 -
1.1462 - goto yysetstate;
1.1463 -
1.1464 -/*------------------------------------------------------------.
1.1465 -| yynewstate -- Push a new state, which is found in yystate. |
1.1466 -`------------------------------------------------------------*/
1.1467 - yynewstate:
1.1468 - /* In all cases, when you get here, the value and location stacks
1.1469 - have just been pushed. So pushing a state here evens the stacks. */
1.1470 - yyssp++;
1.1471 -
1.1472 - yysetstate:
1.1473 - *yyssp = yystate;
1.1474 -
1.1475 - if (yyss + yystacksize - 1 <= yyssp)
1.1476 - {
1.1477 - /* Get the current used size of the three stacks, in elements. */
1.1478 - YYSIZE_T yysize = yyssp - yyss + 1;
1.1479 -
1.1480 -#ifdef yyoverflow
1.1481 - {
1.1482 - /* Give user a chance to reallocate the stack. Use copies of
1.1483 - these so that the &'s don't force the real ones into
1.1484 - memory. */
1.1485 - YYSTYPE *yyvs1 = yyvs;
1.1486 - yytype_int16 *yyss1 = yyss;
1.1487 -
1.1488 - /* Each stack pointer address is followed by the size of the
1.1489 - data in use in that stack, in bytes. This used to be a
1.1490 - conditional around just the two extra args, but that might
1.1491 - be undefined if yyoverflow is a macro. */
1.1492 - yyoverflow (YY_("memory exhausted"),
1.1493 - &yyss1, yysize * sizeof (*yyssp),
1.1494 - &yyvs1, yysize * sizeof (*yyvsp),
1.1495 - &yystacksize);
1.1496 -
1.1497 - yyss = yyss1;
1.1498 - yyvs = yyvs1;
1.1499 - }
1.1500 -#else /* no yyoverflow */
1.1501 -# ifndef YYSTACK_RELOCATE
1.1502 - goto yyexhaustedlab;
1.1503 -# else
1.1504 - /* Extend the stack our own way. */
1.1505 - if (YYMAXDEPTH <= yystacksize)
1.1506 - goto yyexhaustedlab;
1.1507 - yystacksize *= 2;
1.1508 - if (YYMAXDEPTH < yystacksize)
1.1509 - yystacksize = YYMAXDEPTH;
1.1510 -
1.1511 - {
1.1512 - yytype_int16 *yyss1 = yyss;
1.1513 - union yyalloc *yyptr =
1.1514 - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1.1515 - if (! yyptr)
1.1516 - goto yyexhaustedlab;
1.1517 - YYSTACK_RELOCATE (yyss_alloc, yyss);
1.1518 - YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1.1519 -# undef YYSTACK_RELOCATE
1.1520 - if (yyss1 != yyssa)
1.1521 - YYSTACK_FREE (yyss1);
1.1522 - }
1.1523 -# endif
1.1524 -#endif /* no yyoverflow */
1.1525 -
1.1526 - yyssp = yyss + yysize - 1;
1.1527 - yyvsp = yyvs + yysize - 1;
1.1528 -
1.1529 - YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1.1530 - (unsigned long int) yystacksize));
1.1531 -
1.1532 - if (yyss + yystacksize - 1 <= yyssp)
1.1533 - YYABORT;
1.1534 - }
1.1535 -
1.1536 - YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1.1537 -
1.1538 - if (yystate == YYFINAL)
1.1539 - YYACCEPT;
1.1540 -
1.1541 - goto yybackup;
1.1542 -
1.1543 -/*-----------.
1.1544 -| yybackup. |
1.1545 -`-----------*/
1.1546 -yybackup:
1.1547 -
1.1548 - /* Do appropriate processing given the current state. Read a
1.1549 - lookahead token if we need one and don't already have one. */
1.1550 -
1.1551 - /* First try to decide what to do without reference to lookahead token. */
1.1552 - yyn = yypact[yystate];
1.1553 - if (yyn == YYPACT_NINF)
1.1554 - goto yydefault;
1.1555 -
1.1556 - /* Not known => get a lookahead token if don't already have one. */
1.1557 -
1.1558 - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1.1559 - if (yychar == YYEMPTY)
1.1560 - {
1.1561 - YYDPRINTF ((stderr, "Reading a token: "));
1.1562 - yychar = YYLEX;
1.1563 - }
1.1564 -
1.1565 - if (yychar <= YYEOF)
1.1566 - {
1.1567 - yychar = yytoken = YYEOF;
1.1568 - YYDPRINTF ((stderr, "Now at end of input.\n"));
1.1569 - }
1.1570 - else
1.1571 - {
1.1572 - yytoken = YYTRANSLATE (yychar);
1.1573 - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1.1574 - }
1.1575 -
1.1576 - /* If the proper action on seeing token YYTOKEN is to reduce or to
1.1577 - detect an error, take that action. */
1.1578 - yyn += yytoken;
1.1579 - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1.1580 - goto yydefault;
1.1581 - yyn = yytable[yyn];
1.1582 - if (yyn <= 0)
1.1583 - {
1.1584 - if (yyn == 0 || yyn == YYTABLE_NINF)
1.1585 - goto yyerrlab;
1.1586 - yyn = -yyn;
1.1587 - goto yyreduce;
1.1588 - }
1.1589 -
1.1590 - /* Count tokens shifted since error; after three, turn off error
1.1591 - status. */
1.1592 - if (yyerrstatus)
1.1593 - yyerrstatus--;
1.1594 -
1.1595 - /* Shift the lookahead token. */
1.1596 - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1.1597 -
1.1598 - /* Discard the shifted token. */
1.1599 - yychar = YYEMPTY;
1.1600 -
1.1601 - yystate = yyn;
1.1602 - *++yyvsp = yylval;
1.1603 -
1.1604 - goto yynewstate;
1.1605 -
1.1606 -
1.1607 -/*-----------------------------------------------------------.
1.1608 -| yydefault -- do the default action for the current state. |
1.1609 -`-----------------------------------------------------------*/
1.1610 -yydefault:
1.1611 - yyn = yydefact[yystate];
1.1612 - if (yyn == 0)
1.1613 - goto yyerrlab;
1.1614 - goto yyreduce;
1.1615 -
1.1616 -
1.1617 -/*-----------------------------.
1.1618 -| yyreduce -- Do a reduction. |
1.1619 -`-----------------------------*/
1.1620 -yyreduce:
1.1621 - /* yyn is the number of a rule to reduce with. */
1.1622 - yylen = yyr2[yyn];
1.1623 -
1.1624 - /* If YYLEN is nonzero, implement the default value of the action:
1.1625 - `$$ = $1'.
1.1626 -
1.1627 - Otherwise, the following line sets YYVAL to garbage.
1.1628 - This behavior is undocumented and Bison
1.1629 - users should not rely upon it. Assigning to YYVAL
1.1630 - unconditionally makes the parser a bit smaller, and it avoids a
1.1631 - GCC warning that YYVAL may be used uninitialized. */
1.1632 - yyval = yyvsp[1-yylen];
1.1633 -
1.1634 -
1.1635 - YY_REDUCE_PRINT (yyn);
1.1636 - switch (yyn)
1.1637 - {
1.1638 - case 10:
1.1639 -
1.1640 - { zconf_error("unexpected end statement"); ;}
1.1641 - break;
1.1642 -
1.1643 - case 11:
1.1644 -
1.1645 - { zconf_error("unknown statement \"%s\"", (yyvsp[(2) - (4)].string)); ;}
1.1646 - break;
1.1647 -
1.1648 - case 12:
1.1649 -
1.1650 - {
1.1651 - zconf_error("unexpected option \"%s\"", kconf_id_strings + (yyvsp[(2) - (4)].id)->name);
1.1652 -;}
1.1653 - break;
1.1654 -
1.1655 - case 13:
1.1656 -
1.1657 - { zconf_error("invalid statement"); ;}
1.1658 - break;
1.1659 -
1.1660 - case 28:
1.1661 -
1.1662 - { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;}
1.1663 - break;
1.1664 -
1.1665 - case 29:
1.1666 -
1.1667 - { zconf_error("invalid option"); ;}
1.1668 - break;
1.1669 -
1.1670 - case 30:
1.1671 -
1.1672 - {
1.1673 - struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
1.1674 - sym->flags |= SYMBOL_OPTIONAL;
1.1675 - menu_add_entry(sym);
1.1676 - printd(DEBUG_PARSE, "%s:%d:config %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1.1677 -;}
1.1678 - break;
1.1679 -
1.1680 - case 31:
1.1681 -
1.1682 - {
1.1683 - menu_end_entry();
1.1684 - printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1.1685 -;}
1.1686 - break;
1.1687 -
1.1688 - case 32:
1.1689 -
1.1690 - {
1.1691 - struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0);
1.1692 - sym->flags |= SYMBOL_OPTIONAL;
1.1693 - menu_add_entry(sym);
1.1694 - printd(DEBUG_PARSE, "%s:%d:menuconfig %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1.1695 -;}
1.1696 - break;
1.1697 -
1.1698 - case 33:
1.1699 -
1.1700 - {
1.1701 - if (current_entry->prompt)
1.1702 - current_entry->prompt->type = P_MENU;
1.1703 - else
1.1704 - zconfprint("warning: menuconfig statement without prompt");
1.1705 - menu_end_entry();
1.1706 - printd(DEBUG_PARSE, "%s:%d:endconfig\n", zconf_curname(), zconf_lineno());
1.1707 -;}
1.1708 - break;
1.1709 -
1.1710 - case 41:
1.1711 -
1.1712 - {
1.1713 - menu_set_type((yyvsp[(1) - (3)].id)->stype);
1.1714 - printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1.1715 - zconf_curname(), zconf_lineno(),
1.1716 - (yyvsp[(1) - (3)].id)->stype);
1.1717 -;}
1.1718 - break;
1.1719 -
1.1720 - case 42:
1.1721 -
1.1722 - {
1.1723 - menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
1.1724 - printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1.1725 -;}
1.1726 - break;
1.1727 -
1.1728 - case 43:
1.1729 -
1.1730 - {
1.1731 - menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr));
1.1732 - if ((yyvsp[(1) - (4)].id)->stype != S_UNKNOWN)
1.1733 - menu_set_type((yyvsp[(1) - (4)].id)->stype);
1.1734 - printd(DEBUG_PARSE, "%s:%d:default(%u)\n",
1.1735 - zconf_curname(), zconf_lineno(),
1.1736 - (yyvsp[(1) - (4)].id)->stype);
1.1737 -;}
1.1738 - break;
1.1739 -
1.1740 - case 44:
1.1741 -
1.1742 - {
1.1743 - menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
1.1744 - printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
1.1745 -;}
1.1746 - break;
1.1747 -
1.1748 - case 45:
1.1749 -
1.1750 - {
1.1751 - menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr));
1.1752 - printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno());
1.1753 -;}
1.1754 - break;
1.1755 -
1.1756 - case 48:
1.1757 -
1.1758 - {
1.1759 - struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string)));
1.1760 - if (id && id->flags & TF_OPTION)
1.1761 - menu_add_option(id->token, (yyvsp[(3) - (3)].string));
1.1762 - else
1.1763 - zconfprint("warning: ignoring unknown option %s", (yyvsp[(2) - (3)].string));
1.1764 - free((yyvsp[(2) - (3)].string));
1.1765 -;}
1.1766 - break;
1.1767 -
1.1768 - case 49:
1.1769 -
1.1770 - { (yyval.string) = NULL; ;}
1.1771 - break;
1.1772 -
1.1773 - case 50:
1.1774 -
1.1775 - { (yyval.string) = (yyvsp[(2) - (2)].string); ;}
1.1776 - break;
1.1777 -
1.1778 - case 51:
1.1779 -
1.1780 - {
1.1781 - struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE);
1.1782 - sym->flags |= SYMBOL_AUTO;
1.1783 - menu_add_entry(sym);
1.1784 - menu_add_expr(P_CHOICE, NULL, NULL);
1.1785 - printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
1.1786 -;}
1.1787 - break;
1.1788 -
1.1789 - case 52:
1.1790 -
1.1791 - {
1.1792 - (yyval.menu) = menu_add_menu();
1.1793 -;}
1.1794 - break;
1.1795 -
1.1796 - case 53:
1.1797 -
1.1798 - {
1.1799 - if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) {
1.1800 - menu_end_menu();
1.1801 - printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno());
1.1802 - }
1.1803 -;}
1.1804 - break;
1.1805 -
1.1806 - case 61:
1.1807 -
1.1808 - {
1.1809 - menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr));
1.1810 - printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno());
1.1811 -;}
1.1812 - break;
1.1813 -
1.1814 - case 62:
1.1815 -
1.1816 - {
1.1817 - if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) {
1.1818 - menu_set_type((yyvsp[(1) - (3)].id)->stype);
1.1819 - printd(DEBUG_PARSE, "%s:%d:type(%u)\n",
1.1820 - zconf_curname(), zconf_lineno(),
1.1821 - (yyvsp[(1) - (3)].id)->stype);
1.1822 - } else
1.1823 - YYERROR;
1.1824 -;}
1.1825 - break;
1.1826 -
1.1827 - case 63:
1.1828 -
1.1829 - {
1.1830 - current_entry->sym->flags |= SYMBOL_OPTIONAL;
1.1831 - printd(DEBUG_PARSE, "%s:%d:optional\n", zconf_curname(), zconf_lineno());
1.1832 -;}
1.1833 - break;
1.1834 -
1.1835 - case 64:
1.1836 -
1.1837 - {
1.1838 - if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) {
1.1839 - menu_add_symbol(P_DEFAULT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr));
1.1840 - printd(DEBUG_PARSE, "%s:%d:default\n",
1.1841 - zconf_curname(), zconf_lineno());
1.1842 - } else
1.1843 - YYERROR;
1.1844 -;}
1.1845 - break;
1.1846 -
1.1847 - case 67:
1.1848 -
1.1849 - {
1.1850 - printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
1.1851 - menu_add_entry(NULL);
1.1852 - menu_add_dep((yyvsp[(2) - (3)].expr));
1.1853 - (yyval.menu) = menu_add_menu();
1.1854 -;}
1.1855 - break;
1.1856 -
1.1857 - case 68:
1.1858 -
1.1859 - {
1.1860 - if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) {
1.1861 - menu_end_menu();
1.1862 - printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno());
1.1863 - }
1.1864 -;}
1.1865 - break;
1.1866 -
1.1867 - case 74:
1.1868 -
1.1869 - {
1.1870 - menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1.1871 -;}
1.1872 - break;
1.1873 -
1.1874 - case 75:
1.1875 -
1.1876 - {
1.1877 - menu_add_entry(NULL);
1.1878 - menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL);
1.1879 - printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno());
1.1880 -;}
1.1881 - break;
1.1882 -
1.1883 - case 76:
1.1884 -
1.1885 - {
1.1886 - (yyval.menu) = menu_add_menu();
1.1887 -;}
1.1888 - break;
1.1889 -
1.1890 - case 77:
1.1891 -
1.1892 - {
1.1893 - if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) {
1.1894 - menu_end_menu();
1.1895 - printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno());
1.1896 - }
1.1897 -;}
1.1898 - break;
1.1899 -
1.1900 - case 83:
1.1901 -
1.1902 - {
1.1903 - printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string));
1.1904 - zconf_nextfile((yyvsp[(2) - (3)].string));
1.1905 -;}
1.1906 - break;
1.1907 -
1.1908 - case 84:
1.1909 -
1.1910 - {
1.1911 - menu_add_entry(NULL);
1.1912 - menu_add_prompt(P_COMMENT, (yyvsp[(2) - (3)].string), NULL);
1.1913 - printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno());
1.1914 -;}
1.1915 - break;
1.1916 -
1.1917 - case 85:
1.1918 -
1.1919 - {
1.1920 - menu_end_entry();
1.1921 -;}
1.1922 - break;
1.1923 -
1.1924 - case 86:
1.1925 -
1.1926 - {
1.1927 - printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno());
1.1928 - zconf_starthelp();
1.1929 -;}
1.1930 - break;
1.1931 -
1.1932 - case 87:
1.1933 -
1.1934 - {
1.1935 - current_entry->help = (yyvsp[(2) - (2)].string);
1.1936 -;}
1.1937 - break;
1.1938 -
1.1939 - case 92:
1.1940 -
1.1941 - {
1.1942 - menu_add_dep((yyvsp[(3) - (4)].expr));
1.1943 - printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
1.1944 -;}
1.1945 - break;
1.1946 -
1.1947 - case 96:
1.1948 -
1.1949 - {
1.1950 - menu_add_visibility((yyvsp[(2) - (2)].expr));
1.1951 -;}
1.1952 - break;
1.1953 -
1.1954 - case 98:
1.1955 -
1.1956 - {
1.1957 - menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr));
1.1958 -;}
1.1959 - break;
1.1960 -
1.1961 - case 101:
1.1962 -
1.1963 - { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1.1964 - break;
1.1965 -
1.1966 - case 102:
1.1967 -
1.1968 - { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1.1969 - break;
1.1970 -
1.1971 - case 103:
1.1972 -
1.1973 - { (yyval.id) = (yyvsp[(1) - (2)].id); ;}
1.1974 - break;
1.1975 -
1.1976 - case 106:
1.1977 -
1.1978 - { (yyval.expr) = NULL; ;}
1.1979 - break;
1.1980 -
1.1981 - case 107:
1.1982 -
1.1983 - { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;}
1.1984 - break;
1.1985 -
1.1986 - case 108:
1.1987 -
1.1988 - { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;}
1.1989 - break;
1.1990 -
1.1991 - case 109:
1.1992 -
1.1993 - { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
1.1994 - break;
1.1995 -
1.1996 - case 110:
1.1997 -
1.1998 - { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;}
1.1999 - break;
1.2000 -
1.2001 - case 111:
1.2002 -
1.2003 - { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;}
1.2004 - break;
1.2005 -
1.2006 - case 112:
1.2007 -
1.2008 - { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;}
1.2009 - break;
1.2010 -
1.2011 - case 113:
1.2012 -
1.2013 - { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
1.2014 - break;
1.2015 -
1.2016 - case 114:
1.2017 -
1.2018 - { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;}
1.2019 - break;
1.2020 -
1.2021 - case 115:
1.2022 -
1.2023 - { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;}
1.2024 - break;
1.2025 -
1.2026 - case 116:
1.2027 -
1.2028 - { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;}
1.2029 - break;
1.2030 -
1.2031 - case 117:
1.2032 -
1.2033 - { (yyval.string) = NULL; ;}
1.2034 - break;
1.2035 -
1.2036 -
1.2037 -
1.2038 - default: break;
1.2039 - }
1.2040 - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1.2041 -
1.2042 - YYPOPSTACK (yylen);
1.2043 - yylen = 0;
1.2044 - YY_STACK_PRINT (yyss, yyssp);
1.2045 -
1.2046 - *++yyvsp = yyval;
1.2047 -
1.2048 - /* Now `shift' the result of the reduction. Determine what state
1.2049 - that goes to, based on the state we popped back to and the rule
1.2050 - number reduced by. */
1.2051 -
1.2052 - yyn = yyr1[yyn];
1.2053 -
1.2054 - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1.2055 - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1.2056 - yystate = yytable[yystate];
1.2057 - else
1.2058 - yystate = yydefgoto[yyn - YYNTOKENS];
1.2059 -
1.2060 - goto yynewstate;
1.2061 -
1.2062 -
1.2063 -/*------------------------------------.
1.2064 -| yyerrlab -- here on detecting error |
1.2065 -`------------------------------------*/
1.2066 -yyerrlab:
1.2067 - /* If not already recovering from an error, report this error. */
1.2068 - if (!yyerrstatus)
1.2069 - {
1.2070 - ++yynerrs;
1.2071 -#if ! YYERROR_VERBOSE
1.2072 - yyerror (YY_("syntax error"));
1.2073 -#else
1.2074 - {
1.2075 - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1.2076 - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1.2077 - {
1.2078 - YYSIZE_T yyalloc = 2 * yysize;
1.2079 - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1.2080 - yyalloc = YYSTACK_ALLOC_MAXIMUM;
1.2081 - if (yymsg != yymsgbuf)
1.2082 - YYSTACK_FREE (yymsg);
1.2083 - yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1.2084 - if (yymsg)
1.2085 - yymsg_alloc = yyalloc;
1.2086 - else
1.2087 - {
1.2088 - yymsg = yymsgbuf;
1.2089 - yymsg_alloc = sizeof yymsgbuf;
1.2090 - }
1.2091 - }
1.2092 -
1.2093 - if (0 < yysize && yysize <= yymsg_alloc)
1.2094 - {
1.2095 - (void) yysyntax_error (yymsg, yystate, yychar);
1.2096 - yyerror (yymsg);
1.2097 - }
1.2098 - else
1.2099 - {
1.2100 - yyerror (YY_("syntax error"));
1.2101 - if (yysize != 0)
1.2102 - goto yyexhaustedlab;
1.2103 - }
1.2104 - }
1.2105 -#endif
1.2106 - }
1.2107 -
1.2108 -
1.2109 -
1.2110 - if (yyerrstatus == 3)
1.2111 - {
1.2112 - /* If just tried and failed to reuse lookahead token after an
1.2113 - error, discard it. */
1.2114 -
1.2115 - if (yychar <= YYEOF)
1.2116 - {
1.2117 - /* Return failure if at end of input. */
1.2118 - if (yychar == YYEOF)
1.2119 - YYABORT;
1.2120 - }
1.2121 - else
1.2122 - {
1.2123 - yydestruct ("Error: discarding",
1.2124 - yytoken, &yylval);
1.2125 - yychar = YYEMPTY;
1.2126 - }
1.2127 - }
1.2128 -
1.2129 - /* Else will try to reuse lookahead token after shifting the error
1.2130 - token. */
1.2131 - goto yyerrlab1;
1.2132 -
1.2133 -
1.2134 -/*---------------------------------------------------.
1.2135 -| yyerrorlab -- error raised explicitly by YYERROR. |
1.2136 -`---------------------------------------------------*/
1.2137 -yyerrorlab:
1.2138 -
1.2139 - /* Pacify compilers like GCC when the user code never invokes
1.2140 - YYERROR and the label yyerrorlab therefore never appears in user
1.2141 - code. */
1.2142 - if (/*CONSTCOND*/ 0)
1.2143 - goto yyerrorlab;
1.2144 -
1.2145 - /* Do not reclaim the symbols of the rule which action triggered
1.2146 - this YYERROR. */
1.2147 - YYPOPSTACK (yylen);
1.2148 - yylen = 0;
1.2149 - YY_STACK_PRINT (yyss, yyssp);
1.2150 - yystate = *yyssp;
1.2151 - goto yyerrlab1;
1.2152 -
1.2153 -
1.2154 -/*-------------------------------------------------------------.
1.2155 -| yyerrlab1 -- common code for both syntax error and YYERROR. |
1.2156 -`-------------------------------------------------------------*/
1.2157 -yyerrlab1:
1.2158 - yyerrstatus = 3; /* Each real token shifted decrements this. */
1.2159 -
1.2160 - for (;;)
1.2161 - {
1.2162 - yyn = yypact[yystate];
1.2163 - if (yyn != YYPACT_NINF)
1.2164 - {
1.2165 - yyn += YYTERROR;
1.2166 - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1.2167 - {
1.2168 - yyn = yytable[yyn];
1.2169 - if (0 < yyn)
1.2170 - break;
1.2171 - }
1.2172 - }
1.2173 -
1.2174 - /* Pop the current state because it cannot handle the error token. */
1.2175 - if (yyssp == yyss)
1.2176 - YYABORT;
1.2177 -
1.2178 -
1.2179 - yydestruct ("Error: popping",
1.2180 - yystos[yystate], yyvsp);
1.2181 - YYPOPSTACK (1);
1.2182 - yystate = *yyssp;
1.2183 - YY_STACK_PRINT (yyss, yyssp);
1.2184 - }
1.2185 -
1.2186 - *++yyvsp = yylval;
1.2187 -
1.2188 -
1.2189 - /* Shift the error token. */
1.2190 - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1.2191 -
1.2192 - yystate = yyn;
1.2193 - goto yynewstate;
1.2194 -
1.2195 -
1.2196 -/*-------------------------------------.
1.2197 -| yyacceptlab -- YYACCEPT comes here. |
1.2198 -`-------------------------------------*/
1.2199 -yyacceptlab:
1.2200 - yyresult = 0;
1.2201 - goto yyreturn;
1.2202 -
1.2203 -/*-----------------------------------.
1.2204 -| yyabortlab -- YYABORT comes here. |
1.2205 -`-----------------------------------*/
1.2206 -yyabortlab:
1.2207 - yyresult = 1;
1.2208 - goto yyreturn;
1.2209 -
1.2210 -#if !defined(yyoverflow) || YYERROR_VERBOSE
1.2211 -/*-------------------------------------------------.
1.2212 -| yyexhaustedlab -- memory exhaustion comes here. |
1.2213 -`-------------------------------------------------*/
1.2214 -yyexhaustedlab:
1.2215 - yyerror (YY_("memory exhausted"));
1.2216 - yyresult = 2;
1.2217 - /* Fall through. */
1.2218 -#endif
1.2219 -
1.2220 -yyreturn:
1.2221 - if (yychar != YYEMPTY)
1.2222 - yydestruct ("Cleanup: discarding lookahead",
1.2223 - yytoken, &yylval);
1.2224 - /* Do not reclaim the symbols of the rule which action triggered
1.2225 - this YYABORT or YYACCEPT. */
1.2226 - YYPOPSTACK (yylen);
1.2227 - YY_STACK_PRINT (yyss, yyssp);
1.2228 - while (yyssp != yyss)
1.2229 - {
1.2230 - yydestruct ("Cleanup: popping",
1.2231 - yystos[*yyssp], yyvsp);
1.2232 - YYPOPSTACK (1);
1.2233 - }
1.2234 -#ifndef yyoverflow
1.2235 - if (yyss != yyssa)
1.2236 - YYSTACK_FREE (yyss);
1.2237 -#endif
1.2238 -#if YYERROR_VERBOSE
1.2239 - if (yymsg != yymsgbuf)
1.2240 - YYSTACK_FREE (yymsg);
1.2241 -#endif
1.2242 - /* Make sure YYID is used. */
1.2243 - return YYID (yyresult);
1.2244 -}
1.2245 -
1.2246 -
1.2247 -
1.2248 -
1.2249 -
1.2250 -void conf_parse(const char *name)
1.2251 -{
1.2252 - struct symbol *sym;
1.2253 - int i;
1.2254 -
1.2255 - zconf_initscan(name);
1.2256 -
1.2257 - sym_init();
1.2258 - _menu_init();
1.2259 - modules_sym = sym_lookup(NULL, 0);
1.2260 - modules_sym->type = S_BOOLEAN;
1.2261 - modules_sym->flags |= SYMBOL_AUTO;
1.2262 - rootmenu.prompt = menu_add_prompt(P_MENU, PACKAGE " Configuration", NULL);
1.2263 -
1.2264 -#if YYDEBUG
1.2265 - if (getenv("ZCONF_DEBUG"))
1.2266 - zconfdebug = 1;
1.2267 -#endif
1.2268 - zconfparse();
1.2269 - if (zconfnerrs)
1.2270 - exit(1);
1.2271 - if (!modules_sym->prop) {
1.2272 - struct property *prop;
1.2273 -
1.2274 - prop = prop_alloc(P_DEFAULT, modules_sym);
1.2275 - prop->expr = expr_alloc_symbol(sym_lookup("MODULES", 0));
1.2276 - }
1.2277 -
1.2278 - rootmenu.prompt->text = _(rootmenu.prompt->text);
1.2279 - rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
1.2280 -
1.2281 - menu_finalize(&rootmenu);
1.2282 - for_all_symbols(i, sym) {
1.2283 - if (sym_check_deps(sym))
1.2284 - zconfnerrs++;
1.2285 - }
1.2286 - if (zconfnerrs)
1.2287 - exit(1);
1.2288 - sym_set_change_count(1);
1.2289 -}
1.2290 -
1.2291 -static const char *zconf_tokenname(int token)
1.2292 -{
1.2293 - switch (token) {
1.2294 - case T_MENU: return "menu";
1.2295 - case T_ENDMENU: return "endmenu";
1.2296 - case T_CHOICE: return "choice";
1.2297 - case T_ENDCHOICE: return "endchoice";
1.2298 - case T_IF: return "if";
1.2299 - case T_ENDIF: return "endif";
1.2300 - case T_DEPENDS: return "depends";
1.2301 - case T_VISIBLE: return "visible";
1.2302 - }
1.2303 - return "<token>";
1.2304 -}
1.2305 -
1.2306 -static bool zconf_endtoken(struct kconf_id *id, int starttoken, int endtoken)
1.2307 -{
1.2308 - if (id->token != endtoken) {
1.2309 - zconf_error("unexpected '%s' within %s block",
1.2310 - kconf_id_strings + id->name, zconf_tokenname(starttoken));
1.2311 - zconfnerrs++;
1.2312 - return false;
1.2313 - }
1.2314 - if (current_menu->file != current_file) {
1.2315 - zconf_error("'%s' in different file than '%s'",
1.2316 - kconf_id_strings + id->name, zconf_tokenname(starttoken));
1.2317 - fprintf(stderr, "%s:%d: location of the '%s'\n",
1.2318 - current_menu->file->name, current_menu->lineno,
1.2319 - zconf_tokenname(starttoken));
1.2320 - zconfnerrs++;
1.2321 - return false;
1.2322 - }
1.2323 - return true;
1.2324 -}
1.2325 -
1.2326 -static void zconfprint(const char *err, ...)
1.2327 -{
1.2328 - va_list ap;
1.2329 -
1.2330 - fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
1.2331 - va_start(ap, err);
1.2332 - vfprintf(stderr, err, ap);
1.2333 - va_end(ap);
1.2334 - fprintf(stderr, "\n");
1.2335 -}
1.2336 -
1.2337 -static void zconf_error(const char *err, ...)
1.2338 -{
1.2339 - va_list ap;
1.2340 -
1.2341 - zconfnerrs++;
1.2342 - fprintf(stderr, "%s:%d: ", zconf_curname(), zconf_lineno());
1.2343 - va_start(ap, err);
1.2344 - vfprintf(stderr, err, ap);
1.2345 - va_end(ap);
1.2346 - fprintf(stderr, "\n");
1.2347 -}
1.2348 -
1.2349 -static void zconferror(const char *err)
1.2350 -{
1.2351 -#if YYDEBUG
1.2352 - fprintf(stderr, "%s:%d: %s\n", zconf_curname(), zconf_lineno() + 1, err);
1.2353 -#endif
1.2354 -}
1.2355 -
1.2356 -static void print_quoted_string(FILE *out, const char *str)
1.2357 -{
1.2358 - const char *p;
1.2359 - int len;
1.2360 -
1.2361 - putc('"', out);
1.2362 - while ((p = strchr(str, '"'))) {
1.2363 - len = p - str;
1.2364 - if (len)
1.2365 - fprintf(out, "%.*s", len, str);
1.2366 - fputs("\\\"", out);
1.2367 - str = p + 1;
1.2368 - }
1.2369 - fputs(str, out);
1.2370 - putc('"', out);
1.2371 -}
1.2372 -
1.2373 -static void print_symbol(FILE *out, struct menu *menu)
1.2374 -{
1.2375 - struct symbol *sym = menu->sym;
1.2376 - struct property *prop;
1.2377 -
1.2378 - if (sym_is_choice(sym))
1.2379 - fprintf(out, "\nchoice\n");
1.2380 - else
1.2381 - fprintf(out, "\nconfig %s\n", sym->name);
1.2382 - switch (sym->type) {
1.2383 - case S_BOOLEAN:
1.2384 - fputs(" boolean\n", out);
1.2385 - break;
1.2386 - case S_TRISTATE:
1.2387 - fputs(" tristate\n", out);
1.2388 - break;
1.2389 - case S_STRING:
1.2390 - fputs(" string\n", out);
1.2391 - break;
1.2392 - case S_INT:
1.2393 - fputs(" integer\n", out);
1.2394 - break;
1.2395 - case S_HEX:
1.2396 - fputs(" hex\n", out);
1.2397 - break;
1.2398 - default:
1.2399 - fputs(" ???\n", out);
1.2400 - break;
1.2401 - }
1.2402 - for (prop = sym->prop; prop; prop = prop->next) {
1.2403 - if (prop->menu != menu)
1.2404 - continue;
1.2405 - switch (prop->type) {
1.2406 - case P_PROMPT:
1.2407 - fputs(" prompt ", out);
1.2408 - print_quoted_string(out, prop->text);
1.2409 - if (!expr_is_yes(prop->visible.expr)) {
1.2410 - fputs(" if ", out);
1.2411 - expr_fprint(prop->visible.expr, out);
1.2412 - }
1.2413 - fputc('\n', out);
1.2414 - break;
1.2415 - case P_DEFAULT:
1.2416 - fputs( " default ", out);
1.2417 - expr_fprint(prop->expr, out);
1.2418 - if (!expr_is_yes(prop->visible.expr)) {
1.2419 - fputs(" if ", out);
1.2420 - expr_fprint(prop->visible.expr, out);
1.2421 - }
1.2422 - fputc('\n', out);
1.2423 - break;
1.2424 - case P_CHOICE:
1.2425 - fputs(" #choice value\n", out);
1.2426 - break;
1.2427 - case P_SELECT:
1.2428 - fputs( " select ", out);
1.2429 - expr_fprint(prop->expr, out);
1.2430 - fputc('\n', out);
1.2431 - break;
1.2432 - case P_RANGE:
1.2433 - fputs( " range ", out);
1.2434 - expr_fprint(prop->expr, out);
1.2435 - fputc('\n', out);
1.2436 - break;
1.2437 - case P_MENU:
1.2438 - fputs( " menu ", out);
1.2439 - print_quoted_string(out, prop->text);
1.2440 - fputc('\n', out);
1.2441 - break;
1.2442 - default:
1.2443 - fprintf(out, " unknown prop %d!\n", prop->type);
1.2444 - break;
1.2445 - }
1.2446 - }
1.2447 - if (menu->help) {
1.2448 - int len = strlen(menu->help);
1.2449 - while (menu->help[--len] == '\n')
1.2450 - menu->help[len] = 0;
1.2451 - fprintf(out, " help\n%s\n", menu->help);
1.2452 - }
1.2453 -}
1.2454 -
1.2455 -void zconfdump(FILE *out)
1.2456 -{
1.2457 - struct property *prop;
1.2458 - struct symbol *sym;
1.2459 - struct menu *menu;
1.2460 -
1.2461 - menu = rootmenu.list;
1.2462 - while (menu) {
1.2463 - if ((sym = menu->sym))
1.2464 - print_symbol(out, menu);
1.2465 - else if ((prop = menu->prompt)) {
1.2466 - switch (prop->type) {
1.2467 - case P_COMMENT:
1.2468 - fputs("\ncomment ", out);
1.2469 - print_quoted_string(out, prop->text);
1.2470 - fputs("\n", out);
1.2471 - break;
1.2472 - case P_MENU:
1.2473 - fputs("\nmenu ", out);
1.2474 - print_quoted_string(out, prop->text);
1.2475 - fputs("\n", out);
1.2476 - break;
1.2477 - default:
1.2478 - ;
1.2479 - }
1.2480 - if (!expr_is_yes(prop->visible.expr)) {
1.2481 - fputs(" depends ", out);
1.2482 - expr_fprint(prop->visible.expr, out);
1.2483 - fputc('\n', out);
1.2484 - }
1.2485 - }
1.2486 -
1.2487 - if (menu->list)
1.2488 - menu = menu->list;
1.2489 - else if (menu->next)
1.2490 - menu = menu->next;
1.2491 - else while ((menu = menu->parent)) {
1.2492 - if (menu->prompt && menu->prompt->type == P_MENU)
1.2493 - fputs("\nendmenu\n", out);
1.2494 - if (menu->next) {
1.2495 - menu = menu->next;
1.2496 - break;
1.2497 - }
1.2498 - }
1.2499 - }
1.2500 -}
1.2501 -
1.2502 -#include "lex.zconf.c"
1.2503 -#include "util.c"
1.2504 -#include "confdata.c"
1.2505 -#include "expr.c"
1.2506 -#include "symbol.c"
1.2507 -#include "menu.c"
1.2508 -