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