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