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