2 /* A Bison parser, made by GNU Bison 2.4.1. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4.1"
52 #define YYSKELETON_NAME "yacc.c"
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
68 /* Copy the first part of user declarations. */
70 /* Line 189 of yacc.c */
71 #line 21 "dtc-parser.y"
80 extern int yylex(void);
81 extern void print_error(char const *fmt, ...);
82 extern void yyerror(char const *s);
84 extern struct boot_info *the_boot_info;
85 extern int treesource_error;
87 static unsigned long long eval_literal(const char *s, int base, int bits);
88 static unsigned char eval_char_literal(const char *s);
91 /* Line 189 of yacc.c */
92 #line 93 "dtc-parser.tab.c"
94 /* Enabling traces. */
99 /* Enabling verbose error messages. */
100 #ifdef YYERROR_VERBOSE
101 # undef YYERROR_VERBOSE
102 # define YYERROR_VERBOSE 1
104 # define YYERROR_VERBOSE 0
107 /* Enabling the token table. */
108 #ifndef YYTOKEN_TABLE
109 # define YYTOKEN_TABLE 0
116 /* Put the tokens into the symbol table, so that GDB and other debuggers
132 DT_PROPNODENAME = 271,
134 DT_CHAR_LITERAL = 273,
146 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
147 typedef union YYSTYPE
150 /* Line 214 of yacc.c */
151 #line 40 "dtc-parser.y"
165 struct property *prop;
166 struct property *proplist;
168 struct node *nodelist;
169 struct reserve_info *re;
174 /* Line 214 of yacc.c */
175 #line 176 "dtc-parser.tab.c"
177 # define YYSTYPE_IS_TRIVIAL 1
178 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
179 # define YYSTYPE_IS_DECLARED 1
183 /* Copy the second part of user declarations. */
186 /* Line 264 of yacc.c */
187 #line 188 "dtc-parser.tab.c"
194 typedef YYTYPE_UINT8 yytype_uint8;
196 typedef unsigned char yytype_uint8;
200 typedef YYTYPE_INT8 yytype_int8;
201 #elif (defined __STDC__ || defined __C99__FUNC__ \
202 || defined __cplusplus || defined _MSC_VER)
203 typedef signed char yytype_int8;
205 typedef short int yytype_int8;
209 typedef YYTYPE_UINT16 yytype_uint16;
211 typedef unsigned short int yytype_uint16;
215 typedef YYTYPE_INT16 yytype_int16;
217 typedef short int yytype_int16;
221 # ifdef __SIZE_TYPE__
222 # define YYSIZE_T __SIZE_TYPE__
223 # elif defined size_t
224 # define YYSIZE_T size_t
225 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
226 || defined __cplusplus || defined _MSC_VER)
227 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
228 # define YYSIZE_T size_t
230 # define YYSIZE_T unsigned int
234 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
239 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
240 # define YY_(msgid) dgettext ("bison-runtime", msgid)
244 # define YY_(msgid) msgid
248 /* Suppress unused-variable warnings by "using" E. */
249 #if ! defined lint || defined __GNUC__
250 # define YYUSE(e) ((void) (e))
252 # define YYUSE(e) /* empty */
255 /* Identity function, used to suppress warnings about constant conditions. */
259 #if (defined __STDC__ || defined __C99__FUNC__ \
260 || defined __cplusplus || defined _MSC_VER)
273 #if ! defined yyoverflow || YYERROR_VERBOSE
275 /* The parser invokes alloca or malloc; define the necessary symbols. */
277 # ifdef YYSTACK_USE_ALLOCA
278 # if YYSTACK_USE_ALLOCA
280 # define YYSTACK_ALLOC __builtin_alloca
281 # elif defined __BUILTIN_VA_ARG_INCR
282 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
284 # define YYSTACK_ALLOC __alloca
285 # elif defined _MSC_VER
286 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
287 # define alloca _alloca
289 # define YYSTACK_ALLOC alloca
290 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
291 || defined __cplusplus || defined _MSC_VER)
292 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
301 # ifdef YYSTACK_ALLOC
302 /* Pacify GCC's `empty if-body' warning. */
303 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
304 # ifndef YYSTACK_ALLOC_MAXIMUM
305 /* The OS might guarantee only one guard page at the bottom of the stack,
306 and a page size can be as small as 4096 bytes. So we cannot safely
307 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
308 to allow for a few compiler-allocated temporary stack slots. */
309 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
312 # define YYSTACK_ALLOC YYMALLOC
313 # define YYSTACK_FREE YYFREE
314 # ifndef YYSTACK_ALLOC_MAXIMUM
315 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
317 # if (defined __cplusplus && ! defined _STDLIB_H \
318 && ! ((defined YYMALLOC || defined malloc) \
319 && (defined YYFREE || defined free)))
320 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
326 # define YYMALLOC malloc
327 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
328 || defined __cplusplus || defined _MSC_VER)
329 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
334 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
335 || defined __cplusplus || defined _MSC_VER)
336 void free (void *); /* INFRINGES ON USER NAME SPACE */
340 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
343 #if (! defined yyoverflow \
344 && (! defined __cplusplus \
345 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
347 /* A type that is properly aligned for any stack member. */
350 yytype_int16 yyss_alloc;
354 /* The size of the maximum gap between one aligned stack and the next. */
355 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
357 /* The size of an array large to enough to hold all stacks, each with
359 # define YYSTACK_BYTES(N) \
360 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
361 + YYSTACK_GAP_MAXIMUM)
363 /* Copy COUNT objects from FROM to TO. The source and destination do
366 # if defined __GNUC__ && 1 < __GNUC__
367 # define YYCOPY(To, From, Count) \
368 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
370 # define YYCOPY(To, From, Count) \
374 for (yyi = 0; yyi < (Count); yyi++) \
375 (To)[yyi] = (From)[yyi]; \
381 /* Relocate STACK from its old location to the new one. The
382 local variables YYSIZE and YYSTACKSIZE give the old and new number of
383 elements in the stack, and YYPTR gives the new location of the
384 stack. Advance YYPTR to a properly aligned location for the next
386 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
389 YYSIZE_T yynewbytes; \
390 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
391 Stack = &yyptr->Stack_alloc; \
392 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
393 yyptr += yynewbytes / sizeof (*yyptr); \
399 /* YYFINAL -- State number of the termination state. */
401 /* YYLAST -- Last index in YYTABLE. */
404 /* YYNTOKENS -- Number of terminals. */
406 /* YYNNTS -- Number of nonterminals. */
408 /* YYNRULES -- Number of rules. */
410 /* YYNRULES -- Number of states. */
411 #define YYNSTATES 141
413 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
415 #define YYMAXUTOK 279
417 #define YYTRANSLATE(YYX) \
418 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
420 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
421 static const yytype_uint8 yytranslate[] =
423 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 47, 2, 2, 2, 45, 41, 2,
427 33, 35, 44, 42, 34, 43, 2, 26, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 38, 25,
429 36, 29, 30, 37, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 2, 31, 2, 32, 40, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435 2, 2, 2, 27, 39, 28, 46, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
449 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
450 15, 16, 17, 18, 19, 20, 21, 22, 23, 24
454 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
456 static const yytype_uint16 yyprhs[] =
458 0, 0, 3, 8, 9, 12, 17, 20, 23, 27,
459 31, 36, 42, 43, 46, 51, 54, 58, 61, 64,
460 68, 73, 76, 86, 92, 95, 96, 99, 102, 106,
461 108, 111, 114, 117, 119, 121, 125, 127, 129, 135,
462 137, 141, 143, 147, 149, 153, 155, 159, 161, 165,
463 167, 171, 175, 177, 181, 185, 189, 193, 197, 201,
464 203, 207, 211, 213, 217, 221, 225, 227, 229, 232,
465 235, 238, 239, 242, 245, 246, 249, 252, 255, 259
468 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
469 static const yytype_int8 yyrhs[] =
471 49, 0, -1, 3, 25, 50, 52, -1, -1, 51,
472 50, -1, 4, 59, 59, 25, -1, 22, 51, -1,
473 26, 53, -1, 52, 26, 53, -1, 52, 23, 53,
474 -1, 52, 15, 23, 25, -1, 27, 54, 74, 28,
475 25, -1, -1, 54, 55, -1, 16, 29, 56, 25,
476 -1, 16, 25, -1, 14, 16, 25, -1, 22, 55,
477 -1, 57, 21, -1, 57, 58, 30, -1, 57, 31,
478 73, 32, -1, 57, 23, -1, 57, 24, 33, 21,
479 34, 59, 34, 59, 35, -1, 57, 24, 33, 21,
480 35, -1, 56, 22, -1, -1, 56, 34, -1, 57,
481 22, -1, 13, 17, 36, -1, 36, -1, 58, 59,
482 -1, 58, 23, -1, 58, 22, -1, 17, -1, 18,
483 -1, 33, 60, 35, -1, 61, -1, 62, -1, 62,
484 37, 60, 38, 61, -1, 63, -1, 62, 12, 63,
485 -1, 64, -1, 63, 11, 64, -1, 65, -1, 64,
486 39, 65, -1, 66, -1, 65, 40, 66, -1, 67,
487 -1, 66, 41, 67, -1, 68, -1, 67, 9, 68,
488 -1, 67, 10, 68, -1, 69, -1, 68, 36, 69,
489 -1, 68, 30, 69, -1, 68, 7, 69, -1, 68,
490 8, 69, -1, 69, 5, 70, -1, 69, 6, 70,
491 -1, 70, -1, 70, 42, 71, -1, 70, 43, 71,
492 -1, 71, -1, 71, 44, 72, -1, 71, 26, 72,
493 -1, 71, 45, 72, -1, 72, -1, 59, -1, 43,
494 72, -1, 46, 72, -1, 47, 72, -1, -1, 73,
495 20, -1, 73, 22, -1, -1, 75, 74, -1, 75,
496 55, -1, 16, 53, -1, 15, 16, 25, -1, 22,
500 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
501 static const yytype_uint16 yyrline[] =
503 0, 109, 109, 118, 121, 128, 132, 140, 144, 148,
504 158, 172, 180, 183, 190, 194, 198, 202, 210, 214,
505 218, 222, 226, 243, 253, 261, 264, 268, 275, 290,
506 295, 315, 329, 336, 340, 344, 351, 355, 356, 360,
507 361, 365, 366, 370, 371, 375, 376, 380, 381, 385,
508 386, 387, 391, 392, 393, 394, 395, 399, 400, 401,
509 405, 406, 407, 411, 412, 413, 414, 418, 419, 420,
510 421, 426, 429, 433, 441, 444, 448, 456, 460, 464
514 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
515 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
516 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
517 static const char *const yytname[] =
519 "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE", "DT_LSHIFT",
520 "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ", "DT_NE", "DT_AND", "DT_OR",
521 "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE", "DT_PROPNODENAME", "DT_LITERAL",
522 "DT_CHAR_LITERAL", "DT_BASE", "DT_BYTE", "DT_STRING", "DT_LABEL",
523 "DT_REF", "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['",
524 "']'", "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'",
525 "'+'", "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile",
526 "memreserves", "memreserve", "devicetree", "nodedef", "proplist",
527 "propdef", "propdata", "propdataprefix", "arrayprefix", "integer_prim",
528 "integer_expr", "integer_trinary", "integer_or", "integer_and",
529 "integer_bitor", "integer_bitxor", "integer_bitand", "integer_eq",
530 "integer_rela", "integer_shift", "integer_add", "integer_mul",
531 "integer_unary", "bytestring", "subnodes", "subnode", 0
536 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
538 static const yytype_uint16 yytoknum[] =
540 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
541 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
542 275, 276, 277, 278, 279, 59, 47, 123, 125, 61,
543 62, 91, 93, 40, 44, 41, 60, 63, 58, 124,
544 94, 38, 43, 45, 42, 37, 126, 33
548 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
549 static const yytype_uint8 yyr1[] =
551 0, 48, 49, 50, 50, 51, 51, 52, 52, 52,
552 52, 53, 54, 54, 55, 55, 55, 55, 56, 56,
553 56, 56, 56, 56, 56, 57, 57, 57, 58, 58,
554 58, 58, 58, 59, 59, 59, 60, 61, 61, 62,
555 62, 63, 63, 64, 64, 65, 65, 66, 66, 67,
556 67, 67, 68, 68, 68, 68, 68, 69, 69, 69,
557 70, 70, 70, 71, 71, 71, 71, 72, 72, 72,
558 72, 73, 73, 73, 74, 74, 74, 75, 75, 75
561 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
562 static const yytype_uint8 yyr2[] =
564 0, 2, 4, 0, 2, 4, 2, 2, 3, 3,
565 4, 5, 0, 2, 4, 2, 3, 2, 2, 3,
566 4, 2, 9, 5, 2, 0, 2, 2, 3, 1,
567 2, 2, 2, 1, 1, 3, 1, 1, 5, 1,
568 3, 1, 3, 1, 3, 1, 3, 1, 3, 1,
569 3, 3, 1, 3, 3, 3, 3, 3, 3, 1,
570 3, 3, 1, 3, 3, 3, 1, 1, 2, 2,
571 2, 0, 2, 2, 0, 2, 2, 2, 3, 2
574 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
575 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
576 means the default is an error. */
577 static const yytype_uint8 yydefact[] =
579 0, 0, 0, 3, 1, 0, 0, 0, 3, 33,
580 34, 0, 0, 6, 0, 2, 4, 0, 0, 0,
581 67, 0, 36, 37, 39, 41, 43, 45, 47, 49,
582 52, 59, 62, 66, 0, 12, 7, 0, 0, 0,
583 68, 69, 70, 35, 0, 0, 0, 0, 0, 0,
584 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
585 0, 0, 0, 5, 74, 0, 9, 8, 40, 0,
586 42, 44, 46, 48, 50, 51, 55, 56, 54, 53,
587 57, 58, 60, 61, 64, 63, 65, 0, 0, 0,
588 0, 13, 0, 74, 10, 0, 0, 0, 15, 25,
589 77, 17, 79, 0, 76, 75, 38, 16, 78, 0,
590 0, 11, 24, 14, 26, 0, 18, 27, 21, 0,
591 71, 29, 0, 0, 0, 0, 32, 31, 19, 30,
592 28, 0, 72, 73, 20, 0, 23, 0, 0, 0,
596 /* YYDEFGOTO[NTERM-NUM]. */
597 static const yytype_int8 yydefgoto[] =
599 -1, 2, 7, 8, 15, 36, 64, 91, 109, 110,
600 122, 20, 21, 22, 23, 24, 25, 26, 27, 28,
601 29, 30, 31, 32, 33, 125, 92, 93
604 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
606 #define YYPACT_NINF -78
607 static const yytype_int8 yypact[] =
609 22, 11, 51, 10, -78, 23, 10, 2, 10, -78,
610 -78, -9, 23, -78, 30, 38, -78, -9, -9, -9,
611 -78, 35, -78, -6, 52, 29, 48, 49, 33, 3,
612 71, 36, 0, -78, 64, -78, -78, 68, 30, 30,
613 -78, -78, -78, -78, -9, -9, -9, -9, -9, -9,
614 -9, -9, -9, -9, -9, -9, -9, -9, -9, -9,
615 -9, -9, -9, -78, 44, 67, -78, -78, 52, 55,
616 29, 48, 49, 33, 3, 3, 71, 71, 71, 71,
617 36, 36, 0, 0, -78, -78, -78, 78, 79, 42,
618 44, -78, 69, 44, -78, -9, 73, 74, -78, -78,
619 -78, -78, -78, 75, -78, -78, -78, -78, -78, -7,
620 -1, -78, -78, -78, -78, 84, -78, -78, -78, 63,
621 -78, -78, 32, 66, 82, -3, -78, -78, -78, -78,
622 -78, 46, -78, -78, -78, 23, -78, 70, 23, 72,
626 /* YYPGOTO[NTERM-NUM]. */
627 static const yytype_int8 yypgoto[] =
629 -78, -78, 97, 100, -78, -37, -78, -77, -78, -78,
630 -78, -5, 65, 13, -78, 76, 77, 62, 80, 83,
631 34, 20, 26, 28, -14, -78, 18, 24
634 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
635 positive, shift that token. If negative, reduce the rule which
636 number is the opposite. If zero, do what YYDEFACT says.
637 If YYTABLE_NINF, syntax error. */
638 #define YYTABLE_NINF -1
639 static const yytype_uint8 yytable[] =
641 12, 66, 67, 40, 41, 42, 44, 34, 9, 10,
642 52, 53, 115, 101, 5, 112, 104, 132, 113, 133,
643 116, 117, 118, 119, 11, 1, 60, 114, 14, 134,
644 120, 45, 6, 54, 17, 121, 3, 18, 19, 55,
645 9, 10, 50, 51, 61, 62, 84, 85, 86, 9,
646 10, 4, 100, 37, 126, 127, 11, 35, 87, 88,
647 89, 38, 128, 46, 39, 11, 90, 98, 47, 35,
648 43, 99, 76, 77, 78, 79, 56, 57, 58, 59,
649 135, 136, 80, 81, 74, 75, 82, 83, 48, 63,
650 49, 65, 94, 95, 96, 97, 124, 103, 107, 108,
651 111, 123, 130, 131, 138, 16, 13, 140, 106, 71,
652 69, 105, 0, 0, 102, 0, 0, 129, 0, 0,
653 68, 0, 0, 70, 0, 0, 0, 0, 72, 0,
657 static const yytype_int16 yycheck[] =
659 5, 38, 39, 17, 18, 19, 12, 12, 17, 18,
660 7, 8, 13, 90, 4, 22, 93, 20, 25, 22,
661 21, 22, 23, 24, 33, 3, 26, 34, 26, 32,
662 31, 37, 22, 30, 43, 36, 25, 46, 47, 36,
663 17, 18, 9, 10, 44, 45, 60, 61, 62, 17,
664 18, 0, 89, 15, 22, 23, 33, 27, 14, 15,
665 16, 23, 30, 11, 26, 33, 22, 25, 39, 27,
666 35, 29, 52, 53, 54, 55, 5, 6, 42, 43,
667 34, 35, 56, 57, 50, 51, 58, 59, 40, 25,
668 41, 23, 25, 38, 16, 16, 33, 28, 25, 25,
669 25, 17, 36, 21, 34, 8, 6, 35, 95, 47,
670 45, 93, -1, -1, 90, -1, -1, 122, -1, -1,
671 44, -1, -1, 46, -1, -1, -1, -1, 48, -1,
675 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
676 symbol of state STATE-NUM. */
677 static const yytype_uint8 yystos[] =
679 0, 3, 49, 25, 0, 4, 22, 50, 51, 17,
680 18, 33, 59, 51, 26, 52, 50, 43, 46, 47,
681 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
682 69, 70, 71, 72, 59, 27, 53, 15, 23, 26,
683 72, 72, 72, 35, 12, 37, 11, 39, 40, 41,
684 9, 10, 7, 8, 30, 36, 5, 6, 42, 43,
685 26, 44, 45, 25, 54, 23, 53, 53, 63, 60,
686 64, 65, 66, 67, 68, 68, 69, 69, 69, 69,
687 70, 70, 71, 71, 72, 72, 72, 14, 15, 16,
688 22, 55, 74, 75, 25, 38, 16, 16, 25, 29,
689 53, 55, 75, 28, 55, 74, 61, 25, 25, 56,
690 57, 25, 22, 25, 34, 13, 21, 22, 23, 24,
691 31, 36, 58, 17, 33, 73, 22, 23, 30, 59,
692 36, 21, 20, 22, 32, 34, 35, 59, 34, 59,
696 #define yyerrok (yyerrstatus = 0)
697 #define yyclearin (yychar = YYEMPTY)
701 #define YYACCEPT goto yyacceptlab
702 #define YYABORT goto yyabortlab
703 #define YYERROR goto yyerrorlab
706 /* Like YYERROR except do call yyerror. This remains here temporarily
707 to ease the transition to the new meaning of YYERROR, for GCC.
708 Once GCC version 2 has supplanted version 1, this can go. */
710 #define YYFAIL goto yyerrlab
712 #define YYRECOVERING() (!!yyerrstatus)
714 #define YYBACKUP(Token, Value) \
716 if (yychar == YYEMPTY && yylen == 1) \
720 yytoken = YYTRANSLATE (yychar); \
726 yyerror (YY_("syntax error: cannot back up")); \
733 #define YYERRCODE 256
736 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
737 If N is 0, then set CURRENT to the empty location which ends
738 the previous symbol: RHS[0] (always defined). */
740 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
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; \
762 /* YY_LOCATION_PRINT -- Print the location on the stream.
763 This macro was not mandated originally: define only if we know
764 we won't break user code: when these are the locations we know. */
766 #ifndef YY_LOCATION_PRINT
767 # if YYLTYPE_IS_TRIVIAL
768 # define YY_LOCATION_PRINT(File, Loc) \
769 fprintf (File, "%d.%d-%d.%d", \
770 (Loc).first_line, (Loc).first_column, \
771 (Loc).last_line, (Loc).last_column)
773 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
778 /* YYLEX -- calling `yylex' with the right arguments. */
781 # define YYLEX yylex (YYLEX_PARAM)
783 # define YYLEX yylex ()
786 /* Enable debugging if requested. */
790 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
791 # define YYFPRINTF fprintf
794 # define YYDPRINTF(Args) \
800 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
804 YYFPRINTF (stderr, "%s ", Title); \
805 yy_symbol_print (stderr, \
807 YYFPRINTF (stderr, "\n"); \
812 /*--------------------------------.
813 | Print this symbol on YYOUTPUT. |
814 `--------------------------------*/
817 #if (defined __STDC__ || defined __C99__FUNC__ \
818 || defined __cplusplus || defined _MSC_VER)
820 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
823 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
826 YYSTYPE const * const yyvaluep;
832 if (yytype < YYNTOKENS)
833 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
845 /*--------------------------------.
846 | Print this symbol on YYOUTPUT. |
847 `--------------------------------*/
849 #if (defined __STDC__ || defined __C99__FUNC__ \
850 || defined __cplusplus || defined _MSC_VER)
852 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
855 yy_symbol_print (yyoutput, yytype, yyvaluep)
858 YYSTYPE const * const yyvaluep;
861 if (yytype < YYNTOKENS)
862 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
864 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
866 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
867 YYFPRINTF (yyoutput, ")");
870 /*------------------------------------------------------------------.
871 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
873 `------------------------------------------------------------------*/
875 #if (defined __STDC__ || defined __C99__FUNC__ \
876 || defined __cplusplus || defined _MSC_VER)
878 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
881 yy_stack_print (yybottom, yytop)
882 yytype_int16 *yybottom;
886 YYFPRINTF (stderr, "Stack now");
887 for (; yybottom <= yytop; yybottom++)
889 int yybot = *yybottom;
890 YYFPRINTF (stderr, " %d", yybot);
892 YYFPRINTF (stderr, "\n");
895 # define YY_STACK_PRINT(Bottom, Top) \
898 yy_stack_print ((Bottom), (Top)); \
902 /*------------------------------------------------.
903 | Report that the YYRULE is going to be reduced. |
904 `------------------------------------------------*/
906 #if (defined __STDC__ || defined __C99__FUNC__ \
907 || defined __cplusplus || defined _MSC_VER)
909 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
912 yy_reduce_print (yyvsp, yyrule)
917 int yynrhs = yyr2[yyrule];
919 unsigned long int yylno = yyrline[yyrule];
920 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
922 /* The symbols being reduced. */
923 for (yyi = 0; yyi < yynrhs; yyi++)
925 YYFPRINTF (stderr, " $%d = ", yyi + 1);
926 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
927 &(yyvsp[(yyi + 1) - (yynrhs)])
929 YYFPRINTF (stderr, "\n");
933 # define YY_REDUCE_PRINT(Rule) \
936 yy_reduce_print (yyvsp, Rule); \
939 /* Nonzero means print parse trace. It is left uninitialized so that
940 multiple parsers can coexist. */
943 # define YYDPRINTF(Args)
944 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
945 # define YY_STACK_PRINT(Bottom, Top)
946 # define YY_REDUCE_PRINT(Rule)
947 #endif /* !YYDEBUG */
950 /* YYINITDEPTH -- initial size of the parser's stacks. */
952 # define YYINITDEPTH 200
955 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
956 if the built-in stack extension method is used).
958 Do not make this value too large; the results are undefined if
959 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
960 evaluated with infinite-precision integer arithmetic. */
963 # define YYMAXDEPTH 10000
971 # if defined __GLIBC__ && defined _STRING_H
972 # define yystrlen strlen
974 /* Return the length of YYSTR. */
975 #if (defined __STDC__ || defined __C99__FUNC__ \
976 || defined __cplusplus || defined _MSC_VER)
978 yystrlen (const char *yystr)
986 for (yylen = 0; yystr[yylen]; yylen++)
994 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
995 # define yystpcpy stpcpy
997 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
999 #if (defined __STDC__ || defined __C99__FUNC__ \
1000 || defined __cplusplus || defined _MSC_VER)
1002 yystpcpy (char *yydest, const char *yysrc)
1005 yystpcpy (yydest, yysrc)
1011 const char *yys = yysrc;
1013 while ((*yyd++ = *yys++) != '\0')
1022 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1023 quotes and backslashes, so that it's suitable for yyerror. The
1024 heuristic is that double-quoting is unnecessary unless the string
1025 contains an apostrophe, a comma, or backslash (other than
1026 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1027 null, do not copy; instead, return the length of what the result
1030 yytnamerr (char *yyres, const char *yystr)
1035 char const *yyp = yystr;
1042 goto do_not_strip_quotes;
1046 goto do_not_strip_quotes;
1059 do_not_strip_quotes: ;
1063 return yystrlen (yystr);
1065 return yystpcpy (yyres, yystr) - yyres;
1069 /* Copy into YYRESULT an error message about the unexpected token
1070 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1071 including the terminating null byte. If YYRESULT is null, do not
1072 copy anything; just return the number of bytes that would be
1073 copied. As a special case, return 0 if an ordinary "syntax error"
1074 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1075 size calculation. */
1077 yysyntax_error (char *yyresult, int yystate, int yychar)
1079 int yyn = yypact[yystate];
1081 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1085 int yytype = YYTRANSLATE (yychar);
1086 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1087 YYSIZE_T yysize = yysize0;
1089 int yysize_overflow = 0;
1090 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1091 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1095 /* This is so xgettext sees the translatable formats that are
1096 constructed on the fly. */
1097 YY_("syntax error, unexpected %s");
1098 YY_("syntax error, unexpected %s, expecting %s");
1099 YY_("syntax error, unexpected %s, expecting %s or %s");
1100 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1101 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1105 static char const yyunexpected[] = "syntax error, unexpected %s";
1106 static char const yyexpecting[] = ", expecting %s";
1107 static char const yyor[] = " or %s";
1108 char yyformat[sizeof yyunexpected
1109 + sizeof yyexpecting - 1
1110 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1111 * (sizeof yyor - 1))];
1112 char const *yyprefix = yyexpecting;
1114 /* Start YYX at -YYN if negative to avoid negative indexes in
1116 int yyxbegin = yyn < 0 ? -yyn : 0;
1118 /* Stay within bounds of both yycheck and yytname. */
1119 int yychecklim = YYLAST - yyn + 1;
1120 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1123 yyarg[0] = yytname[yytype];
1124 yyfmt = yystpcpy (yyformat, yyunexpected);
1126 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1127 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1129 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1133 yyformat[sizeof yyunexpected - 1] = '\0';
1136 yyarg[yycount++] = yytname[yyx];
1137 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1138 yysize_overflow |= (yysize1 < yysize);
1140 yyfmt = yystpcpy (yyfmt, yyprefix);
1144 yyf = YY_(yyformat);
1145 yysize1 = yysize + yystrlen (yyf);
1146 yysize_overflow |= (yysize1 < yysize);
1149 if (yysize_overflow)
1150 return YYSIZE_MAXIMUM;
1154 /* Avoid sprintf, as that infringes on the user's name space.
1155 Don't have undefined behavior even if the translation
1156 produced a string with the wrong number of "%s"s. */
1157 char *yyp = yyresult;
1159 while ((*yyp = *yyf) != '\0')
1161 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1163 yyp += yytnamerr (yyp, yyarg[yyi++]);
1176 #endif /* YYERROR_VERBOSE */
1179 /*-----------------------------------------------.
1180 | Release the memory associated to this symbol. |
1181 `-----------------------------------------------*/
1184 #if (defined __STDC__ || defined __C99__FUNC__ \
1185 || defined __cplusplus || defined _MSC_VER)
1187 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1190 yydestruct (yymsg, yytype, yyvaluep)
1200 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1210 /* Prevent warnings from -Wmissing-prototypes. */
1211 #ifdef YYPARSE_PARAM
1212 #if defined __STDC__ || defined __cplusplus
1213 int yyparse (void *YYPARSE_PARAM);
1217 #else /* ! YYPARSE_PARAM */
1218 #if defined __STDC__ || defined __cplusplus
1223 #endif /* ! YYPARSE_PARAM */
1226 /* The lookahead symbol. */
1229 /* The semantic value of the lookahead symbol. */
1232 /* Number of syntax errors so far. */
1237 /*-------------------------.
1238 | yyparse or yypush_parse. |
1239 `-------------------------*/
1241 #ifdef YYPARSE_PARAM
1242 #if (defined __STDC__ || defined __C99__FUNC__ \
1243 || defined __cplusplus || defined _MSC_VER)
1245 yyparse (void *YYPARSE_PARAM)
1248 yyparse (YYPARSE_PARAM)
1249 void *YYPARSE_PARAM;
1251 #else /* ! YYPARSE_PARAM */
1252 #if (defined __STDC__ || defined __C99__FUNC__ \
1253 || defined __cplusplus || defined _MSC_VER)
1266 /* Number of tokens to shift before error messages enabled. */
1269 /* The stacks and their tools:
1270 `yyss': related to states.
1271 `yyvs': related to semantic values.
1273 Refer to the stacks thru separate pointers, to allow yyoverflow
1274 to reallocate them elsewhere. */
1276 /* The state stack. */
1277 yytype_int16 yyssa[YYINITDEPTH];
1279 yytype_int16 *yyssp;
1281 /* The semantic value stack. */
1282 YYSTYPE yyvsa[YYINITDEPTH];
1286 YYSIZE_T yystacksize;
1290 /* Lookahead token as an internal (translated) token number. */
1292 /* The variables used to return semantic value and location from the
1297 /* Buffer for error messages, and its allocated size. */
1299 char *yymsg = yymsgbuf;
1300 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1303 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1305 /* The number of symbols on the RHS of the reduced rule.
1306 Keep to zero when no symbol should be popped. */
1312 yystacksize = YYINITDEPTH;
1314 YYDPRINTF ((stderr, "Starting parse\n"));
1319 yychar = YYEMPTY; /* Cause a token to be read. */
1321 /* Initialize stack pointers.
1322 Waste one element of value and location stack
1323 so that they stay on the same level as the state stack.
1324 The wasted elements are never initialized. */
1330 /*------------------------------------------------------------.
1331 | yynewstate -- Push a new state, which is found in yystate. |
1332 `------------------------------------------------------------*/
1334 /* In all cases, when you get here, the value and location stacks
1335 have just been pushed. So pushing a state here evens the stacks. */
1341 if (yyss + yystacksize - 1 <= yyssp)
1343 /* Get the current used size of the three stacks, in elements. */
1344 YYSIZE_T yysize = yyssp - yyss + 1;
1348 /* Give user a chance to reallocate the stack. Use copies of
1349 these so that the &'s don't force the real ones into
1351 YYSTYPE *yyvs1 = yyvs;
1352 yytype_int16 *yyss1 = yyss;
1354 /* Each stack pointer address is followed by the size of the
1355 data in use in that stack, in bytes. This used to be a
1356 conditional around just the two extra args, but that might
1357 be undefined if yyoverflow is a macro. */
1358 yyoverflow (YY_("memory exhausted"),
1359 &yyss1, yysize * sizeof (*yyssp),
1360 &yyvs1, yysize * sizeof (*yyvsp),
1366 #else /* no yyoverflow */
1367 # ifndef YYSTACK_RELOCATE
1368 goto yyexhaustedlab;
1370 /* Extend the stack our own way. */
1371 if (YYMAXDEPTH <= yystacksize)
1372 goto yyexhaustedlab;
1374 if (YYMAXDEPTH < yystacksize)
1375 yystacksize = YYMAXDEPTH;
1378 yytype_int16 *yyss1 = yyss;
1379 union yyalloc *yyptr =
1380 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1382 goto yyexhaustedlab;
1383 YYSTACK_RELOCATE (yyss_alloc, yyss);
1384 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1385 # undef YYSTACK_RELOCATE
1387 YYSTACK_FREE (yyss1);
1390 #endif /* no yyoverflow */
1392 yyssp = yyss + yysize - 1;
1393 yyvsp = yyvs + yysize - 1;
1395 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1396 (unsigned long int) yystacksize));
1398 if (yyss + yystacksize - 1 <= yyssp)
1402 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1404 if (yystate == YYFINAL)
1414 /* Do appropriate processing given the current state. Read a
1415 lookahead token if we need one and don't already have one. */
1417 /* First try to decide what to do without reference to lookahead token. */
1418 yyn = yypact[yystate];
1419 if (yyn == YYPACT_NINF)
1422 /* Not known => get a lookahead token if don't already have one. */
1424 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1425 if (yychar == YYEMPTY)
1427 YYDPRINTF ((stderr, "Reading a token: "));
1431 if (yychar <= YYEOF)
1433 yychar = yytoken = YYEOF;
1434 YYDPRINTF ((stderr, "Now at end of input.\n"));
1438 yytoken = YYTRANSLATE (yychar);
1439 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1442 /* If the proper action on seeing token YYTOKEN is to reduce or to
1443 detect an error, take that action. */
1445 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1450 if (yyn == 0 || yyn == YYTABLE_NINF)
1456 /* Count tokens shifted since error; after three, turn off error
1461 /* Shift the lookahead token. */
1462 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1464 /* Discard the shifted token. */
1473 /*-----------------------------------------------------------.
1474 | yydefault -- do the default action for the current state. |
1475 `-----------------------------------------------------------*/
1477 yyn = yydefact[yystate];
1483 /*-----------------------------.
1484 | yyreduce -- Do a reduction. |
1485 `-----------------------------*/
1487 /* yyn is the number of a rule to reduce with. */
1490 /* If YYLEN is nonzero, implement the default value of the action:
1493 Otherwise, the following line sets YYVAL to garbage.
1494 This behavior is undocumented and Bison
1495 users should not rely upon it. Assigning to YYVAL
1496 unconditionally makes the parser a bit smaller, and it avoids a
1497 GCC warning that YYVAL may be used uninitialized. */
1498 yyval = yyvsp[1-yylen];
1501 YY_REDUCE_PRINT (yyn);
1506 /* Line 1455 of yacc.c */
1507 #line 110 "dtc-parser.y"
1509 the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node),
1510 guess_boot_cpuid((yyvsp[(4) - (4)].node)));
1516 /* Line 1455 of yacc.c */
1517 #line 118 "dtc-parser.y"
1525 /* Line 1455 of yacc.c */
1526 #line 122 "dtc-parser.y"
1528 (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
1534 /* Line 1455 of yacc.c */
1535 #line 129 "dtc-parser.y"
1537 (yyval.re) = build_reserve_entry((yyvsp[(2) - (4)].integer), (yyvsp[(3) - (4)].integer));
1543 /* Line 1455 of yacc.c */
1544 #line 133 "dtc-parser.y"
1546 add_label(&(yyvsp[(2) - (2)].re)->labels, (yyvsp[(1) - (2)].labelref));
1547 (yyval.re) = (yyvsp[(2) - (2)].re);
1553 /* Line 1455 of yacc.c */
1554 #line 141 "dtc-parser.y"
1556 (yyval.node) = name_node((yyvsp[(2) - (2)].node), "");
1562 /* Line 1455 of yacc.c */
1563 #line 145 "dtc-parser.y"
1565 (yyval.node) = merge_nodes((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
1571 /* Line 1455 of yacc.c */
1572 #line 149 "dtc-parser.y"
1574 struct node *target = get_node_by_ref((yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].labelref));
1577 merge_nodes(target, (yyvsp[(3) - (3)].node));
1579 print_error("label or path, '%s', not found", (yyvsp[(2) - (3)].labelref));
1580 (yyval.node) = (yyvsp[(1) - (3)].node);
1586 /* Line 1455 of yacc.c */
1587 #line 159 "dtc-parser.y"
1589 struct node *target = get_node_by_ref((yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].labelref));
1592 print_error("label or path, '%s', not found", (yyvsp[(3) - (4)].labelref));
1594 delete_node(target);
1596 (yyval.node) = (yyvsp[(1) - (4)].node);
1602 /* Line 1455 of yacc.c */
1603 #line 173 "dtc-parser.y"
1605 (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
1611 /* Line 1455 of yacc.c */
1612 #line 180 "dtc-parser.y"
1614 (yyval.proplist) = NULL;
1620 /* Line 1455 of yacc.c */
1621 #line 184 "dtc-parser.y"
1623 (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
1629 /* Line 1455 of yacc.c */
1630 #line 191 "dtc-parser.y"
1632 (yyval.prop) = build_property((yyvsp[(1) - (4)].propnodename), (yyvsp[(3) - (4)].data));
1638 /* Line 1455 of yacc.c */
1639 #line 195 "dtc-parser.y"
1641 (yyval.prop) = build_property((yyvsp[(1) - (2)].propnodename), empty_data);
1647 /* Line 1455 of yacc.c */
1648 #line 199 "dtc-parser.y"
1650 (yyval.prop) = build_property_delete((yyvsp[(2) - (3)].propnodename));
1656 /* Line 1455 of yacc.c */
1657 #line 203 "dtc-parser.y"
1659 add_label(&(yyvsp[(2) - (2)].prop)->labels, (yyvsp[(1) - (2)].labelref));
1660 (yyval.prop) = (yyvsp[(2) - (2)].prop);
1666 /* Line 1455 of yacc.c */
1667 #line 211 "dtc-parser.y"
1669 (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
1675 /* Line 1455 of yacc.c */
1676 #line 215 "dtc-parser.y"
1678 (yyval.data) = data_merge((yyvsp[(1) - (3)].data), (yyvsp[(2) - (3)].array).data);
1684 /* Line 1455 of yacc.c */
1685 #line 219 "dtc-parser.y"
1687 (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
1693 /* Line 1455 of yacc.c */
1694 #line 223 "dtc-parser.y"
1696 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
1702 /* Line 1455 of yacc.c */
1703 #line 227 "dtc-parser.y"
1705 FILE *f = srcfile_relative_open((yyvsp[(4) - (9)].data).val, NULL);
1708 if ((yyvsp[(6) - (9)].integer) != 0)
1709 if (fseek(f, (yyvsp[(6) - (9)].integer), SEEK_SET) != 0)
1710 print_error("Couldn't seek to offset %llu in \"%s\": %s",
1711 (unsigned long long)(yyvsp[(6) - (9)].integer),
1712 (yyvsp[(4) - (9)].data).val,
1715 d = data_copy_file(f, (yyvsp[(8) - (9)].integer));
1717 (yyval.data) = data_merge((yyvsp[(1) - (9)].data), d);
1724 /* Line 1455 of yacc.c */
1725 #line 244 "dtc-parser.y"
1727 FILE *f = srcfile_relative_open((yyvsp[(4) - (5)].data).val, NULL);
1728 struct data d = empty_data;
1730 d = data_copy_file(f, -1);
1732 (yyval.data) = data_merge((yyvsp[(1) - (5)].data), d);
1739 /* Line 1455 of yacc.c */
1740 #line 254 "dtc-parser.y"
1742 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1748 /* Line 1455 of yacc.c */
1749 #line 261 "dtc-parser.y"
1751 (yyval.data) = empty_data;
1757 /* Line 1455 of yacc.c */
1758 #line 265 "dtc-parser.y"
1760 (yyval.data) = (yyvsp[(1) - (2)].data);
1766 /* Line 1455 of yacc.c */
1767 #line 269 "dtc-parser.y"
1769 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1775 /* Line 1455 of yacc.c */
1776 #line 276 "dtc-parser.y"
1778 (yyval.array).data = empty_data;
1779 (yyval.array).bits = eval_literal((yyvsp[(2) - (3)].literal), 0, 7);
1781 if (((yyval.array).bits != 8) &&
1782 ((yyval.array).bits != 16) &&
1783 ((yyval.array).bits != 32) &&
1784 ((yyval.array).bits != 64))
1786 print_error("Only 8, 16, 32 and 64-bit elements"
1787 " are currently supported");
1788 (yyval.array).bits = 32;
1795 /* Line 1455 of yacc.c */
1796 #line 291 "dtc-parser.y"
1798 (yyval.array).data = empty_data;
1799 (yyval.array).bits = 32;
1805 /* Line 1455 of yacc.c */
1806 #line 296 "dtc-parser.y"
1808 if ((yyvsp[(1) - (2)].array).bits < 64) {
1809 uint64_t mask = (1ULL << (yyvsp[(1) - (2)].array).bits) - 1;
1811 * Bits above mask must either be all zero
1812 * (positive within range of mask) or all one
1813 * (negative and sign-extended). The second
1814 * condition is true if when we set all bits
1815 * within the mask to one (i.e. | in the
1816 * mask), all bits are one.
1818 if (((yyvsp[(2) - (2)].integer) > mask) && (((yyvsp[(2) - (2)].integer) | mask) != -1ULL))
1820 "integer value out of range "
1821 "%016lx (%d bits)", (yyvsp[(1) - (2)].array).bits);
1824 (yyval.array).data = data_append_integer((yyvsp[(1) - (2)].array).data, (yyvsp[(2) - (2)].integer), (yyvsp[(1) - (2)].array).bits);
1830 /* Line 1455 of yacc.c */
1831 #line 316 "dtc-parser.y"
1833 uint64_t val = ~0ULL >> (64 - (yyvsp[(1) - (2)].array).bits);
1835 if ((yyvsp[(1) - (2)].array).bits == 32)
1836 (yyvsp[(1) - (2)].array).data = data_add_marker((yyvsp[(1) - (2)].array).data,
1838 (yyvsp[(2) - (2)].labelref));
1840 print_error("References are only allowed in "
1841 "arrays with 32-bit elements.");
1843 (yyval.array).data = data_append_integer((yyvsp[(1) - (2)].array).data, val, (yyvsp[(1) - (2)].array).bits);
1849 /* Line 1455 of yacc.c */
1850 #line 330 "dtc-parser.y"
1852 (yyval.array).data = data_add_marker((yyvsp[(1) - (2)].array).data, LABEL, (yyvsp[(2) - (2)].labelref));
1858 /* Line 1455 of yacc.c */
1859 #line 337 "dtc-parser.y"
1861 (yyval.integer) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
1867 /* Line 1455 of yacc.c */
1868 #line 341 "dtc-parser.y"
1870 (yyval.integer) = eval_char_literal((yyvsp[(1) - (1)].literal));
1876 /* Line 1455 of yacc.c */
1877 #line 345 "dtc-parser.y"
1879 (yyval.integer) = (yyvsp[(2) - (3)].integer);
1885 /* Line 1455 of yacc.c */
1886 #line 356 "dtc-parser.y"
1887 { (yyval.integer) = (yyvsp[(1) - (5)].integer) ? (yyvsp[(3) - (5)].integer) : (yyvsp[(5) - (5)].integer); ;}
1892 /* Line 1455 of yacc.c */
1893 #line 361 "dtc-parser.y"
1894 { (yyval.integer) = (yyvsp[(1) - (3)].integer) || (yyvsp[(3) - (3)].integer); ;}
1899 /* Line 1455 of yacc.c */
1900 #line 366 "dtc-parser.y"
1901 { (yyval.integer) = (yyvsp[(1) - (3)].integer) && (yyvsp[(3) - (3)].integer); ;}
1906 /* Line 1455 of yacc.c */
1907 #line 371 "dtc-parser.y"
1908 { (yyval.integer) = (yyvsp[(1) - (3)].integer) | (yyvsp[(3) - (3)].integer); ;}
1913 /* Line 1455 of yacc.c */
1914 #line 376 "dtc-parser.y"
1915 { (yyval.integer) = (yyvsp[(1) - (3)].integer) ^ (yyvsp[(3) - (3)].integer); ;}
1920 /* Line 1455 of yacc.c */
1921 #line 381 "dtc-parser.y"
1922 { (yyval.integer) = (yyvsp[(1) - (3)].integer) & (yyvsp[(3) - (3)].integer); ;}
1927 /* Line 1455 of yacc.c */
1928 #line 386 "dtc-parser.y"
1929 { (yyval.integer) = (yyvsp[(1) - (3)].integer) == (yyvsp[(3) - (3)].integer); ;}
1934 /* Line 1455 of yacc.c */
1935 #line 387 "dtc-parser.y"
1936 { (yyval.integer) = (yyvsp[(1) - (3)].integer) != (yyvsp[(3) - (3)].integer); ;}
1941 /* Line 1455 of yacc.c */
1942 #line 392 "dtc-parser.y"
1943 { (yyval.integer) = (yyvsp[(1) - (3)].integer) < (yyvsp[(3) - (3)].integer); ;}
1948 /* Line 1455 of yacc.c */
1949 #line 393 "dtc-parser.y"
1950 { (yyval.integer) = (yyvsp[(1) - (3)].integer) > (yyvsp[(3) - (3)].integer); ;}
1955 /* Line 1455 of yacc.c */
1956 #line 394 "dtc-parser.y"
1957 { (yyval.integer) = (yyvsp[(1) - (3)].integer) <= (yyvsp[(3) - (3)].integer); ;}
1962 /* Line 1455 of yacc.c */
1963 #line 395 "dtc-parser.y"
1964 { (yyval.integer) = (yyvsp[(1) - (3)].integer) >= (yyvsp[(3) - (3)].integer); ;}
1969 /* Line 1455 of yacc.c */
1970 #line 399 "dtc-parser.y"
1971 { (yyval.integer) = (yyvsp[(1) - (3)].integer) << (yyvsp[(3) - (3)].integer); ;}
1976 /* Line 1455 of yacc.c */
1977 #line 400 "dtc-parser.y"
1978 { (yyval.integer) = (yyvsp[(1) - (3)].integer) >> (yyvsp[(3) - (3)].integer); ;}
1983 /* Line 1455 of yacc.c */
1984 #line 405 "dtc-parser.y"
1985 { (yyval.integer) = (yyvsp[(1) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;}
1990 /* Line 1455 of yacc.c */
1991 #line 406 "dtc-parser.y"
1992 { (yyval.integer) = (yyvsp[(1) - (3)].integer) - (yyvsp[(3) - (3)].integer); ;}
1997 /* Line 1455 of yacc.c */
1998 #line 411 "dtc-parser.y"
1999 { (yyval.integer) = (yyvsp[(1) - (3)].integer) * (yyvsp[(3) - (3)].integer); ;}
2004 /* Line 1455 of yacc.c */
2005 #line 412 "dtc-parser.y"
2006 { (yyval.integer) = (yyvsp[(1) - (3)].integer) / (yyvsp[(3) - (3)].integer); ;}
2011 /* Line 1455 of yacc.c */
2012 #line 413 "dtc-parser.y"
2013 { (yyval.integer) = (yyvsp[(1) - (3)].integer) % (yyvsp[(3) - (3)].integer); ;}
2018 /* Line 1455 of yacc.c */
2019 #line 419 "dtc-parser.y"
2020 { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;}
2025 /* Line 1455 of yacc.c */
2026 #line 420 "dtc-parser.y"
2027 { (yyval.integer) = ~(yyvsp[(2) - (2)].integer); ;}
2032 /* Line 1455 of yacc.c */
2033 #line 421 "dtc-parser.y"
2034 { (yyval.integer) = !(yyvsp[(2) - (2)].integer); ;}
2039 /* Line 1455 of yacc.c */
2040 #line 426 "dtc-parser.y"
2042 (yyval.data) = empty_data;
2048 /* Line 1455 of yacc.c */
2049 #line 430 "dtc-parser.y"
2051 (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
2057 /* Line 1455 of yacc.c */
2058 #line 434 "dtc-parser.y"
2060 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
2066 /* Line 1455 of yacc.c */
2067 #line 441 "dtc-parser.y"
2069 (yyval.nodelist) = NULL;
2075 /* Line 1455 of yacc.c */
2076 #line 445 "dtc-parser.y"
2078 (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
2084 /* Line 1455 of yacc.c */
2085 #line 449 "dtc-parser.y"
2087 print_error("syntax error: properties must precede subnodes");
2094 /* Line 1455 of yacc.c */
2095 #line 457 "dtc-parser.y"
2097 (yyval.node) = name_node((yyvsp[(2) - (2)].node), (yyvsp[(1) - (2)].propnodename));
2103 /* Line 1455 of yacc.c */
2104 #line 461 "dtc-parser.y"
2106 (yyval.node) = name_node(build_node_delete(), (yyvsp[(2) - (3)].propnodename));
2112 /* Line 1455 of yacc.c */
2113 #line 465 "dtc-parser.y"
2115 add_label(&(yyvsp[(2) - (2)].node)->labels, (yyvsp[(1) - (2)].labelref));
2116 (yyval.node) = (yyvsp[(2) - (2)].node);
2122 /* Line 1455 of yacc.c */
2123 #line 2124 "dtc-parser.tab.c"
2126 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2130 YY_STACK_PRINT (yyss, yyssp);
2134 /* Now `shift' the result of the reduction. Determine what state
2135 that goes to, based on the state we popped back to and the rule
2136 number reduced by. */
2140 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2141 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2142 yystate = yytable[yystate];
2144 yystate = yydefgoto[yyn - YYNTOKENS];
2149 /*------------------------------------.
2150 | yyerrlab -- here on detecting error |
2151 `------------------------------------*/
2153 /* If not already recovering from an error, report this error. */
2157 #if ! YYERROR_VERBOSE
2158 yyerror (YY_("syntax error"));
2161 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2162 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2164 YYSIZE_T yyalloc = 2 * yysize;
2165 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2166 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2167 if (yymsg != yymsgbuf)
2168 YYSTACK_FREE (yymsg);
2169 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2171 yymsg_alloc = yyalloc;
2175 yymsg_alloc = sizeof yymsgbuf;
2179 if (0 < yysize && yysize <= yymsg_alloc)
2181 (void) yysyntax_error (yymsg, yystate, yychar);
2186 yyerror (YY_("syntax error"));
2188 goto yyexhaustedlab;
2196 if (yyerrstatus == 3)
2198 /* If just tried and failed to reuse lookahead token after an
2199 error, discard it. */
2201 if (yychar <= YYEOF)
2203 /* Return failure if at end of input. */
2204 if (yychar == YYEOF)
2209 yydestruct ("Error: discarding",
2215 /* Else will try to reuse lookahead token after shifting the error
2220 /*---------------------------------------------------.
2221 | yyerrorlab -- error raised explicitly by YYERROR. |
2222 `---------------------------------------------------*/
2225 /* Pacify compilers like GCC when the user code never invokes
2226 YYERROR and the label yyerrorlab therefore never appears in user
2228 if (/*CONSTCOND*/ 0)
2231 /* Do not reclaim the symbols of the rule which action triggered
2235 YY_STACK_PRINT (yyss, yyssp);
2240 /*-------------------------------------------------------------.
2241 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2242 `-------------------------------------------------------------*/
2244 yyerrstatus = 3; /* Each real token shifted decrements this. */
2248 yyn = yypact[yystate];
2249 if (yyn != YYPACT_NINF)
2252 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2260 /* Pop the current state because it cannot handle the error token. */
2265 yydestruct ("Error: popping",
2266 yystos[yystate], yyvsp);
2269 YY_STACK_PRINT (yyss, yyssp);
2275 /* Shift the error token. */
2276 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2282 /*-------------------------------------.
2283 | yyacceptlab -- YYACCEPT comes here. |
2284 `-------------------------------------*/
2289 /*-----------------------------------.
2290 | yyabortlab -- YYABORT comes here. |
2291 `-----------------------------------*/
2296 #if !defined(yyoverflow) || YYERROR_VERBOSE
2297 /*-------------------------------------------------.
2298 | yyexhaustedlab -- memory exhaustion comes here. |
2299 `-------------------------------------------------*/
2301 yyerror (YY_("memory exhausted"));
2307 if (yychar != YYEMPTY)
2308 yydestruct ("Cleanup: discarding lookahead",
2310 /* Do not reclaim the symbols of the rule which action triggered
2311 this YYABORT or YYACCEPT. */
2313 YY_STACK_PRINT (yyss, yyssp);
2314 while (yyssp != yyss)
2316 yydestruct ("Cleanup: popping",
2317 yystos[*yyssp], yyvsp);
2322 YYSTACK_FREE (yyss);
2325 if (yymsg != yymsgbuf)
2326 YYSTACK_FREE (yymsg);
2328 /* Make sure YYID is used. */
2329 return YYID (yyresult);
2334 /* Line 1675 of yacc.c */
2335 #line 471 "dtc-parser.y"
2338 void print_error(char const *fmt, ...)
2343 srcpos_verror(&yylloc, fmt, va);
2346 treesource_error = 1;
2349 void yyerror(char const *s) {
2350 print_error("%s", s);
2353 static unsigned long long eval_literal(const char *s, int base, int bits)
2355 unsigned long long val;
2359 val = strtoull(s, &e, base);
2361 size_t uls = strspn(e, "UL");
2363 print_error("bad characters in literal");
2365 if ((errno == ERANGE)
2366 || ((bits < 64) && (val >= (1ULL << bits))))
2367 print_error("literal out of range");
2368 else if (errno != 0)
2369 print_error("bad literal");
2373 static unsigned char eval_char_literal(const char *s)
2380 print_error("empty character literal");
2385 * If the first character in the character literal is a \ then process
2386 * the remaining characters as an escape encoding. If the first
2387 * character is neither an escape or a terminator it should be the only
2388 * character in the literal and will be returned.
2391 c = get_escape_char(s, &i);
2394 print_error("malformed character literal");