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