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