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 */
73 extern int yylex(void);
74 extern void yyerror(char const *s);
75 #define ERROR(loc, ...) \
77 srcpos_error((loc), "Error", __VA_ARGS__); \
78 treesource_error = true; \
81 extern struct boot_info *the_boot_info;
82 extern bool treesource_error;
84 #line 85 "dtc-parser.tab.c" /* yacc.c:339 */
87 # if defined __cplusplus && 201103L <= __cplusplus
88 # define YY_NULLPTR nullptr
94 /* Enabling verbose error messages. */
95 #ifdef YYERROR_VERBOSE
96 # undef YYERROR_VERBOSE
97 # define YYERROR_VERBOSE 1
99 # define YYERROR_VERBOSE 0
102 /* In a future release of Bison, this section will be replaced
103 by #include "dtc-parser.tab.h". */
104 #ifndef YY_YY_DTC_PARSER_TAB_H_INCLUDED
105 # define YY_YY_DTC_PARSER_TAB_H_INCLUDED
133 DT_PROPNODENAME = 272,
135 DT_CHAR_LITERAL = 274,
145 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
146 typedef union YYSTYPE YYSTYPE;
149 #line 39 "dtc-parser.y" /* yacc.c:355 */
161 struct property *prop;
162 struct property *proplist;
164 struct node *nodelist;
165 struct reserve_info *re;
169 #line 170 "dtc-parser.tab.c" /* yacc.c:355 */
171 # define YYSTYPE_IS_TRIVIAL 1
172 # define YYSTYPE_IS_DECLARED 1
176 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
177 typedef struct YYLTYPE YYLTYPE;
185 # define YYLTYPE_IS_DECLARED 1
186 # define YYLTYPE_IS_TRIVIAL 1
190 extern YYSTYPE yylval;
191 extern YYLTYPE yylloc;
194 #endif /* !YY_YY_DTC_PARSER_TAB_H_INCLUDED */
196 /* Copy the second part of user declarations. */
198 #line 199 "dtc-parser.tab.c" /* yacc.c:358 */
205 typedef YYTYPE_UINT8 yytype_uint8;
207 typedef unsigned char yytype_uint8;
211 typedef YYTYPE_INT8 yytype_int8;
213 typedef signed char yytype_int8;
217 typedef YYTYPE_UINT16 yytype_uint16;
219 typedef unsigned short int yytype_uint16;
223 typedef YYTYPE_INT16 yytype_int16;
225 typedef short int yytype_int16;
229 # ifdef __SIZE_TYPE__
230 # define YYSIZE_T __SIZE_TYPE__
231 # elif defined size_t
232 # define YYSIZE_T size_t
233 # elif ! defined YYSIZE_T
234 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
235 # define YYSIZE_T size_t
237 # define YYSIZE_T unsigned int
241 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
244 # if defined YYENABLE_NLS && YYENABLE_NLS
246 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
247 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
251 # define YY_(Msgid) Msgid
256 # if (defined __GNUC__ \
257 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
258 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
259 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
261 # define YY_ATTRIBUTE(Spec) /* empty */
265 #ifndef YY_ATTRIBUTE_PURE
266 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
269 #ifndef YY_ATTRIBUTE_UNUSED
270 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
273 #if !defined _Noreturn \
274 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
275 # if defined _MSC_VER && 1200 <= _MSC_VER
276 # define _Noreturn __declspec (noreturn)
278 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
282 /* Suppress unused-variable warnings by "using" E. */
283 #if ! defined lint || defined __GNUC__
284 # define YYUSE(E) ((void) (E))
286 # define YYUSE(E) /* empty */
289 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
290 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
291 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
292 _Pragma ("GCC diagnostic push") \
293 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
294 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
295 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
296 _Pragma ("GCC diagnostic pop")
298 # define YY_INITIAL_VALUE(Value) Value
300 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
301 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
302 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
304 #ifndef YY_INITIAL_VALUE
305 # define YY_INITIAL_VALUE(Value) /* Nothing. */
309 #if ! defined yyoverflow || YYERROR_VERBOSE
311 /* The parser invokes alloca or malloc; define the necessary symbols. */
313 # ifdef YYSTACK_USE_ALLOCA
314 # if YYSTACK_USE_ALLOCA
316 # define YYSTACK_ALLOC __builtin_alloca
317 # elif defined __BUILTIN_VA_ARG_INCR
318 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
320 # define YYSTACK_ALLOC __alloca
321 # elif defined _MSC_VER
322 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
323 # define alloca _alloca
325 # define YYSTACK_ALLOC alloca
326 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
327 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
328 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
329 # ifndef EXIT_SUCCESS
330 # define EXIT_SUCCESS 0
337 # ifdef YYSTACK_ALLOC
338 /* Pacify GCC's 'empty if-body' warning. */
339 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
340 # ifndef YYSTACK_ALLOC_MAXIMUM
341 /* The OS might guarantee only one guard page at the bottom of the stack,
342 and a page size can be as small as 4096 bytes. So we cannot safely
343 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
344 to allow for a few compiler-allocated temporary stack slots. */
345 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
348 # define YYSTACK_ALLOC YYMALLOC
349 # define YYSTACK_FREE YYFREE
350 # ifndef YYSTACK_ALLOC_MAXIMUM
351 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
353 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
354 && ! ((defined YYMALLOC || defined malloc) \
355 && (defined YYFREE || defined free)))
356 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
357 # ifndef EXIT_SUCCESS
358 # define EXIT_SUCCESS 0
362 # define YYMALLOC malloc
363 # if ! defined malloc && ! defined EXIT_SUCCESS
364 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
369 # if ! defined free && ! defined EXIT_SUCCESS
370 void free (void *); /* INFRINGES ON USER NAME SPACE */
374 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
377 #if (! defined yyoverflow \
378 && (! defined __cplusplus \
379 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
380 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
382 /* A type that is properly aligned for any stack member. */
385 yytype_int16 yyss_alloc;
390 /* The size of the maximum gap between one aligned stack and the next. */
391 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
393 /* The size of an array large to enough to hold all stacks, each with
395 # define YYSTACK_BYTES(N) \
396 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
397 + 2 * YYSTACK_GAP_MAXIMUM)
399 # define YYCOPY_NEEDED 1
401 /* Relocate STACK from its old location to the new one. The
402 local variables YYSIZE and YYSTACKSIZE give the old and new number of
403 elements in the stack, and YYPTR gives the new location of the
404 stack. Advance YYPTR to a properly aligned location for the next
406 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
409 YYSIZE_T yynewbytes; \
410 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
411 Stack = &yyptr->Stack_alloc; \
412 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
413 yyptr += yynewbytes / sizeof (*yyptr); \
419 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
420 /* Copy COUNT objects from SRC to DST. The source and destination do
423 # if defined __GNUC__ && 1 < __GNUC__
424 # define YYCOPY(Dst, Src, Count) \
425 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
427 # define YYCOPY(Dst, Src, Count) \
431 for (yyi = 0; yyi < (Count); yyi++) \
432 (Dst)[yyi] = (Src)[yyi]; \
437 #endif /* !YYCOPY_NEEDED */
439 /* YYFINAL -- State number of the termination state. */
441 /* YYLAST -- Last index in YYTABLE. */
444 /* YYNTOKENS -- Number of terminals. */
446 /* YYNNTS -- Number of nonterminals. */
448 /* YYNRULES -- Number of rules. */
450 /* YYNSTATES -- Number of states. */
451 #define YYNSTATES 147
453 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
454 by yylex, with out-of-bounds checking. */
456 #define YYMAXUTOK 279
458 #define YYTRANSLATE(YYX) \
459 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
461 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
462 as returned by yylex, without out-of-bounds checking. */
463 static const yytype_uint8 yytranslate[] =
465 0, 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, 47, 2, 2, 2, 45, 41, 2,
469 33, 35, 44, 42, 34, 43, 2, 26, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 38, 25,
471 36, 29, 30, 37, 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, 31, 2, 32, 40, 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, 27, 39, 28, 46, 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, 2, 2, 2, 2,
488 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
489 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
490 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
491 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
492 15, 16, 17, 18, 19, 20, 21, 22, 23, 24
496 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
497 static const yytype_uint16 yyrline[] =
499 0, 108, 108, 118, 121, 129, 132, 139, 143, 151,
500 155, 160, 171, 181, 196, 204, 207, 214, 218, 222,
501 226, 234, 238, 242, 246, 250, 266, 276, 284, 287,
502 291, 298, 314, 319, 338, 352, 359, 360, 361, 368,
503 372, 373, 377, 378, 382, 383, 387, 388, 392, 393,
504 397, 398, 402, 403, 404, 408, 409, 410, 411, 412,
505 416, 417, 418, 422, 423, 424, 428, 429, 430, 431,
506 435, 436, 437, 438, 443, 446, 450, 458, 461, 465,
511 #if YYDEBUG || YYERROR_VERBOSE || 0
512 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
513 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
514 static const char *const yytname[] =
516 "$end", "error", "$undefined", "DT_V1", "DT_PLUGIN", "DT_MEMRESERVE",
517 "DT_LSHIFT", "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ", "DT_NE", "DT_AND",
518 "DT_OR", "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE", "DT_PROPNODENAME",
519 "DT_LITERAL", "DT_CHAR_LITERAL", "DT_BYTE", "DT_STRING", "DT_LABEL",
520 "DT_REF", "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['",
521 "']'", "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'",
522 "'+'", "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile",
523 "plugindecl", "memreserves", "memreserve", "devicetree", "nodedef",
524 "proplist", "propdef", "propdata", "propdataprefix", "arrayprefix",
525 "integer_prim", "integer_expr", "integer_trinary", "integer_or",
526 "integer_and", "integer_bitor", "integer_bitxor", "integer_bitand",
527 "integer_eq", "integer_rela", "integer_shift", "integer_add",
528 "integer_mul", "integer_unary", "bytestring", "subnodes", "subnode", YY_NULLPTR
533 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
534 (internal) symbol number NUM (which must be that of a token). */
535 static const yytype_uint16 yytoknum[] =
537 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
538 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
539 275, 276, 277, 278, 279, 59, 47, 123, 125, 61,
540 62, 91, 93, 40, 44, 41, 60, 63, 58, 124,
541 94, 38, 43, 45, 42, 37, 126, 33
545 #define YYPACT_NINF -84
547 #define yypact_value_is_default(Yystate) \
548 (!!((Yystate) == (-84)))
550 #define YYTABLE_NINF -1
552 #define yytable_value_is_error(Yytable_value) \
555 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
557 static const yytype_int8 yypact[] =
559 15, -12, 35, 42, -84, 27, 9, -84, 24, 9,
560 43, 9, -84, -84, -10, 24, -84, 60, 44, -84,
561 -10, -10, -10, -84, 55, -84, -7, 52, 53, 51,
562 54, 10, 2, 38, 37, -4, -84, 68, -84, -84,
563 71, 73, 60, 60, -84, -84, -84, -84, -10, -10,
564 -10, -10, -10, -10, -10, -10, -10, -10, -10, -10,
565 -10, -10, -10, -10, -10, -10, -10, -84, 56, 72,
566 60, -84, -84, 52, 61, 53, 51, 54, 10, 2,
567 2, 38, 38, 38, 38, 37, 37, -4, -4, -84,
568 -84, -84, 81, 83, 34, 56, -84, 74, 56, -84,
569 -84, -10, 76, 78, -84, -84, -84, -84, -84, 79,
570 -84, -84, -84, -84, -84, -6, 3, -84, -84, -84,
571 -84, 87, -84, -84, -84, 75, -84, -84, 32, 70,
572 86, 36, -84, -84, -84, -84, -84, 47, -84, -84,
573 -84, 24, -84, 77, 24, 80, -84
576 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
577 Performed when YYTABLE does not specify something else to do. Zero
578 means the default is an error. */
579 static const yytype_uint8 yydefact[] =
581 0, 0, 0, 3, 1, 0, 5, 4, 0, 0,
582 0, 5, 36, 37, 0, 0, 8, 0, 2, 6,
583 0, 0, 0, 70, 0, 39, 40, 42, 44, 46,
584 48, 50, 52, 55, 62, 65, 69, 0, 15, 9,
585 0, 0, 0, 0, 71, 72, 73, 38, 0, 0,
586 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
587 0, 0, 0, 0, 0, 0, 0, 7, 77, 0,
588 0, 12, 10, 43, 0, 45, 47, 49, 51, 53,
589 54, 58, 59, 57, 56, 60, 61, 63, 64, 67,
590 66, 68, 0, 0, 0, 0, 16, 0, 77, 13,
591 11, 0, 0, 0, 18, 28, 80, 20, 82, 0,
592 79, 78, 41, 19, 81, 0, 0, 14, 27, 17,
593 29, 0, 21, 30, 24, 0, 74, 32, 0, 0,
594 0, 0, 35, 34, 22, 33, 31, 0, 75, 76,
595 23, 0, 26, 0, 0, 0, 25
598 /* YYPGOTO[NTERM-NUM]. */
599 static const yytype_int8 yypgoto[] =
601 -84, -84, -84, 98, 101, -84, -41, -84, -83, -84,
602 -84, -84, -8, 63, 12, -84, 66, 67, 65, 69,
603 82, 29, 18, 25, 26, -17, -84, 20, 28
606 /* YYDEFGOTO[NTERM-NUM]. */
607 static const yytype_int16 yydefgoto[] =
609 -1, 2, 6, 10, 11, 18, 39, 68, 96, 115,
610 116, 128, 23, 24, 25, 26, 27, 28, 29, 30,
611 31, 32, 33, 34, 35, 36, 131, 97, 98
614 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
615 positive, shift that token. If negative, reduce the rule whose
616 number is the opposite. If YYTABLE_NINF, syntax error. */
617 static const yytype_uint8 yytable[] =
619 15, 71, 72, 44, 45, 46, 48, 37, 12, 13,
620 56, 57, 107, 3, 8, 110, 118, 121, 1, 119,
621 54, 55, 64, 14, 122, 123, 124, 125, 120, 100,
622 49, 9, 58, 20, 126, 4, 21, 22, 59, 127,
623 65, 66, 12, 13, 60, 61, 5, 89, 90, 91,
624 12, 13, 7, 106, 132, 133, 138, 14, 139, 104,
625 40, 38, 134, 105, 50, 14, 41, 42, 140, 17,
626 43, 92, 93, 94, 81, 82, 83, 84, 95, 62,
627 63, 141, 142, 79, 80, 85, 86, 38, 87, 88,
628 47, 52, 51, 67, 69, 53, 70, 99, 102, 101,
629 103, 113, 109, 114, 117, 129, 136, 137, 130, 19,
630 16, 144, 74, 112, 73, 146, 76, 75, 111, 0,
631 135, 77, 0, 108, 0, 0, 0, 0, 0, 0,
632 0, 0, 0, 143, 0, 78, 145
635 static const yytype_int16 yycheck[] =
637 8, 42, 43, 20, 21, 22, 13, 15, 18, 19,
638 8, 9, 95, 25, 5, 98, 22, 14, 3, 25,
639 10, 11, 26, 33, 21, 22, 23, 24, 34, 70,
640 37, 22, 30, 43, 31, 0, 46, 47, 36, 36,
641 44, 45, 18, 19, 6, 7, 4, 64, 65, 66,
642 18, 19, 25, 94, 22, 23, 20, 33, 22, 25,
643 16, 27, 30, 29, 12, 33, 22, 23, 32, 26,
644 26, 15, 16, 17, 56, 57, 58, 59, 22, 42,
645 43, 34, 35, 54, 55, 60, 61, 27, 62, 63,
646 35, 40, 39, 25, 23, 41, 23, 25, 17, 38,
647 17, 25, 28, 25, 25, 18, 36, 21, 33, 11,
648 9, 34, 49, 101, 48, 35, 51, 50, 98, -1,
649 128, 52, -1, 95, -1, -1, -1, -1, -1, -1,
650 -1, -1, -1, 141, -1, 53, 144
653 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
654 symbol of state STATE-NUM. */
655 static const yytype_uint8 yystos[] =
657 0, 3, 49, 25, 0, 4, 50, 25, 5, 22,
658 51, 52, 18, 19, 33, 60, 52, 26, 53, 51,
659 43, 46, 47, 60, 61, 62, 63, 64, 65, 66,
660 67, 68, 69, 70, 71, 72, 73, 60, 27, 54,
661 16, 22, 23, 26, 73, 73, 73, 35, 13, 37,
662 12, 39, 40, 41, 10, 11, 8, 9, 30, 36,
663 6, 7, 42, 43, 26, 44, 45, 25, 55, 23,
664 23, 54, 54, 64, 61, 65, 66, 67, 68, 69,
665 69, 70, 70, 70, 70, 71, 71, 72, 72, 73,
666 73, 73, 15, 16, 17, 22, 56, 75, 76, 25,
667 54, 38, 17, 17, 25, 29, 54, 56, 76, 28,
668 56, 75, 62, 25, 25, 57, 58, 25, 22, 25,
669 34, 14, 21, 22, 23, 24, 31, 36, 59, 18,
670 33, 74, 22, 23, 30, 60, 36, 21, 20, 22,
671 32, 34, 35, 60, 34, 60, 35
674 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
675 static const yytype_uint8 yyr1[] =
677 0, 48, 49, 50, 50, 51, 51, 52, 52, 53,
678 53, 53, 53, 53, 54, 55, 55, 56, 56, 56,
679 56, 57, 57, 57, 57, 57, 57, 57, 58, 58,
680 58, 59, 59, 59, 59, 59, 60, 60, 60, 61,
681 62, 62, 63, 63, 64, 64, 65, 65, 66, 66,
682 67, 67, 68, 68, 68, 69, 69, 69, 69, 69,
683 70, 70, 70, 71, 71, 71, 72, 72, 72, 72,
684 73, 73, 73, 73, 74, 74, 74, 75, 75, 75,
688 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
689 static const yytype_uint8 yyr2[] =
691 0, 2, 5, 0, 2, 0, 2, 4, 2, 2,
692 3, 4, 3, 4, 5, 0, 2, 4, 2, 3,
693 2, 2, 3, 4, 2, 9, 5, 2, 0, 2,
694 2, 3, 1, 2, 2, 2, 1, 1, 3, 1,
695 1, 5, 1, 3, 1, 3, 1, 3, 1, 3,
696 1, 3, 1, 3, 3, 1, 3, 3, 3, 3,
697 3, 3, 1, 3, 3, 1, 3, 3, 3, 1,
698 1, 2, 2, 2, 0, 2, 2, 0, 2, 2,
703 #define yyerrok (yyerrstatus = 0)
704 #define yyclearin (yychar = YYEMPTY)
708 #define YYACCEPT goto yyacceptlab
709 #define YYABORT goto yyabortlab
710 #define YYERROR goto yyerrorlab
713 #define YYRECOVERING() (!!yyerrstatus)
715 #define YYBACKUP(Token, Value) \
717 if (yychar == YYEMPTY) \
721 YYPOPSTACK (yylen); \
727 yyerror (YY_("syntax error: cannot back up")); \
732 /* Error token number */
734 #define YYERRCODE 256
737 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
738 If N is 0, then set CURRENT to the empty location which ends
739 the previous symbol: RHS[0] (always defined). */
741 #ifndef YYLLOC_DEFAULT
742 # define YYLLOC_DEFAULT(Current, Rhs, N) \
746 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
747 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
748 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
749 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
753 (Current).first_line = (Current).last_line = \
754 YYRHSLOC (Rhs, 0).last_line; \
755 (Current).first_column = (Current).last_column = \
756 YYRHSLOC (Rhs, 0).last_column; \
761 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
764 /* Enable debugging if requested. */
768 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
769 # define YYFPRINTF fprintf
772 # define YYDPRINTF(Args) \
779 /* YY_LOCATION_PRINT -- Print the location on the stream.
780 This macro was not mandated originally: define only if we know
781 we won't break user code: when these are the locations we know. */
783 #ifndef YY_LOCATION_PRINT
784 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
786 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
790 yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
793 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
794 if (0 <= yylocp->first_line)
796 res += YYFPRINTF (yyo, "%d", yylocp->first_line);
797 if (0 <= yylocp->first_column)
798 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
800 if (0 <= yylocp->last_line)
802 if (yylocp->first_line < yylocp->last_line)
804 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
806 res += YYFPRINTF (yyo, ".%d", end_col);
808 else if (0 <= end_col && yylocp->first_column < end_col)
809 res += YYFPRINTF (yyo, "-%d", end_col);
814 # define YY_LOCATION_PRINT(File, Loc) \
815 yy_location_print_ (File, &(Loc))
818 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
823 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
827 YYFPRINTF (stderr, "%s ", Title); \
828 yy_symbol_print (stderr, \
829 Type, Value, Location); \
830 YYFPRINTF (stderr, "\n"); \
835 /*----------------------------------------.
836 | Print this symbol's value on YYOUTPUT. |
837 `----------------------------------------*/
840 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
842 FILE *yyo = yyoutput;
848 if (yytype < YYNTOKENS)
849 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
855 /*--------------------------------.
856 | Print this symbol on YYOUTPUT. |
857 `--------------------------------*/
860 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
862 YYFPRINTF (yyoutput, "%s %s (",
863 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
865 YY_LOCATION_PRINT (yyoutput, *yylocationp);
866 YYFPRINTF (yyoutput, ": ");
867 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
868 YYFPRINTF (yyoutput, ")");
871 /*------------------------------------------------------------------.
872 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
874 `------------------------------------------------------------------*/
877 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
879 YYFPRINTF (stderr, "Stack now");
880 for (; yybottom <= yytop; yybottom++)
882 int yybot = *yybottom;
883 YYFPRINTF (stderr, " %d", yybot);
885 YYFPRINTF (stderr, "\n");
888 # define YY_STACK_PRINT(Bottom, Top) \
891 yy_stack_print ((Bottom), (Top)); \
895 /*------------------------------------------------.
896 | Report that the YYRULE is going to be reduced. |
897 `------------------------------------------------*/
900 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
902 unsigned long int yylno = yyrline[yyrule];
903 int yynrhs = yyr2[yyrule];
905 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
907 /* The symbols being reduced. */
908 for (yyi = 0; yyi < yynrhs; yyi++)
910 YYFPRINTF (stderr, " $%d = ", yyi + 1);
911 yy_symbol_print (stderr,
912 yystos[yyssp[yyi + 1 - yynrhs]],
913 &(yyvsp[(yyi + 1) - (yynrhs)])
914 , &(yylsp[(yyi + 1) - (yynrhs)]) );
915 YYFPRINTF (stderr, "\n");
919 # define YY_REDUCE_PRINT(Rule) \
922 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
925 /* Nonzero means print parse trace. It is left uninitialized so that
926 multiple parsers can coexist. */
929 # define YYDPRINTF(Args)
930 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
931 # define YY_STACK_PRINT(Bottom, Top)
932 # define YY_REDUCE_PRINT(Rule)
933 #endif /* !YYDEBUG */
936 /* YYINITDEPTH -- initial size of the parser's stacks. */
938 # define YYINITDEPTH 200
941 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
942 if the built-in stack extension method is used).
944 Do not make this value too large; the results are undefined if
945 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
946 evaluated with infinite-precision integer arithmetic. */
949 # define YYMAXDEPTH 10000
956 # if defined __GLIBC__ && defined _STRING_H
957 # define yystrlen strlen
959 /* Return the length of YYSTR. */
961 yystrlen (const char *yystr)
964 for (yylen = 0; yystr[yylen]; yylen++)
972 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
973 # define yystpcpy stpcpy
975 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
978 yystpcpy (char *yydest, const char *yysrc)
981 const char *yys = yysrc;
983 while ((*yyd++ = *yys++) != '\0')
992 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
993 quotes and backslashes, so that it's suitable for yyerror. The
994 heuristic is that double-quoting is unnecessary unless the string
995 contains an apostrophe, a comma, or backslash (other than
996 backslash-backslash). YYSTR is taken from yytname. If YYRES is
997 null, do not copy; instead, return the length of what the result
1000 yytnamerr (char *yyres, const char *yystr)
1005 char const *yyp = yystr;
1012 goto do_not_strip_quotes;
1016 goto do_not_strip_quotes;
1029 do_not_strip_quotes: ;
1033 return yystrlen (yystr);
1035 return yystpcpy (yyres, yystr) - yyres;
1039 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1040 about the unexpected token YYTOKEN for the state stack whose top is
1043 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1044 not large enough to hold the message. In that case, also set
1045 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1046 required number of bytes is too large to store. */
1048 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1049 yytype_int16 *yyssp, int yytoken)
1051 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1052 YYSIZE_T yysize = yysize0;
1053 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1054 /* Internationalized format string. */
1055 const char *yyformat = YY_NULLPTR;
1056 /* Arguments of yyformat. */
1057 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1058 /* Number of reported tokens (one for the "unexpected", one per
1062 /* There are many possibilities here to consider:
1063 - If this state is a consistent state with a default action, then
1064 the only way this function was invoked is if the default action
1065 is an error action. In that case, don't check for expected
1066 tokens because there are none.
1067 - The only way there can be no lookahead present (in yychar) is if
1068 this state is a consistent state with a default action. Thus,
1069 detecting the absence of a lookahead is sufficient to determine
1070 that there is no unexpected or expected token to report. In that
1071 case, just report a simple "syntax error".
1072 - Don't assume there isn't a lookahead just because this state is a
1073 consistent state with a default action. There might have been a
1074 previous inconsistent state, consistent state with a non-default
1075 action, or user semantic action that manipulated yychar.
1076 - Of course, the expected token list depends on states to have
1077 correct lookahead information, and it depends on the parser not
1078 to perform extra reductions after fetching a lookahead from the
1079 scanner and before detecting a syntax error. Thus, state merging
1080 (from LALR or IELR) and default reductions corrupt the expected
1081 token list. However, the list is correct for canonical LR with
1082 one exception: it will still contain any token that will not be
1083 accepted due to an error action in a later state.
1085 if (yytoken != YYEMPTY)
1087 int yyn = yypact[*yyssp];
1088 yyarg[yycount++] = yytname[yytoken];
1089 if (!yypact_value_is_default (yyn))
1091 /* Start YYX at -YYN if negative to avoid negative indexes in
1092 YYCHECK. In other words, skip the first -YYN actions for
1093 this state because they are default actions. */
1094 int yyxbegin = yyn < 0 ? -yyn : 0;
1095 /* Stay within bounds of both yycheck and yytname. */
1096 int yychecklim = YYLAST - yyn + 1;
1097 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1100 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1101 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1102 && !yytable_value_is_error (yytable[yyx + yyn]))
1104 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1110 yyarg[yycount++] = yytname[yyx];
1112 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1113 if (! (yysize <= yysize1
1114 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1124 # define YYCASE_(N, S) \
1128 YYCASE_(0, YY_("syntax error"));
1129 YYCASE_(1, YY_("syntax error, unexpected %s"));
1130 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1131 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1132 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1133 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1138 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1139 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1144 if (*yymsg_alloc < yysize)
1146 *yymsg_alloc = 2 * yysize;
1147 if (! (yysize <= *yymsg_alloc
1148 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1149 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1153 /* Avoid sprintf, as that infringes on the user's name space.
1154 Don't have undefined behavior even if the translation
1155 produced a string with the wrong number of "%s"s. */
1159 while ((*yyp = *yyformat) != '\0')
1160 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1162 yyp += yytnamerr (yyp, yyarg[yyi++]);
1173 #endif /* YYERROR_VERBOSE */
1175 /*-----------------------------------------------.
1176 | Release the memory associated to this symbol. |
1177 `-----------------------------------------------*/
1180 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
1183 YYUSE (yylocationp);
1186 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1188 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1190 YY_IGNORE_MAYBE_UNINITIALIZED_END
1196 /* The lookahead symbol. */
1199 /* The semantic value of the lookahead symbol. */
1201 /* Location data for the lookahead symbol. */
1203 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1207 /* Number of syntax errors so far. */
1219 /* Number of tokens to shift before error messages enabled. */
1222 /* The stacks and their tools:
1223 'yyss': related to states.
1224 'yyvs': related to semantic values.
1225 'yyls': related to locations.
1227 Refer to the stacks through separate pointers, to allow yyoverflow
1228 to reallocate them elsewhere. */
1230 /* The state stack. */
1231 yytype_int16 yyssa[YYINITDEPTH];
1233 yytype_int16 *yyssp;
1235 /* The semantic value stack. */
1236 YYSTYPE yyvsa[YYINITDEPTH];
1240 /* The location stack. */
1241 YYLTYPE yylsa[YYINITDEPTH];
1245 /* The locations where the error started and ended. */
1246 YYLTYPE yyerror_range[3];
1248 YYSIZE_T yystacksize;
1252 /* Lookahead token as an internal (translated) token number. */
1254 /* The variables used to return semantic value and location from the
1260 /* Buffer for error messages, and its allocated size. */
1262 char *yymsg = yymsgbuf;
1263 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1266 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1268 /* The number of symbols on the RHS of the reduced rule.
1269 Keep to zero when no symbol should be popped. */
1272 yyssp = yyss = yyssa;
1273 yyvsp = yyvs = yyvsa;
1274 yylsp = yyls = yylsa;
1275 yystacksize = YYINITDEPTH;
1277 YYDPRINTF ((stderr, "Starting parse\n"));
1282 yychar = YYEMPTY; /* Cause a token to be read. */
1286 /*------------------------------------------------------------.
1287 | yynewstate -- Push a new state, which is found in yystate. |
1288 `------------------------------------------------------------*/
1290 /* In all cases, when you get here, the value and location stacks
1291 have just been pushed. So pushing a state here evens the stacks. */
1297 if (yyss + yystacksize - 1 <= yyssp)
1299 /* Get the current used size of the three stacks, in elements. */
1300 YYSIZE_T yysize = yyssp - yyss + 1;
1304 /* Give user a chance to reallocate the stack. Use copies of
1305 these so that the &'s don't force the real ones into
1307 YYSTYPE *yyvs1 = yyvs;
1308 yytype_int16 *yyss1 = yyss;
1309 YYLTYPE *yyls1 = yyls;
1311 /* Each stack pointer address is followed by the size of the
1312 data in use in that stack, in bytes. This used to be a
1313 conditional around just the two extra args, but that might
1314 be undefined if yyoverflow is a macro. */
1315 yyoverflow (YY_("memory exhausted"),
1316 &yyss1, yysize * sizeof (*yyssp),
1317 &yyvs1, yysize * sizeof (*yyvsp),
1318 &yyls1, yysize * sizeof (*yylsp),
1325 #else /* no yyoverflow */
1326 # ifndef YYSTACK_RELOCATE
1327 goto yyexhaustedlab;
1329 /* Extend the stack our own way. */
1330 if (YYMAXDEPTH <= yystacksize)
1331 goto yyexhaustedlab;
1333 if (YYMAXDEPTH < yystacksize)
1334 yystacksize = YYMAXDEPTH;
1337 yytype_int16 *yyss1 = yyss;
1338 union yyalloc *yyptr =
1339 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1341 goto yyexhaustedlab;
1342 YYSTACK_RELOCATE (yyss_alloc, yyss);
1343 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1344 YYSTACK_RELOCATE (yyls_alloc, yyls);
1345 # undef YYSTACK_RELOCATE
1347 YYSTACK_FREE (yyss1);
1350 #endif /* no yyoverflow */
1352 yyssp = yyss + yysize - 1;
1353 yyvsp = yyvs + yysize - 1;
1354 yylsp = yyls + yysize - 1;
1356 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1357 (unsigned long int) yystacksize));
1359 if (yyss + yystacksize - 1 <= yyssp)
1363 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1365 if (yystate == YYFINAL)
1375 /* Do appropriate processing given the current state. Read a
1376 lookahead token if we need one and don't already have one. */
1378 /* First try to decide what to do without reference to lookahead token. */
1379 yyn = yypact[yystate];
1380 if (yypact_value_is_default (yyn))
1383 /* Not known => get a lookahead token if don't already have one. */
1385 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1386 if (yychar == YYEMPTY)
1388 YYDPRINTF ((stderr, "Reading a token: "));
1392 if (yychar <= YYEOF)
1394 yychar = yytoken = YYEOF;
1395 YYDPRINTF ((stderr, "Now at end of input.\n"));
1399 yytoken = YYTRANSLATE (yychar);
1400 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1403 /* If the proper action on seeing token YYTOKEN is to reduce or to
1404 detect an error, take that action. */
1406 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1411 if (yytable_value_is_error (yyn))
1417 /* Count tokens shifted since error; after three, turn off error
1422 /* Shift the lookahead token. */
1423 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1425 /* Discard the shifted token. */
1429 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1431 YY_IGNORE_MAYBE_UNINITIALIZED_END
1436 /*-----------------------------------------------------------.
1437 | yydefault -- do the default action for the current state. |
1438 `-----------------------------------------------------------*/
1440 yyn = yydefact[yystate];
1446 /*-----------------------------.
1447 | yyreduce -- Do a reduction. |
1448 `-----------------------------*/
1450 /* yyn is the number of a rule to reduce with. */
1453 /* If YYLEN is nonzero, implement the default value of the action:
1456 Otherwise, the following line sets YYVAL to garbage.
1457 This behavior is undocumented and Bison
1458 users should not rely upon it. Assigning to YYVAL
1459 unconditionally makes the parser a bit smaller, and it avoids a
1460 GCC warning that YYVAL may be used uninitialized. */
1461 yyval = yyvsp[1-yylen];
1463 /* Default location. */
1464 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1465 YY_REDUCE_PRINT (yyn);
1469 #line 109 "dtc-parser.y" /* yacc.c:1646 */
1471 (yyvsp[0].node)->is_plugin = (yyvsp[-2].is_plugin);
1472 the_boot_info = build_boot_info((yyvsp[-1].re), (yyvsp[0].node),
1473 guess_boot_cpuid((yyvsp[0].node)));
1475 #line 1476 "dtc-parser.tab.c" /* yacc.c:1646 */
1479 #line 118 "dtc-parser.y" /* yacc.c:1646 */
1481 (yyval.is_plugin) = false;
1483 #line 1484 "dtc-parser.tab.c" /* yacc.c:1646 */
1487 #line 122 "dtc-parser.y" /* yacc.c:1646 */
1489 (yyval.is_plugin) = true;
1491 #line 1492 "dtc-parser.tab.c" /* yacc.c:1646 */
1495 #line 129 "dtc-parser.y" /* yacc.c:1646 */
1499 #line 1500 "dtc-parser.tab.c" /* yacc.c:1646 */
1503 #line 133 "dtc-parser.y" /* yacc.c:1646 */
1505 (yyval.re) = chain_reserve_entry((yyvsp[-1].re), (yyvsp[0].re));
1507 #line 1508 "dtc-parser.tab.c" /* yacc.c:1646 */
1511 #line 140 "dtc-parser.y" /* yacc.c:1646 */
1513 (yyval.re) = build_reserve_entry((yyvsp[-2].integer), (yyvsp[-1].integer));
1515 #line 1516 "dtc-parser.tab.c" /* yacc.c:1646 */
1519 #line 144 "dtc-parser.y" /* yacc.c:1646 */
1521 add_label(&(yyvsp[0].re)->labels, (yyvsp[-1].labelref));
1522 (yyval.re) = (yyvsp[0].re);
1524 #line 1525 "dtc-parser.tab.c" /* yacc.c:1646 */
1528 #line 152 "dtc-parser.y" /* yacc.c:1646 */
1530 (yyval.node) = name_node((yyvsp[0].node), "");
1532 #line 1533 "dtc-parser.tab.c" /* yacc.c:1646 */
1536 #line 156 "dtc-parser.y" /* yacc.c:1646 */
1538 (yyval.node) = merge_nodes((yyvsp[-2].node), (yyvsp[0].node));
1540 #line 1541 "dtc-parser.tab.c" /* yacc.c:1646 */
1544 #line 161 "dtc-parser.y" /* yacc.c:1646 */
1546 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1548 add_label(&target->labels, (yyvsp[-2].labelref));
1550 merge_nodes(target, (yyvsp[0].node));
1552 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1553 (yyval.node) = (yyvsp[-3].node);
1555 #line 1556 "dtc-parser.tab.c" /* yacc.c:1646 */
1559 #line 172 "dtc-parser.y" /* yacc.c:1646 */
1561 struct node *target = get_node_by_ref((yyvsp[-2].node), (yyvsp[-1].labelref));
1564 merge_nodes(target, (yyvsp[0].node));
1566 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1567 (yyval.node) = (yyvsp[-2].node);
1569 #line 1570 "dtc-parser.tab.c" /* yacc.c:1646 */
1573 #line 182 "dtc-parser.y" /* yacc.c:1646 */
1575 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1578 delete_node(target);
1580 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1583 (yyval.node) = (yyvsp[-3].node);
1585 #line 1586 "dtc-parser.tab.c" /* yacc.c:1646 */
1589 #line 197 "dtc-parser.y" /* yacc.c:1646 */
1591 (yyval.node) = build_node((yyvsp[-3].proplist), (yyvsp[-2].nodelist));
1593 #line 1594 "dtc-parser.tab.c" /* yacc.c:1646 */
1597 #line 204 "dtc-parser.y" /* yacc.c:1646 */
1599 (yyval.proplist) = NULL;
1601 #line 1602 "dtc-parser.tab.c" /* yacc.c:1646 */
1605 #line 208 "dtc-parser.y" /* yacc.c:1646 */
1607 (yyval.proplist) = chain_property((yyvsp[0].prop), (yyvsp[-1].proplist));
1609 #line 1610 "dtc-parser.tab.c" /* yacc.c:1646 */
1613 #line 215 "dtc-parser.y" /* yacc.c:1646 */
1615 (yyval.prop) = build_property((yyvsp[-3].propnodename), (yyvsp[-1].data));
1617 #line 1618 "dtc-parser.tab.c" /* yacc.c:1646 */
1621 #line 219 "dtc-parser.y" /* yacc.c:1646 */
1623 (yyval.prop) = build_property((yyvsp[-1].propnodename), empty_data);
1625 #line 1626 "dtc-parser.tab.c" /* yacc.c:1646 */
1629 #line 223 "dtc-parser.y" /* yacc.c:1646 */
1631 (yyval.prop) = build_property_delete((yyvsp[-1].propnodename));
1633 #line 1634 "dtc-parser.tab.c" /* yacc.c:1646 */
1637 #line 227 "dtc-parser.y" /* yacc.c:1646 */
1639 add_label(&(yyvsp[0].prop)->labels, (yyvsp[-1].labelref));
1640 (yyval.prop) = (yyvsp[0].prop);
1642 #line 1643 "dtc-parser.tab.c" /* yacc.c:1646 */
1646 #line 235 "dtc-parser.y" /* yacc.c:1646 */
1648 (yyval.data) = data_merge((yyvsp[-1].data), (yyvsp[0].data));
1650 #line 1651 "dtc-parser.tab.c" /* yacc.c:1646 */
1654 #line 239 "dtc-parser.y" /* yacc.c:1646 */
1656 (yyval.data) = data_merge((yyvsp[-2].data), (yyvsp[-1].array).data);
1658 #line 1659 "dtc-parser.tab.c" /* yacc.c:1646 */
1662 #line 243 "dtc-parser.y" /* yacc.c:1646 */
1664 (yyval.data) = data_merge((yyvsp[-3].data), (yyvsp[-1].data));
1666 #line 1667 "dtc-parser.tab.c" /* yacc.c:1646 */
1670 #line 247 "dtc-parser.y" /* yacc.c:1646 */
1672 (yyval.data) = data_add_marker((yyvsp[-1].data), REF_PATH, (yyvsp[0].labelref));
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[-5].data).val, NULL);
1683 if ((yyvsp[-3].integer) != 0)
1684 if (fseek(f, (yyvsp[-3].integer), SEEK_SET) != 0)
1685 die("Couldn't seek to offset %llu in \"%s\": %s",
1686 (unsigned long long)(yyvsp[-3].integer), (yyvsp[-5].data).val,
1689 d = data_copy_file(f, (yyvsp[-1].integer));
1691 (yyval.data) = data_merge((yyvsp[-8].data), d);
1694 #line 1695 "dtc-parser.tab.c" /* yacc.c:1646 */
1698 #line 267 "dtc-parser.y" /* yacc.c:1646 */
1700 FILE *f = srcfile_relative_open((yyvsp[-1].data).val, NULL);
1701 struct data d = empty_data;
1703 d = data_copy_file(f, -1);
1705 (yyval.data) = data_merge((yyvsp[-4].data), d);
1708 #line 1709 "dtc-parser.tab.c" /* yacc.c:1646 */
1712 #line 277 "dtc-parser.y" /* yacc.c:1646 */
1714 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1716 #line 1717 "dtc-parser.tab.c" /* yacc.c:1646 */
1720 #line 284 "dtc-parser.y" /* yacc.c:1646 */
1722 (yyval.data) = empty_data;
1724 #line 1725 "dtc-parser.tab.c" /* yacc.c:1646 */
1728 #line 288 "dtc-parser.y" /* yacc.c:1646 */
1730 (yyval.data) = (yyvsp[-1].data);
1732 #line 1733 "dtc-parser.tab.c" /* yacc.c:1646 */
1736 #line 292 "dtc-parser.y" /* yacc.c:1646 */
1738 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1740 #line 1741 "dtc-parser.tab.c" /* yacc.c:1646 */
1744 #line 299 "dtc-parser.y" /* yacc.c:1646 */
1746 unsigned long long bits;
1748 bits = (yyvsp[-1].integer);
1750 if ((bits != 8) && (bits != 16) &&
1751 (bits != 32) && (bits != 64)) {
1752 ERROR(&(yylsp[-1]), "Array elements must be"
1753 " 8, 16, 32 or 64-bits");
1757 (yyval.array).data = empty_data;
1758 (yyval.array).bits = bits;
1760 #line 1761 "dtc-parser.tab.c" /* yacc.c:1646 */
1764 #line 315 "dtc-parser.y" /* yacc.c:1646 */
1766 (yyval.array).data = empty_data;
1767 (yyval.array).bits = 32;
1769 #line 1770 "dtc-parser.tab.c" /* yacc.c:1646 */
1773 #line 320 "dtc-parser.y" /* yacc.c:1646 */
1775 if ((yyvsp[-1].array).bits < 64) {
1776 uint64_t mask = (1ULL << (yyvsp[-1].array).bits) - 1;
1778 * Bits above mask must either be all zero
1779 * (positive within range of mask) or all one
1780 * (negative and sign-extended). The second
1781 * condition is true if when we set all bits
1782 * within the mask to one (i.e. | in the
1783 * mask), all bits are one.
1785 if (((yyvsp[0].integer) > mask) && (((yyvsp[0].integer) | mask) != -1ULL))
1786 ERROR(&(yylsp[0]), "Value out of range for"
1787 " %d-bit array element", (yyvsp[-1].array).bits);
1790 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, (yyvsp[0].integer), (yyvsp[-1].array).bits);
1792 #line 1793 "dtc-parser.tab.c" /* yacc.c:1646 */
1796 #line 339 "dtc-parser.y" /* yacc.c:1646 */
1798 uint64_t val = ~0ULL >> (64 - (yyvsp[-1].array).bits);
1800 if ((yyvsp[-1].array).bits == 32)
1801 (yyvsp[-1].array).data = data_add_marker((yyvsp[-1].array).data,
1803 (yyvsp[0].labelref));
1805 ERROR(&(yylsp[0]), "References are only allowed in "
1806 "arrays with 32-bit elements.");
1808 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, val, (yyvsp[-1].array).bits);
1810 #line 1811 "dtc-parser.tab.c" /* yacc.c:1646 */
1814 #line 353 "dtc-parser.y" /* yacc.c:1646 */
1816 (yyval.array).data = data_add_marker((yyvsp[-1].array).data, LABEL, (yyvsp[0].labelref));
1818 #line 1819 "dtc-parser.tab.c" /* yacc.c:1646 */
1822 #line 362 "dtc-parser.y" /* yacc.c:1646 */
1824 (yyval.integer) = (yyvsp[-1].integer);
1826 #line 1827 "dtc-parser.tab.c" /* yacc.c:1646 */
1830 #line 373 "dtc-parser.y" /* yacc.c:1646 */
1831 { (yyval.integer) = (yyvsp[-4].integer) ? (yyvsp[-2].integer) : (yyvsp[0].integer); }
1832 #line 1833 "dtc-parser.tab.c" /* yacc.c:1646 */
1836 #line 378 "dtc-parser.y" /* yacc.c:1646 */
1837 { (yyval.integer) = (yyvsp[-2].integer) || (yyvsp[0].integer); }
1838 #line 1839 "dtc-parser.tab.c" /* yacc.c:1646 */
1842 #line 383 "dtc-parser.y" /* yacc.c:1646 */
1843 { (yyval.integer) = (yyvsp[-2].integer) && (yyvsp[0].integer); }
1844 #line 1845 "dtc-parser.tab.c" /* yacc.c:1646 */
1848 #line 388 "dtc-parser.y" /* yacc.c:1646 */
1849 { (yyval.integer) = (yyvsp[-2].integer) | (yyvsp[0].integer); }
1850 #line 1851 "dtc-parser.tab.c" /* yacc.c:1646 */
1854 #line 393 "dtc-parser.y" /* yacc.c:1646 */
1855 { (yyval.integer) = (yyvsp[-2].integer) ^ (yyvsp[0].integer); }
1856 #line 1857 "dtc-parser.tab.c" /* yacc.c:1646 */
1860 #line 398 "dtc-parser.y" /* yacc.c:1646 */
1861 { (yyval.integer) = (yyvsp[-2].integer) & (yyvsp[0].integer); }
1862 #line 1863 "dtc-parser.tab.c" /* yacc.c:1646 */
1866 #line 403 "dtc-parser.y" /* yacc.c:1646 */
1867 { (yyval.integer) = (yyvsp[-2].integer) == (yyvsp[0].integer); }
1868 #line 1869 "dtc-parser.tab.c" /* yacc.c:1646 */
1872 #line 404 "dtc-parser.y" /* yacc.c:1646 */
1873 { (yyval.integer) = (yyvsp[-2].integer) != (yyvsp[0].integer); }
1874 #line 1875 "dtc-parser.tab.c" /* yacc.c:1646 */
1878 #line 409 "dtc-parser.y" /* yacc.c:1646 */
1879 { (yyval.integer) = (yyvsp[-2].integer) < (yyvsp[0].integer); }
1880 #line 1881 "dtc-parser.tab.c" /* yacc.c:1646 */
1884 #line 410 "dtc-parser.y" /* yacc.c:1646 */
1885 { (yyval.integer) = (yyvsp[-2].integer) > (yyvsp[0].integer); }
1886 #line 1887 "dtc-parser.tab.c" /* yacc.c:1646 */
1890 #line 411 "dtc-parser.y" /* yacc.c:1646 */
1891 { (yyval.integer) = (yyvsp[-2].integer) <= (yyvsp[0].integer); }
1892 #line 1893 "dtc-parser.tab.c" /* yacc.c:1646 */
1896 #line 412 "dtc-parser.y" /* yacc.c:1646 */
1897 { (yyval.integer) = (yyvsp[-2].integer) >= (yyvsp[0].integer); }
1898 #line 1899 "dtc-parser.tab.c" /* yacc.c:1646 */
1902 #line 416 "dtc-parser.y" /* yacc.c:1646 */
1903 { (yyval.integer) = (yyvsp[-2].integer) << (yyvsp[0].integer); }
1904 #line 1905 "dtc-parser.tab.c" /* yacc.c:1646 */
1908 #line 417 "dtc-parser.y" /* yacc.c:1646 */
1909 { (yyval.integer) = (yyvsp[-2].integer) >> (yyvsp[0].integer); }
1910 #line 1911 "dtc-parser.tab.c" /* yacc.c:1646 */
1914 #line 422 "dtc-parser.y" /* yacc.c:1646 */
1915 { (yyval.integer) = (yyvsp[-2].integer) + (yyvsp[0].integer); }
1916 #line 1917 "dtc-parser.tab.c" /* yacc.c:1646 */
1920 #line 423 "dtc-parser.y" /* yacc.c:1646 */
1921 { (yyval.integer) = (yyvsp[-2].integer) - (yyvsp[0].integer); }
1922 #line 1923 "dtc-parser.tab.c" /* yacc.c:1646 */
1926 #line 428 "dtc-parser.y" /* yacc.c:1646 */
1927 { (yyval.integer) = (yyvsp[-2].integer) * (yyvsp[0].integer); }
1928 #line 1929 "dtc-parser.tab.c" /* yacc.c:1646 */
1932 #line 429 "dtc-parser.y" /* yacc.c:1646 */
1933 { (yyval.integer) = (yyvsp[-2].integer) / (yyvsp[0].integer); }
1934 #line 1935 "dtc-parser.tab.c" /* yacc.c:1646 */
1938 #line 430 "dtc-parser.y" /* yacc.c:1646 */
1939 { (yyval.integer) = (yyvsp[-2].integer) % (yyvsp[0].integer); }
1940 #line 1941 "dtc-parser.tab.c" /* yacc.c:1646 */
1944 #line 436 "dtc-parser.y" /* yacc.c:1646 */
1945 { (yyval.integer) = -(yyvsp[0].integer); }
1946 #line 1947 "dtc-parser.tab.c" /* yacc.c:1646 */
1950 #line 437 "dtc-parser.y" /* yacc.c:1646 */
1951 { (yyval.integer) = ~(yyvsp[0].integer); }
1952 #line 1953 "dtc-parser.tab.c" /* yacc.c:1646 */
1956 #line 438 "dtc-parser.y" /* yacc.c:1646 */
1957 { (yyval.integer) = !(yyvsp[0].integer); }
1958 #line 1959 "dtc-parser.tab.c" /* yacc.c:1646 */
1962 #line 443 "dtc-parser.y" /* yacc.c:1646 */
1964 (yyval.data) = empty_data;
1966 #line 1967 "dtc-parser.tab.c" /* yacc.c:1646 */
1970 #line 447 "dtc-parser.y" /* yacc.c:1646 */
1972 (yyval.data) = data_append_byte((yyvsp[-1].data), (yyvsp[0].byte));
1974 #line 1975 "dtc-parser.tab.c" /* yacc.c:1646 */
1978 #line 451 "dtc-parser.y" /* yacc.c:1646 */
1980 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1982 #line 1983 "dtc-parser.tab.c" /* yacc.c:1646 */
1986 #line 458 "dtc-parser.y" /* yacc.c:1646 */
1988 (yyval.nodelist) = NULL;
1990 #line 1991 "dtc-parser.tab.c" /* yacc.c:1646 */
1994 #line 462 "dtc-parser.y" /* yacc.c:1646 */
1996 (yyval.nodelist) = chain_node((yyvsp[-1].node), (yyvsp[0].nodelist));
1998 #line 1999 "dtc-parser.tab.c" /* yacc.c:1646 */
2002 #line 466 "dtc-parser.y" /* yacc.c:1646 */
2004 ERROR(&(yylsp[0]), "Properties must precede subnodes");
2007 #line 2008 "dtc-parser.tab.c" /* yacc.c:1646 */
2011 #line 474 "dtc-parser.y" /* yacc.c:1646 */
2013 (yyval.node) = name_node((yyvsp[0].node), (yyvsp[-1].propnodename));
2015 #line 2016 "dtc-parser.tab.c" /* yacc.c:1646 */
2019 #line 478 "dtc-parser.y" /* yacc.c:1646 */
2021 (yyval.node) = name_node(build_node_delete(), (yyvsp[-1].propnodename));
2023 #line 2024 "dtc-parser.tab.c" /* yacc.c:1646 */
2027 #line 482 "dtc-parser.y" /* yacc.c:1646 */
2029 add_label(&(yyvsp[0].node)->labels, (yyvsp[-1].labelref));
2030 (yyval.node) = (yyvsp[0].node);
2032 #line 2033 "dtc-parser.tab.c" /* yacc.c:1646 */
2036 #line 2037 "dtc-parser.tab.c" /* yacc.c:1646 */
2039 /* User semantic actions sometimes alter yychar, and that requires
2040 that yytoken be updated with the new translation. We take the
2041 approach of translating immediately before every use of yytoken.
2042 One alternative is translating here after every semantic action,
2043 but that translation would be missed if the semantic action invokes
2044 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2045 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2046 incorrect destructor might then be invoked immediately. In the
2047 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2048 to an incorrect destructor call or verbose syntax error message
2049 before the lookahead is translated. */
2050 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2054 YY_STACK_PRINT (yyss, yyssp);
2059 /* Now 'shift' the result of the reduction. Determine what state
2060 that goes to, based on the state we popped back to and the rule
2061 number reduced by. */
2065 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2066 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2067 yystate = yytable[yystate];
2069 yystate = yydefgoto[yyn - YYNTOKENS];
2074 /*--------------------------------------.
2075 | yyerrlab -- here on detecting error. |
2076 `--------------------------------------*/
2078 /* Make sure we have latest lookahead translation. See comments at
2079 user semantic actions for why this is necessary. */
2080 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2082 /* If not already recovering from an error, report this error. */
2086 #if ! YYERROR_VERBOSE
2087 yyerror (YY_("syntax error"));
2089 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2092 char const *yymsgp = YY_("syntax error");
2093 int yysyntax_error_status;
2094 yysyntax_error_status = YYSYNTAX_ERROR;
2095 if (yysyntax_error_status == 0)
2097 else if (yysyntax_error_status == 1)
2099 if (yymsg != yymsgbuf)
2100 YYSTACK_FREE (yymsg);
2101 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2105 yymsg_alloc = sizeof yymsgbuf;
2106 yysyntax_error_status = 2;
2110 yysyntax_error_status = YYSYNTAX_ERROR;
2115 if (yysyntax_error_status == 2)
2116 goto yyexhaustedlab;
2118 # undef YYSYNTAX_ERROR
2122 yyerror_range[1] = yylloc;
2124 if (yyerrstatus == 3)
2126 /* If just tried and failed to reuse lookahead token after an
2127 error, discard it. */
2129 if (yychar <= YYEOF)
2131 /* Return failure if at end of input. */
2132 if (yychar == YYEOF)
2137 yydestruct ("Error: discarding",
2138 yytoken, &yylval, &yylloc);
2143 /* Else will try to reuse lookahead token after shifting the error
2148 /*---------------------------------------------------.
2149 | yyerrorlab -- error raised explicitly by YYERROR. |
2150 `---------------------------------------------------*/
2153 /* Pacify compilers like GCC when the user code never invokes
2154 YYERROR and the label yyerrorlab therefore never appears in user
2156 if (/*CONSTCOND*/ 0)
2159 yyerror_range[1] = yylsp[1-yylen];
2160 /* Do not reclaim the symbols of the rule whose action triggered
2164 YY_STACK_PRINT (yyss, yyssp);
2169 /*-------------------------------------------------------------.
2170 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2171 `-------------------------------------------------------------*/
2173 yyerrstatus = 3; /* Each real token shifted decrements this. */
2177 yyn = yypact[yystate];
2178 if (!yypact_value_is_default (yyn))
2181 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2189 /* Pop the current state because it cannot handle the error token. */
2193 yyerror_range[1] = *yylsp;
2194 yydestruct ("Error: popping",
2195 yystos[yystate], yyvsp, yylsp);
2198 YY_STACK_PRINT (yyss, yyssp);
2201 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2203 YY_IGNORE_MAYBE_UNINITIALIZED_END
2205 yyerror_range[2] = yylloc;
2206 /* Using YYLLOC is tempting, but would change the location of
2207 the lookahead. YYLOC is available though. */
2208 YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
2211 /* Shift the error token. */
2212 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2218 /*-------------------------------------.
2219 | yyacceptlab -- YYACCEPT comes here. |
2220 `-------------------------------------*/
2225 /*-----------------------------------.
2226 | yyabortlab -- YYABORT comes here. |
2227 `-----------------------------------*/
2232 #if !defined yyoverflow || YYERROR_VERBOSE
2233 /*-------------------------------------------------.
2234 | yyexhaustedlab -- memory exhaustion comes here. |
2235 `-------------------------------------------------*/
2237 yyerror (YY_("memory exhausted"));
2243 if (yychar != YYEMPTY)
2245 /* Make sure we have latest lookahead translation. See comments at
2246 user semantic actions for why this is necessary. */
2247 yytoken = YYTRANSLATE (yychar);
2248 yydestruct ("Cleanup: discarding lookahead",
2249 yytoken, &yylval, &yylloc);
2251 /* Do not reclaim the symbols of the rule whose action triggered
2252 this YYABORT or YYACCEPT. */
2254 YY_STACK_PRINT (yyss, yyssp);
2255 while (yyssp != yyss)
2257 yydestruct ("Cleanup: popping",
2258 yystos[*yyssp], yyvsp, yylsp);
2263 YYSTACK_FREE (yyss);
2266 if (yymsg != yymsgbuf)
2267 YYSTACK_FREE (yymsg);
2271 #line 488 "dtc-parser.y" /* yacc.c:1906 */
2274 void yyerror(char const *s)
2276 ERROR(&yylloc, "%s", s);