blob: 1832f35bf3eaf817bb8f13abb0d71accd88d7ffc [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
Patrick Georgi68befd52010-05-05 12:05:25 +000088static struct device *cur_parent, *cur_bus;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000089
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000090
91
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000092
Stefan Reinauer2e78aa52016-05-07 01:11:14 -070093# ifndef YY_NULLPTR
94# if defined __cplusplus && 201103L <= __cplusplus
95# define YY_NULLPTR nullptr
96# else
97# define YY_NULLPTR 0
98# endif
99# endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000100
101/* Enabling verbose error messages. */
102#ifdef YYERROR_VERBOSE
103# undef YYERROR_VERBOSE
104# define YYERROR_VERBOSE 1
105#else
106# define YYERROR_VERBOSE 0
107#endif
108
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700109/* In a future release of Bison, this section will be replaced
110 by #include "sconfig.tab.h_shipped". */
Justin TerAvestca2ed9f2018-01-17 16:36:30 -0800111#ifndef YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
112# define YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700113/* Debug traces. */
114#ifndef YYDEBUG
115# define YYDEBUG 0
116#endif
117#if YYDEBUG
118extern int yydebug;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000119#endif
120
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700121/* Token type. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000122#ifndef YYTOKENTYPE
123# define YYTOKENTYPE
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700124 enum yytokentype
125 {
126 CHIP = 258,
127 DEVICE = 259,
128 REGISTER = 260,
129 BOOL = 261,
130 BUS = 262,
131 RESOURCE = 263,
132 END = 264,
133 EQUALS = 265,
134 HEX = 266,
135 STRING = 267,
136 PCI = 268,
137 PNP = 269,
138 I2C = 270,
139 APIC = 271,
140 CPU_CLUSTER = 272,
141 CPU = 273,
142 DOMAIN = 274,
143 IRQ = 275,
144 DRQ = 276,
145 IO = 277,
146 NUMBER = 278,
147 SUBSYSTEMID = 279,
148 INHERIT = 280,
149 IOAPIC_IRQ = 281,
150 IOAPIC = 282,
Duncan Laurie4650f5b2016-05-07 20:01:34 -0700151 PCIINT = 283,
Furquan Shaikhe6700292017-02-11 00:50:38 -0800152 GENERIC = 284,
Justin TerAvestca2ed9f2018-01-17 16:36:30 -0800153 SPI = 285,
Duncan Lauriebae9f852018-05-07 14:18:13 -0700154 USB = 286,
155 MMIO = 287
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700156 };
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000157#endif
158
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700159/* Value type. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000160#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700161
162union YYSTYPE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000163{
164
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000165
166 struct device *device;
167 char *string;
168 int number;
169
170
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700171};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000172
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700173typedef union YYSTYPE YYSTYPE;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000174# define YYSTYPE_IS_TRIVIAL 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000175# define YYSTYPE_IS_DECLARED 1
176#endif
177
178
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700179extern YYSTYPE yylval;
180
181int yyparse (void);
182
Justin TerAvestca2ed9f2018-01-17 16:36:30 -0800183#endif /* !YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700184
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000185/* Copy the second part of user declarations. */
186
187
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000188
189#ifdef short
190# undef short
191#endif
192
193#ifdef YYTYPE_UINT8
194typedef YYTYPE_UINT8 yytype_uint8;
195#else
196typedef unsigned char yytype_uint8;
197#endif
198
199#ifdef YYTYPE_INT8
200typedef YYTYPE_INT8 yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000201#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700202typedef signed char yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000203#endif
204
205#ifdef YYTYPE_UINT16
206typedef YYTYPE_UINT16 yytype_uint16;
207#else
208typedef unsigned short int yytype_uint16;
209#endif
210
211#ifdef YYTYPE_INT16
212typedef YYTYPE_INT16 yytype_int16;
213#else
214typedef short int yytype_int16;
215#endif
216
217#ifndef YYSIZE_T
218# ifdef __SIZE_TYPE__
219# define YYSIZE_T __SIZE_TYPE__
220# elif defined size_t
221# define YYSIZE_T size_t
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700222# elif ! defined YYSIZE_T
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000223# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
224# define YYSIZE_T size_t
225# else
226# define YYSIZE_T unsigned int
227# endif
228#endif
229
230#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
231
232#ifndef YY_
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200233# if defined YYENABLE_NLS && YYENABLE_NLS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000234# if ENABLE_NLS
235# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700236# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000237# endif
238# endif
239# ifndef YY_
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700240# define YY_(Msgid) Msgid
241# endif
242#endif
243
244#ifndef YY_ATTRIBUTE
245# if (defined __GNUC__ \
246 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
247 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
248# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
249# else
250# define YY_ATTRIBUTE(Spec) /* empty */
251# endif
252#endif
253
254#ifndef YY_ATTRIBUTE_PURE
255# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
256#endif
257
258#ifndef YY_ATTRIBUTE_UNUSED
259# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
260#endif
261
262#if !defined _Noreturn \
263 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
264# if defined _MSC_VER && 1200 <= _MSC_VER
265# define _Noreturn __declspec (noreturn)
266# else
267# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000268# endif
269#endif
270
271/* Suppress unused-variable warnings by "using" E. */
272#if ! defined lint || defined __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700273# define YYUSE(E) ((void) (E))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000274#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700275# define YYUSE(E) /* empty */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000276#endif
277
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700278#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
279/* Suppress an incorrect diagnostic about yylval being uninitialized. */
280# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
281 _Pragma ("GCC diagnostic push") \
282 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
283 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
284# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
285 _Pragma ("GCC diagnostic pop")
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000286#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700287# define YY_INITIAL_VALUE(Value) Value
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000288#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700289#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
290# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
291# define YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000292#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700293#ifndef YY_INITIAL_VALUE
294# define YY_INITIAL_VALUE(Value) /* Nothing. */
295#endif
296
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000297
298#if ! defined yyoverflow || YYERROR_VERBOSE
299
300/* The parser invokes alloca or malloc; define the necessary symbols. */
301
302# ifdef YYSTACK_USE_ALLOCA
303# if YYSTACK_USE_ALLOCA
304# ifdef __GNUC__
305# define YYSTACK_ALLOC __builtin_alloca
306# elif defined __BUILTIN_VA_ARG_INCR
307# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
308# elif defined _AIX
309# define YYSTACK_ALLOC __alloca
310# elif defined _MSC_VER
311# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
312# define alloca _alloca
313# else
314# define YYSTACK_ALLOC alloca
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700315# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000316# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700317 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200318# ifndef EXIT_SUCCESS
319# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000320# endif
321# endif
322# endif
323# endif
324# endif
325
326# ifdef YYSTACK_ALLOC
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700327 /* Pacify GCC's 'empty if-body' warning. */
328# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000329# ifndef YYSTACK_ALLOC_MAXIMUM
330 /* The OS might guarantee only one guard page at the bottom of the stack,
331 and a page size can be as small as 4096 bytes. So we cannot safely
332 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
333 to allow for a few compiler-allocated temporary stack slots. */
334# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
335# endif
336# else
337# define YYSTACK_ALLOC YYMALLOC
338# define YYSTACK_FREE YYFREE
339# ifndef YYSTACK_ALLOC_MAXIMUM
340# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
341# endif
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200342# if (defined __cplusplus && ! defined EXIT_SUCCESS \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000343 && ! ((defined YYMALLOC || defined malloc) \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700344 && (defined YYFREE || defined free)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000345# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200346# ifndef EXIT_SUCCESS
347# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000348# endif
349# endif
350# ifndef YYMALLOC
351# define YYMALLOC malloc
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700352# if ! defined malloc && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000353void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
354# endif
355# endif
356# ifndef YYFREE
357# define YYFREE free
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700358# if ! defined free && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000359void free (void *); /* INFRINGES ON USER NAME SPACE */
360# endif
361# endif
362# endif
363#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
364
365
366#if (! defined yyoverflow \
367 && (! defined __cplusplus \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700368 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000369
370/* A type that is properly aligned for any stack member. */
371union yyalloc
372{
373 yytype_int16 yyss_alloc;
374 YYSTYPE yyvs_alloc;
375};
376
377/* The size of the maximum gap between one aligned stack and the next. */
378# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
379
380/* The size of an array large to enough to hold all stacks, each with
381 N elements. */
382# define YYSTACK_BYTES(N) \
383 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
384 + YYSTACK_GAP_MAXIMUM)
385
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200386# define YYCOPY_NEEDED 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000387
388/* Relocate STACK from its old location to the new one. The
389 local variables YYSIZE and YYSTACKSIZE give the old and new number of
390 elements in the stack, and YYPTR gives the new location of the
391 stack. Advance YYPTR to a properly aligned location for the next
392 stack. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700393# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
394 do \
395 { \
396 YYSIZE_T yynewbytes; \
397 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
398 Stack = &yyptr->Stack_alloc; \
399 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
400 yyptr += yynewbytes / sizeof (*yyptr); \
401 } \
402 while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000403
404#endif
405
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200406#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700407/* Copy COUNT objects from SRC to DST. The source and destination do
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200408 not overlap. */
409# ifndef YYCOPY
410# if defined __GNUC__ && 1 < __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700411# define YYCOPY(Dst, Src, Count) \
412 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200413# else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700414# define YYCOPY(Dst, Src, Count) \
415 do \
416 { \
417 YYSIZE_T yyi; \
418 for (yyi = 0; yyi < (Count); yyi++) \
419 (Dst)[yyi] = (Src)[yyi]; \
420 } \
421 while (0)
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200422# endif
423# endif
424#endif /* !YYCOPY_NEEDED */
425
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000426/* YYFINAL -- State number of the termination state. */
Patrick Georgi68befd52010-05-05 12:05:25 +0000427#define YYFINAL 3
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000428/* YYLAST -- Last index in YYTABLE. */
Aaron Durbinffda804b2014-09-03 12:40:15 -0500429#define YYLAST 39
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000430
431/* YYNTOKENS -- Number of terminals. */
Duncan Lauriebae9f852018-05-07 14:18:13 -0700432#define YYNTOKENS 33
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000433/* YYNNTS -- Number of nonterminals. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200434#define YYNNTS 13
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000435/* YYNRULES -- Number of rules. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200436#define YYNRULES 22
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700437/* YYNSTATES -- Number of states. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200438#define YYNSTATES 41
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000439
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700440/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
441 by yylex, with out-of-bounds checking. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000442#define YYUNDEFTOK 2
Duncan Lauriebae9f852018-05-07 14:18:13 -0700443#define YYMAXUTOK 287
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000444
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700445#define YYTRANSLATE(YYX) \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000446 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
447
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700448/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
449 as returned by yylex, without out-of-bounds checking. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000450static const yytype_uint8 yytranslate[] =
451{
452 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
478 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200479 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
Duncan Lauriebae9f852018-05-07 14:18:13 -0700480 25, 26, 27, 28, 29, 30, 31, 32
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000481};
482
483#if YYDEBUG
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700484 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
Patrick Georgi114e7b22010-05-05 11:19:50 +0000485static const yytype_uint8 yyrline[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000486{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700487 0, 34, 34, 34, 36, 36, 36, 36, 38, 38,
488 38, 38, 38, 38, 40, 40, 50, 50, 62, 65,
489 68, 71, 74
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000490};
491#endif
492
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700493#if YYDEBUG || YYERROR_VERBOSE || 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000494/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
495 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
496static const char *const yytname[] =
497{
498 "$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
499 "BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI", "PNP", "I2C",
Aaron Durbinffda804b2014-09-03 12:40:15 -0500500 "APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ", "IO", "NUMBER",
Duncan Laurie4650f5b2016-05-07 20:01:34 -0700501 "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IOAPIC", "PCIINT", "GENERIC",
Duncan Lauriebae9f852018-05-07 14:18:13 -0700502 "SPI", "USB", "MMIO", "$accept", "devtree", "$@1", "chipchildren",
Justin TerAvestca2ed9f2018-01-17 16:36:30 -0800503 "devicechildren", "chip", "@2", "device", "@3", "resource", "registers",
504 "subsystemid", "ioapic_irq", YY_NULLPTR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000505};
506#endif
507
508# ifdef YYPRINT
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700509/* YYTOKNUM[NUM] -- (External) token number corresponding to the
510 (internal) symbol number NUM (which must be that of a token). */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000511static const yytype_uint16 yytoknum[] =
512{
513 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
514 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
Furquan Shaikhe6700292017-02-11 00:50:38 -0800515 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
Duncan Lauriebae9f852018-05-07 14:18:13 -0700516 285, 286, 287
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000517};
518# endif
519
Aaron Durbinffda804b2014-09-03 12:40:15 -0500520#define YYPACT_NINF -10
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700521
522#define yypact_value_is_default(Yystate) \
523 (!!((Yystate) == (-10)))
524
525#define YYTABLE_NINF -1
526
527#define yytable_value_is_error(Yytable_value) \
528 0
529
530 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
531 STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000532static const yytype_int8 yypact[] =
533{
Aaron Durbinffda804b2014-09-03 12:40:15 -0500534 -10, 3, 1, -10, -2, -10, -10, -10, 4, 5,
535 -1, -10, -10, -10, -10, -9, 7, 9, 6, -10,
536 -10, -10, -3, -4, -10, 2, 8, -10, -10, -10,
537 -10, -10, 10, 11, 0, 12, 13, 14, -10, -10,
538 -10
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000539};
540
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700541 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
542 Performed when YYTABLE does not specify something else to do. Zero
543 means the default is an error. */
544static const yytype_uint8 yydefact[] =
545{
546 2, 0, 0, 1, 0, 3, 14, 7, 0, 0,
547 0, 15, 5, 4, 6, 0, 0, 0, 0, 16,
548 19, 13, 0, 0, 17, 0, 0, 9, 8, 10,
549 11, 12, 0, 0, 0, 0, 20, 0, 18, 21,
550 22
551};
552
553 /* YYPGOTO[NTERM-NUM]. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000554static const yytype_int8 yypgoto[] =
555{
Aaron Durbinffda804b2014-09-03 12:40:15 -0500556 -10, -10, -10, -10, -10, -6, -10, 17, -10, -10,
557 -10, -10, -10
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000558};
559
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700560 /* YYDEFGOTO[NTERM-NUM]. */
561static const yytype_int8 yydefgoto[] =
562{
563 -1, 1, 2, 8, 22, 5, 7, 13, 21, 29,
564 14, 30, 31
565};
566
567 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
568 positive, shift that token. If negative, reduce the rule whose
569 number is the opposite. If YYTABLE_NINF, syntax error. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000570static const yytype_uint8 yytable[] =
571{
Sven Schnelle270a9082011-03-01 19:58:15 +0000572 4, 9, 12, 3, 4, 23, 24, 4, 9, 10,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500573 6, 16, 15, 11, 17, 19, 27, 18, 20, 32,
574 35, 25, 0, 26, 0, 33, 0, 0, 37, 0,
575 0, 34, 0, 0, 36, 38, 0, 40, 39, 28
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000576};
577
Patrick Georgi8f625f62010-05-05 13:13:47 +0000578static const yytype_int8 yycheck[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000579{
Sven Schnelle270a9082011-03-01 19:58:15 +0000580 3, 4, 8, 0, 3, 8, 9, 3, 4, 5,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500581 12, 12, 7, 9, 23, 6, 22, 10, 12, 23,
582 10, 24, -1, 26, -1, 23, -1, -1, 28, -1,
583 -1, 23, -1, -1, 23, 23, -1, 23, 25, 22
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000584};
585
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700586 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
587 symbol of state STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000588static const yytype_uint8 yystos[] =
589{
Duncan Lauriebae9f852018-05-07 14:18:13 -0700590 0, 34, 35, 0, 3, 38, 12, 39, 36, 4,
591 5, 9, 38, 40, 43, 7, 12, 23, 10, 6,
592 12, 41, 37, 8, 9, 24, 26, 38, 40, 42,
593 44, 45, 23, 23, 23, 10, 23, 28, 23, 25,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500594 23
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000595};
596
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700597 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
598static const yytype_uint8 yyr1[] =
599{
Duncan Lauriebae9f852018-05-07 14:18:13 -0700600 0, 33, 35, 34, 36, 36, 36, 36, 37, 37,
601 37, 37, 37, 37, 39, 38, 41, 40, 42, 43,
602 44, 44, 45
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700603};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000604
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700605 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
606static const yytype_uint8 yyr2[] =
607{
608 0, 2, 0, 2, 2, 2, 2, 0, 2, 2,
609 2, 2, 2, 0, 0, 5, 0, 7, 4, 4,
610 3, 4, 4
611};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000612
613
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700614#define yyerrok (yyerrstatus = 0)
615#define yyclearin (yychar = YYEMPTY)
616#define YYEMPTY (-2)
617#define YYEOF 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000618
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700619#define YYACCEPT goto yyacceptlab
620#define YYABORT goto yyabortlab
621#define YYERROR goto yyerrorlab
622
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000623
624#define YYRECOVERING() (!!yyerrstatus)
625
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700626#define YYBACKUP(Token, Value) \
627do \
628 if (yychar == YYEMPTY) \
629 { \
630 yychar = (Token); \
631 yylval = (Value); \
632 YYPOPSTACK (yylen); \
633 yystate = *yyssp; \
634 goto yybackup; \
635 } \
636 else \
637 { \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000638 yyerror (YY_("syntax error: cannot back up")); \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700639 YYERROR; \
640 } \
641while (0)
642
643/* Error token number */
644#define YYTERROR 1
645#define YYERRCODE 256
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000646
647
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000648
649/* Enable debugging if requested. */
650#if YYDEBUG
651
652# ifndef YYFPRINTF
653# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
654# define YYFPRINTF fprintf
655# endif
656
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700657# define YYDPRINTF(Args) \
658do { \
659 if (yydebug) \
660 YYFPRINTF Args; \
661} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000662
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700663/* This macro is provided for backward compatibility. */
664#ifndef YY_LOCATION_PRINT
665# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
666#endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000667
668
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700669# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
670do { \
671 if (yydebug) \
672 { \
673 YYFPRINTF (stderr, "%s ", Title); \
674 yy_symbol_print (stderr, \
675 Type, Value); \
676 YYFPRINTF (stderr, "\n"); \
677 } \
678} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000679
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700680
681/*----------------------------------------.
682| Print this symbol's value on YYOUTPUT. |
683`----------------------------------------*/
684
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000685static void
686yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000687{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700688 FILE *yyo = yyoutput;
689 YYUSE (yyo);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000690 if (!yyvaluep)
691 return;
692# ifdef YYPRINT
693 if (yytype < YYNTOKENS)
694 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000695# endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700696 YYUSE (yytype);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000697}
698
699
700/*--------------------------------.
701| Print this symbol on YYOUTPUT. |
702`--------------------------------*/
703
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000704static void
705yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000706{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700707 YYFPRINTF (yyoutput, "%s %s (",
708 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000709
710 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
711 YYFPRINTF (yyoutput, ")");
712}
713
714/*------------------------------------------------------------------.
715| yy_stack_print -- Print the state stack from its BOTTOM up to its |
716| TOP (included). |
717`------------------------------------------------------------------*/
718
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000719static void
720yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000721{
722 YYFPRINTF (stderr, "Stack now");
723 for (; yybottom <= yytop; yybottom++)
724 {
725 int yybot = *yybottom;
726 YYFPRINTF (stderr, " %d", yybot);
727 }
728 YYFPRINTF (stderr, "\n");
729}
730
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700731# define YY_STACK_PRINT(Bottom, Top) \
732do { \
733 if (yydebug) \
734 yy_stack_print ((Bottom), (Top)); \
735} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000736
737
738/*------------------------------------------------.
739| Report that the YYRULE is going to be reduced. |
740`------------------------------------------------*/
741
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000742static void
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700743yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000744{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700745 unsigned long int yylno = yyrline[yyrule];
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000746 int yynrhs = yyr2[yyrule];
747 int yyi;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000748 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700749 yyrule - 1, yylno);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000750 /* The symbols being reduced. */
751 for (yyi = 0; yyi < yynrhs; yyi++)
752 {
753 YYFPRINTF (stderr, " $%d = ", yyi + 1);
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700754 yy_symbol_print (stderr,
755 yystos[yyssp[yyi + 1 - yynrhs]],
756 &(yyvsp[(yyi + 1) - (yynrhs)])
757 );
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000758 YYFPRINTF (stderr, "\n");
759 }
760}
761
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700762# define YY_REDUCE_PRINT(Rule) \
763do { \
764 if (yydebug) \
765 yy_reduce_print (yyssp, yyvsp, Rule); \
766} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000767
768/* Nonzero means print parse trace. It is left uninitialized so that
769 multiple parsers can coexist. */
770int yydebug;
771#else /* !YYDEBUG */
772# define YYDPRINTF(Args)
773# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
774# define YY_STACK_PRINT(Bottom, Top)
775# define YY_REDUCE_PRINT(Rule)
776#endif /* !YYDEBUG */
777
778
779/* YYINITDEPTH -- initial size of the parser's stacks. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700780#ifndef YYINITDEPTH
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000781# define YYINITDEPTH 200
782#endif
783
784/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
785 if the built-in stack extension method is used).
786
787 Do not make this value too large; the results are undefined if
788 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
789 evaluated with infinite-precision integer arithmetic. */
790
791#ifndef YYMAXDEPTH
792# define YYMAXDEPTH 10000
793#endif
794
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000795
796#if YYERROR_VERBOSE
797
798# ifndef yystrlen
799# if defined __GLIBC__ && defined _STRING_H
800# define yystrlen strlen
801# else
802/* Return the length of YYSTR. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000803static YYSIZE_T
804yystrlen (const char *yystr)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000805{
806 YYSIZE_T yylen;
807 for (yylen = 0; yystr[yylen]; yylen++)
808 continue;
809 return yylen;
810}
811# endif
812# endif
813
814# ifndef yystpcpy
815# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
816# define yystpcpy stpcpy
817# else
818/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
819 YYDEST. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000820static char *
821yystpcpy (char *yydest, const char *yysrc)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000822{
823 char *yyd = yydest;
824 const char *yys = yysrc;
825
826 while ((*yyd++ = *yys++) != '\0')
827 continue;
828
829 return yyd - 1;
830}
831# endif
832# endif
833
834# ifndef yytnamerr
835/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
836 quotes and backslashes, so that it's suitable for yyerror. The
837 heuristic is that double-quoting is unnecessary unless the string
838 contains an apostrophe, a comma, or backslash (other than
839 backslash-backslash). YYSTR is taken from yytname. If YYRES is
840 null, do not copy; instead, return the length of what the result
841 would have been. */
842static YYSIZE_T
843yytnamerr (char *yyres, const char *yystr)
844{
845 if (*yystr == '"')
846 {
847 YYSIZE_T yyn = 0;
848 char const *yyp = yystr;
849
850 for (;;)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700851 switch (*++yyp)
852 {
853 case '\'':
854 case ',':
855 goto do_not_strip_quotes;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000856
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700857 case '\\':
858 if (*++yyp != '\\')
859 goto do_not_strip_quotes;
860 /* Fall through. */
861 default:
862 if (yyres)
863 yyres[yyn] = *yyp;
864 yyn++;
865 break;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000866
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700867 case '"':
868 if (yyres)
869 yyres[yyn] = '\0';
870 return yyn;
871 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000872 do_not_strip_quotes: ;
873 }
874
875 if (! yyres)
876 return yystrlen (yystr);
877
878 return yystpcpy (yyres, yystr) - yyres;
879}
880# endif
881
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200882/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
883 about the unexpected token YYTOKEN for the state stack whose top is
884 YYSSP.
885
886 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
887 not large enough to hold the message. In that case, also set
888 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
889 required number of bytes is too large to store. */
890static int
891yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
892 yytype_int16 *yyssp, int yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000893{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700894 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200895 YYSIZE_T yysize = yysize0;
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200896 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
897 /* Internationalized format string. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700898 const char *yyformat = YY_NULLPTR;
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200899 /* Arguments of yyformat. */
900 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
901 /* Number of reported tokens (one for the "unexpected", one per
902 "expected"). */
903 int yycount = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000904
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200905 /* There are many possibilities here to consider:
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200906 - If this state is a consistent state with a default action, then
907 the only way this function was invoked is if the default action
908 is an error action. In that case, don't check for expected
909 tokens because there are none.
910 - The only way there can be no lookahead present (in yychar) is if
911 this state is a consistent state with a default action. Thus,
912 detecting the absence of a lookahead is sufficient to determine
913 that there is no unexpected or expected token to report. In that
914 case, just report a simple "syntax error".
915 - Don't assume there isn't a lookahead just because this state is a
916 consistent state with a default action. There might have been a
917 previous inconsistent state, consistent state with a non-default
918 action, or user semantic action that manipulated yychar.
919 - Of course, the expected token list depends on states to have
920 correct lookahead information, and it depends on the parser not
921 to perform extra reductions after fetching a lookahead from the
922 scanner and before detecting a syntax error. Thus, state merging
923 (from LALR or IELR) and default reductions corrupt the expected
924 token list. However, the list is correct for canonical LR with
925 one exception: it will still contain any token that will not be
926 accepted due to an error action in a later state.
927 */
928 if (yytoken != YYEMPTY)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000929 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200930 int yyn = yypact[*yyssp];
931 yyarg[yycount++] = yytname[yytoken];
932 if (!yypact_value_is_default (yyn))
933 {
934 /* Start YYX at -YYN if negative to avoid negative indexes in
935 YYCHECK. In other words, skip the first -YYN actions for
936 this state because they are default actions. */
937 int yyxbegin = yyn < 0 ? -yyn : 0;
938 /* Stay within bounds of both yycheck and yytname. */
939 int yychecklim = YYLAST - yyn + 1;
940 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
941 int yyx;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000942
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200943 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
944 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
945 && !yytable_value_is_error (yytable[yyx + yyn]))
946 {
947 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
948 {
949 yycount = 1;
950 yysize = yysize0;
951 break;
952 }
953 yyarg[yycount++] = yytname[yyx];
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700954 {
955 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
956 if (! (yysize <= yysize1
957 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
958 return 2;
959 yysize = yysize1;
960 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200961 }
962 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000963 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200964
965 switch (yycount)
966 {
967# define YYCASE_(N, S) \
968 case N: \
969 yyformat = S; \
970 break
971 YYCASE_(0, YY_("syntax error"));
972 YYCASE_(1, YY_("syntax error, unexpected %s"));
973 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
974 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
975 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
976 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
977# undef YYCASE_
978 }
979
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700980 {
981 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
982 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
983 return 2;
984 yysize = yysize1;
985 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200986
987 if (*yymsg_alloc < yysize)
988 {
989 *yymsg_alloc = 2 * yysize;
990 if (! (yysize <= *yymsg_alloc
991 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
992 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
993 return 1;
994 }
995
996 /* Avoid sprintf, as that infringes on the user's name space.
997 Don't have undefined behavior even if the translation
998 produced a string with the wrong number of "%s"s. */
999 {
1000 char *yyp = *yymsg;
1001 int yyi = 0;
1002 while ((*yyp = *yyformat) != '\0')
1003 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1004 {
1005 yyp += yytnamerr (yyp, yyarg[yyi++]);
1006 yyformat += 2;
1007 }
1008 else
1009 {
1010 yyp++;
1011 yyformat++;
1012 }
1013 }
1014 return 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001015}
1016#endif /* YYERROR_VERBOSE */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001017
1018/*-----------------------------------------------.
1019| Release the memory associated to this symbol. |
1020`-----------------------------------------------*/
1021
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001022static void
1023yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001024{
1025 YYUSE (yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001026 if (!yymsg)
1027 yymsg = "Deleting";
1028 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1029
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001030 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1031 YYUSE (yytype);
1032 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001033}
1034
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001035
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001036
1037
1038/* The lookahead symbol. */
1039int yychar;
1040
1041/* The semantic value of the lookahead symbol. */
1042YYSTYPE yylval;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001043/* Number of syntax errors so far. */
1044int yynerrs;
1045
1046
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001047/*----------.
1048| yyparse. |
1049`----------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001050
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001051int
1052yyparse (void)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001053{
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001054 int yystate;
1055 /* Number of tokens to shift before error messages enabled. */
1056 int yyerrstatus;
1057
1058 /* The stacks and their tools:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001059 'yyss': related to states.
1060 'yyvs': related to semantic values.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001061
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001062 Refer to the stacks through separate pointers, to allow yyoverflow
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001063 to reallocate them elsewhere. */
1064
1065 /* The state stack. */
1066 yytype_int16 yyssa[YYINITDEPTH];
1067 yytype_int16 *yyss;
1068 yytype_int16 *yyssp;
1069
1070 /* The semantic value stack. */
1071 YYSTYPE yyvsa[YYINITDEPTH];
1072 YYSTYPE *yyvs;
1073 YYSTYPE *yyvsp;
1074
1075 YYSIZE_T yystacksize;
1076
1077 int yyn;
1078 int yyresult;
1079 /* Lookahead token as an internal (translated) token number. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001080 int yytoken = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001081 /* The variables used to return semantic value and location from the
1082 action routines. */
1083 YYSTYPE yyval;
1084
1085#if YYERROR_VERBOSE
1086 /* Buffer for error messages, and its allocated size. */
1087 char yymsgbuf[128];
1088 char *yymsg = yymsgbuf;
1089 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1090#endif
1091
1092#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1093
1094 /* The number of symbols on the RHS of the reduced rule.
1095 Keep to zero when no symbol should be popped. */
1096 int yylen = 0;
1097
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001098 yyssp = yyss = yyssa;
1099 yyvsp = yyvs = yyvsa;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001100 yystacksize = YYINITDEPTH;
1101
1102 YYDPRINTF ((stderr, "Starting parse\n"));
1103
1104 yystate = 0;
1105 yyerrstatus = 0;
1106 yynerrs = 0;
1107 yychar = YYEMPTY; /* Cause a token to be read. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001108 goto yysetstate;
1109
1110/*------------------------------------------------------------.
1111| yynewstate -- Push a new state, which is found in yystate. |
1112`------------------------------------------------------------*/
1113 yynewstate:
1114 /* In all cases, when you get here, the value and location stacks
1115 have just been pushed. So pushing a state here evens the stacks. */
1116 yyssp++;
1117
1118 yysetstate:
1119 *yyssp = yystate;
1120
1121 if (yyss + yystacksize - 1 <= yyssp)
1122 {
1123 /* Get the current used size of the three stacks, in elements. */
1124 YYSIZE_T yysize = yyssp - yyss + 1;
1125
1126#ifdef yyoverflow
1127 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001128 /* Give user a chance to reallocate the stack. Use copies of
1129 these so that the &'s don't force the real ones into
1130 memory. */
1131 YYSTYPE *yyvs1 = yyvs;
1132 yytype_int16 *yyss1 = yyss;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001133
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001134 /* Each stack pointer address is followed by the size of the
1135 data in use in that stack, in bytes. This used to be a
1136 conditional around just the two extra args, but that might
1137 be undefined if yyoverflow is a macro. */
1138 yyoverflow (YY_("memory exhausted"),
1139 &yyss1, yysize * sizeof (*yyssp),
1140 &yyvs1, yysize * sizeof (*yyvsp),
1141 &yystacksize);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001142
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001143 yyss = yyss1;
1144 yyvs = yyvs1;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001145 }
1146#else /* no yyoverflow */
1147# ifndef YYSTACK_RELOCATE
1148 goto yyexhaustedlab;
1149# else
1150 /* Extend the stack our own way. */
1151 if (YYMAXDEPTH <= yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001152 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001153 yystacksize *= 2;
1154 if (YYMAXDEPTH < yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001155 yystacksize = YYMAXDEPTH;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001156
1157 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001158 yytype_int16 *yyss1 = yyss;
1159 union yyalloc *yyptr =
1160 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1161 if (! yyptr)
1162 goto yyexhaustedlab;
1163 YYSTACK_RELOCATE (yyss_alloc, yyss);
1164 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001165# undef YYSTACK_RELOCATE
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001166 if (yyss1 != yyssa)
1167 YYSTACK_FREE (yyss1);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001168 }
1169# endif
1170#endif /* no yyoverflow */
1171
1172 yyssp = yyss + yysize - 1;
1173 yyvsp = yyvs + yysize - 1;
1174
1175 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001176 (unsigned long int) yystacksize));
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001177
1178 if (yyss + yystacksize - 1 <= yyssp)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001179 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001180 }
1181
1182 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1183
1184 if (yystate == YYFINAL)
1185 YYACCEPT;
1186
1187 goto yybackup;
1188
1189/*-----------.
1190| yybackup. |
1191`-----------*/
1192yybackup:
1193
1194 /* Do appropriate processing given the current state. Read a
1195 lookahead token if we need one and don't already have one. */
1196
1197 /* First try to decide what to do without reference to lookahead token. */
1198 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001199 if (yypact_value_is_default (yyn))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001200 goto yydefault;
1201
1202 /* Not known => get a lookahead token if don't already have one. */
1203
1204 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1205 if (yychar == YYEMPTY)
1206 {
1207 YYDPRINTF ((stderr, "Reading a token: "));
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001208 yychar = yylex ();
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001209 }
1210
1211 if (yychar <= YYEOF)
1212 {
1213 yychar = yytoken = YYEOF;
1214 YYDPRINTF ((stderr, "Now at end of input.\n"));
1215 }
1216 else
1217 {
1218 yytoken = YYTRANSLATE (yychar);
1219 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1220 }
1221
1222 /* If the proper action on seeing token YYTOKEN is to reduce or to
1223 detect an error, take that action. */
1224 yyn += yytoken;
1225 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1226 goto yydefault;
1227 yyn = yytable[yyn];
1228 if (yyn <= 0)
1229 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001230 if (yytable_value_is_error (yyn))
1231 goto yyerrlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001232 yyn = -yyn;
1233 goto yyreduce;
1234 }
1235
1236 /* Count tokens shifted since error; after three, turn off error
1237 status. */
1238 if (yyerrstatus)
1239 yyerrstatus--;
1240
1241 /* Shift the lookahead token. */
1242 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1243
1244 /* Discard the shifted token. */
1245 yychar = YYEMPTY;
1246
1247 yystate = yyn;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001248 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001249 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001250 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001251
1252 goto yynewstate;
1253
1254
1255/*-----------------------------------------------------------.
1256| yydefault -- do the default action for the current state. |
1257`-----------------------------------------------------------*/
1258yydefault:
1259 yyn = yydefact[yystate];
1260 if (yyn == 0)
1261 goto yyerrlab;
1262 goto yyreduce;
1263
1264
1265/*-----------------------------.
1266| yyreduce -- Do a reduction. |
1267`-----------------------------*/
1268yyreduce:
1269 /* yyn is the number of a rule to reduce with. */
1270 yylen = yyr2[yyn];
1271
1272 /* If YYLEN is nonzero, implement the default value of the action:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001273 '$$ = $1'.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001274
1275 Otherwise, the following line sets YYVAL to garbage.
1276 This behavior is undocumented and Bison
1277 users should not rely upon it. Assigning to YYVAL
1278 unconditionally makes the parser a bit smaller, and it avoids a
1279 GCC warning that YYVAL may be used uninitialized. */
1280 yyval = yyvsp[1-yylen];
1281
1282
1283 YY_REDUCE_PRINT (yyn);
1284 switch (yyn)
1285 {
1286 case 2:
1287
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001288 { cur_parent = cur_bus = head; }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001289
Patrick Georgi68befd52010-05-05 12:05:25 +00001290 break;
1291
1292 case 3:
1293
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001294 { postprocess_devtree(); }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001295
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001296 break;
1297
Sven Schnelle270a9082011-03-01 19:58:15 +00001298 case 14:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001299
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001300 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001301 (yyval.device) = new_chip(cur_parent, cur_bus, (yyvsp[0].string));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001302 cur_parent = (yyval.device);
1303}
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 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001310 cur_parent = (yyvsp[-2].device)->parent;
1311 fold_in((yyvsp[-2].device));
1312 add_header((yyvsp[-2].device));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001313}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001314
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001315 break;
1316
Sven Schnelle270a9082011-03-01 19:58:15 +00001317 case 16:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001318
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001319 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001320 (yyval.device) = new_device(cur_parent, cur_bus, (yyvsp[-2].number), (yyvsp[-1].string), (yyvsp[0].number));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001321 cur_parent = (yyval.device);
1322 cur_bus = (yyval.device);
1323}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001324
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001325 break;
1326
1327 case 17:
1328
1329 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001330 cur_parent = (yyvsp[-2].device)->parent;
1331 cur_bus = (yyvsp[-2].device)->bus;
1332 fold_in((yyvsp[-2].device));
1333 alias_siblings((yyvsp[-2].device)->children);
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001334}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001335
Patrick Georgi68befd52010-05-05 12:05:25 +00001336 break;
1337
Sven Schnelle270a9082011-03-01 19:58:15 +00001338 case 18:
Patrick Georgi68befd52010-05-05 12:05:25 +00001339
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001340 { add_resource(cur_parent, (yyvsp[-3].number), strtol((yyvsp[-2].string), NULL, 0), strtol((yyvsp[0].string), NULL, 0)); }
1341
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001342 break;
1343
Sven Schnelle270a9082011-03-01 19:58:15 +00001344 case 19:
1345
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001346 { add_register(cur_parent, (yyvsp[-2].string), (yyvsp[0].string)); }
1347
Sven Schnelle270a9082011-03-01 19:58:15 +00001348 break;
1349
1350 case 20:
1351
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001352 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-1].string), NULL, 16), strtol((yyvsp[0].string), NULL, 16), 0); }
1353
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001354 break;
1355
1356 case 21:
1357
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001358 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-2].string), NULL, 16), strtol((yyvsp[-1].string), NULL, 16), 1); }
1359
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001360 break;
1361
1362 case 22:
1363
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001364 { add_ioapic_info(cur_parent, strtol((yyvsp[-2].string), NULL, 16), (yyvsp[-1].string), strtol((yyvsp[0].string), NULL, 16)); }
1365
Sven Schnelle270a9082011-03-01 19:58:15 +00001366 break;
1367
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001368
1369
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001370 default: break;
1371 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001372 /* User semantic actions sometimes alter yychar, and that requires
1373 that yytoken be updated with the new translation. We take the
1374 approach of translating immediately before every use of yytoken.
1375 One alternative is translating here after every semantic action,
1376 but that translation would be missed if the semantic action invokes
1377 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1378 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1379 incorrect destructor might then be invoked immediately. In the
1380 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1381 to an incorrect destructor call or verbose syntax error message
1382 before the lookahead is translated. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001383 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1384
1385 YYPOPSTACK (yylen);
1386 yylen = 0;
1387 YY_STACK_PRINT (yyss, yyssp);
1388
1389 *++yyvsp = yyval;
1390
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001391 /* Now 'shift' the result of the reduction. Determine what state
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001392 that goes to, based on the state we popped back to and the rule
1393 number reduced by. */
1394
1395 yyn = yyr1[yyn];
1396
1397 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1398 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1399 yystate = yytable[yystate];
1400 else
1401 yystate = yydefgoto[yyn - YYNTOKENS];
1402
1403 goto yynewstate;
1404
1405
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001406/*--------------------------------------.
1407| yyerrlab -- here on detecting error. |
1408`--------------------------------------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001409yyerrlab:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001410 /* Make sure we have latest lookahead translation. See comments at
1411 user semantic actions for why this is necessary. */
1412 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1413
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001414 /* If not already recovering from an error, report this error. */
1415 if (!yyerrstatus)
1416 {
1417 ++yynerrs;
1418#if ! YYERROR_VERBOSE
1419 yyerror (YY_("syntax error"));
1420#else
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001421# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1422 yyssp, yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001423 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001424 char const *yymsgp = YY_("syntax error");
1425 int yysyntax_error_status;
1426 yysyntax_error_status = YYSYNTAX_ERROR;
1427 if (yysyntax_error_status == 0)
1428 yymsgp = yymsg;
1429 else if (yysyntax_error_status == 1)
1430 {
1431 if (yymsg != yymsgbuf)
1432 YYSTACK_FREE (yymsg);
1433 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1434 if (!yymsg)
1435 {
1436 yymsg = yymsgbuf;
1437 yymsg_alloc = sizeof yymsgbuf;
1438 yysyntax_error_status = 2;
1439 }
1440 else
1441 {
1442 yysyntax_error_status = YYSYNTAX_ERROR;
1443 yymsgp = yymsg;
1444 }
1445 }
1446 yyerror (yymsgp);
1447 if (yysyntax_error_status == 2)
1448 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001449 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001450# undef YYSYNTAX_ERROR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001451#endif
1452 }
1453
1454
1455
1456 if (yyerrstatus == 3)
1457 {
1458 /* If just tried and failed to reuse lookahead token after an
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001459 error, discard it. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001460
1461 if (yychar <= YYEOF)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001462 {
1463 /* Return failure if at end of input. */
1464 if (yychar == YYEOF)
1465 YYABORT;
1466 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001467 else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001468 {
1469 yydestruct ("Error: discarding",
1470 yytoken, &yylval);
1471 yychar = YYEMPTY;
1472 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001473 }
1474
1475 /* Else will try to reuse lookahead token after shifting the error
1476 token. */
1477 goto yyerrlab1;
1478
1479
1480/*---------------------------------------------------.
1481| yyerrorlab -- error raised explicitly by YYERROR. |
1482`---------------------------------------------------*/
1483yyerrorlab:
1484
1485 /* Pacify compilers like GCC when the user code never invokes
1486 YYERROR and the label yyerrorlab therefore never appears in user
1487 code. */
1488 if (/*CONSTCOND*/ 0)
1489 goto yyerrorlab;
1490
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001491 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001492 this YYERROR. */
1493 YYPOPSTACK (yylen);
1494 yylen = 0;
1495 YY_STACK_PRINT (yyss, yyssp);
1496 yystate = *yyssp;
1497 goto yyerrlab1;
1498
1499
1500/*-------------------------------------------------------------.
1501| yyerrlab1 -- common code for both syntax error and YYERROR. |
1502`-------------------------------------------------------------*/
1503yyerrlab1:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001504 yyerrstatus = 3; /* Each real token shifted decrements this. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001505
1506 for (;;)
1507 {
1508 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001509 if (!yypact_value_is_default (yyn))
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001510 {
1511 yyn += YYTERROR;
1512 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1513 {
1514 yyn = yytable[yyn];
1515 if (0 < yyn)
1516 break;
1517 }
1518 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001519
1520 /* Pop the current state because it cannot handle the error token. */
1521 if (yyssp == yyss)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001522 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001523
1524
1525 yydestruct ("Error: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001526 yystos[yystate], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001527 YYPOPSTACK (1);
1528 yystate = *yyssp;
1529 YY_STACK_PRINT (yyss, yyssp);
1530 }
1531
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001532 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001533 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001534 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001535
1536
1537 /* Shift the error token. */
1538 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1539
1540 yystate = yyn;
1541 goto yynewstate;
1542
1543
1544/*-------------------------------------.
1545| yyacceptlab -- YYACCEPT comes here. |
1546`-------------------------------------*/
1547yyacceptlab:
1548 yyresult = 0;
1549 goto yyreturn;
1550
1551/*-----------------------------------.
1552| yyabortlab -- YYABORT comes here. |
1553`-----------------------------------*/
1554yyabortlab:
1555 yyresult = 1;
1556 goto yyreturn;
1557
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001558#if !defined yyoverflow || YYERROR_VERBOSE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001559/*-------------------------------------------------.
1560| yyexhaustedlab -- memory exhaustion comes here. |
1561`-------------------------------------------------*/
1562yyexhaustedlab:
1563 yyerror (YY_("memory exhausted"));
1564 yyresult = 2;
1565 /* Fall through. */
1566#endif
1567
1568yyreturn:
1569 if (yychar != YYEMPTY)
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001570 {
1571 /* Make sure we have latest lookahead translation. See comments at
1572 user semantic actions for why this is necessary. */
1573 yytoken = YYTRANSLATE (yychar);
1574 yydestruct ("Cleanup: discarding lookahead",
1575 yytoken, &yylval);
1576 }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001577 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001578 this YYABORT or YYACCEPT. */
1579 YYPOPSTACK (yylen);
1580 YY_STACK_PRINT (yyss, yyssp);
1581 while (yyssp != yyss)
1582 {
1583 yydestruct ("Cleanup: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001584 yystos[*yyssp], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001585 YYPOPSTACK (1);
1586 }
1587#ifndef yyoverflow
1588 if (yyss != yyssa)
1589 YYSTACK_FREE (yyss);
1590#endif
1591#if YYERROR_VERBOSE
1592 if (yymsg != yymsgbuf)
1593 YYSTACK_FREE (yymsg);
1594#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001595 return yyresult;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001596}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001597
1598