1 /* A Bison parser, made by GNU Bison 3.0.5. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "3.0.5"
50 #define YYSKELETON_NAME "yacc.c"
64 /* Copy the first part of user declarations. */
68 * sconfig, coreboot device tree compiler
70 * Copyright (C) 2010 coresystems GmbH
71 * written by Patrick Georgi <patrick@georgi-clan.de>
73 * This program is free software; you can redistribute it and/or modify
74 * it under the terms of the GNU General Public License as published by
75 * the Free Software Foundation; version 2 of the License.
77 * This program is distributed in the hope that it will be useful,
78 * but WITHOUT ANY WARRANTY; without even the implied warranty of
79 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
80 * GNU General Public License for more details.
86 void yyerror(const char *s);
88 static struct bus *cur_parent;
89 static struct chip_instance *cur_chip_instance;
95 # if defined __cplusplus && 201103L <= __cplusplus
96 # define YY_NULLPTR nullptr
102 /* Enabling verbose error messages. */
103 #ifdef YYERROR_VERBOSE
104 # undef YYERROR_VERBOSE
105 # define YYERROR_VERBOSE 1
107 # define YYERROR_VERBOSE 0
110 /* In a future release of Bison, this section will be replaced
111 by #include "sconfig.tab.h_shipped". */
112 #ifndef YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
113 # define YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
163 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
170 struct chip_instance *chip_instance;
177 typedef union YYSTYPE YYSTYPE;
178 # define YYSTYPE_IS_TRIVIAL 1
179 # define YYSTYPE_IS_DECLARED 1
183 extern YYSTYPE yylval;
187 #endif /* !YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */
189 /* Copy the second part of user declarations. */
198 typedef YYTYPE_UINT8 yytype_uint8;
200 typedef unsigned char yytype_uint8;
204 typedef YYTYPE_INT8 yytype_int8;
206 typedef signed char yytype_int8;
210 typedef YYTYPE_UINT16 yytype_uint16;
212 typedef unsigned short int yytype_uint16;
216 typedef YYTYPE_INT16 yytype_int16;
218 typedef short int yytype_int16;
222 # ifdef __SIZE_TYPE__
223 # define YYSIZE_T __SIZE_TYPE__
224 # elif defined size_t
225 # define YYSIZE_T size_t
226 # elif ! defined YYSIZE_T
227 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
228 # define YYSIZE_T size_t
230 # define YYSIZE_T unsigned int
234 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
237 # if defined YYENABLE_NLS && YYENABLE_NLS
239 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
240 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
244 # define YY_(Msgid) Msgid
249 # if (defined __GNUC__ \
250 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
251 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
252 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
254 # define YY_ATTRIBUTE(Spec) /* empty */
258 #ifndef YY_ATTRIBUTE_PURE
259 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
262 #ifndef YY_ATTRIBUTE_UNUSED
263 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
266 #if !defined _Noreturn \
267 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
268 # if defined _MSC_VER && 1200 <= _MSC_VER
269 # define _Noreturn __declspec (noreturn)
271 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
275 /* Suppress unused-variable warnings by "using" E. */
276 #if ! defined lint || defined __GNUC__
277 # define YYUSE(E) ((void) (E))
279 # define YYUSE(E) /* empty */
282 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
283 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
284 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
285 _Pragma ("GCC diagnostic push") \
286 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
287 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
288 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
289 _Pragma ("GCC diagnostic pop")
291 # define YY_INITIAL_VALUE(Value) Value
293 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
294 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
295 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
297 #ifndef YY_INITIAL_VALUE
298 # define YY_INITIAL_VALUE(Value) /* Nothing. */
302 #if ! defined yyoverflow || YYERROR_VERBOSE
304 /* The parser invokes alloca or malloc; define the necessary symbols. */
306 # ifdef YYSTACK_USE_ALLOCA
307 # if YYSTACK_USE_ALLOCA
309 # define YYSTACK_ALLOC __builtin_alloca
310 # elif defined __BUILTIN_VA_ARG_INCR
311 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
313 # define YYSTACK_ALLOC __alloca
314 # elif defined _MSC_VER
315 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
316 # define alloca _alloca
318 # define YYSTACK_ALLOC alloca
319 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
320 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
321 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
322 # ifndef EXIT_SUCCESS
323 # define EXIT_SUCCESS 0
330 # ifdef YYSTACK_ALLOC
331 /* Pacify GCC's 'empty if-body' warning. */
332 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
333 # ifndef YYSTACK_ALLOC_MAXIMUM
334 /* The OS might guarantee only one guard page at the bottom of the stack,
335 and a page size can be as small as 4096 bytes. So we cannot safely
336 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
337 to allow for a few compiler-allocated temporary stack slots. */
338 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
341 # define YYSTACK_ALLOC YYMALLOC
342 # define YYSTACK_FREE YYFREE
343 # ifndef YYSTACK_ALLOC_MAXIMUM
344 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
346 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
347 && ! ((defined YYMALLOC || defined malloc) \
348 && (defined YYFREE || defined free)))
349 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
350 # ifndef EXIT_SUCCESS
351 # define EXIT_SUCCESS 0
355 # define YYMALLOC malloc
356 # if ! defined malloc && ! defined EXIT_SUCCESS
357 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
362 # if ! defined free && ! defined EXIT_SUCCESS
363 void free (void *); /* INFRINGES ON USER NAME SPACE */
367 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
370 #if (! defined yyoverflow \
371 && (! defined __cplusplus \
372 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
374 /* A type that is properly aligned for any stack member. */
377 yytype_int16 yyss_alloc;
381 /* The size of the maximum gap between one aligned stack and the next. */
382 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
384 /* The size of an array large to enough to hold all stacks, each with
386 # define YYSTACK_BYTES(N) \
387 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
388 + YYSTACK_GAP_MAXIMUM)
390 # define YYCOPY_NEEDED 1
392 /* Relocate STACK from its old location to the new one. The
393 local variables YYSIZE and YYSTACKSIZE give the old and new number of
394 elements in the stack, and YYPTR gives the new location of the
395 stack. Advance YYPTR to a properly aligned location for the next
397 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
400 YYSIZE_T yynewbytes; \
401 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
402 Stack = &yyptr->Stack_alloc; \
403 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
404 yyptr += yynewbytes / sizeof (*yyptr); \
410 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
411 /* Copy COUNT objects from SRC to DST. The source and destination do
414 # if defined __GNUC__ && 1 < __GNUC__
415 # define YYCOPY(Dst, Src, Count) \
416 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
418 # define YYCOPY(Dst, Src, Count) \
422 for (yyi = 0; yyi < (Count); yyi++) \
423 (Dst)[yyi] = (Src)[yyi]; \
428 #endif /* !YYCOPY_NEEDED */
430 /* YYFINAL -- State number of the termination state. */
432 /* YYLAST -- Last index in YYTABLE. */
435 /* YYNTOKENS -- Number of terminals. */
437 /* YYNNTS -- Number of nonterminals. */
439 /* YYNRULES -- Number of rules. */
441 /* YYNSTATES -- Number of states. */
444 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
445 by yylex, with out-of-bounds checking. */
447 #define YYMAXUTOK 289
449 #define YYTRANSLATE(YYX) \
450 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
452 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
453 as returned by yylex, without out-of-bounds checking. */
454 static const yytype_uint8 yytranslate[] =
456 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
481 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
482 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
483 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
484 25, 26, 27, 28, 29, 30, 31, 32, 33, 34
488 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
489 static const yytype_uint8 yyrline[] =
491 0, 36, 36, 36, 38, 38, 38, 38, 40, 40,
492 40, 40, 40, 40, 40, 42, 42, 51, 51, 59,
493 59, 61, 64, 67, 70, 73, 76, 79, 82
497 #if YYDEBUG || YYERROR_VERBOSE || 0
498 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
499 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
500 static const char *const yytname[] =
502 "$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
503 "HIDDEN", "BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI",
504 "PNP", "I2C", "APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ",
505 "SLOT_DESC", "IO", "NUMBER", "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ",
506 "IOAPIC", "PCIINT", "GENERIC", "SPI", "USB", "MMIO", "$accept",
507 "devtree", "$@1", "chipchildren", "devicechildren", "chip", "@2",
508 "device", "@3", "status", "resource", "registers", "subsystemid",
509 "ioapic_irq", "smbios_slot_desc", YY_NULLPTR
514 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
515 (internal) symbol number NUM (which must be that of a token). */
516 static const yytype_uint16 yytoknum[] =
518 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
519 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
520 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
521 285, 286, 287, 288, 289
525 #define YYPACT_NINF -12
527 #define yypact_value_is_default(Yystate) \
528 (!!((Yystate) == (-12)))
530 #define YYTABLE_NINF -1
532 #define yytable_value_is_error(Yytable_value) \
535 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
537 static const yytype_int8 yypact[] =
539 -12, 11, 9, -12, 1, -12, -12, -12, 0, 5,
540 3, -12, -12, -12, -12, -10, 6, 2, 8, -12,
541 -12, -12, -12, -12, -3, -1, -12, 13, 4, 7,
542 -12, -12, -12, -12, -12, -12, 16, 15, 10, -11,
543 12, 17, -5, 14, -12, 18, -12, -12, -12
546 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
547 Performed when YYTABLE does not specify something else to do. Zero
548 means the default is an error. */
549 static const yytype_uint8 yydefact[] =
551 2, 0, 0, 1, 0, 3, 15, 7, 0, 0,
552 0, 16, 5, 4, 6, 0, 0, 0, 0, 19,
553 20, 17, 22, 14, 0, 0, 18, 0, 0, 0,
554 9, 8, 10, 11, 12, 13, 0, 0, 0, 0,
555 0, 28, 23, 0, 21, 27, 24, 25, 26
558 /* YYPGOTO[NTERM-NUM]. */
559 static const yytype_int8 yypgoto[] =
561 -12, -12, -12, -12, -12, -6, -12, 19, -12, -12,
562 -12, -12, -12, -12, -12
565 /* YYDEFGOTO[NTERM-NUM]. */
566 static const yytype_int8 yydefgoto[] =
568 -1, 1, 2, 8, 24, 5, 7, 13, 23, 21,
572 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
573 positive, shift that token. If negative, reduce the rule whose
574 number is the opposite. If YYTABLE_NINF, syntax error. */
575 static const yytype_uint8 yytable[] =
577 4, 9, 12, 4, 9, 10, 25, 26, 19, 20,
578 11, 3, 4, 15, 6, 17, 16, 18, 30, 43,
579 27, 22, 46, 28, 36, 29, 37, 40, 41, 38,
580 45, 48, 39, 0, 0, 42, 0, 44, 0, 47,
584 static const yytype_int8 yycheck[] =
586 3, 4, 8, 3, 4, 5, 9, 10, 6, 7,
587 10, 0, 3, 8, 13, 25, 13, 11, 24, 30,
588 23, 13, 27, 26, 25, 28, 13, 11, 13, 25,
589 13, 13, 25, -1, -1, 25, -1, 25, -1, 25,
593 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
594 symbol of state STATE-NUM. */
595 static const yytype_uint8 yystos[] =
597 0, 36, 37, 0, 3, 40, 13, 41, 38, 4,
598 5, 10, 40, 42, 46, 8, 13, 25, 11, 6,
599 7, 44, 13, 43, 39, 9, 10, 23, 26, 28,
600 40, 42, 45, 47, 48, 49, 25, 13, 25, 25,
601 11, 13, 25, 30, 25, 13, 27, 25, 13
604 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
605 static const yytype_uint8 yyr1[] =
607 0, 35, 37, 36, 38, 38, 38, 38, 39, 39,
608 39, 39, 39, 39, 39, 41, 40, 43, 42, 44,
609 44, 45, 46, 47, 47, 48, 49, 49, 49
612 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
613 static const yytype_uint8 yyr2[] =
615 0, 2, 0, 2, 2, 2, 2, 0, 2, 2,
616 2, 2, 2, 2, 0, 0, 5, 0, 7, 1,
617 1, 4, 4, 3, 4, 4, 5, 4, 3
621 #define yyerrok (yyerrstatus = 0)
622 #define yyclearin (yychar = YYEMPTY)
626 #define YYACCEPT goto yyacceptlab
627 #define YYABORT goto yyabortlab
628 #define YYERROR goto yyerrorlab
631 #define YYRECOVERING() (!!yyerrstatus)
633 #define YYBACKUP(Token, Value) \
635 if (yychar == YYEMPTY) \
639 YYPOPSTACK (yylen); \
645 yyerror (YY_("syntax error: cannot back up")); \
650 /* Error token number */
652 #define YYERRCODE 256
656 /* Enable debugging if requested. */
660 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
661 # define YYFPRINTF fprintf
664 # define YYDPRINTF(Args) \
670 /* This macro is provided for backward compatibility. */
671 #ifndef YY_LOCATION_PRINT
672 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
676 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
680 YYFPRINTF (stderr, "%s ", Title); \
681 yy_symbol_print (stderr, \
683 YYFPRINTF (stderr, "\n"); \
688 /*----------------------------------------.
689 | Print this symbol's value on YYOUTPUT. |
690 `----------------------------------------*/
693 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
695 FILE *yyo = yyoutput;
700 if (yytype < YYNTOKENS)
701 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
707 /*--------------------------------.
708 | Print this symbol on YYOUTPUT. |
709 `--------------------------------*/
712 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
714 YYFPRINTF (yyoutput, "%s %s (",
715 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
717 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
718 YYFPRINTF (yyoutput, ")");
721 /*------------------------------------------------------------------.
722 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
724 `------------------------------------------------------------------*/
727 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
729 YYFPRINTF (stderr, "Stack now");
730 for (; yybottom <= yytop; yybottom++)
732 int yybot = *yybottom;
733 YYFPRINTF (stderr, " %d", yybot);
735 YYFPRINTF (stderr, "\n");
738 # define YY_STACK_PRINT(Bottom, Top) \
741 yy_stack_print ((Bottom), (Top)); \
745 /*------------------------------------------------.
746 | Report that the YYRULE is going to be reduced. |
747 `------------------------------------------------*/
750 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
752 unsigned long int yylno = yyrline[yyrule];
753 int yynrhs = yyr2[yyrule];
755 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
757 /* The symbols being reduced. */
758 for (yyi = 0; yyi < yynrhs; yyi++)
760 YYFPRINTF (stderr, " $%d = ", yyi + 1);
761 yy_symbol_print (stderr,
762 yystos[yyssp[yyi + 1 - yynrhs]],
763 &(yyvsp[(yyi + 1) - (yynrhs)])
765 YYFPRINTF (stderr, "\n");
769 # define YY_REDUCE_PRINT(Rule) \
772 yy_reduce_print (yyssp, yyvsp, Rule); \
775 /* Nonzero means print parse trace. It is left uninitialized so that
776 multiple parsers can coexist. */
779 # define YYDPRINTF(Args)
780 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
781 # define YY_STACK_PRINT(Bottom, Top)
782 # define YY_REDUCE_PRINT(Rule)
783 #endif /* !YYDEBUG */
786 /* YYINITDEPTH -- initial size of the parser's stacks. */
788 # define YYINITDEPTH 200
791 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
792 if the built-in stack extension method is used).
794 Do not make this value too large; the results are undefined if
795 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
796 evaluated with infinite-precision integer arithmetic. */
799 # define YYMAXDEPTH 10000
806 # if defined __GLIBC__ && defined _STRING_H
807 # define yystrlen strlen
809 /* Return the length of YYSTR. */
811 yystrlen (const char *yystr)
814 for (yylen = 0; yystr[yylen]; yylen++)
822 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
823 # define yystpcpy stpcpy
825 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
828 yystpcpy (char *yydest, const char *yysrc)
831 const char *yys = yysrc;
833 while ((*yyd++ = *yys++) != '\0')
842 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
843 quotes and backslashes, so that it's suitable for yyerror. The
844 heuristic is that double-quoting is unnecessary unless the string
845 contains an apostrophe, a comma, or backslash (other than
846 backslash-backslash). YYSTR is taken from yytname. If YYRES is
847 null, do not copy; instead, return the length of what the result
850 yytnamerr (char *yyres, const char *yystr)
855 char const *yyp = yystr;
862 goto do_not_strip_quotes;
866 goto do_not_strip_quotes;
879 do_not_strip_quotes: ;
883 return yystrlen (yystr);
885 return yystpcpy (yyres, yystr) - yyres;
889 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
890 about the unexpected token YYTOKEN for the state stack whose top is
893 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
894 not large enough to hold the message. In that case, also set
895 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
896 required number of bytes is too large to store. */
898 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
899 yytype_int16 *yyssp, int yytoken)
901 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
902 YYSIZE_T yysize = yysize0;
903 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
904 /* Internationalized format string. */
905 const char *yyformat = YY_NULLPTR;
906 /* Arguments of yyformat. */
907 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
908 /* Number of reported tokens (one for the "unexpected", one per
912 /* There are many possibilities here to consider:
913 - If this state is a consistent state with a default action, then
914 the only way this function was invoked is if the default action
915 is an error action. In that case, don't check for expected
916 tokens because there are none.
917 - The only way there can be no lookahead present (in yychar) is if
918 this state is a consistent state with a default action. Thus,
919 detecting the absence of a lookahead is sufficient to determine
920 that there is no unexpected or expected token to report. In that
921 case, just report a simple "syntax error".
922 - Don't assume there isn't a lookahead just because this state is a
923 consistent state with a default action. There might have been a
924 previous inconsistent state, consistent state with a non-default
925 action, or user semantic action that manipulated yychar.
926 - Of course, the expected token list depends on states to have
927 correct lookahead information, and it depends on the parser not
928 to perform extra reductions after fetching a lookahead from the
929 scanner and before detecting a syntax error. Thus, state merging
930 (from LALR or IELR) and default reductions corrupt the expected
931 token list. However, the list is correct for canonical LR with
932 one exception: it will still contain any token that will not be
933 accepted due to an error action in a later state.
935 if (yytoken != YYEMPTY)
937 int yyn = yypact[*yyssp];
938 yyarg[yycount++] = yytname[yytoken];
939 if (!yypact_value_is_default (yyn))
941 /* Start YYX at -YYN if negative to avoid negative indexes in
942 YYCHECK. In other words, skip the first -YYN actions for
943 this state because they are default actions. */
944 int yyxbegin = yyn < 0 ? -yyn : 0;
945 /* Stay within bounds of both yycheck and yytname. */
946 int yychecklim = YYLAST - yyn + 1;
947 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
950 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
951 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
952 && !yytable_value_is_error (yytable[yyx + yyn]))
954 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
960 yyarg[yycount++] = yytname[yyx];
962 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
963 if (! (yysize <= yysize1
964 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
974 # define YYCASE_(N, S) \
978 default: /* Avoid compiler warnings. */
979 YYCASE_(0, YY_("syntax error"));
980 YYCASE_(1, YY_("syntax error, unexpected %s"));
981 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
982 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
983 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
984 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
989 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
990 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
995 if (*yymsg_alloc < yysize)
997 *yymsg_alloc = 2 * yysize;
998 if (! (yysize <= *yymsg_alloc
999 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1000 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1004 /* Avoid sprintf, as that infringes on the user's name space.
1005 Don't have undefined behavior even if the translation
1006 produced a string with the wrong number of "%s"s. */
1010 while ((*yyp = *yyformat) != '\0')
1011 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1013 yyp += yytnamerr (yyp, yyarg[yyi++]);
1024 #endif /* YYERROR_VERBOSE */
1026 /*-----------------------------------------------.
1027 | Release the memory associated to this symbol. |
1028 `-----------------------------------------------*/
1031 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1036 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1038 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1040 YY_IGNORE_MAYBE_UNINITIALIZED_END
1046 /* The lookahead symbol. */
1049 /* The semantic value of the lookahead symbol. */
1051 /* Number of syntax errors so far. */
1063 /* Number of tokens to shift before error messages enabled. */
1066 /* The stacks and their tools:
1067 'yyss': related to states.
1068 'yyvs': related to semantic values.
1070 Refer to the stacks through separate pointers, to allow yyoverflow
1071 to reallocate them elsewhere. */
1073 /* The state stack. */
1074 yytype_int16 yyssa[YYINITDEPTH];
1076 yytype_int16 *yyssp;
1078 /* The semantic value stack. */
1079 YYSTYPE yyvsa[YYINITDEPTH];
1083 YYSIZE_T yystacksize;
1087 /* Lookahead token as an internal (translated) token number. */
1089 /* The variables used to return semantic value and location from the
1094 /* Buffer for error messages, and its allocated size. */
1096 char *yymsg = yymsgbuf;
1097 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1100 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1102 /* The number of symbols on the RHS of the reduced rule.
1103 Keep to zero when no symbol should be popped. */
1106 yyssp = yyss = yyssa;
1107 yyvsp = yyvs = yyvsa;
1108 yystacksize = YYINITDEPTH;
1110 YYDPRINTF ((stderr, "Starting parse\n"));
1115 yychar = YYEMPTY; /* Cause a token to be read. */
1118 /*------------------------------------------------------------.
1119 | yynewstate -- Push a new state, which is found in yystate. |
1120 `------------------------------------------------------------*/
1122 /* In all cases, when you get here, the value and location stacks
1123 have just been pushed. So pushing a state here evens the stacks. */
1129 if (yyss + yystacksize - 1 <= yyssp)
1131 /* Get the current used size of the three stacks, in elements. */
1132 YYSIZE_T yysize = yyssp - yyss + 1;
1136 /* Give user a chance to reallocate the stack. Use copies of
1137 these so that the &'s don't force the real ones into
1139 YYSTYPE *yyvs1 = yyvs;
1140 yytype_int16 *yyss1 = yyss;
1142 /* Each stack pointer address is followed by the size of the
1143 data in use in that stack, in bytes. This used to be a
1144 conditional around just the two extra args, but that might
1145 be undefined if yyoverflow is a macro. */
1146 yyoverflow (YY_("memory exhausted"),
1147 &yyss1, yysize * sizeof (*yyssp),
1148 &yyvs1, yysize * sizeof (*yyvsp),
1154 #else /* no yyoverflow */
1155 # ifndef YYSTACK_RELOCATE
1156 goto yyexhaustedlab;
1158 /* Extend the stack our own way. */
1159 if (YYMAXDEPTH <= yystacksize)
1160 goto yyexhaustedlab;
1162 if (YYMAXDEPTH < yystacksize)
1163 yystacksize = YYMAXDEPTH;
1166 yytype_int16 *yyss1 = yyss;
1167 union yyalloc *yyptr =
1168 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1170 goto yyexhaustedlab;
1171 YYSTACK_RELOCATE (yyss_alloc, yyss);
1172 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1173 # undef YYSTACK_RELOCATE
1175 YYSTACK_FREE (yyss1);
1178 #endif /* no yyoverflow */
1180 yyssp = yyss + yysize - 1;
1181 yyvsp = yyvs + yysize - 1;
1183 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1184 (unsigned long int) yystacksize));
1186 if (yyss + yystacksize - 1 <= yyssp)
1190 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1192 if (yystate == YYFINAL)
1202 /* Do appropriate processing given the current state. Read a
1203 lookahead token if we need one and don't already have one. */
1205 /* First try to decide what to do without reference to lookahead token. */
1206 yyn = yypact[yystate];
1207 if (yypact_value_is_default (yyn))
1210 /* Not known => get a lookahead token if don't already have one. */
1212 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1213 if (yychar == YYEMPTY)
1215 YYDPRINTF ((stderr, "Reading a token: "));
1219 if (yychar <= YYEOF)
1221 yychar = yytoken = YYEOF;
1222 YYDPRINTF ((stderr, "Now at end of input.\n"));
1226 yytoken = YYTRANSLATE (yychar);
1227 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1230 /* If the proper action on seeing token YYTOKEN is to reduce or to
1231 detect an error, take that action. */
1233 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1238 if (yytable_value_is_error (yyn))
1244 /* Count tokens shifted since error; after three, turn off error
1249 /* Shift the lookahead token. */
1250 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1252 /* Discard the shifted token. */
1256 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1258 YY_IGNORE_MAYBE_UNINITIALIZED_END
1263 /*-----------------------------------------------------------.
1264 | yydefault -- do the default action for the current state. |
1265 `-----------------------------------------------------------*/
1267 yyn = yydefact[yystate];
1273 /*-----------------------------.
1274 | yyreduce -- Do a reduction. |
1275 `-----------------------------*/
1277 /* yyn is the number of a rule to reduce with. */
1280 /* If YYLEN is nonzero, implement the default value of the action:
1283 Otherwise, the following line sets YYVAL to garbage.
1284 This behavior is undocumented and Bison
1285 users should not rely upon it. Assigning to YYVAL
1286 unconditionally makes the parser a bit smaller, and it avoids a
1287 GCC warning that YYVAL may be used uninitialized. */
1288 yyval = yyvsp[1-yylen];
1291 YY_REDUCE_PRINT (yyn);
1296 { cur_parent = root_parent; }
1303 (yyval.chip_instance) = new_chip_instance((yyvsp[0].string));
1304 chip_enqueue_tail(cur_chip_instance);
1305 cur_chip_instance = (yyval.chip_instance);
1313 cur_chip_instance = chip_dequeue_tail();
1321 (yyval.dev) = new_device(cur_parent, cur_chip_instance, (yyvsp[-2].number), (yyvsp[-1].string), (yyvsp[0].number));
1322 cur_parent = (yyval.dev)->last_bus;
1330 cur_parent = (yyvsp[-2].dev)->parent;
1337 { add_resource(cur_parent, (yyvsp[-3].number), strtol((yyvsp[-2].string), NULL, 0), strtol((yyvsp[0].string), NULL, 0)); }
1343 { add_register(cur_chip_instance, (yyvsp[-2].string), (yyvsp[0].string)); }
1349 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-1].string), NULL, 16), strtol((yyvsp[0].string), NULL, 16), 0); }
1355 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-2].string), NULL, 16), strtol((yyvsp[-1].string), NULL, 16), 1); }
1361 { add_ioapic_info(cur_parent, strtol((yyvsp[-2].string), NULL, 16), (yyvsp[-1].string), strtol((yyvsp[0].string), NULL, 16)); }
1367 { add_slot_desc(cur_parent, (yyvsp[-3].string), (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].string)); }
1373 { add_slot_desc(cur_parent, (yyvsp[-2].string), (yyvsp[-1].string), (yyvsp[0].string), NULL); }
1379 { add_slot_desc(cur_parent, (yyvsp[-1].string), (yyvsp[0].string), NULL, NULL); }
1387 /* User semantic actions sometimes alter yychar, and that requires
1388 that yytoken be updated with the new translation. We take the
1389 approach of translating immediately before every use of yytoken.
1390 One alternative is translating here after every semantic action,
1391 but that translation would be missed if the semantic action invokes
1392 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1393 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1394 incorrect destructor might then be invoked immediately. In the
1395 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1396 to an incorrect destructor call or verbose syntax error message
1397 before the lookahead is translated. */
1398 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1402 YY_STACK_PRINT (yyss, yyssp);
1406 /* Now 'shift' the result of the reduction. Determine what state
1407 that goes to, based on the state we popped back to and the rule
1408 number reduced by. */
1412 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1413 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1414 yystate = yytable[yystate];
1416 yystate = yydefgoto[yyn - YYNTOKENS];
1421 /*--------------------------------------.
1422 | yyerrlab -- here on detecting error. |
1423 `--------------------------------------*/
1425 /* Make sure we have latest lookahead translation. See comments at
1426 user semantic actions for why this is necessary. */
1427 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1429 /* If not already recovering from an error, report this error. */
1433 #if ! YYERROR_VERBOSE
1434 yyerror (YY_("syntax error"));
1436 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1439 char const *yymsgp = YY_("syntax error");
1440 int yysyntax_error_status;
1441 yysyntax_error_status = YYSYNTAX_ERROR;
1442 if (yysyntax_error_status == 0)
1444 else if (yysyntax_error_status == 1)
1446 if (yymsg != yymsgbuf)
1447 YYSTACK_FREE (yymsg);
1448 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1452 yymsg_alloc = sizeof yymsgbuf;
1453 yysyntax_error_status = 2;
1457 yysyntax_error_status = YYSYNTAX_ERROR;
1462 if (yysyntax_error_status == 2)
1463 goto yyexhaustedlab;
1465 # undef YYSYNTAX_ERROR
1471 if (yyerrstatus == 3)
1473 /* If just tried and failed to reuse lookahead token after an
1474 error, discard it. */
1476 if (yychar <= YYEOF)
1478 /* Return failure if at end of input. */
1479 if (yychar == YYEOF)
1484 yydestruct ("Error: discarding",
1490 /* Else will try to reuse lookahead token after shifting the error
1495 /*---------------------------------------------------.
1496 | yyerrorlab -- error raised explicitly by YYERROR. |
1497 `---------------------------------------------------*/
1500 /* Pacify compilers like GCC when the user code never invokes
1501 YYERROR and the label yyerrorlab therefore never appears in user
1503 if (/*CONSTCOND*/ 0)
1506 /* Do not reclaim the symbols of the rule whose action triggered
1510 YY_STACK_PRINT (yyss, yyssp);
1515 /*-------------------------------------------------------------.
1516 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1517 `-------------------------------------------------------------*/
1519 yyerrstatus = 3; /* Each real token shifted decrements this. */
1523 yyn = yypact[yystate];
1524 if (!yypact_value_is_default (yyn))
1527 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1535 /* Pop the current state because it cannot handle the error token. */
1540 yydestruct ("Error: popping",
1541 yystos[yystate], yyvsp);
1544 YY_STACK_PRINT (yyss, yyssp);
1547 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1549 YY_IGNORE_MAYBE_UNINITIALIZED_END
1552 /* Shift the error token. */
1553 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1559 /*-------------------------------------.
1560 | yyacceptlab -- YYACCEPT comes here. |
1561 `-------------------------------------*/
1566 /*-----------------------------------.
1567 | yyabortlab -- YYABORT comes here. |
1568 `-----------------------------------*/
1573 #if !defined yyoverflow || YYERROR_VERBOSE
1574 /*-------------------------------------------------.
1575 | yyexhaustedlab -- memory exhaustion comes here. |
1576 `-------------------------------------------------*/
1578 yyerror (YY_("memory exhausted"));
1584 if (yychar != YYEMPTY)
1586 /* Make sure we have latest lookahead translation. See comments at
1587 user semantic actions for why this is necessary. */
1588 yytoken = YYTRANSLATE (yychar);
1589 yydestruct ("Cleanup: discarding lookahead",
1592 /* Do not reclaim the symbols of the rule whose action triggered
1593 this YYABORT or YYACCEPT. */
1595 YY_STACK_PRINT (yyss, yyssp);
1596 while (yyssp != yyss)
1598 yydestruct ("Cleanup: popping",
1599 yystos[*yyssp], yyvsp);
1604 YYSTACK_FREE (yyss);
1607 if (yymsg != yymsgbuf)
1608 YYSTACK_FREE (yymsg);