blob: 52bb79cbfc259a54c04b8a23c817814be90fdc58 [file] [log] [blame]
Nico Huber8e1ea522020-06-03 10:20:07 -07001/* A Bison parser, made by GNU Bison 3.5.3. */
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. */
Nico Huber8e1ea522020-06-03 10:20:07 -070051#define YYBISON_VERSION "3.5.3"
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,
Nico Huber8e1ea522020-06-03 10:20:07 -0700133 ALIAS = 261,
134 REFERENCE = 262,
135 ASSOCIATION = 263,
136 BOOL = 264,
137 STATUS = 265,
138 MANDATORY = 266,
139 BUS = 267,
140 RESOURCE = 268,
141 END = 269,
142 EQUALS = 270,
143 HEX = 271,
144 STRING = 272,
145 PCI = 273,
146 PNP = 274,
147 I2C = 275,
148 APIC = 276,
149 CPU_CLUSTER = 277,
150 CPU = 278,
151 DOMAIN = 279,
152 IRQ = 280,
153 DRQ = 281,
154 SLOT_DESC = 282,
155 IO = 283,
156 NUMBER = 284,
157 SUBSYSTEMID = 285,
158 INHERIT = 286,
159 IOAPIC_IRQ = 287,
160 IOAPIC = 288,
161 PCIINT = 289,
162 GENERIC = 290,
163 SPI = 291,
164 USB = 292,
165 MMIO = 293,
166 LPC = 294,
167 ESPI = 295,
168 FW_CONFIG_TABLE = 296,
169 FW_CONFIG_FIELD = 297,
170 FW_CONFIG_OPTION = 298,
171 FW_CONFIG_PROBE = 299
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700172 };
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000173#endif
174
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700175/* Value type. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000176#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700177union YYSTYPE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000178{
179
Furquan Shaikh93198262018-06-03 04:22:17 -0700180 struct device *dev;
Furquan Shaikhc56ae2f2018-05-31 10:33:16 -0700181 struct chip_instance *chip_instance;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000182 char *string;
183 int number;
184
185
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700186};
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700187typedef union YYSTYPE YYSTYPE;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000188# define YYSTYPE_IS_TRIVIAL 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000189# define YYSTYPE_IS_DECLARED 1
190#endif
191
192
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700193extern YYSTYPE yylval;
194
195int yyparse (void);
196
Duncan Laurie47b7b342020-05-15 15:39:08 -0700197#endif /* !YY_YY_SRC_COREBOOT_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000198
199
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000200
201#ifdef short
202# undef short
203#endif
204
Nico Huberd9b2f792020-04-28 16:28:03 +0200205/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
206 <limits.h> and (if available) <stdint.h> are included
207 so that the code can choose integer types of a good width. */
208
209#ifndef __PTRDIFF_MAX__
210# include <limits.h> /* INFRINGES ON USER NAME SPACE */
211# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
212# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
213# define YY_STDINT_H
214# endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000215#endif
216
Nico Huberd9b2f792020-04-28 16:28:03 +0200217/* Narrow types that promote to a signed type and that can represent a
218 signed or unsigned integer of at least N bits. In tables they can
219 save space and decrease cache pressure. Promoting to a signed type
220 helps avoid bugs in integer arithmetic. */
221
222#ifdef __INT_LEAST8_MAX__
223typedef __INT_LEAST8_TYPE__ yytype_int8;
224#elif defined YY_STDINT_H
225typedef int_least8_t yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000226#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700227typedef signed char yytype_int8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000228#endif
229
Nico Huberd9b2f792020-04-28 16:28:03 +0200230#ifdef __INT_LEAST16_MAX__
231typedef __INT_LEAST16_TYPE__ yytype_int16;
232#elif defined YY_STDINT_H
233typedef int_least16_t yytype_int16;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000234#else
Nico Huberd9b2f792020-04-28 16:28:03 +0200235typedef short yytype_int16;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000236#endif
237
Nico Huberd9b2f792020-04-28 16:28:03 +0200238#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
239typedef __UINT_LEAST8_TYPE__ yytype_uint8;
240#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
241 && UINT_LEAST8_MAX <= INT_MAX)
242typedef uint_least8_t yytype_uint8;
243#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
244typedef unsigned char yytype_uint8;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000245#else
Nico Huberd9b2f792020-04-28 16:28:03 +0200246typedef short yytype_uint8;
247#endif
248
249#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
250typedef __UINT_LEAST16_TYPE__ yytype_uint16;
251#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
252 && UINT_LEAST16_MAX <= INT_MAX)
253typedef uint_least16_t yytype_uint16;
254#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
255typedef unsigned short yytype_uint16;
256#else
257typedef int yytype_uint16;
258#endif
259
260#ifndef YYPTRDIFF_T
261# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
262# define YYPTRDIFF_T __PTRDIFF_TYPE__
263# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
264# elif defined PTRDIFF_MAX
265# ifndef ptrdiff_t
266# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
267# endif
268# define YYPTRDIFF_T ptrdiff_t
269# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
270# else
271# define YYPTRDIFF_T long
272# define YYPTRDIFF_MAXIMUM LONG_MAX
273# endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000274#endif
275
276#ifndef YYSIZE_T
277# ifdef __SIZE_TYPE__
278# define YYSIZE_T __SIZE_TYPE__
279# elif defined size_t
280# define YYSIZE_T size_t
Nico Huberd9b2f792020-04-28 16:28:03 +0200281# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000282# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
283# define YYSIZE_T size_t
284# else
Nico Huberd9b2f792020-04-28 16:28:03 +0200285# define YYSIZE_T unsigned
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000286# endif
287#endif
288
Nico Huberd9b2f792020-04-28 16:28:03 +0200289#define YYSIZE_MAXIMUM \
290 YY_CAST (YYPTRDIFF_T, \
291 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
292 ? YYPTRDIFF_MAXIMUM \
293 : YY_CAST (YYSIZE_T, -1)))
294
295#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
296
297/* Stored state numbers (used for stacks). */
298typedef yytype_int8 yy_state_t;
299
300/* State numbers in computations. */
301typedef int yy_state_fast_t;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000302
303#ifndef YY_
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200304# if defined YYENABLE_NLS && YYENABLE_NLS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000305# if ENABLE_NLS
306# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700307# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000308# endif
309# endif
310# ifndef YY_
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700311# define YY_(Msgid) Msgid
312# endif
313#endif
314
Nico Huberd9b2f792020-04-28 16:28:03 +0200315#ifndef YY_ATTRIBUTE_PURE
316# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
317# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700318# else
Nico Huberd9b2f792020-04-28 16:28:03 +0200319# define YY_ATTRIBUTE_PURE
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700320# endif
321#endif
322
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700323#ifndef YY_ATTRIBUTE_UNUSED
Nico Huberd9b2f792020-04-28 16:28:03 +0200324# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
325# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700326# else
Nico Huberd9b2f792020-04-28 16:28:03 +0200327# define YY_ATTRIBUTE_UNUSED
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000328# endif
329#endif
330
331/* Suppress unused-variable warnings by "using" E. */
332#if ! defined lint || defined __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700333# define YYUSE(E) ((void) (E))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000334#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700335# define YYUSE(E) /* empty */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000336#endif
337
Nico Huberd9b2f792020-04-28 16:28:03 +0200338#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700339/* Suppress an incorrect diagnostic about yylval being uninitialized. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200340# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
341 _Pragma ("GCC diagnostic push") \
342 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700343 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
Nico Huberd9b2f792020-04-28 16:28:03 +0200344# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700345 _Pragma ("GCC diagnostic pop")
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000346#else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700347# define YY_INITIAL_VALUE(Value) Value
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000348#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700349#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
350# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
351# define YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000352#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700353#ifndef YY_INITIAL_VALUE
354# define YY_INITIAL_VALUE(Value) /* Nothing. */
355#endif
356
Nico Huberd9b2f792020-04-28 16:28:03 +0200357#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
358# define YY_IGNORE_USELESS_CAST_BEGIN \
359 _Pragma ("GCC diagnostic push") \
360 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
361# define YY_IGNORE_USELESS_CAST_END \
362 _Pragma ("GCC diagnostic pop")
363#endif
364#ifndef YY_IGNORE_USELESS_CAST_BEGIN
365# define YY_IGNORE_USELESS_CAST_BEGIN
366# define YY_IGNORE_USELESS_CAST_END
367#endif
368
369
370#define YY_ASSERT(E) ((void) (0 && (E)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000371
372#if ! defined yyoverflow || YYERROR_VERBOSE
373
374/* The parser invokes alloca or malloc; define the necessary symbols. */
375
376# ifdef YYSTACK_USE_ALLOCA
377# if YYSTACK_USE_ALLOCA
378# ifdef __GNUC__
379# define YYSTACK_ALLOC __builtin_alloca
380# elif defined __BUILTIN_VA_ARG_INCR
381# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
382# elif defined _AIX
383# define YYSTACK_ALLOC __alloca
384# elif defined _MSC_VER
385# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
386# define alloca _alloca
387# else
388# define YYSTACK_ALLOC alloca
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700389# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000390# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700391 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200392# ifndef EXIT_SUCCESS
393# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000394# endif
395# endif
396# endif
397# endif
398# endif
399
400# ifdef YYSTACK_ALLOC
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700401 /* Pacify GCC's 'empty if-body' warning. */
402# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000403# ifndef YYSTACK_ALLOC_MAXIMUM
404 /* The OS might guarantee only one guard page at the bottom of the stack,
405 and a page size can be as small as 4096 bytes. So we cannot safely
406 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
407 to allow for a few compiler-allocated temporary stack slots. */
408# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
409# endif
410# else
411# define YYSTACK_ALLOC YYMALLOC
412# define YYSTACK_FREE YYFREE
413# ifndef YYSTACK_ALLOC_MAXIMUM
414# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
415# endif
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200416# if (defined __cplusplus && ! defined EXIT_SUCCESS \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000417 && ! ((defined YYMALLOC || defined malloc) \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700418 && (defined YYFREE || defined free)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000419# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200420# ifndef EXIT_SUCCESS
421# define EXIT_SUCCESS 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000422# endif
423# endif
424# ifndef YYMALLOC
425# define YYMALLOC malloc
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700426# if ! defined malloc && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000427void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
428# endif
429# endif
430# ifndef YYFREE
431# define YYFREE free
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700432# if ! defined free && ! defined EXIT_SUCCESS
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000433void free (void *); /* INFRINGES ON USER NAME SPACE */
434# endif
435# endif
436# endif
437#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
438
439
440#if (! defined yyoverflow \
441 && (! defined __cplusplus \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700442 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000443
444/* A type that is properly aligned for any stack member. */
445union yyalloc
446{
Nico Huberd9b2f792020-04-28 16:28:03 +0200447 yy_state_t yyss_alloc;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000448 YYSTYPE yyvs_alloc;
449};
450
451/* The size of the maximum gap between one aligned stack and the next. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200452# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000453
454/* The size of an array large to enough to hold all stacks, each with
455 N elements. */
456# define YYSTACK_BYTES(N) \
Nico Huberd9b2f792020-04-28 16:28:03 +0200457 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000458 + YYSTACK_GAP_MAXIMUM)
459
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200460# define YYCOPY_NEEDED 1
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000461
462/* Relocate STACK from its old location to the new one. The
463 local variables YYSIZE and YYSTACKSIZE give the old and new number of
464 elements in the stack, and YYPTR gives the new location of the
465 stack. Advance YYPTR to a properly aligned location for the next
466 stack. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700467# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
468 do \
469 { \
Nico Huberd9b2f792020-04-28 16:28:03 +0200470 YYPTRDIFF_T yynewbytes; \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700471 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
472 Stack = &yyptr->Stack_alloc; \
Nico Huberd9b2f792020-04-28 16:28:03 +0200473 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
474 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700475 } \
476 while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000477
478#endif
479
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200480#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700481/* Copy COUNT objects from SRC to DST. The source and destination do
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200482 not overlap. */
483# ifndef YYCOPY
484# if defined __GNUC__ && 1 < __GNUC__
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700485# define YYCOPY(Dst, Src, Count) \
Nico Huberd9b2f792020-04-28 16:28:03 +0200486 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200487# else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700488# define YYCOPY(Dst, Src, Count) \
489 do \
490 { \
Nico Huberd9b2f792020-04-28 16:28:03 +0200491 YYPTRDIFF_T yyi; \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700492 for (yyi = 0; yyi < (Count); yyi++) \
493 (Dst)[yyi] = (Src)[yyi]; \
494 } \
495 while (0)
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200496# endif
497# endif
498#endif /* !YYCOPY_NEEDED */
499
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000500/* YYFINAL -- State number of the termination state. */
Duncan Laurie47b7b342020-05-15 15:39:08 -0700501#define YYFINAL 2
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000502/* YYLAST -- Last index in YYTABLE. */
Nico Huber8e1ea522020-06-03 10:20:07 -0700503#define YYLAST 64
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000504
505/* YYNTOKENS -- Number of terminals. */
Nico Huber8e1ea522020-06-03 10:20:07 -0700506#define YYNTOKENS 45
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000507/* YYNNTS -- Number of nonterminals. */
Nico Huber8e1ea522020-06-03 10:20:07 -0700508#define YYNNTS 25
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000509/* YYNRULES -- Number of rules. */
Nico Huber8e1ea522020-06-03 10:20:07 -0700510#define YYNRULES 48
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700511/* YYNSTATES -- Number of states. */
Nico Huber8e1ea522020-06-03 10:20:07 -0700512#define YYNSTATES 83
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000513
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000514#define YYUNDEFTOK 2
Nico Huber8e1ea522020-06-03 10:20:07 -0700515#define YYMAXUTOK 299
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000516
Nico Huberd9b2f792020-04-28 16:28:03 +0200517
518/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
519 as returned by yylex, with out-of-bounds checking. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700520#define YYTRANSLATE(YYX) \
Nico Huberd9b2f792020-04-28 16:28:03 +0200521 (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000522
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700523/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
Nico Huberd9b2f792020-04-28 16:28:03 +0200524 as returned by yylex. */
525static const yytype_int8 yytranslate[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000526{
527 0, 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, 2, 2, 2, 2,
550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
553 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200554 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
Ronald G. Minnich466ca2c2019-10-22 02:02:24 +0000555 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
Nico Huber8e1ea522020-06-03 10:20:07 -0700556 35, 36, 37, 38, 39, 40, 41, 42, 43, 44
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000557};
558
559#if YYDEBUG
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700560 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200561static const yytype_int8 yyrline[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000562{
Nico Huber8e1ea522020-06-03 10:20:07 -0700563 0, 24, 24, 24, 24, 26, 26, 26, 26, 26,
564 28, 28, 28, 28, 28, 28, 28, 28, 28, 30,
565 30, 39, 39, 47, 49, 53, 53, 55, 58, 61,
566 64, 67, 70, 73, 76, 79, 83, 86, 86, 89,
567 89, 92, 92, 98, 98, 104, 104, 110, 114
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000568};
569#endif
570
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700571#if YYDEBUG || YYERROR_VERBOSE || 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000572/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
573 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
574static const char *const yytname[] =
575{
Nico Huber8e1ea522020-06-03 10:20:07 -0700576 "$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "ALIAS",
577 "REFERENCE", "ASSOCIATION", "BOOL", "STATUS", "MANDATORY", "BUS",
578 "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI", "PNP", "I2C",
579 "APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ", "SLOT_DESC", "IO",
580 "NUMBER", "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IOAPIC", "PCIINT",
581 "GENERIC", "SPI", "USB", "MMIO", "LPC", "ESPI", "FW_CONFIG_TABLE",
582 "FW_CONFIG_FIELD", "FW_CONFIG_OPTION", "FW_CONFIG_PROBE", "$accept",
583 "devtree", "chipchildren", "devicechildren", "chip", "@1", "device",
584 "@2", "alias", "status", "resource", "reference", "registers",
585 "subsystemid", "ioapic_irq", "smbios_slot_desc", "fw_config_table",
586 "fw_config_table_children", "fw_config_field_children",
587 "fw_config_field", "$@3", "$@4", "$@5", "fw_config_option",
588 "fw_config_probe", YY_NULLPTR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000589};
590#endif
591
592# ifdef YYPRINT
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700593/* YYTOKNUM[NUM] -- (External) token number corresponding to the
594 (internal) symbol number NUM (which must be that of a token). */
Nico Huberd9b2f792020-04-28 16:28:03 +0200595static const yytype_int16 yytoknum[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000596{
597 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
598 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
Furquan Shaikhe6700292017-02-11 00:50:38 -0800599 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
Duncan Laurie47b7b342020-05-15 15:39:08 -0700600 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
Nico Huber8e1ea522020-06-03 10:20:07 -0700601 295, 296, 297, 298, 299
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000602};
603# endif
604
Nico Huber8e1ea522020-06-03 10:20:07 -0700605#define YYPACT_NINF (-21)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700606
Nico Huberd9b2f792020-04-28 16:28:03 +0200607#define yypact_value_is_default(Yyn) \
608 ((Yyn) == YYPACT_NINF)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700609
Nico Huberd9b2f792020-04-28 16:28:03 +0200610#define YYTABLE_NINF (-1)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700611
Nico Huberd9b2f792020-04-28 16:28:03 +0200612#define yytable_value_is_error(Yyn) \
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700613 0
614
615 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
616 STATE-NUM. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000617static const yytype_int8 yypact[] =
618{
Nico Huber8e1ea522020-06-03 10:20:07 -0700619 -21, 3, -21, -4, -21, -21, -21, -21, -2, -21,
620 -21, 4, -21, 11, -20, 14, 6, 13, -21, -21,
621 -21, -21, -21, -1, -21, 2, 17, 26, -21, -21,
622 -10, 29, 21, 22, -21, -7, -21, 25, -21, 30,
623 10, -21, -21, -6, -21, 19, -21, -21, -21, -21,
624 -21, -21, -21, -3, 20, -21, 33, 23, 24, 34,
625 -21, -21, -21, -21, -21, -21, -21, -21, 28, 37,
626 27, 12, 38, 31, 40, 32, 35, -21, -21, 41,
627 -21, -21, -21
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000628};
629
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700630 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
631 Performed when YYTABLE does not specify something else to do. Zero
632 means the default is an error. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200633static const yytype_int8 yydefact[] =
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700634{
Nico Huber8e1ea522020-06-03 10:20:07 -0700635 2, 0, 1, 0, 38, 3, 4, 19, 0, 9,
636 36, 0, 37, 0, 45, 0, 0, 0, 20, 6,
637 5, 8, 7, 43, 40, 0, 0, 0, 41, 40,
638 0, 23, 0, 0, 40, 0, 46, 0, 39, 0,
639 0, 29, 28, 0, 44, 0, 24, 25, 26, 21,
640 42, 47, 18, 0, 0, 22, 0, 0, 0, 0,
641 11, 10, 12, 16, 13, 14, 15, 17, 0, 0,
642 0, 0, 0, 0, 35, 30, 0, 48, 27, 34,
643 31, 32, 33
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700644};
645
646 /* YYPGOTO[NTERM-NUM]. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000647static const yytype_int8 yypgoto[] =
648{
Nico Huber8e1ea522020-06-03 10:20:07 -0700649 -21, -21, -21, -21, -8, -21, 8, -21, -21, -21,
650 -21, -21, 9, -21, -21, -21, -21, -21, -12, -21,
651 -21, -21, -21, -21, -21
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000652};
653
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700654 /* YYDEFGOTO[NTERM-NUM]. */
655static const yytype_int8 yydefgoto[] =
656{
Nico Huber8e1ea522020-06-03 10:20:07 -0700657 -1, 1, 13, 53, 5, 9, 20, 52, 40, 49,
658 62, 21, 22, 64, 65, 66, 6, 8, 30, 12,
659 34, 29, 24, 38, 67
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700660};
661
662 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
663 positive, shift that token. If negative, reduce the rule whose
664 number is the opposite. If YYTABLE_NINF, syntax error. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200665static const yytype_int8 yytable[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000666{
Nico Huber8e1ea522020-06-03 10:20:07 -0700667 3, 15, 16, 2, 36, 19, 3, 44, 50, 23,
668 54, 55, 10, 7, 3, 15, 16, 35, 17, 47,
669 48, 14, 43, 26, 56, 18, 25, 57, 28, 58,
670 27, 31, 32, 37, 33, 39, 37, 37, 41, 42,
671 11, 59, 45, 73, 4, 60, 76, 46, 51, 68,
672 69, 72, 70, 71, 74, 77, 75, 79, 82, 0,
673 78, 61, 63, 80, 81
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000674};
675
Patrick Georgi8f625f62010-05-05 13:13:47 +0000676static const yytype_int8 yycheck[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000677{
Nico Huber8e1ea522020-06-03 10:20:07 -0700678 3, 4, 5, 0, 14, 13, 3, 14, 14, 29,
679 13, 14, 14, 17, 3, 4, 5, 29, 7, 9,
680 10, 17, 34, 17, 27, 14, 12, 30, 29, 32,
681 17, 29, 15, 43, 8, 6, 43, 43, 17, 17,
682 42, 44, 17, 15, 41, 53, 34, 17, 29, 29,
683 17, 17, 29, 29, 17, 17, 29, 17, 17, -1,
684 29, 53, 53, 31, 29
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000685};
686
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700687 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
688 symbol of state STATE-NUM. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200689static const yytype_int8 yystos[] =
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000690{
Nico Huber8e1ea522020-06-03 10:20:07 -0700691 0, 46, 0, 3, 41, 49, 61, 17, 62, 50,
692 14, 42, 64, 47, 17, 4, 5, 7, 14, 49,
693 51, 56, 57, 29, 67, 12, 17, 17, 29, 66,
694 63, 29, 15, 8, 65, 63, 14, 43, 68, 6,
695 53, 17, 17, 63, 14, 17, 17, 9, 10, 54,
696 14, 29, 52, 48, 13, 14, 27, 30, 32, 44,
697 49, 51, 55, 57, 58, 59, 60, 69, 29, 17,
698 29, 29, 17, 15, 17, 29, 34, 17, 29, 17,
699 31, 29, 17
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000700};
701
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700702 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200703static const yytype_int8 yyr1[] =
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700704{
Nico Huber8e1ea522020-06-03 10:20:07 -0700705 0, 45, 46, 46, 46, 47, 47, 47, 47, 47,
706 48, 48, 48, 48, 48, 48, 48, 48, 48, 50,
707 49, 52, 51, 53, 53, 54, 54, 55, 56, 57,
708 58, 58, 59, 60, 60, 60, 61, 62, 62, 63,
709 63, 65, 64, 66, 64, 67, 64, 68, 69
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700710};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000711
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700712 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200713static const yytype_int8 yyr2[] =
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700714{
Nico Huber8e1ea522020-06-03 10:20:07 -0700715 0, 2, 0, 2, 2, 2, 2, 2, 2, 0,
716 2, 2, 2, 2, 2, 2, 2, 2, 0, 0,
717 5, 0, 8, 0, 2, 1, 1, 4, 4, 4,
718 3, 4, 4, 5, 4, 3, 3, 2, 0, 2,
719 0, 0, 7, 0, 6, 0, 5, 3, 3
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700720};
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000721
722
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700723#define yyerrok (yyerrstatus = 0)
724#define yyclearin (yychar = YYEMPTY)
725#define YYEMPTY (-2)
726#define YYEOF 0
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000727
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700728#define YYACCEPT goto yyacceptlab
729#define YYABORT goto yyabortlab
730#define YYERROR goto yyerrorlab
731
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000732
733#define YYRECOVERING() (!!yyerrstatus)
734
Nico Huberd9b2f792020-04-28 16:28:03 +0200735#define YYBACKUP(Token, Value) \
736 do \
737 if (yychar == YYEMPTY) \
738 { \
739 yychar = (Token); \
740 yylval = (Value); \
741 YYPOPSTACK (yylen); \
742 yystate = *yyssp; \
743 goto yybackup; \
744 } \
745 else \
746 { \
747 yyerror (YY_("syntax error: cannot back up")); \
748 YYERROR; \
749 } \
750 while (0)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700751
752/* Error token number */
753#define YYTERROR 1
754#define YYERRCODE 256
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000755
756
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000757
758/* Enable debugging if requested. */
759#if YYDEBUG
760
761# ifndef YYFPRINTF
762# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
763# define YYFPRINTF fprintf
764# endif
765
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700766# define YYDPRINTF(Args) \
767do { \
768 if (yydebug) \
769 YYFPRINTF Args; \
770} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000771
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700772/* This macro is provided for backward compatibility. */
773#ifndef YY_LOCATION_PRINT
774# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
775#endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000776
777
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700778# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
779do { \
780 if (yydebug) \
781 { \
782 YYFPRINTF (stderr, "%s ", Title); \
783 yy_symbol_print (stderr, \
784 Type, Value); \
785 YYFPRINTF (stderr, "\n"); \
786 } \
787} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000788
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700789
Nico Huberd9b2f792020-04-28 16:28:03 +0200790/*-----------------------------------.
791| Print this symbol's value on YYO. |
792`-----------------------------------*/
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700793
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000794static void
Nico Huberd9b2f792020-04-28 16:28:03 +0200795yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000796{
Nico Huberd9b2f792020-04-28 16:28:03 +0200797 FILE *yyoutput = yyo;
798 YYUSE (yyoutput);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000799 if (!yyvaluep)
800 return;
801# ifdef YYPRINT
802 if (yytype < YYNTOKENS)
Nico Huberd9b2f792020-04-28 16:28:03 +0200803 YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000804# endif
Nico Huberd9b2f792020-04-28 16:28:03 +0200805 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700806 YYUSE (yytype);
Nico Huberd9b2f792020-04-28 16:28:03 +0200807 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000808}
809
810
Nico Huberd9b2f792020-04-28 16:28:03 +0200811/*---------------------------.
812| Print this symbol on YYO. |
813`---------------------------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000814
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000815static void
Nico Huberd9b2f792020-04-28 16:28:03 +0200816yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000817{
Nico Huberd9b2f792020-04-28 16:28:03 +0200818 YYFPRINTF (yyo, "%s %s (",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700819 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000820
Nico Huberd9b2f792020-04-28 16:28:03 +0200821 yy_symbol_value_print (yyo, yytype, yyvaluep);
822 YYFPRINTF (yyo, ")");
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000823}
824
825/*------------------------------------------------------------------.
826| yy_stack_print -- Print the state stack from its BOTTOM up to its |
827| TOP (included). |
828`------------------------------------------------------------------*/
829
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000830static void
Nico Huberd9b2f792020-04-28 16:28:03 +0200831yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000832{
833 YYFPRINTF (stderr, "Stack now");
834 for (; yybottom <= yytop; yybottom++)
835 {
836 int yybot = *yybottom;
837 YYFPRINTF (stderr, " %d", yybot);
838 }
839 YYFPRINTF (stderr, "\n");
840}
841
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700842# define YY_STACK_PRINT(Bottom, Top) \
843do { \
844 if (yydebug) \
845 yy_stack_print ((Bottom), (Top)); \
846} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000847
848
849/*------------------------------------------------.
850| Report that the YYRULE is going to be reduced. |
851`------------------------------------------------*/
852
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000853static void
Nico Huberd9b2f792020-04-28 16:28:03 +0200854yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000855{
Nico Huberd9b2f792020-04-28 16:28:03 +0200856 int yylno = yyrline[yyrule];
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000857 int yynrhs = yyr2[yyrule];
858 int yyi;
Nico Huberd9b2f792020-04-28 16:28:03 +0200859 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700860 yyrule - 1, yylno);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000861 /* The symbols being reduced. */
862 for (yyi = 0; yyi < yynrhs; yyi++)
863 {
864 YYFPRINTF (stderr, " $%d = ", yyi + 1);
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700865 yy_symbol_print (stderr,
Nico Huberd9b2f792020-04-28 16:28:03 +0200866 yystos[+yyssp[yyi + 1 - yynrhs]],
867 &yyvsp[(yyi + 1) - (yynrhs)]
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700868 );
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000869 YYFPRINTF (stderr, "\n");
870 }
871}
872
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700873# define YY_REDUCE_PRINT(Rule) \
874do { \
875 if (yydebug) \
876 yy_reduce_print (yyssp, yyvsp, Rule); \
877} while (0)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000878
879/* Nonzero means print parse trace. It is left uninitialized so that
880 multiple parsers can coexist. */
881int yydebug;
882#else /* !YYDEBUG */
883# define YYDPRINTF(Args)
884# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
885# define YY_STACK_PRINT(Bottom, Top)
886# define YY_REDUCE_PRINT(Rule)
887#endif /* !YYDEBUG */
888
889
890/* YYINITDEPTH -- initial size of the parser's stacks. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700891#ifndef YYINITDEPTH
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000892# define YYINITDEPTH 200
893#endif
894
895/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
896 if the built-in stack extension method is used).
897
898 Do not make this value too large; the results are undefined if
899 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
900 evaluated with infinite-precision integer arithmetic. */
901
902#ifndef YYMAXDEPTH
903# define YYMAXDEPTH 10000
904#endif
905
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000906
907#if YYERROR_VERBOSE
908
909# ifndef yystrlen
910# if defined __GLIBC__ && defined _STRING_H
Nico Huberd9b2f792020-04-28 16:28:03 +0200911# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000912# else
913/* Return the length of YYSTR. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200914static YYPTRDIFF_T
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000915yystrlen (const char *yystr)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000916{
Nico Huberd9b2f792020-04-28 16:28:03 +0200917 YYPTRDIFF_T yylen;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000918 for (yylen = 0; yystr[yylen]; yylen++)
919 continue;
920 return yylen;
921}
922# endif
923# endif
924
925# ifndef yystpcpy
926# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
927# define yystpcpy stpcpy
928# else
929/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
930 YYDEST. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000931static char *
932yystpcpy (char *yydest, const char *yysrc)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000933{
934 char *yyd = yydest;
935 const char *yys = yysrc;
936
937 while ((*yyd++ = *yys++) != '\0')
938 continue;
939
940 return yyd - 1;
941}
942# endif
943# endif
944
945# ifndef yytnamerr
946/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
947 quotes and backslashes, so that it's suitable for yyerror. The
948 heuristic is that double-quoting is unnecessary unless the string
949 contains an apostrophe, a comma, or backslash (other than
950 backslash-backslash). YYSTR is taken from yytname. If YYRES is
951 null, do not copy; instead, return the length of what the result
952 would have been. */
Nico Huberd9b2f792020-04-28 16:28:03 +0200953static YYPTRDIFF_T
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000954yytnamerr (char *yyres, const char *yystr)
955{
956 if (*yystr == '"')
957 {
Nico Huberd9b2f792020-04-28 16:28:03 +0200958 YYPTRDIFF_T yyn = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000959 char const *yyp = yystr;
960
961 for (;;)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700962 switch (*++yyp)
963 {
964 case '\'':
965 case ',':
966 goto do_not_strip_quotes;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000967
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700968 case '\\':
969 if (*++yyp != '\\')
970 goto do_not_strip_quotes;
Nico Huberd9b2f792020-04-28 16:28:03 +0200971 else
972 goto append;
973
974 append:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700975 default:
976 if (yyres)
977 yyres[yyn] = *yyp;
978 yyn++;
979 break;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000980
Stefan Reinauer2e78aa52016-05-07 01:11:14 -0700981 case '"':
982 if (yyres)
983 yyres[yyn] = '\0';
984 return yyn;
985 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000986 do_not_strip_quotes: ;
987 }
988
Nico Huberd9b2f792020-04-28 16:28:03 +0200989 if (yyres)
990 return yystpcpy (yyres, yystr) - yyres;
991 else
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000992 return yystrlen (yystr);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +0000993}
994# endif
995
Sven Schnelle0fa50a12012-06-21 22:19:48 +0200996/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
997 about the unexpected token YYTOKEN for the state stack whose top is
998 YYSSP.
999
1000 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1001 not large enough to hold the message. In that case, also set
1002 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1003 required number of bytes is too large to store. */
1004static int
Nico Huberd9b2f792020-04-28 16:28:03 +02001005yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1006 yy_state_t *yyssp, int yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001007{
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001008 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1009 /* Internationalized format string. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001010 const char *yyformat = YY_NULLPTR;
Nico Huberd9b2f792020-04-28 16:28:03 +02001011 /* Arguments of yyformat: reported tokens (one for the "unexpected",
1012 one per "expected"). */
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001013 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
Nico Huberd9b2f792020-04-28 16:28:03 +02001014 /* Actual size of YYARG. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001015 int yycount = 0;
Nico Huberd9b2f792020-04-28 16:28:03 +02001016 /* Cumulated lengths of YYARG. */
1017 YYPTRDIFF_T yysize = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001018
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001019 /* There are many possibilities here to consider:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001020 - If this state is a consistent state with a default action, then
1021 the only way this function was invoked is if the default action
1022 is an error action. In that case, don't check for expected
1023 tokens because there are none.
1024 - The only way there can be no lookahead present (in yychar) is if
1025 this state is a consistent state with a default action. Thus,
1026 detecting the absence of a lookahead is sufficient to determine
1027 that there is no unexpected or expected token to report. In that
1028 case, just report a simple "syntax error".
1029 - Don't assume there isn't a lookahead just because this state is a
1030 consistent state with a default action. There might have been a
1031 previous inconsistent state, consistent state with a non-default
1032 action, or user semantic action that manipulated yychar.
1033 - Of course, the expected token list depends on states to have
1034 correct lookahead information, and it depends on the parser not
1035 to perform extra reductions after fetching a lookahead from the
1036 scanner and before detecting a syntax error. Thus, state merging
1037 (from LALR or IELR) and default reductions corrupt the expected
1038 token list. However, the list is correct for canonical LR with
1039 one exception: it will still contain any token that will not be
1040 accepted due to an error action in a later state.
1041 */
1042 if (yytoken != YYEMPTY)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001043 {
Nico Huberd9b2f792020-04-28 16:28:03 +02001044 int yyn = yypact[+*yyssp];
1045 YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1046 yysize = yysize0;
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001047 yyarg[yycount++] = yytname[yytoken];
1048 if (!yypact_value_is_default (yyn))
1049 {
1050 /* Start YYX at -YYN if negative to avoid negative indexes in
1051 YYCHECK. In other words, skip the first -YYN actions for
1052 this state because they are default actions. */
1053 int yyxbegin = yyn < 0 ? -yyn : 0;
1054 /* Stay within bounds of both yycheck and yytname. */
1055 int yychecklim = YYLAST - yyn + 1;
1056 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1057 int yyx;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001058
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001059 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1060 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1061 && !yytable_value_is_error (yytable[yyx + yyn]))
1062 {
1063 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1064 {
1065 yycount = 1;
1066 yysize = yysize0;
1067 break;
1068 }
1069 yyarg[yycount++] = yytname[yyx];
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001070 {
Nico Huberd9b2f792020-04-28 16:28:03 +02001071 YYPTRDIFF_T yysize1
1072 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1073 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1074 yysize = yysize1;
1075 else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001076 return 2;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001077 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001078 }
1079 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001080 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001081
1082 switch (yycount)
1083 {
1084# define YYCASE_(N, S) \
1085 case N: \
1086 yyformat = S; \
1087 break
Nico Huberd9b2f792020-04-28 16:28:03 +02001088 default: /* Avoid compiler warnings. */
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001089 YYCASE_(0, YY_("syntax error"));
1090 YYCASE_(1, YY_("syntax error, unexpected %s"));
1091 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1092 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1093 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1094 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1095# undef YYCASE_
1096 }
1097
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001098 {
Nico Huberd9b2f792020-04-28 16:28:03 +02001099 /* Don't count the "%s"s in the final size, but reserve room for
1100 the terminator. */
1101 YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
1102 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1103 yysize = yysize1;
1104 else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001105 return 2;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001106 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001107
1108 if (*yymsg_alloc < yysize)
1109 {
1110 *yymsg_alloc = 2 * yysize;
1111 if (! (yysize <= *yymsg_alloc
1112 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1113 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1114 return 1;
1115 }
1116
1117 /* Avoid sprintf, as that infringes on the user's name space.
1118 Don't have undefined behavior even if the translation
1119 produced a string with the wrong number of "%s"s. */
1120 {
1121 char *yyp = *yymsg;
1122 int yyi = 0;
1123 while ((*yyp = *yyformat) != '\0')
1124 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1125 {
1126 yyp += yytnamerr (yyp, yyarg[yyi++]);
1127 yyformat += 2;
1128 }
1129 else
1130 {
Nico Huberd9b2f792020-04-28 16:28:03 +02001131 ++yyp;
1132 ++yyformat;
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001133 }
1134 }
1135 return 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001136}
1137#endif /* YYERROR_VERBOSE */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001138
1139/*-----------------------------------------------.
1140| Release the memory associated to this symbol. |
1141`-----------------------------------------------*/
1142
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001143static void
1144yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001145{
1146 YYUSE (yyvaluep);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001147 if (!yymsg)
1148 yymsg = "Deleting";
1149 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1150
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001151 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1152 YYUSE (yytype);
1153 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001154}
1155
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001156
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001157
1158
1159/* The lookahead symbol. */
1160int yychar;
1161
1162/* The semantic value of the lookahead symbol. */
1163YYSTYPE yylval;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001164/* Number of syntax errors so far. */
1165int yynerrs;
1166
1167
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001168/*----------.
1169| yyparse. |
1170`----------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001171
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001172int
1173yyparse (void)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001174{
Nico Huberd9b2f792020-04-28 16:28:03 +02001175 yy_state_fast_t yystate;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001176 /* Number of tokens to shift before error messages enabled. */
1177 int yyerrstatus;
1178
1179 /* The stacks and their tools:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001180 'yyss': related to states.
1181 'yyvs': related to semantic values.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001182
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001183 Refer to the stacks through separate pointers, to allow yyoverflow
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001184 to reallocate them elsewhere. */
1185
1186 /* The state stack. */
Nico Huberd9b2f792020-04-28 16:28:03 +02001187 yy_state_t yyssa[YYINITDEPTH];
1188 yy_state_t *yyss;
1189 yy_state_t *yyssp;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001190
1191 /* The semantic value stack. */
1192 YYSTYPE yyvsa[YYINITDEPTH];
1193 YYSTYPE *yyvs;
1194 YYSTYPE *yyvsp;
1195
Nico Huberd9b2f792020-04-28 16:28:03 +02001196 YYPTRDIFF_T yystacksize;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001197
1198 int yyn;
1199 int yyresult;
1200 /* Lookahead token as an internal (translated) token number. */
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001201 int yytoken = 0;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001202 /* The variables used to return semantic value and location from the
1203 action routines. */
1204 YYSTYPE yyval;
1205
1206#if YYERROR_VERBOSE
1207 /* Buffer for error messages, and its allocated size. */
1208 char yymsgbuf[128];
1209 char *yymsg = yymsgbuf;
Nico Huberd9b2f792020-04-28 16:28:03 +02001210 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001211#endif
1212
1213#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1214
1215 /* The number of symbols on the RHS of the reduced rule.
1216 Keep to zero when no symbol should be popped. */
1217 int yylen = 0;
1218
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001219 yyssp = yyss = yyssa;
1220 yyvsp = yyvs = yyvsa;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001221 yystacksize = YYINITDEPTH;
1222
1223 YYDPRINTF ((stderr, "Starting parse\n"));
1224
1225 yystate = 0;
1226 yyerrstatus = 0;
1227 yynerrs = 0;
1228 yychar = YYEMPTY; /* Cause a token to be read. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001229 goto yysetstate;
1230
Nico Huberd9b2f792020-04-28 16:28:03 +02001231
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001232/*------------------------------------------------------------.
Nico Huberd9b2f792020-04-28 16:28:03 +02001233| yynewstate -- push a new state, which is found in yystate. |
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001234`------------------------------------------------------------*/
Nico Huberd9b2f792020-04-28 16:28:03 +02001235yynewstate:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001236 /* In all cases, when you get here, the value and location stacks
1237 have just been pushed. So pushing a state here evens the stacks. */
1238 yyssp++;
1239
Nico Huberd9b2f792020-04-28 16:28:03 +02001240
1241/*--------------------------------------------------------------------.
1242| yysetstate -- set current state (the top of the stack) to yystate. |
1243`--------------------------------------------------------------------*/
1244yysetstate:
1245 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1246 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1247 YY_IGNORE_USELESS_CAST_BEGIN
1248 *yyssp = YY_CAST (yy_state_t, yystate);
1249 YY_IGNORE_USELESS_CAST_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001250
1251 if (yyss + yystacksize - 1 <= yyssp)
Nico Huberd9b2f792020-04-28 16:28:03 +02001252#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1253 goto yyexhaustedlab;
1254#else
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001255 {
1256 /* Get the current used size of the three stacks, in elements. */
Nico Huberd9b2f792020-04-28 16:28:03 +02001257 YYPTRDIFF_T yysize = yyssp - yyss + 1;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001258
Nico Huberd9b2f792020-04-28 16:28:03 +02001259# if defined yyoverflow
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001260 {
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001261 /* Give user a chance to reallocate the stack. Use copies of
1262 these so that the &'s don't force the real ones into
1263 memory. */
Nico Huberd9b2f792020-04-28 16:28:03 +02001264 yy_state_t *yyss1 = yyss;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001265 YYSTYPE *yyvs1 = yyvs;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001266
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001267 /* Each stack pointer address is followed by the size of the
1268 data in use in that stack, in bytes. This used to be a
1269 conditional around just the two extra args, but that might
1270 be undefined if yyoverflow is a macro. */
1271 yyoverflow (YY_("memory exhausted"),
Nico Huberd9b2f792020-04-28 16:28:03 +02001272 &yyss1, yysize * YYSIZEOF (*yyssp),
1273 &yyvs1, yysize * YYSIZEOF (*yyvsp),
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001274 &yystacksize);
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001275 yyss = yyss1;
1276 yyvs = yyvs1;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001277 }
Nico Huberd9b2f792020-04-28 16:28:03 +02001278# else /* defined YYSTACK_RELOCATE */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001279 /* Extend the stack our own way. */
1280 if (YYMAXDEPTH <= yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001281 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001282 yystacksize *= 2;
1283 if (YYMAXDEPTH < yystacksize)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001284 yystacksize = YYMAXDEPTH;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001285
1286 {
Nico Huberd9b2f792020-04-28 16:28:03 +02001287 yy_state_t *yyss1 = yyss;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001288 union yyalloc *yyptr =
Nico Huberd9b2f792020-04-28 16:28:03 +02001289 YY_CAST (union yyalloc *,
1290 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001291 if (! yyptr)
1292 goto yyexhaustedlab;
1293 YYSTACK_RELOCATE (yyss_alloc, yyss);
1294 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Nico Huberd9b2f792020-04-28 16:28:03 +02001295# undef YYSTACK_RELOCATE
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001296 if (yyss1 != yyssa)
1297 YYSTACK_FREE (yyss1);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001298 }
1299# endif
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001300
1301 yyssp = yyss + yysize - 1;
1302 yyvsp = yyvs + yysize - 1;
1303
Nico Huberd9b2f792020-04-28 16:28:03 +02001304 YY_IGNORE_USELESS_CAST_BEGIN
1305 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1306 YY_CAST (long, yystacksize)));
1307 YY_IGNORE_USELESS_CAST_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001308
1309 if (yyss + yystacksize - 1 <= yyssp)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001310 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001311 }
Nico Huberd9b2f792020-04-28 16:28:03 +02001312#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001313
1314 if (yystate == YYFINAL)
1315 YYACCEPT;
1316
1317 goto yybackup;
1318
Nico Huberd9b2f792020-04-28 16:28:03 +02001319
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001320/*-----------.
1321| yybackup. |
1322`-----------*/
1323yybackup:
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001324 /* Do appropriate processing given the current state. Read a
1325 lookahead token if we need one and don't already have one. */
1326
1327 /* First try to decide what to do without reference to lookahead token. */
1328 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001329 if (yypact_value_is_default (yyn))
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001330 goto yydefault;
1331
1332 /* Not known => get a lookahead token if don't already have one. */
1333
1334 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1335 if (yychar == YYEMPTY)
1336 {
1337 YYDPRINTF ((stderr, "Reading a token: "));
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001338 yychar = yylex ();
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001339 }
1340
1341 if (yychar <= YYEOF)
1342 {
1343 yychar = yytoken = YYEOF;
1344 YYDPRINTF ((stderr, "Now at end of input.\n"));
1345 }
1346 else
1347 {
1348 yytoken = YYTRANSLATE (yychar);
1349 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1350 }
1351
1352 /* If the proper action on seeing token YYTOKEN is to reduce or to
1353 detect an error, take that action. */
1354 yyn += yytoken;
1355 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1356 goto yydefault;
1357 yyn = yytable[yyn];
1358 if (yyn <= 0)
1359 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001360 if (yytable_value_is_error (yyn))
1361 goto yyerrlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001362 yyn = -yyn;
1363 goto yyreduce;
1364 }
1365
1366 /* Count tokens shifted since error; after three, turn off error
1367 status. */
1368 if (yyerrstatus)
1369 yyerrstatus--;
1370
1371 /* Shift the lookahead token. */
1372 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001373 yystate = yyn;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001374 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001375 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001376 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001377
Nico Huberd9b2f792020-04-28 16:28:03 +02001378 /* Discard the shifted token. */
1379 yychar = YYEMPTY;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001380 goto yynewstate;
1381
1382
1383/*-----------------------------------------------------------.
1384| yydefault -- do the default action for the current state. |
1385`-----------------------------------------------------------*/
1386yydefault:
1387 yyn = yydefact[yystate];
1388 if (yyn == 0)
1389 goto yyerrlab;
1390 goto yyreduce;
1391
1392
1393/*-----------------------------.
Nico Huberd9b2f792020-04-28 16:28:03 +02001394| yyreduce -- do a reduction. |
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001395`-----------------------------*/
1396yyreduce:
1397 /* yyn is the number of a rule to reduce with. */
1398 yylen = yyr2[yyn];
1399
1400 /* If YYLEN is nonzero, implement the default value of the action:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001401 '$$ = $1'.
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001402
1403 Otherwise, the following line sets YYVAL to garbage.
1404 This behavior is undocumented and Bison
1405 users should not rely upon it. Assigning to YYVAL
1406 unconditionally makes the parser a bit smaller, and it avoids a
1407 GCC warning that YYVAL may be used uninitialized. */
1408 yyval = yyvsp[1-yylen];
1409
1410
1411 YY_REDUCE_PRINT (yyn);
1412 switch (yyn)
1413 {
Nico Huberd9b2f792020-04-28 16:28:03 +02001414 case 2:
1415 { cur_parent = root_parent; }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001416 break;
1417
Nico Huber8e1ea522020-06-03 10:20:07 -07001418 case 19:
Nico Huberd9b2f792020-04-28 16:28:03 +02001419 {
Furquan Shaikhc56ae2f2018-05-31 10:33:16 -07001420 (yyval.chip_instance) = new_chip_instance((yyvsp[0].string));
1421 chip_enqueue_tail(cur_chip_instance);
1422 cur_chip_instance = (yyval.chip_instance);
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001423}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001424 break;
1425
Nico Huber8e1ea522020-06-03 10:20:07 -07001426 case 20:
Nico Huberd9b2f792020-04-28 16:28:03 +02001427 {
1428 cur_chip_instance = chip_dequeue_tail();
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001429}
1430 break;
1431
Nico Huber8e1ea522020-06-03 10:20:07 -07001432 case 21:
1433 {
1434 (yyval.dev) = new_device(cur_parent, cur_chip_instance, (yyvsp[-3].number), (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].number));
Nico Huberd9b2f792020-04-28 16:28:03 +02001435 cur_parent = (yyval.dev)->last_bus;
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001436}
Patrick Georgi68befd52010-05-05 12:05:25 +00001437 break;
1438
Nico Huber8e1ea522020-06-03 10:20:07 -07001439 case 22:
Nico Huberd9b2f792020-04-28 16:28:03 +02001440 {
1441 cur_parent = (yyvsp[-2].dev)->parent;
1442}
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001443 break;
1444
Nico Huber8e1ea522020-06-03 10:20:07 -07001445 case 23:
1446 {
1447 (yyval.string) = NULL;
1448}
1449 break;
1450
Duncan Laurie47b7b342020-05-15 15:39:08 -07001451 case 24:
Nico Huber8e1ea522020-06-03 10:20:07 -07001452 {
1453 (yyval.string) = (yyvsp[0].string);
1454}
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001455 break;
1456
Duncan Laurie47b7b342020-05-15 15:39:08 -07001457 case 27:
Nico Huber8e1ea522020-06-03 10:20:07 -07001458 { 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 +00001459 break;
1460
Duncan Laurie47b7b342020-05-15 15:39:08 -07001461 case 28:
Nico Huber8e1ea522020-06-03 10:20:07 -07001462 { add_reference(cur_chip_instance, (yyvsp[0].string), (yyvsp[-2].string)); }
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001463 break;
1464
Duncan Laurie47b7b342020-05-15 15:39:08 -07001465 case 29:
Nico Huber8e1ea522020-06-03 10:20:07 -07001466 { add_register(cur_chip_instance, (yyvsp[-2].string), (yyvsp[0].string)); }
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001467 break;
1468
Duncan Laurie47b7b342020-05-15 15:39:08 -07001469 case 30:
Nico Huber8e1ea522020-06-03 10:20:07 -07001470 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-1].string), NULL, 16), strtol((yyvsp[0].string), NULL, 16), 0); }
Nico Huberd9b2f792020-04-28 16:28:03 +02001471 break;
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001472
Duncan Laurie47b7b342020-05-15 15:39:08 -07001473 case 31:
Nico Huber8e1ea522020-06-03 10:20:07 -07001474 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-2].string), NULL, 16), strtol((yyvsp[-1].string), NULL, 16), 1); }
Patrick Rudolphac24d3c2019-04-12 14:42:17 +02001475 break;
1476
Duncan Laurie47b7b342020-05-15 15:39:08 -07001477 case 32:
Nico Huber8e1ea522020-06-03 10:20:07 -07001478 { add_ioapic_info(cur_parent, strtol((yyvsp[-2].string), NULL, 16), (yyvsp[-1].string), strtol((yyvsp[0].string), NULL, 16)); }
1479 break;
1480
1481 case 33:
1482 { add_slot_desc(cur_parent, (yyvsp[-3].string), (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].string)); }
1483 break;
1484
1485 case 34:
1486 { add_slot_desc(cur_parent, (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].string), NULL); }
1487 break;
1488
1489 case 35:
1490 { add_slot_desc(cur_parent, (yyvsp[-1].string), (yyvsp[0].string), NULL, NULL); }
1491 break;
1492
1493 case 36:
Duncan Laurie47b7b342020-05-15 15:39:08 -07001494 { }
1495 break;
1496
Nico Huber8e1ea522020-06-03 10:20:07 -07001497 case 41:
Duncan Laurie47b7b342020-05-15 15:39:08 -07001498 {
1499 cur_field = new_fw_config_field((yyvsp[-2].string), strtoul((yyvsp[-1].string), NULL, 0), strtoul((yyvsp[0].string), NULL, 0));
1500}
1501 break;
1502
Duncan Laurie47b7b342020-05-15 15:39:08 -07001503 case 42:
1504 { }
1505 break;
1506
1507 case 43:
Nico Huber8e1ea522020-06-03 10:20:07 -07001508 {
1509 cur_field = new_fw_config_field((yyvsp[-1].string), strtoul((yyvsp[0].string), NULL, 0), strtoul((yyvsp[0].string), NULL, 0));
1510}
Duncan Laurie47b7b342020-05-15 15:39:08 -07001511 break;
1512
1513 case 44:
Nico Huber8e1ea522020-06-03 10:20:07 -07001514 { }
1515 break;
1516
1517 case 45:
1518 {
1519 cur_field = get_fw_config_field((yyvsp[0].string));
1520}
1521 break;
1522
1523 case 46:
1524 { }
1525 break;
1526
1527 case 47:
1528 { add_fw_config_option(cur_field, (yyvsp[-1].string), strtoul((yyvsp[0].string), NULL, 0)); }
1529 break;
1530
1531 case 48:
Duncan Laurie47b7b342020-05-15 15:39:08 -07001532 { add_fw_config_probe(cur_parent, (yyvsp[-1].string), (yyvsp[0].string)); }
1533 break;
1534
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001535
1536
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001537 default: break;
1538 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001539 /* User semantic actions sometimes alter yychar, and that requires
1540 that yytoken be updated with the new translation. We take the
1541 approach of translating immediately before every use of yytoken.
1542 One alternative is translating here after every semantic action,
1543 but that translation would be missed if the semantic action invokes
1544 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1545 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1546 incorrect destructor might then be invoked immediately. In the
1547 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1548 to an incorrect destructor call or verbose syntax error message
1549 before the lookahead is translated. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001550 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1551
1552 YYPOPSTACK (yylen);
1553 yylen = 0;
1554 YY_STACK_PRINT (yyss, yyssp);
1555
1556 *++yyvsp = yyval;
1557
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001558 /* Now 'shift' the result of the reduction. Determine what state
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001559 that goes to, based on the state we popped back to and the rule
1560 number reduced by. */
Nico Huberd9b2f792020-04-28 16:28:03 +02001561 {
1562 const int yylhs = yyr1[yyn] - YYNTOKENS;
1563 const int yyi = yypgoto[yylhs] + *yyssp;
1564 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1565 ? yytable[yyi]
1566 : yydefgoto[yylhs]);
1567 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001568
1569 goto yynewstate;
1570
1571
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001572/*--------------------------------------.
1573| yyerrlab -- here on detecting error. |
1574`--------------------------------------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001575yyerrlab:
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001576 /* Make sure we have latest lookahead translation. See comments at
1577 user semantic actions for why this is necessary. */
1578 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1579
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001580 /* If not already recovering from an error, report this error. */
1581 if (!yyerrstatus)
1582 {
1583 ++yynerrs;
1584#if ! YYERROR_VERBOSE
1585 yyerror (YY_("syntax error"));
1586#else
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001587# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1588 yyssp, yytoken)
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001589 {
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001590 char const *yymsgp = YY_("syntax error");
1591 int yysyntax_error_status;
1592 yysyntax_error_status = YYSYNTAX_ERROR;
1593 if (yysyntax_error_status == 0)
1594 yymsgp = yymsg;
1595 else if (yysyntax_error_status == 1)
1596 {
1597 if (yymsg != yymsgbuf)
1598 YYSTACK_FREE (yymsg);
Nico Huberd9b2f792020-04-28 16:28:03 +02001599 yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001600 if (!yymsg)
1601 {
1602 yymsg = yymsgbuf;
1603 yymsg_alloc = sizeof yymsgbuf;
1604 yysyntax_error_status = 2;
1605 }
1606 else
1607 {
1608 yysyntax_error_status = YYSYNTAX_ERROR;
1609 yymsgp = yymsg;
1610 }
1611 }
1612 yyerror (yymsgp);
1613 if (yysyntax_error_status == 2)
1614 goto yyexhaustedlab;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001615 }
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001616# undef YYSYNTAX_ERROR
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001617#endif
1618 }
1619
1620
1621
1622 if (yyerrstatus == 3)
1623 {
1624 /* If just tried and failed to reuse lookahead token after an
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001625 error, discard it. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001626
1627 if (yychar <= YYEOF)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001628 {
1629 /* Return failure if at end of input. */
1630 if (yychar == YYEOF)
1631 YYABORT;
1632 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001633 else
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001634 {
1635 yydestruct ("Error: discarding",
1636 yytoken, &yylval);
1637 yychar = YYEMPTY;
1638 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001639 }
1640
1641 /* Else will try to reuse lookahead token after shifting the error
1642 token. */
1643 goto yyerrlab1;
1644
1645
1646/*---------------------------------------------------.
1647| yyerrorlab -- error raised explicitly by YYERROR. |
1648`---------------------------------------------------*/
1649yyerrorlab:
Nico Huberd9b2f792020-04-28 16:28:03 +02001650 /* Pacify compilers when the user code never invokes YYERROR and the
1651 label yyerrorlab therefore never appears in user code. */
1652 if (0)
1653 YYERROR;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001654
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001655 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001656 this YYERROR. */
1657 YYPOPSTACK (yylen);
1658 yylen = 0;
1659 YY_STACK_PRINT (yyss, yyssp);
1660 yystate = *yyssp;
1661 goto yyerrlab1;
1662
1663
1664/*-------------------------------------------------------------.
1665| yyerrlab1 -- common code for both syntax error and YYERROR. |
1666`-------------------------------------------------------------*/
1667yyerrlab1:
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001668 yyerrstatus = 3; /* Each real token shifted decrements this. */
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001669
1670 for (;;)
1671 {
1672 yyn = yypact[yystate];
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001673 if (!yypact_value_is_default (yyn))
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001674 {
1675 yyn += YYTERROR;
1676 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1677 {
1678 yyn = yytable[yyn];
1679 if (0 < yyn)
1680 break;
1681 }
1682 }
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001683
1684 /* Pop the current state because it cannot handle the error token. */
1685 if (yyssp == yyss)
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001686 YYABORT;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001687
1688
1689 yydestruct ("Error: popping",
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001690 yystos[yystate], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001691 YYPOPSTACK (1);
1692 yystate = *yyssp;
1693 YY_STACK_PRINT (yyss, yyssp);
1694 }
1695
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001696 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001697 *++yyvsp = yylval;
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001698 YY_IGNORE_MAYBE_UNINITIALIZED_END
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001699
1700
1701 /* Shift the error token. */
1702 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1703
1704 yystate = yyn;
1705 goto yynewstate;
1706
1707
1708/*-------------------------------------.
1709| yyacceptlab -- YYACCEPT comes here. |
1710`-------------------------------------*/
1711yyacceptlab:
1712 yyresult = 0;
1713 goto yyreturn;
1714
Nico Huberd9b2f792020-04-28 16:28:03 +02001715
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001716/*-----------------------------------.
1717| yyabortlab -- YYABORT comes here. |
1718`-----------------------------------*/
1719yyabortlab:
1720 yyresult = 1;
1721 goto yyreturn;
1722
Nico Huberd9b2f792020-04-28 16:28:03 +02001723
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001724#if !defined yyoverflow || YYERROR_VERBOSE
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001725/*-------------------------------------------------.
1726| yyexhaustedlab -- memory exhaustion comes here. |
1727`-------------------------------------------------*/
1728yyexhaustedlab:
1729 yyerror (YY_("memory exhausted"));
1730 yyresult = 2;
1731 /* Fall through. */
1732#endif
1733
Nico Huberd9b2f792020-04-28 16:28:03 +02001734
1735/*-----------------------------------------------------.
1736| yyreturn -- parsing is finished, return the result. |
1737`-----------------------------------------------------*/
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001738yyreturn:
1739 if (yychar != YYEMPTY)
Sven Schnelle0fa50a12012-06-21 22:19:48 +02001740 {
1741 /* Make sure we have latest lookahead translation. See comments at
1742 user semantic actions for why this is necessary. */
1743 yytoken = YYTRANSLATE (yychar);
1744 yydestruct ("Cleanup: discarding lookahead",
1745 yytoken, &yylval);
1746 }
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001747 /* Do not reclaim the symbols of the rule whose action triggered
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001748 this YYABORT or YYACCEPT. */
1749 YYPOPSTACK (yylen);
1750 YY_STACK_PRINT (yyss, yyssp);
1751 while (yyssp != yyss)
1752 {
1753 yydestruct ("Cleanup: popping",
Nico Huberd9b2f792020-04-28 16:28:03 +02001754 yystos[+*yyssp], yyvsp);
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001755 YYPOPSTACK (1);
1756 }
1757#ifndef yyoverflow
1758 if (yyss != yyssa)
1759 YYSTACK_FREE (yyss);
1760#endif
1761#if YYERROR_VERBOSE
1762 if (yymsg != yymsgbuf)
1763 YYSTACK_FREE (yymsg);
1764#endif
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001765 return yyresult;
Patrick Georgi7e8c9aa2010-04-08 11:37:43 +00001766}
Stefan Reinauer2e78aa52016-05-07 01:11:14 -07001767