blob: cef198e78659896993b00fd0d786f4253325e773 [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,
151 PCIINT = 283
152 };
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000153#endif
154
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700155/* Value type. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000156#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700157
158union YYSTYPE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000159{
160
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000161
162 struct device *device;
163 char *string;
164 int number;
165
166
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700167};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000168
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700169typedef union YYSTYPE YYSTYPE;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000170# define YYSTYPE_IS_TRIVIAL 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000171# define YYSTYPE_IS_DECLARED 1
172#endif
173
174
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700175extern YYSTYPE yylval;
176
177int yyparse (void);
178
179#endif /* !YY_YY_SCONFIG_TAB_H_SHIPPED_INCLUDED */
180
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000181/* Copy the second part of user declarations. */
182
183
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000184
185#ifdef short
186# undef short
187#endif
188
189#ifdef YYTYPE_UINT8
190typedef YYTYPE_UINT8 yytype_uint8;
191#else
192typedef unsigned char yytype_uint8;
193#endif
194
195#ifdef YYTYPE_INT8
196typedef YYTYPE_INT8 yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000197#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700198typedef signed char yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000199#endif
200
201#ifdef YYTYPE_UINT16
202typedef YYTYPE_UINT16 yytype_uint16;
203#else
204typedef unsigned short int yytype_uint16;
205#endif
206
207#ifdef YYTYPE_INT16
208typedef YYTYPE_INT16 yytype_int16;
209#else
210typedef short int yytype_int16;
211#endif
212
213#ifndef YYSIZE_T
214# ifdef __SIZE_TYPE__
215# define YYSIZE_T __SIZE_TYPE__
216# elif defined size_t
217# define YYSIZE_T size_t
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700218# elif ! defined YYSIZE_T
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000219# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
220# define YYSIZE_T size_t
221# else
222# define YYSIZE_T unsigned int
223# endif
224#endif
225
226#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
227
228#ifndef YY_
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200229# if defined YYENABLE_NLS && YYENABLE_NLS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000230# if ENABLE_NLS
231# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700232# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000233# endif
234# endif
235# ifndef YY_
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700236# define YY_(Msgid) Msgid
237# endif
238#endif
239
240#ifndef YY_ATTRIBUTE
241# if (defined __GNUC__ \
242 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
243 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
244# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
245# else
246# define YY_ATTRIBUTE(Spec) /* empty */
247# endif
248#endif
249
250#ifndef YY_ATTRIBUTE_PURE
251# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
252#endif
253
254#ifndef YY_ATTRIBUTE_UNUSED
255# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
256#endif
257
258#if !defined _Noreturn \
259 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
260# if defined _MSC_VER && 1200 <= _MSC_VER
261# define _Noreturn __declspec (noreturn)
262# else
263# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000264# endif
265#endif
266
267/* Suppress unused-variable warnings by "using" E. */
268#if ! defined lint || defined __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700269# define YYUSE(E) ((void) (E))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000270#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700271# define YYUSE(E) /* empty */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000272#endif
273
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700274#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
275/* Suppress an incorrect diagnostic about yylval being uninitialized. */
276# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
277 _Pragma ("GCC diagnostic push") \
278 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
279 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
280# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
281 _Pragma ("GCC diagnostic pop")
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000282#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700283# define YY_INITIAL_VALUE(Value) Value
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000284#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700285#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
286# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
287# define YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000288#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700289#ifndef YY_INITIAL_VALUE
290# define YY_INITIAL_VALUE(Value) /* Nothing. */
291#endif
292
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000293
294#if ! defined yyoverflow || YYERROR_VERBOSE
295
296/* The parser invokes alloca or malloc; define the necessary symbols. */
297
298# ifdef YYSTACK_USE_ALLOCA
299# if YYSTACK_USE_ALLOCA
300# ifdef __GNUC__
301# define YYSTACK_ALLOC __builtin_alloca
302# elif defined __BUILTIN_VA_ARG_INCR
303# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
304# elif defined _AIX
305# define YYSTACK_ALLOC __alloca
306# elif defined _MSC_VER
307# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
308# define alloca _alloca
309# else
310# define YYSTACK_ALLOC alloca
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700311# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000312# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700313 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200314# ifndef EXIT_SUCCESS
315# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000316# endif
317# endif
318# endif
319# endif
320# endif
321
322# ifdef YYSTACK_ALLOC
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700323 /* Pacify GCC's 'empty if-body' warning. */
324# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000325# ifndef YYSTACK_ALLOC_MAXIMUM
326 /* The OS might guarantee only one guard page at the bottom of the stack,
327 and a page size can be as small as 4096 bytes. So we cannot safely
328 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
329 to allow for a few compiler-allocated temporary stack slots. */
330# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
331# endif
332# else
333# define YYSTACK_ALLOC YYMALLOC
334# define YYSTACK_FREE YYFREE
335# ifndef YYSTACK_ALLOC_MAXIMUM
336# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
337# endif
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200338# if (defined __cplusplus && ! defined EXIT_SUCCESS \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000339 && ! ((defined YYMALLOC || defined malloc) \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700340 && (defined YYFREE || defined free)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000341# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200342# ifndef EXIT_SUCCESS
343# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000344# endif
345# endif
346# ifndef YYMALLOC
347# define YYMALLOC malloc
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700348# if ! defined malloc && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000349void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
350# endif
351# endif
352# ifndef YYFREE
353# define YYFREE free
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700354# if ! defined free && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000355void free (void *); /* INFRINGES ON USER NAME SPACE */
356# endif
357# endif
358# endif
359#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
360
361
362#if (! defined yyoverflow \
363 && (! defined __cplusplus \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700364 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000365
366/* A type that is properly aligned for any stack member. */
367union yyalloc
368{
369 yytype_int16 yyss_alloc;
370 YYSTYPE yyvs_alloc;
371};
372
373/* The size of the maximum gap between one aligned stack and the next. */
374# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
375
376/* The size of an array large to enough to hold all stacks, each with
377 N elements. */
378# define YYSTACK_BYTES(N) \
379 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
380 + YYSTACK_GAP_MAXIMUM)
381
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200382# define YYCOPY_NEEDED 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000383
384/* Relocate STACK from its old location to the new one. The
385 local variables YYSIZE and YYSTACKSIZE give the old and new number of
386 elements in the stack, and YYPTR gives the new location of the
387 stack. Advance YYPTR to a properly aligned location for the next
388 stack. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700389# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
390 do \
391 { \
392 YYSIZE_T yynewbytes; \
393 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
394 Stack = &yyptr->Stack_alloc; \
395 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
396 yyptr += yynewbytes / sizeof (*yyptr); \
397 } \
398 while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000399
400#endif
401
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200402#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700403/* Copy COUNT objects from SRC to DST. The source and destination do
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200404 not overlap. */
405# ifndef YYCOPY
406# if defined __GNUC__ && 1 < __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700407# define YYCOPY(Dst, Src, Count) \
408 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200409# else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700410# define YYCOPY(Dst, Src, Count) \
411 do \
412 { \
413 YYSIZE_T yyi; \
414 for (yyi = 0; yyi < (Count); yyi++) \
415 (Dst)[yyi] = (Src)[yyi]; \
416 } \
417 while (0)
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200418# endif
419# endif
420#endif /* !YYCOPY_NEEDED */
421
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000422/* YYFINAL -- State number of the termination state. */
Patrick Georgi68befd52010-05-05 12:05:25 +0000423#define YYFINAL 3
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000424/* YYLAST -- Last index in YYTABLE. */
Aaron Durbinffda804b2014-09-03 12:40:15 -0500425#define YYLAST 39
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000426
427/* YYNTOKENS -- Number of terminals. */
Aaron Durbinffda804b2014-09-03 12:40:15 -0500428#define YYNTOKENS 29
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000429/* YYNNTS -- Number of nonterminals. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200430#define YYNNTS 13
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000431/* YYNRULES -- Number of rules. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200432#define YYNRULES 22
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700433/* YYNSTATES -- Number of states. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200434#define YYNSTATES 41
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000435
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700436/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
437 by yylex, with out-of-bounds checking. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000438#define YYUNDEFTOK 2
Aaron Durbinffda804b2014-09-03 12:40:15 -0500439#define YYMAXUTOK 283
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000440
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700441#define YYTRANSLATE(YYX) \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000442 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
443
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700444/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
445 as returned by yylex, without out-of-bounds checking. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000446static const yytype_uint8 yytranslate[] =
447{
448 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 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, 1, 2, 3, 4,
474 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200475 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500476 25, 26, 27, 28
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000477};
478
479#if YYDEBUG
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700480 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
Patrick Georgi114e7b22010-05-05 11:19:50 +0000481static const yytype_uint8 yyrline[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000482{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700483 0, 34, 34, 34, 36, 36, 36, 36, 38, 38,
484 38, 38, 38, 38, 40, 40, 50, 50, 62, 65,
485 68, 71, 74
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000486};
487#endif
488
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700489#if YYDEBUG || YYERROR_VERBOSE || 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000490/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
491 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
492static const char *const yytname[] =
493{
494 "$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
495 "BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI", "PNP", "I2C",
Aaron Durbinffda804b2014-09-03 12:40:15 -0500496 "APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ", "IO", "NUMBER",
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200497 "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IOAPIC", "PCIINT", "$accept",
498 "devtree", "$@1", "chipchildren", "devicechildren", "chip", "@2",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700499 "device", "@3", "resource", "registers", "subsystemid", "ioapic_irq", YY_NULLPTR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000500};
501#endif
502
503# ifdef YYPRINT
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700504/* YYTOKNUM[NUM] -- (External) token number corresponding to the
505 (internal) symbol number NUM (which must be that of a token). */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000506static const yytype_uint16 yytoknum[] =
507{
508 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
509 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500510 275, 276, 277, 278, 279, 280, 281, 282, 283
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000511};
512# endif
513
Aaron Durbinffda804b2014-09-03 12:40:15 -0500514#define YYPACT_NINF -10
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700515
516#define yypact_value_is_default(Yystate) \
517 (!!((Yystate) == (-10)))
518
519#define YYTABLE_NINF -1
520
521#define yytable_value_is_error(Yytable_value) \
522 0
523
524 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
525 STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000526static const yytype_int8 yypact[] =
527{
Aaron Durbinffda804b2014-09-03 12:40:15 -0500528 -10, 3, 1, -10, -2, -10, -10, -10, 4, 5,
529 -1, -10, -10, -10, -10, -9, 7, 9, 6, -10,
530 -10, -10, -3, -4, -10, 2, 8, -10, -10, -10,
531 -10, -10, 10, 11, 0, 12, 13, 14, -10, -10,
532 -10
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000533};
534
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700535 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
536 Performed when YYTABLE does not specify something else to do. Zero
537 means the default is an error. */
538static const yytype_uint8 yydefact[] =
539{
540 2, 0, 0, 1, 0, 3, 14, 7, 0, 0,
541 0, 15, 5, 4, 6, 0, 0, 0, 0, 16,
542 19, 13, 0, 0, 17, 0, 0, 9, 8, 10,
543 11, 12, 0, 0, 0, 0, 20, 0, 18, 21,
544 22
545};
546
547 /* YYPGOTO[NTERM-NUM]. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000548static const yytype_int8 yypgoto[] =
549{
Aaron Durbinffda804b2014-09-03 12:40:15 -0500550 -10, -10, -10, -10, -10, -6, -10, 17, -10, -10,
551 -10, -10, -10
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000552};
553
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700554 /* YYDEFGOTO[NTERM-NUM]. */
555static const yytype_int8 yydefgoto[] =
556{
557 -1, 1, 2, 8, 22, 5, 7, 13, 21, 29,
558 14, 30, 31
559};
560
561 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
562 positive, shift that token. If negative, reduce the rule whose
563 number is the opposite. If YYTABLE_NINF, syntax error. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000564static const yytype_uint8 yytable[] =
565{
Sven Schnelle270a9082011-03-01 19:58:15 +0000566 4, 9, 12, 3, 4, 23, 24, 4, 9, 10,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500567 6, 16, 15, 11, 17, 19, 27, 18, 20, 32,
568 35, 25, 0, 26, 0, 33, 0, 0, 37, 0,
569 0, 34, 0, 0, 36, 38, 0, 40, 39, 28
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000570};
571
Patrick Georgi8f625f62010-05-05 13:13:47 +0000572static const yytype_int8 yycheck[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000573{
Sven Schnelle270a9082011-03-01 19:58:15 +0000574 3, 4, 8, 0, 3, 8, 9, 3, 4, 5,
Aaron Durbinffda804b2014-09-03 12:40:15 -0500575 12, 12, 7, 9, 23, 6, 22, 10, 12, 23,
576 10, 24, -1, 26, -1, 23, -1, -1, 28, -1,
577 -1, 23, -1, -1, 23, 23, -1, 23, 25, 22
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000578};
579
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700580 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
581 symbol of state STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000582static const yytype_uint8 yystos[] =
583{
Aaron Durbinffda804b2014-09-03 12:40:15 -0500584 0, 30, 31, 0, 3, 34, 12, 35, 32, 4,
585 5, 9, 34, 36, 39, 7, 12, 23, 10, 6,
586 12, 37, 33, 8, 9, 24, 26, 34, 36, 38,
587 40, 41, 23, 23, 23, 10, 23, 28, 23, 25,
588 23
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000589};
590
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700591 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
592static const yytype_uint8 yyr1[] =
593{
594 0, 29, 31, 30, 32, 32, 32, 32, 33, 33,
595 33, 33, 33, 33, 35, 34, 37, 36, 38, 39,
596 40, 40, 41
597};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000598
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700599 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
600static const yytype_uint8 yyr2[] =
601{
602 0, 2, 0, 2, 2, 2, 2, 0, 2, 2,
603 2, 2, 2, 0, 0, 5, 0, 7, 4, 4,
604 3, 4, 4
605};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000606
607
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700608#define yyerrok (yyerrstatus = 0)
609#define yyclearin (yychar = YYEMPTY)
610#define YYEMPTY (-2)
611#define YYEOF 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000612
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700613#define YYACCEPT goto yyacceptlab
614#define YYABORT goto yyabortlab
615#define YYERROR goto yyerrorlab
616
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000617
618#define YYRECOVERING() (!!yyerrstatus)
619
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700620#define YYBACKUP(Token, Value) \
621do \
622 if (yychar == YYEMPTY) \
623 { \
624 yychar = (Token); \
625 yylval = (Value); \
626 YYPOPSTACK (yylen); \
627 yystate = *yyssp; \
628 goto yybackup; \
629 } \
630 else \
631 { \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000632 yyerror (YY_("syntax error: cannot back up")); \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700633 YYERROR; \
634 } \
635while (0)
636
637/* Error token number */
638#define YYTERROR 1
639#define YYERRCODE 256
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000640
641
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000642
643/* Enable debugging if requested. */
644#if YYDEBUG
645
646# ifndef YYFPRINTF
647# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
648# define YYFPRINTF fprintf
649# endif
650
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700651# define YYDPRINTF(Args) \
652do { \
653 if (yydebug) \
654 YYFPRINTF Args; \
655} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000656
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700657/* This macro is provided for backward compatibility. */
658#ifndef YY_LOCATION_PRINT
659# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
660#endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000661
662
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700663# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
664do { \
665 if (yydebug) \
666 { \
667 YYFPRINTF (stderr, "%s ", Title); \
668 yy_symbol_print (stderr, \
669 Type, Value); \
670 YYFPRINTF (stderr, "\n"); \
671 } \
672} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000673
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700674
675/*----------------------------------------.
676| Print this symbol's value on YYOUTPUT. |
677`----------------------------------------*/
678
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000679static void
680yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000681{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700682 FILE *yyo = yyoutput;
683 YYUSE (yyo);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000684 if (!yyvaluep)
685 return;
686# ifdef YYPRINT
687 if (yytype < YYNTOKENS)
688 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000689# endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700690 YYUSE (yytype);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000691}
692
693
694/*--------------------------------.
695| Print this symbol on YYOUTPUT. |
696`--------------------------------*/
697
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000698static void
699yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000700{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700701 YYFPRINTF (yyoutput, "%s %s (",
702 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000703
704 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
705 YYFPRINTF (yyoutput, ")");
706}
707
708/*------------------------------------------------------------------.
709| yy_stack_print -- Print the state stack from its BOTTOM up to its |
710| TOP (included). |
711`------------------------------------------------------------------*/
712
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000713static void
714yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000715{
716 YYFPRINTF (stderr, "Stack now");
717 for (; yybottom <= yytop; yybottom++)
718 {
719 int yybot = *yybottom;
720 YYFPRINTF (stderr, " %d", yybot);
721 }
722 YYFPRINTF (stderr, "\n");
723}
724
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700725# define YY_STACK_PRINT(Bottom, Top) \
726do { \
727 if (yydebug) \
728 yy_stack_print ((Bottom), (Top)); \
729} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000730
731
732/*------------------------------------------------.
733| Report that the YYRULE is going to be reduced. |
734`------------------------------------------------*/
735
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000736static void
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700737yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000738{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700739 unsigned long int yylno = yyrline[yyrule];
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000740 int yynrhs = yyr2[yyrule];
741 int yyi;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000742 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700743 yyrule - 1, yylno);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000744 /* The symbols being reduced. */
745 for (yyi = 0; yyi < yynrhs; yyi++)
746 {
747 YYFPRINTF (stderr, " $%d = ", yyi + 1);
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700748 yy_symbol_print (stderr,
749 yystos[yyssp[yyi + 1 - yynrhs]],
750 &(yyvsp[(yyi + 1) - (yynrhs)])
751 );
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000752 YYFPRINTF (stderr, "\n");
753 }
754}
755
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700756# define YY_REDUCE_PRINT(Rule) \
757do { \
758 if (yydebug) \
759 yy_reduce_print (yyssp, yyvsp, Rule); \
760} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000761
762/* Nonzero means print parse trace. It is left uninitialized so that
763 multiple parsers can coexist. */
764int yydebug;
765#else /* !YYDEBUG */
766# define YYDPRINTF(Args)
767# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
768# define YY_STACK_PRINT(Bottom, Top)
769# define YY_REDUCE_PRINT(Rule)
770#endif /* !YYDEBUG */
771
772
773/* YYINITDEPTH -- initial size of the parser's stacks. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700774#ifndef YYINITDEPTH
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000775# define YYINITDEPTH 200
776#endif
777
778/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
779 if the built-in stack extension method is used).
780
781 Do not make this value too large; the results are undefined if
782 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
783 evaluated with infinite-precision integer arithmetic. */
784
785#ifndef YYMAXDEPTH
786# define YYMAXDEPTH 10000
787#endif
788
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000789
790#if YYERROR_VERBOSE
791
792# ifndef yystrlen
793# if defined __GLIBC__ && defined _STRING_H
794# define yystrlen strlen
795# else
796/* Return the length of YYSTR. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000797static YYSIZE_T
798yystrlen (const char *yystr)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000799{
800 YYSIZE_T yylen;
801 for (yylen = 0; yystr[yylen]; yylen++)
802 continue;
803 return yylen;
804}
805# endif
806# endif
807
808# ifndef yystpcpy
809# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
810# define yystpcpy stpcpy
811# else
812/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
813 YYDEST. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000814static char *
815yystpcpy (char *yydest, const char *yysrc)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000816{
817 char *yyd = yydest;
818 const char *yys = yysrc;
819
820 while ((*yyd++ = *yys++) != '\0')
821 continue;
822
823 return yyd - 1;
824}
825# endif
826# endif
827
828# ifndef yytnamerr
829/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
830 quotes and backslashes, so that it's suitable for yyerror. The
831 heuristic is that double-quoting is unnecessary unless the string
832 contains an apostrophe, a comma, or backslash (other than
833 backslash-backslash). YYSTR is taken from yytname. If YYRES is
834 null, do not copy; instead, return the length of what the result
835 would have been. */
836static YYSIZE_T
837yytnamerr (char *yyres, const char *yystr)
838{
839 if (*yystr == '"')
840 {
841 YYSIZE_T yyn = 0;
842 char const *yyp = yystr;
843
844 for (;;)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700845 switch (*++yyp)
846 {
847 case '\'':
848 case ',':
849 goto do_not_strip_quotes;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000850
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700851 case '\\':
852 if (*++yyp != '\\')
853 goto do_not_strip_quotes;
854 /* Fall through. */
855 default:
856 if (yyres)
857 yyres[yyn] = *yyp;
858 yyn++;
859 break;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000860
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700861 case '"':
862 if (yyres)
863 yyres[yyn] = '\0';
864 return yyn;
865 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000866 do_not_strip_quotes: ;
867 }
868
869 if (! yyres)
870 return yystrlen (yystr);
871
872 return yystpcpy (yyres, yystr) - yyres;
873}
874# endif
875
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200876/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
877 about the unexpected token YYTOKEN for the state stack whose top is
878 YYSSP.
879
880 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
881 not large enough to hold the message. In that case, also set
882 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
883 required number of bytes is too large to store. */
884static int
885yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
886 yytype_int16 *yyssp, int yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000887{
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700888 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200889 YYSIZE_T yysize = yysize0;
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200890 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
891 /* Internationalized format string. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700892 const char *yyformat = YY_NULLPTR;
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200893 /* Arguments of yyformat. */
894 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
895 /* Number of reported tokens (one for the "unexpected", one per
896 "expected"). */
897 int yycount = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000898
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200899 /* There are many possibilities here to consider:
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200900 - If this state is a consistent state with a default action, then
901 the only way this function was invoked is if the default action
902 is an error action. In that case, don't check for expected
903 tokens because there are none.
904 - The only way there can be no lookahead present (in yychar) is if
905 this state is a consistent state with a default action. Thus,
906 detecting the absence of a lookahead is sufficient to determine
907 that there is no unexpected or expected token to report. In that
908 case, just report a simple "syntax error".
909 - Don't assume there isn't a lookahead just because this state is a
910 consistent state with a default action. There might have been a
911 previous inconsistent state, consistent state with a non-default
912 action, or user semantic action that manipulated yychar.
913 - Of course, the expected token list depends on states to have
914 correct lookahead information, and it depends on the parser not
915 to perform extra reductions after fetching a lookahead from the
916 scanner and before detecting a syntax error. Thus, state merging
917 (from LALR or IELR) and default reductions corrupt the expected
918 token list. However, the list is correct for canonical LR with
919 one exception: it will still contain any token that will not be
920 accepted due to an error action in a later state.
921 */
922 if (yytoken != YYEMPTY)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000923 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200924 int yyn = yypact[*yyssp];
925 yyarg[yycount++] = yytname[yytoken];
926 if (!yypact_value_is_default (yyn))
927 {
928 /* Start YYX at -YYN if negative to avoid negative indexes in
929 YYCHECK. In other words, skip the first -YYN actions for
930 this state because they are default actions. */
931 int yyxbegin = yyn < 0 ? -yyn : 0;
932 /* Stay within bounds of both yycheck and yytname. */
933 int yychecklim = YYLAST - yyn + 1;
934 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
935 int yyx;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000936
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200937 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
938 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
939 && !yytable_value_is_error (yytable[yyx + yyn]))
940 {
941 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
942 {
943 yycount = 1;
944 yysize = yysize0;
945 break;
946 }
947 yyarg[yycount++] = yytname[yyx];
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700948 {
949 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
950 if (! (yysize <= yysize1
951 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
952 return 2;
953 yysize = yysize1;
954 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200955 }
956 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000957 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200958
959 switch (yycount)
960 {
961# define YYCASE_(N, S) \
962 case N: \
963 yyformat = S; \
964 break
965 YYCASE_(0, YY_("syntax error"));
966 YYCASE_(1, YY_("syntax error, unexpected %s"));
967 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
968 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
969 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
970 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
971# undef YYCASE_
972 }
973
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700974 {
975 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
976 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
977 return 2;
978 yysize = yysize1;
979 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200980
981 if (*yymsg_alloc < yysize)
982 {
983 *yymsg_alloc = 2 * yysize;
984 if (! (yysize <= *yymsg_alloc
985 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
986 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
987 return 1;
988 }
989
990 /* Avoid sprintf, as that infringes on the user's name space.
991 Don't have undefined behavior even if the translation
992 produced a string with the wrong number of "%s"s. */
993 {
994 char *yyp = *yymsg;
995 int yyi = 0;
996 while ((*yyp = *yyformat) != '\0')
997 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
998 {
999 yyp += yytnamerr (yyp, yyarg[yyi++]);
1000 yyformat += 2;
1001 }
1002 else
1003 {
1004 yyp++;
1005 yyformat++;
1006 }
1007 }
1008 return 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001009}
1010#endif /* YYERROR_VERBOSE */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001011
1012/*-----------------------------------------------.
1013| Release the memory associated to this symbol. |
1014`-----------------------------------------------*/
1015
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001016static void
1017yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001018{
1019 YYUSE (yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001020 if (!yymsg)
1021 yymsg = "Deleting";
1022 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1023
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001024 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1025 YYUSE (yytype);
1026 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001027}
1028
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001029
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001030
1031
1032/* The lookahead symbol. */
1033int yychar;
1034
1035/* The semantic value of the lookahead symbol. */
1036YYSTYPE yylval;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001037/* Number of syntax errors so far. */
1038int yynerrs;
1039
1040
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001041/*----------.
1042| yyparse. |
1043`----------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001044
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001045int
1046yyparse (void)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001047{
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001048 int yystate;
1049 /* Number of tokens to shift before error messages enabled. */
1050 int yyerrstatus;
1051
1052 /* The stacks and their tools:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001053 'yyss': related to states.
1054 'yyvs': related to semantic values.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001055
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001056 Refer to the stacks through separate pointers, to allow yyoverflow
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001057 to reallocate them elsewhere. */
1058
1059 /* The state stack. */
1060 yytype_int16 yyssa[YYINITDEPTH];
1061 yytype_int16 *yyss;
1062 yytype_int16 *yyssp;
1063
1064 /* The semantic value stack. */
1065 YYSTYPE yyvsa[YYINITDEPTH];
1066 YYSTYPE *yyvs;
1067 YYSTYPE *yyvsp;
1068
1069 YYSIZE_T yystacksize;
1070
1071 int yyn;
1072 int yyresult;
1073 /* Lookahead token as an internal (translated) token number. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001074 int yytoken = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001075 /* The variables used to return semantic value and location from the
1076 action routines. */
1077 YYSTYPE yyval;
1078
1079#if YYERROR_VERBOSE
1080 /* Buffer for error messages, and its allocated size. */
1081 char yymsgbuf[128];
1082 char *yymsg = yymsgbuf;
1083 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1084#endif
1085
1086#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1087
1088 /* The number of symbols on the RHS of the reduced rule.
1089 Keep to zero when no symbol should be popped. */
1090 int yylen = 0;
1091
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001092 yyssp = yyss = yyssa;
1093 yyvsp = yyvs = yyvsa;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001094 yystacksize = YYINITDEPTH;
1095
1096 YYDPRINTF ((stderr, "Starting parse\n"));
1097
1098 yystate = 0;
1099 yyerrstatus = 0;
1100 yynerrs = 0;
1101 yychar = YYEMPTY; /* Cause a token to be read. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001102 goto yysetstate;
1103
1104/*------------------------------------------------------------.
1105| yynewstate -- Push a new state, which is found in yystate. |
1106`------------------------------------------------------------*/
1107 yynewstate:
1108 /* In all cases, when you get here, the value and location stacks
1109 have just been pushed. So pushing a state here evens the stacks. */
1110 yyssp++;
1111
1112 yysetstate:
1113 *yyssp = yystate;
1114
1115 if (yyss + yystacksize - 1 <= yyssp)
1116 {
1117 /* Get the current used size of the three stacks, in elements. */
1118 YYSIZE_T yysize = yyssp - yyss + 1;
1119
1120#ifdef yyoverflow
1121 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001122 /* Give user a chance to reallocate the stack. Use copies of
1123 these so that the &'s don't force the real ones into
1124 memory. */
1125 YYSTYPE *yyvs1 = yyvs;
1126 yytype_int16 *yyss1 = yyss;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001127
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001128 /* Each stack pointer address is followed by the size of the
1129 data in use in that stack, in bytes. This used to be a
1130 conditional around just the two extra args, but that might
1131 be undefined if yyoverflow is a macro. */
1132 yyoverflow (YY_("memory exhausted"),
1133 &yyss1, yysize * sizeof (*yyssp),
1134 &yyvs1, yysize * sizeof (*yyvsp),
1135 &yystacksize);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001136
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001137 yyss = yyss1;
1138 yyvs = yyvs1;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001139 }
1140#else /* no yyoverflow */
1141# ifndef YYSTACK_RELOCATE
1142 goto yyexhaustedlab;
1143# else
1144 /* Extend the stack our own way. */
1145 if (YYMAXDEPTH <= yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001146 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001147 yystacksize *= 2;
1148 if (YYMAXDEPTH < yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001149 yystacksize = YYMAXDEPTH;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001150
1151 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001152 yytype_int16 *yyss1 = yyss;
1153 union yyalloc *yyptr =
1154 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1155 if (! yyptr)
1156 goto yyexhaustedlab;
1157 YYSTACK_RELOCATE (yyss_alloc, yyss);
1158 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001159# undef YYSTACK_RELOCATE
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001160 if (yyss1 != yyssa)
1161 YYSTACK_FREE (yyss1);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001162 }
1163# endif
1164#endif /* no yyoverflow */
1165
1166 yyssp = yyss + yysize - 1;
1167 yyvsp = yyvs + yysize - 1;
1168
1169 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001170 (unsigned long int) yystacksize));
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001171
1172 if (yyss + yystacksize - 1 <= yyssp)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001173 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001174 }
1175
1176 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1177
1178 if (yystate == YYFINAL)
1179 YYACCEPT;
1180
1181 goto yybackup;
1182
1183/*-----------.
1184| yybackup. |
1185`-----------*/
1186yybackup:
1187
1188 /* Do appropriate processing given the current state. Read a
1189 lookahead token if we need one and don't already have one. */
1190
1191 /* First try to decide what to do without reference to lookahead token. */
1192 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001193 if (yypact_value_is_default (yyn))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001194 goto yydefault;
1195
1196 /* Not known => get a lookahead token if don't already have one. */
1197
1198 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1199 if (yychar == YYEMPTY)
1200 {
1201 YYDPRINTF ((stderr, "Reading a token: "));
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001202 yychar = yylex ();
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001203 }
1204
1205 if (yychar <= YYEOF)
1206 {
1207 yychar = yytoken = YYEOF;
1208 YYDPRINTF ((stderr, "Now at end of input.\n"));
1209 }
1210 else
1211 {
1212 yytoken = YYTRANSLATE (yychar);
1213 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1214 }
1215
1216 /* If the proper action on seeing token YYTOKEN is to reduce or to
1217 detect an error, take that action. */
1218 yyn += yytoken;
1219 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1220 goto yydefault;
1221 yyn = yytable[yyn];
1222 if (yyn <= 0)
1223 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001224 if (yytable_value_is_error (yyn))
1225 goto yyerrlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001226 yyn = -yyn;
1227 goto yyreduce;
1228 }
1229
1230 /* Count tokens shifted since error; after three, turn off error
1231 status. */
1232 if (yyerrstatus)
1233 yyerrstatus--;
1234
1235 /* Shift the lookahead token. */
1236 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1237
1238 /* Discard the shifted token. */
1239 yychar = YYEMPTY;
1240
1241 yystate = yyn;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001242 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001243 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001244 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001245
1246 goto yynewstate;
1247
1248
1249/*-----------------------------------------------------------.
1250| yydefault -- do the default action for the current state. |
1251`-----------------------------------------------------------*/
1252yydefault:
1253 yyn = yydefact[yystate];
1254 if (yyn == 0)
1255 goto yyerrlab;
1256 goto yyreduce;
1257
1258
1259/*-----------------------------.
1260| yyreduce -- Do a reduction. |
1261`-----------------------------*/
1262yyreduce:
1263 /* yyn is the number of a rule to reduce with. */
1264 yylen = yyr2[yyn];
1265
1266 /* If YYLEN is nonzero, implement the default value of the action:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001267 '$$ = $1'.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001268
1269 Otherwise, the following line sets YYVAL to garbage.
1270 This behavior is undocumented and Bison
1271 users should not rely upon it. Assigning to YYVAL
1272 unconditionally makes the parser a bit smaller, and it avoids a
1273 GCC warning that YYVAL may be used uninitialized. */
1274 yyval = yyvsp[1-yylen];
1275
1276
1277 YY_REDUCE_PRINT (yyn);
1278 switch (yyn)
1279 {
1280 case 2:
1281
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001282 { cur_parent = cur_bus = head; }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001283
Patrick Georgi68befd52010-05-05 12:05:25 +00001284 break;
1285
1286 case 3:
1287
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001288 { postprocess_devtree(); }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001289
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001290 break;
1291
Sven Schnelle270a9082011-03-01 19:58:15 +00001292 case 14:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001293
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001294 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001295 (yyval.device) = new_chip(cur_parent, cur_bus, (yyvsp[0].string));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001296 cur_parent = (yyval.device);
1297}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001298
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001299 break;
1300
Sven Schnelle270a9082011-03-01 19:58:15 +00001301 case 15:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001302
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001303 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001304 cur_parent = (yyvsp[-2].device)->parent;
1305 fold_in((yyvsp[-2].device));
1306 add_header((yyvsp[-2].device));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001307}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001308
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001309 break;
1310
Sven Schnelle270a9082011-03-01 19:58:15 +00001311 case 16:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001312
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001313 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001314 (yyval.device) = new_device(cur_parent, cur_bus, (yyvsp[-2].number), (yyvsp[-1].string), (yyvsp[0].number));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001315 cur_parent = (yyval.device);
1316 cur_bus = (yyval.device);
1317}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001318
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001319 break;
1320
1321 case 17:
1322
1323 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001324 cur_parent = (yyvsp[-2].device)->parent;
1325 cur_bus = (yyvsp[-2].device)->bus;
1326 fold_in((yyvsp[-2].device));
1327 alias_siblings((yyvsp[-2].device)->children);
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001328}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001329
Patrick Georgi68befd52010-05-05 12:05:25 +00001330 break;
1331
Sven Schnelle270a9082011-03-01 19:58:15 +00001332 case 18:
Patrick Georgi68befd52010-05-05 12:05:25 +00001333
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001334 { add_resource(cur_parent, (yyvsp[-3].number), strtol((yyvsp[-2].string), NULL, 0), strtol((yyvsp[0].string), NULL, 0)); }
1335
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001336 break;
1337
Sven Schnelle270a9082011-03-01 19:58:15 +00001338 case 19:
1339
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001340 { add_register(cur_parent, (yyvsp[-2].string), (yyvsp[0].string)); }
1341
Sven Schnelle270a9082011-03-01 19:58:15 +00001342 break;
1343
1344 case 20:
1345
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001346 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-1].string), NULL, 16), strtol((yyvsp[0].string), NULL, 16), 0); }
1347
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001348 break;
1349
1350 case 21:
1351
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001352 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-2].string), NULL, 16), strtol((yyvsp[-1].string), NULL, 16), 1); }
1353
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001354 break;
1355
1356 case 22:
1357
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001358 { add_ioapic_info(cur_parent, strtol((yyvsp[-2].string), NULL, 16), (yyvsp[-1].string), strtol((yyvsp[0].string), NULL, 16)); }
1359
Sven Schnelle270a9082011-03-01 19:58:15 +00001360 break;
1361
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001362
1363
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001364 default: break;
1365 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001366 /* User semantic actions sometimes alter yychar, and that requires
1367 that yytoken be updated with the new translation. We take the
1368 approach of translating immediately before every use of yytoken.
1369 One alternative is translating here after every semantic action,
1370 but that translation would be missed if the semantic action invokes
1371 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1372 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1373 incorrect destructor might then be invoked immediately. In the
1374 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1375 to an incorrect destructor call or verbose syntax error message
1376 before the lookahead is translated. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001377 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1378
1379 YYPOPSTACK (yylen);
1380 yylen = 0;
1381 YY_STACK_PRINT (yyss, yyssp);
1382
1383 *++yyvsp = yyval;
1384
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001385 /* Now 'shift' the result of the reduction. Determine what state
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001386 that goes to, based on the state we popped back to and the rule
1387 number reduced by. */
1388
1389 yyn = yyr1[yyn];
1390
1391 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1392 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1393 yystate = yytable[yystate];
1394 else
1395 yystate = yydefgoto[yyn - YYNTOKENS];
1396
1397 goto yynewstate;
1398
1399
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001400/*--------------------------------------.
1401| yyerrlab -- here on detecting error. |
1402`--------------------------------------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001403yyerrlab:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001404 /* Make sure we have latest lookahead translation. See comments at
1405 user semantic actions for why this is necessary. */
1406 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1407
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001408 /* If not already recovering from an error, report this error. */
1409 if (!yyerrstatus)
1410 {
1411 ++yynerrs;
1412#if ! YYERROR_VERBOSE
1413 yyerror (YY_("syntax error"));
1414#else
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001415# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1416 yyssp, yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001417 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001418 char const *yymsgp = YY_("syntax error");
1419 int yysyntax_error_status;
1420 yysyntax_error_status = YYSYNTAX_ERROR;
1421 if (yysyntax_error_status == 0)
1422 yymsgp = yymsg;
1423 else if (yysyntax_error_status == 1)
1424 {
1425 if (yymsg != yymsgbuf)
1426 YYSTACK_FREE (yymsg);
1427 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1428 if (!yymsg)
1429 {
1430 yymsg = yymsgbuf;
1431 yymsg_alloc = sizeof yymsgbuf;
1432 yysyntax_error_status = 2;
1433 }
1434 else
1435 {
1436 yysyntax_error_status = YYSYNTAX_ERROR;
1437 yymsgp = yymsg;
1438 }
1439 }
1440 yyerror (yymsgp);
1441 if (yysyntax_error_status == 2)
1442 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001443 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001444# undef YYSYNTAX_ERROR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001445#endif
1446 }
1447
1448
1449
1450 if (yyerrstatus == 3)
1451 {
1452 /* If just tried and failed to reuse lookahead token after an
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001453 error, discard it. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001454
1455 if (yychar <= YYEOF)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001456 {
1457 /* Return failure if at end of input. */
1458 if (yychar == YYEOF)
1459 YYABORT;
1460 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001461 else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001462 {
1463 yydestruct ("Error: discarding",
1464 yytoken, &yylval);
1465 yychar = YYEMPTY;
1466 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001467 }
1468
1469 /* Else will try to reuse lookahead token after shifting the error
1470 token. */
1471 goto yyerrlab1;
1472
1473
1474/*---------------------------------------------------.
1475| yyerrorlab -- error raised explicitly by YYERROR. |
1476`---------------------------------------------------*/
1477yyerrorlab:
1478
1479 /* Pacify compilers like GCC when the user code never invokes
1480 YYERROR and the label yyerrorlab therefore never appears in user
1481 code. */
1482 if (/*CONSTCOND*/ 0)
1483 goto yyerrorlab;
1484
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001485 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001486 this YYERROR. */
1487 YYPOPSTACK (yylen);
1488 yylen = 0;
1489 YY_STACK_PRINT (yyss, yyssp);
1490 yystate = *yyssp;
1491 goto yyerrlab1;
1492
1493
1494/*-------------------------------------------------------------.
1495| yyerrlab1 -- common code for both syntax error and YYERROR. |
1496`-------------------------------------------------------------*/
1497yyerrlab1:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001498 yyerrstatus = 3; /* Each real token shifted decrements this. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001499
1500 for (;;)
1501 {
1502 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001503 if (!yypact_value_is_default (yyn))
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001504 {
1505 yyn += YYTERROR;
1506 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1507 {
1508 yyn = yytable[yyn];
1509 if (0 < yyn)
1510 break;
1511 }
1512 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001513
1514 /* Pop the current state because it cannot handle the error token. */
1515 if (yyssp == yyss)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001516 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001517
1518
1519 yydestruct ("Error: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001520 yystos[yystate], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001521 YYPOPSTACK (1);
1522 yystate = *yyssp;
1523 YY_STACK_PRINT (yyss, yyssp);
1524 }
1525
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001526 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001527 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001528 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001529
1530
1531 /* Shift the error token. */
1532 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1533
1534 yystate = yyn;
1535 goto yynewstate;
1536
1537
1538/*-------------------------------------.
1539| yyacceptlab -- YYACCEPT comes here. |
1540`-------------------------------------*/
1541yyacceptlab:
1542 yyresult = 0;
1543 goto yyreturn;
1544
1545/*-----------------------------------.
1546| yyabortlab -- YYABORT comes here. |
1547`-----------------------------------*/
1548yyabortlab:
1549 yyresult = 1;
1550 goto yyreturn;
1551
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001552#if !defined yyoverflow || YYERROR_VERBOSE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001553/*-------------------------------------------------.
1554| yyexhaustedlab -- memory exhaustion comes here. |
1555`-------------------------------------------------*/
1556yyexhaustedlab:
1557 yyerror (YY_("memory exhausted"));
1558 yyresult = 2;
1559 /* Fall through. */
1560#endif
1561
1562yyreturn:
1563 if (yychar != YYEMPTY)
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001564 {
1565 /* Make sure we have latest lookahead translation. See comments at
1566 user semantic actions for why this is necessary. */
1567 yytoken = YYTRANSLATE (yychar);
1568 yydestruct ("Cleanup: discarding lookahead",
1569 yytoken, &yylval);
1570 }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001571 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001572 this YYABORT or YYACCEPT. */
1573 YYPOPSTACK (yylen);
1574 YY_STACK_PRINT (yyss, yyssp);
1575 while (yyssp != yyss)
1576 {
1577 yydestruct ("Cleanup: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001578 yystos[*yyssp], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001579 YYPOPSTACK (1);
1580 }
1581#ifndef yyoverflow
1582 if (yyss != yyssa)
1583 YYSTACK_FREE (yyss);
1584#endif
1585#if YYERROR_VERBOSE
1586 if (yymsg != yymsgbuf)
1587 YYSTACK_FREE (yymsg);
1588#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001589 return yyresult;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001590}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001591
1592