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