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