Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1 | /* A Bison parser, made by GNU Bison 2.5. */ |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 2 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 3 | /* Bison implementation for Yacc-like parsers in C |
Patrick Georgi | 114e7b2 | 2010-05-05 11:19:50 +0000 | [diff] [blame] | 4 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 5 | Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. |
Patrick Georgi | 114e7b2 | 2010-05-05 11:19:50 +0000 | [diff] [blame] | 6 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 7 | This program is free software: you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by |
| 9 | the Free Software Foundation, either version 3 of the License, or |
| 10 | (at your option) any later version. |
Patrick Georgi | 114e7b2 | 2010-05-05 11:19:50 +0000 | [diff] [blame] | 11 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 12 | This program is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU General Public License for more details. |
Patrick Georgi | 114e7b2 | 2010-05-05 11:19:50 +0000 | [diff] [blame] | 16 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 17 | You should have received a copy of the GNU General Public License |
| 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
| 19 | |
| 20 | /* As a special exception, you may create a larger work that contains |
| 21 | part or all of the Bison parser skeleton and distribute that work |
| 22 | under terms of your choice, so long as that work isn't itself a |
| 23 | parser generator using the skeleton or a modified version thereof |
| 24 | as a parser skeleton. Alternatively, if you modify or redistribute |
| 25 | the parser skeleton itself, you may (at your option) remove this |
| 26 | special exception, which will cause the skeleton and the resulting |
| 27 | Bison output files to be licensed under the GNU General Public |
| 28 | License without this special exception. |
Patrick Georgi | 114e7b2 | 2010-05-05 11:19:50 +0000 | [diff] [blame] | 29 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 30 | This special exception was added by the Free Software Foundation in |
| 31 | version 2.2 of Bison. */ |
| 32 | |
| 33 | /* C LALR(1) parser skeleton written by Richard Stallman, by |
| 34 | simplifying the original so-called "semantic" parser. */ |
| 35 | |
| 36 | /* All symbols defined below should begin with yy or YY, to avoid |
| 37 | infringing on user name space. This should be done even for local |
| 38 | variables, as they might otherwise be expanded by user macros. |
| 39 | There are some unavoidable exceptions within include files to |
| 40 | define necessary library symbols; they are noted "INFRINGES ON |
| 41 | USER NAME SPACE" below. */ |
| 42 | |
| 43 | /* Identify Bison output. */ |
| 44 | #define YYBISON 1 |
| 45 | |
| 46 | /* Bison version. */ |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 47 | #define YYBISON_VERSION "2.5" |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 48 | |
| 49 | /* Skeleton name. */ |
| 50 | #define YYSKELETON_NAME "yacc.c" |
| 51 | |
| 52 | /* Pure parsers. */ |
| 53 | #define YYPURE 0 |
| 54 | |
| 55 | /* Push parsers. */ |
| 56 | #define YYPUSH 0 |
| 57 | |
| 58 | /* Pull parsers. */ |
| 59 | #define YYPULL 1 |
| 60 | |
| 61 | /* Using locations. */ |
| 62 | #define YYLSP_NEEDED 0 |
| 63 | |
| 64 | |
| 65 | |
| 66 | /* Copy the first part of user declarations. */ |
| 67 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 68 | |
| 69 | /* |
| 70 | * sconfig, coreboot device tree compiler |
| 71 | * |
| 72 | * Copyright (C) 2010 coresystems GmbH |
| 73 | * written by Patrick Georgi <patrick.georgi@coresystems.de> |
| 74 | * |
| 75 | * This program is free software; you can redistribute it and/or modify |
| 76 | * it under the terms of the GNU General Public License as published by |
| 77 | * the Free Software Foundation; version 2 of the License. |
| 78 | * |
| 79 | * This program is distributed in the hope that it will be useful, |
| 80 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 81 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 82 | * GNU General Public License for more details. |
| 83 | * |
| 84 | * You should have received a copy of the GNU General Public License |
| 85 | * along with this program; if not, write to the Free Software |
| 86 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA |
| 87 | */ |
| 88 | |
Patrick Georgi | 114e7b2 | 2010-05-05 11:19:50 +0000 | [diff] [blame] | 89 | #include "sconfig.h" |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 90 | |
Patrick Georgi | 68befd5 | 2010-05-05 12:05:25 +0000 | [diff] [blame] | 91 | static struct device *cur_parent, *cur_bus; |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 92 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 93 | |
| 94 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 95 | |
| 96 | /* Enabling traces. */ |
| 97 | #ifndef YYDEBUG |
| 98 | # define YYDEBUG 0 |
| 99 | #endif |
| 100 | |
| 101 | /* Enabling verbose error messages. */ |
| 102 | #ifdef YYERROR_VERBOSE |
| 103 | # undef YYERROR_VERBOSE |
| 104 | # define YYERROR_VERBOSE 1 |
| 105 | #else |
| 106 | # define YYERROR_VERBOSE 0 |
| 107 | #endif |
| 108 | |
| 109 | /* Enabling the token table. */ |
| 110 | #ifndef YYTOKEN_TABLE |
| 111 | # define YYTOKEN_TABLE 0 |
| 112 | #endif |
| 113 | |
| 114 | |
| 115 | /* Tokens. */ |
| 116 | #ifndef YYTOKENTYPE |
| 117 | # define YYTOKENTYPE |
| 118 | /* Put the tokens into the symbol table, so that GDB and other debuggers |
| 119 | know about them. */ |
| 120 | enum yytokentype { |
| 121 | CHIP = 258, |
| 122 | DEVICE = 259, |
| 123 | REGISTER = 260, |
| 124 | BOOL = 261, |
| 125 | BUS = 262, |
| 126 | RESOURCE = 263, |
| 127 | END = 264, |
| 128 | EQUALS = 265, |
| 129 | HEX = 266, |
| 130 | STRING = 267, |
| 131 | PCI = 268, |
| 132 | PNP = 269, |
| 133 | I2C = 270, |
| 134 | APIC = 271, |
| 135 | APIC_CLUSTER = 272, |
| 136 | PCI_DOMAIN = 273, |
| 137 | IRQ = 274, |
| 138 | DRQ = 275, |
| 139 | IO = 276, |
Sven Schnelle | 270a908 | 2011-03-01 19:58:15 +0000 | [diff] [blame] | 140 | NUMBER = 277, |
| 141 | SUBSYSTEMID = 278, |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 142 | INHERIT = 279, |
| 143 | IOAPIC_IRQ = 280, |
| 144 | IOAPIC = 281, |
| 145 | PCIINT = 282 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 146 | }; |
| 147 | #endif |
| 148 | |
| 149 | |
| 150 | |
| 151 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
| 152 | typedef union YYSTYPE |
| 153 | { |
| 154 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 155 | |
| 156 | struct device *device; |
| 157 | char *string; |
| 158 | int number; |
| 159 | |
| 160 | |
| 161 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 162 | } YYSTYPE; |
| 163 | # define YYSTYPE_IS_TRIVIAL 1 |
| 164 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ |
| 165 | # define YYSTYPE_IS_DECLARED 1 |
| 166 | #endif |
| 167 | |
| 168 | |
| 169 | /* Copy the second part of user declarations. */ |
| 170 | |
| 171 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 172 | |
| 173 | #ifdef short |
| 174 | # undef short |
| 175 | #endif |
| 176 | |
| 177 | #ifdef YYTYPE_UINT8 |
| 178 | typedef YYTYPE_UINT8 yytype_uint8; |
| 179 | #else |
| 180 | typedef unsigned char yytype_uint8; |
| 181 | #endif |
| 182 | |
| 183 | #ifdef YYTYPE_INT8 |
| 184 | typedef YYTYPE_INT8 yytype_int8; |
| 185 | #elif (defined __STDC__ || defined __C99__FUNC__ \ |
| 186 | || defined __cplusplus || defined _MSC_VER) |
| 187 | typedef signed char yytype_int8; |
| 188 | #else |
| 189 | typedef short int yytype_int8; |
| 190 | #endif |
| 191 | |
| 192 | #ifdef YYTYPE_UINT16 |
| 193 | typedef YYTYPE_UINT16 yytype_uint16; |
| 194 | #else |
| 195 | typedef unsigned short int yytype_uint16; |
| 196 | #endif |
| 197 | |
| 198 | #ifdef YYTYPE_INT16 |
| 199 | typedef YYTYPE_INT16 yytype_int16; |
| 200 | #else |
| 201 | typedef short int yytype_int16; |
| 202 | #endif |
| 203 | |
| 204 | #ifndef YYSIZE_T |
| 205 | # ifdef __SIZE_TYPE__ |
| 206 | # define YYSIZE_T __SIZE_TYPE__ |
| 207 | # elif defined size_t |
| 208 | # define YYSIZE_T size_t |
| 209 | # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ |
| 210 | || defined __cplusplus || defined _MSC_VER) |
| 211 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
| 212 | # define YYSIZE_T size_t |
| 213 | # else |
| 214 | # define YYSIZE_T unsigned int |
| 215 | # endif |
| 216 | #endif |
| 217 | |
| 218 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
| 219 | |
| 220 | #ifndef YY_ |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 221 | # if defined YYENABLE_NLS && YYENABLE_NLS |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 222 | # if ENABLE_NLS |
| 223 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
| 224 | # define YY_(msgid) dgettext ("bison-runtime", msgid) |
| 225 | # endif |
| 226 | # endif |
| 227 | # ifndef YY_ |
| 228 | # define YY_(msgid) msgid |
| 229 | # endif |
| 230 | #endif |
| 231 | |
| 232 | /* Suppress unused-variable warnings by "using" E. */ |
| 233 | #if ! defined lint || defined __GNUC__ |
| 234 | # define YYUSE(e) ((void) (e)) |
| 235 | #else |
| 236 | # define YYUSE(e) /* empty */ |
| 237 | #endif |
| 238 | |
| 239 | /* Identity function, used to suppress warnings about constant conditions. */ |
| 240 | #ifndef lint |
| 241 | # define YYID(n) (n) |
| 242 | #else |
| 243 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 244 | || defined __cplusplus || defined _MSC_VER) |
| 245 | static int |
| 246 | YYID (int yyi) |
| 247 | #else |
| 248 | static int |
| 249 | YYID (yyi) |
| 250 | int yyi; |
| 251 | #endif |
| 252 | { |
| 253 | return yyi; |
| 254 | } |
| 255 | #endif |
| 256 | |
| 257 | #if ! defined yyoverflow || YYERROR_VERBOSE |
| 258 | |
| 259 | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
| 260 | |
| 261 | # ifdef YYSTACK_USE_ALLOCA |
| 262 | # if YYSTACK_USE_ALLOCA |
| 263 | # ifdef __GNUC__ |
| 264 | # define YYSTACK_ALLOC __builtin_alloca |
| 265 | # elif defined __BUILTIN_VA_ARG_INCR |
| 266 | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ |
| 267 | # elif defined _AIX |
| 268 | # define YYSTACK_ALLOC __alloca |
| 269 | # elif defined _MSC_VER |
| 270 | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ |
| 271 | # define alloca _alloca |
| 272 | # else |
| 273 | # define YYSTACK_ALLOC alloca |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 274 | # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 275 | || defined __cplusplus || defined _MSC_VER) |
| 276 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 277 | # ifndef EXIT_SUCCESS |
| 278 | # define EXIT_SUCCESS 0 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 279 | # endif |
| 280 | # endif |
| 281 | # endif |
| 282 | # endif |
| 283 | # endif |
| 284 | |
| 285 | # ifdef YYSTACK_ALLOC |
| 286 | /* Pacify GCC's `empty if-body' warning. */ |
| 287 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) |
| 288 | # ifndef YYSTACK_ALLOC_MAXIMUM |
| 289 | /* The OS might guarantee only one guard page at the bottom of the stack, |
| 290 | and a page size can be as small as 4096 bytes. So we cannot safely |
| 291 | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number |
| 292 | to allow for a few compiler-allocated temporary stack slots. */ |
| 293 | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
| 294 | # endif |
| 295 | # else |
| 296 | # define YYSTACK_ALLOC YYMALLOC |
| 297 | # define YYSTACK_FREE YYFREE |
| 298 | # ifndef YYSTACK_ALLOC_MAXIMUM |
| 299 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
| 300 | # endif |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 301 | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 302 | && ! ((defined YYMALLOC || defined malloc) \ |
| 303 | && (defined YYFREE || defined free))) |
| 304 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 305 | # ifndef EXIT_SUCCESS |
| 306 | # define EXIT_SUCCESS 0 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 307 | # endif |
| 308 | # endif |
| 309 | # ifndef YYMALLOC |
| 310 | # define YYMALLOC malloc |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 311 | # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 312 | || defined __cplusplus || defined _MSC_VER) |
| 313 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
| 314 | # endif |
| 315 | # endif |
| 316 | # ifndef YYFREE |
| 317 | # define YYFREE free |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 318 | # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 319 | || defined __cplusplus || defined _MSC_VER) |
| 320 | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
| 321 | # endif |
| 322 | # endif |
| 323 | # endif |
| 324 | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ |
| 325 | |
| 326 | |
| 327 | #if (! defined yyoverflow \ |
| 328 | && (! defined __cplusplus \ |
| 329 | || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) |
| 330 | |
| 331 | /* A type that is properly aligned for any stack member. */ |
| 332 | union yyalloc |
| 333 | { |
| 334 | yytype_int16 yyss_alloc; |
| 335 | YYSTYPE yyvs_alloc; |
| 336 | }; |
| 337 | |
| 338 | /* The size of the maximum gap between one aligned stack and the next. */ |
| 339 | # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
| 340 | |
| 341 | /* The size of an array large to enough to hold all stacks, each with |
| 342 | N elements. */ |
| 343 | # define YYSTACK_BYTES(N) \ |
| 344 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ |
| 345 | + YYSTACK_GAP_MAXIMUM) |
| 346 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 347 | # define YYCOPY_NEEDED 1 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 348 | |
| 349 | /* Relocate STACK from its old location to the new one. The |
| 350 | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
| 351 | elements in the stack, and YYPTR gives the new location of the |
| 352 | stack. Advance YYPTR to a properly aligned location for the next |
| 353 | stack. */ |
| 354 | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
| 355 | do \ |
| 356 | { \ |
| 357 | YYSIZE_T yynewbytes; \ |
| 358 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
| 359 | Stack = &yyptr->Stack_alloc; \ |
| 360 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
| 361 | yyptr += yynewbytes / sizeof (*yyptr); \ |
| 362 | } \ |
| 363 | while (YYID (0)) |
| 364 | |
| 365 | #endif |
| 366 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 367 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
| 368 | /* Copy COUNT objects from FROM to TO. The source and destination do |
| 369 | not overlap. */ |
| 370 | # ifndef YYCOPY |
| 371 | # if defined __GNUC__ && 1 < __GNUC__ |
| 372 | # define YYCOPY(To, From, Count) \ |
| 373 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) |
| 374 | # else |
| 375 | # define YYCOPY(To, From, Count) \ |
| 376 | do \ |
| 377 | { \ |
| 378 | YYSIZE_T yyi; \ |
| 379 | for (yyi = 0; yyi < (Count); yyi++) \ |
| 380 | (To)[yyi] = (From)[yyi]; \ |
| 381 | } \ |
| 382 | while (YYID (0)) |
| 383 | # endif |
| 384 | # endif |
| 385 | #endif /* !YYCOPY_NEEDED */ |
| 386 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 387 | /* YYFINAL -- State number of the termination state. */ |
Patrick Georgi | 68befd5 | 2010-05-05 12:05:25 +0000 | [diff] [blame] | 388 | #define YYFINAL 3 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 389 | /* YYLAST -- Last index in YYTABLE. */ |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 390 | #define YYLAST 37 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 391 | |
| 392 | /* YYNTOKENS -- Number of terminals. */ |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 393 | #define YYNTOKENS 28 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 394 | /* YYNNTS -- Number of nonterminals. */ |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 395 | #define YYNNTS 13 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 396 | /* YYNRULES -- Number of rules. */ |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 397 | #define YYNRULES 22 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 398 | /* YYNRULES -- Number of states. */ |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 399 | #define YYNSTATES 41 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 400 | |
| 401 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
| 402 | #define YYUNDEFTOK 2 |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 403 | #define YYMAXUTOK 282 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 404 | |
| 405 | #define YYTRANSLATE(YYX) \ |
| 406 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
| 407 | |
| 408 | /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ |
| 409 | static const yytype_uint8 yytranslate[] = |
| 410 | { |
| 411 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 412 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 413 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 414 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 415 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 416 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 417 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 418 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 419 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 420 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 421 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 422 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 423 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 424 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 425 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 426 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 427 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 428 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 429 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 430 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 431 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 432 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 433 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 434 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 435 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 436 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
| 437 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 438 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
| 439 | 25, 26, 27 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 440 | }; |
| 441 | |
| 442 | #if YYDEBUG |
| 443 | /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in |
| 444 | YYRHS. */ |
| 445 | static const yytype_uint8 yyprhs[] = |
| 446 | { |
Patrick Georgi | 8f625f6 | 2010-05-05 13:13:47 +0000 | [diff] [blame] | 447 | 0, 0, 3, 4, 7, 10, 13, 16, 17, 20, |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 448 | 23, 26, 29, 32, 33, 34, 40, 41, 49, 54, |
| 449 | 59, 63, 68 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 450 | }; |
| 451 | |
| 452 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
| 453 | static const yytype_int8 yyrhs[] = |
| 454 | { |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 455 | 29, 0, -1, -1, 30, 33, -1, 31, 35, -1, |
| 456 | 31, 33, -1, 31, 38, -1, -1, 32, 35, -1, |
| 457 | 32, 33, -1, 32, 37, -1, 32, 39, -1, 32, |
| 458 | 40, -1, -1, -1, 3, 12, 34, 31, 9, -1, |
| 459 | -1, 4, 7, 22, 6, 36, 32, 9, -1, 8, |
| 460 | 22, 10, 22, -1, 5, 12, 10, 12, -1, 23, |
| 461 | 22, 22, -1, 23, 22, 22, 24, -1, 25, 22, |
| 462 | 27, 22, -1 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 463 | }; |
| 464 | |
| 465 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
Patrick Georgi | 114e7b2 | 2010-05-05 11:19:50 +0000 | [diff] [blame] | 466 | static const yytype_uint8 yyrline[] = |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 467 | { |
Sven Schnelle | 270a908 | 2011-03-01 19:58:15 +0000 | [diff] [blame] | 468 | 0, 35, 35, 35, 37, 37, 37, 37, 39, 39, |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 469 | 39, 39, 39, 39, 41, 41, 51, 51, 63, 66, |
| 470 | 69, 72, 75 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 471 | }; |
| 472 | #endif |
| 473 | |
| 474 | #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE |
| 475 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
| 476 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
| 477 | static const char *const yytname[] = |
| 478 | { |
| 479 | "$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL", |
| 480 | "BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI", "PNP", "I2C", |
| 481 | "APIC", "APIC_CLUSTER", "PCI_DOMAIN", "IRQ", "DRQ", "IO", "NUMBER", |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 482 | "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IOAPIC", "PCIINT", "$accept", |
| 483 | "devtree", "$@1", "chipchildren", "devicechildren", "chip", "@2", |
| 484 | "device", "@3", "resource", "registers", "subsystemid", "ioapic_irq", 0 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 485 | }; |
| 486 | #endif |
| 487 | |
| 488 | # ifdef YYPRINT |
| 489 | /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to |
| 490 | token YYLEX-NUM. */ |
| 491 | static const yytype_uint16 yytoknum[] = |
| 492 | { |
| 493 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
| 494 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 495 | 275, 276, 277, 278, 279, 280, 281, 282 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 496 | }; |
| 497 | # endif |
| 498 | |
| 499 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
| 500 | static const yytype_uint8 yyr1[] = |
| 501 | { |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 502 | 0, 28, 30, 29, 31, 31, 31, 31, 32, 32, |
| 503 | 32, 32, 32, 32, 34, 33, 36, 35, 37, 38, |
| 504 | 39, 39, 40 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 505 | }; |
| 506 | |
| 507 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
| 508 | static const yytype_uint8 yyr2[] = |
| 509 | { |
Patrick Georgi | 8f625f6 | 2010-05-05 13:13:47 +0000 | [diff] [blame] | 510 | 0, 2, 0, 2, 2, 2, 2, 0, 2, 2, |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 511 | 2, 2, 2, 0, 0, 5, 0, 7, 4, 4, |
| 512 | 3, 4, 4 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 513 | }; |
| 514 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 515 | /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. |
| 516 | Performed when YYTABLE doesn't specify something else to do. Zero |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 517 | means the default is an error. */ |
| 518 | static const yytype_uint8 yydefact[] = |
| 519 | { |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 520 | 2, 0, 0, 1, 0, 3, 14, 7, 0, 0, |
| 521 | 0, 15, 5, 4, 6, 0, 0, 0, 0, 16, |
| 522 | 19, 13, 0, 0, 17, 0, 0, 9, 8, 10, |
| 523 | 11, 12, 0, 0, 0, 0, 20, 0, 18, 21, |
| 524 | 22 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 525 | }; |
| 526 | |
| 527 | /* YYDEFGOTO[NTERM-NUM]. */ |
| 528 | static const yytype_int8 yydefgoto[] = |
| 529 | { |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 530 | -1, 1, 2, 8, 22, 5, 7, 13, 21, 29, |
| 531 | 14, 30, 31 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 532 | }; |
| 533 | |
| 534 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
| 535 | STATE-NUM. */ |
Sven Schnelle | 270a908 | 2011-03-01 19:58:15 +0000 | [diff] [blame] | 536 | #define YYPACT_NINF -9 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 537 | static const yytype_int8 yypact[] = |
| 538 | { |
Sven Schnelle | 270a908 | 2011-03-01 19:58:15 +0000 | [diff] [blame] | 539 | -9, 3, 1, -9, -2, -9, -9, -9, 4, 5, |
| 540 | -1, -9, -9, -9, -9, -8, 7, 9, 6, -9, |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 541 | -9, -9, -3, 2, -9, 8, 10, -9, -9, -9, |
| 542 | -9, -9, 11, 12, -4, 13, -5, 14, -9, -9, |
| 543 | -9 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 544 | }; |
| 545 | |
| 546 | /* YYPGOTO[NTERM-NUM]. */ |
| 547 | static const yytype_int8 yypgoto[] = |
| 548 | { |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 549 | -9, -9, -9, -9, -9, -6, -9, 15, -9, -9, |
| 550 | -9, -9, -9 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 551 | }; |
| 552 | |
| 553 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
| 554 | positive, shift that token. If negative, reduce the rule which |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 555 | number is the opposite. If YYTABLE_NINF, syntax error. */ |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 556 | #define YYTABLE_NINF -1 |
| 557 | static const yytype_uint8 yytable[] = |
| 558 | { |
Sven Schnelle | 270a908 | 2011-03-01 19:58:15 +0000 | [diff] [blame] | 559 | 4, 9, 12, 3, 4, 23, 24, 4, 9, 10, |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 560 | 6, 16, 15, 11, 17, 19, 27, 18, 20, 39, |
| 561 | 25, 35, 26, 37, 32, 0, 0, 0, 0, 0, |
| 562 | 33, 0, 34, 0, 36, 38, 40, 28 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 563 | }; |
| 564 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 565 | #define yypact_value_is_default(yystate) \ |
| 566 | ((yystate) == (-9)) |
| 567 | |
| 568 | #define yytable_value_is_error(yytable_value) \ |
| 569 | YYID (0) |
| 570 | |
Patrick Georgi | 8f625f6 | 2010-05-05 13:13:47 +0000 | [diff] [blame] | 571 | static const yytype_int8 yycheck[] = |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 572 | { |
Sven Schnelle | 270a908 | 2011-03-01 19:58:15 +0000 | [diff] [blame] | 573 | 3, 4, 8, 0, 3, 8, 9, 3, 4, 5, |
| 574 | 12, 12, 7, 9, 22, 6, 22, 10, 12, 24, |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 575 | 23, 10, 25, 27, 22, -1, -1, -1, -1, -1, |
| 576 | 22, -1, 22, -1, 22, 22, 22, 22 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 577 | }; |
| 578 | |
| 579 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
| 580 | symbol of state STATE-NUM. */ |
| 581 | static const yytype_uint8 yystos[] = |
| 582 | { |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 583 | 0, 29, 30, 0, 3, 33, 12, 34, 31, 4, |
| 584 | 5, 9, 33, 35, 38, 7, 12, 22, 10, 6, |
| 585 | 12, 36, 32, 8, 9, 23, 25, 33, 35, 37, |
| 586 | 39, 40, 22, 22, 22, 10, 22, 27, 22, 24, |
| 587 | 22 |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 588 | }; |
| 589 | |
| 590 | #define yyerrok (yyerrstatus = 0) |
| 591 | #define yyclearin (yychar = YYEMPTY) |
| 592 | #define YYEMPTY (-2) |
| 593 | #define YYEOF 0 |
| 594 | |
| 595 | #define YYACCEPT goto yyacceptlab |
| 596 | #define YYABORT goto yyabortlab |
| 597 | #define YYERROR goto yyerrorlab |
| 598 | |
| 599 | |
| 600 | /* Like YYERROR except do call yyerror. This remains here temporarily |
| 601 | to ease the transition to the new meaning of YYERROR, for GCC. |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 602 | Once GCC version 2 has supplanted version 1, this can go. However, |
| 603 | YYFAIL appears to be in use. Nevertheless, it is formally deprecated |
| 604 | in Bison 2.4.2's NEWS entry, where a plan to phase it out is |
| 605 | discussed. */ |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 606 | |
| 607 | #define YYFAIL goto yyerrlab |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 608 | #if defined YYFAIL |
| 609 | /* This is here to suppress warnings from the GCC cpp's |
| 610 | -Wunused-macros. Normally we don't worry about that warning, but |
| 611 | some users do, and we want to make it easy for users to remove |
| 612 | YYFAIL uses, which will produce warnings from Bison 2.5. */ |
| 613 | #endif |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 614 | |
| 615 | #define YYRECOVERING() (!!yyerrstatus) |
| 616 | |
| 617 | #define YYBACKUP(Token, Value) \ |
| 618 | do \ |
| 619 | if (yychar == YYEMPTY && yylen == 1) \ |
| 620 | { \ |
| 621 | yychar = (Token); \ |
| 622 | yylval = (Value); \ |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 623 | YYPOPSTACK (1); \ |
| 624 | goto yybackup; \ |
| 625 | } \ |
| 626 | else \ |
| 627 | { \ |
| 628 | yyerror (YY_("syntax error: cannot back up")); \ |
| 629 | YYERROR; \ |
| 630 | } \ |
| 631 | while (YYID (0)) |
| 632 | |
| 633 | |
| 634 | #define YYTERROR 1 |
| 635 | #define YYERRCODE 256 |
| 636 | |
| 637 | |
| 638 | /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. |
| 639 | If N is 0, then set CURRENT to the empty location which ends |
| 640 | the previous symbol: RHS[0] (always defined). */ |
| 641 | |
| 642 | #define YYRHSLOC(Rhs, K) ((Rhs)[K]) |
| 643 | #ifndef YYLLOC_DEFAULT |
| 644 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ |
| 645 | do \ |
| 646 | if (YYID (N)) \ |
| 647 | { \ |
| 648 | (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ |
| 649 | (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ |
| 650 | (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ |
| 651 | (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ |
| 652 | } \ |
| 653 | else \ |
| 654 | { \ |
| 655 | (Current).first_line = (Current).last_line = \ |
| 656 | YYRHSLOC (Rhs, 0).last_line; \ |
| 657 | (Current).first_column = (Current).last_column = \ |
| 658 | YYRHSLOC (Rhs, 0).last_column; \ |
| 659 | } \ |
| 660 | while (YYID (0)) |
| 661 | #endif |
| 662 | |
| 663 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 664 | /* This macro is provided for backward compatibility. */ |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 665 | |
| 666 | #ifndef YY_LOCATION_PRINT |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 667 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 668 | #endif |
| 669 | |
| 670 | |
| 671 | /* YYLEX -- calling `yylex' with the right arguments. */ |
| 672 | |
| 673 | #ifdef YYLEX_PARAM |
| 674 | # define YYLEX yylex (YYLEX_PARAM) |
| 675 | #else |
| 676 | # define YYLEX yylex () |
| 677 | #endif |
| 678 | |
| 679 | /* Enable debugging if requested. */ |
| 680 | #if YYDEBUG |
| 681 | |
| 682 | # ifndef YYFPRINTF |
| 683 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
| 684 | # define YYFPRINTF fprintf |
| 685 | # endif |
| 686 | |
| 687 | # define YYDPRINTF(Args) \ |
| 688 | do { \ |
| 689 | if (yydebug) \ |
| 690 | YYFPRINTF Args; \ |
| 691 | } while (YYID (0)) |
| 692 | |
| 693 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
| 694 | do { \ |
| 695 | if (yydebug) \ |
| 696 | { \ |
| 697 | YYFPRINTF (stderr, "%s ", Title); \ |
| 698 | yy_symbol_print (stderr, \ |
| 699 | Type, Value); \ |
| 700 | YYFPRINTF (stderr, "\n"); \ |
| 701 | } \ |
| 702 | } while (YYID (0)) |
| 703 | |
| 704 | |
| 705 | /*--------------------------------. |
| 706 | | Print this symbol on YYOUTPUT. | |
| 707 | `--------------------------------*/ |
| 708 | |
| 709 | /*ARGSUSED*/ |
| 710 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 711 | || defined __cplusplus || defined _MSC_VER) |
| 712 | static void |
| 713 | yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) |
| 714 | #else |
| 715 | static void |
| 716 | yy_symbol_value_print (yyoutput, yytype, yyvaluep) |
| 717 | FILE *yyoutput; |
| 718 | int yytype; |
| 719 | YYSTYPE const * const yyvaluep; |
| 720 | #endif |
| 721 | { |
| 722 | if (!yyvaluep) |
| 723 | return; |
| 724 | # ifdef YYPRINT |
| 725 | if (yytype < YYNTOKENS) |
| 726 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); |
| 727 | # else |
| 728 | YYUSE (yyoutput); |
| 729 | # endif |
| 730 | switch (yytype) |
| 731 | { |
| 732 | default: |
| 733 | break; |
| 734 | } |
| 735 | } |
| 736 | |
| 737 | |
| 738 | /*--------------------------------. |
| 739 | | Print this symbol on YYOUTPUT. | |
| 740 | `--------------------------------*/ |
| 741 | |
| 742 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 743 | || defined __cplusplus || defined _MSC_VER) |
| 744 | static void |
| 745 | yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) |
| 746 | #else |
| 747 | static void |
| 748 | yy_symbol_print (yyoutput, yytype, yyvaluep) |
| 749 | FILE *yyoutput; |
| 750 | int yytype; |
| 751 | YYSTYPE const * const yyvaluep; |
| 752 | #endif |
| 753 | { |
| 754 | if (yytype < YYNTOKENS) |
| 755 | YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); |
| 756 | else |
| 757 | YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); |
| 758 | |
| 759 | yy_symbol_value_print (yyoutput, yytype, yyvaluep); |
| 760 | YYFPRINTF (yyoutput, ")"); |
| 761 | } |
| 762 | |
| 763 | /*------------------------------------------------------------------. |
| 764 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | |
| 765 | | TOP (included). | |
| 766 | `------------------------------------------------------------------*/ |
| 767 | |
| 768 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 769 | || defined __cplusplus || defined _MSC_VER) |
| 770 | static void |
| 771 | yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) |
| 772 | #else |
| 773 | static void |
| 774 | yy_stack_print (yybottom, yytop) |
| 775 | yytype_int16 *yybottom; |
| 776 | yytype_int16 *yytop; |
| 777 | #endif |
| 778 | { |
| 779 | YYFPRINTF (stderr, "Stack now"); |
| 780 | for (; yybottom <= yytop; yybottom++) |
| 781 | { |
| 782 | int yybot = *yybottom; |
| 783 | YYFPRINTF (stderr, " %d", yybot); |
| 784 | } |
| 785 | YYFPRINTF (stderr, "\n"); |
| 786 | } |
| 787 | |
| 788 | # define YY_STACK_PRINT(Bottom, Top) \ |
| 789 | do { \ |
| 790 | if (yydebug) \ |
| 791 | yy_stack_print ((Bottom), (Top)); \ |
| 792 | } while (YYID (0)) |
| 793 | |
| 794 | |
| 795 | /*------------------------------------------------. |
| 796 | | Report that the YYRULE is going to be reduced. | |
| 797 | `------------------------------------------------*/ |
| 798 | |
| 799 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 800 | || defined __cplusplus || defined _MSC_VER) |
| 801 | static void |
| 802 | yy_reduce_print (YYSTYPE *yyvsp, int yyrule) |
| 803 | #else |
| 804 | static void |
| 805 | yy_reduce_print (yyvsp, yyrule) |
| 806 | YYSTYPE *yyvsp; |
| 807 | int yyrule; |
| 808 | #endif |
| 809 | { |
| 810 | int yynrhs = yyr2[yyrule]; |
| 811 | int yyi; |
| 812 | unsigned long int yylno = yyrline[yyrule]; |
| 813 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", |
| 814 | yyrule - 1, yylno); |
| 815 | /* The symbols being reduced. */ |
| 816 | for (yyi = 0; yyi < yynrhs; yyi++) |
| 817 | { |
| 818 | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
| 819 | yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], |
| 820 | &(yyvsp[(yyi + 1) - (yynrhs)]) |
| 821 | ); |
| 822 | YYFPRINTF (stderr, "\n"); |
| 823 | } |
| 824 | } |
| 825 | |
| 826 | # define YY_REDUCE_PRINT(Rule) \ |
| 827 | do { \ |
| 828 | if (yydebug) \ |
| 829 | yy_reduce_print (yyvsp, Rule); \ |
| 830 | } while (YYID (0)) |
| 831 | |
| 832 | /* Nonzero means print parse trace. It is left uninitialized so that |
| 833 | multiple parsers can coexist. */ |
| 834 | int yydebug; |
| 835 | #else /* !YYDEBUG */ |
| 836 | # define YYDPRINTF(Args) |
| 837 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
| 838 | # define YY_STACK_PRINT(Bottom, Top) |
| 839 | # define YY_REDUCE_PRINT(Rule) |
| 840 | #endif /* !YYDEBUG */ |
| 841 | |
| 842 | |
| 843 | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
| 844 | #ifndef YYINITDEPTH |
| 845 | # define YYINITDEPTH 200 |
| 846 | #endif |
| 847 | |
| 848 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
| 849 | if the built-in stack extension method is used). |
| 850 | |
| 851 | Do not make this value too large; the results are undefined if |
| 852 | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
| 853 | evaluated with infinite-precision integer arithmetic. */ |
| 854 | |
| 855 | #ifndef YYMAXDEPTH |
| 856 | # define YYMAXDEPTH 10000 |
| 857 | #endif |
| 858 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 859 | |
| 860 | #if YYERROR_VERBOSE |
| 861 | |
| 862 | # ifndef yystrlen |
| 863 | # if defined __GLIBC__ && defined _STRING_H |
| 864 | # define yystrlen strlen |
| 865 | # else |
| 866 | /* Return the length of YYSTR. */ |
| 867 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 868 | || defined __cplusplus || defined _MSC_VER) |
| 869 | static YYSIZE_T |
| 870 | yystrlen (const char *yystr) |
| 871 | #else |
| 872 | static YYSIZE_T |
| 873 | yystrlen (yystr) |
| 874 | const char *yystr; |
| 875 | #endif |
| 876 | { |
| 877 | YYSIZE_T yylen; |
| 878 | for (yylen = 0; yystr[yylen]; yylen++) |
| 879 | continue; |
| 880 | return yylen; |
| 881 | } |
| 882 | # endif |
| 883 | # endif |
| 884 | |
| 885 | # ifndef yystpcpy |
| 886 | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
| 887 | # define yystpcpy stpcpy |
| 888 | # else |
| 889 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
| 890 | YYDEST. */ |
| 891 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 892 | || defined __cplusplus || defined _MSC_VER) |
| 893 | static char * |
| 894 | yystpcpy (char *yydest, const char *yysrc) |
| 895 | #else |
| 896 | static char * |
| 897 | yystpcpy (yydest, yysrc) |
| 898 | char *yydest; |
| 899 | const char *yysrc; |
| 900 | #endif |
| 901 | { |
| 902 | char *yyd = yydest; |
| 903 | const char *yys = yysrc; |
| 904 | |
| 905 | while ((*yyd++ = *yys++) != '\0') |
| 906 | continue; |
| 907 | |
| 908 | return yyd - 1; |
| 909 | } |
| 910 | # endif |
| 911 | # endif |
| 912 | |
| 913 | # ifndef yytnamerr |
| 914 | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary |
| 915 | quotes and backslashes, so that it's suitable for yyerror. The |
| 916 | heuristic is that double-quoting is unnecessary unless the string |
| 917 | contains an apostrophe, a comma, or backslash (other than |
| 918 | backslash-backslash). YYSTR is taken from yytname. If YYRES is |
| 919 | null, do not copy; instead, return the length of what the result |
| 920 | would have been. */ |
| 921 | static YYSIZE_T |
| 922 | yytnamerr (char *yyres, const char *yystr) |
| 923 | { |
| 924 | if (*yystr == '"') |
| 925 | { |
| 926 | YYSIZE_T yyn = 0; |
| 927 | char const *yyp = yystr; |
| 928 | |
| 929 | for (;;) |
| 930 | switch (*++yyp) |
| 931 | { |
| 932 | case '\'': |
| 933 | case ',': |
| 934 | goto do_not_strip_quotes; |
| 935 | |
| 936 | case '\\': |
| 937 | if (*++yyp != '\\') |
| 938 | goto do_not_strip_quotes; |
| 939 | /* Fall through. */ |
| 940 | default: |
| 941 | if (yyres) |
| 942 | yyres[yyn] = *yyp; |
| 943 | yyn++; |
| 944 | break; |
| 945 | |
| 946 | case '"': |
| 947 | if (yyres) |
| 948 | yyres[yyn] = '\0'; |
| 949 | return yyn; |
| 950 | } |
| 951 | do_not_strip_quotes: ; |
| 952 | } |
| 953 | |
| 954 | if (! yyres) |
| 955 | return yystrlen (yystr); |
| 956 | |
| 957 | return yystpcpy (yyres, yystr) - yyres; |
| 958 | } |
| 959 | # endif |
| 960 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 961 | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
| 962 | about the unexpected token YYTOKEN for the state stack whose top is |
| 963 | YYSSP. |
| 964 | |
| 965 | Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
| 966 | not large enough to hold the message. In that case, also set |
| 967 | *YYMSG_ALLOC to the required number of bytes. Return 2 if the |
| 968 | required number of bytes is too large to store. */ |
| 969 | static int |
| 970 | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, |
| 971 | yytype_int16 *yyssp, int yytoken) |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 972 | { |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 973 | YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); |
| 974 | YYSIZE_T yysize = yysize0; |
| 975 | YYSIZE_T yysize1; |
| 976 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
| 977 | /* Internationalized format string. */ |
| 978 | const char *yyformat = 0; |
| 979 | /* Arguments of yyformat. */ |
| 980 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
| 981 | /* Number of reported tokens (one for the "unexpected", one per |
| 982 | "expected"). */ |
| 983 | int yycount = 0; |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 984 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 985 | /* There are many possibilities here to consider: |
| 986 | - Assume YYFAIL is not used. It's too flawed to consider. See |
| 987 | <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> |
| 988 | for details. YYERROR is fine as it does not invoke this |
| 989 | function. |
| 990 | - If this state is a consistent state with a default action, then |
| 991 | the only way this function was invoked is if the default action |
| 992 | is an error action. In that case, don't check for expected |
| 993 | tokens because there are none. |
| 994 | - The only way there can be no lookahead present (in yychar) is if |
| 995 | this state is a consistent state with a default action. Thus, |
| 996 | detecting the absence of a lookahead is sufficient to determine |
| 997 | that there is no unexpected or expected token to report. In that |
| 998 | case, just report a simple "syntax error". |
| 999 | - Don't assume there isn't a lookahead just because this state is a |
| 1000 | consistent state with a default action. There might have been a |
| 1001 | previous inconsistent state, consistent state with a non-default |
| 1002 | action, or user semantic action that manipulated yychar. |
| 1003 | - Of course, the expected token list depends on states to have |
| 1004 | correct lookahead information, and it depends on the parser not |
| 1005 | to perform extra reductions after fetching a lookahead from the |
| 1006 | scanner and before detecting a syntax error. Thus, state merging |
| 1007 | (from LALR or IELR) and default reductions corrupt the expected |
| 1008 | token list. However, the list is correct for canonical LR with |
| 1009 | one exception: it will still contain any token that will not be |
| 1010 | accepted due to an error action in a later state. |
| 1011 | */ |
| 1012 | if (yytoken != YYEMPTY) |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1013 | { |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1014 | int yyn = yypact[*yyssp]; |
| 1015 | yyarg[yycount++] = yytname[yytoken]; |
| 1016 | if (!yypact_value_is_default (yyn)) |
| 1017 | { |
| 1018 | /* Start YYX at -YYN if negative to avoid negative indexes in |
| 1019 | YYCHECK. In other words, skip the first -YYN actions for |
| 1020 | this state because they are default actions. */ |
| 1021 | int yyxbegin = yyn < 0 ? -yyn : 0; |
| 1022 | /* Stay within bounds of both yycheck and yytname. */ |
| 1023 | int yychecklim = YYLAST - yyn + 1; |
| 1024 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
| 1025 | int yyx; |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1026 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1027 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
| 1028 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR |
| 1029 | && !yytable_value_is_error (yytable[yyx + yyn])) |
| 1030 | { |
| 1031 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
| 1032 | { |
| 1033 | yycount = 1; |
| 1034 | yysize = yysize0; |
| 1035 | break; |
| 1036 | } |
| 1037 | yyarg[yycount++] = yytname[yyx]; |
| 1038 | yysize1 = yysize + yytnamerr (0, yytname[yyx]); |
| 1039 | if (! (yysize <= yysize1 |
| 1040 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
| 1041 | return 2; |
| 1042 | yysize = yysize1; |
| 1043 | } |
| 1044 | } |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1045 | } |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1046 | |
| 1047 | switch (yycount) |
| 1048 | { |
| 1049 | # define YYCASE_(N, S) \ |
| 1050 | case N: \ |
| 1051 | yyformat = S; \ |
| 1052 | break |
| 1053 | YYCASE_(0, YY_("syntax error")); |
| 1054 | YYCASE_(1, YY_("syntax error, unexpected %s")); |
| 1055 | YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); |
| 1056 | YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); |
| 1057 | YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); |
| 1058 | YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); |
| 1059 | # undef YYCASE_ |
| 1060 | } |
| 1061 | |
| 1062 | yysize1 = yysize + yystrlen (yyformat); |
| 1063 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) |
| 1064 | return 2; |
| 1065 | yysize = yysize1; |
| 1066 | |
| 1067 | if (*yymsg_alloc < yysize) |
| 1068 | { |
| 1069 | *yymsg_alloc = 2 * yysize; |
| 1070 | if (! (yysize <= *yymsg_alloc |
| 1071 | && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) |
| 1072 | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; |
| 1073 | return 1; |
| 1074 | } |
| 1075 | |
| 1076 | /* Avoid sprintf, as that infringes on the user's name space. |
| 1077 | Don't have undefined behavior even if the translation |
| 1078 | produced a string with the wrong number of "%s"s. */ |
| 1079 | { |
| 1080 | char *yyp = *yymsg; |
| 1081 | int yyi = 0; |
| 1082 | while ((*yyp = *yyformat) != '\0') |
| 1083 | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) |
| 1084 | { |
| 1085 | yyp += yytnamerr (yyp, yyarg[yyi++]); |
| 1086 | yyformat += 2; |
| 1087 | } |
| 1088 | else |
| 1089 | { |
| 1090 | yyp++; |
| 1091 | yyformat++; |
| 1092 | } |
| 1093 | } |
| 1094 | return 0; |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1095 | } |
| 1096 | #endif /* YYERROR_VERBOSE */ |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1097 | |
| 1098 | /*-----------------------------------------------. |
| 1099 | | Release the memory associated to this symbol. | |
| 1100 | `-----------------------------------------------*/ |
| 1101 | |
| 1102 | /*ARGSUSED*/ |
| 1103 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1104 | || defined __cplusplus || defined _MSC_VER) |
| 1105 | static void |
| 1106 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) |
| 1107 | #else |
| 1108 | static void |
| 1109 | yydestruct (yymsg, yytype, yyvaluep) |
| 1110 | const char *yymsg; |
| 1111 | int yytype; |
| 1112 | YYSTYPE *yyvaluep; |
| 1113 | #endif |
| 1114 | { |
| 1115 | YYUSE (yyvaluep); |
| 1116 | |
| 1117 | if (!yymsg) |
| 1118 | yymsg = "Deleting"; |
| 1119 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
| 1120 | |
| 1121 | switch (yytype) |
| 1122 | { |
| 1123 | |
| 1124 | default: |
| 1125 | break; |
| 1126 | } |
| 1127 | } |
| 1128 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1129 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1130 | /* Prevent warnings from -Wmissing-prototypes. */ |
| 1131 | #ifdef YYPARSE_PARAM |
| 1132 | #if defined __STDC__ || defined __cplusplus |
| 1133 | int yyparse (void *YYPARSE_PARAM); |
| 1134 | #else |
| 1135 | int yyparse (); |
| 1136 | #endif |
| 1137 | #else /* ! YYPARSE_PARAM */ |
| 1138 | #if defined __STDC__ || defined __cplusplus |
| 1139 | int yyparse (void); |
| 1140 | #else |
| 1141 | int yyparse (); |
| 1142 | #endif |
| 1143 | #endif /* ! YYPARSE_PARAM */ |
| 1144 | |
| 1145 | |
| 1146 | /* The lookahead symbol. */ |
| 1147 | int yychar; |
| 1148 | |
| 1149 | /* The semantic value of the lookahead symbol. */ |
| 1150 | YYSTYPE yylval; |
| 1151 | |
| 1152 | /* Number of syntax errors so far. */ |
| 1153 | int yynerrs; |
| 1154 | |
| 1155 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1156 | /*----------. |
| 1157 | | yyparse. | |
| 1158 | `----------*/ |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1159 | |
| 1160 | #ifdef YYPARSE_PARAM |
| 1161 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1162 | || defined __cplusplus || defined _MSC_VER) |
| 1163 | int |
| 1164 | yyparse (void *YYPARSE_PARAM) |
| 1165 | #else |
| 1166 | int |
| 1167 | yyparse (YYPARSE_PARAM) |
| 1168 | void *YYPARSE_PARAM; |
| 1169 | #endif |
| 1170 | #else /* ! YYPARSE_PARAM */ |
| 1171 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1172 | || defined __cplusplus || defined _MSC_VER) |
| 1173 | int |
| 1174 | yyparse (void) |
| 1175 | #else |
| 1176 | int |
| 1177 | yyparse () |
| 1178 | |
| 1179 | #endif |
| 1180 | #endif |
| 1181 | { |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1182 | int yystate; |
| 1183 | /* Number of tokens to shift before error messages enabled. */ |
| 1184 | int yyerrstatus; |
| 1185 | |
| 1186 | /* The stacks and their tools: |
| 1187 | `yyss': related to states. |
| 1188 | `yyvs': related to semantic values. |
| 1189 | |
| 1190 | Refer to the stacks thru separate pointers, to allow yyoverflow |
| 1191 | to reallocate them elsewhere. */ |
| 1192 | |
| 1193 | /* The state stack. */ |
| 1194 | yytype_int16 yyssa[YYINITDEPTH]; |
| 1195 | yytype_int16 *yyss; |
| 1196 | yytype_int16 *yyssp; |
| 1197 | |
| 1198 | /* The semantic value stack. */ |
| 1199 | YYSTYPE yyvsa[YYINITDEPTH]; |
| 1200 | YYSTYPE *yyvs; |
| 1201 | YYSTYPE *yyvsp; |
| 1202 | |
| 1203 | YYSIZE_T yystacksize; |
| 1204 | |
| 1205 | int yyn; |
| 1206 | int yyresult; |
| 1207 | /* Lookahead token as an internal (translated) token number. */ |
| 1208 | int yytoken; |
| 1209 | /* The variables used to return semantic value and location from the |
| 1210 | action routines. */ |
| 1211 | YYSTYPE yyval; |
| 1212 | |
| 1213 | #if YYERROR_VERBOSE |
| 1214 | /* Buffer for error messages, and its allocated size. */ |
| 1215 | char yymsgbuf[128]; |
| 1216 | char *yymsg = yymsgbuf; |
| 1217 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; |
| 1218 | #endif |
| 1219 | |
| 1220 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
| 1221 | |
| 1222 | /* The number of symbols on the RHS of the reduced rule. |
| 1223 | Keep to zero when no symbol should be popped. */ |
| 1224 | int yylen = 0; |
| 1225 | |
| 1226 | yytoken = 0; |
| 1227 | yyss = yyssa; |
| 1228 | yyvs = yyvsa; |
| 1229 | yystacksize = YYINITDEPTH; |
| 1230 | |
| 1231 | YYDPRINTF ((stderr, "Starting parse\n")); |
| 1232 | |
| 1233 | yystate = 0; |
| 1234 | yyerrstatus = 0; |
| 1235 | yynerrs = 0; |
| 1236 | yychar = YYEMPTY; /* Cause a token to be read. */ |
| 1237 | |
| 1238 | /* Initialize stack pointers. |
| 1239 | Waste one element of value and location stack |
| 1240 | so that they stay on the same level as the state stack. |
| 1241 | The wasted elements are never initialized. */ |
| 1242 | yyssp = yyss; |
| 1243 | yyvsp = yyvs; |
| 1244 | |
| 1245 | goto yysetstate; |
| 1246 | |
| 1247 | /*------------------------------------------------------------. |
| 1248 | | yynewstate -- Push a new state, which is found in yystate. | |
| 1249 | `------------------------------------------------------------*/ |
| 1250 | yynewstate: |
| 1251 | /* In all cases, when you get here, the value and location stacks |
| 1252 | have just been pushed. So pushing a state here evens the stacks. */ |
| 1253 | yyssp++; |
| 1254 | |
| 1255 | yysetstate: |
| 1256 | *yyssp = yystate; |
| 1257 | |
| 1258 | if (yyss + yystacksize - 1 <= yyssp) |
| 1259 | { |
| 1260 | /* Get the current used size of the three stacks, in elements. */ |
| 1261 | YYSIZE_T yysize = yyssp - yyss + 1; |
| 1262 | |
| 1263 | #ifdef yyoverflow |
| 1264 | { |
| 1265 | /* Give user a chance to reallocate the stack. Use copies of |
| 1266 | these so that the &'s don't force the real ones into |
| 1267 | memory. */ |
| 1268 | YYSTYPE *yyvs1 = yyvs; |
| 1269 | yytype_int16 *yyss1 = yyss; |
| 1270 | |
| 1271 | /* Each stack pointer address is followed by the size of the |
| 1272 | data in use in that stack, in bytes. This used to be a |
| 1273 | conditional around just the two extra args, but that might |
| 1274 | be undefined if yyoverflow is a macro. */ |
| 1275 | yyoverflow (YY_("memory exhausted"), |
| 1276 | &yyss1, yysize * sizeof (*yyssp), |
| 1277 | &yyvs1, yysize * sizeof (*yyvsp), |
| 1278 | &yystacksize); |
| 1279 | |
| 1280 | yyss = yyss1; |
| 1281 | yyvs = yyvs1; |
| 1282 | } |
| 1283 | #else /* no yyoverflow */ |
| 1284 | # ifndef YYSTACK_RELOCATE |
| 1285 | goto yyexhaustedlab; |
| 1286 | # else |
| 1287 | /* Extend the stack our own way. */ |
| 1288 | if (YYMAXDEPTH <= yystacksize) |
| 1289 | goto yyexhaustedlab; |
| 1290 | yystacksize *= 2; |
| 1291 | if (YYMAXDEPTH < yystacksize) |
| 1292 | yystacksize = YYMAXDEPTH; |
| 1293 | |
| 1294 | { |
| 1295 | yytype_int16 *yyss1 = yyss; |
| 1296 | union yyalloc *yyptr = |
| 1297 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
| 1298 | if (! yyptr) |
| 1299 | goto yyexhaustedlab; |
| 1300 | YYSTACK_RELOCATE (yyss_alloc, yyss); |
| 1301 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
| 1302 | # undef YYSTACK_RELOCATE |
| 1303 | if (yyss1 != yyssa) |
| 1304 | YYSTACK_FREE (yyss1); |
| 1305 | } |
| 1306 | # endif |
| 1307 | #endif /* no yyoverflow */ |
| 1308 | |
| 1309 | yyssp = yyss + yysize - 1; |
| 1310 | yyvsp = yyvs + yysize - 1; |
| 1311 | |
| 1312 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
| 1313 | (unsigned long int) yystacksize)); |
| 1314 | |
| 1315 | if (yyss + yystacksize - 1 <= yyssp) |
| 1316 | YYABORT; |
| 1317 | } |
| 1318 | |
| 1319 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
| 1320 | |
| 1321 | if (yystate == YYFINAL) |
| 1322 | YYACCEPT; |
| 1323 | |
| 1324 | goto yybackup; |
| 1325 | |
| 1326 | /*-----------. |
| 1327 | | yybackup. | |
| 1328 | `-----------*/ |
| 1329 | yybackup: |
| 1330 | |
| 1331 | /* Do appropriate processing given the current state. Read a |
| 1332 | lookahead token if we need one and don't already have one. */ |
| 1333 | |
| 1334 | /* First try to decide what to do without reference to lookahead token. */ |
| 1335 | yyn = yypact[yystate]; |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1336 | if (yypact_value_is_default (yyn)) |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1337 | goto yydefault; |
| 1338 | |
| 1339 | /* Not known => get a lookahead token if don't already have one. */ |
| 1340 | |
| 1341 | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
| 1342 | if (yychar == YYEMPTY) |
| 1343 | { |
| 1344 | YYDPRINTF ((stderr, "Reading a token: ")); |
| 1345 | yychar = YYLEX; |
| 1346 | } |
| 1347 | |
| 1348 | if (yychar <= YYEOF) |
| 1349 | { |
| 1350 | yychar = yytoken = YYEOF; |
| 1351 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
| 1352 | } |
| 1353 | else |
| 1354 | { |
| 1355 | yytoken = YYTRANSLATE (yychar); |
| 1356 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
| 1357 | } |
| 1358 | |
| 1359 | /* If the proper action on seeing token YYTOKEN is to reduce or to |
| 1360 | detect an error, take that action. */ |
| 1361 | yyn += yytoken; |
| 1362 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
| 1363 | goto yydefault; |
| 1364 | yyn = yytable[yyn]; |
| 1365 | if (yyn <= 0) |
| 1366 | { |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1367 | if (yytable_value_is_error (yyn)) |
| 1368 | goto yyerrlab; |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1369 | yyn = -yyn; |
| 1370 | goto yyreduce; |
| 1371 | } |
| 1372 | |
| 1373 | /* Count tokens shifted since error; after three, turn off error |
| 1374 | status. */ |
| 1375 | if (yyerrstatus) |
| 1376 | yyerrstatus--; |
| 1377 | |
| 1378 | /* Shift the lookahead token. */ |
| 1379 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
| 1380 | |
| 1381 | /* Discard the shifted token. */ |
| 1382 | yychar = YYEMPTY; |
| 1383 | |
| 1384 | yystate = yyn; |
| 1385 | *++yyvsp = yylval; |
| 1386 | |
| 1387 | goto yynewstate; |
| 1388 | |
| 1389 | |
| 1390 | /*-----------------------------------------------------------. |
| 1391 | | yydefault -- do the default action for the current state. | |
| 1392 | `-----------------------------------------------------------*/ |
| 1393 | yydefault: |
| 1394 | yyn = yydefact[yystate]; |
| 1395 | if (yyn == 0) |
| 1396 | goto yyerrlab; |
| 1397 | goto yyreduce; |
| 1398 | |
| 1399 | |
| 1400 | /*-----------------------------. |
| 1401 | | yyreduce -- Do a reduction. | |
| 1402 | `-----------------------------*/ |
| 1403 | yyreduce: |
| 1404 | /* yyn is the number of a rule to reduce with. */ |
| 1405 | yylen = yyr2[yyn]; |
| 1406 | |
| 1407 | /* If YYLEN is nonzero, implement the default value of the action: |
| 1408 | `$$ = $1'. |
| 1409 | |
| 1410 | Otherwise, the following line sets YYVAL to garbage. |
| 1411 | This behavior is undocumented and Bison |
| 1412 | users should not rely upon it. Assigning to YYVAL |
| 1413 | unconditionally makes the parser a bit smaller, and it avoids a |
| 1414 | GCC warning that YYVAL may be used uninitialized. */ |
| 1415 | yyval = yyvsp[1-yylen]; |
| 1416 | |
| 1417 | |
| 1418 | YY_REDUCE_PRINT (yyn); |
| 1419 | switch (yyn) |
| 1420 | { |
| 1421 | case 2: |
| 1422 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1423 | { cur_parent = cur_bus = head; } |
Patrick Georgi | 68befd5 | 2010-05-05 12:05:25 +0000 | [diff] [blame] | 1424 | break; |
| 1425 | |
| 1426 | case 3: |
| 1427 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1428 | { postprocess_devtree(); } |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1429 | break; |
| 1430 | |
Sven Schnelle | 270a908 | 2011-03-01 19:58:15 +0000 | [diff] [blame] | 1431 | case 14: |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1432 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1433 | { |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1434 | (yyval.device) = new_chip(cur_parent, cur_bus, (yyvsp[(2) - (2)].string)); |
| 1435 | cur_parent = (yyval.device); |
| 1436 | } |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1437 | break; |
| 1438 | |
Sven Schnelle | 270a908 | 2011-03-01 19:58:15 +0000 | [diff] [blame] | 1439 | case 15: |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1440 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1441 | { |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1442 | cur_parent = (yyvsp[(3) - (5)].device)->parent; |
| 1443 | fold_in((yyvsp[(3) - (5)].device)); |
| 1444 | add_header((yyvsp[(3) - (5)].device)); |
| 1445 | } |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1446 | break; |
| 1447 | |
Sven Schnelle | 270a908 | 2011-03-01 19:58:15 +0000 | [diff] [blame] | 1448 | case 16: |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1449 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1450 | { |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1451 | (yyval.device) = new_device(cur_parent, cur_bus, (yyvsp[(2) - (4)].number), (yyvsp[(3) - (4)].string), (yyvsp[(4) - (4)].number)); |
| 1452 | cur_parent = (yyval.device); |
| 1453 | cur_bus = (yyval.device); |
| 1454 | } |
| 1455 | break; |
| 1456 | |
| 1457 | case 17: |
| 1458 | |
| 1459 | { |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1460 | cur_parent = (yyvsp[(5) - (7)].device)->parent; |
| 1461 | cur_bus = (yyvsp[(5) - (7)].device)->bus; |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1462 | fold_in((yyvsp[(5) - (7)].device)); |
Patrick Georgi | 114e7b2 | 2010-05-05 11:19:50 +0000 | [diff] [blame] | 1463 | alias_siblings((yyvsp[(5) - (7)].device)->children); |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1464 | } |
Patrick Georgi | 68befd5 | 2010-05-05 12:05:25 +0000 | [diff] [blame] | 1465 | break; |
| 1466 | |
Sven Schnelle | 270a908 | 2011-03-01 19:58:15 +0000 | [diff] [blame] | 1467 | case 18: |
Patrick Georgi | 68befd5 | 2010-05-05 12:05:25 +0000 | [diff] [blame] | 1468 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1469 | { add_resource(cur_parent, (yyvsp[(1) - (4)].number), strtol((yyvsp[(2) - (4)].string), NULL, 0), strtol((yyvsp[(4) - (4)].string), NULL, 0)); } |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1470 | break; |
| 1471 | |
Sven Schnelle | 270a908 | 2011-03-01 19:58:15 +0000 | [diff] [blame] | 1472 | case 19: |
| 1473 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1474 | { add_register(cur_parent, (yyvsp[(2) - (4)].string), (yyvsp[(4) - (4)].string)); } |
Sven Schnelle | 270a908 | 2011-03-01 19:58:15 +0000 | [diff] [blame] | 1475 | break; |
| 1476 | |
| 1477 | case 20: |
| 1478 | |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1479 | { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[(2) - (3)].string), NULL, 16), strtol((yyvsp[(3) - (3)].string), NULL, 16), 0); } |
| 1480 | break; |
| 1481 | |
| 1482 | case 21: |
| 1483 | |
| 1484 | { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[(2) - (4)].string), NULL, 16), strtol((yyvsp[(3) - (4)].string), NULL, 16), 1); } |
| 1485 | break; |
| 1486 | |
| 1487 | case 22: |
| 1488 | |
| 1489 | { add_ioapic_info(cur_parent, strtol((yyvsp[(2) - (4)].string), NULL, 16), (yyvsp[(3) - (4)].string), strtol((yyvsp[(4) - (4)].string), NULL, 16)); } |
Sven Schnelle | 270a908 | 2011-03-01 19:58:15 +0000 | [diff] [blame] | 1490 | break; |
| 1491 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1492 | |
| 1493 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1494 | default: break; |
| 1495 | } |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1496 | /* User semantic actions sometimes alter yychar, and that requires |
| 1497 | that yytoken be updated with the new translation. We take the |
| 1498 | approach of translating immediately before every use of yytoken. |
| 1499 | One alternative is translating here after every semantic action, |
| 1500 | but that translation would be missed if the semantic action invokes |
| 1501 | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or |
| 1502 | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an |
| 1503 | incorrect destructor might then be invoked immediately. In the |
| 1504 | case of YYERROR or YYBACKUP, subsequent parser actions might lead |
| 1505 | to an incorrect destructor call or verbose syntax error message |
| 1506 | before the lookahead is translated. */ |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1507 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
| 1508 | |
| 1509 | YYPOPSTACK (yylen); |
| 1510 | yylen = 0; |
| 1511 | YY_STACK_PRINT (yyss, yyssp); |
| 1512 | |
| 1513 | *++yyvsp = yyval; |
| 1514 | |
| 1515 | /* Now `shift' the result of the reduction. Determine what state |
| 1516 | that goes to, based on the state we popped back to and the rule |
| 1517 | number reduced by. */ |
| 1518 | |
| 1519 | yyn = yyr1[yyn]; |
| 1520 | |
| 1521 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
| 1522 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
| 1523 | yystate = yytable[yystate]; |
| 1524 | else |
| 1525 | yystate = yydefgoto[yyn - YYNTOKENS]; |
| 1526 | |
| 1527 | goto yynewstate; |
| 1528 | |
| 1529 | |
| 1530 | /*------------------------------------. |
| 1531 | | yyerrlab -- here on detecting error | |
| 1532 | `------------------------------------*/ |
| 1533 | yyerrlab: |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1534 | /* Make sure we have latest lookahead translation. See comments at |
| 1535 | user semantic actions for why this is necessary. */ |
| 1536 | yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); |
| 1537 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1538 | /* If not already recovering from an error, report this error. */ |
| 1539 | if (!yyerrstatus) |
| 1540 | { |
| 1541 | ++yynerrs; |
| 1542 | #if ! YYERROR_VERBOSE |
| 1543 | yyerror (YY_("syntax error")); |
| 1544 | #else |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1545 | # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ |
| 1546 | yyssp, yytoken) |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1547 | { |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1548 | char const *yymsgp = YY_("syntax error"); |
| 1549 | int yysyntax_error_status; |
| 1550 | yysyntax_error_status = YYSYNTAX_ERROR; |
| 1551 | if (yysyntax_error_status == 0) |
| 1552 | yymsgp = yymsg; |
| 1553 | else if (yysyntax_error_status == 1) |
| 1554 | { |
| 1555 | if (yymsg != yymsgbuf) |
| 1556 | YYSTACK_FREE (yymsg); |
| 1557 | yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); |
| 1558 | if (!yymsg) |
| 1559 | { |
| 1560 | yymsg = yymsgbuf; |
| 1561 | yymsg_alloc = sizeof yymsgbuf; |
| 1562 | yysyntax_error_status = 2; |
| 1563 | } |
| 1564 | else |
| 1565 | { |
| 1566 | yysyntax_error_status = YYSYNTAX_ERROR; |
| 1567 | yymsgp = yymsg; |
| 1568 | } |
| 1569 | } |
| 1570 | yyerror (yymsgp); |
| 1571 | if (yysyntax_error_status == 2) |
| 1572 | goto yyexhaustedlab; |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1573 | } |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1574 | # undef YYSYNTAX_ERROR |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1575 | #endif |
| 1576 | } |
| 1577 | |
| 1578 | |
| 1579 | |
| 1580 | if (yyerrstatus == 3) |
| 1581 | { |
| 1582 | /* If just tried and failed to reuse lookahead token after an |
| 1583 | error, discard it. */ |
| 1584 | |
| 1585 | if (yychar <= YYEOF) |
| 1586 | { |
| 1587 | /* Return failure if at end of input. */ |
| 1588 | if (yychar == YYEOF) |
| 1589 | YYABORT; |
| 1590 | } |
| 1591 | else |
| 1592 | { |
| 1593 | yydestruct ("Error: discarding", |
| 1594 | yytoken, &yylval); |
| 1595 | yychar = YYEMPTY; |
| 1596 | } |
| 1597 | } |
| 1598 | |
| 1599 | /* Else will try to reuse lookahead token after shifting the error |
| 1600 | token. */ |
| 1601 | goto yyerrlab1; |
| 1602 | |
| 1603 | |
| 1604 | /*---------------------------------------------------. |
| 1605 | | yyerrorlab -- error raised explicitly by YYERROR. | |
| 1606 | `---------------------------------------------------*/ |
| 1607 | yyerrorlab: |
| 1608 | |
| 1609 | /* Pacify compilers like GCC when the user code never invokes |
| 1610 | YYERROR and the label yyerrorlab therefore never appears in user |
| 1611 | code. */ |
| 1612 | if (/*CONSTCOND*/ 0) |
| 1613 | goto yyerrorlab; |
| 1614 | |
| 1615 | /* Do not reclaim the symbols of the rule which action triggered |
| 1616 | this YYERROR. */ |
| 1617 | YYPOPSTACK (yylen); |
| 1618 | yylen = 0; |
| 1619 | YY_STACK_PRINT (yyss, yyssp); |
| 1620 | yystate = *yyssp; |
| 1621 | goto yyerrlab1; |
| 1622 | |
| 1623 | |
| 1624 | /*-------------------------------------------------------------. |
| 1625 | | yyerrlab1 -- common code for both syntax error and YYERROR. | |
| 1626 | `-------------------------------------------------------------*/ |
| 1627 | yyerrlab1: |
| 1628 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
| 1629 | |
| 1630 | for (;;) |
| 1631 | { |
| 1632 | yyn = yypact[yystate]; |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1633 | if (!yypact_value_is_default (yyn)) |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1634 | { |
| 1635 | yyn += YYTERROR; |
| 1636 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
| 1637 | { |
| 1638 | yyn = yytable[yyn]; |
| 1639 | if (0 < yyn) |
| 1640 | break; |
| 1641 | } |
| 1642 | } |
| 1643 | |
| 1644 | /* Pop the current state because it cannot handle the error token. */ |
| 1645 | if (yyssp == yyss) |
| 1646 | YYABORT; |
| 1647 | |
| 1648 | |
| 1649 | yydestruct ("Error: popping", |
| 1650 | yystos[yystate], yyvsp); |
| 1651 | YYPOPSTACK (1); |
| 1652 | yystate = *yyssp; |
| 1653 | YY_STACK_PRINT (yyss, yyssp); |
| 1654 | } |
| 1655 | |
| 1656 | *++yyvsp = yylval; |
| 1657 | |
| 1658 | |
| 1659 | /* Shift the error token. */ |
| 1660 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
| 1661 | |
| 1662 | yystate = yyn; |
| 1663 | goto yynewstate; |
| 1664 | |
| 1665 | |
| 1666 | /*-------------------------------------. |
| 1667 | | yyacceptlab -- YYACCEPT comes here. | |
| 1668 | `-------------------------------------*/ |
| 1669 | yyacceptlab: |
| 1670 | yyresult = 0; |
| 1671 | goto yyreturn; |
| 1672 | |
| 1673 | /*-----------------------------------. |
| 1674 | | yyabortlab -- YYABORT comes here. | |
| 1675 | `-----------------------------------*/ |
| 1676 | yyabortlab: |
| 1677 | yyresult = 1; |
| 1678 | goto yyreturn; |
| 1679 | |
| 1680 | #if !defined(yyoverflow) || YYERROR_VERBOSE |
| 1681 | /*-------------------------------------------------. |
| 1682 | | yyexhaustedlab -- memory exhaustion comes here. | |
| 1683 | `-------------------------------------------------*/ |
| 1684 | yyexhaustedlab: |
| 1685 | yyerror (YY_("memory exhausted")); |
| 1686 | yyresult = 2; |
| 1687 | /* Fall through. */ |
| 1688 | #endif |
| 1689 | |
| 1690 | yyreturn: |
| 1691 | if (yychar != YYEMPTY) |
Sven Schnelle | 0fa50a1 | 2012-06-21 22:19:48 +0200 | [diff] [blame^] | 1692 | { |
| 1693 | /* Make sure we have latest lookahead translation. See comments at |
| 1694 | user semantic actions for why this is necessary. */ |
| 1695 | yytoken = YYTRANSLATE (yychar); |
| 1696 | yydestruct ("Cleanup: discarding lookahead", |
| 1697 | yytoken, &yylval); |
| 1698 | } |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1699 | /* Do not reclaim the symbols of the rule which action triggered |
| 1700 | this YYABORT or YYACCEPT. */ |
| 1701 | YYPOPSTACK (yylen); |
| 1702 | YY_STACK_PRINT (yyss, yyssp); |
| 1703 | while (yyssp != yyss) |
| 1704 | { |
| 1705 | yydestruct ("Cleanup: popping", |
| 1706 | yystos[*yyssp], yyvsp); |
| 1707 | YYPOPSTACK (1); |
| 1708 | } |
| 1709 | #ifndef yyoverflow |
| 1710 | if (yyss != yyssa) |
| 1711 | YYSTACK_FREE (yyss); |
| 1712 | #endif |
| 1713 | #if YYERROR_VERBOSE |
| 1714 | if (yymsg != yymsgbuf) |
| 1715 | YYSTACK_FREE (yymsg); |
| 1716 | #endif |
| 1717 | /* Make sure YYID is used. */ |
| 1718 | return YYID (yyresult); |
| 1719 | } |
| 1720 | |
| 1721 | |
| 1722 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1723 | |
Patrick Georgi | 7e8c9aa | 2010-04-08 11:37:43 +0000 | [diff] [blame] | 1724 | |