1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 1
66 /* Put the tokens into the symbol table, so that GDB and other debuggers
71 DT_PROPNODENAME = 260,
73 DT_LEGACYLITERAL = 262,
84 #define DT_MEMRESERVE 259
85 #define DT_PROPNODENAME 260
86 #define DT_LITERAL 261
87 #define DT_LEGACYLITERAL 262
98 /* Copy the first part of user declarations. */
99 #line 23 "dtc-parser.y"
106 extern int yylex(void);
108 extern struct boot_info *the_boot_info;
109 extern int treesource_error;
111 static unsigned long long eval_literal(const char *s, int base, int bits);
114 /* Enabling traces. */
119 /* Enabling verbose error messages. */
120 #ifdef YYERROR_VERBOSE
121 # undef YYERROR_VERBOSE
122 # define YYERROR_VERBOSE 1
124 # define YYERROR_VERBOSE 0
127 /* Enabling the token table. */
128 #ifndef YYTOKEN_TABLE
129 # define YYTOKEN_TABLE 0
132 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
133 typedef union YYSTYPE
134 #line 37 "dtc-parser.y"
145 struct property *prop;
146 struct property *proplist;
148 struct node *nodelist;
149 struct reserve_info *re;
151 /* Line 187 of yacc.c. */
152 #line 153 "dtc-parser.tab.c"
154 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
155 # define YYSTYPE_IS_DECLARED 1
156 # define YYSTYPE_IS_TRIVIAL 1
159 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
160 typedef struct YYLTYPE
167 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
168 # define YYLTYPE_IS_DECLARED 1
169 # define YYLTYPE_IS_TRIVIAL 1
173 /* Copy the second part of user declarations. */
176 /* Line 216 of yacc.c. */
177 #line 178 "dtc-parser.tab.c"
184 typedef YYTYPE_UINT8 yytype_uint8;
186 typedef unsigned char yytype_uint8;
190 typedef YYTYPE_INT8 yytype_int8;
191 #elif (defined __STDC__ || defined __C99__FUNC__ \
192 || defined __cplusplus || defined _MSC_VER)
193 typedef signed char yytype_int8;
195 typedef short int yytype_int8;
199 typedef YYTYPE_UINT16 yytype_uint16;
201 typedef unsigned short int yytype_uint16;
205 typedef YYTYPE_INT16 yytype_int16;
207 typedef short int yytype_int16;
211 # ifdef __SIZE_TYPE__
212 # define YYSIZE_T __SIZE_TYPE__
213 # elif defined size_t
214 # define YYSIZE_T size_t
215 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
216 || defined __cplusplus || defined _MSC_VER)
217 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
218 # define YYSIZE_T size_t
220 # define YYSIZE_T unsigned int
224 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
229 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
230 # define YY_(msgid) dgettext ("bison-runtime", msgid)
234 # define YY_(msgid) msgid
238 /* Suppress unused-variable warnings by "using" E. */
239 #if ! defined lint || defined __GNUC__
240 # define YYUSE(e) ((void) (e))
242 # define YYUSE(e) /* empty */
245 /* Identity function, used to suppress warnings about constant conditions. */
249 #if (defined __STDC__ || defined __C99__FUNC__ \
250 || defined __cplusplus || defined _MSC_VER)
263 #if ! defined yyoverflow || YYERROR_VERBOSE
265 /* The parser invokes alloca or malloc; define the necessary symbols. */
267 # ifdef YYSTACK_USE_ALLOCA
268 # if YYSTACK_USE_ALLOCA
270 # define YYSTACK_ALLOC __builtin_alloca
271 # elif defined __BUILTIN_VA_ARG_INCR
272 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
274 # define YYSTACK_ALLOC __alloca
275 # elif defined _MSC_VER
276 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
277 # define alloca _alloca
279 # define YYSTACK_ALLOC alloca
280 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
281 || defined __cplusplus || defined _MSC_VER)
282 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
291 # ifdef YYSTACK_ALLOC
292 /* Pacify GCC's `empty if-body' warning. */
293 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
294 # ifndef YYSTACK_ALLOC_MAXIMUM
295 /* The OS might guarantee only one guard page at the bottom of the stack,
296 and a page size can be as small as 4096 bytes. So we cannot safely
297 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
298 to allow for a few compiler-allocated temporary stack slots. */
299 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
302 # define YYSTACK_ALLOC YYMALLOC
303 # define YYSTACK_FREE YYFREE
304 # ifndef YYSTACK_ALLOC_MAXIMUM
305 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
307 # if (defined __cplusplus && ! defined _STDLIB_H \
308 && ! ((defined YYMALLOC || defined malloc) \
309 && (defined YYFREE || defined free)))
310 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
316 # define YYMALLOC malloc
317 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
318 || defined __cplusplus || defined _MSC_VER)
319 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
324 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
325 || defined __cplusplus || defined _MSC_VER)
326 void free (void *); /* INFRINGES ON USER NAME SPACE */
330 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
333 #if (! defined yyoverflow \
334 && (! defined __cplusplus \
335 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
336 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
338 /* A type that is properly aligned for any stack member. */
346 /* The size of the maximum gap between one aligned stack and the next. */
347 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
349 /* The size of an array large to enough to hold all stacks, each with
351 # define YYSTACK_BYTES(N) \
352 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
353 + 2 * YYSTACK_GAP_MAXIMUM)
355 /* Copy COUNT objects from FROM to TO. The source and destination do
358 # if defined __GNUC__ && 1 < __GNUC__
359 # define YYCOPY(To, From, Count) \
360 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
362 # define YYCOPY(To, From, Count) \
366 for (yyi = 0; yyi < (Count); yyi++) \
367 (To)[yyi] = (From)[yyi]; \
373 /* Relocate STACK from its old location to the new one. The
374 local variables YYSIZE and YYSTACKSIZE give the old and new number of
375 elements in the stack, and YYPTR gives the new location of the
376 stack. Advance YYPTR to a properly aligned location for the next
378 # define YYSTACK_RELOCATE(Stack) \
381 YYSIZE_T yynewbytes; \
382 YYCOPY (&yyptr->Stack, Stack, yysize); \
383 Stack = &yyptr->Stack; \
384 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
385 yyptr += yynewbytes / sizeof (*yyptr); \
391 /* YYFINAL -- State number of the termination state. */
393 /* YYLAST -- Last index in YYTABLE. */
396 /* YYNTOKENS -- Number of terminals. */
398 /* YYNNTS -- Number of nonterminals. */
400 /* YYNRULES -- Number of rules. */
402 /* YYNRULES -- Number of states. */
405 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
407 #define YYMAXUTOK 268
409 #define YYTRANSLATE(YYX) \
410 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
412 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
413 static const yytype_uint8 yytranslate[] =
415 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
416 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
417 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
418 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
419 24, 26, 2, 2, 25, 15, 2, 16, 2, 2,
420 2, 2, 2, 2, 2, 2, 2, 2, 2, 14,
421 20, 19, 21, 2, 2, 2, 2, 2, 2, 2,
422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 2, 22, 2, 23, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 17, 2, 18, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429 2, 2, 2, 2, 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, 2, 2, 2, 2, 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, 2, 2, 2, 2, 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, 1, 2, 3, 4,
441 5, 6, 7, 8, 9, 10, 11, 12, 13
445 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
447 static const yytype_uint8 yyprhs[] =
449 0, 0, 3, 8, 11, 12, 15, 21, 22, 25,
450 27, 34, 36, 38, 41, 47, 48, 51, 57, 61,
451 64, 69, 74, 77, 87, 93, 96, 97, 100, 103,
452 104, 107, 110, 113, 114, 116, 118, 121, 122, 125,
453 128, 129, 132, 135, 139, 140
456 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
457 static const yytype_int8 yyrhs[] =
459 28, 0, -1, 3, 14, 29, 34, -1, 31, 34,
460 -1, -1, 30, 29, -1, 46, 4, 33, 33, 14,
461 -1, -1, 32, 31, -1, 30, -1, 46, 4, 33,
462 15, 33, 14, -1, 6, -1, 7, -1, 16, 35,
463 -1, 17, 36, 44, 18, 14, -1, -1, 36, 37,
464 -1, 46, 5, 19, 38, 14, -1, 46, 5, 14,
465 -1, 39, 10, -1, 39, 20, 40, 21, -1, 39,
466 22, 43, 23, -1, 39, 12, -1, 39, 13, 24,
467 10, 25, 33, 25, 33, 26, -1, 39, 13, 24,
468 10, 26, -1, 38, 11, -1, -1, 38, 25, -1,
469 39, 11, -1, -1, 40, 42, -1, 40, 12, -1,
470 40, 11, -1, -1, 8, -1, 6, -1, 41, 7,
471 -1, -1, 43, 9, -1, 43, 11, -1, -1, 45,
472 44, -1, 45, 37, -1, 46, 5, 35, -1, -1,
476 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
477 static const yytype_uint16 yyrline[] =
479 0, 89, 89, 93, 101, 104, 111, 119, 122, 129,
480 133, 140, 144, 151, 158, 166, 169, 176, 180, 187,
481 191, 195, 199, 203, 220, 231, 239, 242, 246, 254,
482 257, 261, 266, 274, 277, 281, 285, 293, 296, 300,
483 308, 311, 315, 323, 331, 334
487 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
488 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
489 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
490 static const char *const yytname[] =
492 "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE",
493 "DT_PROPNODENAME", "DT_LITERAL", "DT_LEGACYLITERAL", "DT_BASE",
494 "DT_BYTE", "DT_STRING", "DT_LABEL", "DT_REF", "DT_INCBIN", "';'", "'-'",
495 "'/'", "'{'", "'}'", "'='", "'<'", "'>'", "'['", "']'", "'('", "','",
496 "')'", "$accept", "sourcefile", "memreserves", "memreserve",
497 "v0_memreserves", "v0_memreserve", "addr", "devicetree", "nodedef",
498 "proplist", "propdef", "propdata", "propdataprefix", "celllist",
499 "cellbase", "cellval", "bytestring", "subnodes", "subnode", "label", 0
504 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
506 static const yytype_uint16 yytoknum[] =
508 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
509 265, 266, 267, 268, 59, 45, 47, 123, 125, 61,
510 60, 62, 91, 93, 40, 44, 41
514 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
515 static const yytype_uint8 yyr1[] =
517 0, 27, 28, 28, 29, 29, 30, 31, 31, 32,
518 32, 33, 33, 34, 35, 36, 36, 37, 37, 38,
519 38, 38, 38, 38, 38, 38, 39, 39, 39, 40,
520 40, 40, 40, 41, 41, 42, 42, 43, 43, 43,
521 44, 44, 44, 45, 46, 46
524 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
525 static const yytype_uint8 yyr2[] =
527 0, 2, 4, 2, 0, 2, 5, 0, 2, 1,
528 6, 1, 1, 2, 5, 0, 2, 5, 3, 2,
529 4, 4, 2, 9, 5, 2, 0, 2, 2, 0,
530 2, 2, 2, 0, 1, 1, 2, 0, 2, 2,
534 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
535 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
536 means the default is an error. */
537 static const yytype_uint8 yydefact[] =
539 7, 0, 45, 0, 9, 0, 7, 0, 4, 1,
540 0, 3, 8, 0, 0, 4, 0, 15, 13, 11,
541 12, 0, 2, 5, 0, 40, 0, 0, 0, 16,
542 0, 40, 0, 0, 6, 0, 42, 41, 0, 10,
543 14, 18, 26, 43, 0, 0, 25, 17, 27, 19,
544 28, 22, 0, 29, 37, 0, 33, 0, 0, 35,
545 34, 32, 31, 20, 0, 30, 38, 39, 21, 0,
549 /* YYDEFGOTO[NTERM-NUM]. */
550 static const yytype_int8 yydefgoto[] =
552 -1, 3, 14, 4, 5, 6, 27, 11, 18, 25,
553 29, 44, 45, 56, 64, 65, 57, 30, 31, 7
556 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
558 #define YYPACT_NINF -14
559 static const yytype_int8 yypact[] =
561 30, -11, -14, 7, -14, -1, 27, 13, 27, -14,
562 8, -14, -14, 40, -1, 27, 35, -14, -14, -14,
563 -14, 21, -14, -14, 40, 24, 40, 28, 40, -14,
564 32, 24, 46, 38, -14, 39, -14, -14, 26, -14,
565 -14, -14, -14, -14, -9, 10, -14, -14, -14, -14,
566 -14, -14, 31, -14, -14, 44, -2, 3, 23, -14,
567 -14, -14, -14, -14, 50, -14, -14, -14, -14, 40,
568 -14, -14, 33, 40, 36, -14
571 /* YYPGOTO[NTERM-NUM]. */
572 static const yytype_int8 yypgoto[] =
574 -14, -14, 48, 29, 53, -14, -13, 47, 34, -14,
575 37, -14, -14, -14, -14, -14, -14, 42, -14, -7
578 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
579 positive, shift that token. If negative, reduce the rule which
580 number is the opposite. If zero, do what YYDEFACT says.
581 If YYTABLE_NINF, syntax error. */
582 #define YYTABLE_NINF -45
583 static const yytype_int8 yytable[] =
585 21, 16, 46, 8, 59, 47, 60, 9, 16, 61,
586 62, 28, 66, 33, 67, 10, 48, 13, 32, 63,
587 49, 50, 51, 52, 32, 17, 68, 19, 20, -44,
588 53, -44, 54, 1, -44, 2, 26, 15, 2, 24,
589 41, 2, 34, 17, 15, 42, 19, 20, 69, 70,
590 35, 38, 39, 40, 58, 55, 72, 71, 73, 12,
591 74, 22, 75, 23, 0, 0, 0, 0, 36, 0,
595 static const yytype_int8 yycheck[] =
597 13, 8, 11, 14, 6, 14, 8, 0, 15, 11,
598 12, 24, 9, 26, 11, 16, 25, 4, 25, 21,
599 10, 11, 12, 13, 31, 17, 23, 6, 7, 5,
600 20, 4, 22, 3, 4, 11, 15, 8, 11, 4,
601 14, 11, 14, 17, 15, 19, 6, 7, 25, 26,
602 18, 5, 14, 14, 10, 24, 69, 7, 25, 6,
603 73, 14, 26, 15, -1, -1, -1, -1, 31, -1,
607 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
608 symbol of state STATE-NUM. */
609 static const yytype_uint8 yystos[] =
611 0, 3, 11, 28, 30, 31, 32, 46, 14, 0,
612 16, 34, 31, 4, 29, 30, 46, 17, 35, 6,
613 7, 33, 34, 29, 4, 36, 15, 33, 33, 37,
614 44, 45, 46, 33, 14, 18, 37, 44, 5, 14,
615 14, 14, 19, 35, 38, 39, 11, 14, 25, 10,
616 11, 12, 13, 20, 22, 24, 40, 43, 10, 6,
617 8, 11, 12, 21, 41, 42, 9, 11, 23, 25,
618 26, 7, 33, 25, 33, 26
621 #define yyerrok (yyerrstatus = 0)
622 #define yyclearin (yychar = YYEMPTY)
626 #define YYACCEPT goto yyacceptlab
627 #define YYABORT goto yyabortlab
628 #define YYERROR goto yyerrorlab
631 /* Like YYERROR except do call yyerror. This remains here temporarily
632 to ease the transition to the new meaning of YYERROR, for GCC.
633 Once GCC version 2 has supplanted version 1, this can go. */
635 #define YYFAIL goto yyerrlab
637 #define YYRECOVERING() (!!yyerrstatus)
639 #define YYBACKUP(Token, Value) \
641 if (yychar == YYEMPTY && yylen == 1) \
645 yytoken = YYTRANSLATE (yychar); \
651 yyerror (YY_("syntax error: cannot back up")); \
658 #define YYERRCODE 256
661 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
662 If N is 0, then set CURRENT to the empty location which ends
663 the previous symbol: RHS[0] (always defined). */
665 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
666 #ifndef YYLLOC_DEFAULT
667 # define YYLLOC_DEFAULT(Current, Rhs, N) \
671 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
672 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
673 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
674 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
678 (Current).first_line = (Current).last_line = \
679 YYRHSLOC (Rhs, 0).last_line; \
680 (Current).first_column = (Current).last_column = \
681 YYRHSLOC (Rhs, 0).last_column; \
687 /* YY_LOCATION_PRINT -- Print the location on the stream.
688 This macro was not mandated originally: define only if we know
689 we won't break user code: when these are the locations we know. */
691 #ifndef YY_LOCATION_PRINT
692 # if YYLTYPE_IS_TRIVIAL
693 # define YY_LOCATION_PRINT(File, Loc) \
694 fprintf (File, "%d.%d-%d.%d", \
695 (Loc).first_line, (Loc).first_column, \
696 (Loc).last_line, (Loc).last_column)
698 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
703 /* YYLEX -- calling `yylex' with the right arguments. */
706 # define YYLEX yylex (YYLEX_PARAM)
708 # define YYLEX yylex ()
711 /* Enable debugging if requested. */
715 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
716 # define YYFPRINTF fprintf
719 # define YYDPRINTF(Args) \
725 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
729 YYFPRINTF (stderr, "%s ", Title); \
730 yy_symbol_print (stderr, \
731 Type, Value, Location); \
732 YYFPRINTF (stderr, "\n"); \
737 /*--------------------------------.
738 | Print this symbol on YYOUTPUT. |
739 `--------------------------------*/
742 #if (defined __STDC__ || defined __C99__FUNC__ \
743 || defined __cplusplus || defined _MSC_VER)
745 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
748 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
751 YYSTYPE const * const yyvaluep;
752 YYLTYPE const * const yylocationp;
759 if (yytype < YYNTOKENS)
760 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
772 /*--------------------------------.
773 | Print this symbol on YYOUTPUT. |
774 `--------------------------------*/
776 #if (defined __STDC__ || defined __C99__FUNC__ \
777 || defined __cplusplus || defined _MSC_VER)
779 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
782 yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
785 YYSTYPE const * const yyvaluep;
786 YYLTYPE const * const yylocationp;
789 if (yytype < YYNTOKENS)
790 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
792 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
794 YY_LOCATION_PRINT (yyoutput, *yylocationp);
795 YYFPRINTF (yyoutput, ": ");
796 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
797 YYFPRINTF (yyoutput, ")");
800 /*------------------------------------------------------------------.
801 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
803 `------------------------------------------------------------------*/
805 #if (defined __STDC__ || defined __C99__FUNC__ \
806 || defined __cplusplus || defined _MSC_VER)
808 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
811 yy_stack_print (bottom, top)
812 yytype_int16 *bottom;
816 YYFPRINTF (stderr, "Stack now");
817 for (; bottom <= top; ++bottom)
818 YYFPRINTF (stderr, " %d", *bottom);
819 YYFPRINTF (stderr, "\n");
822 # define YY_STACK_PRINT(Bottom, Top) \
825 yy_stack_print ((Bottom), (Top)); \
829 /*------------------------------------------------.
830 | Report that the YYRULE is going to be reduced. |
831 `------------------------------------------------*/
833 #if (defined __STDC__ || defined __C99__FUNC__ \
834 || defined __cplusplus || defined _MSC_VER)
836 yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
839 yy_reduce_print (yyvsp, yylsp, yyrule)
845 int yynrhs = yyr2[yyrule];
847 unsigned long int yylno = yyrline[yyrule];
848 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
850 /* The symbols being reduced. */
851 for (yyi = 0; yyi < yynrhs; yyi++)
853 fprintf (stderr, " $%d = ", yyi + 1);
854 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
855 &(yyvsp[(yyi + 1) - (yynrhs)])
856 , &(yylsp[(yyi + 1) - (yynrhs)]) );
857 fprintf (stderr, "\n");
861 # define YY_REDUCE_PRINT(Rule) \
864 yy_reduce_print (yyvsp, yylsp, Rule); \
867 /* Nonzero means print parse trace. It is left uninitialized so that
868 multiple parsers can coexist. */
871 # define YYDPRINTF(Args)
872 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
873 # define YY_STACK_PRINT(Bottom, Top)
874 # define YY_REDUCE_PRINT(Rule)
875 #endif /* !YYDEBUG */
878 /* YYINITDEPTH -- initial size of the parser's stacks. */
880 # define YYINITDEPTH 200
883 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
884 if the built-in stack extension method is used).
886 Do not make this value too large; the results are undefined if
887 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
888 evaluated with infinite-precision integer arithmetic. */
891 # define YYMAXDEPTH 10000
899 # if defined __GLIBC__ && defined _STRING_H
900 # define yystrlen strlen
902 /* Return the length of YYSTR. */
903 #if (defined __STDC__ || defined __C99__FUNC__ \
904 || defined __cplusplus || defined _MSC_VER)
906 yystrlen (const char *yystr)
914 for (yylen = 0; yystr[yylen]; yylen++)
922 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
923 # define yystpcpy stpcpy
925 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
927 #if (defined __STDC__ || defined __C99__FUNC__ \
928 || defined __cplusplus || defined _MSC_VER)
930 yystpcpy (char *yydest, const char *yysrc)
933 yystpcpy (yydest, yysrc)
939 const char *yys = yysrc;
941 while ((*yyd++ = *yys++) != '\0')
950 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
951 quotes and backslashes, so that it's suitable for yyerror. The
952 heuristic is that double-quoting is unnecessary unless the string
953 contains an apostrophe, a comma, or backslash (other than
954 backslash-backslash). YYSTR is taken from yytname. If YYRES is
955 null, do not copy; instead, return the length of what the result
958 yytnamerr (char *yyres, const char *yystr)
963 char const *yyp = yystr;
970 goto do_not_strip_quotes;
974 goto do_not_strip_quotes;
987 do_not_strip_quotes: ;
991 return yystrlen (yystr);
993 return yystpcpy (yyres, yystr) - yyres;
997 /* Copy into YYRESULT an error message about the unexpected token
998 YYCHAR while in state YYSTATE. Return the number of bytes copied,
999 including the terminating null byte. If YYRESULT is null, do not
1000 copy anything; just return the number of bytes that would be
1001 copied. As a special case, return 0 if an ordinary "syntax error"
1002 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1003 size calculation. */
1005 yysyntax_error (char *yyresult, int yystate, int yychar)
1007 int yyn = yypact[yystate];
1009 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1013 int yytype = YYTRANSLATE (yychar);
1014 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1015 YYSIZE_T yysize = yysize0;
1017 int yysize_overflow = 0;
1018 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1019 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1023 /* This is so xgettext sees the translatable formats that are
1024 constructed on the fly. */
1025 YY_("syntax error, unexpected %s");
1026 YY_("syntax error, unexpected %s, expecting %s");
1027 YY_("syntax error, unexpected %s, expecting %s or %s");
1028 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1029 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1033 static char const yyunexpected[] = "syntax error, unexpected %s";
1034 static char const yyexpecting[] = ", expecting %s";
1035 static char const yyor[] = " or %s";
1036 char yyformat[sizeof yyunexpected
1037 + sizeof yyexpecting - 1
1038 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1039 * (sizeof yyor - 1))];
1040 char const *yyprefix = yyexpecting;
1042 /* Start YYX at -YYN if negative to avoid negative indexes in
1044 int yyxbegin = yyn < 0 ? -yyn : 0;
1046 /* Stay within bounds of both yycheck and yytname. */
1047 int yychecklim = YYLAST - yyn + 1;
1048 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1051 yyarg[0] = yytname[yytype];
1052 yyfmt = yystpcpy (yyformat, yyunexpected);
1054 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1055 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1057 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1061 yyformat[sizeof yyunexpected - 1] = '\0';
1064 yyarg[yycount++] = yytname[yyx];
1065 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1066 yysize_overflow |= (yysize1 < yysize);
1068 yyfmt = yystpcpy (yyfmt, yyprefix);
1072 yyf = YY_(yyformat);
1073 yysize1 = yysize + yystrlen (yyf);
1074 yysize_overflow |= (yysize1 < yysize);
1077 if (yysize_overflow)
1078 return YYSIZE_MAXIMUM;
1082 /* Avoid sprintf, as that infringes on the user's name space.
1083 Don't have undefined behavior even if the translation
1084 produced a string with the wrong number of "%s"s. */
1085 char *yyp = yyresult;
1087 while ((*yyp = *yyf) != '\0')
1089 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1091 yyp += yytnamerr (yyp, yyarg[yyi++]);
1104 #endif /* YYERROR_VERBOSE */
1107 /*-----------------------------------------------.
1108 | Release the memory associated to this symbol. |
1109 `-----------------------------------------------*/
1112 #if (defined __STDC__ || defined __C99__FUNC__ \
1113 || defined __cplusplus || defined _MSC_VER)
1115 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
1118 yydestruct (yymsg, yytype, yyvaluep, yylocationp)
1122 YYLTYPE *yylocationp;
1126 YYUSE (yylocationp);
1130 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1141 /* Prevent warnings from -Wmissing-prototypes. */
1143 #ifdef YYPARSE_PARAM
1144 #if defined __STDC__ || defined __cplusplus
1145 int yyparse (void *YYPARSE_PARAM);
1149 #else /* ! YYPARSE_PARAM */
1150 #if defined __STDC__ || defined __cplusplus
1155 #endif /* ! YYPARSE_PARAM */
1159 /* The look-ahead symbol. */
1162 /* The semantic value of the look-ahead symbol. */
1165 /* Number of syntax errors so far. */
1167 /* Location data for the look-ahead symbol. */
1176 #ifdef YYPARSE_PARAM
1177 #if (defined __STDC__ || defined __C99__FUNC__ \
1178 || defined __cplusplus || defined _MSC_VER)
1180 yyparse (void *YYPARSE_PARAM)
1183 yyparse (YYPARSE_PARAM)
1184 void *YYPARSE_PARAM;
1186 #else /* ! YYPARSE_PARAM */
1187 #if (defined __STDC__ || defined __C99__FUNC__ \
1188 || defined __cplusplus || defined _MSC_VER)
1202 /* Number of tokens to shift before error messages enabled. */
1204 /* Look-ahead token as an internal (translated) token number. */
1207 /* Buffer for error messages, and its allocated size. */
1209 char *yymsg = yymsgbuf;
1210 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1213 /* Three stacks and their tools:
1214 `yyss': related to states,
1215 `yyvs': related to semantic values,
1216 `yyls': related to locations.
1218 Refer to the stacks thru separate pointers, to allow yyoverflow
1219 to reallocate them elsewhere. */
1221 /* The state stack. */
1222 yytype_int16 yyssa[YYINITDEPTH];
1223 yytype_int16 *yyss = yyssa;
1224 yytype_int16 *yyssp;
1226 /* The semantic value stack. */
1227 YYSTYPE yyvsa[YYINITDEPTH];
1228 YYSTYPE *yyvs = yyvsa;
1231 /* The location stack. */
1232 YYLTYPE yylsa[YYINITDEPTH];
1233 YYLTYPE *yyls = yylsa;
1235 /* The locations where the error started and ended. */
1236 YYLTYPE yyerror_range[2];
1238 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1240 YYSIZE_T yystacksize = YYINITDEPTH;
1242 /* The variables used to return semantic value and location from the
1247 /* The number of symbols on the RHS of the reduced rule.
1248 Keep to zero when no symbol should be popped. */
1251 YYDPRINTF ((stderr, "Starting parse\n"));
1256 yychar = YYEMPTY; /* Cause a token to be read. */
1258 /* Initialize stack pointers.
1259 Waste one element of value and location stack
1260 so that they stay on the same level as the state stack.
1261 The wasted elements are never initialized. */
1266 #if YYLTYPE_IS_TRIVIAL
1267 /* Initialize the default location before parsing starts. */
1268 yylloc.first_line = yylloc.last_line = 1;
1269 yylloc.first_column = yylloc.last_column = 0;
1274 /*------------------------------------------------------------.
1275 | yynewstate -- Push a new state, which is found in yystate. |
1276 `------------------------------------------------------------*/
1278 /* In all cases, when you get here, the value and location stacks
1279 have just been pushed. So pushing a state here evens the stacks. */
1285 if (yyss + yystacksize - 1 <= yyssp)
1287 /* Get the current used size of the three stacks, in elements. */
1288 YYSIZE_T yysize = yyssp - yyss + 1;
1292 /* Give user a chance to reallocate the stack. Use copies of
1293 these so that the &'s don't force the real ones into
1295 YYSTYPE *yyvs1 = yyvs;
1296 yytype_int16 *yyss1 = yyss;
1297 YYLTYPE *yyls1 = yyls;
1299 /* Each stack pointer address is followed by the size of the
1300 data in use in that stack, in bytes. This used to be a
1301 conditional around just the two extra args, but that might
1302 be undefined if yyoverflow is a macro. */
1303 yyoverflow (YY_("memory exhausted"),
1304 &yyss1, yysize * sizeof (*yyssp),
1305 &yyvs1, yysize * sizeof (*yyvsp),
1306 &yyls1, yysize * sizeof (*yylsp),
1312 #else /* no yyoverflow */
1313 # ifndef YYSTACK_RELOCATE
1314 goto yyexhaustedlab;
1316 /* Extend the stack our own way. */
1317 if (YYMAXDEPTH <= yystacksize)
1318 goto yyexhaustedlab;
1320 if (YYMAXDEPTH < yystacksize)
1321 yystacksize = YYMAXDEPTH;
1324 yytype_int16 *yyss1 = yyss;
1325 union yyalloc *yyptr =
1326 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1328 goto yyexhaustedlab;
1329 YYSTACK_RELOCATE (yyss);
1330 YYSTACK_RELOCATE (yyvs);
1331 YYSTACK_RELOCATE (yyls);
1332 # undef YYSTACK_RELOCATE
1334 YYSTACK_FREE (yyss1);
1337 #endif /* no yyoverflow */
1339 yyssp = yyss + yysize - 1;
1340 yyvsp = yyvs + yysize - 1;
1341 yylsp = yyls + yysize - 1;
1343 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1344 (unsigned long int) yystacksize));
1346 if (yyss + yystacksize - 1 <= yyssp)
1350 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1359 /* Do appropriate processing given the current state. Read a
1360 look-ahead token if we need one and don't already have one. */
1362 /* First try to decide what to do without reference to look-ahead token. */
1363 yyn = yypact[yystate];
1364 if (yyn == YYPACT_NINF)
1367 /* Not known => get a look-ahead token if don't already have one. */
1369 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1370 if (yychar == YYEMPTY)
1372 YYDPRINTF ((stderr, "Reading a token: "));
1376 if (yychar <= YYEOF)
1378 yychar = yytoken = YYEOF;
1379 YYDPRINTF ((stderr, "Now at end of input.\n"));
1383 yytoken = YYTRANSLATE (yychar);
1384 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1387 /* If the proper action on seeing token YYTOKEN is to reduce or to
1388 detect an error, take that action. */
1390 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1395 if (yyn == 0 || yyn == YYTABLE_NINF)
1404 /* Count tokens shifted since error; after three, turn off error
1409 /* Shift the look-ahead token. */
1410 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1412 /* Discard the shifted token unless it is eof. */
1413 if (yychar != YYEOF)
1422 /*-----------------------------------------------------------.
1423 | yydefault -- do the default action for the current state. |
1424 `-----------------------------------------------------------*/
1426 yyn = yydefact[yystate];
1432 /*-----------------------------.
1433 | yyreduce -- Do a reduction. |
1434 `-----------------------------*/
1436 /* yyn is the number of a rule to reduce with. */
1439 /* If YYLEN is nonzero, implement the default value of the action:
1442 Otherwise, the following line sets YYVAL to garbage.
1443 This behavior is undocumented and Bison
1444 users should not rely upon it. Assigning to YYVAL
1445 unconditionally makes the parser a bit smaller, and it avoids a
1446 GCC warning that YYVAL may be used uninitialized. */
1447 yyval = yyvsp[1-yylen];
1449 /* Default location. */
1450 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1451 YY_REDUCE_PRINT (yyn);
1455 #line 90 "dtc-parser.y"
1457 the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node), 0);
1462 #line 94 "dtc-parser.y"
1464 the_boot_info = build_boot_info((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].node), 0);
1469 #line 101 "dtc-parser.y"
1476 #line 105 "dtc-parser.y"
1478 (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
1483 #line 112 "dtc-parser.y"
1485 (yyval.re) = build_reserve_entry((yyvsp[(3) - (5)].addr), (yyvsp[(4) - (5)].addr), (yyvsp[(1) - (5)].labelref));
1490 #line 119 "dtc-parser.y"
1497 #line 123 "dtc-parser.y"
1499 (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
1504 #line 130 "dtc-parser.y"
1506 (yyval.re) = (yyvsp[(1) - (1)].re);
1511 #line 134 "dtc-parser.y"
1513 (yyval.re) = build_reserve_entry((yyvsp[(3) - (6)].addr), (yyvsp[(5) - (6)].addr) - (yyvsp[(3) - (6)].addr) + 1, (yyvsp[(1) - (6)].labelref));
1518 #line 141 "dtc-parser.y"
1520 (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
1525 #line 145 "dtc-parser.y"
1527 (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 16, 64);
1532 #line 152 "dtc-parser.y"
1534 (yyval.node) = name_node((yyvsp[(2) - (2)].node), "", NULL);
1539 #line 159 "dtc-parser.y"
1541 (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
1546 #line 166 "dtc-parser.y"
1548 (yyval.proplist) = NULL;
1553 #line 170 "dtc-parser.y"
1555 (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
1560 #line 177 "dtc-parser.y"
1562 (yyval.prop) = build_property((yyvsp[(2) - (5)].propnodename), (yyvsp[(4) - (5)].data), (yyvsp[(1) - (5)].labelref));
1567 #line 181 "dtc-parser.y"
1569 (yyval.prop) = build_property((yyvsp[(2) - (3)].propnodename), empty_data, (yyvsp[(1) - (3)].labelref));
1574 #line 188 "dtc-parser.y"
1576 (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
1581 #line 192 "dtc-parser.y"
1583 (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
1588 #line 196 "dtc-parser.y"
1590 (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
1595 #line 200 "dtc-parser.y"
1597 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
1602 #line 204 "dtc-parser.y"
1604 struct search_path path = { srcpos_file->dir, NULL, NULL };
1605 struct dtc_file *file = dtc_open_file((yyvsp[(4) - (9)].data).val, &path);
1606 struct data d = empty_data;
1608 if ((yyvsp[(6) - (9)].addr) != 0)
1609 if (fseek(file->file, (yyvsp[(6) - (9)].addr), SEEK_SET) != 0)
1610 yyerrorf("Couldn't seek to offset %llu in \"%s\": %s",
1611 (unsigned long long)(yyvsp[(6) - (9)].addr),
1612 (yyvsp[(4) - (9)].data).val, strerror(errno));
1614 d = data_copy_file(file->file, (yyvsp[(8) - (9)].addr));
1616 (yyval.data) = data_merge((yyvsp[(1) - (9)].data), d);
1617 dtc_close_file(file);
1622 #line 221 "dtc-parser.y"
1624 struct search_path path = { srcpos_file->dir, NULL, NULL };
1625 struct dtc_file *file = dtc_open_file((yyvsp[(4) - (5)].data).val, &path);
1626 struct data d = empty_data;
1628 d = data_copy_file(file->file, -1);
1630 (yyval.data) = data_merge((yyvsp[(1) - (5)].data), d);
1631 dtc_close_file(file);
1636 #line 232 "dtc-parser.y"
1638 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1643 #line 239 "dtc-parser.y"
1645 (yyval.data) = empty_data;
1650 #line 243 "dtc-parser.y"
1652 (yyval.data) = (yyvsp[(1) - (2)].data);
1657 #line 247 "dtc-parser.y"
1659 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1664 #line 254 "dtc-parser.y"
1666 (yyval.data) = empty_data;
1671 #line 258 "dtc-parser.y"
1673 (yyval.data) = data_append_cell((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].cell));
1678 #line 262 "dtc-parser.y"
1680 (yyval.data) = data_append_cell(data_add_marker((yyvsp[(1) - (2)].data), REF_PHANDLE,
1681 (yyvsp[(2) - (2)].labelref)), -1);
1686 #line 267 "dtc-parser.y"
1688 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1693 #line 274 "dtc-parser.y"
1700 #line 282 "dtc-parser.y"
1702 (yyval.cell) = eval_literal((yyvsp[(1) - (1)].literal), 0, 32);
1707 #line 286 "dtc-parser.y"
1709 (yyval.cell) = eval_literal((yyvsp[(2) - (2)].literal), (yyvsp[(1) - (2)].cbase), 32);
1714 #line 293 "dtc-parser.y"
1716 (yyval.data) = empty_data;
1721 #line 297 "dtc-parser.y"
1723 (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
1728 #line 301 "dtc-parser.y"
1730 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1735 #line 308 "dtc-parser.y"
1737 (yyval.nodelist) = NULL;
1742 #line 312 "dtc-parser.y"
1744 (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
1749 #line 316 "dtc-parser.y"
1751 yyerror("syntax error: properties must precede subnodes");
1757 #line 324 "dtc-parser.y"
1759 (yyval.node) = name_node((yyvsp[(3) - (3)].node), (yyvsp[(2) - (3)].propnodename), (yyvsp[(1) - (3)].labelref));
1764 #line 331 "dtc-parser.y"
1766 (yyval.labelref) = NULL;
1771 #line 335 "dtc-parser.y"
1773 (yyval.labelref) = (yyvsp[(1) - (1)].labelref);
1778 /* Line 1267 of yacc.c. */
1779 #line 1780 "dtc-parser.tab.c"
1782 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1786 YY_STACK_PRINT (yyss, yyssp);
1791 /* Now `shift' the result of the reduction. Determine what state
1792 that goes to, based on the state we popped back to and the rule
1793 number reduced by. */
1797 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1798 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1799 yystate = yytable[yystate];
1801 yystate = yydefgoto[yyn - YYNTOKENS];
1806 /*------------------------------------.
1807 | yyerrlab -- here on detecting error |
1808 `------------------------------------*/
1810 /* If not already recovering from an error, report this error. */
1814 #if ! YYERROR_VERBOSE
1815 yyerror (YY_("syntax error"));
1818 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1819 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1821 YYSIZE_T yyalloc = 2 * yysize;
1822 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1823 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1824 if (yymsg != yymsgbuf)
1825 YYSTACK_FREE (yymsg);
1826 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1828 yymsg_alloc = yyalloc;
1832 yymsg_alloc = sizeof yymsgbuf;
1836 if (0 < yysize && yysize <= yymsg_alloc)
1838 (void) yysyntax_error (yymsg, yystate, yychar);
1843 yyerror (YY_("syntax error"));
1845 goto yyexhaustedlab;
1851 yyerror_range[0] = yylloc;
1853 if (yyerrstatus == 3)
1855 /* If just tried and failed to reuse look-ahead token after an
1856 error, discard it. */
1858 if (yychar <= YYEOF)
1860 /* Return failure if at end of input. */
1861 if (yychar == YYEOF)
1866 yydestruct ("Error: discarding",
1867 yytoken, &yylval, &yylloc);
1872 /* Else will try to reuse look-ahead token after shifting the error
1877 /*---------------------------------------------------.
1878 | yyerrorlab -- error raised explicitly by YYERROR. |
1879 `---------------------------------------------------*/
1882 /* Pacify compilers like GCC when the user code never invokes
1883 YYERROR and the label yyerrorlab therefore never appears in user
1885 if (/*CONSTCOND*/ 0)
1888 yyerror_range[0] = yylsp[1-yylen];
1889 /* Do not reclaim the symbols of the rule which action triggered
1893 YY_STACK_PRINT (yyss, yyssp);
1898 /*-------------------------------------------------------------.
1899 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1900 `-------------------------------------------------------------*/
1902 yyerrstatus = 3; /* Each real token shifted decrements this. */
1906 yyn = yypact[yystate];
1907 if (yyn != YYPACT_NINF)
1910 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1918 /* Pop the current state because it cannot handle the error token. */
1922 yyerror_range[0] = *yylsp;
1923 yydestruct ("Error: popping",
1924 yystos[yystate], yyvsp, yylsp);
1927 YY_STACK_PRINT (yyss, yyssp);
1935 yyerror_range[1] = yylloc;
1936 /* Using YYLLOC is tempting, but would change the location of
1937 the look-ahead. YYLOC is available though. */
1938 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
1941 /* Shift the error token. */
1942 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1948 /*-------------------------------------.
1949 | yyacceptlab -- YYACCEPT comes here. |
1950 `-------------------------------------*/
1955 /*-----------------------------------.
1956 | yyabortlab -- YYABORT comes here. |
1957 `-----------------------------------*/
1963 /*-------------------------------------------------.
1964 | yyexhaustedlab -- memory exhaustion comes here. |
1965 `-------------------------------------------------*/
1967 yyerror (YY_("memory exhausted"));
1973 if (yychar != YYEOF && yychar != YYEMPTY)
1974 yydestruct ("Cleanup: discarding lookahead",
1975 yytoken, &yylval, &yylloc);
1976 /* Do not reclaim the symbols of the rule which action triggered
1977 this YYABORT or YYACCEPT. */
1979 YY_STACK_PRINT (yyss, yyssp);
1980 while (yyssp != yyss)
1982 yydestruct ("Cleanup: popping",
1983 yystos[*yyssp], yyvsp, yylsp);
1988 YYSTACK_FREE (yyss);
1991 if (yymsg != yymsgbuf)
1992 YYSTACK_FREE (yymsg);
1994 /* Make sure YYID is used. */
1995 return YYID (yyresult);
1999 #line 340 "dtc-parser.y"
2002 void yyerrorf(char const *s, ...)
2004 const char *fname = srcpos_file ? srcpos_file->name : "<no-file>";
2008 if (strcmp(fname, "-") == 0)
2011 fprintf(stderr, "%s:%d ", fname, yylloc.first_line);
2012 vfprintf(stderr, s, va);
2013 fprintf(stderr, "\n");
2015 treesource_error = 1;
2019 void yyerror (char const *s)
2024 static unsigned long long eval_literal(const char *s, int base, int bits)
2026 unsigned long long val;
2030 val = strtoull(s, &e, base);
2032 yyerror("bad characters in literal");
2033 else if ((errno == ERANGE)
2034 || ((bits < 64) && (val >= (1ULL << bits))))
2035 yyerror("literal out of range");
2036 else if (errno != 0)
2037 yyerror("bad literal");