blob: 4c8b8fffc14add833e9461e583d30a42af57058e [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,
154 MMIO = 286
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700155 };
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000156#endif
157
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700158/* Value type. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000159#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700160
161union YYSTYPE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000162{
163
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000164
165 struct device *device;
166 char *string;
167 int number;
168
169
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700170};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000171
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700172typedef union YYSTYPE YYSTYPE;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000173# define YYSTYPE_IS_TRIVIAL 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000174# define YYSTYPE_IS_DECLARED 1
175#endif
176
177
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700178extern YYSTYPE yylval;
179
180int yyparse (void);
181
Justin TerAvestca2ed9f2018-01-17 16:36:30 -0800182#endif /* !YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700183
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000184/* Copy the second part of user declarations. */
185
186
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000187
188#ifdef short
189# undef short
190#endif
191
192#ifdef YYTYPE_UINT8
193typedef YYTYPE_UINT8 yytype_uint8;
194#else
195typedef unsigned char yytype_uint8;
196#endif
197
198#ifdef YYTYPE_INT8
199typedef YYTYPE_INT8 yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000200#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700201typedef signed char yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000202#endif
203
204#ifdef YYTYPE_UINT16
205typedef YYTYPE_UINT16 yytype_uint16;
206#else
207typedef unsigned short int yytype_uint16;
208#endif
209
210#ifdef YYTYPE_INT16
211typedef YYTYPE_INT16 yytype_int16;
212#else
213typedef short int yytype_int16;
214#endif
215
216#ifndef YYSIZE_T
217# ifdef __SIZE_TYPE__
218# define YYSIZE_T __SIZE_TYPE__
219# elif defined size_t
220# define YYSIZE_T size_t
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700221# elif ! defined YYSIZE_T
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000222# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
223# define YYSIZE_T size_t
224# else
225# define YYSIZE_T unsigned int
226# endif
227#endif
228
229#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
230
231#ifndef YY_
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200232# if defined YYENABLE_NLS && YYENABLE_NLS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000233# if ENABLE_NLS
234# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700235# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000236# endif
237# endif
238# ifndef YY_
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700239# define YY_(Msgid) Msgid
240# endif
241#endif
242
243#ifndef YY_ATTRIBUTE
244# if (defined __GNUC__ \
245 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
246 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
247# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
248# else
249# define YY_ATTRIBUTE(Spec) /* empty */
250# endif
251#endif
252
253#ifndef YY_ATTRIBUTE_PURE
254# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
255#endif
256
257#ifndef YY_ATTRIBUTE_UNUSED
258# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
259#endif
260
261#if !defined _Noreturn \
262 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
263# if defined _MSC_VER && 1200 <= _MSC_VER
264# define _Noreturn __declspec (noreturn)
265# else
266# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000267# endif
268#endif
269
270/* Suppress unused-variable warnings by "using" E. */
271#if ! defined lint || defined __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700272# define YYUSE(E) ((void) (E))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000273#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700274# define YYUSE(E) /* empty */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000275#endif
276
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700277#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
278/* Suppress an incorrect diagnostic about yylval being uninitialized. */
279# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
280 _Pragma ("GCC diagnostic push") \
281 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
282 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
283# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
284 _Pragma ("GCC diagnostic pop")
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000285#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700286# define YY_INITIAL_VALUE(Value) Value
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000287#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700288#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
289# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
290# define YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000291#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700292#ifndef YY_INITIAL_VALUE
293# define YY_INITIAL_VALUE(Value) /* Nothing. */
294#endif
295
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000296
297#if ! defined yyoverflow || YYERROR_VERBOSE
298
299/* The parser invokes alloca or malloc; define the necessary symbols. */
300
301# ifdef YYSTACK_USE_ALLOCA
302# if YYSTACK_USE_ALLOCA
303# ifdef __GNUC__
304# define YYSTACK_ALLOC __builtin_alloca
305# elif defined __BUILTIN_VA_ARG_INCR
306# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
307# elif defined _AIX
308# define YYSTACK_ALLOC __alloca
309# elif defined _MSC_VER
310# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
311# define alloca _alloca
312# else
313# define YYSTACK_ALLOC alloca
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700314# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000315# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700316 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200317# ifndef EXIT_SUCCESS
318# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000319# endif
320# endif
321# endif
322# endif
323# endif
324
325# ifdef YYSTACK_ALLOC
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700326 /* Pacify GCC's 'empty if-body' warning. */
327# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000328# ifndef YYSTACK_ALLOC_MAXIMUM
329 /* The OS might guarantee only one guard page at the bottom of the stack,
330 and a page size can be as small as 4096 bytes. So we cannot safely
331 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
332 to allow for a few compiler-allocated temporary stack slots. */
333# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
334# endif
335# else
336# define YYSTACK_ALLOC YYMALLOC
337# define YYSTACK_FREE YYFREE
338# ifndef YYSTACK_ALLOC_MAXIMUM
339# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
340# endif
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200341# if (defined __cplusplus && ! defined EXIT_SUCCESS \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000342 && ! ((defined YYMALLOC || defined malloc) \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700343 && (defined YYFREE || defined free)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000344# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200345# ifndef EXIT_SUCCESS
346# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000347# endif
348# endif
349# ifndef YYMALLOC
350# define YYMALLOC malloc
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700351# if ! defined malloc && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000352void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
353# endif
354# endif
355# ifndef YYFREE
356# define YYFREE free
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700357# if ! defined free && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000358void free (void *); /* INFRINGES ON USER NAME SPACE */
359# endif
360# endif
361# endif
362#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
363
364
365#if (! defined yyoverflow \
366 && (! defined __cplusplus \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700367 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000368
369/* A type that is properly aligned for any stack member. */
370union yyalloc
371{
372 yytype_int16 yyss_alloc;
373 YYSTYPE yyvs_alloc;
374};
375
376/* The size of the maximum gap between one aligned stack and the next. */
377# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
378
379/* The size of an array large to enough to hold all stacks, each with
380 N elements. */
381# define YYSTACK_BYTES(N) \
382 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
383 + YYSTACK_GAP_MAXIMUM)
384
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200385# define YYCOPY_NEEDED 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000386
387/* Relocate STACK from its old location to the new one. The
388 local variables YYSIZE and YYSTACKSIZE give the old and new number of
389 elements in the stack, and YYPTR gives the new location of the
390 stack. Advance YYPTR to a properly aligned location for the next
391 stack. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700392# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
393 do \
394 { \
395 YYSIZE_T yynewbytes; \
396 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
397 Stack = &yyptr->Stack_alloc; \
398 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
399 yyptr += yynewbytes / sizeof (*yyptr); \
400 } \
401 while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000402
403#endif
404
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200405#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700406/* Copy COUNT objects from SRC to DST. The source and destination do
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200407 not overlap. */
408# ifndef YYCOPY
409# if defined __GNUC__ && 1 < __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700410# define YYCOPY(Dst, Src, Count) \
411 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200412# else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700413# define YYCOPY(Dst, Src, Count) \
414 do \
415 { \
416 YYSIZE_T yyi; \
417 for (yyi = 0; yyi < (Count); yyi++) \
418 (Dst)[yyi] = (Src)[yyi]; \
419 } \
420 while (0)
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200421# endif
422# endif
423#endif /* !YYCOPY_NEEDED */
424
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000425/* YYFINAL -- State number of the termination state. */
Patrick Georgi68befd52010-05-05 12:05:25 +0000426#define YYFINAL 3
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000427/* YYLAST -- Last index in YYTABLE. */
Aaron Durbinffda804b2014-09-03 12:40:15 -0500428#define YYLAST 39
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000429
430/* YYNTOKENS -- Number of terminals. */
Justin TerAvestca2ed9f2018-01-17 16:36:30 -0800431#define YYNTOKENS 32
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000432/* YYNNTS -- Number of nonterminals. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200433#define YYNNTS 13
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000434/* YYNRULES -- Number of rules. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200435#define YYNRULES 22
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700436/* YYNSTATES -- Number of states. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200437#define YYNSTATES 41
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000438
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700439/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
440 by yylex, with out-of-bounds checking. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000441#define YYUNDEFTOK 2
Justin TerAvestca2ed9f2018-01-17 16:36:30 -0800442#define YYMAXUTOK 286
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000443
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700444#define YYTRANSLATE(YYX) \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000445 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
446
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700447/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
448 as returned by yylex, without out-of-bounds checking. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000449static const yytype_uint8 yytranslate[] =
450{
451 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 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, 1, 2, 3, 4,
477 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200478 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
Justin TerAvestca2ed9f2018-01-17 16:36:30 -0800479 25, 26, 27, 28, 29, 30, 31
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000480};
481
482#if YYDEBUG
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700483 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
Patrick Georgi114e7b22010-05-05 11:19:50 +0000484static const yytype_uint8 yyrline[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000485{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700486 0, 34, 34, 34, 36, 36, 36, 36, 38, 38,
487 38, 38, 38, 38, 40, 40, 50, 50, 62, 65,
488 68, 71, 74
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000489};
490#endif
491
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700492#if YYDEBUG || YYERROR_VERBOSE || 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000493/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
494 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
495static const char *const yytname[] =
496{
497 "$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
498 "BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI", "PNP", "I2C",
Aaron Durbinffda804b2014-09-03 12:40:15 -0500499 "APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ", "IO", "NUMBER",
Duncan Laurie4650f5b2016-05-07 20:01:34 -0700500 "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IOAPIC", "PCIINT", "GENERIC",
Justin TerAvestca2ed9f2018-01-17 16:36:30 -0800501 "SPI", "MMIO", "$accept", "devtree", "$@1", "chipchildren",
502 "devicechildren", "chip", "@2", "device", "@3", "resource", "registers",
503 "subsystemid", "ioapic_irq", YY_NULLPTR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000504};
505#endif
506
507# ifdef YYPRINT
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700508/* YYTOKNUM[NUM] -- (External) token number corresponding to the
509 (internal) symbol number NUM (which must be that of a token). */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000510static const yytype_uint16 yytoknum[] =
511{
512 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
513 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
Furquan Shaikhe6700292017-02-11 00:50:38 -0800514 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
Justin TerAvestca2ed9f2018-01-17 16:36:30 -0800515 285, 286
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000516};
517# endif
518
Aaron Durbinffda804b2014-09-03 12:40:15 -0500519#define YYPACT_NINF -10
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700520
521#define yypact_value_is_default(Yystate) \
522 (!!((Yystate) == (-10)))
523
524#define YYTABLE_NINF -1
525
526#define yytable_value_is_error(Yytable_value) \
527 0
528
529 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
530 STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000531static const yytype_int8 yypact[] =
532{
Aaron Durbinffda804b2014-09-03 12:40:15 -0500533 -10, 3, 1, -10, -2, -10, -10, -10, 4, 5,
534 -1, -10, -10, -10, -10, -9, 7, 9, 6, -10,
535 -10, -10, -3, -4, -10, 2, 8, -10, -10, -10,
536 -10, -10, 10, 11, 0, 12, 13, 14, -10, -10,
537 -10
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000538};
539
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700540 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
541 Performed when YYTABLE does not specify something else to do. Zero
542 means the default is an error. */
543static const yytype_uint8 yydefact[] =
544{
545 2, 0, 0, 1, 0, 3, 14, 7, 0, 0,
546 0, 15, 5, 4, 6, 0, 0, 0, 0, 16,
547 19, 13, 0, 0, 17, 0, 0, 9, 8, 10,
548 11, 12, 0, 0, 0, 0, 20, 0, 18, 21,
549 22
550};
551
552 /* YYPGOTO[NTERM-NUM]. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000553static const yytype_int8 yypgoto[] =
554{
Aaron Durbinffda804b2014-09-03 12:40:15 -0500555 -10, -10, -10, -10, -10, -6, -10, 17, -10, -10,
556 -10, -10, -10
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000557};
558
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700559 /* YYDEFGOTO[NTERM-NUM]. */
560static const yytype_int8 yydefgoto[] =
561{
562 -1, 1, 2, 8, 22, 5, 7, 13, 21, 29,
563 14, 30, 31
564};
565
566 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
567 positive, shift that token. If negative, reduce the rule whose
568 number is the opposite. If YYTABLE_NINF, syntax error. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000569static const yytype_uint8 yytable[] =
570{
Sven Schnelle270a9082011-03-01 19:58:15 +0000571 4, 9, 12, 3, 4, 23, 24, 4, 9, 10,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500572 6, 16, 15, 11, 17, 19, 27, 18, 20, 32,
573 35, 25, 0, 26, 0, 33, 0, 0, 37, 0,
574 0, 34, 0, 0, 36, 38, 0, 40, 39, 28
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000575};
576
Patrick Georgi8f625f62010-05-05 13:13:47 +0000577static const yytype_int8 yycheck[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000578{
Sven Schnelle270a9082011-03-01 19:58:15 +0000579 3, 4, 8, 0, 3, 8, 9, 3, 4, 5,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500580 12, 12, 7, 9, 23, 6, 22, 10, 12, 23,
581 10, 24, -1, 26, -1, 23, -1, -1, 28, -1,
582 -1, 23, -1, -1, 23, 23, -1, 23, 25, 22
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000583};
584
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700585 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
586 symbol of state STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000587static const yytype_uint8 yystos[] =
588{
Justin TerAvestca2ed9f2018-01-17 16:36:30 -0800589 0, 33, 34, 0, 3, 37, 12, 38, 35, 4,
590 5, 9, 37, 39, 42, 7, 12, 23, 10, 6,
591 12, 40, 36, 8, 9, 24, 26, 37, 39, 41,
592 43, 44, 23, 23, 23, 10, 23, 28, 23, 25,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500593 23
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000594};
595
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700596 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
597static const yytype_uint8 yyr1[] =
598{
Justin TerAvestca2ed9f2018-01-17 16:36:30 -0800599 0, 32, 34, 33, 35, 35, 35, 35, 36, 36,
600 36, 36, 36, 36, 38, 37, 40, 39, 41, 42,
601 43, 43, 44
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700602};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000603
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700604 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
605static const yytype_uint8 yyr2[] =
606{
607 0, 2, 0, 2, 2, 2, 2, 0, 2, 2,
608 2, 2, 2, 0, 0, 5, 0, 7, 4, 4,
609 3, 4, 4
610};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000611
612
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700613#define yyerrok (yyerrstatus = 0)
614#define yyclearin (yychar = YYEMPTY)
615#define YYEMPTY (-2)
616#define YYEOF 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000617
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700618#define YYACCEPT goto yyacceptlab
619#define YYABORT goto yyabortlab
620#define YYERROR goto yyerrorlab
621
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000622
623#define YYRECOVERING() (!!yyerrstatus)
624
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700625#define YYBACKUP(Token, Value) \
626do \
627 if (yychar == YYEMPTY) \
628 { \
629 yychar = (Token); \
630 yylval = (Value); \
631 YYPOPSTACK (yylen); \
632 yystate = *yyssp; \
633 goto yybackup; \
634 } \
635 else \
636 { \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000637 yyerror (YY_("syntax error: cannot back up")); \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700638 YYERROR; \
639 } \
640while (0)
641
642/* Error token number */
643#define YYTERROR 1
644#define YYERRCODE 256
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000645
646
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000647
648/* Enable debugging if requested. */
649#if YYDEBUG
650
651# ifndef YYFPRINTF
652# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
653# define YYFPRINTF fprintf
654# endif
655
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700656# define YYDPRINTF(Args) \
657do { \
658 if (yydebug) \
659 YYFPRINTF Args; \
660} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000661
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700662/* This macro is provided for backward compatibility. */
663#ifndef YY_LOCATION_PRINT
664# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
665#endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000666
667
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700668# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
669do { \
670 if (yydebug) \
671 { \
672 YYFPRINTF (stderr, "%s ", Title); \
673 yy_symbol_print (stderr, \
674 Type, Value); \
675 YYFPRINTF (stderr, "\n"); \
676 } \
677} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000678
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700679
680/*----------------------------------------.
681| Print this symbol's value on YYOUTPUT. |
682`----------------------------------------*/
683
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000684static void
685yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000686{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700687 FILE *yyo = yyoutput;
688 YYUSE (yyo);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000689 if (!yyvaluep)
690 return;
691# ifdef YYPRINT
692 if (yytype < YYNTOKENS)
693 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000694# endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700695 YYUSE (yytype);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000696}
697
698
699/*--------------------------------.
700| Print this symbol on YYOUTPUT. |
701`--------------------------------*/
702
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000703static void
704yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000705{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700706 YYFPRINTF (yyoutput, "%s %s (",
707 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000708
709 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
710 YYFPRINTF (yyoutput, ")");
711}
712
713/*------------------------------------------------------------------.
714| yy_stack_print -- Print the state stack from its BOTTOM up to its |
715| TOP (included). |
716`------------------------------------------------------------------*/
717
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000718static void
719yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000720{
721 YYFPRINTF (stderr, "Stack now");
722 for (; yybottom <= yytop; yybottom++)
723 {
724 int yybot = *yybottom;
725 YYFPRINTF (stderr, " %d", yybot);
726 }
727 YYFPRINTF (stderr, "\n");
728}
729
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700730# define YY_STACK_PRINT(Bottom, Top) \
731do { \
732 if (yydebug) \
733 yy_stack_print ((Bottom), (Top)); \
734} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000735
736
737/*------------------------------------------------.
738| Report that the YYRULE is going to be reduced. |
739`------------------------------------------------*/
740
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000741static void
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700742yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000743{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700744 unsigned long int yylno = yyrline[yyrule];
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000745 int yynrhs = yyr2[yyrule];
746 int yyi;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000747 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700748 yyrule - 1, yylno);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000749 /* The symbols being reduced. */
750 for (yyi = 0; yyi < yynrhs; yyi++)
751 {
752 YYFPRINTF (stderr, " $%d = ", yyi + 1);
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700753 yy_symbol_print (stderr,
754 yystos[yyssp[yyi + 1 - yynrhs]],
755 &(yyvsp[(yyi + 1) - (yynrhs)])
756 );
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000757 YYFPRINTF (stderr, "\n");
758 }
759}
760
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700761# define YY_REDUCE_PRINT(Rule) \
762do { \
763 if (yydebug) \
764 yy_reduce_print (yyssp, yyvsp, Rule); \
765} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000766
767/* Nonzero means print parse trace. It is left uninitialized so that
768 multiple parsers can coexist. */
769int yydebug;
770#else /* !YYDEBUG */
771# define YYDPRINTF(Args)
772# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
773# define YY_STACK_PRINT(Bottom, Top)
774# define YY_REDUCE_PRINT(Rule)
775#endif /* !YYDEBUG */
776
777
778/* YYINITDEPTH -- initial size of the parser's stacks. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700779#ifndef YYINITDEPTH
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000780# define YYINITDEPTH 200
781#endif
782
783/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
784 if the built-in stack extension method is used).
785
786 Do not make this value too large; the results are undefined if
787 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
788 evaluated with infinite-precision integer arithmetic. */
789
790#ifndef YYMAXDEPTH
791# define YYMAXDEPTH 10000
792#endif
793
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000794
795#if YYERROR_VERBOSE
796
797# ifndef yystrlen
798# if defined __GLIBC__ && defined _STRING_H
799# define yystrlen strlen
800# else
801/* Return the length of YYSTR. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000802static YYSIZE_T
803yystrlen (const char *yystr)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000804{
805 YYSIZE_T yylen;
806 for (yylen = 0; yystr[yylen]; yylen++)
807 continue;
808 return yylen;
809}
810# endif
811# endif
812
813# ifndef yystpcpy
814# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
815# define yystpcpy stpcpy
816# else
817/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
818 YYDEST. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000819static char *
820yystpcpy (char *yydest, const char *yysrc)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000821{
822 char *yyd = yydest;
823 const char *yys = yysrc;
824
825 while ((*yyd++ = *yys++) != '\0')
826 continue;
827
828 return yyd - 1;
829}
830# endif
831# endif
832
833# ifndef yytnamerr
834/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
835 quotes and backslashes, so that it's suitable for yyerror. The
836 heuristic is that double-quoting is unnecessary unless the string
837 contains an apostrophe, a comma, or backslash (other than
838 backslash-backslash). YYSTR is taken from yytname. If YYRES is
839 null, do not copy; instead, return the length of what the result
840 would have been. */
841static YYSIZE_T
842yytnamerr (char *yyres, const char *yystr)
843{
844 if (*yystr == '"')
845 {
846 YYSIZE_T yyn = 0;
847 char const *yyp = yystr;
848
849 for (;;)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700850 switch (*++yyp)
851 {
852 case '\'':
853 case ',':
854 goto do_not_strip_quotes;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000855
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700856 case '\\':
857 if (*++yyp != '\\')
858 goto do_not_strip_quotes;
859 /* Fall through. */
860 default:
861 if (yyres)
862 yyres[yyn] = *yyp;
863 yyn++;
864 break;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000865
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700866 case '"':
867 if (yyres)
868 yyres[yyn] = '\0';
869 return yyn;
870 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000871 do_not_strip_quotes: ;
872 }
873
874 if (! yyres)
875 return yystrlen (yystr);
876
877 return yystpcpy (yyres, yystr) - yyres;
878}
879# endif
880
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200881/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
882 about the unexpected token YYTOKEN for the state stack whose top is
883 YYSSP.
884
885 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
886 not large enough to hold the message. In that case, also set
887 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
888 required number of bytes is too large to store. */
889static int
890yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
891 yytype_int16 *yyssp, int yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000892{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700893 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200894 YYSIZE_T yysize = yysize0;
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200895 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
896 /* Internationalized format string. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700897 const char *yyformat = YY_NULLPTR;
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200898 /* Arguments of yyformat. */
899 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
900 /* Number of reported tokens (one for the "unexpected", one per
901 "expected"). */
902 int yycount = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000903
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200904 /* There are many possibilities here to consider:
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200905 - If this state is a consistent state with a default action, then
906 the only way this function was invoked is if the default action
907 is an error action. In that case, don't check for expected
908 tokens because there are none.
909 - The only way there can be no lookahead present (in yychar) is if
910 this state is a consistent state with a default action. Thus,
911 detecting the absence of a lookahead is sufficient to determine
912 that there is no unexpected or expected token to report. In that
913 case, just report a simple "syntax error".
914 - Don't assume there isn't a lookahead just because this state is a
915 consistent state with a default action. There might have been a
916 previous inconsistent state, consistent state with a non-default
917 action, or user semantic action that manipulated yychar.
918 - Of course, the expected token list depends on states to have
919 correct lookahead information, and it depends on the parser not
920 to perform extra reductions after fetching a lookahead from the
921 scanner and before detecting a syntax error. Thus, state merging
922 (from LALR or IELR) and default reductions corrupt the expected
923 token list. However, the list is correct for canonical LR with
924 one exception: it will still contain any token that will not be
925 accepted due to an error action in a later state.
926 */
927 if (yytoken != YYEMPTY)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000928 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200929 int yyn = yypact[*yyssp];
930 yyarg[yycount++] = yytname[yytoken];
931 if (!yypact_value_is_default (yyn))
932 {
933 /* Start YYX at -YYN if negative to avoid negative indexes in
934 YYCHECK. In other words, skip the first -YYN actions for
935 this state because they are default actions. */
936 int yyxbegin = yyn < 0 ? -yyn : 0;
937 /* Stay within bounds of both yycheck and yytname. */
938 int yychecklim = YYLAST - yyn + 1;
939 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
940 int yyx;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000941
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200942 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
943 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
944 && !yytable_value_is_error (yytable[yyx + yyn]))
945 {
946 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
947 {
948 yycount = 1;
949 yysize = yysize0;
950 break;
951 }
952 yyarg[yycount++] = yytname[yyx];
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700953 {
954 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
955 if (! (yysize <= yysize1
956 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
957 return 2;
958 yysize = yysize1;
959 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200960 }
961 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000962 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200963
964 switch (yycount)
965 {
966# define YYCASE_(N, S) \
967 case N: \
968 yyformat = S; \
969 break
970 YYCASE_(0, YY_("syntax error"));
971 YYCASE_(1, YY_("syntax error, unexpected %s"));
972 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
973 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
974 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
975 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
976# undef YYCASE_
977 }
978
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700979 {
980 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
981 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
982 return 2;
983 yysize = yysize1;
984 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200985
986 if (*yymsg_alloc < yysize)
987 {
988 *yymsg_alloc = 2 * yysize;
989 if (! (yysize <= *yymsg_alloc
990 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
991 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
992 return 1;
993 }
994
995 /* Avoid sprintf, as that infringes on the user's name space.
996 Don't have undefined behavior even if the translation
997 produced a string with the wrong number of "%s"s. */
998 {
999 char *yyp = *yymsg;
1000 int yyi = 0;
1001 while ((*yyp = *yyformat) != '\0')
1002 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1003 {
1004 yyp += yytnamerr (yyp, yyarg[yyi++]);
1005 yyformat += 2;
1006 }
1007 else
1008 {
1009 yyp++;
1010 yyformat++;
1011 }
1012 }
1013 return 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001014}
1015#endif /* YYERROR_VERBOSE */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001016
1017/*-----------------------------------------------.
1018| Release the memory associated to this symbol. |
1019`-----------------------------------------------*/
1020
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001021static void
1022yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001023{
1024 YYUSE (yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001025 if (!yymsg)
1026 yymsg = "Deleting";
1027 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1028
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001029 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1030 YYUSE (yytype);
1031 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001032}
1033
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001034
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001035
1036
1037/* The lookahead symbol. */
1038int yychar;
1039
1040/* The semantic value of the lookahead symbol. */
1041YYSTYPE yylval;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001042/* Number of syntax errors so far. */
1043int yynerrs;
1044
1045
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001046/*----------.
1047| yyparse. |
1048`----------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001049
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001050int
1051yyparse (void)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001052{
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001053 int yystate;
1054 /* Number of tokens to shift before error messages enabled. */
1055 int yyerrstatus;
1056
1057 /* The stacks and their tools:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001058 'yyss': related to states.
1059 'yyvs': related to semantic values.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001060
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001061 Refer to the stacks through separate pointers, to allow yyoverflow
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001062 to reallocate them elsewhere. */
1063
1064 /* The state stack. */
1065 yytype_int16 yyssa[YYINITDEPTH];
1066 yytype_int16 *yyss;
1067 yytype_int16 *yyssp;
1068
1069 /* The semantic value stack. */
1070 YYSTYPE yyvsa[YYINITDEPTH];
1071 YYSTYPE *yyvs;
1072 YYSTYPE *yyvsp;
1073
1074 YYSIZE_T yystacksize;
1075
1076 int yyn;
1077 int yyresult;
1078 /* Lookahead token as an internal (translated) token number. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001079 int yytoken = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001080 /* The variables used to return semantic value and location from the
1081 action routines. */
1082 YYSTYPE yyval;
1083
1084#if YYERROR_VERBOSE
1085 /* Buffer for error messages, and its allocated size. */
1086 char yymsgbuf[128];
1087 char *yymsg = yymsgbuf;
1088 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1089#endif
1090
1091#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1092
1093 /* The number of symbols on the RHS of the reduced rule.
1094 Keep to zero when no symbol should be popped. */
1095 int yylen = 0;
1096
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001097 yyssp = yyss = yyssa;
1098 yyvsp = yyvs = yyvsa;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001099 yystacksize = YYINITDEPTH;
1100
1101 YYDPRINTF ((stderr, "Starting parse\n"));
1102
1103 yystate = 0;
1104 yyerrstatus = 0;
1105 yynerrs = 0;
1106 yychar = YYEMPTY; /* Cause a token to be read. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001107 goto yysetstate;
1108
1109/*------------------------------------------------------------.
1110| yynewstate -- Push a new state, which is found in yystate. |
1111`------------------------------------------------------------*/
1112 yynewstate:
1113 /* In all cases, when you get here, the value and location stacks
1114 have just been pushed. So pushing a state here evens the stacks. */
1115 yyssp++;
1116
1117 yysetstate:
1118 *yyssp = yystate;
1119
1120 if (yyss + yystacksize - 1 <= yyssp)
1121 {
1122 /* Get the current used size of the three stacks, in elements. */
1123 YYSIZE_T yysize = yyssp - yyss + 1;
1124
1125#ifdef yyoverflow
1126 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001127 /* Give user a chance to reallocate the stack. Use copies of
1128 these so that the &'s don't force the real ones into
1129 memory. */
1130 YYSTYPE *yyvs1 = yyvs;
1131 yytype_int16 *yyss1 = yyss;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001132
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001133 /* Each stack pointer address is followed by the size of the
1134 data in use in that stack, in bytes. This used to be a
1135 conditional around just the two extra args, but that might
1136 be undefined if yyoverflow is a macro. */
1137 yyoverflow (YY_("memory exhausted"),
1138 &yyss1, yysize * sizeof (*yyssp),
1139 &yyvs1, yysize * sizeof (*yyvsp),
1140 &yystacksize);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001141
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001142 yyss = yyss1;
1143 yyvs = yyvs1;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001144 }
1145#else /* no yyoverflow */
1146# ifndef YYSTACK_RELOCATE
1147 goto yyexhaustedlab;
1148# else
1149 /* Extend the stack our own way. */
1150 if (YYMAXDEPTH <= yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001151 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001152 yystacksize *= 2;
1153 if (YYMAXDEPTH < yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001154 yystacksize = YYMAXDEPTH;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001155
1156 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001157 yytype_int16 *yyss1 = yyss;
1158 union yyalloc *yyptr =
1159 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1160 if (! yyptr)
1161 goto yyexhaustedlab;
1162 YYSTACK_RELOCATE (yyss_alloc, yyss);
1163 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001164# undef YYSTACK_RELOCATE
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001165 if (yyss1 != yyssa)
1166 YYSTACK_FREE (yyss1);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001167 }
1168# endif
1169#endif /* no yyoverflow */
1170
1171 yyssp = yyss + yysize - 1;
1172 yyvsp = yyvs + yysize - 1;
1173
1174 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001175 (unsigned long int) yystacksize));
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001176
1177 if (yyss + yystacksize - 1 <= yyssp)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001178 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001179 }
1180
1181 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1182
1183 if (yystate == YYFINAL)
1184 YYACCEPT;
1185
1186 goto yybackup;
1187
1188/*-----------.
1189| yybackup. |
1190`-----------*/
1191yybackup:
1192
1193 /* Do appropriate processing given the current state. Read a
1194 lookahead token if we need one and don't already have one. */
1195
1196 /* First try to decide what to do without reference to lookahead token. */
1197 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001198 if (yypact_value_is_default (yyn))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001199 goto yydefault;
1200
1201 /* Not known => get a lookahead token if don't already have one. */
1202
1203 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1204 if (yychar == YYEMPTY)
1205 {
1206 YYDPRINTF ((stderr, "Reading a token: "));
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001207 yychar = yylex ();
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001208 }
1209
1210 if (yychar <= YYEOF)
1211 {
1212 yychar = yytoken = YYEOF;
1213 YYDPRINTF ((stderr, "Now at end of input.\n"));
1214 }
1215 else
1216 {
1217 yytoken = YYTRANSLATE (yychar);
1218 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1219 }
1220
1221 /* If the proper action on seeing token YYTOKEN is to reduce or to
1222 detect an error, take that action. */
1223 yyn += yytoken;
1224 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1225 goto yydefault;
1226 yyn = yytable[yyn];
1227 if (yyn <= 0)
1228 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001229 if (yytable_value_is_error (yyn))
1230 goto yyerrlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001231 yyn = -yyn;
1232 goto yyreduce;
1233 }
1234
1235 /* Count tokens shifted since error; after three, turn off error
1236 status. */
1237 if (yyerrstatus)
1238 yyerrstatus--;
1239
1240 /* Shift the lookahead token. */
1241 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1242
1243 /* Discard the shifted token. */
1244 yychar = YYEMPTY;
1245
1246 yystate = yyn;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001247 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001248 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001249 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001250
1251 goto yynewstate;
1252
1253
1254/*-----------------------------------------------------------.
1255| yydefault -- do the default action for the current state. |
1256`-----------------------------------------------------------*/
1257yydefault:
1258 yyn = yydefact[yystate];
1259 if (yyn == 0)
1260 goto yyerrlab;
1261 goto yyreduce;
1262
1263
1264/*-----------------------------.
1265| yyreduce -- Do a reduction. |
1266`-----------------------------*/
1267yyreduce:
1268 /* yyn is the number of a rule to reduce with. */
1269 yylen = yyr2[yyn];
1270
1271 /* If YYLEN is nonzero, implement the default value of the action:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001272 '$$ = $1'.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001273
1274 Otherwise, the following line sets YYVAL to garbage.
1275 This behavior is undocumented and Bison
1276 users should not rely upon it. Assigning to YYVAL
1277 unconditionally makes the parser a bit smaller, and it avoids a
1278 GCC warning that YYVAL may be used uninitialized. */
1279 yyval = yyvsp[1-yylen];
1280
1281
1282 YY_REDUCE_PRINT (yyn);
1283 switch (yyn)
1284 {
1285 case 2:
1286
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001287 { cur_parent = cur_bus = head; }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001288
Patrick Georgi68befd52010-05-05 12:05:25 +00001289 break;
1290
1291 case 3:
1292
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001293 { postprocess_devtree(); }
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 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001300 (yyval.device) = new_chip(cur_parent, cur_bus, (yyvsp[0].string));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001301 cur_parent = (yyval.device);
1302}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001303
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001304 break;
1305
Sven Schnelle270a9082011-03-01 19:58:15 +00001306 case 15:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001307
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001308 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001309 cur_parent = (yyvsp[-2].device)->parent;
1310 fold_in((yyvsp[-2].device));
1311 add_header((yyvsp[-2].device));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001312}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001313
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001314 break;
1315
Sven Schnelle270a9082011-03-01 19:58:15 +00001316 case 16:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001317
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001318 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001319 (yyval.device) = new_device(cur_parent, cur_bus, (yyvsp[-2].number), (yyvsp[-1].string), (yyvsp[0].number));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001320 cur_parent = (yyval.device);
1321 cur_bus = (yyval.device);
1322}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001323
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001324 break;
1325
1326 case 17:
1327
1328 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001329 cur_parent = (yyvsp[-2].device)->parent;
1330 cur_bus = (yyvsp[-2].device)->bus;
1331 fold_in((yyvsp[-2].device));
1332 alias_siblings((yyvsp[-2].device)->children);
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001333}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001334
Patrick Georgi68befd52010-05-05 12:05:25 +00001335 break;
1336
Sven Schnelle270a9082011-03-01 19:58:15 +00001337 case 18:
Patrick Georgi68befd52010-05-05 12:05:25 +00001338
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001339 { add_resource(cur_parent, (yyvsp[-3].number), strtol((yyvsp[-2].string), NULL, 0), strtol((yyvsp[0].string), NULL, 0)); }
1340
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001341 break;
1342
Sven Schnelle270a9082011-03-01 19:58:15 +00001343 case 19:
1344
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001345 { add_register(cur_parent, (yyvsp[-2].string), (yyvsp[0].string)); }
1346
Sven Schnelle270a9082011-03-01 19:58:15 +00001347 break;
1348
1349 case 20:
1350
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001351 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-1].string), NULL, 16), strtol((yyvsp[0].string), NULL, 16), 0); }
1352
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001353 break;
1354
1355 case 21:
1356
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001357 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-2].string), NULL, 16), strtol((yyvsp[-1].string), NULL, 16), 1); }
1358
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001359 break;
1360
1361 case 22:
1362
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001363 { add_ioapic_info(cur_parent, strtol((yyvsp[-2].string), NULL, 16), (yyvsp[-1].string), strtol((yyvsp[0].string), NULL, 16)); }
1364
Sven Schnelle270a9082011-03-01 19:58:15 +00001365 break;
1366
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001367
1368
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001369 default: break;
1370 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001371 /* User semantic actions sometimes alter yychar, and that requires
1372 that yytoken be updated with the new translation. We take the
1373 approach of translating immediately before every use of yytoken.
1374 One alternative is translating here after every semantic action,
1375 but that translation would be missed if the semantic action invokes
1376 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1377 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1378 incorrect destructor might then be invoked immediately. In the
1379 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1380 to an incorrect destructor call or verbose syntax error message
1381 before the lookahead is translated. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001382 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1383
1384 YYPOPSTACK (yylen);
1385 yylen = 0;
1386 YY_STACK_PRINT (yyss, yyssp);
1387
1388 *++yyvsp = yyval;
1389
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001390 /* Now 'shift' the result of the reduction. Determine what state
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001391 that goes to, based on the state we popped back to and the rule
1392 number reduced by. */
1393
1394 yyn = yyr1[yyn];
1395
1396 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1397 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1398 yystate = yytable[yystate];
1399 else
1400 yystate = yydefgoto[yyn - YYNTOKENS];
1401
1402 goto yynewstate;
1403
1404
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001405/*--------------------------------------.
1406| yyerrlab -- here on detecting error. |
1407`--------------------------------------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001408yyerrlab:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001409 /* Make sure we have latest lookahead translation. See comments at
1410 user semantic actions for why this is necessary. */
1411 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1412
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001413 /* If not already recovering from an error, report this error. */
1414 if (!yyerrstatus)
1415 {
1416 ++yynerrs;
1417#if ! YYERROR_VERBOSE
1418 yyerror (YY_("syntax error"));
1419#else
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001420# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1421 yyssp, yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001422 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001423 char const *yymsgp = YY_("syntax error");
1424 int yysyntax_error_status;
1425 yysyntax_error_status = YYSYNTAX_ERROR;
1426 if (yysyntax_error_status == 0)
1427 yymsgp = yymsg;
1428 else if (yysyntax_error_status == 1)
1429 {
1430 if (yymsg != yymsgbuf)
1431 YYSTACK_FREE (yymsg);
1432 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1433 if (!yymsg)
1434 {
1435 yymsg = yymsgbuf;
1436 yymsg_alloc = sizeof yymsgbuf;
1437 yysyntax_error_status = 2;
1438 }
1439 else
1440 {
1441 yysyntax_error_status = YYSYNTAX_ERROR;
1442 yymsgp = yymsg;
1443 }
1444 }
1445 yyerror (yymsgp);
1446 if (yysyntax_error_status == 2)
1447 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001448 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001449# undef YYSYNTAX_ERROR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001450#endif
1451 }
1452
1453
1454
1455 if (yyerrstatus == 3)
1456 {
1457 /* If just tried and failed to reuse lookahead token after an
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001458 error, discard it. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001459
1460 if (yychar <= YYEOF)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001461 {
1462 /* Return failure if at end of input. */
1463 if (yychar == YYEOF)
1464 YYABORT;
1465 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001466 else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001467 {
1468 yydestruct ("Error: discarding",
1469 yytoken, &yylval);
1470 yychar = YYEMPTY;
1471 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001472 }
1473
1474 /* Else will try to reuse lookahead token after shifting the error
1475 token. */
1476 goto yyerrlab1;
1477
1478
1479/*---------------------------------------------------.
1480| yyerrorlab -- error raised explicitly by YYERROR. |
1481`---------------------------------------------------*/
1482yyerrorlab:
1483
1484 /* Pacify compilers like GCC when the user code never invokes
1485 YYERROR and the label yyerrorlab therefore never appears in user
1486 code. */
1487 if (/*CONSTCOND*/ 0)
1488 goto yyerrorlab;
1489
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001490 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001491 this YYERROR. */
1492 YYPOPSTACK (yylen);
1493 yylen = 0;
1494 YY_STACK_PRINT (yyss, yyssp);
1495 yystate = *yyssp;
1496 goto yyerrlab1;
1497
1498
1499/*-------------------------------------------------------------.
1500| yyerrlab1 -- common code for both syntax error and YYERROR. |
1501`-------------------------------------------------------------*/
1502yyerrlab1:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001503 yyerrstatus = 3; /* Each real token shifted decrements this. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001504
1505 for (;;)
1506 {
1507 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001508 if (!yypact_value_is_default (yyn))
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001509 {
1510 yyn += YYTERROR;
1511 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1512 {
1513 yyn = yytable[yyn];
1514 if (0 < yyn)
1515 break;
1516 }
1517 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001518
1519 /* Pop the current state because it cannot handle the error token. */
1520 if (yyssp == yyss)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001521 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001522
1523
1524 yydestruct ("Error: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001525 yystos[yystate], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001526 YYPOPSTACK (1);
1527 yystate = *yyssp;
1528 YY_STACK_PRINT (yyss, yyssp);
1529 }
1530
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001531 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001532 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001533 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001534
1535
1536 /* Shift the error token. */
1537 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1538
1539 yystate = yyn;
1540 goto yynewstate;
1541
1542
1543/*-------------------------------------.
1544| yyacceptlab -- YYACCEPT comes here. |
1545`-------------------------------------*/
1546yyacceptlab:
1547 yyresult = 0;
1548 goto yyreturn;
1549
1550/*-----------------------------------.
1551| yyabortlab -- YYABORT comes here. |
1552`-----------------------------------*/
1553yyabortlab:
1554 yyresult = 1;
1555 goto yyreturn;
1556
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001557#if !defined yyoverflow || YYERROR_VERBOSE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001558/*-------------------------------------------------.
1559| yyexhaustedlab -- memory exhaustion comes here. |
1560`-------------------------------------------------*/
1561yyexhaustedlab:
1562 yyerror (YY_("memory exhausted"));
1563 yyresult = 2;
1564 /* Fall through. */
1565#endif
1566
1567yyreturn:
1568 if (yychar != YYEMPTY)
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001569 {
1570 /* Make sure we have latest lookahead translation. See comments at
1571 user semantic actions for why this is necessary. */
1572 yytoken = YYTRANSLATE (yychar);
1573 yydestruct ("Cleanup: discarding lookahead",
1574 yytoken, &yylval);
1575 }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001576 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001577 this YYABORT or YYACCEPT. */
1578 YYPOPSTACK (yylen);
1579 YY_STACK_PRINT (yyss, yyssp);
1580 while (yyssp != yyss)
1581 {
1582 yydestruct ("Cleanup: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001583 yystos[*yyssp], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001584 YYPOPSTACK (1);
1585 }
1586#ifndef yyoverflow
1587 if (yyss != yyssa)
1588 YYSTACK_FREE (yyss);
1589#endif
1590#if YYERROR_VERBOSE
1591 if (yymsg != yymsgbuf)
1592 YYSTACK_FREE (yymsg);
1593#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001594 return yyresult;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001595}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001596
1597