1 /* A Bison parser, made by GNU Bison 2.5. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2011 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 "2.5"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 0
66 /* Copy the first part of user declarations. */
68 /* Line 268 of yacc.c */
69 #line 21 "dtc-parser.y"
78 extern int yylex(void);
79 extern void print_error(char const *fmt, ...);
80 extern void yyerror(char const *s);
82 extern struct boot_info *the_boot_info;
83 extern int treesource_error;
85 static unsigned long long eval_literal(const char *s, int base, int bits);
86 static unsigned char eval_char_literal(const char *s);
89 /* Line 268 of yacc.c */
90 #line 91 "dtc-parser.tab.c"
92 /* Enabling traces. */
97 /* Enabling verbose error messages. */
98 #ifdef YYERROR_VERBOSE
99 # undef YYERROR_VERBOSE
100 # define YYERROR_VERBOSE 1
102 # define YYERROR_VERBOSE 0
105 /* Enabling the token table. */
106 #ifndef YYTOKEN_TABLE
107 # define YYTOKEN_TABLE 0
114 /* Put the tokens into the symbol table, so that GDB and other debuggers
130 DT_PROPNODENAME = 271,
132 DT_CHAR_LITERAL = 273,
144 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
145 typedef union YYSTYPE
148 /* Line 293 of yacc.c */
149 #line 40 "dtc-parser.y"
163 struct property *prop;
164 struct property *proplist;
166 struct node *nodelist;
167 struct reserve_info *re;
172 /* Line 293 of yacc.c */
173 #line 174 "dtc-parser.tab.c"
175 # define YYSTYPE_IS_TRIVIAL 1
176 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
177 # define YYSTYPE_IS_DECLARED 1
181 /* Copy the second part of user declarations. */
184 /* Line 343 of yacc.c */
185 #line 186 "dtc-parser.tab.c"
192 typedef YYTYPE_UINT8 yytype_uint8;
194 typedef unsigned char yytype_uint8;
198 typedef YYTYPE_INT8 yytype_int8;
199 #elif (defined __STDC__ || defined __C99__FUNC__ \
200 || defined __cplusplus || defined _MSC_VER)
201 typedef signed char yytype_int8;
203 typedef short int yytype_int8;
207 typedef YYTYPE_UINT16 yytype_uint16;
209 typedef unsigned short int yytype_uint16;
213 typedef YYTYPE_INT16 yytype_int16;
215 typedef short int yytype_int16;
219 # ifdef __SIZE_TYPE__
220 # define YYSIZE_T __SIZE_TYPE__
221 # elif defined size_t
222 # define YYSIZE_T size_t
223 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
224 || defined __cplusplus || defined _MSC_VER)
225 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
226 # define YYSIZE_T size_t
228 # define YYSIZE_T unsigned int
232 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
235 # if defined YYENABLE_NLS && YYENABLE_NLS
237 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
238 # define YY_(msgid) dgettext ("bison-runtime", msgid)
242 # define YY_(msgid) msgid
246 /* Suppress unused-variable warnings by "using" E. */
247 #if ! defined lint || defined __GNUC__
248 # define YYUSE(e) ((void) (e))
250 # define YYUSE(e) /* empty */
253 /* Identity function, used to suppress warnings about constant conditions. */
257 #if (defined __STDC__ || defined __C99__FUNC__ \
258 || defined __cplusplus || defined _MSC_VER)
271 #if ! defined yyoverflow || YYERROR_VERBOSE
273 /* The parser invokes alloca or malloc; define the necessary symbols. */
275 # ifdef YYSTACK_USE_ALLOCA
276 # if YYSTACK_USE_ALLOCA
278 # define YYSTACK_ALLOC __builtin_alloca
279 # elif defined __BUILTIN_VA_ARG_INCR
280 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
282 # define YYSTACK_ALLOC __alloca
283 # elif defined _MSC_VER
284 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
285 # define alloca _alloca
287 # define YYSTACK_ALLOC alloca
288 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
289 || defined __cplusplus || defined _MSC_VER)
290 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
291 # ifndef EXIT_SUCCESS
292 # define EXIT_SUCCESS 0
299 # ifdef YYSTACK_ALLOC
300 /* Pacify GCC's `empty if-body' warning. */
301 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
302 # ifndef YYSTACK_ALLOC_MAXIMUM
303 /* The OS might guarantee only one guard page at the bottom of the stack,
304 and a page size can be as small as 4096 bytes. So we cannot safely
305 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
306 to allow for a few compiler-allocated temporary stack slots. */
307 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
310 # define YYSTACK_ALLOC YYMALLOC
311 # define YYSTACK_FREE YYFREE
312 # ifndef YYSTACK_ALLOC_MAXIMUM
313 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
315 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
316 && ! ((defined YYMALLOC || defined malloc) \
317 && (defined YYFREE || defined free)))
318 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
319 # ifndef EXIT_SUCCESS
320 # define EXIT_SUCCESS 0
324 # define YYMALLOC malloc
325 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
326 || defined __cplusplus || defined _MSC_VER)
327 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
332 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
333 || defined __cplusplus || defined _MSC_VER)
334 void free (void *); /* INFRINGES ON USER NAME SPACE */
338 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
341 #if (! defined yyoverflow \
342 && (! defined __cplusplus \
343 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
345 /* A type that is properly aligned for any stack member. */
348 yytype_int16 yyss_alloc;
352 /* The size of the maximum gap between one aligned stack and the next. */
353 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
355 /* The size of an array large to enough to hold all stacks, each with
357 # define YYSTACK_BYTES(N) \
358 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
359 + YYSTACK_GAP_MAXIMUM)
361 # define YYCOPY_NEEDED 1
363 /* Relocate STACK from its old location to the new one. The
364 local variables YYSIZE and YYSTACKSIZE give the old and new number of
365 elements in the stack, and YYPTR gives the new location of the
366 stack. Advance YYPTR to a properly aligned location for the next
368 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
371 YYSIZE_T yynewbytes; \
372 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
373 Stack = &yyptr->Stack_alloc; \
374 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
375 yyptr += yynewbytes / sizeof (*yyptr); \
381 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
382 /* Copy COUNT objects from FROM to TO. The source and destination do
385 # if defined __GNUC__ && 1 < __GNUC__
386 # define YYCOPY(To, From, Count) \
387 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
389 # define YYCOPY(To, From, Count) \
393 for (yyi = 0; yyi < (Count); yyi++) \
394 (To)[yyi] = (From)[yyi]; \
399 #endif /* !YYCOPY_NEEDED */
401 /* YYFINAL -- State number of the termination state. */
403 /* YYLAST -- Last index in YYTABLE. */
406 /* YYNTOKENS -- Number of terminals. */
408 /* YYNNTS -- Number of nonterminals. */
410 /* YYNRULES -- Number of rules. */
412 /* YYNRULES -- Number of states. */
413 #define YYNSTATES 141
415 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
417 #define YYMAXUTOK 279
419 #define YYTRANSLATE(YYX) \
420 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
422 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
423 static const yytype_uint8 yytranslate[] =
425 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 47, 2, 2, 2, 45, 41, 2,
429 33, 35, 44, 42, 34, 43, 2, 26, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 38, 25,
431 36, 29, 30, 37, 2, 2, 2, 2, 2, 2,
432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 31, 2, 32, 40, 2, 2, 2, 2, 2,
435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 27, 39, 28, 46, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
451 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
452 15, 16, 17, 18, 19, 20, 21, 22, 23, 24
456 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
458 static const yytype_uint16 yyprhs[] =
460 0, 0, 3, 8, 9, 12, 17, 20, 23, 27,
461 31, 36, 42, 43, 46, 51, 54, 58, 61, 64,
462 68, 73, 76, 86, 92, 95, 96, 99, 102, 106,
463 108, 111, 114, 117, 119, 121, 125, 127, 129, 135,
464 137, 141, 143, 147, 149, 153, 155, 159, 161, 165,
465 167, 171, 175, 177, 181, 185, 189, 193, 197, 201,
466 203, 207, 211, 213, 217, 221, 225, 227, 229, 232,
467 235, 238, 239, 242, 245, 246, 249, 252, 255, 259
470 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
471 static const yytype_int8 yyrhs[] =
473 49, 0, -1, 3, 25, 50, 52, -1, -1, 51,
474 50, -1, 4, 59, 59, 25, -1, 22, 51, -1,
475 26, 53, -1, 52, 26, 53, -1, 52, 23, 53,
476 -1, 52, 15, 23, 25, -1, 27, 54, 74, 28,
477 25, -1, -1, 54, 55, -1, 16, 29, 56, 25,
478 -1, 16, 25, -1, 14, 16, 25, -1, 22, 55,
479 -1, 57, 21, -1, 57, 58, 30, -1, 57, 31,
480 73, 32, -1, 57, 23, -1, 57, 24, 33, 21,
481 34, 59, 34, 59, 35, -1, 57, 24, 33, 21,
482 35, -1, 56, 22, -1, -1, 56, 34, -1, 57,
483 22, -1, 13, 17, 36, -1, 36, -1, 58, 59,
484 -1, 58, 23, -1, 58, 22, -1, 17, -1, 18,
485 -1, 33, 60, 35, -1, 61, -1, 62, -1, 62,
486 37, 60, 38, 61, -1, 63, -1, 62, 12, 63,
487 -1, 64, -1, 63, 11, 64, -1, 65, -1, 64,
488 39, 65, -1, 66, -1, 65, 40, 66, -1, 67,
489 -1, 66, 41, 67, -1, 68, -1, 67, 9, 68,
490 -1, 67, 10, 68, -1, 69, -1, 68, 36, 69,
491 -1, 68, 30, 69, -1, 68, 7, 69, -1, 68,
492 8, 69, -1, 69, 5, 70, -1, 69, 6, 70,
493 -1, 70, -1, 70, 42, 71, -1, 70, 43, 71,
494 -1, 71, -1, 71, 44, 72, -1, 71, 26, 72,
495 -1, 71, 45, 72, -1, 72, -1, 59, -1, 43,
496 72, -1, 46, 72, -1, 47, 72, -1, -1, 73,
497 20, -1, 73, 22, -1, -1, 75, 74, -1, 75,
498 55, -1, 16, 53, -1, 15, 16, 25, -1, 22,
502 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
503 static const yytype_uint16 yyrline[] =
505 0, 109, 109, 118, 121, 128, 132, 140, 144, 148,
506 158, 172, 180, 183, 190, 194, 198, 202, 210, 214,
507 218, 222, 226, 243, 253, 261, 264, 268, 275, 290,
508 295, 315, 329, 336, 340, 344, 351, 355, 356, 360,
509 361, 365, 366, 370, 371, 375, 376, 380, 381, 385,
510 386, 387, 391, 392, 393, 394, 395, 399, 400, 401,
511 405, 406, 407, 411, 412, 413, 414, 418, 419, 420,
512 421, 426, 429, 433, 441, 444, 448, 456, 460, 464
516 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
517 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
518 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
519 static const char *const yytname[] =
521 "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE", "DT_LSHIFT",
522 "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ", "DT_NE", "DT_AND", "DT_OR",
523 "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE", "DT_PROPNODENAME", "DT_LITERAL",
524 "DT_CHAR_LITERAL", "DT_BASE", "DT_BYTE", "DT_STRING", "DT_LABEL",
525 "DT_REF", "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['",
526 "']'", "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'",
527 "'+'", "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile",
528 "memreserves", "memreserve", "devicetree", "nodedef", "proplist",
529 "propdef", "propdata", "propdataprefix", "arrayprefix", "integer_prim",
530 "integer_expr", "integer_trinary", "integer_or", "integer_and",
531 "integer_bitor", "integer_bitxor", "integer_bitand", "integer_eq",
532 "integer_rela", "integer_shift", "integer_add", "integer_mul",
533 "integer_unary", "bytestring", "subnodes", "subnode", 0
538 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
540 static const yytype_uint16 yytoknum[] =
542 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
543 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
544 275, 276, 277, 278, 279, 59, 47, 123, 125, 61,
545 62, 91, 93, 40, 44, 41, 60, 63, 58, 124,
546 94, 38, 43, 45, 42, 37, 126, 33
550 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
551 static const yytype_uint8 yyr1[] =
553 0, 48, 49, 50, 50, 51, 51, 52, 52, 52,
554 52, 53, 54, 54, 55, 55, 55, 55, 56, 56,
555 56, 56, 56, 56, 56, 57, 57, 57, 58, 58,
556 58, 58, 58, 59, 59, 59, 60, 61, 61, 62,
557 62, 63, 63, 64, 64, 65, 65, 66, 66, 67,
558 67, 67, 68, 68, 68, 68, 68, 69, 69, 69,
559 70, 70, 70, 71, 71, 71, 71, 72, 72, 72,
560 72, 73, 73, 73, 74, 74, 74, 75, 75, 75
563 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
564 static const yytype_uint8 yyr2[] =
566 0, 2, 4, 0, 2, 4, 2, 2, 3, 3,
567 4, 5, 0, 2, 4, 2, 3, 2, 2, 3,
568 4, 2, 9, 5, 2, 0, 2, 2, 3, 1,
569 2, 2, 2, 1, 1, 3, 1, 1, 5, 1,
570 3, 1, 3, 1, 3, 1, 3, 1, 3, 1,
571 3, 3, 1, 3, 3, 3, 3, 3, 3, 1,
572 3, 3, 1, 3, 3, 3, 1, 1, 2, 2,
573 2, 0, 2, 2, 0, 2, 2, 2, 3, 2
576 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
577 Performed when YYTABLE doesn't 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, 0, 0, 3, 33,
582 34, 0, 0, 6, 0, 2, 4, 0, 0, 0,
583 67, 0, 36, 37, 39, 41, 43, 45, 47, 49,
584 52, 59, 62, 66, 0, 12, 7, 0, 0, 0,
585 68, 69, 70, 35, 0, 0, 0, 0, 0, 0,
586 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
587 0, 0, 0, 5, 74, 0, 9, 8, 40, 0,
588 42, 44, 46, 48, 50, 51, 55, 56, 54, 53,
589 57, 58, 60, 61, 64, 63, 65, 0, 0, 0,
590 0, 13, 0, 74, 10, 0, 0, 0, 15, 25,
591 77, 17, 79, 0, 76, 75, 38, 16, 78, 0,
592 0, 11, 24, 14, 26, 0, 18, 27, 21, 0,
593 71, 29, 0, 0, 0, 0, 32, 31, 19, 30,
594 28, 0, 72, 73, 20, 0, 23, 0, 0, 0,
598 /* YYDEFGOTO[NTERM-NUM]. */
599 static const yytype_int8 yydefgoto[] =
601 -1, 2, 7, 8, 15, 36, 64, 91, 109, 110,
602 122, 20, 21, 22, 23, 24, 25, 26, 27, 28,
603 29, 30, 31, 32, 33, 125, 92, 93
606 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
608 #define YYPACT_NINF -78
609 static const yytype_int8 yypact[] =
611 22, 11, 51, 10, -78, 23, 10, 2, 10, -78,
612 -78, -9, 23, -78, 30, 38, -78, -9, -9, -9,
613 -78, 35, -78, -6, 52, 29, 48, 49, 33, 3,
614 71, 36, 0, -78, 64, -78, -78, 68, 30, 30,
615 -78, -78, -78, -78, -9, -9, -9, -9, -9, -9,
616 -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
617 -9, -9, -9, -78, 44, 67, -78, -78, 52, 55,
618 29, 48, 49, 33, 3, 3, 71, 71, 71, 71,
619 36, 36, 0, 0, -78, -78, -78, 78, 79, 42,
620 44, -78, 69, 44, -78, -9, 73, 74, -78, -78,
621 -78, -78, -78, 75, -78, -78, -78, -78, -78, -7,
622 -1, -78, -78, -78, -78, 84, -78, -78, -78, 63,
623 -78, -78, 32, 66, 82, -3, -78, -78, -78, -78,
624 -78, 46, -78, -78, -78, 23, -78, 70, 23, 72,
628 /* YYPGOTO[NTERM-NUM]. */
629 static const yytype_int8 yypgoto[] =
631 -78, -78, 97, 100, -78, -37, -78, -77, -78, -78,
632 -78, -5, 65, 13, -78, 76, 77, 62, 80, 83,
633 34, 20, 26, 28, -14, -78, 18, 24
636 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
637 positive, shift that token. If negative, reduce the rule which
638 number is the opposite. If YYTABLE_NINF, syntax error. */
639 #define YYTABLE_NINF -1
640 static const yytype_uint8 yytable[] =
642 12, 66, 67, 40, 41, 42, 44, 34, 9, 10,
643 52, 53, 115, 101, 5, 112, 104, 132, 113, 133,
644 116, 117, 118, 119, 11, 1, 60, 114, 14, 134,
645 120, 45, 6, 54, 17, 121, 3, 18, 19, 55,
646 9, 10, 50, 51, 61, 62, 84, 85, 86, 9,
647 10, 4, 100, 37, 126, 127, 11, 35, 87, 88,
648 89, 38, 128, 46, 39, 11, 90, 98, 47, 35,
649 43, 99, 76, 77, 78, 79, 56, 57, 58, 59,
650 135, 136, 80, 81, 74, 75, 82, 83, 48, 63,
651 49, 65, 94, 95, 96, 97, 124, 103, 107, 108,
652 111, 123, 130, 131, 138, 16, 13, 140, 106, 71,
653 69, 105, 0, 0, 102, 0, 0, 129, 0, 0,
654 68, 0, 0, 70, 0, 0, 0, 0, 72, 0,
658 #define yypact_value_is_default(yystate) \
661 #define yytable_value_is_error(yytable_value) \
664 static const yytype_int16 yycheck[] =
666 5, 38, 39, 17, 18, 19, 12, 12, 17, 18,
667 7, 8, 13, 90, 4, 22, 93, 20, 25, 22,
668 21, 22, 23, 24, 33, 3, 26, 34, 26, 32,
669 31, 37, 22, 30, 43, 36, 25, 46, 47, 36,
670 17, 18, 9, 10, 44, 45, 60, 61, 62, 17,
671 18, 0, 89, 15, 22, 23, 33, 27, 14, 15,
672 16, 23, 30, 11, 26, 33, 22, 25, 39, 27,
673 35, 29, 52, 53, 54, 55, 5, 6, 42, 43,
674 34, 35, 56, 57, 50, 51, 58, 59, 40, 25,
675 41, 23, 25, 38, 16, 16, 33, 28, 25, 25,
676 25, 17, 36, 21, 34, 8, 6, 35, 95, 47,
677 45, 93, -1, -1, 90, -1, -1, 122, -1, -1,
678 44, -1, -1, 46, -1, -1, -1, -1, 48, -1,
682 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
683 symbol of state STATE-NUM. */
684 static const yytype_uint8 yystos[] =
686 0, 3, 49, 25, 0, 4, 22, 50, 51, 17,
687 18, 33, 59, 51, 26, 52, 50, 43, 46, 47,
688 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
689 69, 70, 71, 72, 59, 27, 53, 15, 23, 26,
690 72, 72, 72, 35, 12, 37, 11, 39, 40, 41,
691 9, 10, 7, 8, 30, 36, 5, 6, 42, 43,
692 26, 44, 45, 25, 54, 23, 53, 53, 63, 60,
693 64, 65, 66, 67, 68, 68, 69, 69, 69, 69,
694 70, 70, 71, 71, 72, 72, 72, 14, 15, 16,
695 22, 55, 74, 75, 25, 38, 16, 16, 25, 29,
696 53, 55, 75, 28, 55, 74, 61, 25, 25, 56,
697 57, 25, 22, 25, 34, 13, 21, 22, 23, 24,
698 31, 36, 58, 17, 33, 73, 22, 23, 30, 59,
699 36, 21, 20, 22, 32, 34, 35, 59, 34, 59,
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 /* Like YYERROR except do call yyerror. This remains here temporarily
714 to ease the transition to the new meaning of YYERROR, for GCC.
715 Once GCC version 2 has supplanted version 1, this can go. However,
716 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
717 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
720 #define YYFAIL goto yyerrlab
722 /* This is here to suppress warnings from the GCC cpp's
723 -Wunused-macros. Normally we don't worry about that warning, but
724 some users do, and we want to make it easy for users to remove
725 YYFAIL uses, which will produce warnings from Bison 2.5. */
728 #define YYRECOVERING() (!!yyerrstatus)
730 #define YYBACKUP(Token, Value) \
732 if (yychar == YYEMPTY && yylen == 1) \
741 yyerror (YY_("syntax error: cannot back up")); \
748 #define YYERRCODE 256
751 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
752 If N is 0, then set CURRENT to the empty location which ends
753 the previous symbol: RHS[0] (always defined). */
755 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
756 #ifndef YYLLOC_DEFAULT
757 # define YYLLOC_DEFAULT(Current, Rhs, N) \
761 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
762 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
763 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
764 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
768 (Current).first_line = (Current).last_line = \
769 YYRHSLOC (Rhs, 0).last_line; \
770 (Current).first_column = (Current).last_column = \
771 YYRHSLOC (Rhs, 0).last_column; \
777 /* This macro is provided for backward compatibility. */
779 #ifndef YY_LOCATION_PRINT
780 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
784 /* YYLEX -- calling `yylex' with the right arguments. */
787 # define YYLEX yylex (YYLEX_PARAM)
789 # define YYLEX yylex ()
792 /* Enable debugging if requested. */
796 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
797 # define YYFPRINTF fprintf
800 # define YYDPRINTF(Args) \
806 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
810 YYFPRINTF (stderr, "%s ", Title); \
811 yy_symbol_print (stderr, \
813 YYFPRINTF (stderr, "\n"); \
818 /*--------------------------------.
819 | Print this symbol on YYOUTPUT. |
820 `--------------------------------*/
823 #if (defined __STDC__ || defined __C99__FUNC__ \
824 || defined __cplusplus || defined _MSC_VER)
826 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
829 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
832 YYSTYPE const * const yyvaluep;
838 if (yytype < YYNTOKENS)
839 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
851 /*--------------------------------.
852 | Print this symbol on YYOUTPUT. |
853 `--------------------------------*/
855 #if (defined __STDC__ || defined __C99__FUNC__ \
856 || defined __cplusplus || defined _MSC_VER)
858 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
861 yy_symbol_print (yyoutput, yytype, yyvaluep)
864 YYSTYPE const * const yyvaluep;
867 if (yytype < YYNTOKENS)
868 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
870 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
872 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
873 YYFPRINTF (yyoutput, ")");
876 /*------------------------------------------------------------------.
877 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
879 `------------------------------------------------------------------*/
881 #if (defined __STDC__ || defined __C99__FUNC__ \
882 || defined __cplusplus || defined _MSC_VER)
884 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
887 yy_stack_print (yybottom, yytop)
888 yytype_int16 *yybottom;
892 YYFPRINTF (stderr, "Stack now");
893 for (; yybottom <= yytop; yybottom++)
895 int yybot = *yybottom;
896 YYFPRINTF (stderr, " %d", yybot);
898 YYFPRINTF (stderr, "\n");
901 # define YY_STACK_PRINT(Bottom, Top) \
904 yy_stack_print ((Bottom), (Top)); \
908 /*------------------------------------------------.
909 | Report that the YYRULE is going to be reduced. |
910 `------------------------------------------------*/
912 #if (defined __STDC__ || defined __C99__FUNC__ \
913 || defined __cplusplus || defined _MSC_VER)
915 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
918 yy_reduce_print (yyvsp, yyrule)
923 int yynrhs = yyr2[yyrule];
925 unsigned long int yylno = yyrline[yyrule];
926 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
928 /* The symbols being reduced. */
929 for (yyi = 0; yyi < yynrhs; yyi++)
931 YYFPRINTF (stderr, " $%d = ", yyi + 1);
932 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
933 &(yyvsp[(yyi + 1) - (yynrhs)])
935 YYFPRINTF (stderr, "\n");
939 # define YY_REDUCE_PRINT(Rule) \
942 yy_reduce_print (yyvsp, Rule); \
945 /* Nonzero means print parse trace. It is left uninitialized so that
946 multiple parsers can coexist. */
949 # define YYDPRINTF(Args)
950 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
951 # define YY_STACK_PRINT(Bottom, Top)
952 # define YY_REDUCE_PRINT(Rule)
953 #endif /* !YYDEBUG */
956 /* YYINITDEPTH -- initial size of the parser's stacks. */
958 # define YYINITDEPTH 200
961 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
962 if the built-in stack extension method is used).
964 Do not make this value too large; the results are undefined if
965 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
966 evaluated with infinite-precision integer arithmetic. */
969 # define YYMAXDEPTH 10000
976 # if defined __GLIBC__ && defined _STRING_H
977 # define yystrlen strlen
979 /* Return the length of YYSTR. */
980 #if (defined __STDC__ || defined __C99__FUNC__ \
981 || defined __cplusplus || defined _MSC_VER)
983 yystrlen (const char *yystr)
991 for (yylen = 0; yystr[yylen]; yylen++)
999 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1000 # define yystpcpy stpcpy
1002 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1004 #if (defined __STDC__ || defined __C99__FUNC__ \
1005 || defined __cplusplus || defined _MSC_VER)
1007 yystpcpy (char *yydest, const char *yysrc)
1010 yystpcpy (yydest, yysrc)
1016 const char *yys = yysrc;
1018 while ((*yyd++ = *yys++) != '\0')
1027 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1028 quotes and backslashes, so that it's suitable for yyerror. The
1029 heuristic is that double-quoting is unnecessary unless the string
1030 contains an apostrophe, a comma, or backslash (other than
1031 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1032 null, do not copy; instead, return the length of what the result
1035 yytnamerr (char *yyres, const char *yystr)
1040 char const *yyp = yystr;
1047 goto do_not_strip_quotes;
1051 goto do_not_strip_quotes;
1064 do_not_strip_quotes: ;
1068 return yystrlen (yystr);
1070 return yystpcpy (yyres, yystr) - yyres;
1074 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1075 about the unexpected token YYTOKEN for the state stack whose top is
1078 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1079 not large enough to hold the message. In that case, also set
1080 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1081 required number of bytes is too large to store. */
1083 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1084 yytype_int16 *yyssp, int yytoken)
1086 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1087 YYSIZE_T yysize = yysize0;
1089 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1090 /* Internationalized format string. */
1091 const char *yyformat = 0;
1092 /* Arguments of yyformat. */
1093 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1094 /* Number of reported tokens (one for the "unexpected", one per
1098 /* There are many possibilities here to consider:
1099 - Assume YYFAIL is not used. It's too flawed to consider. See
1100 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1101 for details. YYERROR is fine as it does not invoke this
1103 - If this state is a consistent state with a default action, then
1104 the only way this function was invoked is if the default action
1105 is an error action. In that case, don't check for expected
1106 tokens because there are none.
1107 - The only way there can be no lookahead present (in yychar) is if
1108 this state is a consistent state with a default action. Thus,
1109 detecting the absence of a lookahead is sufficient to determine
1110 that there is no unexpected or expected token to report. In that
1111 case, just report a simple "syntax error".
1112 - Don't assume there isn't a lookahead just because this state is a
1113 consistent state with a default action. There might have been a
1114 previous inconsistent state, consistent state with a non-default
1115 action, or user semantic action that manipulated yychar.
1116 - Of course, the expected token list depends on states to have
1117 correct lookahead information, and it depends on the parser not
1118 to perform extra reductions after fetching a lookahead from the
1119 scanner and before detecting a syntax error. Thus, state merging
1120 (from LALR or IELR) and default reductions corrupt the expected
1121 token list. However, the list is correct for canonical LR with
1122 one exception: it will still contain any token that will not be
1123 accepted due to an error action in a later state.
1125 if (yytoken != YYEMPTY)
1127 int yyn = yypact[*yyssp];
1128 yyarg[yycount++] = yytname[yytoken];
1129 if (!yypact_value_is_default (yyn))
1131 /* Start YYX at -YYN if negative to avoid negative indexes in
1132 YYCHECK. In other words, skip the first -YYN actions for
1133 this state because they are default actions. */
1134 int yyxbegin = yyn < 0 ? -yyn : 0;
1135 /* Stay within bounds of both yycheck and yytname. */
1136 int yychecklim = YYLAST - yyn + 1;
1137 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1140 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1141 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1142 && !yytable_value_is_error (yytable[yyx + yyn]))
1144 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1150 yyarg[yycount++] = yytname[yyx];
1151 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1152 if (! (yysize <= yysize1
1153 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1162 # define YYCASE_(N, S) \
1166 YYCASE_(0, YY_("syntax error"));
1167 YYCASE_(1, YY_("syntax error, unexpected %s"));
1168 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1169 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1170 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1171 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1175 yysize1 = yysize + yystrlen (yyformat);
1176 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1180 if (*yymsg_alloc < yysize)
1182 *yymsg_alloc = 2 * yysize;
1183 if (! (yysize <= *yymsg_alloc
1184 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1185 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1189 /* Avoid sprintf, as that infringes on the user's name space.
1190 Don't have undefined behavior even if the translation
1191 produced a string with the wrong number of "%s"s. */
1195 while ((*yyp = *yyformat) != '\0')
1196 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1198 yyp += yytnamerr (yyp, yyarg[yyi++]);
1209 #endif /* YYERROR_VERBOSE */
1211 /*-----------------------------------------------.
1212 | Release the memory associated to this symbol. |
1213 `-----------------------------------------------*/
1216 #if (defined __STDC__ || defined __C99__FUNC__ \
1217 || defined __cplusplus || defined _MSC_VER)
1219 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1222 yydestruct (yymsg, yytype, yyvaluep)
1232 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1243 /* Prevent warnings from -Wmissing-prototypes. */
1244 #ifdef YYPARSE_PARAM
1245 #if defined __STDC__ || defined __cplusplus
1246 int yyparse (void *YYPARSE_PARAM);
1250 #else /* ! YYPARSE_PARAM */
1251 #if defined __STDC__ || defined __cplusplus
1256 #endif /* ! YYPARSE_PARAM */
1259 /* The lookahead symbol. */
1262 /* The semantic value of the lookahead symbol. */
1265 /* Number of syntax errors so far. */
1273 #ifdef YYPARSE_PARAM
1274 #if (defined __STDC__ || defined __C99__FUNC__ \
1275 || defined __cplusplus || defined _MSC_VER)
1277 yyparse (void *YYPARSE_PARAM)
1280 yyparse (YYPARSE_PARAM)
1281 void *YYPARSE_PARAM;
1283 #else /* ! YYPARSE_PARAM */
1284 #if (defined __STDC__ || defined __C99__FUNC__ \
1285 || defined __cplusplus || defined _MSC_VER)
1296 /* Number of tokens to shift before error messages enabled. */
1299 /* The stacks and their tools:
1300 `yyss': related to states.
1301 `yyvs': related to semantic values.
1303 Refer to the stacks thru separate pointers, to allow yyoverflow
1304 to reallocate them elsewhere. */
1306 /* The state stack. */
1307 yytype_int16 yyssa[YYINITDEPTH];
1309 yytype_int16 *yyssp;
1311 /* The semantic value stack. */
1312 YYSTYPE yyvsa[YYINITDEPTH];
1316 YYSIZE_T yystacksize;
1320 /* Lookahead token as an internal (translated) token number. */
1322 /* The variables used to return semantic value and location from the
1327 /* Buffer for error messages, and its allocated size. */
1329 char *yymsg = yymsgbuf;
1330 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1333 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1335 /* The number of symbols on the RHS of the reduced rule.
1336 Keep to zero when no symbol should be popped. */
1342 yystacksize = YYINITDEPTH;
1344 YYDPRINTF ((stderr, "Starting parse\n"));
1349 yychar = YYEMPTY; /* Cause a token to be read. */
1351 /* Initialize stack pointers.
1352 Waste one element of value and location stack
1353 so that they stay on the same level as the state stack.
1354 The wasted elements are never initialized. */
1360 /*------------------------------------------------------------.
1361 | yynewstate -- Push a new state, which is found in yystate. |
1362 `------------------------------------------------------------*/
1364 /* In all cases, when you get here, the value and location stacks
1365 have just been pushed. So pushing a state here evens the stacks. */
1371 if (yyss + yystacksize - 1 <= yyssp)
1373 /* Get the current used size of the three stacks, in elements. */
1374 YYSIZE_T yysize = yyssp - yyss + 1;
1378 /* Give user a chance to reallocate the stack. Use copies of
1379 these so that the &'s don't force the real ones into
1381 YYSTYPE *yyvs1 = yyvs;
1382 yytype_int16 *yyss1 = yyss;
1384 /* Each stack pointer address is followed by the size of the
1385 data in use in that stack, in bytes. This used to be a
1386 conditional around just the two extra args, but that might
1387 be undefined if yyoverflow is a macro. */
1388 yyoverflow (YY_("memory exhausted"),
1389 &yyss1, yysize * sizeof (*yyssp),
1390 &yyvs1, yysize * sizeof (*yyvsp),
1396 #else /* no yyoverflow */
1397 # ifndef YYSTACK_RELOCATE
1398 goto yyexhaustedlab;
1400 /* Extend the stack our own way. */
1401 if (YYMAXDEPTH <= yystacksize)
1402 goto yyexhaustedlab;
1404 if (YYMAXDEPTH < yystacksize)
1405 yystacksize = YYMAXDEPTH;
1408 yytype_int16 *yyss1 = yyss;
1409 union yyalloc *yyptr =
1410 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1412 goto yyexhaustedlab;
1413 YYSTACK_RELOCATE (yyss_alloc, yyss);
1414 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1415 # undef YYSTACK_RELOCATE
1417 YYSTACK_FREE (yyss1);
1420 #endif /* no yyoverflow */
1422 yyssp = yyss + yysize - 1;
1423 yyvsp = yyvs + yysize - 1;
1425 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1426 (unsigned long int) yystacksize));
1428 if (yyss + yystacksize - 1 <= yyssp)
1432 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1434 if (yystate == YYFINAL)
1444 /* Do appropriate processing given the current state. Read a
1445 lookahead token if we need one and don't already have one. */
1447 /* First try to decide what to do without reference to lookahead token. */
1448 yyn = yypact[yystate];
1449 if (yypact_value_is_default (yyn))
1452 /* Not known => get a lookahead token if don't already have one. */
1454 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1455 if (yychar == YYEMPTY)
1457 YYDPRINTF ((stderr, "Reading a token: "));
1461 if (yychar <= YYEOF)
1463 yychar = yytoken = YYEOF;
1464 YYDPRINTF ((stderr, "Now at end of input.\n"));
1468 yytoken = YYTRANSLATE (yychar);
1469 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1472 /* If the proper action on seeing token YYTOKEN is to reduce or to
1473 detect an error, take that action. */
1475 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1480 if (yytable_value_is_error (yyn))
1486 /* Count tokens shifted since error; after three, turn off error
1491 /* Shift the lookahead token. */
1492 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1494 /* Discard the shifted token. */
1503 /*-----------------------------------------------------------.
1504 | yydefault -- do the default action for the current state. |
1505 `-----------------------------------------------------------*/
1507 yyn = yydefact[yystate];
1513 /*-----------------------------.
1514 | yyreduce -- Do a reduction. |
1515 `-----------------------------*/
1517 /* yyn is the number of a rule to reduce with. */
1520 /* If YYLEN is nonzero, implement the default value of the action:
1523 Otherwise, the following line sets YYVAL to garbage.
1524 This behavior is undocumented and Bison
1525 users should not rely upon it. Assigning to YYVAL
1526 unconditionally makes the parser a bit smaller, and it avoids a
1527 GCC warning that YYVAL may be used uninitialized. */
1528 yyval = yyvsp[1-yylen];
1531 YY_REDUCE_PRINT (yyn);
1536 /* Line 1806 of yacc.c */
1537 #line 110 "dtc-parser.y"
1539 the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node),
1540 guess_boot_cpuid((yyvsp[(4) - (4)].node)));
1546 /* Line 1806 of yacc.c */
1547 #line 118 "dtc-parser.y"
1555 /* Line 1806 of yacc.c */
1556 #line 122 "dtc-parser.y"
1558 (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
1564 /* Line 1806 of yacc.c */
1565 #line 129 "dtc-parser.y"
1567 (yyval.re) = build_reserve_entry((yyvsp[(2) - (4)].integer), (yyvsp[(3) - (4)].integer));
1573 /* Line 1806 of yacc.c */
1574 #line 133 "dtc-parser.y"
1576 add_label(&(yyvsp[(2) - (2)].re)->labels, (yyvsp[(1) - (2)].labelref));
1577 (yyval.re) = (yyvsp[(2) - (2)].re);
1583 /* Line 1806 of yacc.c */
1584 #line 141 "dtc-parser.y"
1586 (yyval.node) = name_node((yyvsp[(2) - (2)].node), "");
1592 /* Line 1806 of yacc.c */
1593 #line 145 "dtc-parser.y"
1595 (yyval.node) = merge_nodes((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
1601 /* Line 1806 of yacc.c */
1602 #line 149 "dtc-parser.y"
1604 struct node *target = get_node_by_ref((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].labelref));
1607 merge_nodes(target, (yyvsp[(3) - (3)].node));
1609 print_error("label or path, '%s', not found", (yyvsp[(2) - (3)].labelref));
1610 (yyval.node) = (yyvsp[(1) - (3)].node);
1616 /* Line 1806 of yacc.c */
1617 #line 159 "dtc-parser.y"
1619 struct node *target = get_node_by_ref((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].labelref));
1622 print_error("label or path, '%s', not found", (yyvsp[(3) - (4)].labelref));
1624 delete_node(target);
1626 (yyval.node) = (yyvsp[(1) - (4)].node);
1632 /* Line 1806 of yacc.c */
1633 #line 173 "dtc-parser.y"
1635 (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
1641 /* Line 1806 of yacc.c */
1642 #line 180 "dtc-parser.y"
1644 (yyval.proplist) = NULL;
1650 /* Line 1806 of yacc.c */
1651 #line 184 "dtc-parser.y"
1653 (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
1659 /* Line 1806 of yacc.c */
1660 #line 191 "dtc-parser.y"
1662 (yyval.prop) = build_property((yyvsp[(1) - (4)].propnodename), (yyvsp[(3) - (4)].data));
1668 /* Line 1806 of yacc.c */
1669 #line 195 "dtc-parser.y"
1671 (yyval.prop) = build_property((yyvsp[(1) - (2)].propnodename), empty_data);
1677 /* Line 1806 of yacc.c */
1678 #line 199 "dtc-parser.y"
1680 (yyval.prop) = build_property_delete((yyvsp[(2) - (3)].propnodename));
1686 /* Line 1806 of yacc.c */
1687 #line 203 "dtc-parser.y"
1689 add_label(&(yyvsp[(2) - (2)].prop)->labels, (yyvsp[(1) - (2)].labelref));
1690 (yyval.prop) = (yyvsp[(2) - (2)].prop);
1696 /* Line 1806 of yacc.c */
1697 #line 211 "dtc-parser.y"
1699 (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
1705 /* Line 1806 of yacc.c */
1706 #line 215 "dtc-parser.y"
1708 (yyval.data) = data_merge((yyvsp[(1) - (3)].data), (yyvsp[(2) - (3)].array).data);
1714 /* Line 1806 of yacc.c */
1715 #line 219 "dtc-parser.y"
1717 (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
1723 /* Line 1806 of yacc.c */
1724 #line 223 "dtc-parser.y"
1726 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
1732 /* Line 1806 of yacc.c */
1733 #line 227 "dtc-parser.y"
1735 FILE *f = srcfile_relative_open((yyvsp[(4) - (9)].data).val, NULL);
1738 if ((yyvsp[(6) - (9)].integer) != 0)
1739 if (fseek(f, (yyvsp[(6) - (9)].integer), SEEK_SET) != 0)
1740 print_error("Couldn't seek to offset %llu in \"%s\": %s",
1741 (unsigned long long)(yyvsp[(6) - (9)].integer),
1742 (yyvsp[(4) - (9)].data).val,
1745 d = data_copy_file(f, (yyvsp[(8) - (9)].integer));
1747 (yyval.data) = data_merge((yyvsp[(1) - (9)].data), d);
1754 /* Line 1806 of yacc.c */
1755 #line 244 "dtc-parser.y"
1757 FILE *f = srcfile_relative_open((yyvsp[(4) - (5)].data).val, NULL);
1758 struct data d = empty_data;
1760 d = data_copy_file(f, -1);
1762 (yyval.data) = data_merge((yyvsp[(1) - (5)].data), d);
1769 /* Line 1806 of yacc.c */
1770 #line 254 "dtc-parser.y"
1772 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1778 /* Line 1806 of yacc.c */
1779 #line 261 "dtc-parser.y"
1781 (yyval.data) = empty_data;
1787 /* Line 1806 of yacc.c */
1788 #line 265 "dtc-parser.y"
1790 (yyval.data) = (yyvsp[(1) - (2)].data);
1796 /* Line 1806 of yacc.c */
1797 #line 269 "dtc-parser.y"
1799 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1805 /* Line 1806 of yacc.c */
1806 #line 276 "dtc-parser.y"
1808 (yyval.array).data = empty_data;
1809 (yyval.array).bits = eval_literal((yyvsp[(2) - (3)].literal), 0, 7);
1811 if (((yyval.array).bits != 8) &&
1812 ((yyval.array).bits != 16) &&
1813 ((yyval.array).bits != 32) &&
1814 ((yyval.array).bits != 64))
1816 print_error("Only 8, 16, 32 and 64-bit elements"
1817 " are currently supported");
1818 (yyval.array).bits = 32;
1825 /* Line 1806 of yacc.c */
1826 #line 291 "dtc-parser.y"
1828 (yyval.array).data = empty_data;
1829 (yyval.array).bits = 32;
1835 /* Line 1806 of yacc.c */
1836 #line 296 "dtc-parser.y"
1838 if ((yyvsp[(1) - (2)].array).bits < 64) {
1839 uint64_t mask = (1ULL << (yyvsp[(1) - (2)].array).bits) - 1;
1841 * Bits above mask must either be all zero
1842 * (positive within range of mask) or all one
1843 * (negative and sign-extended). The second
1844 * condition is true if when we set all bits
1845 * within the mask to one (i.e. | in the
1846 * mask), all bits are one.
1848 if (((yyvsp[(2) - (2)].integer) > mask) && (((yyvsp[(2) - (2)].integer) | mask) != -1ULL))
1850 "integer value out of range "
1851 "%016lx (%d bits)", (yyvsp[(1) - (2)].array).bits);
1854 (yyval.array).data = data_append_integer((yyvsp[(1) - (2)].array).data, (yyvsp[(2) - (2)].integer), (yyvsp[(1) - (2)].array).bits);
1860 /* Line 1806 of yacc.c */
1861 #line 316 "dtc-parser.y"
1863 uint64_t val = ~0ULL >> (64 - (yyvsp[(1) - (2)].array).bits);
1865 if ((yyvsp[(1) - (2)].array).bits == 32)
1866 (yyvsp[(1) - (2)].array).data = data_add_marker((yyvsp[(1) - (2)].array).data,
1868 (yyvsp[(2) - (2)].labelref));
1870 print_error("References are only allowed in "
1871 "arrays with 32-bit elements.");
1873 (yyval.array).data = data_append_integer((yyvsp[(1) - (2)].array).data, val, (yyvsp[(1) - (2)].array).bits);
1879 /* Line 1806 of yacc.c */
1880 #line 330 "dtc-parser.y"
1882 (yyval.array).data = data_add_marker((yyvsp[(1) - (2)].array).data, LABEL, (yyvsp[(2) - (2)].labelref));
1888 /* Line 1806 of yacc.c */
1889 #line 337 "dtc-parser.y"
1891 (yyval.integer) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
1897 /* Line 1806 of yacc.c */
1898 #line 341 "dtc-parser.y"
1900 (yyval.integer) = eval_char_literal((yyvsp[(1) - (1)].literal));
1906 /* Line 1806 of yacc.c */
1907 #line 345 "dtc-parser.y"
1909 (yyval.integer) = (yyvsp[(2) - (3)].integer);
1915 /* Line 1806 of yacc.c */
1916 #line 356 "dtc-parser.y"
1917 { (yyval.integer) = (yyvsp[(1) - (5)].integer) ? (yyvsp[(3) - (5)].integer) : (yyvsp[(5) - (5)].integer); }
1922 /* Line 1806 of yacc.c */
1923 #line 361 "dtc-parser.y"
1924 { (yyval.integer) = (yyvsp[(1) - (3)].integer) || (yyvsp[(3) - (3)].integer); }
1929 /* Line 1806 of yacc.c */
1930 #line 366 "dtc-parser.y"
1931 { (yyval.integer) = (yyvsp[(1) - (3)].integer) && (yyvsp[(3) - (3)].integer); }
1936 /* Line 1806 of yacc.c */
1937 #line 371 "dtc-parser.y"
1938 { (yyval.integer) = (yyvsp[(1) - (3)].integer) | (yyvsp[(3) - (3)].integer); }
1943 /* Line 1806 of yacc.c */
1944 #line 376 "dtc-parser.y"
1945 { (yyval.integer) = (yyvsp[(1) - (3)].integer) ^ (yyvsp[(3) - (3)].integer); }
1950 /* Line 1806 of yacc.c */
1951 #line 381 "dtc-parser.y"
1952 { (yyval.integer) = (yyvsp[(1) - (3)].integer) & (yyvsp[(3) - (3)].integer); }
1957 /* Line 1806 of yacc.c */
1958 #line 386 "dtc-parser.y"
1959 { (yyval.integer) = (yyvsp[(1) - (3)].integer) == (yyvsp[(3) - (3)].integer); }
1964 /* Line 1806 of yacc.c */
1965 #line 387 "dtc-parser.y"
1966 { (yyval.integer) = (yyvsp[(1) - (3)].integer) != (yyvsp[(3) - (3)].integer); }
1971 /* Line 1806 of yacc.c */
1972 #line 392 "dtc-parser.y"
1973 { (yyval.integer) = (yyvsp[(1) - (3)].integer) < (yyvsp[(3) - (3)].integer); }
1978 /* Line 1806 of yacc.c */
1979 #line 393 "dtc-parser.y"
1980 { (yyval.integer) = (yyvsp[(1) - (3)].integer) > (yyvsp[(3) - (3)].integer); }
1985 /* Line 1806 of yacc.c */
1986 #line 394 "dtc-parser.y"
1987 { (yyval.integer) = (yyvsp[(1) - (3)].integer) <= (yyvsp[(3) - (3)].integer); }
1992 /* Line 1806 of yacc.c */
1993 #line 395 "dtc-parser.y"
1994 { (yyval.integer) = (yyvsp[(1) - (3)].integer) >= (yyvsp[(3) - (3)].integer); }
1999 /* Line 1806 of yacc.c */
2000 #line 399 "dtc-parser.y"
2001 { (yyval.integer) = (yyvsp[(1) - (3)].integer) << (yyvsp[(3) - (3)].integer); }
2006 /* Line 1806 of yacc.c */
2007 #line 400 "dtc-parser.y"
2008 { (yyval.integer) = (yyvsp[(1) - (3)].integer) >> (yyvsp[(3) - (3)].integer); }
2013 /* Line 1806 of yacc.c */
2014 #line 405 "dtc-parser.y"
2015 { (yyval.integer) = (yyvsp[(1) - (3)].integer) + (yyvsp[(3) - (3)].integer); }
2020 /* Line 1806 of yacc.c */
2021 #line 406 "dtc-parser.y"
2022 { (yyval.integer) = (yyvsp[(1) - (3)].integer) - (yyvsp[(3) - (3)].integer); }
2027 /* Line 1806 of yacc.c */
2028 #line 411 "dtc-parser.y"
2029 { (yyval.integer) = (yyvsp[(1) - (3)].integer) * (yyvsp[(3) - (3)].integer); }
2034 /* Line 1806 of yacc.c */
2035 #line 412 "dtc-parser.y"
2036 { (yyval.integer) = (yyvsp[(1) - (3)].integer) / (yyvsp[(3) - (3)].integer); }
2041 /* Line 1806 of yacc.c */
2042 #line 413 "dtc-parser.y"
2043 { (yyval.integer) = (yyvsp[(1) - (3)].integer) % (yyvsp[(3) - (3)].integer); }
2048 /* Line 1806 of yacc.c */
2049 #line 419 "dtc-parser.y"
2050 { (yyval.integer) = -(yyvsp[(2) - (2)].integer); }
2055 /* Line 1806 of yacc.c */
2056 #line 420 "dtc-parser.y"
2057 { (yyval.integer) = ~(yyvsp[(2) - (2)].integer); }
2062 /* Line 1806 of yacc.c */
2063 #line 421 "dtc-parser.y"
2064 { (yyval.integer) = !(yyvsp[(2) - (2)].integer); }
2069 /* Line 1806 of yacc.c */
2070 #line 426 "dtc-parser.y"
2072 (yyval.data) = empty_data;
2078 /* Line 1806 of yacc.c */
2079 #line 430 "dtc-parser.y"
2081 (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
2087 /* Line 1806 of yacc.c */
2088 #line 434 "dtc-parser.y"
2090 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
2096 /* Line 1806 of yacc.c */
2097 #line 441 "dtc-parser.y"
2099 (yyval.nodelist) = NULL;
2105 /* Line 1806 of yacc.c */
2106 #line 445 "dtc-parser.y"
2108 (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
2114 /* Line 1806 of yacc.c */
2115 #line 449 "dtc-parser.y"
2117 print_error("syntax error: properties must precede subnodes");
2124 /* Line 1806 of yacc.c */
2125 #line 457 "dtc-parser.y"
2127 (yyval.node) = name_node((yyvsp[(2) - (2)].node), (yyvsp[(1) - (2)].propnodename));
2133 /* Line 1806 of yacc.c */
2134 #line 461 "dtc-parser.y"
2136 (yyval.node) = name_node(build_node_delete(), (yyvsp[(2) - (3)].propnodename));
2142 /* Line 1806 of yacc.c */
2143 #line 465 "dtc-parser.y"
2145 add_label(&(yyvsp[(2) - (2)].node)->labels, (yyvsp[(1) - (2)].labelref));
2146 (yyval.node) = (yyvsp[(2) - (2)].node);
2152 /* Line 1806 of yacc.c */
2153 #line 2154 "dtc-parser.tab.c"
2156 /* User semantic actions sometimes alter yychar, and that requires
2157 that yytoken be updated with the new translation. We take the
2158 approach of translating immediately before every use of yytoken.
2159 One alternative is translating here after every semantic action,
2160 but that translation would be missed if the semantic action invokes
2161 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2162 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2163 incorrect destructor might then be invoked immediately. In the
2164 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2165 to an incorrect destructor call or verbose syntax error message
2166 before the lookahead is translated. */
2167 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2171 YY_STACK_PRINT (yyss, yyssp);
2175 /* Now `shift' the result of the reduction. Determine what state
2176 that goes to, based on the state we popped back to and the rule
2177 number reduced by. */
2181 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2182 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2183 yystate = yytable[yystate];
2185 yystate = yydefgoto[yyn - YYNTOKENS];
2190 /*------------------------------------.
2191 | yyerrlab -- here on detecting error |
2192 `------------------------------------*/
2194 /* Make sure we have latest lookahead translation. See comments at
2195 user semantic actions for why this is necessary. */
2196 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2198 /* If not already recovering from an error, report this error. */
2202 #if ! YYERROR_VERBOSE
2203 yyerror (YY_("syntax error"));
2205 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2208 char const *yymsgp = YY_("syntax error");
2209 int yysyntax_error_status;
2210 yysyntax_error_status = YYSYNTAX_ERROR;
2211 if (yysyntax_error_status == 0)
2213 else if (yysyntax_error_status == 1)
2215 if (yymsg != yymsgbuf)
2216 YYSTACK_FREE (yymsg);
2217 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2221 yymsg_alloc = sizeof yymsgbuf;
2222 yysyntax_error_status = 2;
2226 yysyntax_error_status = YYSYNTAX_ERROR;
2231 if (yysyntax_error_status == 2)
2232 goto yyexhaustedlab;
2234 # undef YYSYNTAX_ERROR
2240 if (yyerrstatus == 3)
2242 /* If just tried and failed to reuse lookahead token after an
2243 error, discard it. */
2245 if (yychar <= YYEOF)
2247 /* Return failure if at end of input. */
2248 if (yychar == YYEOF)
2253 yydestruct ("Error: discarding",
2259 /* Else will try to reuse lookahead token after shifting the error
2264 /*---------------------------------------------------.
2265 | yyerrorlab -- error raised explicitly by YYERROR. |
2266 `---------------------------------------------------*/
2269 /* Pacify compilers like GCC when the user code never invokes
2270 YYERROR and the label yyerrorlab therefore never appears in user
2272 if (/*CONSTCOND*/ 0)
2275 /* Do not reclaim the symbols of the rule which action triggered
2279 YY_STACK_PRINT (yyss, yyssp);
2284 /*-------------------------------------------------------------.
2285 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2286 `-------------------------------------------------------------*/
2288 yyerrstatus = 3; /* Each real token shifted decrements this. */
2292 yyn = yypact[yystate];
2293 if (!yypact_value_is_default (yyn))
2296 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2304 /* Pop the current state because it cannot handle the error token. */
2309 yydestruct ("Error: popping",
2310 yystos[yystate], yyvsp);
2313 YY_STACK_PRINT (yyss, yyssp);
2319 /* Shift the error token. */
2320 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2326 /*-------------------------------------.
2327 | yyacceptlab -- YYACCEPT comes here. |
2328 `-------------------------------------*/
2333 /*-----------------------------------.
2334 | yyabortlab -- YYABORT comes here. |
2335 `-----------------------------------*/
2340 #if !defined(yyoverflow) || YYERROR_VERBOSE
2341 /*-------------------------------------------------.
2342 | yyexhaustedlab -- memory exhaustion comes here. |
2343 `-------------------------------------------------*/
2345 yyerror (YY_("memory exhausted"));
2351 if (yychar != YYEMPTY)
2353 /* Make sure we have latest lookahead translation. See comments at
2354 user semantic actions for why this is necessary. */
2355 yytoken = YYTRANSLATE (yychar);
2356 yydestruct ("Cleanup: discarding lookahead",
2359 /* Do not reclaim the symbols of the rule which action triggered
2360 this YYABORT or YYACCEPT. */
2362 YY_STACK_PRINT (yyss, yyssp);
2363 while (yyssp != yyss)
2365 yydestruct ("Cleanup: popping",
2366 yystos[*yyssp], yyvsp);
2371 YYSTACK_FREE (yyss);
2374 if (yymsg != yymsgbuf)
2375 YYSTACK_FREE (yymsg);
2377 /* Make sure YYID is used. */
2378 return YYID (yyresult);
2383 /* Line 2067 of yacc.c */
2384 #line 471 "dtc-parser.y"
2387 void print_error(char const *fmt, ...)
2392 srcpos_verror(&yylloc, fmt, va);
2395 treesource_error = 1;
2398 void yyerror(char const *s) {
2399 print_error("%s", s);
2402 static unsigned long long eval_literal(const char *s, int base, int bits)
2404 unsigned long long val;
2408 val = strtoull(s, &e, base);
2410 size_t uls = strspn(e, "UL");
2412 print_error("bad characters in literal");
2414 if ((errno == ERANGE)
2415 || ((bits < 64) && (val >= (1ULL << bits))))
2416 print_error("literal out of range");
2417 else if (errno != 0)
2418 print_error("bad literal");
2422 static unsigned char eval_char_literal(const char *s)
2429 print_error("empty character literal");
2434 * If the first character in the character literal is a \ then process
2435 * the remaining characters as an escape encoding. If the first
2436 * character is neither an escape or a terminator it should be the only
2437 * character in the literal and will be returned.
2440 c = get_escape_char(s, &i);
2443 print_error("malformed character literal");