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