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