blob: d59a1b6883f295dd371d401865299280aee808bc [file] [log] [blame]
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001/* A Bison parser, made by GNU Bison 3.0.4. */
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
5 Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6
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. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -070047#define YYBISON_VERSION "3.0.4"
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,
147 IO = 278,
148 NUMBER = 279,
149 SUBSYSTEMID = 280,
150 INHERIT = 281,
151 IOAPIC_IRQ = 282,
152 IOAPIC = 283,
153 PCIINT = 284,
154 GENERIC = 285,
155 SPI = 286,
156 USB = 287,
157 MMIO = 288
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700158 };
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000159#endif
160
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700161/* Value type. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000162#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700163
164union YYSTYPE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000165{
166
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000167
Furquan Shaikh93198262018-06-03 04:22:17 -0700168 struct device *dev;
Furquan Shaikhc56ae2f2018-05-31 10:33:16 -0700169 struct chip_instance *chip_instance;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000170 char *string;
171 int number;
172
173
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700174};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000175
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700176typedef union YYSTYPE YYSTYPE;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000177# define YYSTYPE_IS_TRIVIAL 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000178# define YYSTYPE_IS_DECLARED 1
179#endif
180
181
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700182extern YYSTYPE yylval;
183
184int yyparse (void);
185
Justin TerAvestca2ed9f2018-01-17 16:36:30 -0800186#endif /* !YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700187
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000188/* Copy the second part of user declarations. */
189
190
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000191
192#ifdef short
193# undef short
194#endif
195
196#ifdef YYTYPE_UINT8
197typedef YYTYPE_UINT8 yytype_uint8;
198#else
199typedef unsigned char yytype_uint8;
200#endif
201
202#ifdef YYTYPE_INT8
203typedef YYTYPE_INT8 yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000204#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700205typedef signed char yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000206#endif
207
208#ifdef YYTYPE_UINT16
209typedef YYTYPE_UINT16 yytype_uint16;
210#else
211typedef unsigned short int yytype_uint16;
212#endif
213
214#ifdef YYTYPE_INT16
215typedef YYTYPE_INT16 yytype_int16;
216#else
217typedef short int yytype_int16;
218#endif
219
220#ifndef YYSIZE_T
221# ifdef __SIZE_TYPE__
222# define YYSIZE_T __SIZE_TYPE__
223# elif defined size_t
224# define YYSIZE_T size_t
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700225# elif ! defined YYSIZE_T
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000226# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
227# define YYSIZE_T size_t
228# else
229# define YYSIZE_T unsigned int
230# endif
231#endif
232
233#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
234
235#ifndef YY_
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200236# if defined YYENABLE_NLS && YYENABLE_NLS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000237# if ENABLE_NLS
238# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700239# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000240# endif
241# endif
242# ifndef YY_
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700243# define YY_(Msgid) Msgid
244# endif
245#endif
246
247#ifndef YY_ATTRIBUTE
248# if (defined __GNUC__ \
249 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
250 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
251# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
252# else
253# define YY_ATTRIBUTE(Spec) /* empty */
254# endif
255#endif
256
257#ifndef YY_ATTRIBUTE_PURE
258# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
259#endif
260
261#ifndef YY_ATTRIBUTE_UNUSED
262# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
263#endif
264
265#if !defined _Noreturn \
266 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
267# if defined _MSC_VER && 1200 <= _MSC_VER
268# define _Noreturn __declspec (noreturn)
269# else
270# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000271# endif
272#endif
273
274/* Suppress unused-variable warnings by "using" E. */
275#if ! defined lint || defined __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700276# define YYUSE(E) ((void) (E))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000277#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700278# define YYUSE(E) /* empty */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000279#endif
280
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700281#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
282/* Suppress an incorrect diagnostic about yylval being uninitialized. */
283# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
284 _Pragma ("GCC diagnostic push") \
285 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
286 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
287# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
288 _Pragma ("GCC diagnostic pop")
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000289#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700290# define YY_INITIAL_VALUE(Value) Value
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000291#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700292#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
293# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
294# define YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000295#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700296#ifndef YY_INITIAL_VALUE
297# define YY_INITIAL_VALUE(Value) /* Nothing. */
298#endif
299
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000300
301#if ! defined yyoverflow || YYERROR_VERBOSE
302
303/* The parser invokes alloca or malloc; define the necessary symbols. */
304
305# ifdef YYSTACK_USE_ALLOCA
306# if YYSTACK_USE_ALLOCA
307# ifdef __GNUC__
308# define YYSTACK_ALLOC __builtin_alloca
309# elif defined __BUILTIN_VA_ARG_INCR
310# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
311# elif defined _AIX
312# define YYSTACK_ALLOC __alloca
313# elif defined _MSC_VER
314# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
315# define alloca _alloca
316# else
317# define YYSTACK_ALLOC alloca
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700318# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000319# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700320 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200321# ifndef EXIT_SUCCESS
322# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000323# endif
324# endif
325# endif
326# endif
327# endif
328
329# ifdef YYSTACK_ALLOC
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700330 /* Pacify GCC's 'empty if-body' warning. */
331# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000332# ifndef YYSTACK_ALLOC_MAXIMUM
333 /* The OS might guarantee only one guard page at the bottom of the stack,
334 and a page size can be as small as 4096 bytes. So we cannot safely
335 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
336 to allow for a few compiler-allocated temporary stack slots. */
337# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
338# endif
339# else
340# define YYSTACK_ALLOC YYMALLOC
341# define YYSTACK_FREE YYFREE
342# ifndef YYSTACK_ALLOC_MAXIMUM
343# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
344# endif
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200345# if (defined __cplusplus && ! defined EXIT_SUCCESS \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000346 && ! ((defined YYMALLOC || defined malloc) \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700347 && (defined YYFREE || defined free)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000348# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200349# ifndef EXIT_SUCCESS
350# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000351# endif
352# endif
353# ifndef YYMALLOC
354# define YYMALLOC malloc
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700355# if ! defined malloc && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000356void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
357# endif
358# endif
359# ifndef YYFREE
360# define YYFREE free
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700361# if ! defined free && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000362void free (void *); /* INFRINGES ON USER NAME SPACE */
363# endif
364# endif
365# endif
366#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
367
368
369#if (! defined yyoverflow \
370 && (! defined __cplusplus \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700371 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000372
373/* A type that is properly aligned for any stack member. */
374union yyalloc
375{
376 yytype_int16 yyss_alloc;
377 YYSTYPE yyvs_alloc;
378};
379
380/* The size of the maximum gap between one aligned stack and the next. */
381# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
382
383/* The size of an array large to enough to hold all stacks, each with
384 N elements. */
385# define YYSTACK_BYTES(N) \
386 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
387 + YYSTACK_GAP_MAXIMUM)
388
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200389# define YYCOPY_NEEDED 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000390
391/* Relocate STACK from its old location to the new one. The
392 local variables YYSIZE and YYSTACKSIZE give the old and new number of
393 elements in the stack, and YYPTR gives the new location of the
394 stack. Advance YYPTR to a properly aligned location for the next
395 stack. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700396# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
397 do \
398 { \
399 YYSIZE_T yynewbytes; \
400 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
401 Stack = &yyptr->Stack_alloc; \
402 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
403 yyptr += yynewbytes / sizeof (*yyptr); \
404 } \
405 while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000406
407#endif
408
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200409#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700410/* Copy COUNT objects from SRC to DST. The source and destination do
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200411 not overlap. */
412# ifndef YYCOPY
413# if defined __GNUC__ && 1 < __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700414# define YYCOPY(Dst, Src, Count) \
415 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200416# else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700417# define YYCOPY(Dst, Src, Count) \
418 do \
419 { \
420 YYSIZE_T yyi; \
421 for (yyi = 0; yyi < (Count); yyi++) \
422 (Dst)[yyi] = (Src)[yyi]; \
423 } \
424 while (0)
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200425# endif
426# endif
427#endif /* !YYCOPY_NEEDED */
428
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000429/* YYFINAL -- State number of the termination state. */
Patrick Georgi68befd52010-05-05 12:05:25 +0000430#define YYFINAL 3
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000431/* YYLAST -- Last index in YYTABLE. */
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800432#define YYLAST 40
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000433
434/* YYNTOKENS -- Number of terminals. */
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800435#define YYNTOKENS 34
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000436/* YYNNTS -- Number of nonterminals. */
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800437#define YYNNTS 14
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000438/* YYNRULES -- Number of rules. */
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800439#define YYNRULES 24
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700440/* YYNSTATES -- Number of states. */
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800441#define YYNSTATES 43
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000442
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700443/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
444 by yylex, with out-of-bounds checking. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000445#define YYUNDEFTOK 2
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800446#define YYMAXUTOK 288
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000447
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700448#define YYTRANSLATE(YYX) \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000449 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
450
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700451/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
452 as returned by yylex, without out-of-bounds checking. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000453static const yytype_uint8 yytranslate[] =
454{
455 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
481 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200482 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800483 25, 26, 27, 28, 29, 30, 31, 32, 33
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000484};
485
486#if YYDEBUG
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700487 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
Patrick Georgi114e7b22010-05-05 11:19:50 +0000488static const yytype_uint8 yyrline[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000489{
Furquan Shaikh79e84122018-05-30 15:09:09 -0700490 0, 36, 36, 36, 38, 38, 38, 38, 40, 40,
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800491 40, 40, 40, 40, 42, 42, 51, 51, 59, 59,
492 61, 64, 67, 70, 73
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000493};
494#endif
495
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700496#if YYDEBUG || YYERROR_VERBOSE || 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000497/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
498 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
499static const char *const yytname[] =
500{
501 "$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800502 "HIDDEN", "BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI",
503 "PNP", "I2C", "APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ", "IO",
504 "NUMBER", "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IOAPIC", "PCIINT",
505 "GENERIC", "SPI", "USB", "MMIO", "$accept", "devtree", "$@1",
506 "chipchildren", "devicechildren", "chip", "@2", "device", "@3", "status",
507 "resource", "registers", "subsystemid", "ioapic_irq", YY_NULLPTR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000508};
509#endif
510
511# ifdef YYPRINT
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700512/* YYTOKNUM[NUM] -- (External) token number corresponding to the
513 (internal) symbol number NUM (which must be that of a token). */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000514static const yytype_uint16 yytoknum[] =
515{
516 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
517 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
Furquan Shaikhe6700292017-02-11 00:50:38 -0800518 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800519 285, 286, 287, 288
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000520};
521# endif
522
Aaron Durbinffda804b2014-09-03 12:40:15 -0500523#define YYPACT_NINF -10
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700524
525#define yypact_value_is_default(Yystate) \
526 (!!((Yystate) == (-10)))
527
528#define YYTABLE_NINF -1
529
530#define yytable_value_is_error(Yytable_value) \
531 0
532
533 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
534 STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000535static const yytype_int8 yypact[] =
536{
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800537 -10, 11, 9, -10, 1, -10, -10, -10, 0, 5,
538 3, -10, -10, -10, -10, -9, 6, 2, 7, -10,
539 -10, -10, -10, -10, -3, -5, -10, -1, 4, -10,
540 -10, -10, -10, -10, 10, 8, -4, 12, 13, 14,
541 -10, -10, -10
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000542};
543
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700544 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
545 Performed when YYTABLE does not specify something else to do. Zero
546 means the default is an error. */
547static const yytype_uint8 yydefact[] =
548{
549 2, 0, 0, 1, 0, 3, 14, 7, 0, 0,
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800550 0, 15, 5, 4, 6, 0, 0, 0, 0, 18,
551 19, 16, 21, 13, 0, 0, 17, 0, 0, 9,
552 8, 10, 11, 12, 0, 0, 0, 0, 22, 0,
553 20, 23, 24
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700554};
555
556 /* YYPGOTO[NTERM-NUM]. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000557static const yytype_int8 yypgoto[] =
558{
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800559 -10, -10, -10, -10, -10, -6, -10, 16, -10, -10,
560 -10, -10, -10, -10
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000561};
562
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700563 /* YYDEFGOTO[NTERM-NUM]. */
564static const yytype_int8 yydefgoto[] =
565{
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800566 -1, 1, 2, 8, 24, 5, 7, 13, 23, 21,
567 31, 14, 32, 33
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700568};
569
570 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
571 positive, shift that token. If negative, reduce the rule whose
572 number is the opposite. If YYTABLE_NINF, syntax error. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000573static const yytype_uint8 yytable[] =
574{
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800575 4, 9, 12, 4, 9, 10, 25, 26, 19, 20,
576 11, 3, 4, 15, 6, 17, 16, 18, 29, 34,
577 22, 37, 27, 35, 28, 39, 0, 0, 36, 0,
578 0, 0, 38, 0, 0, 0, 40, 0, 42, 41,
579 30
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000580};
581
Patrick Georgi8f625f62010-05-05 13:13:47 +0000582static const yytype_int8 yycheck[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000583{
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800584 3, 4, 8, 3, 4, 5, 9, 10, 6, 7,
585 10, 0, 3, 8, 13, 24, 13, 11, 24, 24,
586 13, 11, 25, 24, 27, 29, -1, -1, 24, -1,
587 -1, -1, 24, -1, -1, -1, 24, -1, 24, 26,
588 24
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000589};
590
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700591 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
592 symbol of state STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000593static const yytype_uint8 yystos[] =
594{
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800595 0, 35, 36, 0, 3, 39, 13, 40, 37, 4,
596 5, 10, 39, 41, 45, 8, 13, 24, 11, 6,
597 7, 43, 13, 42, 38, 9, 10, 25, 27, 39,
598 41, 44, 46, 47, 24, 24, 24, 11, 24, 29,
599 24, 26, 24
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000600};
601
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700602 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
603static const yytype_uint8 yyr1[] =
604{
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800605 0, 34, 36, 35, 37, 37, 37, 37, 38, 38,
606 38, 38, 38, 38, 40, 39, 42, 41, 43, 43,
607 44, 45, 46, 46, 47
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700608};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000609
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700610 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
611static const yytype_uint8 yyr2[] =
612{
613 0, 2, 0, 2, 2, 2, 2, 0, 2, 2,
Hung-Te Lin936dbe12018-09-10 10:51:26 +0800614 2, 2, 2, 0, 0, 5, 0, 7, 1, 1,
615 4, 4, 3, 4, 4
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700616};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000617
618
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700619#define yyerrok (yyerrstatus = 0)
620#define yyclearin (yychar = YYEMPTY)
621#define YYEMPTY (-2)
622#define YYEOF 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000623
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700624#define YYACCEPT goto yyacceptlab
625#define YYABORT goto yyabortlab
626#define YYERROR goto yyerrorlab
627
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000628
629#define YYRECOVERING() (!!yyerrstatus)
630
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700631#define YYBACKUP(Token, Value) \
632do \
633 if (yychar == YYEMPTY) \
634 { \
635 yychar = (Token); \
636 yylval = (Value); \
637 YYPOPSTACK (yylen); \
638 yystate = *yyssp; \
639 goto yybackup; \
640 } \
641 else \
642 { \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000643 yyerror (YY_("syntax error: cannot back up")); \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700644 YYERROR; \
645 } \
646while (0)
647
648/* Error token number */
649#define YYTERROR 1
650#define YYERRCODE 256
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000651
652
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000653
654/* Enable debugging if requested. */
655#if YYDEBUG
656
657# ifndef YYFPRINTF
658# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
659# define YYFPRINTF fprintf
660# endif
661
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700662# define YYDPRINTF(Args) \
663do { \
664 if (yydebug) \
665 YYFPRINTF Args; \
666} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000667
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700668/* This macro is provided for backward compatibility. */
669#ifndef YY_LOCATION_PRINT
670# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
671#endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000672
673
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700674# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
675do { \
676 if (yydebug) \
677 { \
678 YYFPRINTF (stderr, "%s ", Title); \
679 yy_symbol_print (stderr, \
680 Type, Value); \
681 YYFPRINTF (stderr, "\n"); \
682 } \
683} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000684
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700685
686/*----------------------------------------.
687| Print this symbol's value on YYOUTPUT. |
688`----------------------------------------*/
689
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000690static void
691yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000692{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700693 FILE *yyo = yyoutput;
694 YYUSE (yyo);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000695 if (!yyvaluep)
696 return;
697# ifdef YYPRINT
698 if (yytype < YYNTOKENS)
699 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000700# endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700701 YYUSE (yytype);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000702}
703
704
705/*--------------------------------.
706| Print this symbol on YYOUTPUT. |
707`--------------------------------*/
708
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000709static void
710yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000711{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700712 YYFPRINTF (yyoutput, "%s %s (",
713 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000714
715 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
716 YYFPRINTF (yyoutput, ")");
717}
718
719/*------------------------------------------------------------------.
720| yy_stack_print -- Print the state stack from its BOTTOM up to its |
721| TOP (included). |
722`------------------------------------------------------------------*/
723
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000724static void
725yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000726{
727 YYFPRINTF (stderr, "Stack now");
728 for (; yybottom <= yytop; yybottom++)
729 {
730 int yybot = *yybottom;
731 YYFPRINTF (stderr, " %d", yybot);
732 }
733 YYFPRINTF (stderr, "\n");
734}
735
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700736# define YY_STACK_PRINT(Bottom, Top) \
737do { \
738 if (yydebug) \
739 yy_stack_print ((Bottom), (Top)); \
740} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000741
742
743/*------------------------------------------------.
744| Report that the YYRULE is going to be reduced. |
745`------------------------------------------------*/
746
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000747static void
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700748yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000749{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700750 unsigned long int yylno = yyrline[yyrule];
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000751 int yynrhs = yyr2[yyrule];
752 int yyi;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000753 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700754 yyrule - 1, yylno);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000755 /* The symbols being reduced. */
756 for (yyi = 0; yyi < yynrhs; yyi++)
757 {
758 YYFPRINTF (stderr, " $%d = ", yyi + 1);
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700759 yy_symbol_print (stderr,
760 yystos[yyssp[yyi + 1 - yynrhs]],
761 &(yyvsp[(yyi + 1) - (yynrhs)])
762 );
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000763 YYFPRINTF (stderr, "\n");
764 }
765}
766
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700767# define YY_REDUCE_PRINT(Rule) \
768do { \
769 if (yydebug) \
770 yy_reduce_print (yyssp, yyvsp, Rule); \
771} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000772
773/* Nonzero means print parse trace. It is left uninitialized so that
774 multiple parsers can coexist. */
775int yydebug;
776#else /* !YYDEBUG */
777# define YYDPRINTF(Args)
778# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
779# define YY_STACK_PRINT(Bottom, Top)
780# define YY_REDUCE_PRINT(Rule)
781#endif /* !YYDEBUG */
782
783
784/* YYINITDEPTH -- initial size of the parser's stacks. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700785#ifndef YYINITDEPTH
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000786# define YYINITDEPTH 200
787#endif
788
789/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
790 if the built-in stack extension method is used).
791
792 Do not make this value too large; the results are undefined if
793 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
794 evaluated with infinite-precision integer arithmetic. */
795
796#ifndef YYMAXDEPTH
797# define YYMAXDEPTH 10000
798#endif
799
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000800
801#if YYERROR_VERBOSE
802
803# ifndef yystrlen
804# if defined __GLIBC__ && defined _STRING_H
805# define yystrlen strlen
806# else
807/* Return the length of YYSTR. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000808static YYSIZE_T
809yystrlen (const char *yystr)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000810{
811 YYSIZE_T yylen;
812 for (yylen = 0; yystr[yylen]; yylen++)
813 continue;
814 return yylen;
815}
816# endif
817# endif
818
819# ifndef yystpcpy
820# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
821# define yystpcpy stpcpy
822# else
823/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
824 YYDEST. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000825static char *
826yystpcpy (char *yydest, const char *yysrc)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000827{
828 char *yyd = yydest;
829 const char *yys = yysrc;
830
831 while ((*yyd++ = *yys++) != '\0')
832 continue;
833
834 return yyd - 1;
835}
836# endif
837# endif
838
839# ifndef yytnamerr
840/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
841 quotes and backslashes, so that it's suitable for yyerror. The
842 heuristic is that double-quoting is unnecessary unless the string
843 contains an apostrophe, a comma, or backslash (other than
844 backslash-backslash). YYSTR is taken from yytname. If YYRES is
845 null, do not copy; instead, return the length of what the result
846 would have been. */
847static YYSIZE_T
848yytnamerr (char *yyres, const char *yystr)
849{
850 if (*yystr == '"')
851 {
852 YYSIZE_T yyn = 0;
853 char const *yyp = yystr;
854
855 for (;;)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700856 switch (*++yyp)
857 {
858 case '\'':
859 case ',':
860 goto do_not_strip_quotes;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000861
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700862 case '\\':
863 if (*++yyp != '\\')
864 goto do_not_strip_quotes;
865 /* Fall through. */
866 default:
867 if (yyres)
868 yyres[yyn] = *yyp;
869 yyn++;
870 break;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000871
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700872 case '"':
873 if (yyres)
874 yyres[yyn] = '\0';
875 return yyn;
876 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000877 do_not_strip_quotes: ;
878 }
879
880 if (! yyres)
881 return yystrlen (yystr);
882
883 return yystpcpy (yyres, yystr) - yyres;
884}
885# endif
886
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200887/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
888 about the unexpected token YYTOKEN for the state stack whose top is
889 YYSSP.
890
891 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
892 not large enough to hold the message. In that case, also set
893 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
894 required number of bytes is too large to store. */
895static int
896yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
897 yytype_int16 *yyssp, int yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000898{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700899 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200900 YYSIZE_T yysize = yysize0;
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200901 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
902 /* Internationalized format string. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700903 const char *yyformat = YY_NULLPTR;
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200904 /* Arguments of yyformat. */
905 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
906 /* Number of reported tokens (one for the "unexpected", one per
907 "expected"). */
908 int yycount = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000909
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200910 /* There are many possibilities here to consider:
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200911 - If this state is a consistent state with a default action, then
912 the only way this function was invoked is if the default action
913 is an error action. In that case, don't check for expected
914 tokens because there are none.
915 - The only way there can be no lookahead present (in yychar) is if
916 this state is a consistent state with a default action. Thus,
917 detecting the absence of a lookahead is sufficient to determine
918 that there is no unexpected or expected token to report. In that
919 case, just report a simple "syntax error".
920 - Don't assume there isn't a lookahead just because this state is a
921 consistent state with a default action. There might have been a
922 previous inconsistent state, consistent state with a non-default
923 action, or user semantic action that manipulated yychar.
924 - Of course, the expected token list depends on states to have
925 correct lookahead information, and it depends on the parser not
926 to perform extra reductions after fetching a lookahead from the
927 scanner and before detecting a syntax error. Thus, state merging
928 (from LALR or IELR) and default reductions corrupt the expected
929 token list. However, the list is correct for canonical LR with
930 one exception: it will still contain any token that will not be
931 accepted due to an error action in a later state.
932 */
933 if (yytoken != YYEMPTY)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000934 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200935 int yyn = yypact[*yyssp];
936 yyarg[yycount++] = yytname[yytoken];
937 if (!yypact_value_is_default (yyn))
938 {
939 /* Start YYX at -YYN if negative to avoid negative indexes in
940 YYCHECK. In other words, skip the first -YYN actions for
941 this state because they are default actions. */
942 int yyxbegin = yyn < 0 ? -yyn : 0;
943 /* Stay within bounds of both yycheck and yytname. */
944 int yychecklim = YYLAST - yyn + 1;
945 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
946 int yyx;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000947
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200948 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
949 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
950 && !yytable_value_is_error (yytable[yyx + yyn]))
951 {
952 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
953 {
954 yycount = 1;
955 yysize = yysize0;
956 break;
957 }
958 yyarg[yycount++] = yytname[yyx];
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700959 {
960 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
961 if (! (yysize <= yysize1
962 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
963 return 2;
964 yysize = yysize1;
965 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200966 }
967 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000968 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200969
970 switch (yycount)
971 {
972# define YYCASE_(N, S) \
973 case N: \
974 yyformat = S; \
975 break
976 YYCASE_(0, YY_("syntax error"));
977 YYCASE_(1, YY_("syntax error, unexpected %s"));
978 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
979 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
980 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
981 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
982# undef YYCASE_
983 }
984
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700985 {
986 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
987 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
988 return 2;
989 yysize = yysize1;
990 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200991
992 if (*yymsg_alloc < yysize)
993 {
994 *yymsg_alloc = 2 * yysize;
995 if (! (yysize <= *yymsg_alloc
996 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
997 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
998 return 1;
999 }
1000
1001 /* Avoid sprintf, as that infringes on the user's name space.
1002 Don't have undefined behavior even if the translation
1003 produced a string with the wrong number of "%s"s. */
1004 {
1005 char *yyp = *yymsg;
1006 int yyi = 0;
1007 while ((*yyp = *yyformat) != '\0')
1008 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1009 {
1010 yyp += yytnamerr (yyp, yyarg[yyi++]);
1011 yyformat += 2;
1012 }
1013 else
1014 {
1015 yyp++;
1016 yyformat++;
1017 }
1018 }
1019 return 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001020}
1021#endif /* YYERROR_VERBOSE */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001022
1023/*-----------------------------------------------.
1024| Release the memory associated to this symbol. |
1025`-----------------------------------------------*/
1026
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001027static void
1028yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001029{
1030 YYUSE (yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001031 if (!yymsg)
1032 yymsg = "Deleting";
1033 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1034
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001035 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1036 YYUSE (yytype);
1037 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001038}
1039
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001040
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001041
1042
1043/* The lookahead symbol. */
1044int yychar;
1045
1046/* The semantic value of the lookahead symbol. */
1047YYSTYPE yylval;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001048/* Number of syntax errors so far. */
1049int yynerrs;
1050
1051
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001052/*----------.
1053| yyparse. |
1054`----------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001055
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001056int
1057yyparse (void)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001058{
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001059 int yystate;
1060 /* Number of tokens to shift before error messages enabled. */
1061 int yyerrstatus;
1062
1063 /* The stacks and their tools:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001064 'yyss': related to states.
1065 'yyvs': related to semantic values.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001066
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001067 Refer to the stacks through separate pointers, to allow yyoverflow
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001068 to reallocate them elsewhere. */
1069
1070 /* The state stack. */
1071 yytype_int16 yyssa[YYINITDEPTH];
1072 yytype_int16 *yyss;
1073 yytype_int16 *yyssp;
1074
1075 /* The semantic value stack. */
1076 YYSTYPE yyvsa[YYINITDEPTH];
1077 YYSTYPE *yyvs;
1078 YYSTYPE *yyvsp;
1079
1080 YYSIZE_T yystacksize;
1081
1082 int yyn;
1083 int yyresult;
1084 /* Lookahead token as an internal (translated) token number. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001085 int yytoken = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001086 /* The variables used to return semantic value and location from the
1087 action routines. */
1088 YYSTYPE yyval;
1089
1090#if YYERROR_VERBOSE
1091 /* Buffer for error messages, and its allocated size. */
1092 char yymsgbuf[128];
1093 char *yymsg = yymsgbuf;
1094 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1095#endif
1096
1097#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1098
1099 /* The number of symbols on the RHS of the reduced rule.
1100 Keep to zero when no symbol should be popped. */
1101 int yylen = 0;
1102
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001103 yyssp = yyss = yyssa;
1104 yyvsp = yyvs = yyvsa;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001105 yystacksize = YYINITDEPTH;
1106
1107 YYDPRINTF ((stderr, "Starting parse\n"));
1108
1109 yystate = 0;
1110 yyerrstatus = 0;
1111 yynerrs = 0;
1112 yychar = YYEMPTY; /* Cause a token to be read. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001113 goto yysetstate;
1114
1115/*------------------------------------------------------------.
1116| yynewstate -- Push a new state, which is found in yystate. |
1117`------------------------------------------------------------*/
1118 yynewstate:
1119 /* In all cases, when you get here, the value and location stacks
1120 have just been pushed. So pushing a state here evens the stacks. */
1121 yyssp++;
1122
1123 yysetstate:
1124 *yyssp = yystate;
1125
1126 if (yyss + yystacksize - 1 <= yyssp)
1127 {
1128 /* Get the current used size of the three stacks, in elements. */
1129 YYSIZE_T yysize = yyssp - yyss + 1;
1130
1131#ifdef yyoverflow
1132 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001133 /* Give user a chance to reallocate the stack. Use copies of
1134 these so that the &'s don't force the real ones into
1135 memory. */
1136 YYSTYPE *yyvs1 = yyvs;
1137 yytype_int16 *yyss1 = yyss;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001138
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001139 /* Each stack pointer address is followed by the size of the
1140 data in use in that stack, in bytes. This used to be a
1141 conditional around just the two extra args, but that might
1142 be undefined if yyoverflow is a macro. */
1143 yyoverflow (YY_("memory exhausted"),
1144 &yyss1, yysize * sizeof (*yyssp),
1145 &yyvs1, yysize * sizeof (*yyvsp),
1146 &yystacksize);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001147
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001148 yyss = yyss1;
1149 yyvs = yyvs1;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001150 }
1151#else /* no yyoverflow */
1152# ifndef YYSTACK_RELOCATE
1153 goto yyexhaustedlab;
1154# else
1155 /* Extend the stack our own way. */
1156 if (YYMAXDEPTH <= yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001157 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001158 yystacksize *= 2;
1159 if (YYMAXDEPTH < yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001160 yystacksize = YYMAXDEPTH;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001161
1162 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001163 yytype_int16 *yyss1 = yyss;
1164 union yyalloc *yyptr =
1165 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1166 if (! yyptr)
1167 goto yyexhaustedlab;
1168 YYSTACK_RELOCATE (yyss_alloc, yyss);
1169 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001170# undef YYSTACK_RELOCATE
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001171 if (yyss1 != yyssa)
1172 YYSTACK_FREE (yyss1);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001173 }
1174# endif
1175#endif /* no yyoverflow */
1176
1177 yyssp = yyss + yysize - 1;
1178 yyvsp = yyvs + yysize - 1;
1179
1180 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001181 (unsigned long int) yystacksize));
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001182
1183 if (yyss + yystacksize - 1 <= yyssp)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001184 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001185 }
1186
1187 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1188
1189 if (yystate == YYFINAL)
1190 YYACCEPT;
1191
1192 goto yybackup;
1193
1194/*-----------.
1195| yybackup. |
1196`-----------*/
1197yybackup:
1198
1199 /* Do appropriate processing given the current state. Read a
1200 lookahead token if we need one and don't already have one. */
1201
1202 /* First try to decide what to do without reference to lookahead token. */
1203 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001204 if (yypact_value_is_default (yyn))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001205 goto yydefault;
1206
1207 /* Not known => get a lookahead token if don't already have one. */
1208
1209 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1210 if (yychar == YYEMPTY)
1211 {
1212 YYDPRINTF ((stderr, "Reading a token: "));
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001213 yychar = yylex ();
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001214 }
1215
1216 if (yychar <= YYEOF)
1217 {
1218 yychar = yytoken = YYEOF;
1219 YYDPRINTF ((stderr, "Now at end of input.\n"));
1220 }
1221 else
1222 {
1223 yytoken = YYTRANSLATE (yychar);
1224 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1225 }
1226
1227 /* If the proper action on seeing token YYTOKEN is to reduce or to
1228 detect an error, take that action. */
1229 yyn += yytoken;
1230 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1231 goto yydefault;
1232 yyn = yytable[yyn];
1233 if (yyn <= 0)
1234 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001235 if (yytable_value_is_error (yyn))
1236 goto yyerrlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001237 yyn = -yyn;
1238 goto yyreduce;
1239 }
1240
1241 /* Count tokens shifted since error; after three, turn off error
1242 status. */
1243 if (yyerrstatus)
1244 yyerrstatus--;
1245
1246 /* Shift the lookahead token. */
1247 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1248
1249 /* Discard the shifted token. */
1250 yychar = YYEMPTY;
1251
1252 yystate = yyn;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001253 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001254 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001255 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001256
1257 goto yynewstate;
1258
1259
1260/*-----------------------------------------------------------.
1261| yydefault -- do the default action for the current state. |
1262`-----------------------------------------------------------*/
1263yydefault:
1264 yyn = yydefact[yystate];
1265 if (yyn == 0)
1266 goto yyerrlab;
1267 goto yyreduce;
1268
1269
1270/*-----------------------------.
1271| yyreduce -- Do a reduction. |
1272`-----------------------------*/
1273yyreduce:
1274 /* yyn is the number of a rule to reduce with. */
1275 yylen = yyr2[yyn];
1276
1277 /* If YYLEN is nonzero, implement the default value of the action:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001278 '$$ = $1'.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001279
1280 Otherwise, the following line sets YYVAL to garbage.
1281 This behavior is undocumented and Bison
1282 users should not rely upon it. Assigning to YYVAL
1283 unconditionally makes the parser a bit smaller, and it avoids a
1284 GCC warning that YYVAL may be used uninitialized. */
1285 yyval = yyvsp[1-yylen];
1286
1287
1288 YY_REDUCE_PRINT (yyn);
1289 switch (yyn)
1290 {
1291 case 2:
1292
Furquan Shaikh93198262018-06-03 04:22:17 -07001293 { cur_parent = root_parent; }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001294
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001295 break;
1296
Sven Schnelle270a9082011-03-01 19:58:15 +00001297 case 14:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001298
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001299 {
Furquan Shaikhc56ae2f2018-05-31 10:33:16 -07001300 (yyval.chip_instance) = new_chip_instance((yyvsp[0].string));
1301 chip_enqueue_tail(cur_chip_instance);
1302 cur_chip_instance = (yyval.chip_instance);
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001303}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001304
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001305 break;
1306
Sven Schnelle270a9082011-03-01 19:58:15 +00001307 case 15:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001308
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001309 {
Furquan Shaikhc56ae2f2018-05-31 10:33:16 -07001310 cur_chip_instance = chip_dequeue_tail();
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001311}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001312
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001313 break;
1314
Sven Schnelle270a9082011-03-01 19:58:15 +00001315 case 16:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001316
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001317 {
Furquan Shaikh93198262018-06-03 04:22:17 -07001318 (yyval.dev) = new_device(cur_parent, cur_chip_instance, (yyvsp[-2].number), (yyvsp[-1].string), (yyvsp[0].number));
1319 cur_parent = (yyval.dev)->last_bus;
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001320}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001321
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001322 break;
1323
1324 case 17:
1325
1326 {
Furquan Shaikh93198262018-06-03 04:22:17 -07001327 cur_parent = (yyvsp[-2].dev)->parent;
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001328}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001329
Patrick Georgi68befd52010-05-05 12:05:25 +00001330 break;
1331
Hung-Te Lin936dbe12018-09-10 10:51:26 +08001332 case 20:
Patrick Georgi68befd52010-05-05 12:05:25 +00001333
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001334 { add_resource(cur_parent, (yyvsp[-3].number), strtol((yyvsp[-2].string), NULL, 0), strtol((yyvsp[0].string), NULL, 0)); }
1335
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001336 break;
1337
Hung-Te Lin936dbe12018-09-10 10:51:26 +08001338 case 21:
Sven Schnelle270a9082011-03-01 19:58:15 +00001339
Furquan Shaikhc56ae2f2018-05-31 10:33:16 -07001340 { add_register(cur_chip_instance, (yyvsp[-2].string), (yyvsp[0].string)); }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001341
Sven Schnelle270a9082011-03-01 19:58:15 +00001342 break;
1343
Hung-Te Lin936dbe12018-09-10 10:51:26 +08001344 case 22:
Sven Schnelle270a9082011-03-01 19:58:15 +00001345
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001346 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-1].string), NULL, 16), strtol((yyvsp[0].string), NULL, 16), 0); }
1347
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001348 break;
1349
Hung-Te Lin936dbe12018-09-10 10:51:26 +08001350 case 23:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001351
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001352 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-2].string), NULL, 16), strtol((yyvsp[-1].string), NULL, 16), 1); }
1353
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001354 break;
1355
Hung-Te Lin936dbe12018-09-10 10:51:26 +08001356 case 24:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001357
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001358 { add_ioapic_info(cur_parent, strtol((yyvsp[-2].string), NULL, 16), (yyvsp[-1].string), strtol((yyvsp[0].string), NULL, 16)); }
1359
Sven Schnelle270a9082011-03-01 19:58:15 +00001360 break;
1361
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001362
1363
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001364 default: break;
1365 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001366 /* User semantic actions sometimes alter yychar, and that requires
1367 that yytoken be updated with the new translation. We take the
1368 approach of translating immediately before every use of yytoken.
1369 One alternative is translating here after every semantic action,
1370 but that translation would be missed if the semantic action invokes
1371 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1372 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1373 incorrect destructor might then be invoked immediately. In the
1374 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1375 to an incorrect destructor call or verbose syntax error message
1376 before the lookahead is translated. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001377 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1378
1379 YYPOPSTACK (yylen);
1380 yylen = 0;
1381 YY_STACK_PRINT (yyss, yyssp);
1382
1383 *++yyvsp = yyval;
1384
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001385 /* Now 'shift' the result of the reduction. Determine what state
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001386 that goes to, based on the state we popped back to and the rule
1387 number reduced by. */
1388
1389 yyn = yyr1[yyn];
1390
1391 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1392 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1393 yystate = yytable[yystate];
1394 else
1395 yystate = yydefgoto[yyn - YYNTOKENS];
1396
1397 goto yynewstate;
1398
1399
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001400/*--------------------------------------.
1401| yyerrlab -- here on detecting error. |
1402`--------------------------------------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001403yyerrlab:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001404 /* Make sure we have latest lookahead translation. See comments at
1405 user semantic actions for why this is necessary. */
1406 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1407
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001408 /* If not already recovering from an error, report this error. */
1409 if (!yyerrstatus)
1410 {
1411 ++yynerrs;
1412#if ! YYERROR_VERBOSE
1413 yyerror (YY_("syntax error"));
1414#else
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001415# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1416 yyssp, yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001417 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001418 char const *yymsgp = YY_("syntax error");
1419 int yysyntax_error_status;
1420 yysyntax_error_status = YYSYNTAX_ERROR;
1421 if (yysyntax_error_status == 0)
1422 yymsgp = yymsg;
1423 else if (yysyntax_error_status == 1)
1424 {
1425 if (yymsg != yymsgbuf)
1426 YYSTACK_FREE (yymsg);
1427 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1428 if (!yymsg)
1429 {
1430 yymsg = yymsgbuf;
1431 yymsg_alloc = sizeof yymsgbuf;
1432 yysyntax_error_status = 2;
1433 }
1434 else
1435 {
1436 yysyntax_error_status = YYSYNTAX_ERROR;
1437 yymsgp = yymsg;
1438 }
1439 }
1440 yyerror (yymsgp);
1441 if (yysyntax_error_status == 2)
1442 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001443 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001444# undef YYSYNTAX_ERROR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001445#endif
1446 }
1447
1448
1449
1450 if (yyerrstatus == 3)
1451 {
1452 /* If just tried and failed to reuse lookahead token after an
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001453 error, discard it. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001454
1455 if (yychar <= YYEOF)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001456 {
1457 /* Return failure if at end of input. */
1458 if (yychar == YYEOF)
1459 YYABORT;
1460 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001461 else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001462 {
1463 yydestruct ("Error: discarding",
1464 yytoken, &yylval);
1465 yychar = YYEMPTY;
1466 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001467 }
1468
1469 /* Else will try to reuse lookahead token after shifting the error
1470 token. */
1471 goto yyerrlab1;
1472
1473
1474/*---------------------------------------------------.
1475| yyerrorlab -- error raised explicitly by YYERROR. |
1476`---------------------------------------------------*/
1477yyerrorlab:
1478
1479 /* Pacify compilers like GCC when the user code never invokes
1480 YYERROR and the label yyerrorlab therefore never appears in user
1481 code. */
1482 if (/*CONSTCOND*/ 0)
1483 goto yyerrorlab;
1484
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001485 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001486 this YYERROR. */
1487 YYPOPSTACK (yylen);
1488 yylen = 0;
1489 YY_STACK_PRINT (yyss, yyssp);
1490 yystate = *yyssp;
1491 goto yyerrlab1;
1492
1493
1494/*-------------------------------------------------------------.
1495| yyerrlab1 -- common code for both syntax error and YYERROR. |
1496`-------------------------------------------------------------*/
1497yyerrlab1:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001498 yyerrstatus = 3; /* Each real token shifted decrements this. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001499
1500 for (;;)
1501 {
1502 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001503 if (!yypact_value_is_default (yyn))
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001504 {
1505 yyn += YYTERROR;
1506 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1507 {
1508 yyn = yytable[yyn];
1509 if (0 < yyn)
1510 break;
1511 }
1512 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001513
1514 /* Pop the current state because it cannot handle the error token. */
1515 if (yyssp == yyss)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001516 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001517
1518
1519 yydestruct ("Error: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001520 yystos[yystate], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001521 YYPOPSTACK (1);
1522 yystate = *yyssp;
1523 YY_STACK_PRINT (yyss, yyssp);
1524 }
1525
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001526 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001527 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001528 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001529
1530
1531 /* Shift the error token. */
1532 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1533
1534 yystate = yyn;
1535 goto yynewstate;
1536
1537
1538/*-------------------------------------.
1539| yyacceptlab -- YYACCEPT comes here. |
1540`-------------------------------------*/
1541yyacceptlab:
1542 yyresult = 0;
1543 goto yyreturn;
1544
1545/*-----------------------------------.
1546| yyabortlab -- YYABORT comes here. |
1547`-----------------------------------*/
1548yyabortlab:
1549 yyresult = 1;
1550 goto yyreturn;
1551
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001552#if !defined yyoverflow || YYERROR_VERBOSE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001553/*-------------------------------------------------.
1554| yyexhaustedlab -- memory exhaustion comes here. |
1555`-------------------------------------------------*/
1556yyexhaustedlab:
1557 yyerror (YY_("memory exhausted"));
1558 yyresult = 2;
1559 /* Fall through. */
1560#endif
1561
1562yyreturn:
1563 if (yychar != YYEMPTY)
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001564 {
1565 /* Make sure we have latest lookahead translation. See comments at
1566 user semantic actions for why this is necessary. */
1567 yytoken = YYTRANSLATE (yychar);
1568 yydestruct ("Cleanup: discarding lookahead",
1569 yytoken, &yylval);
1570 }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001571 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001572 this YYABORT or YYACCEPT. */
1573 YYPOPSTACK (yylen);
1574 YY_STACK_PRINT (yyss, yyssp);
1575 while (yyssp != yyss)
1576 {
1577 yydestruct ("Cleanup: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001578 yystos[*yyssp], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001579 YYPOPSTACK (1);
1580 }
1581#ifndef yyoverflow
1582 if (yyss != yyssa)
1583 YYSTACK_FREE (yyss);
1584#endif
1585#if YYERROR_VERBOSE
1586 if (yymsg != yymsgbuf)
1587 YYSTACK_FREE (yymsg);
1588#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001589 return yyresult;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001590}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001591
1592