1 /* A Bison parser, made by GNU Bison 3.0.4. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2015 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.4"
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 device *cur_parent, *cur_bus;
94 # if defined __cplusplus && 201103L <= __cplusplus
95 # define YY_NULLPTR nullptr
101 /* Enabling verbose error messages. */
102 #ifdef YYERROR_VERBOSE
103 # undef YYERROR_VERBOSE
104 # define YYERROR_VERBOSE 1
106 # define YYERROR_VERBOSE 0
109 /* In a future release of Bison, this section will be replaced
110 by #include "sconfig.tab.h_shipped". */
111 #ifndef YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
112 # define YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED
160 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
166 struct device *device;
173 typedef union YYSTYPE YYSTYPE;
174 # define YYSTYPE_IS_TRIVIAL 1
175 # define YYSTYPE_IS_DECLARED 1
179 extern YYSTYPE yylval;
183 #endif /* !YY_YY_UTIL_SCONFIG_SCONFIG_TAB_H_SHIPPED_INCLUDED */
185 /* Copy the second part of user declarations. */
194 typedef YYTYPE_UINT8 yytype_uint8;
196 typedef unsigned char yytype_uint8;
200 typedef YYTYPE_INT8 yytype_int8;
202 typedef signed char yytype_int8;
206 typedef YYTYPE_UINT16 yytype_uint16;
208 typedef unsigned short int yytype_uint16;
212 typedef YYTYPE_INT16 yytype_int16;
214 typedef short int yytype_int16;
218 # ifdef __SIZE_TYPE__
219 # define YYSIZE_T __SIZE_TYPE__
220 # elif defined size_t
221 # define YYSIZE_T size_t
222 # elif ! defined YYSIZE_T
223 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
224 # define YYSIZE_T size_t
226 # define YYSIZE_T unsigned int
230 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
233 # if defined YYENABLE_NLS && YYENABLE_NLS
235 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
236 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
240 # define YY_(Msgid) Msgid
245 # if (defined __GNUC__ \
246 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
247 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
248 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
250 # define YY_ATTRIBUTE(Spec) /* empty */
254 #ifndef YY_ATTRIBUTE_PURE
255 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
258 #ifndef YY_ATTRIBUTE_UNUSED
259 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
262 #if !defined _Noreturn \
263 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
264 # if defined _MSC_VER && 1200 <= _MSC_VER
265 # define _Noreturn __declspec (noreturn)
267 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
271 /* Suppress unused-variable warnings by "using" E. */
272 #if ! defined lint || defined __GNUC__
273 # define YYUSE(E) ((void) (E))
275 # define YYUSE(E) /* empty */
278 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
279 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
280 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
281 _Pragma ("GCC diagnostic push") \
282 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
283 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
284 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
285 _Pragma ("GCC diagnostic pop")
287 # define YY_INITIAL_VALUE(Value) Value
289 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
290 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
291 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
293 #ifndef YY_INITIAL_VALUE
294 # define YY_INITIAL_VALUE(Value) /* Nothing. */
298 #if ! defined yyoverflow || YYERROR_VERBOSE
300 /* The parser invokes alloca or malloc; define the necessary symbols. */
302 # ifdef YYSTACK_USE_ALLOCA
303 # if YYSTACK_USE_ALLOCA
305 # define YYSTACK_ALLOC __builtin_alloca
306 # elif defined __BUILTIN_VA_ARG_INCR
307 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
309 # define YYSTACK_ALLOC __alloca
310 # elif defined _MSC_VER
311 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
312 # define alloca _alloca
314 # define YYSTACK_ALLOC alloca
315 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
316 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
317 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
318 # ifndef EXIT_SUCCESS
319 # define EXIT_SUCCESS 0
326 # ifdef YYSTACK_ALLOC
327 /* Pacify GCC's 'empty if-body' warning. */
328 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
329 # ifndef YYSTACK_ALLOC_MAXIMUM
330 /* The OS might guarantee only one guard page at the bottom of the stack,
331 and a page size can be as small as 4096 bytes. So we cannot safely
332 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
333 to allow for a few compiler-allocated temporary stack slots. */
334 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
337 # define YYSTACK_ALLOC YYMALLOC
338 # define YYSTACK_FREE YYFREE
339 # ifndef YYSTACK_ALLOC_MAXIMUM
340 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
342 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
343 && ! ((defined YYMALLOC || defined malloc) \
344 && (defined YYFREE || defined free)))
345 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
346 # ifndef EXIT_SUCCESS
347 # define EXIT_SUCCESS 0
351 # define YYMALLOC malloc
352 # if ! defined malloc && ! defined EXIT_SUCCESS
353 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
358 # if ! defined free && ! defined EXIT_SUCCESS
359 void free (void *); /* INFRINGES ON USER NAME SPACE */
363 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
366 #if (! defined yyoverflow \
367 && (! defined __cplusplus \
368 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
370 /* A type that is properly aligned for any stack member. */
373 yytype_int16 yyss_alloc;
377 /* The size of the maximum gap between one aligned stack and the next. */
378 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
380 /* The size of an array large to enough to hold all stacks, each with
382 # define YYSTACK_BYTES(N) \
383 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
384 + YYSTACK_GAP_MAXIMUM)
386 # define YYCOPY_NEEDED 1
388 /* Relocate STACK from its old location to the new one. The
389 local variables YYSIZE and YYSTACKSIZE give the old and new number of
390 elements in the stack, and YYPTR gives the new location of the
391 stack. Advance YYPTR to a properly aligned location for the next
393 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
396 YYSIZE_T yynewbytes; \
397 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
398 Stack = &yyptr->Stack_alloc; \
399 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
400 yyptr += yynewbytes / sizeof (*yyptr); \
406 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
407 /* Copy COUNT objects from SRC to DST. The source and destination do
410 # if defined __GNUC__ && 1 < __GNUC__
411 # define YYCOPY(Dst, Src, Count) \
412 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
414 # define YYCOPY(Dst, Src, Count) \
418 for (yyi = 0; yyi < (Count); yyi++) \
419 (Dst)[yyi] = (Src)[yyi]; \
424 #endif /* !YYCOPY_NEEDED */
426 /* YYFINAL -- State number of the termination state. */
428 /* YYLAST -- Last index in YYTABLE. */
431 /* YYNTOKENS -- Number of terminals. */
433 /* YYNNTS -- Number of nonterminals. */
435 /* YYNRULES -- Number of rules. */
437 /* YYNSTATES -- Number of states. */
440 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
441 by yylex, with out-of-bounds checking. */
443 #define YYMAXUTOK 287
445 #define YYTRANSLATE(YYX) \
446 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
448 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
449 as returned by yylex, without out-of-bounds checking. */
450 static const yytype_uint8 yytranslate[] =
452 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
478 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
479 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
480 25, 26, 27, 28, 29, 30, 31, 32
484 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
485 static const yytype_uint8 yyrline[] =
487 0, 34, 34, 34, 36, 36, 36, 36, 38, 38,
488 38, 38, 38, 38, 40, 40, 50, 50, 62, 65,
493 #if YYDEBUG || YYERROR_VERBOSE || 0
494 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
495 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
496 static const char *const yytname[] =
498 "$end", "error", "$undefined", "CHIP", "DEVICE", "REGISTER", "BOOL",
499 "BUS", "RESOURCE", "END", "EQUALS", "HEX", "STRING", "PCI", "PNP", "I2C",
500 "APIC", "CPU_CLUSTER", "CPU", "DOMAIN", "IRQ", "DRQ", "IO", "NUMBER",
501 "SUBSYSTEMID", "INHERIT", "IOAPIC_IRQ", "IOAPIC", "PCIINT", "GENERIC",
502 "SPI", "USB", "MMIO", "$accept", "devtree", "$@1", "chipchildren",
503 "devicechildren", "chip", "@2", "device", "@3", "resource", "registers",
504 "subsystemid", "ioapic_irq", YY_NULLPTR
509 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
510 (internal) symbol number NUM (which must be that of a token). */
511 static const yytype_uint16 yytoknum[] =
513 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
514 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
515 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
520 #define YYPACT_NINF -10
522 #define yypact_value_is_default(Yystate) \
523 (!!((Yystate) == (-10)))
525 #define YYTABLE_NINF -1
527 #define yytable_value_is_error(Yytable_value) \
530 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
532 static const yytype_int8 yypact[] =
534 -10, 3, 1, -10, -2, -10, -10, -10, 4, 5,
535 -1, -10, -10, -10, -10, -9, 7, 9, 6, -10,
536 -10, -10, -3, -4, -10, 2, 8, -10, -10, -10,
537 -10, -10, 10, 11, 0, 12, 13, 14, -10, -10,
541 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
542 Performed when YYTABLE does not specify something else to do. Zero
543 means the default is an error. */
544 static const yytype_uint8 yydefact[] =
546 2, 0, 0, 1, 0, 3, 14, 7, 0, 0,
547 0, 15, 5, 4, 6, 0, 0, 0, 0, 16,
548 19, 13, 0, 0, 17, 0, 0, 9, 8, 10,
549 11, 12, 0, 0, 0, 0, 20, 0, 18, 21,
553 /* YYPGOTO[NTERM-NUM]. */
554 static const yytype_int8 yypgoto[] =
556 -10, -10, -10, -10, -10, -6, -10, 17, -10, -10,
560 /* YYDEFGOTO[NTERM-NUM]. */
561 static const yytype_int8 yydefgoto[] =
563 -1, 1, 2, 8, 22, 5, 7, 13, 21, 29,
567 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
568 positive, shift that token. If negative, reduce the rule whose
569 number is the opposite. If YYTABLE_NINF, syntax error. */
570 static const yytype_uint8 yytable[] =
572 4, 9, 12, 3, 4, 23, 24, 4, 9, 10,
573 6, 16, 15, 11, 17, 19, 27, 18, 20, 32,
574 35, 25, 0, 26, 0, 33, 0, 0, 37, 0,
575 0, 34, 0, 0, 36, 38, 0, 40, 39, 28
578 static const yytype_int8 yycheck[] =
580 3, 4, 8, 0, 3, 8, 9, 3, 4, 5,
581 12, 12, 7, 9, 23, 6, 22, 10, 12, 23,
582 10, 24, -1, 26, -1, 23, -1, -1, 28, -1,
583 -1, 23, -1, -1, 23, 23, -1, 23, 25, 22
586 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
587 symbol of state STATE-NUM. */
588 static const yytype_uint8 yystos[] =
590 0, 34, 35, 0, 3, 38, 12, 39, 36, 4,
591 5, 9, 38, 40, 43, 7, 12, 23, 10, 6,
592 12, 41, 37, 8, 9, 24, 26, 38, 40, 42,
593 44, 45, 23, 23, 23, 10, 23, 28, 23, 25,
597 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
598 static const yytype_uint8 yyr1[] =
600 0, 33, 35, 34, 36, 36, 36, 36, 37, 37,
601 37, 37, 37, 37, 39, 38, 41, 40, 42, 43,
605 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
606 static const yytype_uint8 yyr2[] =
608 0, 2, 0, 2, 2, 2, 2, 0, 2, 2,
609 2, 2, 2, 0, 0, 5, 0, 7, 4, 4,
614 #define yyerrok (yyerrstatus = 0)
615 #define yyclearin (yychar = YYEMPTY)
619 #define YYACCEPT goto yyacceptlab
620 #define YYABORT goto yyabortlab
621 #define YYERROR goto yyerrorlab
624 #define YYRECOVERING() (!!yyerrstatus)
626 #define YYBACKUP(Token, Value) \
628 if (yychar == YYEMPTY) \
632 YYPOPSTACK (yylen); \
638 yyerror (YY_("syntax error: cannot back up")); \
643 /* Error token number */
645 #define YYERRCODE 256
649 /* Enable debugging if requested. */
653 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
654 # define YYFPRINTF fprintf
657 # define YYDPRINTF(Args) \
663 /* This macro is provided for backward compatibility. */
664 #ifndef YY_LOCATION_PRINT
665 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
669 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
673 YYFPRINTF (stderr, "%s ", Title); \
674 yy_symbol_print (stderr, \
676 YYFPRINTF (stderr, "\n"); \
681 /*----------------------------------------.
682 | Print this symbol's value on YYOUTPUT. |
683 `----------------------------------------*/
686 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
688 FILE *yyo = yyoutput;
693 if (yytype < YYNTOKENS)
694 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
700 /*--------------------------------.
701 | Print this symbol on YYOUTPUT. |
702 `--------------------------------*/
705 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
707 YYFPRINTF (yyoutput, "%s %s (",
708 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
710 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
711 YYFPRINTF (yyoutput, ")");
714 /*------------------------------------------------------------------.
715 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
717 `------------------------------------------------------------------*/
720 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
722 YYFPRINTF (stderr, "Stack now");
723 for (; yybottom <= yytop; yybottom++)
725 int yybot = *yybottom;
726 YYFPRINTF (stderr, " %d", yybot);
728 YYFPRINTF (stderr, "\n");
731 # define YY_STACK_PRINT(Bottom, Top) \
734 yy_stack_print ((Bottom), (Top)); \
738 /*------------------------------------------------.
739 | Report that the YYRULE is going to be reduced. |
740 `------------------------------------------------*/
743 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
745 unsigned long int yylno = yyrline[yyrule];
746 int yynrhs = yyr2[yyrule];
748 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
750 /* The symbols being reduced. */
751 for (yyi = 0; yyi < yynrhs; yyi++)
753 YYFPRINTF (stderr, " $%d = ", yyi + 1);
754 yy_symbol_print (stderr,
755 yystos[yyssp[yyi + 1 - yynrhs]],
756 &(yyvsp[(yyi + 1) - (yynrhs)])
758 YYFPRINTF (stderr, "\n");
762 # define YY_REDUCE_PRINT(Rule) \
765 yy_reduce_print (yyssp, yyvsp, Rule); \
768 /* Nonzero means print parse trace. It is left uninitialized so that
769 multiple parsers can coexist. */
772 # define YYDPRINTF(Args)
773 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
774 # define YY_STACK_PRINT(Bottom, Top)
775 # define YY_REDUCE_PRINT(Rule)
776 #endif /* !YYDEBUG */
779 /* YYINITDEPTH -- initial size of the parser's stacks. */
781 # define YYINITDEPTH 200
784 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
785 if the built-in stack extension method is used).
787 Do not make this value too large; the results are undefined if
788 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
789 evaluated with infinite-precision integer arithmetic. */
792 # define YYMAXDEPTH 10000
799 # if defined __GLIBC__ && defined _STRING_H
800 # define yystrlen strlen
802 /* Return the length of YYSTR. */
804 yystrlen (const char *yystr)
807 for (yylen = 0; yystr[yylen]; yylen++)
815 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
816 # define yystpcpy stpcpy
818 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
821 yystpcpy (char *yydest, const char *yysrc)
824 const char *yys = yysrc;
826 while ((*yyd++ = *yys++) != '\0')
835 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
836 quotes and backslashes, so that it's suitable for yyerror. The
837 heuristic is that double-quoting is unnecessary unless the string
838 contains an apostrophe, a comma, or backslash (other than
839 backslash-backslash). YYSTR is taken from yytname. If YYRES is
840 null, do not copy; instead, return the length of what the result
843 yytnamerr (char *yyres, const char *yystr)
848 char const *yyp = yystr;
855 goto do_not_strip_quotes;
859 goto do_not_strip_quotes;
872 do_not_strip_quotes: ;
876 return yystrlen (yystr);
878 return yystpcpy (yyres, yystr) - yyres;
882 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
883 about the unexpected token YYTOKEN for the state stack whose top is
886 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
887 not large enough to hold the message. In that case, also set
888 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
889 required number of bytes is too large to store. */
891 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
892 yytype_int16 *yyssp, int yytoken)
894 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
895 YYSIZE_T yysize = yysize0;
896 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
897 /* Internationalized format string. */
898 const char *yyformat = YY_NULLPTR;
899 /* Arguments of yyformat. */
900 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
901 /* Number of reported tokens (one for the "unexpected", one per
905 /* There are many possibilities here to consider:
906 - If this state is a consistent state with a default action, then
907 the only way this function was invoked is if the default action
908 is an error action. In that case, don't check for expected
909 tokens because there are none.
910 - The only way there can be no lookahead present (in yychar) is if
911 this state is a consistent state with a default action. Thus,
912 detecting the absence of a lookahead is sufficient to determine
913 that there is no unexpected or expected token to report. In that
914 case, just report a simple "syntax error".
915 - Don't assume there isn't a lookahead just because this state is a
916 consistent state with a default action. There might have been a
917 previous inconsistent state, consistent state with a non-default
918 action, or user semantic action that manipulated yychar.
919 - Of course, the expected token list depends on states to have
920 correct lookahead information, and it depends on the parser not
921 to perform extra reductions after fetching a lookahead from the
922 scanner and before detecting a syntax error. Thus, state merging
923 (from LALR or IELR) and default reductions corrupt the expected
924 token list. However, the list is correct for canonical LR with
925 one exception: it will still contain any token that will not be
926 accepted due to an error action in a later state.
928 if (yytoken != YYEMPTY)
930 int yyn = yypact[*yyssp];
931 yyarg[yycount++] = yytname[yytoken];
932 if (!yypact_value_is_default (yyn))
934 /* Start YYX at -YYN if negative to avoid negative indexes in
935 YYCHECK. In other words, skip the first -YYN actions for
936 this state because they are default actions. */
937 int yyxbegin = yyn < 0 ? -yyn : 0;
938 /* Stay within bounds of both yycheck and yytname. */
939 int yychecklim = YYLAST - yyn + 1;
940 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
943 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
944 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
945 && !yytable_value_is_error (yytable[yyx + yyn]))
947 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
953 yyarg[yycount++] = yytname[yyx];
955 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
956 if (! (yysize <= yysize1
957 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
967 # define YYCASE_(N, S) \
971 YYCASE_(0, YY_("syntax error"));
972 YYCASE_(1, YY_("syntax error, unexpected %s"));
973 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
974 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
975 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
976 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
981 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
982 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
987 if (*yymsg_alloc < yysize)
989 *yymsg_alloc = 2 * yysize;
990 if (! (yysize <= *yymsg_alloc
991 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
992 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
996 /* Avoid sprintf, as that infringes on the user's name space.
997 Don't have undefined behavior even if the translation
998 produced a string with the wrong number of "%s"s. */
1002 while ((*yyp = *yyformat) != '\0')
1003 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1005 yyp += yytnamerr (yyp, yyarg[yyi++]);
1016 #endif /* YYERROR_VERBOSE */
1018 /*-----------------------------------------------.
1019 | Release the memory associated to this symbol. |
1020 `-----------------------------------------------*/
1023 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1028 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1030 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1032 YY_IGNORE_MAYBE_UNINITIALIZED_END
1038 /* The lookahead symbol. */
1041 /* The semantic value of the lookahead symbol. */
1043 /* Number of syntax errors so far. */
1055 /* Number of tokens to shift before error messages enabled. */
1058 /* The stacks and their tools:
1059 'yyss': related to states.
1060 'yyvs': related to semantic values.
1062 Refer to the stacks through separate pointers, to allow yyoverflow
1063 to reallocate them elsewhere. */
1065 /* The state stack. */
1066 yytype_int16 yyssa[YYINITDEPTH];
1068 yytype_int16 *yyssp;
1070 /* The semantic value stack. */
1071 YYSTYPE yyvsa[YYINITDEPTH];
1075 YYSIZE_T yystacksize;
1079 /* Lookahead token as an internal (translated) token number. */
1081 /* The variables used to return semantic value and location from the
1086 /* Buffer for error messages, and its allocated size. */
1088 char *yymsg = yymsgbuf;
1089 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1092 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1094 /* The number of symbols on the RHS of the reduced rule.
1095 Keep to zero when no symbol should be popped. */
1098 yyssp = yyss = yyssa;
1099 yyvsp = yyvs = yyvsa;
1100 yystacksize = YYINITDEPTH;
1102 YYDPRINTF ((stderr, "Starting parse\n"));
1107 yychar = YYEMPTY; /* Cause a token to be read. */
1110 /*------------------------------------------------------------.
1111 | yynewstate -- Push a new state, which is found in yystate. |
1112 `------------------------------------------------------------*/
1114 /* In all cases, when you get here, the value and location stacks
1115 have just been pushed. So pushing a state here evens the stacks. */
1121 if (yyss + yystacksize - 1 <= yyssp)
1123 /* Get the current used size of the three stacks, in elements. */
1124 YYSIZE_T yysize = yyssp - yyss + 1;
1128 /* Give user a chance to reallocate the stack. Use copies of
1129 these so that the &'s don't force the real ones into
1131 YYSTYPE *yyvs1 = yyvs;
1132 yytype_int16 *yyss1 = yyss;
1134 /* Each stack pointer address is followed by the size of the
1135 data in use in that stack, in bytes. This used to be a
1136 conditional around just the two extra args, but that might
1137 be undefined if yyoverflow is a macro. */
1138 yyoverflow (YY_("memory exhausted"),
1139 &yyss1, yysize * sizeof (*yyssp),
1140 &yyvs1, yysize * sizeof (*yyvsp),
1146 #else /* no yyoverflow */
1147 # ifndef YYSTACK_RELOCATE
1148 goto yyexhaustedlab;
1150 /* Extend the stack our own way. */
1151 if (YYMAXDEPTH <= yystacksize)
1152 goto yyexhaustedlab;
1154 if (YYMAXDEPTH < yystacksize)
1155 yystacksize = YYMAXDEPTH;
1158 yytype_int16 *yyss1 = yyss;
1159 union yyalloc *yyptr =
1160 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1162 goto yyexhaustedlab;
1163 YYSTACK_RELOCATE (yyss_alloc, yyss);
1164 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1165 # undef YYSTACK_RELOCATE
1167 YYSTACK_FREE (yyss1);
1170 #endif /* no yyoverflow */
1172 yyssp = yyss + yysize - 1;
1173 yyvsp = yyvs + yysize - 1;
1175 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1176 (unsigned long int) yystacksize));
1178 if (yyss + yystacksize - 1 <= yyssp)
1182 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1184 if (yystate == YYFINAL)
1194 /* Do appropriate processing given the current state. Read a
1195 lookahead token if we need one and don't already have one. */
1197 /* First try to decide what to do without reference to lookahead token. */
1198 yyn = yypact[yystate];
1199 if (yypact_value_is_default (yyn))
1202 /* Not known => get a lookahead token if don't already have one. */
1204 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1205 if (yychar == YYEMPTY)
1207 YYDPRINTF ((stderr, "Reading a token: "));
1211 if (yychar <= YYEOF)
1213 yychar = yytoken = YYEOF;
1214 YYDPRINTF ((stderr, "Now at end of input.\n"));
1218 yytoken = YYTRANSLATE (yychar);
1219 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1222 /* If the proper action on seeing token YYTOKEN is to reduce or to
1223 detect an error, take that action. */
1225 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1230 if (yytable_value_is_error (yyn))
1236 /* Count tokens shifted since error; after three, turn off error
1241 /* Shift the lookahead token. */
1242 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1244 /* Discard the shifted token. */
1248 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1250 YY_IGNORE_MAYBE_UNINITIALIZED_END
1255 /*-----------------------------------------------------------.
1256 | yydefault -- do the default action for the current state. |
1257 `-----------------------------------------------------------*/
1259 yyn = yydefact[yystate];
1265 /*-----------------------------.
1266 | yyreduce -- Do a reduction. |
1267 `-----------------------------*/
1269 /* yyn is the number of a rule to reduce with. */
1272 /* If YYLEN is nonzero, implement the default value of the action:
1275 Otherwise, the following line sets YYVAL to garbage.
1276 This behavior is undocumented and Bison
1277 users should not rely upon it. Assigning to YYVAL
1278 unconditionally makes the parser a bit smaller, and it avoids a
1279 GCC warning that YYVAL may be used uninitialized. */
1280 yyval = yyvsp[1-yylen];
1283 YY_REDUCE_PRINT (yyn);
1288 { cur_parent = cur_bus = head; }
1294 { postprocess_devtree(); }
1301 (yyval.device) = new_chip(cur_parent, cur_bus, (yyvsp[0].string));
1302 cur_parent = (yyval.device);
1310 cur_parent = (yyvsp[-2].device)->parent;
1311 fold_in((yyvsp[-2].device));
1312 add_header((yyvsp[-2].device));
1320 (yyval.device) = new_device(cur_parent, cur_bus, (yyvsp[-2].number), (yyvsp[-1].string), (yyvsp[0].number));
1321 cur_parent = (yyval.device);
1322 cur_bus = (yyval.device);
1330 cur_parent = (yyvsp[-2].device)->parent;
1331 cur_bus = (yyvsp[-2].device)->bus;
1332 fold_in((yyvsp[-2].device));
1333 alias_siblings((yyvsp[-2].device)->children);
1340 { add_resource(cur_parent, (yyvsp[-3].number), strtol((yyvsp[-2].string), NULL, 0), strtol((yyvsp[0].string), NULL, 0)); }
1346 { add_register(cur_parent, (yyvsp[-2].string), (yyvsp[0].string)); }
1352 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-1].string), NULL, 16), strtol((yyvsp[0].string), NULL, 16), 0); }
1358 { add_pci_subsystem_ids(cur_parent, strtol((yyvsp[-2].string), NULL, 16), strtol((yyvsp[-1].string), NULL, 16), 1); }
1364 { add_ioapic_info(cur_parent, strtol((yyvsp[-2].string), NULL, 16), (yyvsp[-1].string), strtol((yyvsp[0].string), NULL, 16)); }
1372 /* User semantic actions sometimes alter yychar, and that requires
1373 that yytoken be updated with the new translation. We take the
1374 approach of translating immediately before every use of yytoken.
1375 One alternative is translating here after every semantic action,
1376 but that translation would be missed if the semantic action invokes
1377 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1378 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1379 incorrect destructor might then be invoked immediately. In the
1380 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1381 to an incorrect destructor call or verbose syntax error message
1382 before the lookahead is translated. */
1383 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1387 YY_STACK_PRINT (yyss, yyssp);
1391 /* Now 'shift' the result of the reduction. Determine what state
1392 that goes to, based on the state we popped back to and the rule
1393 number reduced by. */
1397 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1398 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1399 yystate = yytable[yystate];
1401 yystate = yydefgoto[yyn - YYNTOKENS];
1406 /*--------------------------------------.
1407 | yyerrlab -- here on detecting error. |
1408 `--------------------------------------*/
1410 /* Make sure we have latest lookahead translation. See comments at
1411 user semantic actions for why this is necessary. */
1412 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1414 /* If not already recovering from an error, report this error. */
1418 #if ! YYERROR_VERBOSE
1419 yyerror (YY_("syntax error"));
1421 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1424 char const *yymsgp = YY_("syntax error");
1425 int yysyntax_error_status;
1426 yysyntax_error_status = YYSYNTAX_ERROR;
1427 if (yysyntax_error_status == 0)
1429 else if (yysyntax_error_status == 1)
1431 if (yymsg != yymsgbuf)
1432 YYSTACK_FREE (yymsg);
1433 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1437 yymsg_alloc = sizeof yymsgbuf;
1438 yysyntax_error_status = 2;
1442 yysyntax_error_status = YYSYNTAX_ERROR;
1447 if (yysyntax_error_status == 2)
1448 goto yyexhaustedlab;
1450 # undef YYSYNTAX_ERROR
1456 if (yyerrstatus == 3)
1458 /* If just tried and failed to reuse lookahead token after an
1459 error, discard it. */
1461 if (yychar <= YYEOF)
1463 /* Return failure if at end of input. */
1464 if (yychar == YYEOF)
1469 yydestruct ("Error: discarding",
1475 /* Else will try to reuse lookahead token after shifting the error
1480 /*---------------------------------------------------.
1481 | yyerrorlab -- error raised explicitly by YYERROR. |
1482 `---------------------------------------------------*/
1485 /* Pacify compilers like GCC when the user code never invokes
1486 YYERROR and the label yyerrorlab therefore never appears in user
1488 if (/*CONSTCOND*/ 0)
1491 /* Do not reclaim the symbols of the rule whose action triggered
1495 YY_STACK_PRINT (yyss, yyssp);
1500 /*-------------------------------------------------------------.
1501 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1502 `-------------------------------------------------------------*/
1504 yyerrstatus = 3; /* Each real token shifted decrements this. */
1508 yyn = yypact[yystate];
1509 if (!yypact_value_is_default (yyn))
1512 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1520 /* Pop the current state because it cannot handle the error token. */
1525 yydestruct ("Error: popping",
1526 yystos[yystate], yyvsp);
1529 YY_STACK_PRINT (yyss, yyssp);
1532 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1534 YY_IGNORE_MAYBE_UNINITIALIZED_END
1537 /* Shift the error token. */
1538 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1544 /*-------------------------------------.
1545 | yyacceptlab -- YYACCEPT comes here. |
1546 `-------------------------------------*/
1551 /*-----------------------------------.
1552 | yyabortlab -- YYABORT comes here. |
1553 `-----------------------------------*/
1558 #if !defined yyoverflow || YYERROR_VERBOSE
1559 /*-------------------------------------------------.
1560 | yyexhaustedlab -- memory exhaustion comes here. |
1561 `-------------------------------------------------*/
1563 yyerror (YY_("memory exhausted"));
1569 if (yychar != YYEMPTY)
1571 /* Make sure we have latest lookahead translation. See comments at
1572 user semantic actions for why this is necessary. */
1573 yytoken = YYTRANSLATE (yychar);
1574 yydestruct ("Cleanup: discarding lookahead",
1577 /* Do not reclaim the symbols of the rule whose action triggered
1578 this YYABORT or YYACCEPT. */
1580 YY_STACK_PRINT (yyss, yyssp);
1581 while (yyssp != yyss)
1583 yydestruct ("Cleanup: popping",
1584 yystos[*yyssp], yyvsp);
1589 YYSTACK_FREE (yyss);
1592 if (yymsg != yymsgbuf)
1593 YYSTACK_FREE (yymsg);