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