blob: 116f41f05ceab424ac9b382b65b2ad870cdd00df [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,
Furquan Shaikhe6700292017-02-11 00:50:38 -0800152 GENERIC = 284,
153 SPI = 285
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700154 };
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000155#endif
156
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700157/* Value type. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000158#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700159
160union YYSTYPE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000161{
162
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000163
164 struct device *device;
165 char *string;
166 int number;
167
168
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700169};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000170
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700171typedef union YYSTYPE YYSTYPE;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000172# define YYSTYPE_IS_TRIVIAL 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000173# define YYSTYPE_IS_DECLARED 1
174#endif
175
176
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700177extern YYSTYPE yylval;
178
179int yyparse (void);
180
181#endif /* !YY_YY_SCONFIG_TAB_H_SHIPPED_INCLUDED */
182
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000183/* Copy the second part of user declarations. */
184
185
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000186
187#ifdef short
188# undef short
189#endif
190
191#ifdef YYTYPE_UINT8
192typedef YYTYPE_UINT8 yytype_uint8;
193#else
194typedef unsigned char yytype_uint8;
195#endif
196
197#ifdef YYTYPE_INT8
198typedef YYTYPE_INT8 yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000199#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700200typedef signed char yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000201#endif
202
203#ifdef YYTYPE_UINT16
204typedef YYTYPE_UINT16 yytype_uint16;
205#else
206typedef unsigned short int yytype_uint16;
207#endif
208
209#ifdef YYTYPE_INT16
210typedef YYTYPE_INT16 yytype_int16;
211#else
212typedef short int yytype_int16;
213#endif
214
215#ifndef YYSIZE_T
216# ifdef __SIZE_TYPE__
217# define YYSIZE_T __SIZE_TYPE__
218# elif defined size_t
219# define YYSIZE_T size_t
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700220# elif ! defined YYSIZE_T
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000221# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
222# define YYSIZE_T size_t
223# else
224# define YYSIZE_T unsigned int
225# endif
226#endif
227
228#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
229
230#ifndef YY_
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200231# if defined YYENABLE_NLS && YYENABLE_NLS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000232# if ENABLE_NLS
233# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700234# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000235# endif
236# endif
237# ifndef YY_
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700238# define YY_(Msgid) Msgid
239# endif
240#endif
241
242#ifndef YY_ATTRIBUTE
243# if (defined __GNUC__ \
244 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
245 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
246# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
247# else
248# define YY_ATTRIBUTE(Spec) /* empty */
249# endif
250#endif
251
252#ifndef YY_ATTRIBUTE_PURE
253# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
254#endif
255
256#ifndef YY_ATTRIBUTE_UNUSED
257# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
258#endif
259
260#if !defined _Noreturn \
261 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
262# if defined _MSC_VER && 1200 <= _MSC_VER
263# define _Noreturn __declspec (noreturn)
264# else
265# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000266# endif
267#endif
268
269/* Suppress unused-variable warnings by "using" E. */
270#if ! defined lint || defined __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700271# define YYUSE(E) ((void) (E))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000272#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700273# define YYUSE(E) /* empty */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000274#endif
275
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700276#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
277/* Suppress an incorrect diagnostic about yylval being uninitialized. */
278# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
279 _Pragma ("GCC diagnostic push") \
280 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
281 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
282# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
283 _Pragma ("GCC diagnostic pop")
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000284#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700285# define YY_INITIAL_VALUE(Value) Value
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000286#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700287#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
288# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
289# define YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000290#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700291#ifndef YY_INITIAL_VALUE
292# define YY_INITIAL_VALUE(Value) /* Nothing. */
293#endif
294
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000295
296#if ! defined yyoverflow || YYERROR_VERBOSE
297
298/* The parser invokes alloca or malloc; define the necessary symbols. */
299
300# ifdef YYSTACK_USE_ALLOCA
301# if YYSTACK_USE_ALLOCA
302# ifdef __GNUC__
303# define YYSTACK_ALLOC __builtin_alloca
304# elif defined __BUILTIN_VA_ARG_INCR
305# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
306# elif defined _AIX
307# define YYSTACK_ALLOC __alloca
308# elif defined _MSC_VER
309# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
310# define alloca _alloca
311# else
312# define YYSTACK_ALLOC alloca
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700313# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000314# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700315 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200316# ifndef EXIT_SUCCESS
317# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000318# endif
319# endif
320# endif
321# endif
322# endif
323
324# ifdef YYSTACK_ALLOC
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700325 /* Pacify GCC's 'empty if-body' warning. */
326# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000327# ifndef YYSTACK_ALLOC_MAXIMUM
328 /* The OS might guarantee only one guard page at the bottom of the stack,
329 and a page size can be as small as 4096 bytes. So we cannot safely
330 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
331 to allow for a few compiler-allocated temporary stack slots. */
332# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
333# endif
334# else
335# define YYSTACK_ALLOC YYMALLOC
336# define YYSTACK_FREE YYFREE
337# ifndef YYSTACK_ALLOC_MAXIMUM
338# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
339# endif
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200340# if (defined __cplusplus && ! defined EXIT_SUCCESS \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000341 && ! ((defined YYMALLOC || defined malloc) \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700342 && (defined YYFREE || defined free)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000343# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200344# ifndef EXIT_SUCCESS
345# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000346# endif
347# endif
348# ifndef YYMALLOC
349# define YYMALLOC malloc
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700350# if ! defined malloc && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000351void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
352# endif
353# endif
354# ifndef YYFREE
355# define YYFREE free
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700356# if ! defined free && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000357void free (void *); /* INFRINGES ON USER NAME SPACE */
358# endif
359# endif
360# endif
361#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
362
363
364#if (! defined yyoverflow \
365 && (! defined __cplusplus \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700366 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000367
368/* A type that is properly aligned for any stack member. */
369union yyalloc
370{
371 yytype_int16 yyss_alloc;
372 YYSTYPE yyvs_alloc;
373};
374
375/* The size of the maximum gap between one aligned stack and the next. */
376# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
377
378/* The size of an array large to enough to hold all stacks, each with
379 N elements. */
380# define YYSTACK_BYTES(N) \
381 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
382 + YYSTACK_GAP_MAXIMUM)
383
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200384# define YYCOPY_NEEDED 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000385
386/* Relocate STACK from its old location to the new one. The
387 local variables YYSIZE and YYSTACKSIZE give the old and new number of
388 elements in the stack, and YYPTR gives the new location of the
389 stack. Advance YYPTR to a properly aligned location for the next
390 stack. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700391# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
392 do \
393 { \
394 YYSIZE_T yynewbytes; \
395 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
396 Stack = &yyptr->Stack_alloc; \
397 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
398 yyptr += yynewbytes / sizeof (*yyptr); \
399 } \
400 while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000401
402#endif
403
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200404#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700405/* Copy COUNT objects from SRC to DST. The source and destination do
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200406 not overlap. */
407# ifndef YYCOPY
408# if defined __GNUC__ && 1 < __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700409# define YYCOPY(Dst, Src, Count) \
410 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200411# else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700412# define YYCOPY(Dst, Src, Count) \
413 do \
414 { \
415 YYSIZE_T yyi; \
416 for (yyi = 0; yyi < (Count); yyi++) \
417 (Dst)[yyi] = (Src)[yyi]; \
418 } \
419 while (0)
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200420# endif
421# endif
422#endif /* !YYCOPY_NEEDED */
423
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000424/* YYFINAL -- State number of the termination state. */
Patrick Georgi68befd52010-05-05 12:05:25 +0000425#define YYFINAL 3
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000426/* YYLAST -- Last index in YYTABLE. */
Aaron Durbinffda804b2014-09-03 12:40:15 -0500427#define YYLAST 39
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000428
429/* YYNTOKENS -- Number of terminals. */
Furquan Shaikhe6700292017-02-11 00:50:38 -0800430#define YYNTOKENS 31
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000431/* YYNNTS -- Number of nonterminals. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200432#define YYNNTS 13
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000433/* YYNRULES -- Number of rules. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200434#define YYNRULES 22
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700435/* YYNSTATES -- Number of states. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200436#define YYNSTATES 41
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000437
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700438/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
439 by yylex, with out-of-bounds checking. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000440#define YYUNDEFTOK 2
Furquan Shaikhe6700292017-02-11 00:50:38 -0800441#define YYMAXUTOK 285
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000442
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700443#define YYTRANSLATE(YYX) \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000444 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
445
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700446/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
447 as returned by yylex, without out-of-bounds checking. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000448static const yytype_uint8 yytranslate[] =
449{
450 0, 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, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
476 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200477 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
Furquan Shaikhe6700292017-02-11 00:50:38 -0800478 25, 26, 27, 28, 29, 30
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000479};
480
481#if YYDEBUG
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700482 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
Patrick Georgi114e7b22010-05-05 11:19:50 +0000483static const yytype_uint8 yyrline[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000484{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700485 0, 34, 34, 34, 36, 36, 36, 36, 38, 38,
486 38, 38, 38, 38, 40, 40, 50, 50, 62, 65,
487 68, 71, 74
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000488};
489#endif
490
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700491#if YYDEBUG || YYERROR_VERBOSE || 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000492/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
493 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
494static const char *const yytname[] =
495{
496 "$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
497 "BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI", "PNP", "I2C",
Aaron Durbinffda804b2014-09-03 12:40:15 -0500498 "APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ", "IO", "NUMBER",
Duncan Laurie4650f5b2016-05-07 20:01:34 -0700499 "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IOAPIC", "PCIINT", "GENERIC",
Furquan Shaikhe6700292017-02-11 00:50:38 -0800500 "SPI", "$accept", "devtree", "$@1", "chipchildren", "devicechildren",
501 "chip", "@2", "device", "@3", "resource", "registers", "subsystemid",
Duncan Laurie4650f5b2016-05-07 20:01:34 -0700502 "ioapic_irq", YY_NULLPTR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000503};
504#endif
505
506# ifdef YYPRINT
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700507/* YYTOKNUM[NUM] -- (External) token number corresponding to the
508 (internal) symbol number NUM (which must be that of a token). */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000509static const yytype_uint16 yytoknum[] =
510{
511 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
512 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
Furquan Shaikhe6700292017-02-11 00:50:38 -0800513 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
514 285
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000515};
516# endif
517
Aaron Durbinffda804b2014-09-03 12:40:15 -0500518#define YYPACT_NINF -10
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700519
520#define yypact_value_is_default(Yystate) \
521 (!!((Yystate) == (-10)))
522
523#define YYTABLE_NINF -1
524
525#define yytable_value_is_error(Yytable_value) \
526 0
527
528 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
529 STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000530static const yytype_int8 yypact[] =
531{
Aaron Durbinffda804b2014-09-03 12:40:15 -0500532 -10, 3, 1, -10, -2, -10, -10, -10, 4, 5,
533 -1, -10, -10, -10, -10, -9, 7, 9, 6, -10,
534 -10, -10, -3, -4, -10, 2, 8, -10, -10, -10,
535 -10, -10, 10, 11, 0, 12, 13, 14, -10, -10,
536 -10
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000537};
538
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700539 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
540 Performed when YYTABLE does not specify something else to do. Zero
541 means the default is an error. */
542static const yytype_uint8 yydefact[] =
543{
544 2, 0, 0, 1, 0, 3, 14, 7, 0, 0,
545 0, 15, 5, 4, 6, 0, 0, 0, 0, 16,
546 19, 13, 0, 0, 17, 0, 0, 9, 8, 10,
547 11, 12, 0, 0, 0, 0, 20, 0, 18, 21,
548 22
549};
550
551 /* YYPGOTO[NTERM-NUM]. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000552static const yytype_int8 yypgoto[] =
553{
Aaron Durbinffda804b2014-09-03 12:40:15 -0500554 -10, -10, -10, -10, -10, -6, -10, 17, -10, -10,
555 -10, -10, -10
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000556};
557
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700558 /* YYDEFGOTO[NTERM-NUM]. */
559static const yytype_int8 yydefgoto[] =
560{
561 -1, 1, 2, 8, 22, 5, 7, 13, 21, 29,
562 14, 30, 31
563};
564
565 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
566 positive, shift that token. If negative, reduce the rule whose
567 number is the opposite. If YYTABLE_NINF, syntax error. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000568static const yytype_uint8 yytable[] =
569{
Sven Schnelle270a9082011-03-01 19:58:15 +0000570 4, 9, 12, 3, 4, 23, 24, 4, 9, 10,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500571 6, 16, 15, 11, 17, 19, 27, 18, 20, 32,
572 35, 25, 0, 26, 0, 33, 0, 0, 37, 0,
573 0, 34, 0, 0, 36, 38, 0, 40, 39, 28
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000574};
575
Patrick Georgi8f625f62010-05-05 13:13:47 +0000576static const yytype_int8 yycheck[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000577{
Sven Schnelle270a9082011-03-01 19:58:15 +0000578 3, 4, 8, 0, 3, 8, 9, 3, 4, 5,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500579 12, 12, 7, 9, 23, 6, 22, 10, 12, 23,
580 10, 24, -1, 26, -1, 23, -1, -1, 28, -1,
581 -1, 23, -1, -1, 23, 23, -1, 23, 25, 22
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000582};
583
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700584 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
585 symbol of state STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000586static const yytype_uint8 yystos[] =
587{
Furquan Shaikhe6700292017-02-11 00:50:38 -0800588 0, 32, 33, 0, 3, 36, 12, 37, 34, 4,
589 5, 9, 36, 38, 41, 7, 12, 23, 10, 6,
590 12, 39, 35, 8, 9, 24, 26, 36, 38, 40,
591 42, 43, 23, 23, 23, 10, 23, 28, 23, 25,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500592 23
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000593};
594
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700595 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
596static const yytype_uint8 yyr1[] =
597{
Furquan Shaikhe6700292017-02-11 00:50:38 -0800598 0, 31, 33, 32, 34, 34, 34, 34, 35, 35,
599 35, 35, 35, 35, 37, 36, 39, 38, 40, 41,
600 42, 42, 43
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700601};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000602
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700603 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
604static const yytype_uint8 yyr2[] =
605{
606 0, 2, 0, 2, 2, 2, 2, 0, 2, 2,
607 2, 2, 2, 0, 0, 5, 0, 7, 4, 4,
608 3, 4, 4
609};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000610
611
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700612#define yyerrok (yyerrstatus = 0)
613#define yyclearin (yychar = YYEMPTY)
614#define YYEMPTY (-2)
615#define YYEOF 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000616
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700617#define YYACCEPT goto yyacceptlab
618#define YYABORT goto yyabortlab
619#define YYERROR goto yyerrorlab
620
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000621
622#define YYRECOVERING() (!!yyerrstatus)
623
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700624#define YYBACKUP(Token, Value) \
625do \
626 if (yychar == YYEMPTY) \
627 { \
628 yychar = (Token); \
629 yylval = (Value); \
630 YYPOPSTACK (yylen); \
631 yystate = *yyssp; \
632 goto yybackup; \
633 } \
634 else \
635 { \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000636 yyerror (YY_("syntax error: cannot back up")); \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700637 YYERROR; \
638 } \
639while (0)
640
641/* Error token number */
642#define YYTERROR 1
643#define YYERRCODE 256
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000644
645
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000646
647/* Enable debugging if requested. */
648#if YYDEBUG
649
650# ifndef YYFPRINTF
651# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
652# define YYFPRINTF fprintf
653# endif
654
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700655# define YYDPRINTF(Args) \
656do { \
657 if (yydebug) \
658 YYFPRINTF Args; \
659} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000660
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700661/* This macro is provided for backward compatibility. */
662#ifndef YY_LOCATION_PRINT
663# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
664#endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000665
666
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700667# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
668do { \
669 if (yydebug) \
670 { \
671 YYFPRINTF (stderr, "%s ", Title); \
672 yy_symbol_print (stderr, \
673 Type, Value); \
674 YYFPRINTF (stderr, "\n"); \
675 } \
676} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000677
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700678
679/*----------------------------------------.
680| Print this symbol's value on YYOUTPUT. |
681`----------------------------------------*/
682
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000683static void
684yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000685{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700686 FILE *yyo = yyoutput;
687 YYUSE (yyo);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000688 if (!yyvaluep)
689 return;
690# ifdef YYPRINT
691 if (yytype < YYNTOKENS)
692 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000693# endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700694 YYUSE (yytype);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000695}
696
697
698/*--------------------------------.
699| Print this symbol on YYOUTPUT. |
700`--------------------------------*/
701
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000702static void
703yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000704{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700705 YYFPRINTF (yyoutput, "%s %s (",
706 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000707
708 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
709 YYFPRINTF (yyoutput, ")");
710}
711
712/*------------------------------------------------------------------.
713| yy_stack_print -- Print the state stack from its BOTTOM up to its |
714| TOP (included). |
715`------------------------------------------------------------------*/
716
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000717static void
718yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000719{
720 YYFPRINTF (stderr, "Stack now");
721 for (; yybottom <= yytop; yybottom++)
722 {
723 int yybot = *yybottom;
724 YYFPRINTF (stderr, " %d", yybot);
725 }
726 YYFPRINTF (stderr, "\n");
727}
728
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700729# define YY_STACK_PRINT(Bottom, Top) \
730do { \
731 if (yydebug) \
732 yy_stack_print ((Bottom), (Top)); \
733} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000734
735
736/*------------------------------------------------.
737| Report that the YYRULE is going to be reduced. |
738`------------------------------------------------*/
739
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000740static void
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700741yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000742{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700743 unsigned long int yylno = yyrline[yyrule];
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000744 int yynrhs = yyr2[yyrule];
745 int yyi;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000746 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700747 yyrule - 1, yylno);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000748 /* The symbols being reduced. */
749 for (yyi = 0; yyi < yynrhs; yyi++)
750 {
751 YYFPRINTF (stderr, " $%d = ", yyi + 1);
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700752 yy_symbol_print (stderr,
753 yystos[yyssp[yyi + 1 - yynrhs]],
754 &(yyvsp[(yyi + 1) - (yynrhs)])
755 );
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000756 YYFPRINTF (stderr, "\n");
757 }
758}
759
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700760# define YY_REDUCE_PRINT(Rule) \
761do { \
762 if (yydebug) \
763 yy_reduce_print (yyssp, yyvsp, Rule); \
764} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000765
766/* Nonzero means print parse trace. It is left uninitialized so that
767 multiple parsers can coexist. */
768int yydebug;
769#else /* !YYDEBUG */
770# define YYDPRINTF(Args)
771# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
772# define YY_STACK_PRINT(Bottom, Top)
773# define YY_REDUCE_PRINT(Rule)
774#endif /* !YYDEBUG */
775
776
777/* YYINITDEPTH -- initial size of the parser's stacks. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700778#ifndef YYINITDEPTH
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000779# define YYINITDEPTH 200
780#endif
781
782/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
783 if the built-in stack extension method is used).
784
785 Do not make this value too large; the results are undefined if
786 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
787 evaluated with infinite-precision integer arithmetic. */
788
789#ifndef YYMAXDEPTH
790# define YYMAXDEPTH 10000
791#endif
792
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000793
794#if YYERROR_VERBOSE
795
796# ifndef yystrlen
797# if defined __GLIBC__ && defined _STRING_H
798# define yystrlen strlen
799# else
800/* Return the length of YYSTR. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000801static YYSIZE_T
802yystrlen (const char *yystr)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000803{
804 YYSIZE_T yylen;
805 for (yylen = 0; yystr[yylen]; yylen++)
806 continue;
807 return yylen;
808}
809# endif
810# endif
811
812# ifndef yystpcpy
813# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
814# define yystpcpy stpcpy
815# else
816/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
817 YYDEST. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000818static char *
819yystpcpy (char *yydest, const char *yysrc)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000820{
821 char *yyd = yydest;
822 const char *yys = yysrc;
823
824 while ((*yyd++ = *yys++) != '\0')
825 continue;
826
827 return yyd - 1;
828}
829# endif
830# endif
831
832# ifndef yytnamerr
833/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
834 quotes and backslashes, so that it's suitable for yyerror. The
835 heuristic is that double-quoting is unnecessary unless the string
836 contains an apostrophe, a comma, or backslash (other than
837 backslash-backslash). YYSTR is taken from yytname. If YYRES is
838 null, do not copy; instead, return the length of what the result
839 would have been. */
840static YYSIZE_T
841yytnamerr (char *yyres, const char *yystr)
842{
843 if (*yystr == '"')
844 {
845 YYSIZE_T yyn = 0;
846 char const *yyp = yystr;
847
848 for (;;)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700849 switch (*++yyp)
850 {
851 case '\'':
852 case ',':
853 goto do_not_strip_quotes;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000854
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700855 case '\\':
856 if (*++yyp != '\\')
857 goto do_not_strip_quotes;
858 /* Fall through. */
859 default:
860 if (yyres)
861 yyres[yyn] = *yyp;
862 yyn++;
863 break;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000864
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700865 case '"':
866 if (yyres)
867 yyres[yyn] = '\0';
868 return yyn;
869 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000870 do_not_strip_quotes: ;
871 }
872
873 if (! yyres)
874 return yystrlen (yystr);
875
876 return yystpcpy (yyres, yystr) - yyres;
877}
878# endif
879
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200880/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
881 about the unexpected token YYTOKEN for the state stack whose top is
882 YYSSP.
883
884 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
885 not large enough to hold the message. In that case, also set
886 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
887 required number of bytes is too large to store. */
888static int
889yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
890 yytype_int16 *yyssp, int yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000891{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700892 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200893 YYSIZE_T yysize = yysize0;
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200894 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
895 /* Internationalized format string. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700896 const char *yyformat = YY_NULLPTR;
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200897 /* Arguments of yyformat. */
898 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
899 /* Number of reported tokens (one for the "unexpected", one per
900 "expected"). */
901 int yycount = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000902
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200903 /* There are many possibilities here to consider:
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200904 - If this state is a consistent state with a default action, then
905 the only way this function was invoked is if the default action
906 is an error action. In that case, don't check for expected
907 tokens because there are none.
908 - The only way there can be no lookahead present (in yychar) is if
909 this state is a consistent state with a default action. Thus,
910 detecting the absence of a lookahead is sufficient to determine
911 that there is no unexpected or expected token to report. In that
912 case, just report a simple "syntax error".
913 - Don't assume there isn't a lookahead just because this state is a
914 consistent state with a default action. There might have been a
915 previous inconsistent state, consistent state with a non-default
916 action, or user semantic action that manipulated yychar.
917 - Of course, the expected token list depends on states to have
918 correct lookahead information, and it depends on the parser not
919 to perform extra reductions after fetching a lookahead from the
920 scanner and before detecting a syntax error. Thus, state merging
921 (from LALR or IELR) and default reductions corrupt the expected
922 token list. However, the list is correct for canonical LR with
923 one exception: it will still contain any token that will not be
924 accepted due to an error action in a later state.
925 */
926 if (yytoken != YYEMPTY)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000927 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200928 int yyn = yypact[*yyssp];
929 yyarg[yycount++] = yytname[yytoken];
930 if (!yypact_value_is_default (yyn))
931 {
932 /* Start YYX at -YYN if negative to avoid negative indexes in
933 YYCHECK. In other words, skip the first -YYN actions for
934 this state because they are default actions. */
935 int yyxbegin = yyn < 0 ? -yyn : 0;
936 /* Stay within bounds of both yycheck and yytname. */
937 int yychecklim = YYLAST - yyn + 1;
938 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
939 int yyx;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000940
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200941 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
942 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
943 && !yytable_value_is_error (yytable[yyx + yyn]))
944 {
945 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
946 {
947 yycount = 1;
948 yysize = yysize0;
949 break;
950 }
951 yyarg[yycount++] = yytname[yyx];
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700952 {
953 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
954 if (! (yysize <= yysize1
955 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
956 return 2;
957 yysize = yysize1;
958 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200959 }
960 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000961 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200962
963 switch (yycount)
964 {
965# define YYCASE_(N, S) \
966 case N: \
967 yyformat = S; \
968 break
969 YYCASE_(0, YY_("syntax error"));
970 YYCASE_(1, YY_("syntax error, unexpected %s"));
971 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
972 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
973 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
974 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
975# undef YYCASE_
976 }
977
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700978 {
979 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
980 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
981 return 2;
982 yysize = yysize1;
983 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200984
985 if (*yymsg_alloc < yysize)
986 {
987 *yymsg_alloc = 2 * yysize;
988 if (! (yysize <= *yymsg_alloc
989 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
990 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
991 return 1;
992 }
993
994 /* Avoid sprintf, as that infringes on the user's name space.
995 Don't have undefined behavior even if the translation
996 produced a string with the wrong number of "%s"s. */
997 {
998 char *yyp = *yymsg;
999 int yyi = 0;
1000 while ((*yyp = *yyformat) != '\0')
1001 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1002 {
1003 yyp += yytnamerr (yyp, yyarg[yyi++]);
1004 yyformat += 2;
1005 }
1006 else
1007 {
1008 yyp++;
1009 yyformat++;
1010 }
1011 }
1012 return 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001013}
1014#endif /* YYERROR_VERBOSE */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001015
1016/*-----------------------------------------------.
1017| Release the memory associated to this symbol. |
1018`-----------------------------------------------*/
1019
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001020static void
1021yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001022{
1023 YYUSE (yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001024 if (!yymsg)
1025 yymsg = "Deleting";
1026 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1027
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001028 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1029 YYUSE (yytype);
1030 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001031}
1032
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001033
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001034
1035
1036/* The lookahead symbol. */
1037int yychar;
1038
1039/* The semantic value of the lookahead symbol. */
1040YYSTYPE yylval;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001041/* Number of syntax errors so far. */
1042int yynerrs;
1043
1044
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001045/*----------.
1046| yyparse. |
1047`----------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001048
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001049int
1050yyparse (void)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001051{
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001052 int yystate;
1053 /* Number of tokens to shift before error messages enabled. */
1054 int yyerrstatus;
1055
1056 /* The stacks and their tools:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001057 'yyss': related to states.
1058 'yyvs': related to semantic values.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001059
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001060 Refer to the stacks through separate pointers, to allow yyoverflow
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001061 to reallocate them elsewhere. */
1062
1063 /* The state stack. */
1064 yytype_int16 yyssa[YYINITDEPTH];
1065 yytype_int16 *yyss;
1066 yytype_int16 *yyssp;
1067
1068 /* The semantic value stack. */
1069 YYSTYPE yyvsa[YYINITDEPTH];
1070 YYSTYPE *yyvs;
1071 YYSTYPE *yyvsp;
1072
1073 YYSIZE_T yystacksize;
1074
1075 int yyn;
1076 int yyresult;
1077 /* Lookahead token as an internal (translated) token number. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001078 int yytoken = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001079 /* The variables used to return semantic value and location from the
1080 action routines. */
1081 YYSTYPE yyval;
1082
1083#if YYERROR_VERBOSE
1084 /* Buffer for error messages, and its allocated size. */
1085 char yymsgbuf[128];
1086 char *yymsg = yymsgbuf;
1087 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1088#endif
1089
1090#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1091
1092 /* The number of symbols on the RHS of the reduced rule.
1093 Keep to zero when no symbol should be popped. */
1094 int yylen = 0;
1095
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001096 yyssp = yyss = yyssa;
1097 yyvsp = yyvs = yyvsa;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001098 yystacksize = YYINITDEPTH;
1099
1100 YYDPRINTF ((stderr, "Starting parse\n"));
1101
1102 yystate = 0;
1103 yyerrstatus = 0;
1104 yynerrs = 0;
1105 yychar = YYEMPTY; /* Cause a token to be read. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001106 goto yysetstate;
1107
1108/*------------------------------------------------------------.
1109| yynewstate -- Push a new state, which is found in yystate. |
1110`------------------------------------------------------------*/
1111 yynewstate:
1112 /* In all cases, when you get here, the value and location stacks
1113 have just been pushed. So pushing a state here evens the stacks. */
1114 yyssp++;
1115
1116 yysetstate:
1117 *yyssp = yystate;
1118
1119 if (yyss + yystacksize - 1 <= yyssp)
1120 {
1121 /* Get the current used size of the three stacks, in elements. */
1122 YYSIZE_T yysize = yyssp - yyss + 1;
1123
1124#ifdef yyoverflow
1125 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001126 /* Give user a chance to reallocate the stack. Use copies of
1127 these so that the &'s don't force the real ones into
1128 memory. */
1129 YYSTYPE *yyvs1 = yyvs;
1130 yytype_int16 *yyss1 = yyss;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001131
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001132 /* Each stack pointer address is followed by the size of the
1133 data in use in that stack, in bytes. This used to be a
1134 conditional around just the two extra args, but that might
1135 be undefined if yyoverflow is a macro. */
1136 yyoverflow (YY_("memory exhausted"),
1137 &yyss1, yysize * sizeof (*yyssp),
1138 &yyvs1, yysize * sizeof (*yyvsp),
1139 &yystacksize);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001140
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001141 yyss = yyss1;
1142 yyvs = yyvs1;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001143 }
1144#else /* no yyoverflow */
1145# ifndef YYSTACK_RELOCATE
1146 goto yyexhaustedlab;
1147# else
1148 /* Extend the stack our own way. */
1149 if (YYMAXDEPTH <= yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001150 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001151 yystacksize *= 2;
1152 if (YYMAXDEPTH < yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001153 yystacksize = YYMAXDEPTH;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001154
1155 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001156 yytype_int16 *yyss1 = yyss;
1157 union yyalloc *yyptr =
1158 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1159 if (! yyptr)
1160 goto yyexhaustedlab;
1161 YYSTACK_RELOCATE (yyss_alloc, yyss);
1162 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001163# undef YYSTACK_RELOCATE
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001164 if (yyss1 != yyssa)
1165 YYSTACK_FREE (yyss1);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001166 }
1167# endif
1168#endif /* no yyoverflow */
1169
1170 yyssp = yyss + yysize - 1;
1171 yyvsp = yyvs + yysize - 1;
1172
1173 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001174 (unsigned long int) yystacksize));
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001175
1176 if (yyss + yystacksize - 1 <= yyssp)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001177 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001178 }
1179
1180 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1181
1182 if (yystate == YYFINAL)
1183 YYACCEPT;
1184
1185 goto yybackup;
1186
1187/*-----------.
1188| yybackup. |
1189`-----------*/
1190yybackup:
1191
1192 /* Do appropriate processing given the current state. Read a
1193 lookahead token if we need one and don't already have one. */
1194
1195 /* First try to decide what to do without reference to lookahead token. */
1196 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001197 if (yypact_value_is_default (yyn))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001198 goto yydefault;
1199
1200 /* Not known => get a lookahead token if don't already have one. */
1201
1202 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1203 if (yychar == YYEMPTY)
1204 {
1205 YYDPRINTF ((stderr, "Reading a token: "));
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001206 yychar = yylex ();
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001207 }
1208
1209 if (yychar <= YYEOF)
1210 {
1211 yychar = yytoken = YYEOF;
1212 YYDPRINTF ((stderr, "Now at end of input.\n"));
1213 }
1214 else
1215 {
1216 yytoken = YYTRANSLATE (yychar);
1217 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1218 }
1219
1220 /* If the proper action on seeing token YYTOKEN is to reduce or to
1221 detect an error, take that action. */
1222 yyn += yytoken;
1223 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1224 goto yydefault;
1225 yyn = yytable[yyn];
1226 if (yyn <= 0)
1227 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001228 if (yytable_value_is_error (yyn))
1229 goto yyerrlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001230 yyn = -yyn;
1231 goto yyreduce;
1232 }
1233
1234 /* Count tokens shifted since error; after three, turn off error
1235 status. */
1236 if (yyerrstatus)
1237 yyerrstatus--;
1238
1239 /* Shift the lookahead token. */
1240 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1241
1242 /* Discard the shifted token. */
1243 yychar = YYEMPTY;
1244
1245 yystate = yyn;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001246 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001247 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001248 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001249
1250 goto yynewstate;
1251
1252
1253/*-----------------------------------------------------------.
1254| yydefault -- do the default action for the current state. |
1255`-----------------------------------------------------------*/
1256yydefault:
1257 yyn = yydefact[yystate];
1258 if (yyn == 0)
1259 goto yyerrlab;
1260 goto yyreduce;
1261
1262
1263/*-----------------------------.
1264| yyreduce -- Do a reduction. |
1265`-----------------------------*/
1266yyreduce:
1267 /* yyn is the number of a rule to reduce with. */
1268 yylen = yyr2[yyn];
1269
1270 /* If YYLEN is nonzero, implement the default value of the action:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001271 '$$ = $1'.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001272
1273 Otherwise, the following line sets YYVAL to garbage.
1274 This behavior is undocumented and Bison
1275 users should not rely upon it. Assigning to YYVAL
1276 unconditionally makes the parser a bit smaller, and it avoids a
1277 GCC warning that YYVAL may be used uninitialized. */
1278 yyval = yyvsp[1-yylen];
1279
1280
1281 YY_REDUCE_PRINT (yyn);
1282 switch (yyn)
1283 {
1284 case 2:
1285
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001286 { cur_parent = cur_bus = head; }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001287
Patrick Georgi68befd52010-05-05 12:05:25 +00001288 break;
1289
1290 case 3:
1291
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001292 { postprocess_devtree(); }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001293
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001294 break;
1295
Sven Schnelle270a9082011-03-01 19:58:15 +00001296 case 14:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001297
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001298 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001299 (yyval.device) = new_chip(cur_parent, cur_bus, (yyvsp[0].string));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001300 cur_parent = (yyval.device);
1301}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001302
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001303 break;
1304
Sven Schnelle270a9082011-03-01 19:58:15 +00001305 case 15:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001306
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001307 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001308 cur_parent = (yyvsp[-2].device)->parent;
1309 fold_in((yyvsp[-2].device));
1310 add_header((yyvsp[-2].device));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001311}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001312
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001313 break;
1314
Sven Schnelle270a9082011-03-01 19:58:15 +00001315 case 16:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001316
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001317 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001318 (yyval.device) = new_device(cur_parent, cur_bus, (yyvsp[-2].number), (yyvsp[-1].string), (yyvsp[0].number));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001319 cur_parent = (yyval.device);
1320 cur_bus = (yyval.device);
1321}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001322
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001323 break;
1324
1325 case 17:
1326
1327 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001328 cur_parent = (yyvsp[-2].device)->parent;
1329 cur_bus = (yyvsp[-2].device)->bus;
1330 fold_in((yyvsp[-2].device));
1331 alias_siblings((yyvsp[-2].device)->children);
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001332}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001333
Patrick Georgi68befd52010-05-05 12:05:25 +00001334 break;
1335
Sven Schnelle270a9082011-03-01 19:58:15 +00001336 case 18:
Patrick Georgi68befd52010-05-05 12:05:25 +00001337
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001338 { add_resource(cur_parent, (yyvsp[-3].number), strtol((yyvsp[-2].string), NULL, 0), strtol((yyvsp[0].string), NULL, 0)); }
1339
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001340 break;
1341
Sven Schnelle270a9082011-03-01 19:58:15 +00001342 case 19:
1343
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001344 { add_register(cur_parent, (yyvsp[-2].string), (yyvsp[0].string)); }
1345
Sven Schnelle270a9082011-03-01 19:58:15 +00001346 break;
1347
1348 case 20:
1349
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001350 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-1].string), NULL, 16), strtol((yyvsp[0].string), NULL, 16), 0); }
1351
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001352 break;
1353
1354 case 21:
1355
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001356 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-2].string), NULL, 16), strtol((yyvsp[-1].string), NULL, 16), 1); }
1357
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001358 break;
1359
1360 case 22:
1361
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001362 { add_ioapic_info(cur_parent, strtol((yyvsp[-2].string), NULL, 16), (yyvsp[-1].string), strtol((yyvsp[0].string), NULL, 16)); }
1363
Sven Schnelle270a9082011-03-01 19:58:15 +00001364 break;
1365
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001366
1367
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001368 default: break;
1369 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001370 /* User semantic actions sometimes alter yychar, and that requires
1371 that yytoken be updated with the new translation. We take the
1372 approach of translating immediately before every use of yytoken.
1373 One alternative is translating here after every semantic action,
1374 but that translation would be missed if the semantic action invokes
1375 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1376 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1377 incorrect destructor might then be invoked immediately. In the
1378 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1379 to an incorrect destructor call or verbose syntax error message
1380 before the lookahead is translated. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001381 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1382
1383 YYPOPSTACK (yylen);
1384 yylen = 0;
1385 YY_STACK_PRINT (yyss, yyssp);
1386
1387 *++yyvsp = yyval;
1388
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001389 /* Now 'shift' the result of the reduction. Determine what state
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001390 that goes to, based on the state we popped back to and the rule
1391 number reduced by. */
1392
1393 yyn = yyr1[yyn];
1394
1395 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1396 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1397 yystate = yytable[yystate];
1398 else
1399 yystate = yydefgoto[yyn - YYNTOKENS];
1400
1401 goto yynewstate;
1402
1403
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001404/*--------------------------------------.
1405| yyerrlab -- here on detecting error. |
1406`--------------------------------------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001407yyerrlab:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001408 /* Make sure we have latest lookahead translation. See comments at
1409 user semantic actions for why this is necessary. */
1410 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1411
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001412 /* If not already recovering from an error, report this error. */
1413 if (!yyerrstatus)
1414 {
1415 ++yynerrs;
1416#if ! YYERROR_VERBOSE
1417 yyerror (YY_("syntax error"));
1418#else
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001419# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1420 yyssp, yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001421 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001422 char const *yymsgp = YY_("syntax error");
1423 int yysyntax_error_status;
1424 yysyntax_error_status = YYSYNTAX_ERROR;
1425 if (yysyntax_error_status == 0)
1426 yymsgp = yymsg;
1427 else if (yysyntax_error_status == 1)
1428 {
1429 if (yymsg != yymsgbuf)
1430 YYSTACK_FREE (yymsg);
1431 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1432 if (!yymsg)
1433 {
1434 yymsg = yymsgbuf;
1435 yymsg_alloc = sizeof yymsgbuf;
1436 yysyntax_error_status = 2;
1437 }
1438 else
1439 {
1440 yysyntax_error_status = YYSYNTAX_ERROR;
1441 yymsgp = yymsg;
1442 }
1443 }
1444 yyerror (yymsgp);
1445 if (yysyntax_error_status == 2)
1446 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001447 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001448# undef YYSYNTAX_ERROR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001449#endif
1450 }
1451
1452
1453
1454 if (yyerrstatus == 3)
1455 {
1456 /* If just tried and failed to reuse lookahead token after an
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001457 error, discard it. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001458
1459 if (yychar <= YYEOF)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001460 {
1461 /* Return failure if at end of input. */
1462 if (yychar == YYEOF)
1463 YYABORT;
1464 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001465 else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001466 {
1467 yydestruct ("Error: discarding",
1468 yytoken, &yylval);
1469 yychar = YYEMPTY;
1470 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001471 }
1472
1473 /* Else will try to reuse lookahead token after shifting the error
1474 token. */
1475 goto yyerrlab1;
1476
1477
1478/*---------------------------------------------------.
1479| yyerrorlab -- error raised explicitly by YYERROR. |
1480`---------------------------------------------------*/
1481yyerrorlab:
1482
1483 /* Pacify compilers like GCC when the user code never invokes
1484 YYERROR and the label yyerrorlab therefore never appears in user
1485 code. */
1486 if (/*CONSTCOND*/ 0)
1487 goto yyerrorlab;
1488
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001489 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001490 this YYERROR. */
1491 YYPOPSTACK (yylen);
1492 yylen = 0;
1493 YY_STACK_PRINT (yyss, yyssp);
1494 yystate = *yyssp;
1495 goto yyerrlab1;
1496
1497
1498/*-------------------------------------------------------------.
1499| yyerrlab1 -- common code for both syntax error and YYERROR. |
1500`-------------------------------------------------------------*/
1501yyerrlab1:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001502 yyerrstatus = 3; /* Each real token shifted decrements this. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001503
1504 for (;;)
1505 {
1506 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001507 if (!yypact_value_is_default (yyn))
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001508 {
1509 yyn += YYTERROR;
1510 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1511 {
1512 yyn = yytable[yyn];
1513 if (0 < yyn)
1514 break;
1515 }
1516 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001517
1518 /* Pop the current state because it cannot handle the error token. */
1519 if (yyssp == yyss)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001520 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001521
1522
1523 yydestruct ("Error: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001524 yystos[yystate], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001525 YYPOPSTACK (1);
1526 yystate = *yyssp;
1527 YY_STACK_PRINT (yyss, yyssp);
1528 }
1529
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001530 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001531 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001532 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001533
1534
1535 /* Shift the error token. */
1536 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1537
1538 yystate = yyn;
1539 goto yynewstate;
1540
1541
1542/*-------------------------------------.
1543| yyacceptlab -- YYACCEPT comes here. |
1544`-------------------------------------*/
1545yyacceptlab:
1546 yyresult = 0;
1547 goto yyreturn;
1548
1549/*-----------------------------------.
1550| yyabortlab -- YYABORT comes here. |
1551`-----------------------------------*/
1552yyabortlab:
1553 yyresult = 1;
1554 goto yyreturn;
1555
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001556#if !defined yyoverflow || YYERROR_VERBOSE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001557/*-------------------------------------------------.
1558| yyexhaustedlab -- memory exhaustion comes here. |
1559`-------------------------------------------------*/
1560yyexhaustedlab:
1561 yyerror (YY_("memory exhausted"));
1562 yyresult = 2;
1563 /* Fall through. */
1564#endif
1565
1566yyreturn:
1567 if (yychar != YYEMPTY)
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001568 {
1569 /* Make sure we have latest lookahead translation. See comments at
1570 user semantic actions for why this is necessary. */
1571 yytoken = YYTRANSLATE (yychar);
1572 yydestruct ("Cleanup: discarding lookahead",
1573 yytoken, &yylval);
1574 }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001575 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001576 this YYABORT or YYACCEPT. */
1577 YYPOPSTACK (yylen);
1578 YY_STACK_PRINT (yyss, yyssp);
1579 while (yyssp != yyss)
1580 {
1581 yydestruct ("Cleanup: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001582 yystos[*yyssp], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001583 YYPOPSTACK (1);
1584 }
1585#ifndef yyoverflow
1586 if (yyss != yyssa)
1587 YYSTACK_FREE (yyss);
1588#endif
1589#if YYERROR_VERBOSE
1590 if (yymsg != yymsgbuf)
1591 YYSTACK_FREE (yymsg);
1592#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001593 return yyresult;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001594}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001595
1596