blob: c78f1ace25f41b233dae3c80f22dad36a8f2747e [file] [log] [blame]
Duncan Laurie47b7b342020-05-15 15:39:08 -07001/* A Bison parser, made by GNU Bison 3.5.1. */
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
Nico Huberd9b2f792020-04-28 16:28:03 +02005 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
6 Inc.
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07007
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00008 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
Stefan Reinauer2e78aa52016-05-07 01:11:14 -070012
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000013 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
Stefan Reinauer2e78aa52016-05-07 01:11:14 -070017
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000018 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
21/* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
Stefan Reinauer2e78aa52016-05-07 01:11:14 -070030
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000031 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34/* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
36
37/* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
43
Nico Huberd9b2f792020-04-28 16:28:03 +020044/* Undocumented macros, especially those whose name start with YY_,
45 are private implementation details. Do not rely on them. */
46
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000047/* Identify Bison output. */
48#define YYBISON 1
49
50/* Bison version. */
Duncan Laurie47b7b342020-05-15 15:39:08 -070051#define YYBISON_VERSION "3.5.1"
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000052
53/* Skeleton name. */
54#define YYSKELETON_NAME "yacc.c"
55
56/* Pure parsers. */
57#define YYPURE 0
58
59/* Push parsers. */
60#define YYPUSH 0
61
62/* Pull parsers. */
63#define YYPULL 1
64
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000065
66
67
Nico Huberd9b2f792020-04-28 16:28:03 +020068/* First part of user prologue. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000069
Patrick Georgiea063cb2020-05-08 19:28:13 +020070/* sconfig, coreboot device tree compiler */
Patrick Georgi7333a112020-05-08 20:48:04 +020071/* SPDX-License-Identifier: GPL-2.0-only */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000072
Patrick Georgi114e7b22010-05-05 11:19:50 +000073#include "sconfig.h"
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000074
Stefan Reinauer2e78aa52016-05-07 01:11:14 -070075int yylex();
76void yyerror(const char *s);
77
Furquan Shaikh93198262018-06-03 04:22:17 -070078static struct bus *cur_parent;
Furquan Shaikhc56ae2f2018-05-31 10:33:16 -070079static struct chip_instance *cur_chip_instance;
Duncan Laurie47b7b342020-05-15 15:39:08 -070080static struct fw_config_field *cur_field;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000081
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +000082
83
Nico Huberd9b2f792020-04-28 16:28:03 +020084# ifndef YY_CAST
85# ifdef __cplusplus
86# define YY_CAST(Type, Val) static_cast<Type> (Val)
87# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -070088# else
Nico Huberd9b2f792020-04-28 16:28:03 +020089# define YY_CAST(Type, Val) ((Type) (Val))
90# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
91# endif
92# endif
93# ifndef YY_NULLPTR
94# if defined __cplusplus
95# if 201103L <= __cplusplus
96# define YY_NULLPTR nullptr
97# else
98# define YY_NULLPTR 0
99# endif
100# else
101# define YY_NULLPTR ((void*)0)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700102# endif
103# endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000104
105/* Enabling verbose error messages. */
106#ifdef YYERROR_VERBOSE
107# undef YYERROR_VERBOSE
108# define YYERROR_VERBOSE 1
109#else
110# define YYERROR_VERBOSE 0
111#endif
112
Nico Huberd9b2f792020-04-28 16:28:03 +0200113/* Use api.header.include to #include this header
114 instead of duplicating it here. */
Duncan Laurie47b7b342020-05-15 15:39:08 -0700115#ifndef YY_YY_SRC_COREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
116# define YY_YY_SRC_COREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700117/* Debug traces. */
118#ifndef YYDEBUG
119# define YYDEBUG 0
120#endif
121#if YYDEBUG
122extern int yydebug;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000123#endif
124
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700125/* Token type. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000126#ifndef YYTOKENTYPE
127# define YYTOKENTYPE
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700128 enum yytokentype
129 {
130 CHIP = 258,
131 DEVICE = 259,
132 REGISTER = 260,
133 BOOL = 261,
Ronald G. Minnich466ca2c2019-10-22 02:02:24 +0000134 STATUS = 262,
135 MANDATORY = 263,
136 BUS = 264,
137 RESOURCE = 265,
138 END = 266,
139 EQUALS = 267,
140 HEX = 268,
141 STRING = 269,
142 PCI = 270,
143 PNP = 271,
144 I2C = 272,
145 APIC = 273,
146 CPU_CLUSTER = 274,
147 CPU = 275,
148 DOMAIN = 276,
149 IRQ = 277,
150 DRQ = 278,
151 SLOT_DESC = 279,
152 IO = 280,
153 NUMBER = 281,
154 SUBSYSTEMID = 282,
155 INHERIT = 283,
156 IOAPIC_IRQ = 284,
157 IOAPIC = 285,
158 PCIINT = 286,
159 GENERIC = 287,
160 SPI = 288,
161 USB = 289,
Raul E Rangel3f3f53c2020-05-06 11:47:04 -0600162 MMIO = 290,
163 LPC = 291,
Duncan Laurie47b7b342020-05-15 15:39:08 -0700164 ESPI = 292,
165 FW_CONFIG_TABLE = 293,
166 FW_CONFIG_FIELD = 294,
167 FW_CONFIG_OPTION = 295,
168 FW_CONFIG_PROBE = 296
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700169 };
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000170#endif
171
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700172/* Value type. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000173#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700174union YYSTYPE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000175{
176
Furquan Shaikh93198262018-06-03 04:22:17 -0700177 struct device *dev;
Furquan Shaikhc56ae2f2018-05-31 10:33:16 -0700178 struct chip_instance *chip_instance;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000179 char *string;
180 int number;
181
182
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700183};
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700184typedef union YYSTYPE YYSTYPE;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000185# define YYSTYPE_IS_TRIVIAL 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000186# define YYSTYPE_IS_DECLARED 1
187#endif
188
189
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700190extern YYSTYPE yylval;
191
192int yyparse (void);
193
Duncan Laurie47b7b342020-05-15 15:39:08 -0700194#endif /* !YY_YY_SRC_COREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000195
196
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000197
198#ifdef short
199# undef short
200#endif
201
Nico Huberd9b2f792020-04-28 16:28:03 +0200202/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
203 <limits.h> and (if available) <stdint.h> are included
204 so that the code can choose integer types of a good width. */
205
206#ifndef __PTRDIFF_MAX__
207# include <limits.h> /* INFRINGES ON USER NAME SPACE */
208# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
209# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
210# define YY_STDINT_H
211# endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000212#endif
213
Nico Huberd9b2f792020-04-28 16:28:03 +0200214/* Narrow types that promote to a signed type and that can represent a
215 signed or unsigned integer of at least N bits. In tables they can
216 save space and decrease cache pressure. Promoting to a signed type
217 helps avoid bugs in integer arithmetic. */
218
219#ifdef __INT_LEAST8_MAX__
220typedef __INT_LEAST8_TYPE__ yytype_int8;
221#elif defined YY_STDINT_H
222typedef int_least8_t yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000223#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700224typedef signed char yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000225#endif
226
Nico Huberd9b2f792020-04-28 16:28:03 +0200227#ifdef __INT_LEAST16_MAX__
228typedef __INT_LEAST16_TYPE__ yytype_int16;
229#elif defined YY_STDINT_H
230typedef int_least16_t yytype_int16;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000231#else
Nico Huberd9b2f792020-04-28 16:28:03 +0200232typedef short yytype_int16;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000233#endif
234
Nico Huberd9b2f792020-04-28 16:28:03 +0200235#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
236typedef __UINT_LEAST8_TYPE__ yytype_uint8;
237#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
238 && UINT_LEAST8_MAX <= INT_MAX)
239typedef uint_least8_t yytype_uint8;
240#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
241typedef unsigned char yytype_uint8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000242#else
Nico Huberd9b2f792020-04-28 16:28:03 +0200243typedef short yytype_uint8;
244#endif
245
246#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
247typedef __UINT_LEAST16_TYPE__ yytype_uint16;
248#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
249 && UINT_LEAST16_MAX <= INT_MAX)
250typedef uint_least16_t yytype_uint16;
251#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
252typedef unsigned short yytype_uint16;
253#else
254typedef int yytype_uint16;
255#endif
256
257#ifndef YYPTRDIFF_T
258# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
259# define YYPTRDIFF_T __PTRDIFF_TYPE__
260# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
261# elif defined PTRDIFF_MAX
262# ifndef ptrdiff_t
263# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
264# endif
265# define YYPTRDIFF_T ptrdiff_t
266# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
267# else
268# define YYPTRDIFF_T long
269# define YYPTRDIFF_MAXIMUM LONG_MAX
270# endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000271#endif
272
273#ifndef YYSIZE_T
274# ifdef __SIZE_TYPE__
275# define YYSIZE_T __SIZE_TYPE__
276# elif defined size_t
277# define YYSIZE_T size_t
Nico Huberd9b2f792020-04-28 16:28:03 +0200278# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000279# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
280# define YYSIZE_T size_t
281# else
Nico Huberd9b2f792020-04-28 16:28:03 +0200282# define YYSIZE_T unsigned
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000283# endif
284#endif
285
Nico Huberd9b2f792020-04-28 16:28:03 +0200286#define YYSIZE_MAXIMUM \
287 YY_CAST (YYPTRDIFF_T, \
288 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
289 ? YYPTRDIFF_MAXIMUM \
290 : YY_CAST (YYSIZE_T, -1)))
291
292#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
293
294/* Stored state numbers (used for stacks). */
295typedef yytype_int8 yy_state_t;
296
297/* State numbers in computations. */
298typedef int yy_state_fast_t;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000299
300#ifndef YY_
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200301# if defined YYENABLE_NLS && YYENABLE_NLS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000302# if ENABLE_NLS
303# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700304# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000305# endif
306# endif
307# ifndef YY_
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700308# define YY_(Msgid) Msgid
309# endif
310#endif
311
Nico Huberd9b2f792020-04-28 16:28:03 +0200312#ifndef YY_ATTRIBUTE_PURE
313# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
314# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700315# else
Nico Huberd9b2f792020-04-28 16:28:03 +0200316# define YY_ATTRIBUTE_PURE
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700317# endif
318#endif
319
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700320#ifndef YY_ATTRIBUTE_UNUSED
Nico Huberd9b2f792020-04-28 16:28:03 +0200321# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
322# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700323# else
Nico Huberd9b2f792020-04-28 16:28:03 +0200324# define YY_ATTRIBUTE_UNUSED
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000325# endif
326#endif
327
328/* Suppress unused-variable warnings by "using" E. */
329#if ! defined lint || defined __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700330# define YYUSE(E) ((void) (E))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000331#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700332# define YYUSE(E) /* empty */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000333#endif
334
Nico Huberd9b2f792020-04-28 16:28:03 +0200335#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700336/* Suppress an incorrect diagnostic about yylval being uninitialized. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200337# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
338 _Pragma ("GCC diagnostic push") \
339 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700340 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
Nico Huberd9b2f792020-04-28 16:28:03 +0200341# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700342 _Pragma ("GCC diagnostic pop")
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000343#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700344# define YY_INITIAL_VALUE(Value) Value
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000345#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700346#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
347# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
348# define YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000349#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700350#ifndef YY_INITIAL_VALUE
351# define YY_INITIAL_VALUE(Value) /* Nothing. */
352#endif
353
Nico Huberd9b2f792020-04-28 16:28:03 +0200354#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
355# define YY_IGNORE_USELESS_CAST_BEGIN \
356 _Pragma ("GCC diagnostic push") \
357 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
358# define YY_IGNORE_USELESS_CAST_END \
359 _Pragma ("GCC diagnostic pop")
360#endif
361#ifndef YY_IGNORE_USELESS_CAST_BEGIN
362# define YY_IGNORE_USELESS_CAST_BEGIN
363# define YY_IGNORE_USELESS_CAST_END
364#endif
365
366
367#define YY_ASSERT(E) ((void) (0 && (E)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000368
369#if ! defined yyoverflow || YYERROR_VERBOSE
370
371/* The parser invokes alloca or malloc; define the necessary symbols. */
372
373# ifdef YYSTACK_USE_ALLOCA
374# if YYSTACK_USE_ALLOCA
375# ifdef __GNUC__
376# define YYSTACK_ALLOC __builtin_alloca
377# elif defined __BUILTIN_VA_ARG_INCR
378# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
379# elif defined _AIX
380# define YYSTACK_ALLOC __alloca
381# elif defined _MSC_VER
382# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
383# define alloca _alloca
384# else
385# define YYSTACK_ALLOC alloca
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700386# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000387# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700388 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200389# ifndef EXIT_SUCCESS
390# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000391# endif
392# endif
393# endif
394# endif
395# endif
396
397# ifdef YYSTACK_ALLOC
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700398 /* Pacify GCC's 'empty if-body' warning. */
399# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000400# ifndef YYSTACK_ALLOC_MAXIMUM
401 /* The OS might guarantee only one guard page at the bottom of the stack,
402 and a page size can be as small as 4096 bytes. So we cannot safely
403 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
404 to allow for a few compiler-allocated temporary stack slots. */
405# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
406# endif
407# else
408# define YYSTACK_ALLOC YYMALLOC
409# define YYSTACK_FREE YYFREE
410# ifndef YYSTACK_ALLOC_MAXIMUM
411# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
412# endif
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200413# if (defined __cplusplus && ! defined EXIT_SUCCESS \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000414 && ! ((defined YYMALLOC || defined malloc) \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700415 && (defined YYFREE || defined free)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000416# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200417# ifndef EXIT_SUCCESS
418# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000419# endif
420# endif
421# ifndef YYMALLOC
422# define YYMALLOC malloc
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700423# if ! defined malloc && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000424void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
425# endif
426# endif
427# ifndef YYFREE
428# define YYFREE free
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700429# if ! defined free && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000430void free (void *); /* INFRINGES ON USER NAME SPACE */
431# endif
432# endif
433# endif
434#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
435
436
437#if (! defined yyoverflow \
438 && (! defined __cplusplus \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700439 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000440
441/* A type that is properly aligned for any stack member. */
442union yyalloc
443{
Nico Huberd9b2f792020-04-28 16:28:03 +0200444 yy_state_t yyss_alloc;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000445 YYSTYPE yyvs_alloc;
446};
447
448/* The size of the maximum gap between one aligned stack and the next. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200449# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000450
451/* The size of an array large to enough to hold all stacks, each with
452 N elements. */
453# define YYSTACK_BYTES(N) \
Nico Huberd9b2f792020-04-28 16:28:03 +0200454 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000455 + YYSTACK_GAP_MAXIMUM)
456
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200457# define YYCOPY_NEEDED 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000458
459/* Relocate STACK from its old location to the new one. The
460 local variables YYSIZE and YYSTACKSIZE give the old and new number of
461 elements in the stack, and YYPTR gives the new location of the
462 stack. Advance YYPTR to a properly aligned location for the next
463 stack. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700464# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
465 do \
466 { \
Nico Huberd9b2f792020-04-28 16:28:03 +0200467 YYPTRDIFF_T yynewbytes; \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700468 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
469 Stack = &yyptr->Stack_alloc; \
Nico Huberd9b2f792020-04-28 16:28:03 +0200470 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
471 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700472 } \
473 while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000474
475#endif
476
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200477#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700478/* Copy COUNT objects from SRC to DST. The source and destination do
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200479 not overlap. */
480# ifndef YYCOPY
481# if defined __GNUC__ && 1 < __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700482# define YYCOPY(Dst, Src, Count) \
Nico Huberd9b2f792020-04-28 16:28:03 +0200483 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200484# else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700485# define YYCOPY(Dst, Src, Count) \
486 do \
487 { \
Nico Huberd9b2f792020-04-28 16:28:03 +0200488 YYPTRDIFF_T yyi; \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700489 for (yyi = 0; yyi < (Count); yyi++) \
490 (Dst)[yyi] = (Src)[yyi]; \
491 } \
492 while (0)
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200493# endif
494# endif
495#endif /* !YYCOPY_NEEDED */
496
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000497/* YYFINAL -- State number of the termination state. */
Duncan Laurie47b7b342020-05-15 15:39:08 -0700498#define YYFINAL 2
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000499/* YYLAST -- Last index in YYTABLE. */
Duncan Laurie47b7b342020-05-15 15:39:08 -0700500#define YYLAST 58
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000501
502/* YYNTOKENS -- Number of terminals. */
Duncan Laurie47b7b342020-05-15 15:39:08 -0700503#define YYNTOKENS 42
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000504/* YYNNTS -- Number of nonterminals. */
Duncan Laurie47b7b342020-05-15 15:39:08 -0700505#define YYNNTS 23
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000506/* YYNRULES -- Number of rules. */
Duncan Laurie47b7b342020-05-15 15:39:08 -0700507#define YYNRULES 44
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700508/* YYNSTATES -- Number of states. */
Duncan Laurie47b7b342020-05-15 15:39:08 -0700509#define YYNSTATES 75
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000510
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000511#define YYUNDEFTOK 2
Duncan Laurie47b7b342020-05-15 15:39:08 -0700512#define YYMAXUTOK 296
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000513
Nico Huberd9b2f792020-04-28 16:28:03 +0200514
515/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
516 as returned by yylex, with out-of-bounds checking. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700517#define YYTRANSLATE(YYX) \
Nico Huberd9b2f792020-04-28 16:28:03 +0200518 (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000519
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700520/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
Nico Huberd9b2f792020-04-28 16:28:03 +0200521 as returned by yylex. */
522static const yytype_int8 yytranslate[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000523{
524 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
525 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
526 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
527 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
528 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
531 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
533 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
534 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
535 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
544 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
550 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200551 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
Ronald G. Minnich466ca2c2019-10-22 02:02:24 +0000552 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
Duncan Laurie47b7b342020-05-15 15:39:08 -0700553 35, 36, 37, 38, 39, 40, 41
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000554};
555
556#if YYDEBUG
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700557 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200558static const yytype_int8 yyrline[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000559{
Duncan Laurie47b7b342020-05-15 15:39:08 -0700560 0, 24, 24, 24, 24, 26, 26, 26, 26, 28,
561 28, 28, 28, 28, 28, 28, 28, 28, 30, 30,
562 39, 39, 47, 47, 49, 52, 55, 58, 61, 64,
563 67, 70, 74, 77, 77, 80, 80, 83, 83, 89,
564 89, 95, 95, 101, 105
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000565};
566#endif
567
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700568#if YYDEBUG || YYERROR_VERBOSE || 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000569/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
570 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
571static const char *const yytname[] =
572{
573 "$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
Ronald G. Minnich466ca2c2019-10-22 02:02:24 +0000574 "STATUS", "MANDATORY", "BUS", "RESOURCE", "END", "EQUALS", "HEX",
575 "STRING", "PCI", "PNP", "I2C", "APIC", "CPU_CLUSTER", "CPU", "DOMAIN",
576 "IRQ", "DRQ", "SLOT_DESC", "IO", "NUMBER", "SUBSYSTEMID", "INHERIT",
Raul E Rangel3f3f53c2020-05-06 11:47:04 -0600577 "IOAPIC_IRQ", "IOAPIC", "PCIINT", "GENERIC", "SPI", "USB", "MMIO", "LPC",
Duncan Laurie47b7b342020-05-15 15:39:08 -0700578 "ESPI", "FW_CONFIG_TABLE", "FW_CONFIG_FIELD", "FW_CONFIG_OPTION",
579 "FW_CONFIG_PROBE", "$accept", "devtree", "chipchildren",
580 "devicechildren", "chip", "@1", "device", "@2", "status", "resource",
581 "registers", "subsystemid", "ioapic_irq", "smbios_slot_desc",
582 "fw_config_table", "fw_config_table_children",
583 "fw_config_field_children", "fw_config_field", "$@3", "$@4", "$@5",
584 "fw_config_option", "fw_config_probe", YY_NULLPTR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000585};
586#endif
587
588# ifdef YYPRINT
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700589/* YYTOKNUM[NUM] -- (External) token number corresponding to the
590 (internal) symbol number NUM (which must be that of a token). */
Nico Huberd9b2f792020-04-28 16:28:03 +0200591static const yytype_int16 yytoknum[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000592{
593 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
594 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
Furquan Shaikhe6700292017-02-11 00:50:38 -0800595 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
Duncan Laurie47b7b342020-05-15 15:39:08 -0700596 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
597 295, 296
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000598};
599# endif
600
Duncan Laurie47b7b342020-05-15 15:39:08 -0700601#define YYPACT_NINF (-12)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700602
Nico Huberd9b2f792020-04-28 16:28:03 +0200603#define yypact_value_is_default(Yyn) \
604 ((Yyn) == YYPACT_NINF)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700605
Nico Huberd9b2f792020-04-28 16:28:03 +0200606#define YYTABLE_NINF (-1)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700607
Nico Huberd9b2f792020-04-28 16:28:03 +0200608#define yytable_value_is_error(Yyn) \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700609 0
610
611 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
612 STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000613static const yytype_int8 yypact[] =
614{
Duncan Laurie47b7b342020-05-15 15:39:08 -0700615 -12, 3, -12, 4, -12, -12, -12, -12, -2, -12,
616 -12, 8, -12, 9, 1, 14, 11, -12, -12, -12,
617 -12, 2, -12, 5, 17, -12, -12, -6, 10, 16,
618 -12, -1, -12, 18, -12, -12, -12, -12, -12, 0,
619 -12, 7, -12, -12, -12, -3, 19, -12, 21, 20,
620 22, 28, -12, -12, -12, -12, -12, -12, -12, -12,
621 31, 30, 23, 24, 33, 25, 36, 26, 27, -12,
622 -12, 38, -12, -12, -12
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000623};
624
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700625 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
626 Performed when YYTABLE does not specify something else to do. Zero
627 means the default is an error. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200628static const yytype_int8 yydefact[] =
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700629{
Duncan Laurie47b7b342020-05-15 15:39:08 -0700630 2, 0, 1, 0, 34, 3, 4, 18, 0, 8,
631 32, 0, 33, 0, 41, 0, 0, 19, 6, 5,
632 7, 39, 36, 0, 0, 37, 36, 0, 0, 0,
633 36, 0, 42, 0, 35, 22, 23, 20, 25, 0,
634 40, 0, 17, 38, 43, 0, 0, 21, 0, 0,
635 0, 0, 10, 9, 11, 15, 12, 13, 14, 16,
636 0, 0, 0, 0, 0, 0, 31, 26, 0, 44,
637 24, 30, 27, 28, 29
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700638};
639
640 /* YYPGOTO[NTERM-NUM]. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000641static const yytype_int8 yypgoto[] =
642{
Duncan Laurie47b7b342020-05-15 15:39:08 -0700643 -12, -12, -12, -12, -9, -12, 12, -12, -12, -12,
644 13, -12, -12, -12, -12, -12, -11, -12, -12, -12,
645 -12, -12, -12
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000646};
647
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700648 /* YYDEFGOTO[NTERM-NUM]. */
649static const yytype_int8 yydefgoto[] =
650{
Duncan Laurie47b7b342020-05-15 15:39:08 -0700651 -1, 1, 13, 45, 5, 9, 19, 42, 37, 54,
652 20, 56, 57, 58, 6, 8, 27, 12, 30, 26,
653 22, 34, 59
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700654};
655
656 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
657 positive, shift that token. If negative, reduce the rule whose
658 number is the opposite. If YYTABLE_NINF, syntax error. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200659static const yytype_int8 yytable[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000660{
Duncan Laurie47b7b342020-05-15 15:39:08 -0700661 3, 15, 16, 2, 18, 32, 3, 46, 47, 10,
662 40, 43, 3, 15, 16, 31, 35, 36, 7, 39,
663 17, 48, 14, 23, 49, 24, 50, 21, 25, 29,
664 38, 28, 41, 44, 33, 61, 52, 11, 51, 33,
665 33, 4, 64, 65, 66, 60, 62, 69, 63, 67,
666 71, 70, 74, 73, 72, 68, 0, 53, 55
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000667};
668
Patrick Georgi8f625f62010-05-05 13:13:47 +0000669static const yytype_int8 yycheck[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000670{
Duncan Laurie47b7b342020-05-15 15:39:08 -0700671 3, 4, 5, 0, 13, 11, 3, 10, 11, 11,
672 11, 11, 3, 4, 5, 26, 6, 7, 14, 30,
673 11, 24, 14, 9, 27, 14, 29, 26, 26, 12,
674 14, 26, 14, 26, 40, 14, 45, 39, 41, 40,
675 40, 38, 14, 12, 14, 26, 26, 14, 26, 26,
676 14, 26, 14, 26, 28, 31, -1, 45, 45
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000677};
678
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700679 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
680 symbol of state STATE-NUM. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200681static const yytype_int8 yystos[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000682{
Duncan Laurie47b7b342020-05-15 15:39:08 -0700683 0, 43, 0, 3, 38, 46, 56, 14, 57, 47,
684 11, 39, 59, 44, 14, 4, 5, 11, 46, 48,
685 52, 26, 62, 9, 14, 26, 61, 58, 26, 12,
686 60, 58, 11, 40, 63, 6, 7, 50, 14, 58,
687 11, 14, 49, 11, 26, 45, 10, 11, 24, 27,
688 29, 41, 46, 48, 51, 52, 53, 54, 55, 64,
689 26, 14, 26, 26, 14, 12, 14, 26, 31, 14,
690 26, 14, 28, 26, 14
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000691};
692
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700693 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200694static const yytype_int8 yyr1[] =
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700695{
Duncan Laurie47b7b342020-05-15 15:39:08 -0700696 0, 42, 43, 43, 43, 44, 44, 44, 44, 45,
697 45, 45, 45, 45, 45, 45, 45, 45, 47, 46,
698 49, 48, 50, 50, 51, 52, 53, 53, 54, 55,
699 55, 55, 56, 57, 57, 58, 58, 60, 59, 61,
700 59, 62, 59, 63, 64
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700701};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000702
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700703 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200704static const yytype_int8 yyr2[] =
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700705{
Duncan Laurie47b7b342020-05-15 15:39:08 -0700706 0, 2, 0, 2, 2, 2, 2, 2, 0, 2,
707 2, 2, 2, 2, 2, 2, 2, 0, 0, 5,
708 0, 7, 1, 1, 4, 4, 3, 4, 4, 5,
709 4, 3, 3, 2, 0, 2, 0, 0, 7, 0,
710 6, 0, 5, 3, 3
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700711};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000712
713
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700714#define yyerrok (yyerrstatus = 0)
715#define yyclearin (yychar = YYEMPTY)
716#define YYEMPTY (-2)
717#define YYEOF 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000718
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700719#define YYACCEPT goto yyacceptlab
720#define YYABORT goto yyabortlab
721#define YYERROR goto yyerrorlab
722
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000723
724#define YYRECOVERING() (!!yyerrstatus)
725
Nico Huberd9b2f792020-04-28 16:28:03 +0200726#define YYBACKUP(Token, Value) \
727 do \
728 if (yychar == YYEMPTY) \
729 { \
730 yychar = (Token); \
731 yylval = (Value); \
732 YYPOPSTACK (yylen); \
733 yystate = *yyssp; \
734 goto yybackup; \
735 } \
736 else \
737 { \
738 yyerror (YY_("syntax error: cannot back up")); \
739 YYERROR; \
740 } \
741 while (0)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700742
743/* Error token number */
744#define YYTERROR 1
745#define YYERRCODE 256
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000746
747
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000748
749/* Enable debugging if requested. */
750#if YYDEBUG
751
752# ifndef YYFPRINTF
753# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
754# define YYFPRINTF fprintf
755# endif
756
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700757# define YYDPRINTF(Args) \
758do { \
759 if (yydebug) \
760 YYFPRINTF Args; \
761} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000762
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700763/* This macro is provided for backward compatibility. */
764#ifndef YY_LOCATION_PRINT
765# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
766#endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000767
768
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700769# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
770do { \
771 if (yydebug) \
772 { \
773 YYFPRINTF (stderr, "%s ", Title); \
774 yy_symbol_print (stderr, \
775 Type, Value); \
776 YYFPRINTF (stderr, "\n"); \
777 } \
778} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000779
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700780
Nico Huberd9b2f792020-04-28 16:28:03 +0200781/*-----------------------------------.
782| Print this symbol's value on YYO. |
783`-----------------------------------*/
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700784
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000785static void
Nico Huberd9b2f792020-04-28 16:28:03 +0200786yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000787{
Nico Huberd9b2f792020-04-28 16:28:03 +0200788 FILE *yyoutput = yyo;
789 YYUSE (yyoutput);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000790 if (!yyvaluep)
791 return;
792# ifdef YYPRINT
793 if (yytype < YYNTOKENS)
Nico Huberd9b2f792020-04-28 16:28:03 +0200794 YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000795# endif
Nico Huberd9b2f792020-04-28 16:28:03 +0200796 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700797 YYUSE (yytype);
Nico Huberd9b2f792020-04-28 16:28:03 +0200798 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000799}
800
801
Nico Huberd9b2f792020-04-28 16:28:03 +0200802/*---------------------------.
803| Print this symbol on YYO. |
804`---------------------------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000805
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000806static void
Nico Huberd9b2f792020-04-28 16:28:03 +0200807yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000808{
Nico Huberd9b2f792020-04-28 16:28:03 +0200809 YYFPRINTF (yyo, "%s %s (",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700810 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000811
Nico Huberd9b2f792020-04-28 16:28:03 +0200812 yy_symbol_value_print (yyo, yytype, yyvaluep);
813 YYFPRINTF (yyo, ")");
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000814}
815
816/*------------------------------------------------------------------.
817| yy_stack_print -- Print the state stack from its BOTTOM up to its |
818| TOP (included). |
819`------------------------------------------------------------------*/
820
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000821static void
Nico Huberd9b2f792020-04-28 16:28:03 +0200822yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000823{
824 YYFPRINTF (stderr, "Stack now");
825 for (; yybottom <= yytop; yybottom++)
826 {
827 int yybot = *yybottom;
828 YYFPRINTF (stderr, " %d", yybot);
829 }
830 YYFPRINTF (stderr, "\n");
831}
832
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700833# define YY_STACK_PRINT(Bottom, Top) \
834do { \
835 if (yydebug) \
836 yy_stack_print ((Bottom), (Top)); \
837} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000838
839
840/*------------------------------------------------.
841| Report that the YYRULE is going to be reduced. |
842`------------------------------------------------*/
843
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000844static void
Nico Huberd9b2f792020-04-28 16:28:03 +0200845yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000846{
Nico Huberd9b2f792020-04-28 16:28:03 +0200847 int yylno = yyrline[yyrule];
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000848 int yynrhs = yyr2[yyrule];
849 int yyi;
Nico Huberd9b2f792020-04-28 16:28:03 +0200850 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700851 yyrule - 1, yylno);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000852 /* The symbols being reduced. */
853 for (yyi = 0; yyi < yynrhs; yyi++)
854 {
855 YYFPRINTF (stderr, " $%d = ", yyi + 1);
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700856 yy_symbol_print (stderr,
Nico Huberd9b2f792020-04-28 16:28:03 +0200857 yystos[+yyssp[yyi + 1 - yynrhs]],
858 &yyvsp[(yyi + 1) - (yynrhs)]
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700859 );
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000860 YYFPRINTF (stderr, "\n");
861 }
862}
863
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700864# define YY_REDUCE_PRINT(Rule) \
865do { \
866 if (yydebug) \
867 yy_reduce_print (yyssp, yyvsp, Rule); \
868} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000869
870/* Nonzero means print parse trace. It is left uninitialized so that
871 multiple parsers can coexist. */
872int yydebug;
873#else /* !YYDEBUG */
874# define YYDPRINTF(Args)
875# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
876# define YY_STACK_PRINT(Bottom, Top)
877# define YY_REDUCE_PRINT(Rule)
878#endif /* !YYDEBUG */
879
880
881/* YYINITDEPTH -- initial size of the parser's stacks. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700882#ifndef YYINITDEPTH
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000883# define YYINITDEPTH 200
884#endif
885
886/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
887 if the built-in stack extension method is used).
888
889 Do not make this value too large; the results are undefined if
890 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
891 evaluated with infinite-precision integer arithmetic. */
892
893#ifndef YYMAXDEPTH
894# define YYMAXDEPTH 10000
895#endif
896
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000897
898#if YYERROR_VERBOSE
899
900# ifndef yystrlen
901# if defined __GLIBC__ && defined _STRING_H
Nico Huberd9b2f792020-04-28 16:28:03 +0200902# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000903# else
904/* Return the length of YYSTR. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200905static YYPTRDIFF_T
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000906yystrlen (const char *yystr)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000907{
Nico Huberd9b2f792020-04-28 16:28:03 +0200908 YYPTRDIFF_T yylen;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000909 for (yylen = 0; yystr[yylen]; yylen++)
910 continue;
911 return yylen;
912}
913# endif
914# endif
915
916# ifndef yystpcpy
917# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
918# define yystpcpy stpcpy
919# else
920/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
921 YYDEST. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000922static char *
923yystpcpy (char *yydest, const char *yysrc)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000924{
925 char *yyd = yydest;
926 const char *yys = yysrc;
927
928 while ((*yyd++ = *yys++) != '\0')
929 continue;
930
931 return yyd - 1;
932}
933# endif
934# endif
935
936# ifndef yytnamerr
937/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
938 quotes and backslashes, so that it's suitable for yyerror. The
939 heuristic is that double-quoting is unnecessary unless the string
940 contains an apostrophe, a comma, or backslash (other than
941 backslash-backslash). YYSTR is taken from yytname. If YYRES is
942 null, do not copy; instead, return the length of what the result
943 would have been. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200944static YYPTRDIFF_T
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000945yytnamerr (char *yyres, const char *yystr)
946{
947 if (*yystr == '"')
948 {
Nico Huberd9b2f792020-04-28 16:28:03 +0200949 YYPTRDIFF_T yyn = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000950 char const *yyp = yystr;
951
952 for (;;)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700953 switch (*++yyp)
954 {
955 case '\'':
956 case ',':
957 goto do_not_strip_quotes;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000958
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700959 case '\\':
960 if (*++yyp != '\\')
961 goto do_not_strip_quotes;
Nico Huberd9b2f792020-04-28 16:28:03 +0200962 else
963 goto append;
964
965 append:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700966 default:
967 if (yyres)
968 yyres[yyn] = *yyp;
969 yyn++;
970 break;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000971
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700972 case '"':
973 if (yyres)
974 yyres[yyn] = '\0';
975 return yyn;
976 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000977 do_not_strip_quotes: ;
978 }
979
Nico Huberd9b2f792020-04-28 16:28:03 +0200980 if (yyres)
981 return yystpcpy (yyres, yystr) - yyres;
982 else
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000983 return yystrlen (yystr);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000984}
985# endif
986
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200987/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
988 about the unexpected token YYTOKEN for the state stack whose top is
989 YYSSP.
990
991 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
992 not large enough to hold the message. In that case, also set
993 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
994 required number of bytes is too large to store. */
995static int
Nico Huberd9b2f792020-04-28 16:28:03 +0200996yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
997 yy_state_t *yyssp, int yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000998{
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200999 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1000 /* Internationalized format string. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001001 const char *yyformat = YY_NULLPTR;
Nico Huberd9b2f792020-04-28 16:28:03 +02001002 /* Arguments of yyformat: reported tokens (one for the "unexpected",
1003 one per "expected"). */
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001004 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
Nico Huberd9b2f792020-04-28 16:28:03 +02001005 /* Actual size of YYARG. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001006 int yycount = 0;
Nico Huberd9b2f792020-04-28 16:28:03 +02001007 /* Cumulated lengths of YYARG. */
1008 YYPTRDIFF_T yysize = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001009
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001010 /* There are many possibilities here to consider:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001011 - If this state is a consistent state with a default action, then
1012 the only way this function was invoked is if the default action
1013 is an error action. In that case, don't check for expected
1014 tokens because there are none.
1015 - The only way there can be no lookahead present (in yychar) is if
1016 this state is a consistent state with a default action. Thus,
1017 detecting the absence of a lookahead is sufficient to determine
1018 that there is no unexpected or expected token to report. In that
1019 case, just report a simple "syntax error".
1020 - Don't assume there isn't a lookahead just because this state is a
1021 consistent state with a default action. There might have been a
1022 previous inconsistent state, consistent state with a non-default
1023 action, or user semantic action that manipulated yychar.
1024 - Of course, the expected token list depends on states to have
1025 correct lookahead information, and it depends on the parser not
1026 to perform extra reductions after fetching a lookahead from the
1027 scanner and before detecting a syntax error. Thus, state merging
1028 (from LALR or IELR) and default reductions corrupt the expected
1029 token list. However, the list is correct for canonical LR with
1030 one exception: it will still contain any token that will not be
1031 accepted due to an error action in a later state.
1032 */
1033 if (yytoken != YYEMPTY)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001034 {
Nico Huberd9b2f792020-04-28 16:28:03 +02001035 int yyn = yypact[+*yyssp];
1036 YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1037 yysize = yysize0;
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001038 yyarg[yycount++] = yytname[yytoken];
1039 if (!yypact_value_is_default (yyn))
1040 {
1041 /* Start YYX at -YYN if negative to avoid negative indexes in
1042 YYCHECK. In other words, skip the first -YYN actions for
1043 this state because they are default actions. */
1044 int yyxbegin = yyn < 0 ? -yyn : 0;
1045 /* Stay within bounds of both yycheck and yytname. */
1046 int yychecklim = YYLAST - yyn + 1;
1047 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1048 int yyx;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001049
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001050 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1051 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1052 && !yytable_value_is_error (yytable[yyx + yyn]))
1053 {
1054 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1055 {
1056 yycount = 1;
1057 yysize = yysize0;
1058 break;
1059 }
1060 yyarg[yycount++] = yytname[yyx];
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001061 {
Nico Huberd9b2f792020-04-28 16:28:03 +02001062 YYPTRDIFF_T yysize1
1063 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1064 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1065 yysize = yysize1;
1066 else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001067 return 2;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001068 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001069 }
1070 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001071 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001072
1073 switch (yycount)
1074 {
1075# define YYCASE_(N, S) \
1076 case N: \
1077 yyformat = S; \
1078 break
Nico Huberd9b2f792020-04-28 16:28:03 +02001079 default: /* Avoid compiler warnings. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001080 YYCASE_(0, YY_("syntax error"));
1081 YYCASE_(1, YY_("syntax error, unexpected %s"));
1082 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1083 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1084 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1085 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1086# undef YYCASE_
1087 }
1088
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001089 {
Nico Huberd9b2f792020-04-28 16:28:03 +02001090 /* Don't count the "%s"s in the final size, but reserve room for
1091 the terminator. */
1092 YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
1093 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1094 yysize = yysize1;
1095 else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001096 return 2;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001097 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001098
1099 if (*yymsg_alloc < yysize)
1100 {
1101 *yymsg_alloc = 2 * yysize;
1102 if (! (yysize <= *yymsg_alloc
1103 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1104 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1105 return 1;
1106 }
1107
1108 /* Avoid sprintf, as that infringes on the user's name space.
1109 Don't have undefined behavior even if the translation
1110 produced a string with the wrong number of "%s"s. */
1111 {
1112 char *yyp = *yymsg;
1113 int yyi = 0;
1114 while ((*yyp = *yyformat) != '\0')
1115 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1116 {
1117 yyp += yytnamerr (yyp, yyarg[yyi++]);
1118 yyformat += 2;
1119 }
1120 else
1121 {
Nico Huberd9b2f792020-04-28 16:28:03 +02001122 ++yyp;
1123 ++yyformat;
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001124 }
1125 }
1126 return 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001127}
1128#endif /* YYERROR_VERBOSE */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001129
1130/*-----------------------------------------------.
1131| Release the memory associated to this symbol. |
1132`-----------------------------------------------*/
1133
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001134static void
1135yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001136{
1137 YYUSE (yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001138 if (!yymsg)
1139 yymsg = "Deleting";
1140 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1141
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001142 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1143 YYUSE (yytype);
1144 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001145}
1146
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001147
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001148
1149
1150/* The lookahead symbol. */
1151int yychar;
1152
1153/* The semantic value of the lookahead symbol. */
1154YYSTYPE yylval;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001155/* Number of syntax errors so far. */
1156int yynerrs;
1157
1158
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001159/*----------.
1160| yyparse. |
1161`----------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001162
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001163int
1164yyparse (void)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001165{
Nico Huberd9b2f792020-04-28 16:28:03 +02001166 yy_state_fast_t yystate;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001167 /* Number of tokens to shift before error messages enabled. */
1168 int yyerrstatus;
1169
1170 /* The stacks and their tools:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001171 'yyss': related to states.
1172 'yyvs': related to semantic values.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001173
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001174 Refer to the stacks through separate pointers, to allow yyoverflow
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001175 to reallocate them elsewhere. */
1176
1177 /* The state stack. */
Nico Huberd9b2f792020-04-28 16:28:03 +02001178 yy_state_t yyssa[YYINITDEPTH];
1179 yy_state_t *yyss;
1180 yy_state_t *yyssp;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001181
1182 /* The semantic value stack. */
1183 YYSTYPE yyvsa[YYINITDEPTH];
1184 YYSTYPE *yyvs;
1185 YYSTYPE *yyvsp;
1186
Nico Huberd9b2f792020-04-28 16:28:03 +02001187 YYPTRDIFF_T yystacksize;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001188
1189 int yyn;
1190 int yyresult;
1191 /* Lookahead token as an internal (translated) token number. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001192 int yytoken = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001193 /* The variables used to return semantic value and location from the
1194 action routines. */
1195 YYSTYPE yyval;
1196
1197#if YYERROR_VERBOSE
1198 /* Buffer for error messages, and its allocated size. */
1199 char yymsgbuf[128];
1200 char *yymsg = yymsgbuf;
Nico Huberd9b2f792020-04-28 16:28:03 +02001201 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001202#endif
1203
1204#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1205
1206 /* The number of symbols on the RHS of the reduced rule.
1207 Keep to zero when no symbol should be popped. */
1208 int yylen = 0;
1209
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001210 yyssp = yyss = yyssa;
1211 yyvsp = yyvs = yyvsa;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001212 yystacksize = YYINITDEPTH;
1213
1214 YYDPRINTF ((stderr, "Starting parse\n"));
1215
1216 yystate = 0;
1217 yyerrstatus = 0;
1218 yynerrs = 0;
1219 yychar = YYEMPTY; /* Cause a token to be read. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001220 goto yysetstate;
1221
Nico Huberd9b2f792020-04-28 16:28:03 +02001222
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001223/*------------------------------------------------------------.
Nico Huberd9b2f792020-04-28 16:28:03 +02001224| yynewstate -- push a new state, which is found in yystate. |
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001225`------------------------------------------------------------*/
Nico Huberd9b2f792020-04-28 16:28:03 +02001226yynewstate:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001227 /* In all cases, when you get here, the value and location stacks
1228 have just been pushed. So pushing a state here evens the stacks. */
1229 yyssp++;
1230
Nico Huberd9b2f792020-04-28 16:28:03 +02001231
1232/*--------------------------------------------------------------------.
1233| yysetstate -- set current state (the top of the stack) to yystate. |
1234`--------------------------------------------------------------------*/
1235yysetstate:
1236 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1237 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1238 YY_IGNORE_USELESS_CAST_BEGIN
1239 *yyssp = YY_CAST (yy_state_t, yystate);
1240 YY_IGNORE_USELESS_CAST_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001241
1242 if (yyss + yystacksize - 1 <= yyssp)
Nico Huberd9b2f792020-04-28 16:28:03 +02001243#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1244 goto yyexhaustedlab;
1245#else
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001246 {
1247 /* Get the current used size of the three stacks, in elements. */
Nico Huberd9b2f792020-04-28 16:28:03 +02001248 YYPTRDIFF_T yysize = yyssp - yyss + 1;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001249
Nico Huberd9b2f792020-04-28 16:28:03 +02001250# if defined yyoverflow
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001251 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001252 /* Give user a chance to reallocate the stack. Use copies of
1253 these so that the &'s don't force the real ones into
1254 memory. */
Nico Huberd9b2f792020-04-28 16:28:03 +02001255 yy_state_t *yyss1 = yyss;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001256 YYSTYPE *yyvs1 = yyvs;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001257
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001258 /* Each stack pointer address is followed by the size of the
1259 data in use in that stack, in bytes. This used to be a
1260 conditional around just the two extra args, but that might
1261 be undefined if yyoverflow is a macro. */
1262 yyoverflow (YY_("memory exhausted"),
Nico Huberd9b2f792020-04-28 16:28:03 +02001263 &yyss1, yysize * YYSIZEOF (*yyssp),
1264 &yyvs1, yysize * YYSIZEOF (*yyvsp),
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001265 &yystacksize);
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001266 yyss = yyss1;
1267 yyvs = yyvs1;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001268 }
Nico Huberd9b2f792020-04-28 16:28:03 +02001269# else /* defined YYSTACK_RELOCATE */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001270 /* Extend the stack our own way. */
1271 if (YYMAXDEPTH <= yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001272 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001273 yystacksize *= 2;
1274 if (YYMAXDEPTH < yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001275 yystacksize = YYMAXDEPTH;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001276
1277 {
Nico Huberd9b2f792020-04-28 16:28:03 +02001278 yy_state_t *yyss1 = yyss;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001279 union yyalloc *yyptr =
Nico Huberd9b2f792020-04-28 16:28:03 +02001280 YY_CAST (union yyalloc *,
1281 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001282 if (! yyptr)
1283 goto yyexhaustedlab;
1284 YYSTACK_RELOCATE (yyss_alloc, yyss);
1285 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Nico Huberd9b2f792020-04-28 16:28:03 +02001286# undef YYSTACK_RELOCATE
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001287 if (yyss1 != yyssa)
1288 YYSTACK_FREE (yyss1);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001289 }
1290# endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001291
1292 yyssp = yyss + yysize - 1;
1293 yyvsp = yyvs + yysize - 1;
1294
Nico Huberd9b2f792020-04-28 16:28:03 +02001295 YY_IGNORE_USELESS_CAST_BEGIN
1296 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1297 YY_CAST (long, yystacksize)));
1298 YY_IGNORE_USELESS_CAST_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001299
1300 if (yyss + yystacksize - 1 <= yyssp)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001301 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001302 }
Nico Huberd9b2f792020-04-28 16:28:03 +02001303#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001304
1305 if (yystate == YYFINAL)
1306 YYACCEPT;
1307
1308 goto yybackup;
1309
Nico Huberd9b2f792020-04-28 16:28:03 +02001310
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001311/*-----------.
1312| yybackup. |
1313`-----------*/
1314yybackup:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001315 /* Do appropriate processing given the current state. Read a
1316 lookahead token if we need one and don't already have one. */
1317
1318 /* First try to decide what to do without reference to lookahead token. */
1319 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001320 if (yypact_value_is_default (yyn))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001321 goto yydefault;
1322
1323 /* Not known => get a lookahead token if don't already have one. */
1324
1325 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1326 if (yychar == YYEMPTY)
1327 {
1328 YYDPRINTF ((stderr, "Reading a token: "));
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001329 yychar = yylex ();
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001330 }
1331
1332 if (yychar <= YYEOF)
1333 {
1334 yychar = yytoken = YYEOF;
1335 YYDPRINTF ((stderr, "Now at end of input.\n"));
1336 }
1337 else
1338 {
1339 yytoken = YYTRANSLATE (yychar);
1340 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1341 }
1342
1343 /* If the proper action on seeing token YYTOKEN is to reduce or to
1344 detect an error, take that action. */
1345 yyn += yytoken;
1346 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1347 goto yydefault;
1348 yyn = yytable[yyn];
1349 if (yyn <= 0)
1350 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001351 if (yytable_value_is_error (yyn))
1352 goto yyerrlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001353 yyn = -yyn;
1354 goto yyreduce;
1355 }
1356
1357 /* Count tokens shifted since error; after three, turn off error
1358 status. */
1359 if (yyerrstatus)
1360 yyerrstatus--;
1361
1362 /* Shift the lookahead token. */
1363 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001364 yystate = yyn;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001365 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001366 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001367 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001368
Nico Huberd9b2f792020-04-28 16:28:03 +02001369 /* Discard the shifted token. */
1370 yychar = YYEMPTY;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001371 goto yynewstate;
1372
1373
1374/*-----------------------------------------------------------.
1375| yydefault -- do the default action for the current state. |
1376`-----------------------------------------------------------*/
1377yydefault:
1378 yyn = yydefact[yystate];
1379 if (yyn == 0)
1380 goto yyerrlab;
1381 goto yyreduce;
1382
1383
1384/*-----------------------------.
Nico Huberd9b2f792020-04-28 16:28:03 +02001385| yyreduce -- do a reduction. |
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001386`-----------------------------*/
1387yyreduce:
1388 /* yyn is the number of a rule to reduce with. */
1389 yylen = yyr2[yyn];
1390
1391 /* If YYLEN is nonzero, implement the default value of the action:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001392 '$$ = $1'.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001393
1394 Otherwise, the following line sets YYVAL to garbage.
1395 This behavior is undocumented and Bison
1396 users should not rely upon it. Assigning to YYVAL
1397 unconditionally makes the parser a bit smaller, and it avoids a
1398 GCC warning that YYVAL may be used uninitialized. */
1399 yyval = yyvsp[1-yylen];
1400
1401
1402 YY_REDUCE_PRINT (yyn);
1403 switch (yyn)
1404 {
Nico Huberd9b2f792020-04-28 16:28:03 +02001405 case 2:
1406 { cur_parent = root_parent; }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001407 break;
1408
Duncan Laurie47b7b342020-05-15 15:39:08 -07001409 case 18:
Nico Huberd9b2f792020-04-28 16:28:03 +02001410 {
Furquan Shaikhc56ae2f2018-05-31 10:33:16 -07001411 (yyval.chip_instance) = new_chip_instance((yyvsp[0].string));
1412 chip_enqueue_tail(cur_chip_instance);
1413 cur_chip_instance = (yyval.chip_instance);
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001414}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001415 break;
1416
Duncan Laurie47b7b342020-05-15 15:39:08 -07001417 case 19:
Nico Huberd9b2f792020-04-28 16:28:03 +02001418 {
1419 cur_chip_instance = chip_dequeue_tail();
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001420}
1421 break;
1422
Duncan Laurie47b7b342020-05-15 15:39:08 -07001423 case 20:
Nico Huberd9b2f792020-04-28 16:28:03 +02001424 {
1425 (yyval.dev) = new_device(cur_parent, cur_chip_instance, (yyvsp[-2].number), (yyvsp[-1].string), (yyvsp[0].number));
1426 cur_parent = (yyval.dev)->last_bus;
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001427}
Patrick Georgi68befd52010-05-05 12:05:25 +00001428 break;
1429
Duncan Laurie47b7b342020-05-15 15:39:08 -07001430 case 21:
Nico Huberd9b2f792020-04-28 16:28:03 +02001431 {
1432 cur_parent = (yyvsp[-2].dev)->parent;
1433}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001434 break;
1435
Duncan Laurie47b7b342020-05-15 15:39:08 -07001436 case 24:
Nico Huberd9b2f792020-04-28 16:28:03 +02001437 { add_resource(cur_parent, (yyvsp[-3].number), strtol((yyvsp[-2].string), NULL, 0), strtol((yyvsp[0].string), NULL, 0)); }
Sven Schnelle270a9082011-03-01 19:58:15 +00001438 break;
1439
Duncan Laurie47b7b342020-05-15 15:39:08 -07001440 case 25:
Nico Huberd9b2f792020-04-28 16:28:03 +02001441 { add_register(cur_chip_instance, (yyvsp[-2].string), (yyvsp[0].string)); }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001442 break;
1443
Duncan Laurie47b7b342020-05-15 15:39:08 -07001444 case 26:
Nico Huberd9b2f792020-04-28 16:28:03 +02001445 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-1].string), NULL, 16), strtol((yyvsp[0].string), NULL, 16), 0); }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001446 break;
1447
Duncan Laurie47b7b342020-05-15 15:39:08 -07001448 case 27:
Nico Huberd9b2f792020-04-28 16:28:03 +02001449 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-2].string), NULL, 16), strtol((yyvsp[-1].string), NULL, 16), 1); }
Sven Schnelle270a9082011-03-01 19:58:15 +00001450 break;
1451
Duncan Laurie47b7b342020-05-15 15:39:08 -07001452 case 28:
Nico Huberd9b2f792020-04-28 16:28:03 +02001453 { add_ioapic_info(cur_parent, strtol((yyvsp[-2].string), NULL, 16), (yyvsp[-1].string), strtol((yyvsp[0].string), NULL, 16)); }
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001454 break;
1455
Duncan Laurie47b7b342020-05-15 15:39:08 -07001456 case 29:
Nico Huberd9b2f792020-04-28 16:28:03 +02001457 { add_slot_desc(cur_parent, (yyvsp[-3].string), (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].string)); }
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001458 break;
1459
Duncan Laurie47b7b342020-05-15 15:39:08 -07001460 case 30:
Nico Huberd9b2f792020-04-28 16:28:03 +02001461 { add_slot_desc(cur_parent, (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].string), NULL); }
1462 break;
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001463
Duncan Laurie47b7b342020-05-15 15:39:08 -07001464 case 31:
Nico Huberd9b2f792020-04-28 16:28:03 +02001465 { add_slot_desc(cur_parent, (yyvsp[-1].string), (yyvsp[0].string), NULL, NULL); }
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001466 break;
1467
Duncan Laurie47b7b342020-05-15 15:39:08 -07001468 case 32:
1469 { }
1470 break;
1471
1472 case 37:
1473 {
1474 cur_field = new_fw_config_field((yyvsp[-2].string), strtoul((yyvsp[-1].string), NULL, 0), strtoul((yyvsp[0].string), NULL, 0));
1475}
1476 break;
1477
1478 case 38:
1479 { }
1480 break;
1481
1482 case 39:
1483 {
1484 cur_field = new_fw_config_field((yyvsp[-1].string), strtoul((yyvsp[0].string), NULL, 0), strtoul((yyvsp[0].string), NULL, 0));
1485}
1486 break;
1487
1488 case 40:
1489 { }
1490 break;
1491
1492 case 41:
1493 {
1494 cur_field = get_fw_config_field((yyvsp[0].string));
1495}
1496 break;
1497
1498 case 42:
1499 { }
1500 break;
1501
1502 case 43:
1503 { add_fw_config_option(cur_field, (yyvsp[-1].string), strtoul((yyvsp[0].string), NULL, 0)); }
1504 break;
1505
1506 case 44:
1507 { add_fw_config_probe(cur_parent, (yyvsp[-1].string), (yyvsp[0].string)); }
1508 break;
1509
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001510
1511
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001512 default: break;
1513 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001514 /* User semantic actions sometimes alter yychar, and that requires
1515 that yytoken be updated with the new translation. We take the
1516 approach of translating immediately before every use of yytoken.
1517 One alternative is translating here after every semantic action,
1518 but that translation would be missed if the semantic action invokes
1519 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1520 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1521 incorrect destructor might then be invoked immediately. In the
1522 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1523 to an incorrect destructor call or verbose syntax error message
1524 before the lookahead is translated. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001525 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1526
1527 YYPOPSTACK (yylen);
1528 yylen = 0;
1529 YY_STACK_PRINT (yyss, yyssp);
1530
1531 *++yyvsp = yyval;
1532
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001533 /* Now 'shift' the result of the reduction. Determine what state
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001534 that goes to, based on the state we popped back to and the rule
1535 number reduced by. */
Nico Huberd9b2f792020-04-28 16:28:03 +02001536 {
1537 const int yylhs = yyr1[yyn] - YYNTOKENS;
1538 const int yyi = yypgoto[yylhs] + *yyssp;
1539 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1540 ? yytable[yyi]
1541 : yydefgoto[yylhs]);
1542 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001543
1544 goto yynewstate;
1545
1546
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001547/*--------------------------------------.
1548| yyerrlab -- here on detecting error. |
1549`--------------------------------------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001550yyerrlab:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001551 /* Make sure we have latest lookahead translation. See comments at
1552 user semantic actions for why this is necessary. */
1553 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1554
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001555 /* If not already recovering from an error, report this error. */
1556 if (!yyerrstatus)
1557 {
1558 ++yynerrs;
1559#if ! YYERROR_VERBOSE
1560 yyerror (YY_("syntax error"));
1561#else
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001562# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1563 yyssp, yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001564 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001565 char const *yymsgp = YY_("syntax error");
1566 int yysyntax_error_status;
1567 yysyntax_error_status = YYSYNTAX_ERROR;
1568 if (yysyntax_error_status == 0)
1569 yymsgp = yymsg;
1570 else if (yysyntax_error_status == 1)
1571 {
1572 if (yymsg != yymsgbuf)
1573 YYSTACK_FREE (yymsg);
Nico Huberd9b2f792020-04-28 16:28:03 +02001574 yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001575 if (!yymsg)
1576 {
1577 yymsg = yymsgbuf;
1578 yymsg_alloc = sizeof yymsgbuf;
1579 yysyntax_error_status = 2;
1580 }
1581 else
1582 {
1583 yysyntax_error_status = YYSYNTAX_ERROR;
1584 yymsgp = yymsg;
1585 }
1586 }
1587 yyerror (yymsgp);
1588 if (yysyntax_error_status == 2)
1589 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001590 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001591# undef YYSYNTAX_ERROR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001592#endif
1593 }
1594
1595
1596
1597 if (yyerrstatus == 3)
1598 {
1599 /* If just tried and failed to reuse lookahead token after an
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001600 error, discard it. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001601
1602 if (yychar <= YYEOF)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001603 {
1604 /* Return failure if at end of input. */
1605 if (yychar == YYEOF)
1606 YYABORT;
1607 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001608 else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001609 {
1610 yydestruct ("Error: discarding",
1611 yytoken, &yylval);
1612 yychar = YYEMPTY;
1613 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001614 }
1615
1616 /* Else will try to reuse lookahead token after shifting the error
1617 token. */
1618 goto yyerrlab1;
1619
1620
1621/*---------------------------------------------------.
1622| yyerrorlab -- error raised explicitly by YYERROR. |
1623`---------------------------------------------------*/
1624yyerrorlab:
Nico Huberd9b2f792020-04-28 16:28:03 +02001625 /* Pacify compilers when the user code never invokes YYERROR and the
1626 label yyerrorlab therefore never appears in user code. */
1627 if (0)
1628 YYERROR;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001629
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001630 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001631 this YYERROR. */
1632 YYPOPSTACK (yylen);
1633 yylen = 0;
1634 YY_STACK_PRINT (yyss, yyssp);
1635 yystate = *yyssp;
1636 goto yyerrlab1;
1637
1638
1639/*-------------------------------------------------------------.
1640| yyerrlab1 -- common code for both syntax error and YYERROR. |
1641`-------------------------------------------------------------*/
1642yyerrlab1:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001643 yyerrstatus = 3; /* Each real token shifted decrements this. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001644
1645 for (;;)
1646 {
1647 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001648 if (!yypact_value_is_default (yyn))
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001649 {
1650 yyn += YYTERROR;
1651 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1652 {
1653 yyn = yytable[yyn];
1654 if (0 < yyn)
1655 break;
1656 }
1657 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001658
1659 /* Pop the current state because it cannot handle the error token. */
1660 if (yyssp == yyss)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001661 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001662
1663
1664 yydestruct ("Error: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001665 yystos[yystate], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001666 YYPOPSTACK (1);
1667 yystate = *yyssp;
1668 YY_STACK_PRINT (yyss, yyssp);
1669 }
1670
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001671 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001672 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001673 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001674
1675
1676 /* Shift the error token. */
1677 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1678
1679 yystate = yyn;
1680 goto yynewstate;
1681
1682
1683/*-------------------------------------.
1684| yyacceptlab -- YYACCEPT comes here. |
1685`-------------------------------------*/
1686yyacceptlab:
1687 yyresult = 0;
1688 goto yyreturn;
1689
Nico Huberd9b2f792020-04-28 16:28:03 +02001690
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001691/*-----------------------------------.
1692| yyabortlab -- YYABORT comes here. |
1693`-----------------------------------*/
1694yyabortlab:
1695 yyresult = 1;
1696 goto yyreturn;
1697
Nico Huberd9b2f792020-04-28 16:28:03 +02001698
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001699#if !defined yyoverflow || YYERROR_VERBOSE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001700/*-------------------------------------------------.
1701| yyexhaustedlab -- memory exhaustion comes here. |
1702`-------------------------------------------------*/
1703yyexhaustedlab:
1704 yyerror (YY_("memory exhausted"));
1705 yyresult = 2;
1706 /* Fall through. */
1707#endif
1708
Nico Huberd9b2f792020-04-28 16:28:03 +02001709
1710/*-----------------------------------------------------.
1711| yyreturn -- parsing is finished, return the result. |
1712`-----------------------------------------------------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001713yyreturn:
1714 if (yychar != YYEMPTY)
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001715 {
1716 /* Make sure we have latest lookahead translation. See comments at
1717 user semantic actions for why this is necessary. */
1718 yytoken = YYTRANSLATE (yychar);
1719 yydestruct ("Cleanup: discarding lookahead",
1720 yytoken, &yylval);
1721 }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001722 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001723 this YYABORT or YYACCEPT. */
1724 YYPOPSTACK (yylen);
1725 YY_STACK_PRINT (yyss, yyssp);
1726 while (yyssp != yyss)
1727 {
1728 yydestruct ("Cleanup: popping",
Nico Huberd9b2f792020-04-28 16:28:03 +02001729 yystos[+*yyssp], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001730 YYPOPSTACK (1);
1731 }
1732#ifndef yyoverflow
1733 if (yyss != yyssa)
1734 YYSTACK_FREE (yyss);
1735#endif
1736#if YYERROR_VERBOSE
1737 if (yymsg != yymsgbuf)
1738 YYSTACK_FREE (yymsg);
1739#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001740 return yyresult;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001741}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001742