blob: 8e1e57de54b235ee2a8836875b020e78dcddae1a [file] [log] [blame]
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001/* A Bison parser, made by GNU Bison 3.0.5. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00002
Sven Schnelle0fa50a12012-06-21 22:19:48 +02003/* Bison implementation for Yacc-like parsers in C
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07004
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02005 Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07006
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00007 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 Reinauer2e78aa52016-05-07 01:11:14 -070011
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000012 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 Reinauer2e78aa52016-05-07 01:11:14 -070016
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000017 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 Reinauer2e78aa52016-05-07 01:11:14 -070029
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000030 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. */
Patrick Rudolphac24d3c2019-04-12 14:42:17 +020047#define YYBISON_VERSION "3.0.5"
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000048
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 Georgi7e8c9aa2010-04-08 11:37:43 +000061
62
63
64/* Copy the first part of user declarations. */
65
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000066
67/*
68 * sconfig, coreboot device tree compiler
69 *
70 * Copyright (C) 2010 coresystems GmbH
Stefan Reinauer2e78aa52016-05-07 01:11:14 -070071 * written by Patrick Georgi <patrick@georgi-clan.de>
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000072 *
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 Georgi7e8c9aa2010-04-08 11:37:43 +000081 */
82
Patrick Georgi114e7b22010-05-05 11:19:50 +000083#include "sconfig.h"
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000084
Stefan Reinauer2e78aa52016-05-07 01:11:14 -070085int yylex();
86void yyerror(const char *s);
87
Furquan Shaikh93198262018-06-03 04:22:17 -070088static struct bus *cur_parent;
Furquan Shaikhc56ae2f2018-05-31 10:33:16 -070089static struct chip_instance *cur_chip_instance;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000090
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000091
92
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000093
Stefan Reinauer2e78aa52016-05-07 01:11:14 -070094# 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 Georgi7e8c9aa2010-04-08 11:37:43 +0000101
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 Reinauer2e78aa52016-05-07 01:11:14 -0700110/* In a future release of Bison, this section will be replaced
111 by #include "sconfig.tab.h_shipped". */
Justin TerAvestca2ed9f2018-01-17 16:36:30 -0800112#ifndef YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
113# define YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700114/* Debug traces. */
115#ifndef YYDEBUG
116# define YYDEBUG 0
117#endif
118#if YYDEBUG
119extern int yydebug;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000120#endif
121
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700122/* Token type. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000123#ifndef YYTOKENTYPE
124# define YYTOKENTYPE
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700125 enum yytokentype
126 {
127 CHIP = 258,
128 DEVICE = 259,
129 REGISTER = 260,
130 BOOL = 261,
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800131 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,
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200147 SLOT_DESC = 278,
148 IO = 279,
149 NUMBER = 280,
150 SUBSYSTEMID = 281,
151 INHERIT = 282,
152 IOAPIC_IRQ = 283,
153 IOAPIC = 284,
154 PCIINT = 285,
155 GENERIC = 286,
156 SPI = 287,
157 USB = 288,
158 MMIO = 289
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700159 };
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000160#endif
161
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700162/* Value type. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000163#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700164
165union YYSTYPE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000166{
167
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000168
Furquan Shaikh93198262018-06-03 04:22:17 -0700169 struct device *dev;
Furquan Shaikhc56ae2f2018-05-31 10:33:16 -0700170 struct chip_instance *chip_instance;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000171 char *string;
172 int number;
173
174
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700175};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000176
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700177typedef union YYSTYPE YYSTYPE;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000178# define YYSTYPE_IS_TRIVIAL 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000179# define YYSTYPE_IS_DECLARED 1
180#endif
181
182
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700183extern YYSTYPE yylval;
184
185int yyparse (void);
186
Justin TerAvestca2ed9f2018-01-17 16:36:30 -0800187#endif /* !YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700188
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000189/* Copy the second part of user declarations. */
190
191
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000192
193#ifdef short
194# undef short
195#endif
196
197#ifdef YYTYPE_UINT8
198typedef YYTYPE_UINT8 yytype_uint8;
199#else
200typedef unsigned char yytype_uint8;
201#endif
202
203#ifdef YYTYPE_INT8
204typedef YYTYPE_INT8 yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000205#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700206typedef signed char yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000207#endif
208
209#ifdef YYTYPE_UINT16
210typedef YYTYPE_UINT16 yytype_uint16;
211#else
212typedef unsigned short int yytype_uint16;
213#endif
214
215#ifdef YYTYPE_INT16
216typedef YYTYPE_INT16 yytype_int16;
217#else
218typedef short int yytype_int16;
219#endif
220
221#ifndef YYSIZE_T
222# ifdef __SIZE_TYPE__
223# define YYSIZE_T __SIZE_TYPE__
224# elif defined size_t
225# define YYSIZE_T size_t
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700226# elif ! defined YYSIZE_T
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000227# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
228# define YYSIZE_T size_t
229# else
230# define YYSIZE_T unsigned int
231# endif
232#endif
233
234#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
235
236#ifndef YY_
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200237# if defined YYENABLE_NLS && YYENABLE_NLS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000238# if ENABLE_NLS
239# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700240# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000241# endif
242# endif
243# ifndef YY_
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700244# define YY_(Msgid) Msgid
245# endif
246#endif
247
248#ifndef YY_ATTRIBUTE
249# if (defined __GNUC__ \
250 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
251 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
252# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
253# else
254# define YY_ATTRIBUTE(Spec) /* empty */
255# endif
256#endif
257
258#ifndef YY_ATTRIBUTE_PURE
259# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
260#endif
261
262#ifndef YY_ATTRIBUTE_UNUSED
263# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
264#endif
265
266#if !defined _Noreturn \
267 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
268# if defined _MSC_VER && 1200 <= _MSC_VER
269# define _Noreturn __declspec (noreturn)
270# else
271# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000272# endif
273#endif
274
275/* Suppress unused-variable warnings by "using" E. */
276#if ! defined lint || defined __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700277# define YYUSE(E) ((void) (E))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000278#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700279# define YYUSE(E) /* empty */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000280#endif
281
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700282#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
283/* Suppress an incorrect diagnostic about yylval being uninitialized. */
284# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
285 _Pragma ("GCC diagnostic push") \
286 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
287 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
288# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
289 _Pragma ("GCC diagnostic pop")
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000290#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700291# define YY_INITIAL_VALUE(Value) Value
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000292#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700293#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
294# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
295# define YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000296#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700297#ifndef YY_INITIAL_VALUE
298# define YY_INITIAL_VALUE(Value) /* Nothing. */
299#endif
300
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000301
302#if ! defined yyoverflow || YYERROR_VERBOSE
303
304/* The parser invokes alloca or malloc; define the necessary symbols. */
305
306# ifdef YYSTACK_USE_ALLOCA
307# if YYSTACK_USE_ALLOCA
308# ifdef __GNUC__
309# define YYSTACK_ALLOC __builtin_alloca
310# elif defined __BUILTIN_VA_ARG_INCR
311# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
312# elif defined _AIX
313# define YYSTACK_ALLOC __alloca
314# elif defined _MSC_VER
315# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
316# define alloca _alloca
317# else
318# define YYSTACK_ALLOC alloca
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700319# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000320# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700321 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200322# ifndef EXIT_SUCCESS
323# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000324# endif
325# endif
326# endif
327# endif
328# endif
329
330# ifdef YYSTACK_ALLOC
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700331 /* Pacify GCC's 'empty if-body' warning. */
332# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000333# ifndef YYSTACK_ALLOC_MAXIMUM
334 /* The OS might guarantee only one guard page at the bottom of the stack,
335 and a page size can be as small as 4096 bytes. So we cannot safely
336 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
337 to allow for a few compiler-allocated temporary stack slots. */
338# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
339# endif
340# else
341# define YYSTACK_ALLOC YYMALLOC
342# define YYSTACK_FREE YYFREE
343# ifndef YYSTACK_ALLOC_MAXIMUM
344# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
345# endif
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200346# if (defined __cplusplus && ! defined EXIT_SUCCESS \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000347 && ! ((defined YYMALLOC || defined malloc) \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700348 && (defined YYFREE || defined free)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000349# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200350# ifndef EXIT_SUCCESS
351# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000352# endif
353# endif
354# ifndef YYMALLOC
355# define YYMALLOC malloc
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700356# if ! defined malloc && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000357void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
358# endif
359# endif
360# ifndef YYFREE
361# define YYFREE free
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700362# if ! defined free && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000363void free (void *); /* INFRINGES ON USER NAME SPACE */
364# endif
365# endif
366# endif
367#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
368
369
370#if (! defined yyoverflow \
371 && (! defined __cplusplus \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700372 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000373
374/* A type that is properly aligned for any stack member. */
375union yyalloc
376{
377 yytype_int16 yyss_alloc;
378 YYSTYPE yyvs_alloc;
379};
380
381/* The size of the maximum gap between one aligned stack and the next. */
382# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
383
384/* The size of an array large to enough to hold all stacks, each with
385 N elements. */
386# define YYSTACK_BYTES(N) \
387 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
388 + YYSTACK_GAP_MAXIMUM)
389
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200390# define YYCOPY_NEEDED 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000391
392/* Relocate STACK from its old location to the new one. The
393 local variables YYSIZE and YYSTACKSIZE give the old and new number of
394 elements in the stack, and YYPTR gives the new location of the
395 stack. Advance YYPTR to a properly aligned location for the next
396 stack. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700397# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
398 do \
399 { \
400 YYSIZE_T yynewbytes; \
401 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
402 Stack = &yyptr->Stack_alloc; \
403 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
404 yyptr += yynewbytes / sizeof (*yyptr); \
405 } \
406 while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000407
408#endif
409
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200410#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700411/* Copy COUNT objects from SRC to DST. The source and destination do
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200412 not overlap. */
413# ifndef YYCOPY
414# if defined __GNUC__ && 1 < __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700415# define YYCOPY(Dst, Src, Count) \
416 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200417# else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700418# define YYCOPY(Dst, Src, Count) \
419 do \
420 { \
421 YYSIZE_T yyi; \
422 for (yyi = 0; yyi < (Count); yyi++) \
423 (Dst)[yyi] = (Src)[yyi]; \
424 } \
425 while (0)
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200426# endif
427# endif
428#endif /* !YYCOPY_NEEDED */
429
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000430/* YYFINAL -- State number of the termination state. */
Patrick Georgi68befd52010-05-05 12:05:25 +0000431#define YYFINAL 3
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000432/* YYLAST -- Last index in YYTABLE. */
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200433#define YYLAST 43
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000434
435/* YYNTOKENS -- Number of terminals. */
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200436#define YYNTOKENS 35
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000437/* YYNNTS -- Number of nonterminals. */
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200438#define YYNNTS 15
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000439/* YYNRULES -- Number of rules. */
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200440#define YYNRULES 28
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700441/* YYNSTATES -- Number of states. */
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200442#define YYNSTATES 49
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000443
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700444/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
445 by yylex, with out-of-bounds checking. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000446#define YYUNDEFTOK 2
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200447#define YYMAXUTOK 289
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000448
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700449#define YYTRANSLATE(YYX) \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000450 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
451
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700452/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
453 as returned by yylex, without out-of-bounds checking. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000454static const yytype_uint8 yytranslate[] =
455{
456 0, 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, 2, 2, 2, 2,
481 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
482 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200483 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200484 25, 26, 27, 28, 29, 30, 31, 32, 33, 34
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000485};
486
487#if YYDEBUG
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700488 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
Patrick Georgi114e7b22010-05-05 11:19:50 +0000489static const yytype_uint8 yyrline[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000490{
Furquan Shaikh79e84122018-05-30 15:09:09 -0700491 0, 36, 36, 36, 38, 38, 38, 38, 40, 40,
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200492 40, 40, 40, 40, 40, 42, 42, 51, 51, 59,
493 59, 61, 64, 67, 70, 73, 76, 79, 82
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000494};
495#endif
496
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700497#if YYDEBUG || YYERROR_VERBOSE || 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000498/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
499 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
500static const char *const yytname[] =
501{
502 "$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800503 "HIDDEN", "BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI",
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200504 "PNP", "I2C", "APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ",
505 "SLOT_DESC", "IO", "NUMBER", "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ",
506 "IOAPIC", "PCIINT", "GENERIC", "SPI", "USB", "MMIO", "$accept",
507 "devtree", "$@1", "chipchildren", "devicechildren", "chip", "@2",
508 "device", "@3", "status", "resource", "registers", "subsystemid",
509 "ioapic_irq", "smbios_slot_desc", YY_NULLPTR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000510};
511#endif
512
513# ifdef YYPRINT
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700514/* YYTOKNUM[NUM] -- (External) token number corresponding to the
515 (internal) symbol number NUM (which must be that of a token). */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000516static const yytype_uint16 yytoknum[] =
517{
518 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
519 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
Furquan Shaikhe6700292017-02-11 00:50:38 -0800520 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200521 285, 286, 287, 288, 289
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000522};
523# endif
524
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200525#define YYPACT_NINF -12
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700526
527#define yypact_value_is_default(Yystate) \
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200528 (!!((Yystate) == (-12)))
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700529
530#define YYTABLE_NINF -1
531
532#define yytable_value_is_error(Yytable_value) \
533 0
534
535 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
536 STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000537static const yytype_int8 yypact[] =
538{
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200539 -12, 11, 9, -12, 1, -12, -12, -12, 0, 5,
540 3, -12, -12, -12, -12, -10, 6, 2, 8, -12,
541 -12, -12, -12, -12, -3, -1, -12, 13, 4, 7,
542 -12, -12, -12, -12, -12, -12, 16, 15, 10, -11,
543 12, 17, -5, 14, -12, 18, -12, -12, -12
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000544};
545
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700546 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
547 Performed when YYTABLE does not specify something else to do. Zero
548 means the default is an error. */
549static const yytype_uint8 yydefact[] =
550{
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200551 2, 0, 0, 1, 0, 3, 15, 7, 0, 0,
552 0, 16, 5, 4, 6, 0, 0, 0, 0, 19,
553 20, 17, 22, 14, 0, 0, 18, 0, 0, 0,
554 9, 8, 10, 11, 12, 13, 0, 0, 0, 0,
555 0, 28, 23, 0, 21, 27, 24, 25, 26
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700556};
557
558 /* YYPGOTO[NTERM-NUM]. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000559static const yytype_int8 yypgoto[] =
560{
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200561 -12, -12, -12, -12, -12, -6, -12, 19, -12, -12,
562 -12, -12, -12, -12, -12
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000563};
564
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700565 /* YYDEFGOTO[NTERM-NUM]. */
566static const yytype_int8 yydefgoto[] =
567{
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800568 -1, 1, 2, 8, 24, 5, 7, 13, 23, 21,
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200569 32, 14, 33, 34, 35
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700570};
571
572 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
573 positive, shift that token. If negative, reduce the rule whose
574 number is the opposite. If YYTABLE_NINF, syntax error. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000575static const yytype_uint8 yytable[] =
576{
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800577 4, 9, 12, 4, 9, 10, 25, 26, 19, 20,
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200578 11, 3, 4, 15, 6, 17, 16, 18, 30, 43,
579 27, 22, 46, 28, 36, 29, 37, 40, 41, 38,
580 45, 48, 39, 0, 0, 42, 0, 44, 0, 47,
581 0, 0, 0, 31
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000582};
583
Patrick Georgi8f625f62010-05-05 13:13:47 +0000584static const yytype_int8 yycheck[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000585{
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800586 3, 4, 8, 3, 4, 5, 9, 10, 6, 7,
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200587 10, 0, 3, 8, 13, 25, 13, 11, 24, 30,
588 23, 13, 27, 26, 25, 28, 13, 11, 13, 25,
589 13, 13, 25, -1, -1, 25, -1, 25, -1, 25,
590 -1, -1, -1, 24
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000591};
592
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700593 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
594 symbol of state STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000595static const yytype_uint8 yystos[] =
596{
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200597 0, 36, 37, 0, 3, 40, 13, 41, 38, 4,
598 5, 10, 40, 42, 46, 8, 13, 25, 11, 6,
599 7, 44, 13, 43, 39, 9, 10, 23, 26, 28,
600 40, 42, 45, 47, 48, 49, 25, 13, 25, 25,
601 11, 13, 25, 30, 25, 13, 27, 25, 13
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000602};
603
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700604 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
605static const yytype_uint8 yyr1[] =
606{
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200607 0, 35, 37, 36, 38, 38, 38, 38, 39, 39,
608 39, 39, 39, 39, 39, 41, 40, 43, 42, 44,
609 44, 45, 46, 47, 47, 48, 49, 49, 49
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700610};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000611
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700612 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
613static const yytype_uint8 yyr2[] =
614{
615 0, 2, 0, 2, 2, 2, 2, 0, 2, 2,
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200616 2, 2, 2, 2, 0, 0, 5, 0, 7, 1,
617 1, 4, 4, 3, 4, 4, 5, 4, 3
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700618};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000619
620
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700621#define yyerrok (yyerrstatus = 0)
622#define yyclearin (yychar = YYEMPTY)
623#define YYEMPTY (-2)
624#define YYEOF 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000625
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700626#define YYACCEPT goto yyacceptlab
627#define YYABORT goto yyabortlab
628#define YYERROR goto yyerrorlab
629
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000630
631#define YYRECOVERING() (!!yyerrstatus)
632
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700633#define YYBACKUP(Token, Value) \
634do \
635 if (yychar == YYEMPTY) \
636 { \
637 yychar = (Token); \
638 yylval = (Value); \
639 YYPOPSTACK (yylen); \
640 yystate = *yyssp; \
641 goto yybackup; \
642 } \
643 else \
644 { \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000645 yyerror (YY_("syntax error: cannot back up")); \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700646 YYERROR; \
647 } \
648while (0)
649
650/* Error token number */
651#define YYTERROR 1
652#define YYERRCODE 256
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000653
654
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000655
656/* Enable debugging if requested. */
657#if YYDEBUG
658
659# ifndef YYFPRINTF
660# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
661# define YYFPRINTF fprintf
662# endif
663
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700664# define YYDPRINTF(Args) \
665do { \
666 if (yydebug) \
667 YYFPRINTF Args; \
668} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000669
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700670/* This macro is provided for backward compatibility. */
671#ifndef YY_LOCATION_PRINT
672# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
673#endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000674
675
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700676# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
677do { \
678 if (yydebug) \
679 { \
680 YYFPRINTF (stderr, "%s ", Title); \
681 yy_symbol_print (stderr, \
682 Type, Value); \
683 YYFPRINTF (stderr, "\n"); \
684 } \
685} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000686
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700687
688/*----------------------------------------.
689| Print this symbol's value on YYOUTPUT. |
690`----------------------------------------*/
691
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000692static void
693yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000694{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700695 FILE *yyo = yyoutput;
696 YYUSE (yyo);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000697 if (!yyvaluep)
698 return;
699# ifdef YYPRINT
700 if (yytype < YYNTOKENS)
701 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000702# endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700703 YYUSE (yytype);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000704}
705
706
707/*--------------------------------.
708| Print this symbol on YYOUTPUT. |
709`--------------------------------*/
710
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000711static void
712yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000713{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700714 YYFPRINTF (yyoutput, "%s %s (",
715 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000716
717 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
718 YYFPRINTF (yyoutput, ")");
719}
720
721/*------------------------------------------------------------------.
722| yy_stack_print -- Print the state stack from its BOTTOM up to its |
723| TOP (included). |
724`------------------------------------------------------------------*/
725
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000726static void
727yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000728{
729 YYFPRINTF (stderr, "Stack now");
730 for (; yybottom <= yytop; yybottom++)
731 {
732 int yybot = *yybottom;
733 YYFPRINTF (stderr, " %d", yybot);
734 }
735 YYFPRINTF (stderr, "\n");
736}
737
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700738# define YY_STACK_PRINT(Bottom, Top) \
739do { \
740 if (yydebug) \
741 yy_stack_print ((Bottom), (Top)); \
742} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000743
744
745/*------------------------------------------------.
746| Report that the YYRULE is going to be reduced. |
747`------------------------------------------------*/
748
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000749static void
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700750yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000751{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700752 unsigned long int yylno = yyrline[yyrule];
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000753 int yynrhs = yyr2[yyrule];
754 int yyi;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000755 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700756 yyrule - 1, yylno);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000757 /* The symbols being reduced. */
758 for (yyi = 0; yyi < yynrhs; yyi++)
759 {
760 YYFPRINTF (stderr, " $%d = ", yyi + 1);
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700761 yy_symbol_print (stderr,
762 yystos[yyssp[yyi + 1 - yynrhs]],
763 &(yyvsp[(yyi + 1) - (yynrhs)])
764 );
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000765 YYFPRINTF (stderr, "\n");
766 }
767}
768
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700769# define YY_REDUCE_PRINT(Rule) \
770do { \
771 if (yydebug) \
772 yy_reduce_print (yyssp, yyvsp, Rule); \
773} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000774
775/* Nonzero means print parse trace. It is left uninitialized so that
776 multiple parsers can coexist. */
777int yydebug;
778#else /* !YYDEBUG */
779# define YYDPRINTF(Args)
780# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
781# define YY_STACK_PRINT(Bottom, Top)
782# define YY_REDUCE_PRINT(Rule)
783#endif /* !YYDEBUG */
784
785
786/* YYINITDEPTH -- initial size of the parser's stacks. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700787#ifndef YYINITDEPTH
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000788# define YYINITDEPTH 200
789#endif
790
791/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
792 if the built-in stack extension method is used).
793
794 Do not make this value too large; the results are undefined if
795 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
796 evaluated with infinite-precision integer arithmetic. */
797
798#ifndef YYMAXDEPTH
799# define YYMAXDEPTH 10000
800#endif
801
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000802
803#if YYERROR_VERBOSE
804
805# ifndef yystrlen
806# if defined __GLIBC__ && defined _STRING_H
807# define yystrlen strlen
808# else
809/* Return the length of YYSTR. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000810static YYSIZE_T
811yystrlen (const char *yystr)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000812{
813 YYSIZE_T yylen;
814 for (yylen = 0; yystr[yylen]; yylen++)
815 continue;
816 return yylen;
817}
818# endif
819# endif
820
821# ifndef yystpcpy
822# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
823# define yystpcpy stpcpy
824# else
825/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
826 YYDEST. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000827static char *
828yystpcpy (char *yydest, const char *yysrc)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000829{
830 char *yyd = yydest;
831 const char *yys = yysrc;
832
833 while ((*yyd++ = *yys++) != '\0')
834 continue;
835
836 return yyd - 1;
837}
838# endif
839# endif
840
841# ifndef yytnamerr
842/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
843 quotes and backslashes, so that it's suitable for yyerror. The
844 heuristic is that double-quoting is unnecessary unless the string
845 contains an apostrophe, a comma, or backslash (other than
846 backslash-backslash). YYSTR is taken from yytname. If YYRES is
847 null, do not copy; instead, return the length of what the result
848 would have been. */
849static YYSIZE_T
850yytnamerr (char *yyres, const char *yystr)
851{
852 if (*yystr == '"')
853 {
854 YYSIZE_T yyn = 0;
855 char const *yyp = yystr;
856
857 for (;;)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700858 switch (*++yyp)
859 {
860 case '\'':
861 case ',':
862 goto do_not_strip_quotes;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000863
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700864 case '\\':
865 if (*++yyp != '\\')
866 goto do_not_strip_quotes;
867 /* Fall through. */
868 default:
869 if (yyres)
870 yyres[yyn] = *yyp;
871 yyn++;
872 break;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000873
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700874 case '"':
875 if (yyres)
876 yyres[yyn] = '\0';
877 return yyn;
878 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000879 do_not_strip_quotes: ;
880 }
881
882 if (! yyres)
883 return yystrlen (yystr);
884
885 return yystpcpy (yyres, yystr) - yyres;
886}
887# endif
888
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200889/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
890 about the unexpected token YYTOKEN for the state stack whose top is
891 YYSSP.
892
893 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
894 not large enough to hold the message. In that case, also set
895 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
896 required number of bytes is too large to store. */
897static int
898yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
899 yytype_int16 *yyssp, int yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000900{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700901 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200902 YYSIZE_T yysize = yysize0;
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200903 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
904 /* Internationalized format string. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700905 const char *yyformat = YY_NULLPTR;
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200906 /* Arguments of yyformat. */
907 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
908 /* Number of reported tokens (one for the "unexpected", one per
909 "expected"). */
910 int yycount = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000911
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200912 /* There are many possibilities here to consider:
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200913 - If this state is a consistent state with a default action, then
914 the only way this function was invoked is if the default action
915 is an error action. In that case, don't check for expected
916 tokens because there are none.
917 - The only way there can be no lookahead present (in yychar) is if
918 this state is a consistent state with a default action. Thus,
919 detecting the absence of a lookahead is sufficient to determine
920 that there is no unexpected or expected token to report. In that
921 case, just report a simple "syntax error".
922 - Don't assume there isn't a lookahead just because this state is a
923 consistent state with a default action. There might have been a
924 previous inconsistent state, consistent state with a non-default
925 action, or user semantic action that manipulated yychar.
926 - Of course, the expected token list depends on states to have
927 correct lookahead information, and it depends on the parser not
928 to perform extra reductions after fetching a lookahead from the
929 scanner and before detecting a syntax error. Thus, state merging
930 (from LALR or IELR) and default reductions corrupt the expected
931 token list. However, the list is correct for canonical LR with
932 one exception: it will still contain any token that will not be
933 accepted due to an error action in a later state.
934 */
935 if (yytoken != YYEMPTY)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000936 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200937 int yyn = yypact[*yyssp];
938 yyarg[yycount++] = yytname[yytoken];
939 if (!yypact_value_is_default (yyn))
940 {
941 /* Start YYX at -YYN if negative to avoid negative indexes in
942 YYCHECK. In other words, skip the first -YYN actions for
943 this state because they are default actions. */
944 int yyxbegin = yyn < 0 ? -yyn : 0;
945 /* Stay within bounds of both yycheck and yytname. */
946 int yychecklim = YYLAST - yyn + 1;
947 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
948 int yyx;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000949
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200950 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
951 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
952 && !yytable_value_is_error (yytable[yyx + yyn]))
953 {
954 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
955 {
956 yycount = 1;
957 yysize = yysize0;
958 break;
959 }
960 yyarg[yycount++] = yytname[yyx];
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700961 {
962 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
963 if (! (yysize <= yysize1
964 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
965 return 2;
966 yysize = yysize1;
967 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200968 }
969 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000970 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200971
972 switch (yycount)
973 {
974# define YYCASE_(N, S) \
975 case N: \
976 yyformat = S; \
977 break
Patrick Rudolphac24d3c2019-04-12 14:42:17 +0200978 default: /* Avoid compiler warnings. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200979 YYCASE_(0, YY_("syntax error"));
980 YYCASE_(1, YY_("syntax error, unexpected %s"));
981 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
982 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
983 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
984 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
985# undef YYCASE_
986 }
987
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700988 {
989 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
990 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
991 return 2;
992 yysize = yysize1;
993 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200994
995 if (*yymsg_alloc < yysize)
996 {
997 *yymsg_alloc = 2 * yysize;
998 if (! (yysize <= *yymsg_alloc
999 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1000 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1001 return 1;
1002 }
1003
1004 /* Avoid sprintf, as that infringes on the user's name space.
1005 Don't have undefined behavior even if the translation
1006 produced a string with the wrong number of "%s"s. */
1007 {
1008 char *yyp = *yymsg;
1009 int yyi = 0;
1010 while ((*yyp = *yyformat) != '\0')
1011 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1012 {
1013 yyp += yytnamerr (yyp, yyarg[yyi++]);
1014 yyformat += 2;
1015 }
1016 else
1017 {
1018 yyp++;
1019 yyformat++;
1020 }
1021 }
1022 return 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001023}
1024#endif /* YYERROR_VERBOSE */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001025
1026/*-----------------------------------------------.
1027| Release the memory associated to this symbol. |
1028`-----------------------------------------------*/
1029
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001030static void
1031yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001032{
1033 YYUSE (yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001034 if (!yymsg)
1035 yymsg = "Deleting";
1036 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1037
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001038 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1039 YYUSE (yytype);
1040 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001041}
1042
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001043
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001044
1045
1046/* The lookahead symbol. */
1047int yychar;
1048
1049/* The semantic value of the lookahead symbol. */
1050YYSTYPE yylval;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001051/* Number of syntax errors so far. */
1052int yynerrs;
1053
1054
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001055/*----------.
1056| yyparse. |
1057`----------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001058
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001059int
1060yyparse (void)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001061{
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001062 int yystate;
1063 /* Number of tokens to shift before error messages enabled. */
1064 int yyerrstatus;
1065
1066 /* The stacks and their tools:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001067 'yyss': related to states.
1068 'yyvs': related to semantic values.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001069
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001070 Refer to the stacks through separate pointers, to allow yyoverflow
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001071 to reallocate them elsewhere. */
1072
1073 /* The state stack. */
1074 yytype_int16 yyssa[YYINITDEPTH];
1075 yytype_int16 *yyss;
1076 yytype_int16 *yyssp;
1077
1078 /* The semantic value stack. */
1079 YYSTYPE yyvsa[YYINITDEPTH];
1080 YYSTYPE *yyvs;
1081 YYSTYPE *yyvsp;
1082
1083 YYSIZE_T yystacksize;
1084
1085 int yyn;
1086 int yyresult;
1087 /* Lookahead token as an internal (translated) token number. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001088 int yytoken = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001089 /* The variables used to return semantic value and location from the
1090 action routines. */
1091 YYSTYPE yyval;
1092
1093#if YYERROR_VERBOSE
1094 /* Buffer for error messages, and its allocated size. */
1095 char yymsgbuf[128];
1096 char *yymsg = yymsgbuf;
1097 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1098#endif
1099
1100#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1101
1102 /* The number of symbols on the RHS of the reduced rule.
1103 Keep to zero when no symbol should be popped. */
1104 int yylen = 0;
1105
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001106 yyssp = yyss = yyssa;
1107 yyvsp = yyvs = yyvsa;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001108 yystacksize = YYINITDEPTH;
1109
1110 YYDPRINTF ((stderr, "Starting parse\n"));
1111
1112 yystate = 0;
1113 yyerrstatus = 0;
1114 yynerrs = 0;
1115 yychar = YYEMPTY; /* Cause a token to be read. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001116 goto yysetstate;
1117
1118/*------------------------------------------------------------.
1119| yynewstate -- Push a new state, which is found in yystate. |
1120`------------------------------------------------------------*/
1121 yynewstate:
1122 /* In all cases, when you get here, the value and location stacks
1123 have just been pushed. So pushing a state here evens the stacks. */
1124 yyssp++;
1125
1126 yysetstate:
1127 *yyssp = yystate;
1128
1129 if (yyss + yystacksize - 1 <= yyssp)
1130 {
1131 /* Get the current used size of the three stacks, in elements. */
1132 YYSIZE_T yysize = yyssp - yyss + 1;
1133
1134#ifdef yyoverflow
1135 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001136 /* Give user a chance to reallocate the stack. Use copies of
1137 these so that the &'s don't force the real ones into
1138 memory. */
1139 YYSTYPE *yyvs1 = yyvs;
1140 yytype_int16 *yyss1 = yyss;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001141
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001142 /* Each stack pointer address is followed by the size of the
1143 data in use in that stack, in bytes. This used to be a
1144 conditional around just the two extra args, but that might
1145 be undefined if yyoverflow is a macro. */
1146 yyoverflow (YY_("memory exhausted"),
1147 &yyss1, yysize * sizeof (*yyssp),
1148 &yyvs1, yysize * sizeof (*yyvsp),
1149 &yystacksize);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001150
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001151 yyss = yyss1;
1152 yyvs = yyvs1;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001153 }
1154#else /* no yyoverflow */
1155# ifndef YYSTACK_RELOCATE
1156 goto yyexhaustedlab;
1157# else
1158 /* Extend the stack our own way. */
1159 if (YYMAXDEPTH <= yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001160 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001161 yystacksize *= 2;
1162 if (YYMAXDEPTH < yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001163 yystacksize = YYMAXDEPTH;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001164
1165 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001166 yytype_int16 *yyss1 = yyss;
1167 union yyalloc *yyptr =
1168 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1169 if (! yyptr)
1170 goto yyexhaustedlab;
1171 YYSTACK_RELOCATE (yyss_alloc, yyss);
1172 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001173# undef YYSTACK_RELOCATE
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001174 if (yyss1 != yyssa)
1175 YYSTACK_FREE (yyss1);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001176 }
1177# endif
1178#endif /* no yyoverflow */
1179
1180 yyssp = yyss + yysize - 1;
1181 yyvsp = yyvs + yysize - 1;
1182
1183 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001184 (unsigned long int) yystacksize));
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001185
1186 if (yyss + yystacksize - 1 <= yyssp)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001187 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001188 }
1189
1190 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1191
1192 if (yystate == YYFINAL)
1193 YYACCEPT;
1194
1195 goto yybackup;
1196
1197/*-----------.
1198| yybackup. |
1199`-----------*/
1200yybackup:
1201
1202 /* Do appropriate processing given the current state. Read a
1203 lookahead token if we need one and don't already have one. */
1204
1205 /* First try to decide what to do without reference to lookahead token. */
1206 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001207 if (yypact_value_is_default (yyn))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001208 goto yydefault;
1209
1210 /* Not known => get a lookahead token if don't already have one. */
1211
1212 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1213 if (yychar == YYEMPTY)
1214 {
1215 YYDPRINTF ((stderr, "Reading a token: "));
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001216 yychar = yylex ();
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001217 }
1218
1219 if (yychar <= YYEOF)
1220 {
1221 yychar = yytoken = YYEOF;
1222 YYDPRINTF ((stderr, "Now at end of input.\n"));
1223 }
1224 else
1225 {
1226 yytoken = YYTRANSLATE (yychar);
1227 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1228 }
1229
1230 /* If the proper action on seeing token YYTOKEN is to reduce or to
1231 detect an error, take that action. */
1232 yyn += yytoken;
1233 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1234 goto yydefault;
1235 yyn = yytable[yyn];
1236 if (yyn <= 0)
1237 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001238 if (yytable_value_is_error (yyn))
1239 goto yyerrlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001240 yyn = -yyn;
1241 goto yyreduce;
1242 }
1243
1244 /* Count tokens shifted since error; after three, turn off error
1245 status. */
1246 if (yyerrstatus)
1247 yyerrstatus--;
1248
1249 /* Shift the lookahead token. */
1250 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1251
1252 /* Discard the shifted token. */
1253 yychar = YYEMPTY;
1254
1255 yystate = yyn;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001256 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001257 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001258 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001259
1260 goto yynewstate;
1261
1262
1263/*-----------------------------------------------------------.
1264| yydefault -- do the default action for the current state. |
1265`-----------------------------------------------------------*/
1266yydefault:
1267 yyn = yydefact[yystate];
1268 if (yyn == 0)
1269 goto yyerrlab;
1270 goto yyreduce;
1271
1272
1273/*-----------------------------.
1274| yyreduce -- Do a reduction. |
1275`-----------------------------*/
1276yyreduce:
1277 /* yyn is the number of a rule to reduce with. */
1278 yylen = yyr2[yyn];
1279
1280 /* If YYLEN is nonzero, implement the default value of the action:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001281 '$$ = $1'.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001282
1283 Otherwise, the following line sets YYVAL to garbage.
1284 This behavior is undocumented and Bison
1285 users should not rely upon it. Assigning to YYVAL
1286 unconditionally makes the parser a bit smaller, and it avoids a
1287 GCC warning that YYVAL may be used uninitialized. */
1288 yyval = yyvsp[1-yylen];
1289
1290
1291 YY_REDUCE_PRINT (yyn);
1292 switch (yyn)
1293 {
1294 case 2:
1295
Furquan Shaikh93198262018-06-03 04:22:17 -07001296 { cur_parent = root_parent; }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001297
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001298 break;
1299
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001300 case 15:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001301
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001302 {
Furquan Shaikhc56ae2f2018-05-31 10:33:16 -07001303 (yyval.chip_instance) = new_chip_instance((yyvsp[0].string));
1304 chip_enqueue_tail(cur_chip_instance);
1305 cur_chip_instance = (yyval.chip_instance);
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001306}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001307
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001308 break;
1309
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001310 case 16:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001311
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001312 {
Furquan Shaikhc56ae2f2018-05-31 10:33:16 -07001313 cur_chip_instance = chip_dequeue_tail();
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001314}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001315
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001316 break;
1317
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001318 case 17:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001319
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001320 {
Furquan Shaikh93198262018-06-03 04:22:17 -07001321 (yyval.dev) = new_device(cur_parent, cur_chip_instance, (yyvsp[-2].number), (yyvsp[-1].string), (yyvsp[0].number));
1322 cur_parent = (yyval.dev)->last_bus;
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001323}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001324
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001325 break;
1326
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001327 case 18:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001328
1329 {
Furquan Shaikh93198262018-06-03 04:22:17 -07001330 cur_parent = (yyvsp[-2].dev)->parent;
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001331}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001332
Patrick Georgi68befd52010-05-05 12:05:25 +00001333 break;
1334
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001335 case 21:
Patrick Georgi68befd52010-05-05 12:05:25 +00001336
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001337 { add_resource(cur_parent, (yyvsp[-3].number), strtol((yyvsp[-2].string), NULL, 0), strtol((yyvsp[0].string), NULL, 0)); }
1338
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001339 break;
1340
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001341 case 22:
Sven Schnelle270a9082011-03-01 19:58:15 +00001342
Furquan Shaikhc56ae2f2018-05-31 10:33:16 -07001343 { add_register(cur_chip_instance, (yyvsp[-2].string), (yyvsp[0].string)); }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001344
Sven Schnelle270a9082011-03-01 19:58:15 +00001345 break;
1346
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001347 case 23:
Sven Schnelle270a9082011-03-01 19:58:15 +00001348
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001349 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-1].string), NULL, 16), strtol((yyvsp[0].string), NULL, 16), 0); }
1350
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001351 break;
1352
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001353 case 24:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001354
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001355 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-2].string), NULL, 16), strtol((yyvsp[-1].string), NULL, 16), 1); }
1356
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001357 break;
1358
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001359 case 25:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001360
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001361 { add_ioapic_info(cur_parent, strtol((yyvsp[-2].string), NULL, 16), (yyvsp[-1].string), strtol((yyvsp[0].string), NULL, 16)); }
1362
Sven Schnelle270a9082011-03-01 19:58:15 +00001363 break;
1364
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001365 case 26:
1366
1367 { add_slot_desc(cur_parent, (yyvsp[-3].string), (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].string)); }
1368
1369 break;
1370
1371 case 27:
1372
1373 { add_slot_desc(cur_parent, (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].string), NULL); }
1374
1375 break;
1376
1377 case 28:
1378
1379 { add_slot_desc(cur_parent, (yyvsp[-1].string), (yyvsp[0].string), NULL, NULL); }
1380
1381 break;
1382
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001383
1384
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001385 default: break;
1386 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001387 /* User semantic actions sometimes alter yychar, and that requires
1388 that yytoken be updated with the new translation. We take the
1389 approach of translating immediately before every use of yytoken.
1390 One alternative is translating here after every semantic action,
1391 but that translation would be missed if the semantic action invokes
1392 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1393 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1394 incorrect destructor might then be invoked immediately. In the
1395 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1396 to an incorrect destructor call or verbose syntax error message
1397 before the lookahead is translated. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001398 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1399
1400 YYPOPSTACK (yylen);
1401 yylen = 0;
1402 YY_STACK_PRINT (yyss, yyssp);
1403
1404 *++yyvsp = yyval;
1405
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001406 /* Now 'shift' the result of the reduction. Determine what state
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001407 that goes to, based on the state we popped back to and the rule
1408 number reduced by. */
1409
1410 yyn = yyr1[yyn];
1411
1412 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1413 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1414 yystate = yytable[yystate];
1415 else
1416 yystate = yydefgoto[yyn - YYNTOKENS];
1417
1418 goto yynewstate;
1419
1420
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001421/*--------------------------------------.
1422| yyerrlab -- here on detecting error. |
1423`--------------------------------------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001424yyerrlab:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001425 /* Make sure we have latest lookahead translation. See comments at
1426 user semantic actions for why this is necessary. */
1427 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1428
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001429 /* If not already recovering from an error, report this error. */
1430 if (!yyerrstatus)
1431 {
1432 ++yynerrs;
1433#if ! YYERROR_VERBOSE
1434 yyerror (YY_("syntax error"));
1435#else
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001436# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1437 yyssp, yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001438 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001439 char const *yymsgp = YY_("syntax error");
1440 int yysyntax_error_status;
1441 yysyntax_error_status = YYSYNTAX_ERROR;
1442 if (yysyntax_error_status == 0)
1443 yymsgp = yymsg;
1444 else if (yysyntax_error_status == 1)
1445 {
1446 if (yymsg != yymsgbuf)
1447 YYSTACK_FREE (yymsg);
1448 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1449 if (!yymsg)
1450 {
1451 yymsg = yymsgbuf;
1452 yymsg_alloc = sizeof yymsgbuf;
1453 yysyntax_error_status = 2;
1454 }
1455 else
1456 {
1457 yysyntax_error_status = YYSYNTAX_ERROR;
1458 yymsgp = yymsg;
1459 }
1460 }
1461 yyerror (yymsgp);
1462 if (yysyntax_error_status == 2)
1463 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001464 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001465# undef YYSYNTAX_ERROR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001466#endif
1467 }
1468
1469
1470
1471 if (yyerrstatus == 3)
1472 {
1473 /* If just tried and failed to reuse lookahead token after an
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001474 error, discard it. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001475
1476 if (yychar <= YYEOF)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001477 {
1478 /* Return failure if at end of input. */
1479 if (yychar == YYEOF)
1480 YYABORT;
1481 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001482 else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001483 {
1484 yydestruct ("Error: discarding",
1485 yytoken, &yylval);
1486 yychar = YYEMPTY;
1487 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001488 }
1489
1490 /* Else will try to reuse lookahead token after shifting the error
1491 token. */
1492 goto yyerrlab1;
1493
1494
1495/*---------------------------------------------------.
1496| yyerrorlab -- error raised explicitly by YYERROR. |
1497`---------------------------------------------------*/
1498yyerrorlab:
1499
1500 /* Pacify compilers like GCC when the user code never invokes
1501 YYERROR and the label yyerrorlab therefore never appears in user
1502 code. */
1503 if (/*CONSTCOND*/ 0)
1504 goto yyerrorlab;
1505
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001506 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001507 this YYERROR. */
1508 YYPOPSTACK (yylen);
1509 yylen = 0;
1510 YY_STACK_PRINT (yyss, yyssp);
1511 yystate = *yyssp;
1512 goto yyerrlab1;
1513
1514
1515/*-------------------------------------------------------------.
1516| yyerrlab1 -- common code for both syntax error and YYERROR. |
1517`-------------------------------------------------------------*/
1518yyerrlab1:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001519 yyerrstatus = 3; /* Each real token shifted decrements this. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001520
1521 for (;;)
1522 {
1523 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001524 if (!yypact_value_is_default (yyn))
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001525 {
1526 yyn += YYTERROR;
1527 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1528 {
1529 yyn = yytable[yyn];
1530 if (0 < yyn)
1531 break;
1532 }
1533 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001534
1535 /* Pop the current state because it cannot handle the error token. */
1536 if (yyssp == yyss)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001537 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001538
1539
1540 yydestruct ("Error: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001541 yystos[yystate], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001542 YYPOPSTACK (1);
1543 yystate = *yyssp;
1544 YY_STACK_PRINT (yyss, yyssp);
1545 }
1546
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001547 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001548 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001549 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001550
1551
1552 /* Shift the error token. */
1553 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1554
1555 yystate = yyn;
1556 goto yynewstate;
1557
1558
1559/*-------------------------------------.
1560| yyacceptlab -- YYACCEPT comes here. |
1561`-------------------------------------*/
1562yyacceptlab:
1563 yyresult = 0;
1564 goto yyreturn;
1565
1566/*-----------------------------------.
1567| yyabortlab -- YYABORT comes here. |
1568`-----------------------------------*/
1569yyabortlab:
1570 yyresult = 1;
1571 goto yyreturn;
1572
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001573#if !defined yyoverflow || YYERROR_VERBOSE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001574/*-------------------------------------------------.
1575| yyexhaustedlab -- memory exhaustion comes here. |
1576`-------------------------------------------------*/
1577yyexhaustedlab:
1578 yyerror (YY_("memory exhausted"));
1579 yyresult = 2;
1580 /* Fall through. */
1581#endif
1582
1583yyreturn:
1584 if (yychar != YYEMPTY)
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001585 {
1586 /* Make sure we have latest lookahead translation. See comments at
1587 user semantic actions for why this is necessary. */
1588 yytoken = YYTRANSLATE (yychar);
1589 yydestruct ("Cleanup: discarding lookahead",
1590 yytoken, &yylval);
1591 }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001592 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001593 this YYABORT or YYACCEPT. */
1594 YYPOPSTACK (yylen);
1595 YY_STACK_PRINT (yyss, yyssp);
1596 while (yyssp != yyss)
1597 {
1598 yydestruct ("Cleanup: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001599 yystos[*yyssp], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001600 YYPOPSTACK (1);
1601 }
1602#ifndef yyoverflow
1603 if (yyss != yyssa)
1604 YYSTACK_FREE (yyss);
1605#endif
1606#if YYERROR_VERBOSE
1607 if (yymsg != yymsgbuf)
1608 YYSTACK_FREE (yymsg);
1609#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001610 return yyresult;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001611}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001612
1613