Debian Codegraph @

util/sconfig/sconfig.tab.c_shipped

raw
1 /* A Bison parser, made by GNU Bison 3.8.2. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6 Inc.
7
8 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.
12
13 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.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <https://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.
30
31 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 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38 especially those whose name start with YY_ or yy_. They are
39 private implementation details that can be changed or removed. */
40
41 /* All symbols defined below should begin with yy or YY, to avoid
42 infringing on user name space. This should be done even for local
43 variables, as they might otherwise be expanded by user macros.
44 There are some unavoidable exceptions within include files to
45 define necessary library symbols; they are noted "INFRINGES ON
46 USER NAME SPACE" below. */
47
48 /* Identify Bison output, and Bison version. */
49 #define YYBISON 30802
50
51 /* Bison version string. */
52 #define YYBISON_VERSION "3.8.2"
53
54 /* Skeleton name. */
55 #define YYSKELETON_NAME "yacc.c"
56
57 /* Pure parsers. */
58 #define YYPURE 0
59
60 /* Push parsers. */
61 #define YYPUSH 0
62
63 /* Pull parsers. */
64 #define YYPULL 1
65
66
67
68
69 /* First part of user prologue. */
70
71 /* sconfig, coreboot device tree compiler */
72 /* SPDX-License-Identifier: GPL-2.0-only */
73
74 #include <stdint.h>
75 #include "sconfig.h"
76
77 int yylex();
78 void yyerror(const char *s);
79
80 static struct bus *cur_parent;
81 static struct chip_instance *cur_chip_instance;
82 static struct fw_config_field *cur_field;
83 static struct fw_config_field_bits *cur_bits;
84
85
86
87 # ifndef YY_CAST
88 # ifdef __cplusplus
89 # define YY_CAST(Type, Val) static_cast<Type> (Val)
90 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
91 # else
92 # define YY_CAST(Type, Val) ((Type) (Val))
93 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
94 # endif
95 # endif
96 # ifndef YY_NULLPTR
97 # if defined __cplusplus
98 # if 201103L <= __cplusplus
99 # define YY_NULLPTR nullptr
100 # else
101 # define YY_NULLPTR 0
102 # endif
103 # else
104 # define YY_NULLPTR ((void*)0)
105 # endif
106 # endif
107
108 #include "sconfig.tab.h_shipped"
109 /* Symbol kind. */
110 enum yysymbol_kind_t
111 {
112 YYSYMBOL_YYEMPTY = -2,
113 YYSYMBOL_YYEOF = 0, /* "end of file" */
114 YYSYMBOL_YYerror = 1, /* error */
115 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
116 YYSYMBOL_CHIP = 3, /* CHIP */
117 YYSYMBOL_DEVICE = 4, /* DEVICE */
118 YYSYMBOL_REGISTER = 5, /* REGISTER */
119 YYSYMBOL_ALIAS = 6, /* ALIAS */
120 YYSYMBOL_REFERENCE = 7, /* REFERENCE */
121 YYSYMBOL_ASSOCIATION = 8, /* ASSOCIATION */
122 YYSYMBOL_BOOL = 9, /* BOOL */
123 YYSYMBOL_STATUS = 10, /* STATUS */
124 YYSYMBOL_MANDATORY = 11, /* MANDATORY */
125 YYSYMBOL_BUS = 12, /* BUS */
126 YYSYMBOL_RESOURCE = 13, /* RESOURCE */
127 YYSYMBOL_END = 14, /* END */
128 YYSYMBOL_EQUALS = 15, /* EQUALS */
129 YYSYMBOL_HEX = 16, /* HEX */
130 YYSYMBOL_STRING = 17, /* STRING */
131 YYSYMBOL_PCI = 18, /* PCI */
132 YYSYMBOL_PNP = 19, /* PNP */
133 YYSYMBOL_I2C = 20, /* I2C */
134 YYSYMBOL_CPU_CLUSTER = 21, /* CPU_CLUSTER */
135 YYSYMBOL_CPU = 22, /* CPU */
136 YYSYMBOL_DOMAIN = 23, /* DOMAIN */
137 YYSYMBOL_IRQ = 24, /* IRQ */
138 YYSYMBOL_DRQ = 25, /* DRQ */
139 YYSYMBOL_SLOT_DESC = 26, /* SLOT_DESC */
140 YYSYMBOL_SMBIOS_DEV_INFO = 27, /* SMBIOS_DEV_INFO */
141 YYSYMBOL_IO = 28, /* IO */
142 YYSYMBOL_NUMBER = 29, /* NUMBER */
143 YYSYMBOL_SUBSYSTEMID = 30, /* SUBSYSTEMID */
144 YYSYMBOL_INHERIT = 31, /* INHERIT */
145 YYSYMBOL_PCIINT = 32, /* PCIINT */
146 YYSYMBOL_GENERIC = 33, /* GENERIC */
147 YYSYMBOL_SPI = 34, /* SPI */
148 YYSYMBOL_USB = 35, /* USB */
149 YYSYMBOL_MMIO = 36, /* MMIO */
150 YYSYMBOL_GPIO = 37, /* GPIO */
151 YYSYMBOL_MDIO = 38, /* MDIO */
152 YYSYMBOL_FW_CONFIG_TABLE = 39, /* FW_CONFIG_TABLE */
153 YYSYMBOL_FW_CONFIG_FIELD = 40, /* FW_CONFIG_FIELD */
154 YYSYMBOL_FW_CONFIG_OPTION = 41, /* FW_CONFIG_OPTION */
155 YYSYMBOL_FW_CONFIG_PROBE = 42, /* FW_CONFIG_PROBE */
156 YYSYMBOL_FW_CONFIG_UNPROVISIONED = 43, /* FW_CONFIG_UNPROVISIONED */
157 YYSYMBOL_PIPE = 44, /* PIPE */
158 YYSYMBOL_OPS = 45, /* OPS */
159 YYSYMBOL_YYACCEPT = 46, /* $accept */
160 YYSYMBOL_devtree = 47, /* devtree */
161 YYSYMBOL_chipchild_nondev = 48, /* chipchild_nondev */
162 YYSYMBOL_chipchild = 49, /* chipchild */
163 YYSYMBOL_chipchildren = 50, /* chipchildren */
164 YYSYMBOL_chipchildren_dev = 51, /* chipchildren_dev */
165 YYSYMBOL_devicechildren = 52, /* devicechildren */
166 YYSYMBOL_chip = 53, /* chip */
167 YYSYMBOL_54_1 = 54, /* @1 */
168 YYSYMBOL_device = 55, /* device */
169 YYSYMBOL_56_2 = 56, /* @2 */
170 YYSYMBOL_57_3 = 57, /* @3 */
171 YYSYMBOL_alias = 58, /* alias */
172 YYSYMBOL_status = 59, /* status */
173 YYSYMBOL_resource = 60, /* resource */
174 YYSYMBOL_reference = 61, /* reference */
175 YYSYMBOL_registers = 62, /* registers */
176 YYSYMBOL_subsystemid = 63, /* subsystemid */
177 YYSYMBOL_smbios_slot_desc = 64, /* smbios_slot_desc */
178 YYSYMBOL_smbios_dev_info = 65, /* smbios_dev_info */
179 YYSYMBOL_fw_config_table = 66, /* fw_config_table */
180 YYSYMBOL_fw_config_table_children = 67, /* fw_config_table_children */
181 YYSYMBOL_fw_config_field_children = 68, /* fw_config_field_children */
182 YYSYMBOL_fw_config_field_bits = 69, /* fw_config_field_bits */
183 YYSYMBOL_fw_config_field_bits_repeating = 70, /* fw_config_field_bits_repeating */
184 YYSYMBOL_fw_config_field = 71, /* fw_config_field */
185 YYSYMBOL_72_4 = 72, /* $@4 */
186 YYSYMBOL_73_5 = 73, /* $@5 */
187 YYSYMBOL_74_6 = 74, /* $@6 */
188 YYSYMBOL_fw_config_option = 75, /* fw_config_option */
189 YYSYMBOL_fw_config_probe = 76, /* fw_config_probe */
190 YYSYMBOL_ops = 77 /* ops */
191 };
192 typedef enum yysymbol_kind_t yysymbol_kind_t;
193
194
195
196
197 #ifdef short
198 # undef short
199 #endif
200
201 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
202 <limits.h> and (if available) <stdint.h> are included
203 so that the code can choose integer types of a good width. */
204
205 #ifndef __PTRDIFF_MAX__
206 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
207 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
208 # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
209 # define YY_STDINT_H
210 # endif
211 #endif
212
213 /* Narrow types that promote to a signed type and that can represent a
214 signed or unsigned integer of at least N bits. In tables they can
215 save space and decrease cache pressure. Promoting to a signed type
216 helps avoid bugs in integer arithmetic. */
217
218 #ifdef __INT_LEAST8_MAX__
219 typedef __INT_LEAST8_TYPE__ yytype_int8;
220 #elif defined YY_STDINT_H
221 typedef int_least8_t yytype_int8;
222 #else
223 typedef signed char yytype_int8;
224 #endif
225
226 #ifdef __INT_LEAST16_MAX__
227 typedef __INT_LEAST16_TYPE__ yytype_int16;
228 #elif defined YY_STDINT_H
229 typedef int_least16_t yytype_int16;
230 #else
231 typedef short yytype_int16;
232 #endif
233
234 /* Work around bug in HP-UX 11.23, which defines these macros
235 incorrectly for preprocessor constants. This workaround can likely
236 be removed in 2023, as HPE has promised support for HP-UX 11.23
237 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
238 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
239 #ifdef __hpux
240 # undef UINT_LEAST8_MAX
241 # undef UINT_LEAST16_MAX
242 # define UINT_LEAST8_MAX 255
243 # define UINT_LEAST16_MAX 65535
244 #endif
245
246 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
247 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
248 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
249 && UINT_LEAST8_MAX <= INT_MAX)
250 typedef uint_least8_t yytype_uint8;
251 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
252 typedef unsigned char yytype_uint8;
253 #else
254 typedef short yytype_uint8;
255 #endif
256
257 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
258 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
259 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
260 && UINT_LEAST16_MAX <= INT_MAX)
261 typedef uint_least16_t yytype_uint16;
262 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
263 typedef unsigned short yytype_uint16;
264 #else
265 typedef int yytype_uint16;
266 #endif
267
268 #ifndef YYPTRDIFF_T
269 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
270 # define YYPTRDIFF_T __PTRDIFF_TYPE__
271 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
272 # elif defined PTRDIFF_MAX
273 # ifndef ptrdiff_t
274 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
275 # endif
276 # define YYPTRDIFF_T ptrdiff_t
277 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
278 # else
279 # define YYPTRDIFF_T long
280 # define YYPTRDIFF_MAXIMUM LONG_MAX
281 # endif
282 #endif
283
284 #ifndef YYSIZE_T
285 # ifdef __SIZE_TYPE__
286 # define YYSIZE_T __SIZE_TYPE__
287 # elif defined size_t
288 # define YYSIZE_T size_t
289 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
290 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
291 # define YYSIZE_T size_t
292 # else
293 # define YYSIZE_T unsigned
294 # endif
295 #endif
296
297 #define YYSIZE_MAXIMUM \
298 YY_CAST (YYPTRDIFF_T, \
299 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
300 ? YYPTRDIFF_MAXIMUM \
301 : YY_CAST (YYSIZE_T, -1)))
302
303 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
304
305
306 /* Stored state numbers (used for stacks). */
307 typedef yytype_int8 yy_state_t;
308
309 /* State numbers in computations. */
310 typedef int yy_state_fast_t;
311
312 #ifndef YY_
313 # if defined YYENABLE_NLS && YYENABLE_NLS
314 # if ENABLE_NLS
315 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
316 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
317 # endif
318 # endif
319 # ifndef YY_
320 # define YY_(Msgid) Msgid
321 # endif
322 #endif
323
324
325 #ifndef YY_ATTRIBUTE_PURE
326 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
327 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
328 # else
329 # define YY_ATTRIBUTE_PURE
330 # endif
331 #endif
332
333 #ifndef YY_ATTRIBUTE_UNUSED
334 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
335 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
336 # else
337 # define YY_ATTRIBUTE_UNUSED
338 # endif
339 #endif
340
341 /* Suppress unused-variable warnings by "using" E. */
342 #if ! defined lint || defined __GNUC__
343 # define YY_USE(E) ((void) (E))
344 #else
345 # define YY_USE(E) /* empty */
346 #endif
347
348 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
349 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
350 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
351 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
352 _Pragma ("GCC diagnostic push") \
353 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
354 # else
355 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
356 _Pragma ("GCC diagnostic push") \
357 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
358 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
359 # endif
360 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
361 _Pragma ("GCC diagnostic pop")
362 #else
363 # define YY_INITIAL_VALUE(Value) Value
364 #endif
365 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
366 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
367 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
368 #endif
369 #ifndef YY_INITIAL_VALUE
370 # define YY_INITIAL_VALUE(Value) /* Nothing. */
371 #endif
372
373 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
374 # define YY_IGNORE_USELESS_CAST_BEGIN \
375 _Pragma ("GCC diagnostic push") \
376 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
377 # define YY_IGNORE_USELESS_CAST_END \
378 _Pragma ("GCC diagnostic pop")
379 #endif
380 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
381 # define YY_IGNORE_USELESS_CAST_BEGIN
382 # define YY_IGNORE_USELESS_CAST_END
383 #endif
384
385
386 #define YY_ASSERT(E) ((void) (0 && (E)))
387
388 #if !defined yyoverflow
389
390 /* The parser invokes alloca or malloc; define the necessary symbols. */
391
392 # ifdef YYSTACK_USE_ALLOCA
393 # if YYSTACK_USE_ALLOCA
394 # ifdef __GNUC__
395 # define YYSTACK_ALLOC __builtin_alloca
396 # elif defined __BUILTIN_VA_ARG_INCR
397 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
398 # elif defined _AIX
399 # define YYSTACK_ALLOC __alloca
400 # elif defined _MSC_VER
401 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
402 # define alloca _alloca
403 # else
404 # define YYSTACK_ALLOC alloca
405 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
406 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
407 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
408 # ifndef EXIT_SUCCESS
409 # define EXIT_SUCCESS 0
410 # endif
411 # endif
412 # endif
413 # endif
414 # endif
415
416 # ifdef YYSTACK_ALLOC
417 /* Pacify GCC's 'empty if-body' warning. */
418 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
419 # ifndef YYSTACK_ALLOC_MAXIMUM
420 /* The OS might guarantee only one guard page at the bottom of the stack,
421 and a page size can be as small as 4096 bytes. So we cannot safely
422 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
423 to allow for a few compiler-allocated temporary stack slots. */
424 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
425 # endif
426 # else
427 # define YYSTACK_ALLOC YYMALLOC
428 # define YYSTACK_FREE YYFREE
429 # ifndef YYSTACK_ALLOC_MAXIMUM
430 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
431 # endif
432 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
433 && ! ((defined YYMALLOC || defined malloc) \
434 && (defined YYFREE || defined free)))
435 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
436 # ifndef EXIT_SUCCESS
437 # define EXIT_SUCCESS 0
438 # endif
439 # endif
440 # ifndef YYMALLOC
441 # define YYMALLOC malloc
442 # if ! defined malloc && ! defined EXIT_SUCCESS
443 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
444 # endif
445 # endif
446 # ifndef YYFREE
447 # define YYFREE free
448 # if ! defined free && ! defined EXIT_SUCCESS
449 void free (void *); /* INFRINGES ON USER NAME SPACE */
450 # endif
451 # endif
452 # endif
453 #endif /* !defined yyoverflow */
454
455 #if (! defined yyoverflow \
456 && (! defined __cplusplus \
457 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
458
459 /* A type that is properly aligned for any stack member. */
460 union yyalloc
461 {
462 yy_state_t yyss_alloc;
463 YYSTYPE yyvs_alloc;
464 };
465
466 /* The size of the maximum gap between one aligned stack and the next. */
467 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
468
469 /* The size of an array large to enough to hold all stacks, each with
470 N elements. */
471 # define YYSTACK_BYTES(N) \
472 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
473 + YYSTACK_GAP_MAXIMUM)
474
475 # define YYCOPY_NEEDED 1
476
477 /* Relocate STACK from its old location to the new one. The
478 local variables YYSIZE and YYSTACKSIZE give the old and new number of
479 elements in the stack, and YYPTR gives the new location of the
480 stack. Advance YYPTR to a properly aligned location for the next
481 stack. */
482 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
483 do \
484 { \
485 YYPTRDIFF_T yynewbytes; \
486 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
487 Stack = &yyptr->Stack_alloc; \
488 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
489 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
490 } \
491 while (0)
492
493 #endif
494
495 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
496 /* Copy COUNT objects from SRC to DST. The source and destination do
497 not overlap. */
498 # ifndef YYCOPY
499 # if defined __GNUC__ && 1 < __GNUC__
500 # define YYCOPY(Dst, Src, Count) \
501 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
502 # else
503 # define YYCOPY(Dst, Src, Count) \
504 do \
505 { \
506 YYPTRDIFF_T yyi; \
507 for (yyi = 0; yyi < (Count); yyi++) \
508 (Dst)[yyi] = (Src)[yyi]; \
509 } \
510 while (0)
511 # endif
512 # endif
513 #endif /* !YYCOPY_NEEDED */
514
515 /* YYFINAL -- State number of the termination state. */
516 #define YYFINAL 2
517 /* YYLAST -- Last index in YYTABLE. */
518 #define YYLAST 93
519
520 /* YYNTOKENS -- Number of terminals. */
521 #define YYNTOKENS 46
522 /* YYNNTS -- Number of nonterminals. */
523 #define YYNNTS 32
524 /* YYNRULES -- Number of rules. */
525 #define YYNRULES 61
526 /* YYNSTATES -- Number of states. */
527 #define YYNSTATES 104
528
529 /* YYMAXUTOK -- Last valid token kind. */
530 #define YYMAXUTOK 300
531
532
533 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
534 as returned by yylex, with out-of-bounds checking. */
535 #define YYTRANSLATE(YYX) \
536 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
537 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
538 : YYSYMBOL_YYUNDEF)
539
540 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
541 as returned by yylex. */
542 static const yytype_int8 yytranslate[] =
543 {
544 0, 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, 2, 2, 2, 2,
553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
554 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
555 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
560 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
561 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
562 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
564 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
570 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
571 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
572 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
573 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
574 45
575 };
576
577 #if YYDEBUG
578 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
579 static const yytype_uint8 yyrline[] =
580 {
581 0, 26, 26, 26, 26, 29, 29, 29, 30, 30,
582 31, 31, 32, 32, 34, 34, 34, 34, 34, 34,
583 34, 34, 34, 34, 36, 36, 45, 45, 53, 53,
584 61, 63, 67, 67, 69, 72, 75, 78, 81, 84,
585 87, 90, 93, 96, 100, 103, 103, 106, 106, 109,
586 115, 115, 118, 117, 122, 122, 130, 130, 136, 140,
587 143, 146
588 };
589 #endif
590
591 /** Accessing symbol of state STATE. */
592 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
593
594 #if YYDEBUG || 0
595 /* The user-facing name of the symbol whose (internal) number is
596 YYSYMBOL. No bounds checking. */
597 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
598
599 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
600 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
601 static const char *const yytname[] =
602 {
603 "\"end of file\"", "error", "\"invalid token\"", "CHIP", "DEVICE",
604 "REGISTER", "ALIAS", "REFERENCE", "ASSOCIATION", "BOOL", "STATUS",
605 "MANDATORY", "BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI",
606 "PNP", "I2C", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ", "SLOT_DESC",
607 "SMBIOS_DEV_INFO", "IO", "NUMBER", "SUBSYSTEMID", "INHERIT", "PCIINT",
608 "GENERIC", "SPI", "USB", "MMIO", "GPIO", "MDIO", "FW_CONFIG_TABLE",
609 "FW_CONFIG_FIELD", "FW_CONFIG_OPTION", "FW_CONFIG_PROBE",
610 "FW_CONFIG_UNPROVISIONED", "PIPE", "OPS", "$accept", "devtree",
611 "chipchild_nondev", "chipchild", "chipchildren", "chipchildren_dev",
612 "devicechildren", "chip", "@1", "device", "@2", "@3", "alias", "status",
613 "resource", "reference", "registers", "subsystemid", "smbios_slot_desc",
614 "smbios_dev_info", "fw_config_table", "fw_config_table_children",
615 "fw_config_field_children", "fw_config_field_bits",
616 "fw_config_field_bits_repeating", "fw_config_field", "$@4", "$@5", "$@6",
617 "fw_config_option", "fw_config_probe", "ops", YY_NULLPTR
618 };
619
620 static const char *
621 yysymbol_name (yysymbol_kind_t yysymbol)
622 {
623 return yytname[yysymbol];
624 }
625 #endif
626
627 #define YYPACT_NINF (-51)
628
629 #define yypact_value_is_default(Yyn) \
630 ((Yyn) == YYPACT_NINF)
631
632 #define YYTABLE_NINF (-1)
633
634 #define yytable_value_is_error(Yyn) \
635 0
636
637 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
638 STATE-NUM. */
639 static const yytype_int8 yypact[] =
640 {
641 -51, 12, -51, 4, -51, -51, -51, -51, -3, 49,
642 -51, 11, -51, 10, 23, 24, 49, 29, -51, -51,
643 -51, -51, 15, 31, 20, 40, 51, -51, -51, 49,
644 28, 16, -51, 14, 55, 45, 46, -51, -51, -51,
645 -51, -51, 35, -51, -12, -51, -51, -51, 50, 14,
646 -51, -51, -8, 28, 16, -51, -51, 52, -51, -51,
647 -51, -51, -51, -51, -7, 37, 0, -51, -51, -51,
648 39, -51, 53, 42, 43, 3, 56, -51, -51, -51,
649 -51, -51, -51, -51, -51, -51, 5, 59, 58, 60,
650 47, 61, -51, -51, -51, 54, 62, -51, 57, -51,
651 -51, 63, -51, -51
652 };
653
654 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
655 Performed when YYTABLE does not specify something else to do. Zero
656 means the default is an error. */
657 static const yytype_int8 yydefact[] =
658 {
659 2, 0, 1, 0, 46, 3, 4, 24, 0, 0,
660 44, 0, 45, 0, 0, 0, 0, 0, 5, 11,
661 7, 6, 56, 0, 0, 0, 0, 13, 25, 12,
662 54, 51, 48, 0, 30, 0, 0, 9, 10, 8,
663 49, 48, 0, 52, 0, 32, 33, 28, 0, 0,
664 36, 35, 0, 0, 51, 48, 57, 0, 47, 23,
665 31, 26, 55, 50, 0, 0, 0, 23, 53, 58,
666 0, 29, 0, 0, 0, 0, 0, 15, 14, 16,
667 20, 17, 18, 19, 21, 22, 0, 0, 0, 43,
668 0, 0, 60, 61, 27, 0, 41, 42, 37, 59,
669 34, 40, 38, 39
670 };
671
672 /* YYPGOTO[NTERM-NUM]. */
673 static const yytype_int8 yypgoto[] =
674 {
675 -51, -51, 64, -51, -51, 65, 17, -1, -51, -28,
676 -51, -51, -51, 33, -51, -51, -50, -51, -51, -51,
677 -51, -51, -16, 44, 36, -51, -51, -51, -51, -51,
678 -51, -51
679 };
680
681 /* YYDEFGOTO[NTERM-NUM]. */
682 static const yytype_int8 yydefgoto[] =
683 {
684 0, 1, 16, 38, 29, 17, 66, 18, 9, 19,
685 67, 59, 49, 47, 79, 20, 21, 81, 82, 83,
686 6, 8, 44, 31, 43, 12, 55, 41, 32, 58,
687 84, 85
688 };
689
690 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
691 positive, shift that token. If negative, reduce the rule whose
692 number is the opposite. If YYTABLE_NINF, syntax error. */
693 static const yytype_int8 yytable[] =
694 {
695 5, 39, 56, 3, 13, 14, 62, 68, 3, 13,
696 14, 10, 2, 70, 71, 3, 80, 23, 70, 94,
697 91, 7, 24, 45, 46, 52, 72, 73, 22, 57,
698 74, 72, 73, 57, 57, 74, 80, 11, 78, 64,
699 25, 26, 75, 28, 30, 76, 92, 75, 33, 34,
700 76, 4, 3, 13, 14, 35, 15, 40, 78, 36,
701 42, 48, 50, 51, 53, 77, 69, 60, 87, 65,
702 88, 89, 90, 93, 95, 96, 98, 97, 99, 101,
703 103, 27, 61, 100, 86, 77, 54, 0, 102, 0,
704 63, 0, 0, 37
705 };
706
707 static const yytype_int8 yycheck[] =
708 {
709 1, 29, 14, 3, 4, 5, 14, 14, 3, 4,
710 5, 14, 0, 13, 14, 3, 66, 7, 13, 14,
711 17, 17, 12, 9, 10, 41, 26, 27, 17, 41,
712 30, 26, 27, 41, 41, 30, 86, 40, 66, 55,
713 17, 17, 42, 14, 29, 45, 43, 42, 17, 29,
714 45, 39, 3, 4, 5, 15, 7, 29, 86, 8,
715 44, 6, 17, 17, 29, 66, 29, 17, 29, 17,
716 17, 29, 29, 17, 15, 17, 29, 17, 17, 17,
717 17, 16, 49, 29, 67, 86, 42, -1, 31, -1,
718 54, -1, -1, 29
719 };
720
721 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
722 state STATE-NUM. */
723 static const yytype_int8 yystos[] =
724 {
725 0, 47, 0, 3, 39, 53, 66, 17, 67, 54,
726 14, 40, 71, 4, 5, 7, 48, 51, 53, 55,
727 61, 62, 17, 7, 12, 17, 17, 51, 14, 50,
728 29, 69, 74, 17, 29, 15, 8, 48, 49, 55,
729 29, 73, 44, 70, 68, 9, 10, 59, 6, 58,
730 17, 17, 68, 29, 69, 72, 14, 41, 75, 57,
731 17, 59, 14, 70, 68, 17, 52, 56, 14, 29,
732 13, 14, 26, 27, 30, 42, 45, 53, 55, 60,
733 62, 63, 64, 65, 76, 77, 52, 29, 17, 29,
734 29, 17, 43, 17, 14, 15, 17, 17, 29, 17,
735 29, 17, 31, 17
736 };
737
738 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
739 static const yytype_int8 yyr1[] =
740 {
741 0, 46, 47, 47, 47, 48, 48, 48, 49, 49,
742 50, 50, 51, 51, 52, 52, 52, 52, 52, 52,
743 52, 52, 52, 52, 54, 53, 56, 55, 57, 55,
744 58, 58, 59, 59, 60, 61, 62, 63, 63, 64,
745 64, 64, 65, 65, 66, 67, 67, 68, 68, 69,
746 70, 70, 72, 71, 73, 71, 74, 71, 75, 76,
747 76, 77
748 };
749
750 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
751 static const yytype_int8 yyr2[] =
752 {
753 0, 2, 0, 2, 2, 1, 1, 1, 1, 1,
754 2, 0, 2, 2, 2, 2, 2, 2, 2, 2,
755 2, 2, 2, 0, 0, 5, 0, 8, 0, 7,
756 0, 2, 1, 1, 4, 4, 4, 3, 4, 5,
757 4, 3, 3, 2, 3, 2, 0, 2, 0, 2,
758 3, 0, 0, 7, 0, 6, 0, 5, 3, 3,
759 2, 2
760 };
761
762
763 enum { YYENOMEM = -2 };
764
765 #define yyerrok (yyerrstatus = 0)
766 #define yyclearin (yychar = YYEMPTY)
767
768 #define YYACCEPT goto yyacceptlab
769 #define YYABORT goto yyabortlab
770 #define YYERROR goto yyerrorlab
771 #define YYNOMEM goto yyexhaustedlab
772
773
774 #define YYRECOVERING() (!!yyerrstatus)
775
776 #define YYBACKUP(Token, Value) \
777 do \
778 if (yychar == YYEMPTY) \
779 { \
780 yychar = (Token); \
781 yylval = (Value); \
782 YYPOPSTACK (yylen); \
783 yystate = *yyssp; \
784 goto yybackup; \
785 } \
786 else \
787 { \
788 yyerror (YY_("syntax error: cannot back up")); \
789 YYERROR; \
790 } \
791 while (0)
792
793 /* Backward compatibility with an undocumented macro.
794 Use YYerror or YYUNDEF. */
795 #define YYERRCODE YYUNDEF
796
797
798 /* Enable debugging if requested. */
799 #if YYDEBUG
800
801 # ifndef YYFPRINTF
802 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
803 # define YYFPRINTF fprintf
804 # endif
805
806 # define YYDPRINTF(Args) \
807 do { \
808 if (yydebug) \
809 YYFPRINTF Args; \
810 } while (0)
811
812
813
814
815 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
816 do { \
817 if (yydebug) \
818 { \
819 YYFPRINTF (stderr, "%s ", Title); \
820 yy_symbol_print (stderr, \
821 Kind, Value); \
822 YYFPRINTF (stderr, "\n"); \
823 } \
824 } while (0)
825
826
827 /*-----------------------------------.
828 | Print this symbol's value on YYO. |
829 `-----------------------------------*/
830
831 static void
832 yy_symbol_value_print (FILE *yyo,
833 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
834 {
835 FILE *yyoutput = yyo;
836 YY_USE (yyoutput);
837 if (!yyvaluep)
838 return;
839 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
840 YY_USE (yykind);
841 YY_IGNORE_MAYBE_UNINITIALIZED_END
842 }
843
844
845 /*---------------------------.
846 | Print this symbol on YYO. |
847 `---------------------------*/
848
849 static void
850 yy_symbol_print (FILE *yyo,
851 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
852 {
853 YYFPRINTF (yyo, "%s %s (",
854 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
855
856 yy_symbol_value_print (yyo, yykind, yyvaluep);
857 YYFPRINTF (yyo, ")");
858 }
859
860 /*------------------------------------------------------------------.
861 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
862 | TOP (included). |
863 `------------------------------------------------------------------*/
864
865 static void
866 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
867 {
868 YYFPRINTF (stderr, "Stack now");
869 for (; yybottom <= yytop; yybottom++)
870 {
871 int yybot = *yybottom;
872 YYFPRINTF (stderr, " %d", yybot);
873 }
874 YYFPRINTF (stderr, "\n");
875 }
876
877 # define YY_STACK_PRINT(Bottom, Top) \
878 do { \
879 if (yydebug) \
880 yy_stack_print ((Bottom), (Top)); \
881 } while (0)
882
883
884 /*------------------------------------------------.
885 | Report that the YYRULE is going to be reduced. |
886 `------------------------------------------------*/
887
888 static void
889 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
890 int yyrule)
891 {
892 int yylno = yyrline[yyrule];
893 int yynrhs = yyr2[yyrule];
894 int yyi;
895 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
896 yyrule - 1, yylno);
897 /* The symbols being reduced. */
898 for (yyi = 0; yyi < yynrhs; yyi++)
899 {
900 YYFPRINTF (stderr, " $%d = ", yyi + 1);
901 yy_symbol_print (stderr,
902 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
903 &yyvsp[(yyi + 1) - (yynrhs)]);
904 YYFPRINTF (stderr, "\n");
905 }
906 }
907
908 # define YY_REDUCE_PRINT(Rule) \
909 do { \
910 if (yydebug) \
911 yy_reduce_print (yyssp, yyvsp, Rule); \
912 } while (0)
913
914 /* Nonzero means print parse trace. It is left uninitialized so that
915 multiple parsers can coexist. */
916 int yydebug;
917 #else /* !YYDEBUG */
918 # define YYDPRINTF(Args) ((void) 0)
919 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
920 # define YY_STACK_PRINT(Bottom, Top)
921 # define YY_REDUCE_PRINT(Rule)
922 #endif /* !YYDEBUG */
923
924
925 /* YYINITDEPTH -- initial size of the parser's stacks. */
926 #ifndef YYINITDEPTH
927 # define YYINITDEPTH 200
928 #endif
929
930 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
931 if the built-in stack extension method is used).
932
933 Do not make this value too large; the results are undefined if
934 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
935 evaluated with infinite-precision integer arithmetic. */
936
937 #ifndef YYMAXDEPTH
938 # define YYMAXDEPTH 10000
939 #endif
940
941
942
943
944
945
946 /*-----------------------------------------------.
947 | Release the memory associated to this symbol. |
948 `-----------------------------------------------*/
949
950 static void
951 yydestruct (const char *yymsg,
952 yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
953 {
954 YY_USE (yyvaluep);
955 if (!yymsg)
956 yymsg = "Deleting";
957 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
958
959 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
960 YY_USE (yykind);
961 YY_IGNORE_MAYBE_UNINITIALIZED_END
962 }
963
964
965 /* Lookahead token kind. */
966 int yychar;
967
968 /* The semantic value of the lookahead symbol. */
969 YYSTYPE yylval;
970 /* Number of syntax errors so far. */
971 int yynerrs;
972
973
974
975
976 /*----------.
977 | yyparse. |
978 `----------*/
979
980 int
981 yyparse (void)
982 {
983 yy_state_fast_t yystate = 0;
984 /* Number of tokens to shift before error messages enabled. */
985 int yyerrstatus = 0;
986
987 /* Refer to the stacks through separate pointers, to allow yyoverflow
988 to reallocate them elsewhere. */
989
990 /* Their size. */
991 YYPTRDIFF_T yystacksize = YYINITDEPTH;
992
993 /* The state stack: array, bottom, top. */
994 yy_state_t yyssa[YYINITDEPTH];
995 yy_state_t *yyss = yyssa;
996 yy_state_t *yyssp = yyss;
997
998 /* The semantic value stack: array, bottom, top. */
999 YYSTYPE yyvsa[YYINITDEPTH];
1000 YYSTYPE *yyvs = yyvsa;
1001 YYSTYPE *yyvsp = yyvs;
1002
1003 int yyn;
1004 /* The return value of yyparse. */
1005 int yyresult;
1006 /* Lookahead symbol kind. */
1007 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1008 /* The variables used to return semantic value and location from the
1009 action routines. */
1010 YYSTYPE yyval;
1011
1012
1013
1014 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1015
1016 /* The number of symbols on the RHS of the reduced rule.
1017 Keep to zero when no symbol should be popped. */
1018 int yylen = 0;
1019
1020 YYDPRINTF ((stderr, "Starting parse\n"));
1021
1022 yychar = YYEMPTY; /* Cause a token to be read. */
1023
1024 goto yysetstate;
1025
1026
1027 /*------------------------------------------------------------.
1028 | yynewstate -- push a new state, which is found in yystate. |
1029 `------------------------------------------------------------*/
1030 yynewstate:
1031 /* In all cases, when you get here, the value and location stacks
1032 have just been pushed. So pushing a state here evens the stacks. */
1033 yyssp++;
1034
1035
1036 /*--------------------------------------------------------------------.
1037 | yysetstate -- set current state (the top of the stack) to yystate. |
1038 `--------------------------------------------------------------------*/
1039 yysetstate:
1040 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1041 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1042 YY_IGNORE_USELESS_CAST_BEGIN
1043 *yyssp = YY_CAST (yy_state_t, yystate);
1044 YY_IGNORE_USELESS_CAST_END
1045 YY_STACK_PRINT (yyss, yyssp);
1046
1047 if (yyss + yystacksize - 1 <= yyssp)
1048 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1049 YYNOMEM;
1050 #else
1051 {
1052 /* Get the current used size of the three stacks, in elements. */
1053 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1054
1055 # if defined yyoverflow
1056 {
1057 /* Give user a chance to reallocate the stack. Use copies of
1058 these so that the &'s don't force the real ones into
1059 memory. */
1060 yy_state_t *yyss1 = yyss;
1061 YYSTYPE *yyvs1 = yyvs;
1062
1063 /* Each stack pointer address is followed by the size of the
1064 data in use in that stack, in bytes. This used to be a
1065 conditional around just the two extra args, but that might
1066 be undefined if yyoverflow is a macro. */
1067 yyoverflow (YY_("memory exhausted"),
1068 &yyss1, yysize * YYSIZEOF (*yyssp),
1069 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1070 &yystacksize);
1071 yyss = yyss1;
1072 yyvs = yyvs1;
1073 }
1074 # else /* defined YYSTACK_RELOCATE */
1075 /* Extend the stack our own way. */
1076 if (YYMAXDEPTH <= yystacksize)
1077 YYNOMEM;
1078 yystacksize *= 2;
1079 if (YYMAXDEPTH < yystacksize)
1080 yystacksize = YYMAXDEPTH;
1081
1082 {
1083 yy_state_t *yyss1 = yyss;
1084 union yyalloc *yyptr =
1085 YY_CAST (union yyalloc *,
1086 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1087 if (! yyptr)
1088 YYNOMEM;
1089 YYSTACK_RELOCATE (yyss_alloc, yyss);
1090 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1091 # undef YYSTACK_RELOCATE
1092 if (yyss1 != yyssa)
1093 YYSTACK_FREE (yyss1);
1094 }
1095 # endif
1096
1097 yyssp = yyss + yysize - 1;
1098 yyvsp = yyvs + yysize - 1;
1099
1100 YY_IGNORE_USELESS_CAST_BEGIN
1101 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1102 YY_CAST (long, yystacksize)));
1103 YY_IGNORE_USELESS_CAST_END
1104
1105 if (yyss + yystacksize - 1 <= yyssp)
1106 YYABORT;
1107 }
1108 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1109
1110
1111 if (yystate == YYFINAL)
1112 YYACCEPT;
1113
1114 goto yybackup;
1115
1116
1117 /*-----------.
1118 | yybackup. |
1119 `-----------*/
1120 yybackup:
1121 /* Do appropriate processing given the current state. Read a
1122 lookahead token if we need one and don't already have one. */
1123
1124 /* First try to decide what to do without reference to lookahead token. */
1125 yyn = yypact[yystate];
1126 if (yypact_value_is_default (yyn))
1127 goto yydefault;
1128
1129 /* Not known => get a lookahead token if don't already have one. */
1130
1131 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1132 if (yychar == YYEMPTY)
1133 {
1134 YYDPRINTF ((stderr, "Reading a token\n"));
1135 yychar = yylex ();
1136 }
1137
1138 if (yychar <= YYEOF)
1139 {
1140 yychar = YYEOF;
1141 yytoken = YYSYMBOL_YYEOF;
1142 YYDPRINTF ((stderr, "Now at end of input.\n"));
1143 }
1144 else if (yychar == YYerror)
1145 {
1146 /* The scanner already issued an error message, process directly
1147 to error recovery. But do not keep the error token as
1148 lookahead, it is too special and may lead us to an endless
1149 loop in error recovery. */
1150 yychar = YYUNDEF;
1151 yytoken = YYSYMBOL_YYerror;
1152 goto yyerrlab1;
1153 }
1154 else
1155 {
1156 yytoken = YYTRANSLATE (yychar);
1157 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1158 }
1159
1160 /* If the proper action on seeing token YYTOKEN is to reduce or to
1161 detect an error, take that action. */
1162 yyn += yytoken;
1163 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1164 goto yydefault;
1165 yyn = yytable[yyn];
1166 if (yyn <= 0)
1167 {
1168 if (yytable_value_is_error (yyn))
1169 goto yyerrlab;
1170 yyn = -yyn;
1171 goto yyreduce;
1172 }
1173
1174 /* Count tokens shifted since error; after three, turn off error
1175 status. */
1176 if (yyerrstatus)
1177 yyerrstatus--;
1178
1179 /* Shift the lookahead token. */
1180 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1181 yystate = yyn;
1182 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1183 *++yyvsp = yylval;
1184 YY_IGNORE_MAYBE_UNINITIALIZED_END
1185
1186 /* Discard the shifted token. */
1187 yychar = YYEMPTY;
1188 goto yynewstate;
1189
1190
1191 /*-----------------------------------------------------------.
1192 | yydefault -- do the default action for the current state. |
1193 `-----------------------------------------------------------*/
1194 yydefault:
1195 yyn = yydefact[yystate];
1196 if (yyn == 0)
1197 goto yyerrlab;
1198 goto yyreduce;
1199
1200
1201 /*-----------------------------.
1202 | yyreduce -- do a reduction. |
1203 `-----------------------------*/
1204 yyreduce:
1205 /* yyn is the number of a rule to reduce with. */
1206 yylen = yyr2[yyn];
1207
1208 /* If YYLEN is nonzero, implement the default value of the action:
1209 '$$ = $1'.
1210
1211 Otherwise, the following line sets YYVAL to garbage.
1212 This behavior is undocumented and Bison
1213 users should not rely upon it. Assigning to YYVAL
1214 unconditionally makes the parser a bit smaller, and it avoids a
1215 GCC warning that YYVAL may be used uninitialized. */
1216 yyval = yyvsp[1-yylen];
1217
1218
1219 YY_REDUCE_PRINT (yyn);
1220 switch (yyn)
1221 {
1222 case 2: /* devtree: %empty */
1223 { cur_parent = root_parent; }
1224 break;
1225
1226 case 24: /* @1: %empty */
1227 {
1228 (yyval.chip_instance) = new_chip_instance((yyvsp[0].string));
1229 chip_enqueue_tail(cur_chip_instance);
1230 cur_chip_instance = (yyval.chip_instance);
1231 }
1232 break;
1233
1234 case 25: /* chip: CHIP STRING @1 chipchildren_dev END */
1235 {
1236 cur_chip_instance = chip_dequeue_tail();
1237 }
1238 break;
1239
1240 case 26: /* @2: %empty */
1241 {
1242 (yyval.dev) = new_device_raw(cur_parent, cur_chip_instance, (yyvsp[-3].number), (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].number));
1243 cur_parent = (yyval.dev)->bus;
1244 }
1245 break;
1246
1247 case 27: /* device: DEVICE BUS NUMBER alias status @2 devicechildren END */
1248 {
1249 cur_parent = (yyvsp[-2].dev)->parent;
1250 }
1251 break;
1252
1253 case 28: /* @3: %empty */
1254 {
1255 (yyval.dev) = new_device_reference(cur_parent, cur_chip_instance, (yyvsp[-1].string), (yyvsp[0].number));
1256 cur_parent = (yyval.dev)->bus;
1257 }
1258 break;
1259
1260 case 29: /* device: DEVICE REFERENCE STRING status @3 devicechildren END */
1261 {
1262 cur_parent = (yyvsp[-2].dev)->parent;
1263 }
1264 break;
1265
1266 case 30: /* alias: %empty */
1267 {
1268 (yyval.string) = NULL;
1269 }
1270 break;
1271
1272 case 31: /* alias: ALIAS STRING */
1273 {
1274 (yyval.string) = (yyvsp[0].string);
1275 }
1276 break;
1277
1278 case 34: /* resource: RESOURCE NUMBER EQUALS NUMBER */
1279 { add_resource(cur_parent, (yyvsp[-3].number), strtol((yyvsp[-2].string), NULL, 0), strtol((yyvsp[0].string), NULL, 0)); }
1280 break;
1281
1282 case 35: /* reference: REFERENCE STRING ASSOCIATION STRING */
1283 { add_reference(cur_chip_instance, (yyvsp[0].string), (yyvsp[-2].string)); }
1284 break;
1285
1286 case 36: /* registers: REGISTER STRING EQUALS STRING */
1287 { add_register(cur_chip_instance, (yyvsp[-2].string), (yyvsp[0].string)); }
1288 break;
1289
1290 case 37: /* subsystemid: SUBSYSTEMID NUMBER NUMBER */
1291 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-1].string), NULL, 16), strtol((yyvsp[0].string), NULL, 16), 0); }
1292 break;
1293
1294 case 38: /* subsystemid: SUBSYSTEMID NUMBER NUMBER INHERIT */
1295 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-2].string), NULL, 16), strtol((yyvsp[-1].string), NULL, 16), 1); }
1296 break;
1297
1298 case 39: /* smbios_slot_desc: SLOT_DESC STRING STRING STRING STRING */
1299 { add_slot_desc(cur_parent, (yyvsp[-3].string), (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].string)); }
1300 break;
1301
1302 case 40: /* smbios_slot_desc: SLOT_DESC STRING STRING STRING */
1303 { add_slot_desc(cur_parent, (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].string), NULL); }
1304 break;
1305
1306 case 41: /* smbios_slot_desc: SLOT_DESC STRING STRING */
1307 { add_slot_desc(cur_parent, (yyvsp[-1].string), (yyvsp[0].string), NULL, NULL); }
1308 break;
1309
1310 case 42: /* smbios_dev_info: SMBIOS_DEV_INFO NUMBER STRING */
1311 { add_smbios_dev_info(cur_parent, strtol((yyvsp[-1].string), NULL, 0), (yyvsp[0].string)); }
1312 break;
1313
1314 case 43: /* smbios_dev_info: SMBIOS_DEV_INFO NUMBER */
1315 { add_smbios_dev_info(cur_parent, strtol((yyvsp[0].string), NULL, 0), NULL); }
1316 break;
1317
1318 case 44: /* fw_config_table: FW_CONFIG_TABLE fw_config_table_children END */
1319 { }
1320 break;
1321
1322 case 49: /* fw_config_field_bits: NUMBER NUMBER */
1323 {
1324 append_fw_config_bits(&cur_bits, strtoul((yyvsp[-1].string), NULL, 0), strtoul((yyvsp[0].string), NULL, 0));
1325 }
1326 break;
1327
1328 case 52: /* $@4: %empty */
1329 { cur_field = new_fw_config_field((yyvsp[-2].string), cur_bits); }
1330 break;
1331
1332 case 53: /* fw_config_field: FW_CONFIG_FIELD STRING fw_config_field_bits fw_config_field_bits_repeating $@4 fw_config_field_children END */
1333 { cur_bits = NULL; }
1334 break;
1335
1336 case 54: /* $@5: %empty */
1337 {
1338 cur_bits = NULL;
1339 append_fw_config_bits(&cur_bits, strtoul((yyvsp[0].string), NULL, 0), strtoul((yyvsp[0].string), NULL, 0));
1340 cur_field = new_fw_config_field((yyvsp[-1].string), cur_bits);
1341 }
1342 break;
1343
1344 case 55: /* fw_config_field: FW_CONFIG_FIELD STRING NUMBER $@5 fw_config_field_children END */
1345 { cur_bits = NULL; }
1346 break;
1347
1348 case 56: /* $@6: %empty */
1349 {
1350 cur_field = get_fw_config_field((yyvsp[0].string));
1351 }
1352 break;
1353
1354 case 57: /* fw_config_field: FW_CONFIG_FIELD STRING $@6 fw_config_field_children END */
1355 { cur_bits = NULL; }
1356 break;
1357
1358 case 58: /* fw_config_option: FW_CONFIG_OPTION STRING NUMBER */
1359 { add_fw_config_option(cur_field, (yyvsp[-1].string), strtoull((yyvsp[0].string), NULL, 0)); }
1360 break;
1361
1362 case 59: /* fw_config_probe: FW_CONFIG_PROBE STRING STRING */
1363 { add_fw_config_probe(cur_parent, (yyvsp[-1].string), (yyvsp[0].string)); }
1364 break;
1365
1366 case 60: /* fw_config_probe: FW_CONFIG_PROBE FW_CONFIG_UNPROVISIONED */
1367 { probe_unprovisioned_fw_config(cur_parent); }
1368 break;
1369
1370 case 61: /* ops: OPS STRING */
1371 { add_device_ops(cur_parent, (yyvsp[0].string)); }
1372 break;
1373
1374
1375
1376 default: break;
1377 }
1378 /* User semantic actions sometimes alter yychar, and that requires
1379 that yytoken be updated with the new translation. We take the
1380 approach of translating immediately before every use of yytoken.
1381 One alternative is translating here after every semantic action,
1382 but that translation would be missed if the semantic action invokes
1383 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1384 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1385 incorrect destructor might then be invoked immediately. In the
1386 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1387 to an incorrect destructor call or verbose syntax error message
1388 before the lookahead is translated. */
1389 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1390
1391 YYPOPSTACK (yylen);
1392 yylen = 0;
1393
1394 *++yyvsp = yyval;
1395
1396 /* Now 'shift' the result of the reduction. Determine what state
1397 that goes to, based on the state we popped back to and the rule
1398 number reduced by. */
1399 {
1400 const int yylhs = yyr1[yyn] - YYNTOKENS;
1401 const int yyi = yypgoto[yylhs] + *yyssp;
1402 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1403 ? yytable[yyi]
1404 : yydefgoto[yylhs]);
1405 }
1406
1407 goto yynewstate;
1408
1409
1410 /*--------------------------------------.
1411 | yyerrlab -- here on detecting error. |
1412 `--------------------------------------*/
1413 yyerrlab:
1414 /* Make sure we have latest lookahead translation. See comments at
1415 user semantic actions for why this is necessary. */
1416 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1417 /* If not already recovering from an error, report this error. */
1418 if (!yyerrstatus)
1419 {
1420 ++yynerrs;
1421 yyerror (YY_("syntax error"));
1422 }
1423
1424 if (yyerrstatus == 3)
1425 {
1426 /* If just tried and failed to reuse lookahead token after an
1427 error, discard it. */
1428
1429 if (yychar <= YYEOF)
1430 {
1431 /* Return failure if at end of input. */
1432 if (yychar == YYEOF)
1433 YYABORT;
1434 }
1435 else
1436 {
1437 yydestruct ("Error: discarding",
1438 yytoken, &yylval);
1439 yychar = YYEMPTY;
1440 }
1441 }
1442
1443 /* Else will try to reuse lookahead token after shifting the error
1444 token. */
1445 goto yyerrlab1;
1446
1447
1448 /*---------------------------------------------------.
1449 | yyerrorlab -- error raised explicitly by YYERROR. |
1450 `---------------------------------------------------*/
1451 yyerrorlab:
1452 /* Pacify compilers when the user code never invokes YYERROR and the
1453 label yyerrorlab therefore never appears in user code. */
1454 if (0)
1455 YYERROR;
1456 ++yynerrs;
1457
1458 /* Do not reclaim the symbols of the rule whose action triggered
1459 this YYERROR. */
1460 YYPOPSTACK (yylen);
1461 yylen = 0;
1462 YY_STACK_PRINT (yyss, yyssp);
1463 yystate = *yyssp;
1464 goto yyerrlab1;
1465
1466
1467 /*-------------------------------------------------------------.
1468 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1469 `-------------------------------------------------------------*/
1470 yyerrlab1:
1471 yyerrstatus = 3; /* Each real token shifted decrements this. */
1472
1473 /* Pop stack until we find a state that shifts the error token. */
1474 for (;;)
1475 {
1476 yyn = yypact[yystate];
1477 if (!yypact_value_is_default (yyn))
1478 {
1479 yyn += YYSYMBOL_YYerror;
1480 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1481 {
1482 yyn = yytable[yyn];
1483 if (0 < yyn)
1484 break;
1485 }
1486 }
1487
1488 /* Pop the current state because it cannot handle the error token. */
1489 if (yyssp == yyss)
1490 YYABORT;
1491
1492
1493 yydestruct ("Error: popping",
1494 YY_ACCESSING_SYMBOL (yystate), yyvsp);
1495 YYPOPSTACK (1);
1496 yystate = *yyssp;
1497 YY_STACK_PRINT (yyss, yyssp);
1498 }
1499
1500 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1501 *++yyvsp = yylval;
1502 YY_IGNORE_MAYBE_UNINITIALIZED_END
1503
1504
1505 /* Shift the error token. */
1506 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1507
1508 yystate = yyn;
1509 goto yynewstate;
1510
1511
1512 /*-------------------------------------.
1513 | yyacceptlab -- YYACCEPT comes here. |
1514 `-------------------------------------*/
1515 yyacceptlab:
1516 yyresult = 0;
1517 goto yyreturnlab;
1518
1519
1520 /*-----------------------------------.
1521 | yyabortlab -- YYABORT comes here. |
1522 `-----------------------------------*/
1523 yyabortlab:
1524 yyresult = 1;
1525 goto yyreturnlab;
1526
1527
1528 /*-----------------------------------------------------------.
1529 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
1530 `-----------------------------------------------------------*/
1531 yyexhaustedlab:
1532 yyerror (YY_("memory exhausted"));
1533 yyresult = 2;
1534 goto yyreturnlab;
1535
1536
1537 /*----------------------------------------------------------.
1538 | yyreturnlab -- parsing is finished, clean up and return. |
1539 `----------------------------------------------------------*/
1540 yyreturnlab:
1541 if (yychar != YYEMPTY)
1542 {
1543 /* Make sure we have latest lookahead translation. See comments at
1544 user semantic actions for why this is necessary. */
1545 yytoken = YYTRANSLATE (yychar);
1546 yydestruct ("Cleanup: discarding lookahead",
1547 yytoken, &yylval);
1548 }
1549 /* Do not reclaim the symbols of the rule whose action triggered
1550 this YYABORT or YYACCEPT. */
1551 YYPOPSTACK (yylen);
1552 YY_STACK_PRINT (yyss, yyssp);
1553 while (yyssp != yyss)
1554 {
1555 yydestruct ("Cleanup: popping",
1556 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
1557 YYPOPSTACK (1);
1558 }
1559 #ifndef yyoverflow
1560 if (yyss != yyssa)
1561 YYSTACK_FREE (yyss);
1562 #endif
1563
1564 return yyresult;
1565 }
1566
1567