blob: bca06a075d2553a243cba81f8d3894ce8603c3e1 [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". */
111#ifndef YY_YY_SCONFIG_TAB_H_SHIPPED_INCLUDED
112# define YY_YY_SCONFIG_TAB_H_SHIPPED_INCLUDED
113/* 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,
152 GENERIC = 284
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700153 };
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000154#endif
155
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700156/* Value type. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000157#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700158
159union YYSTYPE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000160{
161
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000162
163 struct device *device;
164 char *string;
165 int number;
166
167
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700168};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000169
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700170typedef union YYSTYPE YYSTYPE;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000171# define YYSTYPE_IS_TRIVIAL 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000172# define YYSTYPE_IS_DECLARED 1
173#endif
174
175
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700176extern YYSTYPE yylval;
177
178int yyparse (void);
179
180#endif /* !YY_YY_SCONFIG_TAB_H_SHIPPED_INCLUDED */
181
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000182/* Copy the second part of user declarations. */
183
184
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000185
186#ifdef short
187# undef short
188#endif
189
190#ifdef YYTYPE_UINT8
191typedef YYTYPE_UINT8 yytype_uint8;
192#else
193typedef unsigned char yytype_uint8;
194#endif
195
196#ifdef YYTYPE_INT8
197typedef YYTYPE_INT8 yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000198#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700199typedef signed char yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000200#endif
201
202#ifdef YYTYPE_UINT16
203typedef YYTYPE_UINT16 yytype_uint16;
204#else
205typedef unsigned short int yytype_uint16;
206#endif
207
208#ifdef YYTYPE_INT16
209typedef YYTYPE_INT16 yytype_int16;
210#else
211typedef short int yytype_int16;
212#endif
213
214#ifndef YYSIZE_T
215# ifdef __SIZE_TYPE__
216# define YYSIZE_T __SIZE_TYPE__
217# elif defined size_t
218# define YYSIZE_T size_t
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700219# elif ! defined YYSIZE_T
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000220# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
221# define YYSIZE_T size_t
222# else
223# define YYSIZE_T unsigned int
224# endif
225#endif
226
227#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
228
229#ifndef YY_
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200230# if defined YYENABLE_NLS && YYENABLE_NLS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000231# if ENABLE_NLS
232# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700233# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000234# endif
235# endif
236# ifndef YY_
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700237# define YY_(Msgid) Msgid
238# endif
239#endif
240
241#ifndef YY_ATTRIBUTE
242# if (defined __GNUC__ \
243 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
244 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
245# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
246# else
247# define YY_ATTRIBUTE(Spec) /* empty */
248# endif
249#endif
250
251#ifndef YY_ATTRIBUTE_PURE
252# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
253#endif
254
255#ifndef YY_ATTRIBUTE_UNUSED
256# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
257#endif
258
259#if !defined _Noreturn \
260 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
261# if defined _MSC_VER && 1200 <= _MSC_VER
262# define _Noreturn __declspec (noreturn)
263# else
264# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000265# endif
266#endif
267
268/* Suppress unused-variable warnings by "using" E. */
269#if ! defined lint || defined __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700270# define YYUSE(E) ((void) (E))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000271#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700272# define YYUSE(E) /* empty */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000273#endif
274
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700275#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
276/* Suppress an incorrect diagnostic about yylval being uninitialized. */
277# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
278 _Pragma ("GCC diagnostic push") \
279 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
280 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
281# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
282 _Pragma ("GCC diagnostic pop")
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000283#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700284# define YY_INITIAL_VALUE(Value) Value
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000285#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700286#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
287# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
288# define YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000289#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700290#ifndef YY_INITIAL_VALUE
291# define YY_INITIAL_VALUE(Value) /* Nothing. */
292#endif
293
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000294
295#if ! defined yyoverflow || YYERROR_VERBOSE
296
297/* The parser invokes alloca or malloc; define the necessary symbols. */
298
299# ifdef YYSTACK_USE_ALLOCA
300# if YYSTACK_USE_ALLOCA
301# ifdef __GNUC__
302# define YYSTACK_ALLOC __builtin_alloca
303# elif defined __BUILTIN_VA_ARG_INCR
304# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
305# elif defined _AIX
306# define YYSTACK_ALLOC __alloca
307# elif defined _MSC_VER
308# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
309# define alloca _alloca
310# else
311# define YYSTACK_ALLOC alloca
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700312# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000313# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700314 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200315# ifndef EXIT_SUCCESS
316# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000317# endif
318# endif
319# endif
320# endif
321# endif
322
323# ifdef YYSTACK_ALLOC
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700324 /* Pacify GCC's 'empty if-body' warning. */
325# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000326# ifndef YYSTACK_ALLOC_MAXIMUM
327 /* The OS might guarantee only one guard page at the bottom of the stack,
328 and a page size can be as small as 4096 bytes. So we cannot safely
329 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
330 to allow for a few compiler-allocated temporary stack slots. */
331# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
332# endif
333# else
334# define YYSTACK_ALLOC YYMALLOC
335# define YYSTACK_FREE YYFREE
336# ifndef YYSTACK_ALLOC_MAXIMUM
337# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
338# endif
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200339# if (defined __cplusplus && ! defined EXIT_SUCCESS \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000340 && ! ((defined YYMALLOC || defined malloc) \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700341 && (defined YYFREE || defined free)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000342# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200343# ifndef EXIT_SUCCESS
344# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000345# endif
346# endif
347# ifndef YYMALLOC
348# define YYMALLOC malloc
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700349# if ! defined malloc && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000350void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
351# endif
352# endif
353# ifndef YYFREE
354# define YYFREE free
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700355# if ! defined free && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000356void free (void *); /* INFRINGES ON USER NAME SPACE */
357# endif
358# endif
359# endif
360#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
361
362
363#if (! defined yyoverflow \
364 && (! defined __cplusplus \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700365 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000366
367/* A type that is properly aligned for any stack member. */
368union yyalloc
369{
370 yytype_int16 yyss_alloc;
371 YYSTYPE yyvs_alloc;
372};
373
374/* The size of the maximum gap between one aligned stack and the next. */
375# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
376
377/* The size of an array large to enough to hold all stacks, each with
378 N elements. */
379# define YYSTACK_BYTES(N) \
380 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
381 + YYSTACK_GAP_MAXIMUM)
382
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200383# define YYCOPY_NEEDED 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000384
385/* Relocate STACK from its old location to the new one. The
386 local variables YYSIZE and YYSTACKSIZE give the old and new number of
387 elements in the stack, and YYPTR gives the new location of the
388 stack. Advance YYPTR to a properly aligned location for the next
389 stack. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700390# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
391 do \
392 { \
393 YYSIZE_T yynewbytes; \
394 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
395 Stack = &yyptr->Stack_alloc; \
396 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
397 yyptr += yynewbytes / sizeof (*yyptr); \
398 } \
399 while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000400
401#endif
402
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200403#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700404/* Copy COUNT objects from SRC to DST. The source and destination do
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200405 not overlap. */
406# ifndef YYCOPY
407# if defined __GNUC__ && 1 < __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700408# define YYCOPY(Dst, Src, Count) \
409 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200410# else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700411# define YYCOPY(Dst, Src, Count) \
412 do \
413 { \
414 YYSIZE_T yyi; \
415 for (yyi = 0; yyi < (Count); yyi++) \
416 (Dst)[yyi] = (Src)[yyi]; \
417 } \
418 while (0)
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200419# endif
420# endif
421#endif /* !YYCOPY_NEEDED */
422
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000423/* YYFINAL -- State number of the termination state. */
Patrick Georgi68befd52010-05-05 12:05:25 +0000424#define YYFINAL 3
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000425/* YYLAST -- Last index in YYTABLE. */
Aaron Durbinffda804b2014-09-03 12:40:15 -0500426#define YYLAST 39
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000427
428/* YYNTOKENS -- Number of terminals. */
Duncan Laurie4650f5b2016-05-07 20:01:34 -0700429#define YYNTOKENS 30
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000430/* YYNNTS -- Number of nonterminals. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200431#define YYNNTS 13
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000432/* YYNRULES -- Number of rules. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200433#define YYNRULES 22
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700434/* YYNSTATES -- Number of states. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200435#define YYNSTATES 41
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000436
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700437/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
438 by yylex, with out-of-bounds checking. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000439#define YYUNDEFTOK 2
Duncan Laurie4650f5b2016-05-07 20:01:34 -0700440#define YYMAXUTOK 284
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000441
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700442#define YYTRANSLATE(YYX) \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000443 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
444
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700445/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
446 as returned by yylex, without out-of-bounds checking. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000447static const yytype_uint8 yytranslate[] =
448{
449 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 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, 1, 2, 3, 4,
475 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200476 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
Duncan Laurie4650f5b2016-05-07 20:01:34 -0700477 25, 26, 27, 28, 29
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000478};
479
480#if YYDEBUG
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700481 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
Patrick Georgi114e7b22010-05-05 11:19:50 +0000482static const yytype_uint8 yyrline[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000483{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700484 0, 34, 34, 34, 36, 36, 36, 36, 38, 38,
485 38, 38, 38, 38, 40, 40, 50, 50, 62, 65,
486 68, 71, 74
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000487};
488#endif
489
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700490#if YYDEBUG || YYERROR_VERBOSE || 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000491/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
492 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
493static const char *const yytname[] =
494{
495 "$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
496 "BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI", "PNP", "I2C",
Aaron Durbinffda804b2014-09-03 12:40:15 -0500497 "APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ", "IO", "NUMBER",
Duncan Laurie4650f5b2016-05-07 20:01:34 -0700498 "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IOAPIC", "PCIINT", "GENERIC",
499 "$accept", "devtree", "$@1", "chipchildren", "devicechildren", "chip",
500 "@2", "device", "@3", "resource", "registers", "subsystemid",
501 "ioapic_irq", YY_NULLPTR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000502};
503#endif
504
505# ifdef YYPRINT
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700506/* YYTOKNUM[NUM] -- (External) token number corresponding to the
507 (internal) symbol number NUM (which must be that of a token). */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000508static const yytype_uint16 yytoknum[] =
509{
510 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
511 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
Duncan Laurie4650f5b2016-05-07 20:01:34 -0700512 275, 276, 277, 278, 279, 280, 281, 282, 283, 284
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000513};
514# endif
515
Aaron Durbinffda804b2014-09-03 12:40:15 -0500516#define YYPACT_NINF -10
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700517
518#define yypact_value_is_default(Yystate) \
519 (!!((Yystate) == (-10)))
520
521#define YYTABLE_NINF -1
522
523#define yytable_value_is_error(Yytable_value) \
524 0
525
526 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
527 STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000528static const yytype_int8 yypact[] =
529{
Aaron Durbinffda804b2014-09-03 12:40:15 -0500530 -10, 3, 1, -10, -2, -10, -10, -10, 4, 5,
531 -1, -10, -10, -10, -10, -9, 7, 9, 6, -10,
532 -10, -10, -3, -4, -10, 2, 8, -10, -10, -10,
533 -10, -10, 10, 11, 0, 12, 13, 14, -10, -10,
534 -10
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000535};
536
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700537 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
538 Performed when YYTABLE does not specify something else to do. Zero
539 means the default is an error. */
540static const yytype_uint8 yydefact[] =
541{
542 2, 0, 0, 1, 0, 3, 14, 7, 0, 0,
543 0, 15, 5, 4, 6, 0, 0, 0, 0, 16,
544 19, 13, 0, 0, 17, 0, 0, 9, 8, 10,
545 11, 12, 0, 0, 0, 0, 20, 0, 18, 21,
546 22
547};
548
549 /* YYPGOTO[NTERM-NUM]. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000550static const yytype_int8 yypgoto[] =
551{
Aaron Durbinffda804b2014-09-03 12:40:15 -0500552 -10, -10, -10, -10, -10, -6, -10, 17, -10, -10,
553 -10, -10, -10
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000554};
555
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700556 /* YYDEFGOTO[NTERM-NUM]. */
557static const yytype_int8 yydefgoto[] =
558{
559 -1, 1, 2, 8, 22, 5, 7, 13, 21, 29,
560 14, 30, 31
561};
562
563 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
564 positive, shift that token. If negative, reduce the rule whose
565 number is the opposite. If YYTABLE_NINF, syntax error. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000566static const yytype_uint8 yytable[] =
567{
Sven Schnelle270a9082011-03-01 19:58:15 +0000568 4, 9, 12, 3, 4, 23, 24, 4, 9, 10,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500569 6, 16, 15, 11, 17, 19, 27, 18, 20, 32,
570 35, 25, 0, 26, 0, 33, 0, 0, 37, 0,
571 0, 34, 0, 0, 36, 38, 0, 40, 39, 28
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000572};
573
Patrick Georgi8f625f62010-05-05 13:13:47 +0000574static const yytype_int8 yycheck[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000575{
Sven Schnelle270a9082011-03-01 19:58:15 +0000576 3, 4, 8, 0, 3, 8, 9, 3, 4, 5,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500577 12, 12, 7, 9, 23, 6, 22, 10, 12, 23,
578 10, 24, -1, 26, -1, 23, -1, -1, 28, -1,
579 -1, 23, -1, -1, 23, 23, -1, 23, 25, 22
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000580};
581
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700582 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
583 symbol of state STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000584static const yytype_uint8 yystos[] =
585{
Duncan Laurie4650f5b2016-05-07 20:01:34 -0700586 0, 31, 32, 0, 3, 35, 12, 36, 33, 4,
587 5, 9, 35, 37, 40, 7, 12, 23, 10, 6,
588 12, 38, 34, 8, 9, 24, 26, 35, 37, 39,
589 41, 42, 23, 23, 23, 10, 23, 28, 23, 25,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500590 23
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000591};
592
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700593 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
594static const yytype_uint8 yyr1[] =
595{
Duncan Laurie4650f5b2016-05-07 20:01:34 -0700596 0, 30, 32, 31, 33, 33, 33, 33, 34, 34,
597 34, 34, 34, 34, 36, 35, 38, 37, 39, 40,
598 41, 41, 42
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700599};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000600
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700601 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
602static const yytype_uint8 yyr2[] =
603{
604 0, 2, 0, 2, 2, 2, 2, 0, 2, 2,
605 2, 2, 2, 0, 0, 5, 0, 7, 4, 4,
606 3, 4, 4
607};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000608
609
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700610#define yyerrok (yyerrstatus = 0)
611#define yyclearin (yychar = YYEMPTY)
612#define YYEMPTY (-2)
613#define YYEOF 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000614
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700615#define YYACCEPT goto yyacceptlab
616#define YYABORT goto yyabortlab
617#define YYERROR goto yyerrorlab
618
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000619
620#define YYRECOVERING() (!!yyerrstatus)
621
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700622#define YYBACKUP(Token, Value) \
623do \
624 if (yychar == YYEMPTY) \
625 { \
626 yychar = (Token); \
627 yylval = (Value); \
628 YYPOPSTACK (yylen); \
629 yystate = *yyssp; \
630 goto yybackup; \
631 } \
632 else \
633 { \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000634 yyerror (YY_("syntax error: cannot back up")); \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700635 YYERROR; \
636 } \
637while (0)
638
639/* Error token number */
640#define YYTERROR 1
641#define YYERRCODE 256
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000642
643
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000644
645/* Enable debugging if requested. */
646#if YYDEBUG
647
648# ifndef YYFPRINTF
649# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
650# define YYFPRINTF fprintf
651# endif
652
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700653# define YYDPRINTF(Args) \
654do { \
655 if (yydebug) \
656 YYFPRINTF Args; \
657} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000658
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700659/* This macro is provided for backward compatibility. */
660#ifndef YY_LOCATION_PRINT
661# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
662#endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000663
664
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700665# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
666do { \
667 if (yydebug) \
668 { \
669 YYFPRINTF (stderr, "%s ", Title); \
670 yy_symbol_print (stderr, \
671 Type, Value); \
672 YYFPRINTF (stderr, "\n"); \
673 } \
674} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000675
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700676
677/*----------------------------------------.
678| Print this symbol's value on YYOUTPUT. |
679`----------------------------------------*/
680
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000681static void
682yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000683{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700684 FILE *yyo = yyoutput;
685 YYUSE (yyo);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000686 if (!yyvaluep)
687 return;
688# ifdef YYPRINT
689 if (yytype < YYNTOKENS)
690 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000691# endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700692 YYUSE (yytype);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000693}
694
695
696/*--------------------------------.
697| Print this symbol on YYOUTPUT. |
698`--------------------------------*/
699
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000700static void
701yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000702{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700703 YYFPRINTF (yyoutput, "%s %s (",
704 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000705
706 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
707 YYFPRINTF (yyoutput, ")");
708}
709
710/*------------------------------------------------------------------.
711| yy_stack_print -- Print the state stack from its BOTTOM up to its |
712| TOP (included). |
713`------------------------------------------------------------------*/
714
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000715static void
716yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000717{
718 YYFPRINTF (stderr, "Stack now");
719 for (; yybottom <= yytop; yybottom++)
720 {
721 int yybot = *yybottom;
722 YYFPRINTF (stderr, " %d", yybot);
723 }
724 YYFPRINTF (stderr, "\n");
725}
726
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700727# define YY_STACK_PRINT(Bottom, Top) \
728do { \
729 if (yydebug) \
730 yy_stack_print ((Bottom), (Top)); \
731} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000732
733
734/*------------------------------------------------.
735| Report that the YYRULE is going to be reduced. |
736`------------------------------------------------*/
737
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000738static void
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700739yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000740{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700741 unsigned long int yylno = yyrline[yyrule];
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000742 int yynrhs = yyr2[yyrule];
743 int yyi;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000744 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700745 yyrule - 1, yylno);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000746 /* The symbols being reduced. */
747 for (yyi = 0; yyi < yynrhs; yyi++)
748 {
749 YYFPRINTF (stderr, " $%d = ", yyi + 1);
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700750 yy_symbol_print (stderr,
751 yystos[yyssp[yyi + 1 - yynrhs]],
752 &(yyvsp[(yyi + 1) - (yynrhs)])
753 );
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000754 YYFPRINTF (stderr, "\n");
755 }
756}
757
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700758# define YY_REDUCE_PRINT(Rule) \
759do { \
760 if (yydebug) \
761 yy_reduce_print (yyssp, yyvsp, Rule); \
762} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000763
764/* Nonzero means print parse trace. It is left uninitialized so that
765 multiple parsers can coexist. */
766int yydebug;
767#else /* !YYDEBUG */
768# define YYDPRINTF(Args)
769# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
770# define YY_STACK_PRINT(Bottom, Top)
771# define YY_REDUCE_PRINT(Rule)
772#endif /* !YYDEBUG */
773
774
775/* YYINITDEPTH -- initial size of the parser's stacks. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700776#ifndef YYINITDEPTH
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000777# define YYINITDEPTH 200
778#endif
779
780/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
781 if the built-in stack extension method is used).
782
783 Do not make this value too large; the results are undefined if
784 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
785 evaluated with infinite-precision integer arithmetic. */
786
787#ifndef YYMAXDEPTH
788# define YYMAXDEPTH 10000
789#endif
790
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000791
792#if YYERROR_VERBOSE
793
794# ifndef yystrlen
795# if defined __GLIBC__ && defined _STRING_H
796# define yystrlen strlen
797# else
798/* Return the length of YYSTR. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000799static YYSIZE_T
800yystrlen (const char *yystr)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000801{
802 YYSIZE_T yylen;
803 for (yylen = 0; yystr[yylen]; yylen++)
804 continue;
805 return yylen;
806}
807# endif
808# endif
809
810# ifndef yystpcpy
811# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
812# define yystpcpy stpcpy
813# else
814/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
815 YYDEST. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000816static char *
817yystpcpy (char *yydest, const char *yysrc)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000818{
819 char *yyd = yydest;
820 const char *yys = yysrc;
821
822 while ((*yyd++ = *yys++) != '\0')
823 continue;
824
825 return yyd - 1;
826}
827# endif
828# endif
829
830# ifndef yytnamerr
831/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
832 quotes and backslashes, so that it's suitable for yyerror. The
833 heuristic is that double-quoting is unnecessary unless the string
834 contains an apostrophe, a comma, or backslash (other than
835 backslash-backslash). YYSTR is taken from yytname. If YYRES is
836 null, do not copy; instead, return the length of what the result
837 would have been. */
838static YYSIZE_T
839yytnamerr (char *yyres, const char *yystr)
840{
841 if (*yystr == '"')
842 {
843 YYSIZE_T yyn = 0;
844 char const *yyp = yystr;
845
846 for (;;)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700847 switch (*++yyp)
848 {
849 case '\'':
850 case ',':
851 goto do_not_strip_quotes;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000852
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700853 case '\\':
854 if (*++yyp != '\\')
855 goto do_not_strip_quotes;
856 /* Fall through. */
857 default:
858 if (yyres)
859 yyres[yyn] = *yyp;
860 yyn++;
861 break;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000862
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700863 case '"':
864 if (yyres)
865 yyres[yyn] = '\0';
866 return yyn;
867 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000868 do_not_strip_quotes: ;
869 }
870
871 if (! yyres)
872 return yystrlen (yystr);
873
874 return yystpcpy (yyres, yystr) - yyres;
875}
876# endif
877
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200878/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
879 about the unexpected token YYTOKEN for the state stack whose top is
880 YYSSP.
881
882 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
883 not large enough to hold the message. In that case, also set
884 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
885 required number of bytes is too large to store. */
886static int
887yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
888 yytype_int16 *yyssp, int yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000889{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700890 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200891 YYSIZE_T yysize = yysize0;
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200892 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
893 /* Internationalized format string. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700894 const char *yyformat = YY_NULLPTR;
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200895 /* Arguments of yyformat. */
896 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
897 /* Number of reported tokens (one for the "unexpected", one per
898 "expected"). */
899 int yycount = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000900
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200901 /* There are many possibilities here to consider:
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200902 - If this state is a consistent state with a default action, then
903 the only way this function was invoked is if the default action
904 is an error action. In that case, don't check for expected
905 tokens because there are none.
906 - The only way there can be no lookahead present (in yychar) is if
907 this state is a consistent state with a default action. Thus,
908 detecting the absence of a lookahead is sufficient to determine
909 that there is no unexpected or expected token to report. In that
910 case, just report a simple "syntax error".
911 - Don't assume there isn't a lookahead just because this state is a
912 consistent state with a default action. There might have been a
913 previous inconsistent state, consistent state with a non-default
914 action, or user semantic action that manipulated yychar.
915 - Of course, the expected token list depends on states to have
916 correct lookahead information, and it depends on the parser not
917 to perform extra reductions after fetching a lookahead from the
918 scanner and before detecting a syntax error. Thus, state merging
919 (from LALR or IELR) and default reductions corrupt the expected
920 token list. However, the list is correct for canonical LR with
921 one exception: it will still contain any token that will not be
922 accepted due to an error action in a later state.
923 */
924 if (yytoken != YYEMPTY)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000925 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200926 int yyn = yypact[*yyssp];
927 yyarg[yycount++] = yytname[yytoken];
928 if (!yypact_value_is_default (yyn))
929 {
930 /* Start YYX at -YYN if negative to avoid negative indexes in
931 YYCHECK. In other words, skip the first -YYN actions for
932 this state because they are default actions. */
933 int yyxbegin = yyn < 0 ? -yyn : 0;
934 /* Stay within bounds of both yycheck and yytname. */
935 int yychecklim = YYLAST - yyn + 1;
936 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
937 int yyx;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000938
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200939 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
940 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
941 && !yytable_value_is_error (yytable[yyx + yyn]))
942 {
943 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
944 {
945 yycount = 1;
946 yysize = yysize0;
947 break;
948 }
949 yyarg[yycount++] = yytname[yyx];
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700950 {
951 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
952 if (! (yysize <= yysize1
953 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
954 return 2;
955 yysize = yysize1;
956 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200957 }
958 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000959 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200960
961 switch (yycount)
962 {
963# define YYCASE_(N, S) \
964 case N: \
965 yyformat = S; \
966 break
967 YYCASE_(0, YY_("syntax error"));
968 YYCASE_(1, YY_("syntax error, unexpected %s"));
969 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
970 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
971 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
972 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
973# undef YYCASE_
974 }
975
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700976 {
977 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
978 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
979 return 2;
980 yysize = yysize1;
981 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200982
983 if (*yymsg_alloc < yysize)
984 {
985 *yymsg_alloc = 2 * yysize;
986 if (! (yysize <= *yymsg_alloc
987 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
988 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
989 return 1;
990 }
991
992 /* Avoid sprintf, as that infringes on the user's name space.
993 Don't have undefined behavior even if the translation
994 produced a string with the wrong number of "%s"s. */
995 {
996 char *yyp = *yymsg;
997 int yyi = 0;
998 while ((*yyp = *yyformat) != '\0')
999 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1000 {
1001 yyp += yytnamerr (yyp, yyarg[yyi++]);
1002 yyformat += 2;
1003 }
1004 else
1005 {
1006 yyp++;
1007 yyformat++;
1008 }
1009 }
1010 return 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001011}
1012#endif /* YYERROR_VERBOSE */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001013
1014/*-----------------------------------------------.
1015| Release the memory associated to this symbol. |
1016`-----------------------------------------------*/
1017
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001018static void
1019yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001020{
1021 YYUSE (yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001022 if (!yymsg)
1023 yymsg = "Deleting";
1024 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1025
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001026 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1027 YYUSE (yytype);
1028 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001029}
1030
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001031
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001032
1033
1034/* The lookahead symbol. */
1035int yychar;
1036
1037/* The semantic value of the lookahead symbol. */
1038YYSTYPE yylval;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001039/* Number of syntax errors so far. */
1040int yynerrs;
1041
1042
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001043/*----------.
1044| yyparse. |
1045`----------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001046
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001047int
1048yyparse (void)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001049{
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001050 int yystate;
1051 /* Number of tokens to shift before error messages enabled. */
1052 int yyerrstatus;
1053
1054 /* The stacks and their tools:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001055 'yyss': related to states.
1056 'yyvs': related to semantic values.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001057
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001058 Refer to the stacks through separate pointers, to allow yyoverflow
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001059 to reallocate them elsewhere. */
1060
1061 /* The state stack. */
1062 yytype_int16 yyssa[YYINITDEPTH];
1063 yytype_int16 *yyss;
1064 yytype_int16 *yyssp;
1065
1066 /* The semantic value stack. */
1067 YYSTYPE yyvsa[YYINITDEPTH];
1068 YYSTYPE *yyvs;
1069 YYSTYPE *yyvsp;
1070
1071 YYSIZE_T yystacksize;
1072
1073 int yyn;
1074 int yyresult;
1075 /* Lookahead token as an internal (translated) token number. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001076 int yytoken = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001077 /* The variables used to return semantic value and location from the
1078 action routines. */
1079 YYSTYPE yyval;
1080
1081#if YYERROR_VERBOSE
1082 /* Buffer for error messages, and its allocated size. */
1083 char yymsgbuf[128];
1084 char *yymsg = yymsgbuf;
1085 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1086#endif
1087
1088#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1089
1090 /* The number of symbols on the RHS of the reduced rule.
1091 Keep to zero when no symbol should be popped. */
1092 int yylen = 0;
1093
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001094 yyssp = yyss = yyssa;
1095 yyvsp = yyvs = yyvsa;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001096 yystacksize = YYINITDEPTH;
1097
1098 YYDPRINTF ((stderr, "Starting parse\n"));
1099
1100 yystate = 0;
1101 yyerrstatus = 0;
1102 yynerrs = 0;
1103 yychar = YYEMPTY; /* Cause a token to be read. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001104 goto yysetstate;
1105
1106/*------------------------------------------------------------.
1107| yynewstate -- Push a new state, which is found in yystate. |
1108`------------------------------------------------------------*/
1109 yynewstate:
1110 /* In all cases, when you get here, the value and location stacks
1111 have just been pushed. So pushing a state here evens the stacks. */
1112 yyssp++;
1113
1114 yysetstate:
1115 *yyssp = yystate;
1116
1117 if (yyss + yystacksize - 1 <= yyssp)
1118 {
1119 /* Get the current used size of the three stacks, in elements. */
1120 YYSIZE_T yysize = yyssp - yyss + 1;
1121
1122#ifdef yyoverflow
1123 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001124 /* Give user a chance to reallocate the stack. Use copies of
1125 these so that the &'s don't force the real ones into
1126 memory. */
1127 YYSTYPE *yyvs1 = yyvs;
1128 yytype_int16 *yyss1 = yyss;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001129
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001130 /* Each stack pointer address is followed by the size of the
1131 data in use in that stack, in bytes. This used to be a
1132 conditional around just the two extra args, but that might
1133 be undefined if yyoverflow is a macro. */
1134 yyoverflow (YY_("memory exhausted"),
1135 &yyss1, yysize * sizeof (*yyssp),
1136 &yyvs1, yysize * sizeof (*yyvsp),
1137 &yystacksize);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001138
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001139 yyss = yyss1;
1140 yyvs = yyvs1;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001141 }
1142#else /* no yyoverflow */
1143# ifndef YYSTACK_RELOCATE
1144 goto yyexhaustedlab;
1145# else
1146 /* Extend the stack our own way. */
1147 if (YYMAXDEPTH <= yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001148 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001149 yystacksize *= 2;
1150 if (YYMAXDEPTH < yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001151 yystacksize = YYMAXDEPTH;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001152
1153 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001154 yytype_int16 *yyss1 = yyss;
1155 union yyalloc *yyptr =
1156 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1157 if (! yyptr)
1158 goto yyexhaustedlab;
1159 YYSTACK_RELOCATE (yyss_alloc, yyss);
1160 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001161# undef YYSTACK_RELOCATE
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001162 if (yyss1 != yyssa)
1163 YYSTACK_FREE (yyss1);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001164 }
1165# endif
1166#endif /* no yyoverflow */
1167
1168 yyssp = yyss + yysize - 1;
1169 yyvsp = yyvs + yysize - 1;
1170
1171 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001172 (unsigned long int) yystacksize));
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001173
1174 if (yyss + yystacksize - 1 <= yyssp)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001175 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001176 }
1177
1178 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1179
1180 if (yystate == YYFINAL)
1181 YYACCEPT;
1182
1183 goto yybackup;
1184
1185/*-----------.
1186| yybackup. |
1187`-----------*/
1188yybackup:
1189
1190 /* Do appropriate processing given the current state. Read a
1191 lookahead token if we need one and don't already have one. */
1192
1193 /* First try to decide what to do without reference to lookahead token. */
1194 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001195 if (yypact_value_is_default (yyn))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001196 goto yydefault;
1197
1198 /* Not known => get a lookahead token if don't already have one. */
1199
1200 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1201 if (yychar == YYEMPTY)
1202 {
1203 YYDPRINTF ((stderr, "Reading a token: "));
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001204 yychar = yylex ();
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001205 }
1206
1207 if (yychar <= YYEOF)
1208 {
1209 yychar = yytoken = YYEOF;
1210 YYDPRINTF ((stderr, "Now at end of input.\n"));
1211 }
1212 else
1213 {
1214 yytoken = YYTRANSLATE (yychar);
1215 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1216 }
1217
1218 /* If the proper action on seeing token YYTOKEN is to reduce or to
1219 detect an error, take that action. */
1220 yyn += yytoken;
1221 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1222 goto yydefault;
1223 yyn = yytable[yyn];
1224 if (yyn <= 0)
1225 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001226 if (yytable_value_is_error (yyn))
1227 goto yyerrlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001228 yyn = -yyn;
1229 goto yyreduce;
1230 }
1231
1232 /* Count tokens shifted since error; after three, turn off error
1233 status. */
1234 if (yyerrstatus)
1235 yyerrstatus--;
1236
1237 /* Shift the lookahead token. */
1238 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1239
1240 /* Discard the shifted token. */
1241 yychar = YYEMPTY;
1242
1243 yystate = yyn;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001244 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001245 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001246 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001247
1248 goto yynewstate;
1249
1250
1251/*-----------------------------------------------------------.
1252| yydefault -- do the default action for the current state. |
1253`-----------------------------------------------------------*/
1254yydefault:
1255 yyn = yydefact[yystate];
1256 if (yyn == 0)
1257 goto yyerrlab;
1258 goto yyreduce;
1259
1260
1261/*-----------------------------.
1262| yyreduce -- Do a reduction. |
1263`-----------------------------*/
1264yyreduce:
1265 /* yyn is the number of a rule to reduce with. */
1266 yylen = yyr2[yyn];
1267
1268 /* If YYLEN is nonzero, implement the default value of the action:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001269 '$$ = $1'.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001270
1271 Otherwise, the following line sets YYVAL to garbage.
1272 This behavior is undocumented and Bison
1273 users should not rely upon it. Assigning to YYVAL
1274 unconditionally makes the parser a bit smaller, and it avoids a
1275 GCC warning that YYVAL may be used uninitialized. */
1276 yyval = yyvsp[1-yylen];
1277
1278
1279 YY_REDUCE_PRINT (yyn);
1280 switch (yyn)
1281 {
1282 case 2:
1283
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001284 { cur_parent = cur_bus = head; }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001285
Patrick Georgi68befd52010-05-05 12:05:25 +00001286 break;
1287
1288 case 3:
1289
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001290 { postprocess_devtree(); }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001291
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001292 break;
1293
Sven Schnelle270a9082011-03-01 19:58:15 +00001294 case 14:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001295
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001296 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001297 (yyval.device) = new_chip(cur_parent, cur_bus, (yyvsp[0].string));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001298 cur_parent = (yyval.device);
1299}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001300
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001301 break;
1302
Sven Schnelle270a9082011-03-01 19:58:15 +00001303 case 15:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001304
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001305 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001306 cur_parent = (yyvsp[-2].device)->parent;
1307 fold_in((yyvsp[-2].device));
1308 add_header((yyvsp[-2].device));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001309}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001310
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001311 break;
1312
Sven Schnelle270a9082011-03-01 19:58:15 +00001313 case 16:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001314
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001315 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001316 (yyval.device) = new_device(cur_parent, cur_bus, (yyvsp[-2].number), (yyvsp[-1].string), (yyvsp[0].number));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001317 cur_parent = (yyval.device);
1318 cur_bus = (yyval.device);
1319}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001320
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001321 break;
1322
1323 case 17:
1324
1325 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001326 cur_parent = (yyvsp[-2].device)->parent;
1327 cur_bus = (yyvsp[-2].device)->bus;
1328 fold_in((yyvsp[-2].device));
1329 alias_siblings((yyvsp[-2].device)->children);
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001330}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001331
Patrick Georgi68befd52010-05-05 12:05:25 +00001332 break;
1333
Sven Schnelle270a9082011-03-01 19:58:15 +00001334 case 18:
Patrick Georgi68befd52010-05-05 12:05:25 +00001335
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001336 { add_resource(cur_parent, (yyvsp[-3].number), strtol((yyvsp[-2].string), NULL, 0), strtol((yyvsp[0].string), NULL, 0)); }
1337
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001338 break;
1339
Sven Schnelle270a9082011-03-01 19:58:15 +00001340 case 19:
1341
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001342 { add_register(cur_parent, (yyvsp[-2].string), (yyvsp[0].string)); }
1343
Sven Schnelle270a9082011-03-01 19:58:15 +00001344 break;
1345
1346 case 20:
1347
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001348 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-1].string), NULL, 16), strtol((yyvsp[0].string), NULL, 16), 0); }
1349
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001350 break;
1351
1352 case 21:
1353
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001354 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-2].string), NULL, 16), strtol((yyvsp[-1].string), NULL, 16), 1); }
1355
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001356 break;
1357
1358 case 22:
1359
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001360 { add_ioapic_info(cur_parent, strtol((yyvsp[-2].string), NULL, 16), (yyvsp[-1].string), strtol((yyvsp[0].string), NULL, 16)); }
1361
Sven Schnelle270a9082011-03-01 19:58:15 +00001362 break;
1363
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001364
1365
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001366 default: break;
1367 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001368 /* User semantic actions sometimes alter yychar, and that requires
1369 that yytoken be updated with the new translation. We take the
1370 approach of translating immediately before every use of yytoken.
1371 One alternative is translating here after every semantic action,
1372 but that translation would be missed if the semantic action invokes
1373 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1374 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1375 incorrect destructor might then be invoked immediately. In the
1376 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1377 to an incorrect destructor call or verbose syntax error message
1378 before the lookahead is translated. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001379 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1380
1381 YYPOPSTACK (yylen);
1382 yylen = 0;
1383 YY_STACK_PRINT (yyss, yyssp);
1384
1385 *++yyvsp = yyval;
1386
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001387 /* Now 'shift' the result of the reduction. Determine what state
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001388 that goes to, based on the state we popped back to and the rule
1389 number reduced by. */
1390
1391 yyn = yyr1[yyn];
1392
1393 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1394 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1395 yystate = yytable[yystate];
1396 else
1397 yystate = yydefgoto[yyn - YYNTOKENS];
1398
1399 goto yynewstate;
1400
1401
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001402/*--------------------------------------.
1403| yyerrlab -- here on detecting error. |
1404`--------------------------------------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001405yyerrlab:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001406 /* Make sure we have latest lookahead translation. See comments at
1407 user semantic actions for why this is necessary. */
1408 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1409
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001410 /* If not already recovering from an error, report this error. */
1411 if (!yyerrstatus)
1412 {
1413 ++yynerrs;
1414#if ! YYERROR_VERBOSE
1415 yyerror (YY_("syntax error"));
1416#else
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001417# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1418 yyssp, yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001419 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001420 char const *yymsgp = YY_("syntax error");
1421 int yysyntax_error_status;
1422 yysyntax_error_status = YYSYNTAX_ERROR;
1423 if (yysyntax_error_status == 0)
1424 yymsgp = yymsg;
1425 else if (yysyntax_error_status == 1)
1426 {
1427 if (yymsg != yymsgbuf)
1428 YYSTACK_FREE (yymsg);
1429 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1430 if (!yymsg)
1431 {
1432 yymsg = yymsgbuf;
1433 yymsg_alloc = sizeof yymsgbuf;
1434 yysyntax_error_status = 2;
1435 }
1436 else
1437 {
1438 yysyntax_error_status = YYSYNTAX_ERROR;
1439 yymsgp = yymsg;
1440 }
1441 }
1442 yyerror (yymsgp);
1443 if (yysyntax_error_status == 2)
1444 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001445 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001446# undef YYSYNTAX_ERROR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001447#endif
1448 }
1449
1450
1451
1452 if (yyerrstatus == 3)
1453 {
1454 /* If just tried and failed to reuse lookahead token after an
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001455 error, discard it. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001456
1457 if (yychar <= YYEOF)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001458 {
1459 /* Return failure if at end of input. */
1460 if (yychar == YYEOF)
1461 YYABORT;
1462 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001463 else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001464 {
1465 yydestruct ("Error: discarding",
1466 yytoken, &yylval);
1467 yychar = YYEMPTY;
1468 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001469 }
1470
1471 /* Else will try to reuse lookahead token after shifting the error
1472 token. */
1473 goto yyerrlab1;
1474
1475
1476/*---------------------------------------------------.
1477| yyerrorlab -- error raised explicitly by YYERROR. |
1478`---------------------------------------------------*/
1479yyerrorlab:
1480
1481 /* Pacify compilers like GCC when the user code never invokes
1482 YYERROR and the label yyerrorlab therefore never appears in user
1483 code. */
1484 if (/*CONSTCOND*/ 0)
1485 goto yyerrorlab;
1486
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001487 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001488 this YYERROR. */
1489 YYPOPSTACK (yylen);
1490 yylen = 0;
1491 YY_STACK_PRINT (yyss, yyssp);
1492 yystate = *yyssp;
1493 goto yyerrlab1;
1494
1495
1496/*-------------------------------------------------------------.
1497| yyerrlab1 -- common code for both syntax error and YYERROR. |
1498`-------------------------------------------------------------*/
1499yyerrlab1:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001500 yyerrstatus = 3; /* Each real token shifted decrements this. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001501
1502 for (;;)
1503 {
1504 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001505 if (!yypact_value_is_default (yyn))
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001506 {
1507 yyn += YYTERROR;
1508 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1509 {
1510 yyn = yytable[yyn];
1511 if (0 < yyn)
1512 break;
1513 }
1514 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001515
1516 /* Pop the current state because it cannot handle the error token. */
1517 if (yyssp == yyss)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001518 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001519
1520
1521 yydestruct ("Error: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001522 yystos[yystate], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001523 YYPOPSTACK (1);
1524 yystate = *yyssp;
1525 YY_STACK_PRINT (yyss, yyssp);
1526 }
1527
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001528 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001529 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001530 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001531
1532
1533 /* Shift the error token. */
1534 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1535
1536 yystate = yyn;
1537 goto yynewstate;
1538
1539
1540/*-------------------------------------.
1541| yyacceptlab -- YYACCEPT comes here. |
1542`-------------------------------------*/
1543yyacceptlab:
1544 yyresult = 0;
1545 goto yyreturn;
1546
1547/*-----------------------------------.
1548| yyabortlab -- YYABORT comes here. |
1549`-----------------------------------*/
1550yyabortlab:
1551 yyresult = 1;
1552 goto yyreturn;
1553
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001554#if !defined yyoverflow || YYERROR_VERBOSE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001555/*-------------------------------------------------.
1556| yyexhaustedlab -- memory exhaustion comes here. |
1557`-------------------------------------------------*/
1558yyexhaustedlab:
1559 yyerror (YY_("memory exhausted"));
1560 yyresult = 2;
1561 /* Fall through. */
1562#endif
1563
1564yyreturn:
1565 if (yychar != YYEMPTY)
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001566 {
1567 /* Make sure we have latest lookahead translation. See comments at
1568 user semantic actions for why this is necessary. */
1569 yytoken = YYTRANSLATE (yychar);
1570 yydestruct ("Cleanup: discarding lookahead",
1571 yytoken, &yylval);
1572 }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001573 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001574 this YYABORT or YYACCEPT. */
1575 YYPOPSTACK (yylen);
1576 YY_STACK_PRINT (yyss, yyssp);
1577 while (yyssp != yyss)
1578 {
1579 yydestruct ("Cleanup: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001580 yystos[*yyssp], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001581 YYPOPSTACK (1);
1582 }
1583#ifndef yyoverflow
1584 if (yyss != yyssa)
1585 YYSTACK_FREE (yyss);
1586#endif
1587#if YYERROR_VERBOSE
1588 if (yymsg != yymsgbuf)
1589 YYSTACK_FREE (yymsg);
1590#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001591 return yyresult;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001592}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001593
1594