1 /* A Bison parser, made by GNU Bison 3.0.2. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2013 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.2"
50 #define YYSKELETON_NAME "yacc.c"
64 /* Copy the first part of user declarations. */
65 #line 20 "dtc-parser.y" /* yacc.c:339 */
72 extern int yylex(void);
73 extern void yyerror(char const *s);
74 #define ERROR(loc, ...) \
76 srcpos_error((loc), "Error", __VA_ARGS__); \
77 treesource_error = true; \
80 extern struct boot_info *the_boot_info;
81 extern bool treesource_error;
83 #line 84 "dtc-parser.tab.c" /* yacc.c:339 */
86 # if defined __cplusplus && 201103L <= __cplusplus
87 # define YY_NULLPTR nullptr
93 /* Enabling verbose error messages. */
94 #ifdef YYERROR_VERBOSE
95 # undef YYERROR_VERBOSE
96 # define YYERROR_VERBOSE 1
98 # define YYERROR_VERBOSE 0
101 /* In a future release of Bison, this section will be replaced
102 by #include "dtc-parser.tab.h". */
103 #ifndef YY_YY_DTC_PARSER_TAB_H_INCLUDED
104 # define YY_YY_DTC_PARSER_TAB_H_INCLUDED
131 DT_PROPNODENAME = 271,
133 DT_CHAR_LITERAL = 273,
143 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
144 typedef union YYSTYPE YYSTYPE;
147 #line 38 "dtc-parser.y" /* yacc.c:355 */
159 struct property *prop;
160 struct property *proplist;
162 struct node *nodelist;
163 struct reserve_info *re;
166 #line 167 "dtc-parser.tab.c" /* yacc.c:355 */
168 # define YYSTYPE_IS_TRIVIAL 1
169 # define YYSTYPE_IS_DECLARED 1
173 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
174 typedef struct YYLTYPE YYLTYPE;
182 # define YYLTYPE_IS_DECLARED 1
183 # define YYLTYPE_IS_TRIVIAL 1
187 extern YYSTYPE yylval;
188 extern YYLTYPE yylloc;
191 #endif /* !YY_YY_DTC_PARSER_TAB_H_INCLUDED */
193 /* Copy the second part of user declarations. */
195 #line 196 "dtc-parser.tab.c" /* yacc.c:358 */
202 typedef YYTYPE_UINT8 yytype_uint8;
204 typedef unsigned char yytype_uint8;
208 typedef YYTYPE_INT8 yytype_int8;
210 typedef signed char yytype_int8;
214 typedef YYTYPE_UINT16 yytype_uint16;
216 typedef unsigned short int yytype_uint16;
220 typedef YYTYPE_INT16 yytype_int16;
222 typedef short int yytype_int16;
226 # ifdef __SIZE_TYPE__
227 # define YYSIZE_T __SIZE_TYPE__
228 # elif defined size_t
229 # define YYSIZE_T size_t
230 # elif ! defined YYSIZE_T
231 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
232 # define YYSIZE_T size_t
234 # define YYSIZE_T unsigned int
238 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
241 # if defined YYENABLE_NLS && YYENABLE_NLS
243 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
244 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
248 # define YY_(Msgid) Msgid
253 # if (defined __GNUC__ \
254 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
255 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
256 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
258 # define YY_ATTRIBUTE(Spec) /* empty */
262 #ifndef YY_ATTRIBUTE_PURE
263 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
266 #ifndef YY_ATTRIBUTE_UNUSED
267 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
270 #if !defined _Noreturn \
271 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
272 # if defined _MSC_VER && 1200 <= _MSC_VER
273 # define _Noreturn __declspec (noreturn)
275 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
279 /* Suppress unused-variable warnings by "using" E. */
280 #if ! defined lint || defined __GNUC__
281 # define YYUSE(E) ((void) (E))
283 # define YYUSE(E) /* empty */
286 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
287 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
288 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
289 _Pragma ("GCC diagnostic push") \
290 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
291 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
292 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
293 _Pragma ("GCC diagnostic pop")
295 # define YY_INITIAL_VALUE(Value) Value
297 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
298 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
299 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
301 #ifndef YY_INITIAL_VALUE
302 # define YY_INITIAL_VALUE(Value) /* Nothing. */
306 #if ! defined yyoverflow || YYERROR_VERBOSE
308 /* The parser invokes alloca or malloc; define the necessary symbols. */
310 # ifdef YYSTACK_USE_ALLOCA
311 # if YYSTACK_USE_ALLOCA
313 # define YYSTACK_ALLOC __builtin_alloca
314 # elif defined __BUILTIN_VA_ARG_INCR
315 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
317 # define YYSTACK_ALLOC __alloca
318 # elif defined _MSC_VER
319 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
320 # define alloca _alloca
322 # define YYSTACK_ALLOC alloca
323 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
324 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
325 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
326 # ifndef EXIT_SUCCESS
327 # define EXIT_SUCCESS 0
334 # ifdef YYSTACK_ALLOC
335 /* Pacify GCC's 'empty if-body' warning. */
336 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
337 # ifndef YYSTACK_ALLOC_MAXIMUM
338 /* The OS might guarantee only one guard page at the bottom of the stack,
339 and a page size can be as small as 4096 bytes. So we cannot safely
340 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
341 to allow for a few compiler-allocated temporary stack slots. */
342 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
345 # define YYSTACK_ALLOC YYMALLOC
346 # define YYSTACK_FREE YYFREE
347 # ifndef YYSTACK_ALLOC_MAXIMUM
348 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
350 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
351 && ! ((defined YYMALLOC || defined malloc) \
352 && (defined YYFREE || defined free)))
353 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
354 # ifndef EXIT_SUCCESS
355 # define EXIT_SUCCESS 0
359 # define YYMALLOC malloc
360 # if ! defined malloc && ! defined EXIT_SUCCESS
361 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
366 # if ! defined free && ! defined EXIT_SUCCESS
367 void free (void *); /* INFRINGES ON USER NAME SPACE */
371 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
374 #if (! defined yyoverflow \
375 && (! defined __cplusplus \
376 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
377 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
379 /* A type that is properly aligned for any stack member. */
382 yytype_int16 yyss_alloc;
387 /* The size of the maximum gap between one aligned stack and the next. */
388 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
390 /* The size of an array large to enough to hold all stacks, each with
392 # define YYSTACK_BYTES(N) \
393 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
394 + 2 * YYSTACK_GAP_MAXIMUM)
396 # define YYCOPY_NEEDED 1
398 /* Relocate STACK from its old location to the new one. The
399 local variables YYSIZE and YYSTACKSIZE give the old and new number of
400 elements in the stack, and YYPTR gives the new location of the
401 stack. Advance YYPTR to a properly aligned location for the next
403 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
406 YYSIZE_T yynewbytes; \
407 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
408 Stack = &yyptr->Stack_alloc; \
409 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
410 yyptr += yynewbytes / sizeof (*yyptr); \
416 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
417 /* Copy COUNT objects from SRC to DST. The source and destination do
420 # if defined __GNUC__ && 1 < __GNUC__
421 # define YYCOPY(Dst, Src, Count) \
422 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
424 # define YYCOPY(Dst, Src, Count) \
428 for (yyi = 0; yyi < (Count); yyi++) \
429 (Dst)[yyi] = (Src)[yyi]; \
434 #endif /* !YYCOPY_NEEDED */
436 /* YYFINAL -- State number of the termination state. */
438 /* YYLAST -- Last index in YYTABLE. */
441 /* YYNTOKENS -- Number of terminals. */
443 /* YYNNTS -- Number of nonterminals. */
445 /* YYNRULES -- Number of rules. */
447 /* YYNSTATES -- Number of states. */
448 #define YYNSTATES 144
450 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
451 by yylex, with out-of-bounds checking. */
453 #define YYMAXUTOK 278
455 #define YYTRANSLATE(YYX) \
456 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
458 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
459 as returned by yylex, without out-of-bounds checking. */
460 static const yytype_uint8 yytranslate[] =
462 0, 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, 46, 2, 2, 2, 44, 40, 2,
466 32, 34, 43, 41, 33, 42, 2, 25, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 37, 24,
468 35, 28, 29, 36, 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, 30, 2, 31, 39, 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, 26, 38, 27, 45, 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, 2, 2, 2, 2,
482 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
483 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
486 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
487 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
488 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
489 15, 16, 17, 18, 19, 20, 21, 22, 23
493 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
494 static const yytype_uint16 yyrline[] =
496 0, 104, 104, 113, 116, 123, 127, 135, 139, 144,
497 155, 165, 180, 188, 191, 198, 202, 206, 210, 218,
498 222, 226, 230, 234, 250, 260, 268, 271, 275, 282,
499 298, 303, 322, 336, 343, 344, 345, 352, 356, 357,
500 361, 362, 366, 367, 371, 372, 376, 377, 381, 382,
501 386, 387, 388, 392, 393, 394, 395, 396, 400, 401,
502 402, 406, 407, 408, 412, 413, 414, 415, 419, 420,
503 421, 422, 427, 430, 434, 442, 445, 449, 457, 461,
508 #if YYDEBUG || YYERROR_VERBOSE || 0
509 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
510 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
511 static const char *const yytname[] =
513 "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE", "DT_LSHIFT",
514 "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ", "DT_NE", "DT_AND", "DT_OR",
515 "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE", "DT_PROPNODENAME", "DT_LITERAL",
516 "DT_CHAR_LITERAL", "DT_BYTE", "DT_STRING", "DT_LABEL", "DT_REF",
517 "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['", "']'",
518 "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'", "'+'",
519 "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile",
520 "memreserves", "memreserve", "devicetree", "nodedef", "proplist",
521 "propdef", "propdata", "propdataprefix", "arrayprefix", "integer_prim",
522 "integer_expr", "integer_trinary", "integer_or", "integer_and",
523 "integer_bitor", "integer_bitxor", "integer_bitand", "integer_eq",
524 "integer_rela", "integer_shift", "integer_add", "integer_mul",
525 "integer_unary", "bytestring", "subnodes", "subnode", YY_NULLPTR
530 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
531 (internal) symbol number NUM (which must be that of a token). */
532 static const yytype_uint16 yytoknum[] =
534 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
535 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
536 275, 276, 277, 278, 59, 47, 123, 125, 61, 62,
537 91, 93, 40, 44, 41, 60, 63, 58, 124, 94,
538 38, 43, 45, 42, 37, 126, 33
542 #define YYPACT_NINF -81
544 #define yypact_value_is_default(Yystate) \
545 (!!((Yystate) == (-81)))
547 #define YYTABLE_NINF -1
549 #define yytable_value_is_error(Yytable_value) \
552 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
554 static const yytype_int8 yypact[] =
556 16, -11, 21, 10, -81, 25, 10, 19, 10, -81,
557 -81, -9, 25, -81, 2, 51, -81, -9, -9, -9,
558 -81, 1, -81, -6, 50, 14, 28, 29, 36, 3,
559 58, 44, -3, -81, 47, -81, -81, 65, 68, 2,
560 2, -81, -81, -81, -81, -9, -9, -9, -9, -9,
561 -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
562 -9, -9, -9, -9, -81, 63, 69, 2, -81, -81,
563 50, 57, 14, 28, 29, 36, 3, 3, 58, 58,
564 58, 58, 44, 44, -3, -3, -81, -81, -81, 79,
565 80, -8, 63, -81, 72, 63, -81, -81, -9, 76,
566 77, -81, -81, -81, -81, -81, 78, -81, -81, -81,
567 -81, -81, 35, 4, -81, -81, -81, -81, 86, -81,
568 -81, -81, 73, -81, -81, 33, 71, 84, 39, -81,
569 -81, -81, -81, -81, 41, -81, -81, -81, 25, -81,
573 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
574 Performed when YYTABLE does not specify something else to do. Zero
575 means the default is an error. */
576 static const yytype_uint8 yydefact[] =
578 0, 0, 0, 3, 1, 0, 0, 0, 3, 34,
579 35, 0, 0, 6, 0, 2, 4, 0, 0, 0,
580 68, 0, 37, 38, 40, 42, 44, 46, 48, 50,
581 53, 60, 63, 67, 0, 13, 7, 0, 0, 0,
582 0, 69, 70, 71, 36, 0, 0, 0, 0, 0,
583 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
584 0, 0, 0, 0, 5, 75, 0, 0, 10, 8,
585 41, 0, 43, 45, 47, 49, 51, 52, 56, 57,
586 55, 54, 58, 59, 61, 62, 65, 64, 66, 0,
587 0, 0, 0, 14, 0, 75, 11, 9, 0, 0,
588 0, 16, 26, 78, 18, 80, 0, 77, 76, 39,
589 17, 79, 0, 0, 12, 25, 15, 27, 0, 19,
590 28, 22, 0, 72, 30, 0, 0, 0, 0, 33,
591 32, 20, 31, 29, 0, 73, 74, 21, 0, 24,
595 /* YYPGOTO[NTERM-NUM]. */
596 static const yytype_int8 yypgoto[] =
598 -81, -81, 100, 104, -81, -38, -81, -80, -81, -81,
599 -81, -5, 66, 13, -81, 70, 67, 81, 64, 82,
600 37, 27, 34, 38, -14, -81, 22, 24
603 /* YYDEFGOTO[NTERM-NUM]. */
604 static const yytype_int16 yydefgoto[] =
606 -1, 2, 7, 8, 15, 36, 65, 93, 112, 113,
607 125, 20, 21, 22, 23, 24, 25, 26, 27, 28,
608 29, 30, 31, 32, 33, 128, 94, 95
611 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
612 positive, shift that token. If negative, reduce the rule whose
613 number is the opposite. If YYTABLE_NINF, syntax error. */
614 static const yytype_uint8 yytable[] =
616 12, 68, 69, 41, 42, 43, 45, 34, 9, 10,
617 53, 54, 104, 3, 5, 107, 101, 118, 35, 1,
618 102, 4, 61, 11, 119, 120, 121, 122, 35, 97,
619 46, 6, 55, 17, 123, 44, 18, 19, 56, 124,
620 62, 63, 9, 10, 14, 51, 52, 86, 87, 88,
621 9, 10, 48, 103, 129, 130, 115, 11, 135, 116,
622 136, 47, 131, 57, 58, 11, 37, 49, 117, 50,
623 137, 64, 38, 39, 138, 139, 40, 89, 90, 91,
624 78, 79, 80, 81, 92, 59, 60, 66, 76, 77,
625 67, 82, 83, 96, 98, 99, 100, 84, 85, 106,
626 110, 111, 114, 126, 134, 127, 133, 141, 16, 143,
627 13, 109, 71, 74, 72, 70, 105, 108, 0, 0,
628 132, 0, 0, 0, 0, 0, 0, 0, 0, 73,
629 0, 0, 75, 140, 0, 0, 142
632 static const yytype_int16 yycheck[] =
634 5, 39, 40, 17, 18, 19, 12, 12, 17, 18,
635 7, 8, 92, 24, 4, 95, 24, 13, 26, 3,
636 28, 0, 25, 32, 20, 21, 22, 23, 26, 67,
637 36, 21, 29, 42, 30, 34, 45, 46, 35, 35,
638 43, 44, 17, 18, 25, 9, 10, 61, 62, 63,
639 17, 18, 38, 91, 21, 22, 21, 32, 19, 24,
640 21, 11, 29, 5, 6, 32, 15, 39, 33, 40,
641 31, 24, 21, 22, 33, 34, 25, 14, 15, 16,
642 53, 54, 55, 56, 21, 41, 42, 22, 51, 52,
643 22, 57, 58, 24, 37, 16, 16, 59, 60, 27,
644 24, 24, 24, 17, 20, 32, 35, 33, 8, 34,
645 6, 98, 46, 49, 47, 45, 92, 95, -1, -1,
646 125, -1, -1, -1, -1, -1, -1, -1, -1, 48,
647 -1, -1, 50, 138, -1, -1, 141
650 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
651 symbol of state STATE-NUM. */
652 static const yytype_uint8 yystos[] =
654 0, 3, 48, 24, 0, 4, 21, 49, 50, 17,
655 18, 32, 58, 50, 25, 51, 49, 42, 45, 46,
656 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
657 68, 69, 70, 71, 58, 26, 52, 15, 21, 22,
658 25, 71, 71, 71, 34, 12, 36, 11, 38, 39,
659 40, 9, 10, 7, 8, 29, 35, 5, 6, 41,
660 42, 25, 43, 44, 24, 53, 22, 22, 52, 52,
661 62, 59, 63, 64, 65, 66, 67, 67, 68, 68,
662 68, 68, 69, 69, 70, 70, 71, 71, 71, 14,
663 15, 16, 21, 54, 73, 74, 24, 52, 37, 16,
664 16, 24, 28, 52, 54, 74, 27, 54, 73, 60,
665 24, 24, 55, 56, 24, 21, 24, 33, 13, 20,
666 21, 22, 23, 30, 35, 57, 17, 32, 72, 21,
667 22, 29, 58, 35, 20, 19, 21, 31, 33, 34,
671 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
672 static const yytype_uint8 yyr1[] =
674 0, 47, 48, 49, 49, 50, 50, 51, 51, 51,
675 51, 51, 52, 53, 53, 54, 54, 54, 54, 55,
676 55, 55, 55, 55, 55, 55, 56, 56, 56, 57,
677 57, 57, 57, 57, 58, 58, 58, 59, 60, 60,
678 61, 61, 62, 62, 63, 63, 64, 64, 65, 65,
679 66, 66, 66, 67, 67, 67, 67, 67, 68, 68,
680 68, 69, 69, 69, 70, 70, 70, 70, 71, 71,
681 71, 71, 72, 72, 72, 73, 73, 73, 74, 74,
685 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
686 static const yytype_uint8 yyr2[] =
688 0, 2, 4, 0, 2, 4, 2, 2, 3, 4,
689 3, 4, 5, 0, 2, 4, 2, 3, 2, 2,
690 3, 4, 2, 9, 5, 2, 0, 2, 2, 3,
691 1, 2, 2, 2, 1, 1, 3, 1, 1, 5,
692 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
693 1, 3, 3, 1, 3, 3, 3, 3, 3, 3,
694 1, 3, 3, 1, 3, 3, 3, 1, 1, 2,
695 2, 2, 0, 2, 2, 0, 2, 2, 2, 3,
700 #define yyerrok (yyerrstatus = 0)
701 #define yyclearin (yychar = YYEMPTY)
705 #define YYACCEPT goto yyacceptlab
706 #define YYABORT goto yyabortlab
707 #define YYERROR goto yyerrorlab
710 #define YYRECOVERING() (!!yyerrstatus)
712 #define YYBACKUP(Token, Value) \
714 if (yychar == YYEMPTY) \
718 YYPOPSTACK (yylen); \
724 yyerror (YY_("syntax error: cannot back up")); \
729 /* Error token number */
731 #define YYERRCODE 256
734 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
735 If N is 0, then set CURRENT to the empty location which ends
736 the previous symbol: RHS[0] (always defined). */
738 #ifndef YYLLOC_DEFAULT
739 # define YYLLOC_DEFAULT(Current, Rhs, N) \
743 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
744 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
745 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
746 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
750 (Current).first_line = (Current).last_line = \
751 YYRHSLOC (Rhs, 0).last_line; \
752 (Current).first_column = (Current).last_column = \
753 YYRHSLOC (Rhs, 0).last_column; \
758 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
761 /* Enable debugging if requested. */
765 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
766 # define YYFPRINTF fprintf
769 # define YYDPRINTF(Args) \
776 /* YY_LOCATION_PRINT -- Print the location on the stream.
777 This macro was not mandated originally: define only if we know
778 we won't break user code: when these are the locations we know. */
780 #ifndef YY_LOCATION_PRINT
781 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
783 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
787 yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
790 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
791 if (0 <= yylocp->first_line)
793 res += YYFPRINTF (yyo, "%d", yylocp->first_line);
794 if (0 <= yylocp->first_column)
795 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
797 if (0 <= yylocp->last_line)
799 if (yylocp->first_line < yylocp->last_line)
801 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
803 res += YYFPRINTF (yyo, ".%d", end_col);
805 else if (0 <= end_col && yylocp->first_column < end_col)
806 res += YYFPRINTF (yyo, "-%d", end_col);
811 # define YY_LOCATION_PRINT(File, Loc) \
812 yy_location_print_ (File, &(Loc))
815 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
820 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
824 YYFPRINTF (stderr, "%s ", Title); \
825 yy_symbol_print (stderr, \
826 Type, Value, Location); \
827 YYFPRINTF (stderr, "\n"); \
832 /*----------------------------------------.
833 | Print this symbol's value on YYOUTPUT. |
834 `----------------------------------------*/
837 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
839 FILE *yyo = yyoutput;
845 if (yytype < YYNTOKENS)
846 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
852 /*--------------------------------.
853 | Print this symbol on YYOUTPUT. |
854 `--------------------------------*/
857 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
859 YYFPRINTF (yyoutput, "%s %s (",
860 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
862 YY_LOCATION_PRINT (yyoutput, *yylocationp);
863 YYFPRINTF (yyoutput, ": ");
864 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
865 YYFPRINTF (yyoutput, ")");
868 /*------------------------------------------------------------------.
869 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
871 `------------------------------------------------------------------*/
874 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
876 YYFPRINTF (stderr, "Stack now");
877 for (; yybottom <= yytop; yybottom++)
879 int yybot = *yybottom;
880 YYFPRINTF (stderr, " %d", yybot);
882 YYFPRINTF (stderr, "\n");
885 # define YY_STACK_PRINT(Bottom, Top) \
888 yy_stack_print ((Bottom), (Top)); \
892 /*------------------------------------------------.
893 | Report that the YYRULE is going to be reduced. |
894 `------------------------------------------------*/
897 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
899 unsigned long int yylno = yyrline[yyrule];
900 int yynrhs = yyr2[yyrule];
902 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
904 /* The symbols being reduced. */
905 for (yyi = 0; yyi < yynrhs; yyi++)
907 YYFPRINTF (stderr, " $%d = ", yyi + 1);
908 yy_symbol_print (stderr,
909 yystos[yyssp[yyi + 1 - yynrhs]],
910 &(yyvsp[(yyi + 1) - (yynrhs)])
911 , &(yylsp[(yyi + 1) - (yynrhs)]) );
912 YYFPRINTF (stderr, "\n");
916 # define YY_REDUCE_PRINT(Rule) \
919 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
922 /* Nonzero means print parse trace. It is left uninitialized so that
923 multiple parsers can coexist. */
926 # define YYDPRINTF(Args)
927 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
928 # define YY_STACK_PRINT(Bottom, Top)
929 # define YY_REDUCE_PRINT(Rule)
930 #endif /* !YYDEBUG */
933 /* YYINITDEPTH -- initial size of the parser's stacks. */
935 # define YYINITDEPTH 200
938 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
939 if the built-in stack extension method is used).
941 Do not make this value too large; the results are undefined if
942 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
943 evaluated with infinite-precision integer arithmetic. */
946 # define YYMAXDEPTH 10000
953 # if defined __GLIBC__ && defined _STRING_H
954 # define yystrlen strlen
956 /* Return the length of YYSTR. */
958 yystrlen (const char *yystr)
961 for (yylen = 0; yystr[yylen]; yylen++)
969 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
970 # define yystpcpy stpcpy
972 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
975 yystpcpy (char *yydest, const char *yysrc)
978 const char *yys = yysrc;
980 while ((*yyd++ = *yys++) != '\0')
989 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
990 quotes and backslashes, so that it's suitable for yyerror. The
991 heuristic is that double-quoting is unnecessary unless the string
992 contains an apostrophe, a comma, or backslash (other than
993 backslash-backslash). YYSTR is taken from yytname. If YYRES is
994 null, do not copy; instead, return the length of what the result
997 yytnamerr (char *yyres, const char *yystr)
1002 char const *yyp = yystr;
1009 goto do_not_strip_quotes;
1013 goto do_not_strip_quotes;
1026 do_not_strip_quotes: ;
1030 return yystrlen (yystr);
1032 return yystpcpy (yyres, yystr) - yyres;
1036 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1037 about the unexpected token YYTOKEN for the state stack whose top is
1040 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1041 not large enough to hold the message. In that case, also set
1042 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1043 required number of bytes is too large to store. */
1045 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1046 yytype_int16 *yyssp, int yytoken)
1048 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1049 YYSIZE_T yysize = yysize0;
1050 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1051 /* Internationalized format string. */
1052 const char *yyformat = YY_NULLPTR;
1053 /* Arguments of yyformat. */
1054 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1055 /* Number of reported tokens (one for the "unexpected", one per
1059 /* There are many possibilities here to consider:
1060 - If this state is a consistent state with a default action, then
1061 the only way this function was invoked is if the default action
1062 is an error action. In that case, don't check for expected
1063 tokens because there are none.
1064 - The only way there can be no lookahead present (in yychar) is if
1065 this state is a consistent state with a default action. Thus,
1066 detecting the absence of a lookahead is sufficient to determine
1067 that there is no unexpected or expected token to report. In that
1068 case, just report a simple "syntax error".
1069 - Don't assume there isn't a lookahead just because this state is a
1070 consistent state with a default action. There might have been a
1071 previous inconsistent state, consistent state with a non-default
1072 action, or user semantic action that manipulated yychar.
1073 - Of course, the expected token list depends on states to have
1074 correct lookahead information, and it depends on the parser not
1075 to perform extra reductions after fetching a lookahead from the
1076 scanner and before detecting a syntax error. Thus, state merging
1077 (from LALR or IELR) and default reductions corrupt the expected
1078 token list. However, the list is correct for canonical LR with
1079 one exception: it will still contain any token that will not be
1080 accepted due to an error action in a later state.
1082 if (yytoken != YYEMPTY)
1084 int yyn = yypact[*yyssp];
1085 yyarg[yycount++] = yytname[yytoken];
1086 if (!yypact_value_is_default (yyn))
1088 /* Start YYX at -YYN if negative to avoid negative indexes in
1089 YYCHECK. In other words, skip the first -YYN actions for
1090 this state because they are default actions. */
1091 int yyxbegin = yyn < 0 ? -yyn : 0;
1092 /* Stay within bounds of both yycheck and yytname. */
1093 int yychecklim = YYLAST - yyn + 1;
1094 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1097 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1098 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1099 && !yytable_value_is_error (yytable[yyx + yyn]))
1101 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1107 yyarg[yycount++] = yytname[yyx];
1109 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1110 if (! (yysize <= yysize1
1111 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1121 # define YYCASE_(N, S) \
1125 YYCASE_(0, YY_("syntax error"));
1126 YYCASE_(1, YY_("syntax error, unexpected %s"));
1127 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1128 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1129 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1130 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1135 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1136 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1141 if (*yymsg_alloc < yysize)
1143 *yymsg_alloc = 2 * yysize;
1144 if (! (yysize <= *yymsg_alloc
1145 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1146 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1150 /* Avoid sprintf, as that infringes on the user's name space.
1151 Don't have undefined behavior even if the translation
1152 produced a string with the wrong number of "%s"s. */
1156 while ((*yyp = *yyformat) != '\0')
1157 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1159 yyp += yytnamerr (yyp, yyarg[yyi++]);
1170 #endif /* YYERROR_VERBOSE */
1172 /*-----------------------------------------------.
1173 | Release the memory associated to this symbol. |
1174 `-----------------------------------------------*/
1177 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
1180 YYUSE (yylocationp);
1183 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1185 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1187 YY_IGNORE_MAYBE_UNINITIALIZED_END
1193 /* The lookahead symbol. */
1196 /* The semantic value of the lookahead symbol. */
1198 /* Location data for the lookahead symbol. */
1200 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1204 /* Number of syntax errors so far. */
1216 /* Number of tokens to shift before error messages enabled. */
1219 /* The stacks and their tools:
1220 'yyss': related to states.
1221 'yyvs': related to semantic values.
1222 'yyls': related to locations.
1224 Refer to the stacks through separate pointers, to allow yyoverflow
1225 to reallocate them elsewhere. */
1227 /* The state stack. */
1228 yytype_int16 yyssa[YYINITDEPTH];
1230 yytype_int16 *yyssp;
1232 /* The semantic value stack. */
1233 YYSTYPE yyvsa[YYINITDEPTH];
1237 /* The location stack. */
1238 YYLTYPE yylsa[YYINITDEPTH];
1242 /* The locations where the error started and ended. */
1243 YYLTYPE yyerror_range[3];
1245 YYSIZE_T yystacksize;
1249 /* Lookahead token as an internal (translated) token number. */
1251 /* The variables used to return semantic value and location from the
1257 /* Buffer for error messages, and its allocated size. */
1259 char *yymsg = yymsgbuf;
1260 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1263 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1265 /* The number of symbols on the RHS of the reduced rule.
1266 Keep to zero when no symbol should be popped. */
1269 yyssp = yyss = yyssa;
1270 yyvsp = yyvs = yyvsa;
1271 yylsp = yyls = yylsa;
1272 yystacksize = YYINITDEPTH;
1274 YYDPRINTF ((stderr, "Starting parse\n"));
1279 yychar = YYEMPTY; /* Cause a token to be read. */
1283 /*------------------------------------------------------------.
1284 | yynewstate -- Push a new state, which is found in yystate. |
1285 `------------------------------------------------------------*/
1287 /* In all cases, when you get here, the value and location stacks
1288 have just been pushed. So pushing a state here evens the stacks. */
1294 if (yyss + yystacksize - 1 <= yyssp)
1296 /* Get the current used size of the three stacks, in elements. */
1297 YYSIZE_T yysize = yyssp - yyss + 1;
1301 /* Give user a chance to reallocate the stack. Use copies of
1302 these so that the &'s don't force the real ones into
1304 YYSTYPE *yyvs1 = yyvs;
1305 yytype_int16 *yyss1 = yyss;
1306 YYLTYPE *yyls1 = yyls;
1308 /* Each stack pointer address is followed by the size of the
1309 data in use in that stack, in bytes. This used to be a
1310 conditional around just the two extra args, but that might
1311 be undefined if yyoverflow is a macro. */
1312 yyoverflow (YY_("memory exhausted"),
1313 &yyss1, yysize * sizeof (*yyssp),
1314 &yyvs1, yysize * sizeof (*yyvsp),
1315 &yyls1, yysize * sizeof (*yylsp),
1322 #else /* no yyoverflow */
1323 # ifndef YYSTACK_RELOCATE
1324 goto yyexhaustedlab;
1326 /* Extend the stack our own way. */
1327 if (YYMAXDEPTH <= yystacksize)
1328 goto yyexhaustedlab;
1330 if (YYMAXDEPTH < yystacksize)
1331 yystacksize = YYMAXDEPTH;
1334 yytype_int16 *yyss1 = yyss;
1335 union yyalloc *yyptr =
1336 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1338 goto yyexhaustedlab;
1339 YYSTACK_RELOCATE (yyss_alloc, yyss);
1340 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1341 YYSTACK_RELOCATE (yyls_alloc, yyls);
1342 # undef YYSTACK_RELOCATE
1344 YYSTACK_FREE (yyss1);
1347 #endif /* no yyoverflow */
1349 yyssp = yyss + yysize - 1;
1350 yyvsp = yyvs + yysize - 1;
1351 yylsp = yyls + yysize - 1;
1353 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1354 (unsigned long int) yystacksize));
1356 if (yyss + yystacksize - 1 <= yyssp)
1360 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1362 if (yystate == YYFINAL)
1372 /* Do appropriate processing given the current state. Read a
1373 lookahead token if we need one and don't already have one. */
1375 /* First try to decide what to do without reference to lookahead token. */
1376 yyn = yypact[yystate];
1377 if (yypact_value_is_default (yyn))
1380 /* Not known => get a lookahead token if don't already have one. */
1382 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1383 if (yychar == YYEMPTY)
1385 YYDPRINTF ((stderr, "Reading a token: "));
1389 if (yychar <= YYEOF)
1391 yychar = yytoken = YYEOF;
1392 YYDPRINTF ((stderr, "Now at end of input.\n"));
1396 yytoken = YYTRANSLATE (yychar);
1397 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1400 /* If the proper action on seeing token YYTOKEN is to reduce or to
1401 detect an error, take that action. */
1403 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1408 if (yytable_value_is_error (yyn))
1414 /* Count tokens shifted since error; after three, turn off error
1419 /* Shift the lookahead token. */
1420 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1422 /* Discard the shifted token. */
1426 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1428 YY_IGNORE_MAYBE_UNINITIALIZED_END
1433 /*-----------------------------------------------------------.
1434 | yydefault -- do the default action for the current state. |
1435 `-----------------------------------------------------------*/
1437 yyn = yydefact[yystate];
1443 /*-----------------------------.
1444 | yyreduce -- Do a reduction. |
1445 `-----------------------------*/
1447 /* yyn is the number of a rule to reduce with. */
1450 /* If YYLEN is nonzero, implement the default value of the action:
1453 Otherwise, the following line sets YYVAL to garbage.
1454 This behavior is undocumented and Bison
1455 users should not rely upon it. Assigning to YYVAL
1456 unconditionally makes the parser a bit smaller, and it avoids a
1457 GCC warning that YYVAL may be used uninitialized. */
1458 yyval = yyvsp[1-yylen];
1460 /* Default location. */
1461 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1462 YY_REDUCE_PRINT (yyn);
1466 #line 105 "dtc-parser.y" /* yacc.c:1646 */
1468 the_boot_info = build_boot_info((yyvsp[-1].re), (yyvsp[0].node),
1469 guess_boot_cpuid((yyvsp[0].node)));
1471 #line 1472 "dtc-parser.tab.c" /* yacc.c:1646 */
1475 #line 113 "dtc-parser.y" /* yacc.c:1646 */
1479 #line 1480 "dtc-parser.tab.c" /* yacc.c:1646 */
1483 #line 117 "dtc-parser.y" /* yacc.c:1646 */
1485 (yyval.re) = chain_reserve_entry((yyvsp[-1].re), (yyvsp[0].re));
1487 #line 1488 "dtc-parser.tab.c" /* yacc.c:1646 */
1491 #line 124 "dtc-parser.y" /* yacc.c:1646 */
1493 (yyval.re) = build_reserve_entry((yyvsp[-2].integer), (yyvsp[-1].integer));
1495 #line 1496 "dtc-parser.tab.c" /* yacc.c:1646 */
1499 #line 128 "dtc-parser.y" /* yacc.c:1646 */
1501 add_label(&(yyvsp[0].re)->labels, (yyvsp[-1].labelref));
1502 (yyval.re) = (yyvsp[0].re);
1504 #line 1505 "dtc-parser.tab.c" /* yacc.c:1646 */
1508 #line 136 "dtc-parser.y" /* yacc.c:1646 */
1510 (yyval.node) = name_node((yyvsp[0].node), "");
1512 #line 1513 "dtc-parser.tab.c" /* yacc.c:1646 */
1516 #line 140 "dtc-parser.y" /* yacc.c:1646 */
1518 (yyval.node) = merge_nodes((yyvsp[-2].node), (yyvsp[0].node));
1520 #line 1521 "dtc-parser.tab.c" /* yacc.c:1646 */
1524 #line 145 "dtc-parser.y" /* yacc.c:1646 */
1526 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1528 add_label(&target->labels, (yyvsp[-2].labelref));
1530 merge_nodes(target, (yyvsp[0].node));
1532 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1533 (yyval.node) = (yyvsp[-3].node);
1535 #line 1536 "dtc-parser.tab.c" /* yacc.c:1646 */
1539 #line 156 "dtc-parser.y" /* yacc.c:1646 */
1541 struct node *target = get_node_by_ref((yyvsp[-2].node), (yyvsp[-1].labelref));
1544 merge_nodes(target, (yyvsp[0].node));
1546 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1547 (yyval.node) = (yyvsp[-2].node);
1549 #line 1550 "dtc-parser.tab.c" /* yacc.c:1646 */
1553 #line 166 "dtc-parser.y" /* yacc.c:1646 */
1555 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1558 delete_node(target);
1560 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1563 (yyval.node) = (yyvsp[-3].node);
1565 #line 1566 "dtc-parser.tab.c" /* yacc.c:1646 */
1569 #line 181 "dtc-parser.y" /* yacc.c:1646 */
1571 (yyval.node) = build_node((yyvsp[-3].proplist), (yyvsp[-2].nodelist));
1573 #line 1574 "dtc-parser.tab.c" /* yacc.c:1646 */
1577 #line 188 "dtc-parser.y" /* yacc.c:1646 */
1579 (yyval.proplist) = NULL;
1581 #line 1582 "dtc-parser.tab.c" /* yacc.c:1646 */
1585 #line 192 "dtc-parser.y" /* yacc.c:1646 */
1587 (yyval.proplist) = chain_property((yyvsp[0].prop), (yyvsp[-1].proplist));
1589 #line 1590 "dtc-parser.tab.c" /* yacc.c:1646 */
1593 #line 199 "dtc-parser.y" /* yacc.c:1646 */
1595 (yyval.prop) = build_property((yyvsp[-3].propnodename), (yyvsp[-1].data));
1597 #line 1598 "dtc-parser.tab.c" /* yacc.c:1646 */
1601 #line 203 "dtc-parser.y" /* yacc.c:1646 */
1603 (yyval.prop) = build_property((yyvsp[-1].propnodename), empty_data);
1605 #line 1606 "dtc-parser.tab.c" /* yacc.c:1646 */
1609 #line 207 "dtc-parser.y" /* yacc.c:1646 */
1611 (yyval.prop) = build_property_delete((yyvsp[-1].propnodename));
1613 #line 1614 "dtc-parser.tab.c" /* yacc.c:1646 */
1617 #line 211 "dtc-parser.y" /* yacc.c:1646 */
1619 add_label(&(yyvsp[0].prop)->labels, (yyvsp[-1].labelref));
1620 (yyval.prop) = (yyvsp[0].prop);
1622 #line 1623 "dtc-parser.tab.c" /* yacc.c:1646 */
1626 #line 219 "dtc-parser.y" /* yacc.c:1646 */
1628 (yyval.data) = data_merge((yyvsp[-1].data), (yyvsp[0].data));
1630 #line 1631 "dtc-parser.tab.c" /* yacc.c:1646 */
1634 #line 223 "dtc-parser.y" /* yacc.c:1646 */
1636 (yyval.data) = data_merge((yyvsp[-2].data), (yyvsp[-1].array).data);
1638 #line 1639 "dtc-parser.tab.c" /* yacc.c:1646 */
1642 #line 227 "dtc-parser.y" /* yacc.c:1646 */
1644 (yyval.data) = data_merge((yyvsp[-3].data), (yyvsp[-1].data));
1646 #line 1647 "dtc-parser.tab.c" /* yacc.c:1646 */
1650 #line 231 "dtc-parser.y" /* yacc.c:1646 */
1652 (yyval.data) = data_add_marker((yyvsp[-1].data), REF_PATH, (yyvsp[0].labelref));
1654 #line 1655 "dtc-parser.tab.c" /* yacc.c:1646 */
1658 #line 235 "dtc-parser.y" /* yacc.c:1646 */
1660 FILE *f = srcfile_relative_open((yyvsp[-5].data).val, NULL);
1663 if ((yyvsp[-3].integer) != 0)
1664 if (fseek(f, (yyvsp[-3].integer), SEEK_SET) != 0)
1665 die("Couldn't seek to offset %llu in \"%s\": %s",
1666 (unsigned long long)(yyvsp[-3].integer), (yyvsp[-5].data).val,
1669 d = data_copy_file(f, (yyvsp[-1].integer));
1671 (yyval.data) = data_merge((yyvsp[-8].data), d);
1674 #line 1675 "dtc-parser.tab.c" /* yacc.c:1646 */
1678 #line 251 "dtc-parser.y" /* yacc.c:1646 */
1680 FILE *f = srcfile_relative_open((yyvsp[-1].data).val, NULL);
1681 struct data d = empty_data;
1683 d = data_copy_file(f, -1);
1685 (yyval.data) = data_merge((yyvsp[-4].data), d);
1688 #line 1689 "dtc-parser.tab.c" /* yacc.c:1646 */
1692 #line 261 "dtc-parser.y" /* yacc.c:1646 */
1694 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1696 #line 1697 "dtc-parser.tab.c" /* yacc.c:1646 */
1700 #line 268 "dtc-parser.y" /* yacc.c:1646 */
1702 (yyval.data) = empty_data;
1704 #line 1705 "dtc-parser.tab.c" /* yacc.c:1646 */
1708 #line 272 "dtc-parser.y" /* yacc.c:1646 */
1710 (yyval.data) = (yyvsp[-1].data);
1712 #line 1713 "dtc-parser.tab.c" /* yacc.c:1646 */
1716 #line 276 "dtc-parser.y" /* yacc.c:1646 */
1718 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1720 #line 1721 "dtc-parser.tab.c" /* yacc.c:1646 */
1724 #line 283 "dtc-parser.y" /* yacc.c:1646 */
1726 unsigned long long bits;
1728 bits = (yyvsp[-1].integer);
1730 if ((bits != 8) && (bits != 16) &&
1731 (bits != 32) && (bits != 64)) {
1732 ERROR(&(yylsp[-1]), "Array elements must be"
1733 " 8, 16, 32 or 64-bits");
1737 (yyval.array).data = empty_data;
1738 (yyval.array).bits = bits;
1740 #line 1741 "dtc-parser.tab.c" /* yacc.c:1646 */
1744 #line 299 "dtc-parser.y" /* yacc.c:1646 */
1746 (yyval.array).data = empty_data;
1747 (yyval.array).bits = 32;
1749 #line 1750 "dtc-parser.tab.c" /* yacc.c:1646 */
1753 #line 304 "dtc-parser.y" /* yacc.c:1646 */
1755 if ((yyvsp[-1].array).bits < 64) {
1756 uint64_t mask = (1ULL << (yyvsp[-1].array).bits) - 1;
1758 * Bits above mask must either be all zero
1759 * (positive within range of mask) or all one
1760 * (negative and sign-extended). The second
1761 * condition is true if when we set all bits
1762 * within the mask to one (i.e. | in the
1763 * mask), all bits are one.
1765 if (((yyvsp[0].integer) > mask) && (((yyvsp[0].integer) | mask) != -1ULL))
1766 ERROR(&(yylsp[0]), "Value out of range for"
1767 " %d-bit array element", (yyvsp[-1].array).bits);
1770 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, (yyvsp[0].integer), (yyvsp[-1].array).bits);
1772 #line 1773 "dtc-parser.tab.c" /* yacc.c:1646 */
1776 #line 323 "dtc-parser.y" /* yacc.c:1646 */
1778 uint64_t val = ~0ULL >> (64 - (yyvsp[-1].array).bits);
1780 if ((yyvsp[-1].array).bits == 32)
1781 (yyvsp[-1].array).data = data_add_marker((yyvsp[-1].array).data,
1783 (yyvsp[0].labelref));
1785 ERROR(&(yylsp[0]), "References are only allowed in "
1786 "arrays with 32-bit elements.");
1788 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, val, (yyvsp[-1].array).bits);
1790 #line 1791 "dtc-parser.tab.c" /* yacc.c:1646 */
1794 #line 337 "dtc-parser.y" /* yacc.c:1646 */
1796 (yyval.array).data = data_add_marker((yyvsp[-1].array).data, LABEL, (yyvsp[0].labelref));
1798 #line 1799 "dtc-parser.tab.c" /* yacc.c:1646 */
1802 #line 346 "dtc-parser.y" /* yacc.c:1646 */
1804 (yyval.integer) = (yyvsp[-1].integer);
1806 #line 1807 "dtc-parser.tab.c" /* yacc.c:1646 */
1810 #line 357 "dtc-parser.y" /* yacc.c:1646 */
1811 { (yyval.integer) = (yyvsp[-4].integer) ? (yyvsp[-2].integer) : (yyvsp[0].integer); }
1812 #line 1813 "dtc-parser.tab.c" /* yacc.c:1646 */
1816 #line 362 "dtc-parser.y" /* yacc.c:1646 */
1817 { (yyval.integer) = (yyvsp[-2].integer) || (yyvsp[0].integer); }
1818 #line 1819 "dtc-parser.tab.c" /* yacc.c:1646 */
1822 #line 367 "dtc-parser.y" /* yacc.c:1646 */
1823 { (yyval.integer) = (yyvsp[-2].integer) && (yyvsp[0].integer); }
1824 #line 1825 "dtc-parser.tab.c" /* yacc.c:1646 */
1828 #line 372 "dtc-parser.y" /* yacc.c:1646 */
1829 { (yyval.integer) = (yyvsp[-2].integer) | (yyvsp[0].integer); }
1830 #line 1831 "dtc-parser.tab.c" /* yacc.c:1646 */
1834 #line 377 "dtc-parser.y" /* yacc.c:1646 */
1835 { (yyval.integer) = (yyvsp[-2].integer) ^ (yyvsp[0].integer); }
1836 #line 1837 "dtc-parser.tab.c" /* yacc.c:1646 */
1840 #line 382 "dtc-parser.y" /* yacc.c:1646 */
1841 { (yyval.integer) = (yyvsp[-2].integer) & (yyvsp[0].integer); }
1842 #line 1843 "dtc-parser.tab.c" /* yacc.c:1646 */
1846 #line 387 "dtc-parser.y" /* yacc.c:1646 */
1847 { (yyval.integer) = (yyvsp[-2].integer) == (yyvsp[0].integer); }
1848 #line 1849 "dtc-parser.tab.c" /* yacc.c:1646 */
1852 #line 388 "dtc-parser.y" /* yacc.c:1646 */
1853 { (yyval.integer) = (yyvsp[-2].integer) != (yyvsp[0].integer); }
1854 #line 1855 "dtc-parser.tab.c" /* yacc.c:1646 */
1858 #line 393 "dtc-parser.y" /* yacc.c:1646 */
1859 { (yyval.integer) = (yyvsp[-2].integer) < (yyvsp[0].integer); }
1860 #line 1861 "dtc-parser.tab.c" /* yacc.c:1646 */
1864 #line 394 "dtc-parser.y" /* yacc.c:1646 */
1865 { (yyval.integer) = (yyvsp[-2].integer) > (yyvsp[0].integer); }
1866 #line 1867 "dtc-parser.tab.c" /* yacc.c:1646 */
1870 #line 395 "dtc-parser.y" /* yacc.c:1646 */
1871 { (yyval.integer) = (yyvsp[-2].integer) <= (yyvsp[0].integer); }
1872 #line 1873 "dtc-parser.tab.c" /* yacc.c:1646 */
1876 #line 396 "dtc-parser.y" /* yacc.c:1646 */
1877 { (yyval.integer) = (yyvsp[-2].integer) >= (yyvsp[0].integer); }
1878 #line 1879 "dtc-parser.tab.c" /* yacc.c:1646 */
1882 #line 400 "dtc-parser.y" /* yacc.c:1646 */
1883 { (yyval.integer) = (yyvsp[-2].integer) << (yyvsp[0].integer); }
1884 #line 1885 "dtc-parser.tab.c" /* yacc.c:1646 */
1888 #line 401 "dtc-parser.y" /* yacc.c:1646 */
1889 { (yyval.integer) = (yyvsp[-2].integer) >> (yyvsp[0].integer); }
1890 #line 1891 "dtc-parser.tab.c" /* yacc.c:1646 */
1894 #line 406 "dtc-parser.y" /* yacc.c:1646 */
1895 { (yyval.integer) = (yyvsp[-2].integer) + (yyvsp[0].integer); }
1896 #line 1897 "dtc-parser.tab.c" /* yacc.c:1646 */
1900 #line 407 "dtc-parser.y" /* yacc.c:1646 */
1901 { (yyval.integer) = (yyvsp[-2].integer) - (yyvsp[0].integer); }
1902 #line 1903 "dtc-parser.tab.c" /* yacc.c:1646 */
1906 #line 412 "dtc-parser.y" /* yacc.c:1646 */
1907 { (yyval.integer) = (yyvsp[-2].integer) * (yyvsp[0].integer); }
1908 #line 1909 "dtc-parser.tab.c" /* yacc.c:1646 */
1912 #line 413 "dtc-parser.y" /* yacc.c:1646 */
1913 { (yyval.integer) = (yyvsp[-2].integer) / (yyvsp[0].integer); }
1914 #line 1915 "dtc-parser.tab.c" /* yacc.c:1646 */
1918 #line 414 "dtc-parser.y" /* yacc.c:1646 */
1919 { (yyval.integer) = (yyvsp[-2].integer) % (yyvsp[0].integer); }
1920 #line 1921 "dtc-parser.tab.c" /* yacc.c:1646 */
1924 #line 420 "dtc-parser.y" /* yacc.c:1646 */
1925 { (yyval.integer) = -(yyvsp[0].integer); }
1926 #line 1927 "dtc-parser.tab.c" /* yacc.c:1646 */
1930 #line 421 "dtc-parser.y" /* yacc.c:1646 */
1931 { (yyval.integer) = ~(yyvsp[0].integer); }
1932 #line 1933 "dtc-parser.tab.c" /* yacc.c:1646 */
1936 #line 422 "dtc-parser.y" /* yacc.c:1646 */
1937 { (yyval.integer) = !(yyvsp[0].integer); }
1938 #line 1939 "dtc-parser.tab.c" /* yacc.c:1646 */
1942 #line 427 "dtc-parser.y" /* yacc.c:1646 */
1944 (yyval.data) = empty_data;
1946 #line 1947 "dtc-parser.tab.c" /* yacc.c:1646 */
1950 #line 431 "dtc-parser.y" /* yacc.c:1646 */
1952 (yyval.data) = data_append_byte((yyvsp[-1].data), (yyvsp[0].byte));
1954 #line 1955 "dtc-parser.tab.c" /* yacc.c:1646 */
1958 #line 435 "dtc-parser.y" /* yacc.c:1646 */
1960 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1962 #line 1963 "dtc-parser.tab.c" /* yacc.c:1646 */
1966 #line 442 "dtc-parser.y" /* yacc.c:1646 */
1968 (yyval.nodelist) = NULL;
1970 #line 1971 "dtc-parser.tab.c" /* yacc.c:1646 */
1974 #line 446 "dtc-parser.y" /* yacc.c:1646 */
1976 (yyval.nodelist) = chain_node((yyvsp[-1].node), (yyvsp[0].nodelist));
1978 #line 1979 "dtc-parser.tab.c" /* yacc.c:1646 */
1982 #line 450 "dtc-parser.y" /* yacc.c:1646 */
1984 ERROR(&(yylsp[0]), "Properties must precede subnodes");
1987 #line 1988 "dtc-parser.tab.c" /* yacc.c:1646 */
1991 #line 458 "dtc-parser.y" /* yacc.c:1646 */
1993 (yyval.node) = name_node((yyvsp[0].node), (yyvsp[-1].propnodename));
1995 #line 1996 "dtc-parser.tab.c" /* yacc.c:1646 */
1999 #line 462 "dtc-parser.y" /* yacc.c:1646 */
2001 (yyval.node) = name_node(build_node_delete(), (yyvsp[-1].propnodename));
2003 #line 2004 "dtc-parser.tab.c" /* yacc.c:1646 */
2007 #line 466 "dtc-parser.y" /* yacc.c:1646 */
2009 add_label(&(yyvsp[0].node)->labels, (yyvsp[-1].labelref));
2010 (yyval.node) = (yyvsp[0].node);
2012 #line 2013 "dtc-parser.tab.c" /* yacc.c:1646 */
2016 #line 2017 "dtc-parser.tab.c" /* yacc.c:1646 */
2019 /* User semantic actions sometimes alter yychar, and that requires
2020 that yytoken be updated with the new translation. We take the
2021 approach of translating immediately before every use of yytoken.
2022 One alternative is translating here after every semantic action,
2023 but that translation would be missed if the semantic action invokes
2024 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2025 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2026 incorrect destructor might then be invoked immediately. In the
2027 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2028 to an incorrect destructor call or verbose syntax error message
2029 before the lookahead is translated. */
2030 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2034 YY_STACK_PRINT (yyss, yyssp);
2039 /* Now 'shift' the result of the reduction. Determine what state
2040 that goes to, based on the state we popped back to and the rule
2041 number reduced by. */
2045 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2046 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2047 yystate = yytable[yystate];
2049 yystate = yydefgoto[yyn - YYNTOKENS];
2054 /*--------------------------------------.
2055 | yyerrlab -- here on detecting error. |
2056 `--------------------------------------*/
2058 /* Make sure we have latest lookahead translation. See comments at
2059 user semantic actions for why this is necessary. */
2060 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2062 /* If not already recovering from an error, report this error. */
2066 #if ! YYERROR_VERBOSE
2067 yyerror (YY_("syntax error"));
2069 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2072 char const *yymsgp = YY_("syntax error");
2073 int yysyntax_error_status;
2074 yysyntax_error_status = YYSYNTAX_ERROR;
2075 if (yysyntax_error_status == 0)
2077 else if (yysyntax_error_status == 1)
2079 if (yymsg != yymsgbuf)
2080 YYSTACK_FREE (yymsg);
2081 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2085 yymsg_alloc = sizeof yymsgbuf;
2086 yysyntax_error_status = 2;
2090 yysyntax_error_status = YYSYNTAX_ERROR;
2095 if (yysyntax_error_status == 2)
2096 goto yyexhaustedlab;
2098 # undef YYSYNTAX_ERROR
2102 yyerror_range[1] = yylloc;
2104 if (yyerrstatus == 3)
2106 /* If just tried and failed to reuse lookahead token after an
2107 error, discard it. */
2109 if (yychar <= YYEOF)
2111 /* Return failure if at end of input. */
2112 if (yychar == YYEOF)
2117 yydestruct ("Error: discarding",
2118 yytoken, &yylval, &yylloc);
2123 /* Else will try to reuse lookahead token after shifting the error
2128 /*---------------------------------------------------.
2129 | yyerrorlab -- error raised explicitly by YYERROR. |
2130 `---------------------------------------------------*/
2133 /* Pacify compilers like GCC when the user code never invokes
2134 YYERROR and the label yyerrorlab therefore never appears in user
2136 if (/*CONSTCOND*/ 0)
2139 yyerror_range[1] = yylsp[1-yylen];
2140 /* Do not reclaim the symbols of the rule whose action triggered
2144 YY_STACK_PRINT (yyss, yyssp);
2149 /*-------------------------------------------------------------.
2150 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2151 `-------------------------------------------------------------*/
2153 yyerrstatus = 3; /* Each real token shifted decrements this. */
2157 yyn = yypact[yystate];
2158 if (!yypact_value_is_default (yyn))
2161 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2169 /* Pop the current state because it cannot handle the error token. */
2173 yyerror_range[1] = *yylsp;
2174 yydestruct ("Error: popping",
2175 yystos[yystate], yyvsp, yylsp);
2178 YY_STACK_PRINT (yyss, yyssp);
2181 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2183 YY_IGNORE_MAYBE_UNINITIALIZED_END
2185 yyerror_range[2] = yylloc;
2186 /* Using YYLLOC is tempting, but would change the location of
2187 the lookahead. YYLOC is available though. */
2188 YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
2191 /* Shift the error token. */
2192 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2198 /*-------------------------------------.
2199 | yyacceptlab -- YYACCEPT comes here. |
2200 `-------------------------------------*/
2205 /*-----------------------------------.
2206 | yyabortlab -- YYABORT comes here. |
2207 `-----------------------------------*/
2212 #if !defined yyoverflow || YYERROR_VERBOSE
2213 /*-------------------------------------------------.
2214 | yyexhaustedlab -- memory exhaustion comes here. |
2215 `-------------------------------------------------*/
2217 yyerror (YY_("memory exhausted"));
2223 if (yychar != YYEMPTY)
2225 /* Make sure we have latest lookahead translation. See comments at
2226 user semantic actions for why this is necessary. */
2227 yytoken = YYTRANSLATE (yychar);
2228 yydestruct ("Cleanup: discarding lookahead",
2229 yytoken, &yylval, &yylloc);
2231 /* Do not reclaim the symbols of the rule whose action triggered
2232 this YYABORT or YYACCEPT. */
2234 YY_STACK_PRINT (yyss, yyssp);
2235 while (yyssp != yyss)
2237 yydestruct ("Cleanup: popping",
2238 yystos[*yyssp], yyvsp, yylsp);
2243 YYSTACK_FREE (yyss);
2246 if (yymsg != yymsgbuf)
2247 YYSTACK_FREE (yymsg);
2251 #line 472 "dtc-parser.y" /* yacc.c:1906 */
2254 void yyerror(char const *s)
2256 ERROR(&yylloc, "%s", s);