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,
83 #define DT_MEMRESERVE 259
84 #define DT_PROPNODENAME 260
85 #define DT_LITERAL 261
86 #define DT_LEGACYLITERAL 262
96 /* Copy the first part of user declarations. */
97 #line 23 "dtc-parser.y"
103 unsigned long long eval_literal(const char *s, int base, int bits);
105 extern struct boot_info *the_boot_info;
109 /* Enabling traces. */
114 /* Enabling verbose error messages. */
115 #ifdef YYERROR_VERBOSE
116 # undef YYERROR_VERBOSE
117 # define YYERROR_VERBOSE 1
119 # define YYERROR_VERBOSE 0
122 /* Enabling the token table. */
123 #ifndef YYTOKEN_TABLE
124 # define YYTOKEN_TABLE 0
127 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
128 typedef union YYSTYPE
129 #line 34 "dtc-parser.y"
140 struct property *prop;
141 struct property *proplist;
143 struct node *nodelist;
144 struct reserve_info *re;
146 /* Line 187 of yacc.c. */
147 #line 148 "dtc-parser.tab.c"
149 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
150 # define YYSTYPE_IS_DECLARED 1
151 # define YYSTYPE_IS_TRIVIAL 1
154 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
155 typedef struct YYLTYPE
162 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
163 # define YYLTYPE_IS_DECLARED 1
164 # define YYLTYPE_IS_TRIVIAL 1
168 /* Copy the second part of user declarations. */
171 /* Line 216 of yacc.c. */
172 #line 173 "dtc-parser.tab.c"
179 typedef YYTYPE_UINT8 yytype_uint8;
181 typedef unsigned char yytype_uint8;
185 typedef YYTYPE_INT8 yytype_int8;
186 #elif (defined __STDC__ || defined __C99__FUNC__ \
187 || defined __cplusplus || defined _MSC_VER)
188 typedef signed char yytype_int8;
190 typedef short int yytype_int8;
194 typedef YYTYPE_UINT16 yytype_uint16;
196 typedef unsigned short int yytype_uint16;
200 typedef YYTYPE_INT16 yytype_int16;
202 typedef short int yytype_int16;
206 # ifdef __SIZE_TYPE__
207 # define YYSIZE_T __SIZE_TYPE__
208 # elif defined size_t
209 # define YYSIZE_T size_t
210 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
211 || defined __cplusplus || defined _MSC_VER)
212 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
213 # define YYSIZE_T size_t
215 # define YYSIZE_T unsigned int
219 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
224 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
225 # define YY_(msgid) dgettext ("bison-runtime", msgid)
229 # define YY_(msgid) msgid
233 /* Suppress unused-variable warnings by "using" E. */
234 #if ! defined lint || defined __GNUC__
235 # define YYUSE(e) ((void) (e))
237 # define YYUSE(e) /* empty */
240 /* Identity function, used to suppress warnings about constant conditions. */
244 #if (defined __STDC__ || defined __C99__FUNC__ \
245 || defined __cplusplus || defined _MSC_VER)
258 #if ! defined yyoverflow || YYERROR_VERBOSE
260 /* The parser invokes alloca or malloc; define the necessary symbols. */
262 # ifdef YYSTACK_USE_ALLOCA
263 # if YYSTACK_USE_ALLOCA
265 # define YYSTACK_ALLOC __builtin_alloca
266 # elif defined __BUILTIN_VA_ARG_INCR
267 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
269 # define YYSTACK_ALLOC __alloca
270 # elif defined _MSC_VER
271 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
272 # define alloca _alloca
274 # define YYSTACK_ALLOC alloca
275 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
276 || defined __cplusplus || defined _MSC_VER)
277 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
286 # ifdef YYSTACK_ALLOC
287 /* Pacify GCC's `empty if-body' warning. */
288 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
289 # ifndef YYSTACK_ALLOC_MAXIMUM
290 /* The OS might guarantee only one guard page at the bottom of the stack,
291 and a page size can be as small as 4096 bytes. So we cannot safely
292 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
293 to allow for a few compiler-allocated temporary stack slots. */
294 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
297 # define YYSTACK_ALLOC YYMALLOC
298 # define YYSTACK_FREE YYFREE
299 # ifndef YYSTACK_ALLOC_MAXIMUM
300 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
302 # if (defined __cplusplus && ! defined _STDLIB_H \
303 && ! ((defined YYMALLOC || defined malloc) \
304 && (defined YYFREE || defined free)))
305 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
311 # define YYMALLOC malloc
312 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
313 || defined __cplusplus || defined _MSC_VER)
314 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
319 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
320 || defined __cplusplus || defined _MSC_VER)
321 void free (void *); /* INFRINGES ON USER NAME SPACE */
325 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
328 #if (! defined yyoverflow \
329 && (! defined __cplusplus \
330 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
331 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
333 /* A type that is properly aligned for any stack member. */
341 /* The size of the maximum gap between one aligned stack and the next. */
342 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
344 /* The size of an array large to enough to hold all stacks, each with
346 # define YYSTACK_BYTES(N) \
347 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
348 + 2 * YYSTACK_GAP_MAXIMUM)
350 /* Copy COUNT objects from FROM to TO. The source and destination do
353 # if defined __GNUC__ && 1 < __GNUC__
354 # define YYCOPY(To, From, Count) \
355 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
357 # define YYCOPY(To, From, Count) \
361 for (yyi = 0; yyi < (Count); yyi++) \
362 (To)[yyi] = (From)[yyi]; \
368 /* Relocate STACK from its old location to the new one. The
369 local variables YYSIZE and YYSTACKSIZE give the old and new number of
370 elements in the stack, and YYPTR gives the new location of the
371 stack. Advance YYPTR to a properly aligned location for the next
373 # define YYSTACK_RELOCATE(Stack) \
376 YYSIZE_T yynewbytes; \
377 YYCOPY (&yyptr->Stack, Stack, yysize); \
378 Stack = &yyptr->Stack; \
379 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
380 yyptr += yynewbytes / sizeof (*yyptr); \
386 /* YYFINAL -- State number of the termination state. */
388 /* YYLAST -- Last index in YYTABLE. */
391 /* YYNTOKENS -- Number of terminals. */
393 /* YYNNTS -- Number of nonterminals. */
395 /* YYNRULES -- Number of rules. */
397 /* YYNRULES -- Number of states. */
400 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
402 #define YYMAXUTOK 267
404 #define YYTRANSLATE(YYX) \
405 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
407 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
408 static const yytype_uint8 yytranslate[] =
410 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
413 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
414 2, 2, 2, 2, 23, 14, 2, 15, 2, 2,
415 2, 2, 2, 2, 2, 2, 2, 2, 2, 13,
416 19, 18, 20, 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 2, 21, 2, 22, 2, 2, 2, 2, 2, 2,
420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
421 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
422 2, 2, 2, 16, 2, 17, 2, 2, 2, 2,
423 2, 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, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
436 5, 6, 7, 8, 9, 10, 11, 12
440 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
442 static const yytype_uint8 yyprhs[] =
444 0, 0, 3, 8, 11, 12, 15, 21, 22, 25,
445 27, 34, 36, 38, 41, 47, 48, 51, 57, 61,
446 64, 69, 74, 77, 80, 81, 84, 87, 88, 91,
447 94, 97, 98, 100, 102, 105, 106, 109, 112, 113,
451 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
452 static const yytype_int8 yyrhs[] =
454 25, 0, -1, 3, 13, 26, 31, -1, 28, 31,
455 -1, -1, 27, 26, -1, 43, 4, 30, 30, 13,
456 -1, -1, 29, 28, -1, 27, -1, 43, 4, 30,
457 14, 30, 13, -1, 6, -1, 7, -1, 15, 32,
458 -1, 16, 33, 41, 17, 13, -1, -1, 33, 34,
459 -1, 43, 5, 18, 35, 13, -1, 43, 5, 13,
460 -1, 36, 10, -1, 36, 19, 37, 20, -1, 36,
461 21, 40, 22, -1, 36, 12, -1, 35, 11, -1,
462 -1, 35, 23, -1, 36, 11, -1, -1, 37, 39,
463 -1, 37, 12, -1, 37, 11, -1, -1, 8, -1,
464 6, -1, 38, 7, -1, -1, 40, 9, -1, 40,
465 11, -1, -1, 42, 41, -1, 42, 34, -1, 43,
466 5, 32, -1, -1, 11, -1
469 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
470 static const yytype_uint16 yyrline[] =
472 0, 85, 85, 89, 97, 100, 107, 115, 118, 125,
473 129, 136, 140, 147, 154, 162, 165, 172, 176, 183,
474 187, 191, 195, 199, 207, 210, 214, 222, 225, 229,
475 234, 242, 245, 249, 253, 261, 264, 268, 276, 279,
480 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
481 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
482 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
483 static const char *const yytname[] =
485 "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE",
486 "DT_PROPNODENAME", "DT_LITERAL", "DT_LEGACYLITERAL", "DT_BASE",
487 "DT_BYTE", "DT_STRING", "DT_LABEL", "DT_REF", "';'", "'-'", "'/'", "'{'",
488 "'}'", "'='", "'<'", "'>'", "'['", "']'", "','", "$accept", "sourcefile",
489 "memreserves", "memreserve", "v0_memreserves", "v0_memreserve", "addr",
490 "devicetree", "nodedef", "proplist", "propdef", "propdata",
491 "propdataprefix", "celllist", "cellbase", "cellval", "bytestring",
492 "subnodes", "subnode", "label", 0
497 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
499 static const yytype_uint16 yytoknum[] =
501 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
502 265, 266, 267, 59, 45, 47, 123, 125, 61, 60,
507 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
508 static const yytype_uint8 yyr1[] =
510 0, 24, 25, 25, 26, 26, 27, 28, 28, 29,
511 29, 30, 30, 31, 32, 33, 33, 34, 34, 35,
512 35, 35, 35, 35, 36, 36, 36, 37, 37, 37,
513 37, 38, 38, 39, 39, 40, 40, 40, 41, 41,
517 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
518 static const yytype_uint8 yyr2[] =
520 0, 2, 4, 2, 0, 2, 5, 0, 2, 1,
521 6, 1, 1, 2, 5, 0, 2, 5, 3, 2,
522 4, 4, 2, 2, 0, 2, 2, 0, 2, 2,
523 2, 0, 1, 1, 2, 0, 2, 2, 0, 2,
527 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
528 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
529 means the default is an error. */
530 static const yytype_uint8 yydefact[] =
532 7, 0, 43, 0, 9, 0, 7, 0, 4, 1,
533 0, 3, 8, 0, 0, 4, 0, 15, 13, 11,
534 12, 0, 2, 5, 0, 38, 0, 0, 0, 16,
535 0, 38, 0, 0, 6, 0, 40, 39, 0, 10,
536 14, 18, 24, 41, 0, 0, 23, 17, 25, 19,
537 26, 22, 27, 35, 31, 0, 33, 32, 30, 29,
538 20, 0, 28, 36, 37, 21, 34
541 /* YYDEFGOTO[NTERM-NUM]. */
542 static const yytype_int8 yydefgoto[] =
544 -1, 3, 14, 4, 5, 6, 27, 11, 18, 25,
545 29, 44, 45, 54, 61, 62, 55, 30, 31, 7
548 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
550 #define YYPACT_NINF -13
551 static const yytype_int8 yypact[] =
553 23, 11, -13, 37, -13, -4, 18, 39, 18, -13,
554 28, -13, -13, 34, -4, 18, 41, -13, -13, -13,
555 -13, 25, -13, -13, 34, -3, 34, 33, 34, -13,
556 30, -3, 43, 36, -13, 38, -13, -13, 20, -13,
557 -13, -13, -13, -13, 2, 9, -13, -13, -13, -13,
558 -13, -13, -13, -13, -2, -6, -13, -13, -13, -13,
559 -13, 45, -13, -13, -13, -13, -13
562 /* YYPGOTO[NTERM-NUM]. */
563 static const yytype_int8 yypgoto[] =
565 -13, -13, 35, 27, 47, -13, -12, 40, 17, -13,
566 26, -13, -13, -13, -13, -13, -13, 29, -13, -8
569 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
570 positive, shift that token. If negative, reduce the rule which
571 number is the opposite. If zero, do what YYDEFACT says.
572 If YYTABLE_NINF, syntax error. */
573 #define YYTABLE_NINF -43
574 static const yytype_int8 yytable[] =
576 16, 21, -42, 63, 56, 64, 57, 16, 2, 58,
577 59, 10, 28, 46, 33, 47, 65, 32, 60, 49,
578 50, 51, -42, 32, 8, 48, 1, -42, 52, 2,
579 53, 19, 20, 41, 2, 15, 17, 9, 42, 26,
580 19, 20, 15, 13, 17, 24, 34, 35, 38, 39,
581 23, 40, 66, 12, 22, 43, 0, 36, 0, 0,
585 static const yytype_int8 yycheck[] =
587 8, 13, 5, 9, 6, 11, 8, 15, 11, 11,
588 12, 15, 24, 11, 26, 13, 22, 25, 20, 10,
589 11, 12, 4, 31, 13, 23, 3, 4, 19, 11,
590 21, 6, 7, 13, 11, 8, 16, 0, 18, 14,
591 6, 7, 15, 4, 16, 4, 13, 17, 5, 13,
592 15, 13, 7, 6, 14, 38, -1, 31, -1, -1,
596 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
597 symbol of state STATE-NUM. */
598 static const yytype_uint8 yystos[] =
600 0, 3, 11, 25, 27, 28, 29, 43, 13, 0,
601 15, 31, 28, 4, 26, 27, 43, 16, 32, 6,
602 7, 30, 31, 26, 4, 33, 14, 30, 30, 34,
603 41, 42, 43, 30, 13, 17, 34, 41, 5, 13,
604 13, 13, 18, 32, 35, 36, 11, 13, 23, 10,
605 11, 12, 19, 21, 37, 40, 6, 8, 11, 12,
606 20, 38, 39, 9, 11, 22, 7
609 #define yyerrok (yyerrstatus = 0)
610 #define yyclearin (yychar = YYEMPTY)
614 #define YYACCEPT goto yyacceptlab
615 #define YYABORT goto yyabortlab
616 #define YYERROR goto yyerrorlab
619 /* Like YYERROR except do call yyerror. This remains here temporarily
620 to ease the transition to the new meaning of YYERROR, for GCC.
621 Once GCC version 2 has supplanted version 1, this can go. */
623 #define YYFAIL goto yyerrlab
625 #define YYRECOVERING() (!!yyerrstatus)
627 #define YYBACKUP(Token, Value) \
629 if (yychar == YYEMPTY && yylen == 1) \
633 yytoken = YYTRANSLATE (yychar); \
639 yyerror (YY_("syntax error: cannot back up")); \
646 #define YYERRCODE 256
649 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
650 If N is 0, then set CURRENT to the empty location which ends
651 the previous symbol: RHS[0] (always defined). */
653 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
654 #ifndef YYLLOC_DEFAULT
655 # define YYLLOC_DEFAULT(Current, Rhs, N) \
659 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
660 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
661 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
662 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
666 (Current).first_line = (Current).last_line = \
667 YYRHSLOC (Rhs, 0).last_line; \
668 (Current).first_column = (Current).last_column = \
669 YYRHSLOC (Rhs, 0).last_column; \
675 /* YY_LOCATION_PRINT -- Print the location on the stream.
676 This macro was not mandated originally: define only if we know
677 we won't break user code: when these are the locations we know. */
679 #ifndef YY_LOCATION_PRINT
680 # if YYLTYPE_IS_TRIVIAL
681 # define YY_LOCATION_PRINT(File, Loc) \
682 fprintf (File, "%d.%d-%d.%d", \
683 (Loc).first_line, (Loc).first_column, \
684 (Loc).last_line, (Loc).last_column)
686 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
691 /* YYLEX -- calling `yylex' with the right arguments. */
694 # define YYLEX yylex (YYLEX_PARAM)
696 # define YYLEX yylex ()
699 /* Enable debugging if requested. */
703 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
704 # define YYFPRINTF fprintf
707 # define YYDPRINTF(Args) \
713 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
717 YYFPRINTF (stderr, "%s ", Title); \
718 yy_symbol_print (stderr, \
719 Type, Value, Location); \
720 YYFPRINTF (stderr, "\n"); \
725 /*--------------------------------.
726 | Print this symbol on YYOUTPUT. |
727 `--------------------------------*/
730 #if (defined __STDC__ || defined __C99__FUNC__ \
731 || defined __cplusplus || defined _MSC_VER)
733 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
736 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
739 YYSTYPE const * const yyvaluep;
740 YYLTYPE const * const yylocationp;
747 if (yytype < YYNTOKENS)
748 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
760 /*--------------------------------.
761 | Print this symbol on YYOUTPUT. |
762 `--------------------------------*/
764 #if (defined __STDC__ || defined __C99__FUNC__ \
765 || defined __cplusplus || defined _MSC_VER)
767 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
770 yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
773 YYSTYPE const * const yyvaluep;
774 YYLTYPE const * const yylocationp;
777 if (yytype < YYNTOKENS)
778 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
780 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
782 YY_LOCATION_PRINT (yyoutput, *yylocationp);
783 YYFPRINTF (yyoutput, ": ");
784 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
785 YYFPRINTF (yyoutput, ")");
788 /*------------------------------------------------------------------.
789 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
791 `------------------------------------------------------------------*/
793 #if (defined __STDC__ || defined __C99__FUNC__ \
794 || defined __cplusplus || defined _MSC_VER)
796 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
799 yy_stack_print (bottom, top)
800 yytype_int16 *bottom;
804 YYFPRINTF (stderr, "Stack now");
805 for (; bottom <= top; ++bottom)
806 YYFPRINTF (stderr, " %d", *bottom);
807 YYFPRINTF (stderr, "\n");
810 # define YY_STACK_PRINT(Bottom, Top) \
813 yy_stack_print ((Bottom), (Top)); \
817 /*------------------------------------------------.
818 | Report that the YYRULE is going to be reduced. |
819 `------------------------------------------------*/
821 #if (defined __STDC__ || defined __C99__FUNC__ \
822 || defined __cplusplus || defined _MSC_VER)
824 yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
827 yy_reduce_print (yyvsp, yylsp, yyrule)
833 int yynrhs = yyr2[yyrule];
835 unsigned long int yylno = yyrline[yyrule];
836 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
838 /* The symbols being reduced. */
839 for (yyi = 0; yyi < yynrhs; yyi++)
841 fprintf (stderr, " $%d = ", yyi + 1);
842 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
843 &(yyvsp[(yyi + 1) - (yynrhs)])
844 , &(yylsp[(yyi + 1) - (yynrhs)]) );
845 fprintf (stderr, "\n");
849 # define YY_REDUCE_PRINT(Rule) \
852 yy_reduce_print (yyvsp, yylsp, Rule); \
855 /* Nonzero means print parse trace. It is left uninitialized so that
856 multiple parsers can coexist. */
859 # define YYDPRINTF(Args)
860 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
861 # define YY_STACK_PRINT(Bottom, Top)
862 # define YY_REDUCE_PRINT(Rule)
863 #endif /* !YYDEBUG */
866 /* YYINITDEPTH -- initial size of the parser's stacks. */
868 # define YYINITDEPTH 200
871 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
872 if the built-in stack extension method is used).
874 Do not make this value too large; the results are undefined if
875 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
876 evaluated with infinite-precision integer arithmetic. */
879 # define YYMAXDEPTH 10000
887 # if defined __GLIBC__ && defined _STRING_H
888 # define yystrlen strlen
890 /* Return the length of YYSTR. */
891 #if (defined __STDC__ || defined __C99__FUNC__ \
892 || defined __cplusplus || defined _MSC_VER)
894 yystrlen (const char *yystr)
902 for (yylen = 0; yystr[yylen]; yylen++)
910 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
911 # define yystpcpy stpcpy
913 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
915 #if (defined __STDC__ || defined __C99__FUNC__ \
916 || defined __cplusplus || defined _MSC_VER)
918 yystpcpy (char *yydest, const char *yysrc)
921 yystpcpy (yydest, yysrc)
927 const char *yys = yysrc;
929 while ((*yyd++ = *yys++) != '\0')
938 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
939 quotes and backslashes, so that it's suitable for yyerror. The
940 heuristic is that double-quoting is unnecessary unless the string
941 contains an apostrophe, a comma, or backslash (other than
942 backslash-backslash). YYSTR is taken from yytname. If YYRES is
943 null, do not copy; instead, return the length of what the result
946 yytnamerr (char *yyres, const char *yystr)
951 char const *yyp = yystr;
958 goto do_not_strip_quotes;
962 goto do_not_strip_quotes;
975 do_not_strip_quotes: ;
979 return yystrlen (yystr);
981 return yystpcpy (yyres, yystr) - yyres;
985 /* Copy into YYRESULT an error message about the unexpected token
986 YYCHAR while in state YYSTATE. Return the number of bytes copied,
987 including the terminating null byte. If YYRESULT is null, do not
988 copy anything; just return the number of bytes that would be
989 copied. As a special case, return 0 if an ordinary "syntax error"
990 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
993 yysyntax_error (char *yyresult, int yystate, int yychar)
995 int yyn = yypact[yystate];
997 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1001 int yytype = YYTRANSLATE (yychar);
1002 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1003 YYSIZE_T yysize = yysize0;
1005 int yysize_overflow = 0;
1006 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1007 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1011 /* This is so xgettext sees the translatable formats that are
1012 constructed on the fly. */
1013 YY_("syntax error, unexpected %s");
1014 YY_("syntax error, unexpected %s, expecting %s");
1015 YY_("syntax error, unexpected %s, expecting %s or %s");
1016 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1017 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1021 static char const yyunexpected[] = "syntax error, unexpected %s";
1022 static char const yyexpecting[] = ", expecting %s";
1023 static char const yyor[] = " or %s";
1024 char yyformat[sizeof yyunexpected
1025 + sizeof yyexpecting - 1
1026 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1027 * (sizeof yyor - 1))];
1028 char const *yyprefix = yyexpecting;
1030 /* Start YYX at -YYN if negative to avoid negative indexes in
1032 int yyxbegin = yyn < 0 ? -yyn : 0;
1034 /* Stay within bounds of both yycheck and yytname. */
1035 int yychecklim = YYLAST - yyn + 1;
1036 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1039 yyarg[0] = yytname[yytype];
1040 yyfmt = yystpcpy (yyformat, yyunexpected);
1042 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1043 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1045 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1049 yyformat[sizeof yyunexpected - 1] = '\0';
1052 yyarg[yycount++] = yytname[yyx];
1053 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1054 yysize_overflow |= (yysize1 < yysize);
1056 yyfmt = yystpcpy (yyfmt, yyprefix);
1060 yyf = YY_(yyformat);
1061 yysize1 = yysize + yystrlen (yyf);
1062 yysize_overflow |= (yysize1 < yysize);
1065 if (yysize_overflow)
1066 return YYSIZE_MAXIMUM;
1070 /* Avoid sprintf, as that infringes on the user's name space.
1071 Don't have undefined behavior even if the translation
1072 produced a string with the wrong number of "%s"s. */
1073 char *yyp = yyresult;
1075 while ((*yyp = *yyf) != '\0')
1077 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1079 yyp += yytnamerr (yyp, yyarg[yyi++]);
1092 #endif /* YYERROR_VERBOSE */
1095 /*-----------------------------------------------.
1096 | Release the memory associated to this symbol. |
1097 `-----------------------------------------------*/
1100 #if (defined __STDC__ || defined __C99__FUNC__ \
1101 || defined __cplusplus || defined _MSC_VER)
1103 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
1106 yydestruct (yymsg, yytype, yyvaluep, yylocationp)
1110 YYLTYPE *yylocationp;
1114 YYUSE (yylocationp);
1118 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1129 /* Prevent warnings from -Wmissing-prototypes. */
1131 #ifdef YYPARSE_PARAM
1132 #if defined __STDC__ || defined __cplusplus
1133 int yyparse (void *YYPARSE_PARAM);
1137 #else /* ! YYPARSE_PARAM */
1138 #if defined __STDC__ || defined __cplusplus
1143 #endif /* ! YYPARSE_PARAM */
1147 /* The look-ahead symbol. */
1150 /* The semantic value of the look-ahead symbol. */
1153 /* Number of syntax errors so far. */
1155 /* Location data for the look-ahead symbol. */
1164 #ifdef YYPARSE_PARAM
1165 #if (defined __STDC__ || defined __C99__FUNC__ \
1166 || defined __cplusplus || defined _MSC_VER)
1168 yyparse (void *YYPARSE_PARAM)
1171 yyparse (YYPARSE_PARAM)
1172 void *YYPARSE_PARAM;
1174 #else /* ! YYPARSE_PARAM */
1175 #if (defined __STDC__ || defined __C99__FUNC__ \
1176 || defined __cplusplus || defined _MSC_VER)
1190 /* Number of tokens to shift before error messages enabled. */
1192 /* Look-ahead token as an internal (translated) token number. */
1195 /* Buffer for error messages, and its allocated size. */
1197 char *yymsg = yymsgbuf;
1198 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1201 /* Three stacks and their tools:
1202 `yyss': related to states,
1203 `yyvs': related to semantic values,
1204 `yyls': related to locations.
1206 Refer to the stacks thru separate pointers, to allow yyoverflow
1207 to reallocate them elsewhere. */
1209 /* The state stack. */
1210 yytype_int16 yyssa[YYINITDEPTH];
1211 yytype_int16 *yyss = yyssa;
1212 yytype_int16 *yyssp;
1214 /* The semantic value stack. */
1215 YYSTYPE yyvsa[YYINITDEPTH];
1216 YYSTYPE *yyvs = yyvsa;
1219 /* The location stack. */
1220 YYLTYPE yylsa[YYINITDEPTH];
1221 YYLTYPE *yyls = yylsa;
1223 /* The locations where the error started and ended. */
1224 YYLTYPE yyerror_range[2];
1226 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1228 YYSIZE_T yystacksize = YYINITDEPTH;
1230 /* The variables used to return semantic value and location from the
1235 /* The number of symbols on the RHS of the reduced rule.
1236 Keep to zero when no symbol should be popped. */
1239 YYDPRINTF ((stderr, "Starting parse\n"));
1244 yychar = YYEMPTY; /* Cause a token to be read. */
1246 /* Initialize stack pointers.
1247 Waste one element of value and location stack
1248 so that they stay on the same level as the state stack.
1249 The wasted elements are never initialized. */
1254 #if YYLTYPE_IS_TRIVIAL
1255 /* Initialize the default location before parsing starts. */
1256 yylloc.first_line = yylloc.last_line = 1;
1257 yylloc.first_column = yylloc.last_column = 0;
1262 /*------------------------------------------------------------.
1263 | yynewstate -- Push a new state, which is found in yystate. |
1264 `------------------------------------------------------------*/
1266 /* In all cases, when you get here, the value and location stacks
1267 have just been pushed. So pushing a state here evens the stacks. */
1273 if (yyss + yystacksize - 1 <= yyssp)
1275 /* Get the current used size of the three stacks, in elements. */
1276 YYSIZE_T yysize = yyssp - yyss + 1;
1280 /* Give user a chance to reallocate the stack. Use copies of
1281 these so that the &'s don't force the real ones into
1283 YYSTYPE *yyvs1 = yyvs;
1284 yytype_int16 *yyss1 = yyss;
1285 YYLTYPE *yyls1 = yyls;
1287 /* Each stack pointer address is followed by the size of the
1288 data in use in that stack, in bytes. This used to be a
1289 conditional around just the two extra args, but that might
1290 be undefined if yyoverflow is a macro. */
1291 yyoverflow (YY_("memory exhausted"),
1292 &yyss1, yysize * sizeof (*yyssp),
1293 &yyvs1, yysize * sizeof (*yyvsp),
1294 &yyls1, yysize * sizeof (*yylsp),
1300 #else /* no yyoverflow */
1301 # ifndef YYSTACK_RELOCATE
1302 goto yyexhaustedlab;
1304 /* Extend the stack our own way. */
1305 if (YYMAXDEPTH <= yystacksize)
1306 goto yyexhaustedlab;
1308 if (YYMAXDEPTH < yystacksize)
1309 yystacksize = YYMAXDEPTH;
1312 yytype_int16 *yyss1 = yyss;
1313 union yyalloc *yyptr =
1314 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1316 goto yyexhaustedlab;
1317 YYSTACK_RELOCATE (yyss);
1318 YYSTACK_RELOCATE (yyvs);
1319 YYSTACK_RELOCATE (yyls);
1320 # undef YYSTACK_RELOCATE
1322 YYSTACK_FREE (yyss1);
1325 #endif /* no yyoverflow */
1327 yyssp = yyss + yysize - 1;
1328 yyvsp = yyvs + yysize - 1;
1329 yylsp = yyls + yysize - 1;
1331 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1332 (unsigned long int) yystacksize));
1334 if (yyss + yystacksize - 1 <= yyssp)
1338 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1347 /* Do appropriate processing given the current state. Read a
1348 look-ahead token if we need one and don't already have one. */
1350 /* First try to decide what to do without reference to look-ahead token. */
1351 yyn = yypact[yystate];
1352 if (yyn == YYPACT_NINF)
1355 /* Not known => get a look-ahead token if don't already have one. */
1357 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1358 if (yychar == YYEMPTY)
1360 YYDPRINTF ((stderr, "Reading a token: "));
1364 if (yychar <= YYEOF)
1366 yychar = yytoken = YYEOF;
1367 YYDPRINTF ((stderr, "Now at end of input.\n"));
1371 yytoken = YYTRANSLATE (yychar);
1372 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1375 /* If the proper action on seeing token YYTOKEN is to reduce or to
1376 detect an error, take that action. */
1378 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1383 if (yyn == 0 || yyn == YYTABLE_NINF)
1392 /* Count tokens shifted since error; after three, turn off error
1397 /* Shift the look-ahead token. */
1398 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1400 /* Discard the shifted token unless it is eof. */
1401 if (yychar != YYEOF)
1410 /*-----------------------------------------------------------.
1411 | yydefault -- do the default action for the current state. |
1412 `-----------------------------------------------------------*/
1414 yyn = yydefact[yystate];
1420 /*-----------------------------.
1421 | yyreduce -- Do a reduction. |
1422 `-----------------------------*/
1424 /* yyn is the number of a rule to reduce with. */
1427 /* If YYLEN is nonzero, implement the default value of the action:
1430 Otherwise, the following line sets YYVAL to garbage.
1431 This behavior is undocumented and Bison
1432 users should not rely upon it. Assigning to YYVAL
1433 unconditionally makes the parser a bit smaller, and it avoids a
1434 GCC warning that YYVAL may be used uninitialized. */
1435 yyval = yyvsp[1-yylen];
1437 /* Default location. */
1438 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1439 YY_REDUCE_PRINT (yyn);
1443 #line 86 "dtc-parser.y"
1445 the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node));
1450 #line 90 "dtc-parser.y"
1452 the_boot_info = build_boot_info((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].node));
1457 #line 97 "dtc-parser.y"
1464 #line 101 "dtc-parser.y"
1466 (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
1471 #line 108 "dtc-parser.y"
1473 (yyval.re) = build_reserve_entry((yyvsp[(3) - (5)].addr), (yyvsp[(4) - (5)].addr), (yyvsp[(1) - (5)].labelref));
1478 #line 115 "dtc-parser.y"
1485 #line 119 "dtc-parser.y"
1487 (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
1492 #line 126 "dtc-parser.y"
1494 (yyval.re) = (yyvsp[(1) - (1)].re);
1499 #line 130 "dtc-parser.y"
1501 (yyval.re) = build_reserve_entry((yyvsp[(3) - (6)].addr), (yyvsp[(5) - (6)].addr) - (yyvsp[(3) - (6)].addr) + 1, (yyvsp[(1) - (6)].labelref));
1506 #line 137 "dtc-parser.y"
1508 (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
1513 #line 141 "dtc-parser.y"
1515 (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 16, 64);
1520 #line 148 "dtc-parser.y"
1522 (yyval.node) = name_node((yyvsp[(2) - (2)].node), "", NULL);
1527 #line 155 "dtc-parser.y"
1529 (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
1534 #line 162 "dtc-parser.y"
1536 (yyval.proplist) = NULL;
1541 #line 166 "dtc-parser.y"
1543 (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
1548 #line 173 "dtc-parser.y"
1550 (yyval.prop) = build_property((yyvsp[(2) - (5)].propnodename), (yyvsp[(4) - (5)].data), (yyvsp[(1) - (5)].labelref));
1555 #line 177 "dtc-parser.y"
1557 (yyval.prop) = build_property((yyvsp[(2) - (3)].propnodename), empty_data, (yyvsp[(1) - (3)].labelref));
1562 #line 184 "dtc-parser.y"
1564 (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
1569 #line 188 "dtc-parser.y"
1571 (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
1576 #line 192 "dtc-parser.y"
1578 (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
1583 #line 196 "dtc-parser.y"
1585 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
1590 #line 200 "dtc-parser.y"
1592 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1597 #line 207 "dtc-parser.y"
1599 (yyval.data) = empty_data;
1604 #line 211 "dtc-parser.y"
1606 (yyval.data) = (yyvsp[(1) - (2)].data);
1611 #line 215 "dtc-parser.y"
1613 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1618 #line 222 "dtc-parser.y"
1620 (yyval.data) = empty_data;
1625 #line 226 "dtc-parser.y"
1627 (yyval.data) = data_append_cell((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].cell));
1632 #line 230 "dtc-parser.y"
1634 (yyval.data) = data_append_cell(data_add_marker((yyvsp[(1) - (2)].data), REF_PHANDLE,
1635 (yyvsp[(2) - (2)].labelref)), -1);
1640 #line 235 "dtc-parser.y"
1642 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1647 #line 242 "dtc-parser.y"
1654 #line 250 "dtc-parser.y"
1656 (yyval.cell) = eval_literal((yyvsp[(1) - (1)].literal), 0, 32);
1661 #line 254 "dtc-parser.y"
1663 (yyval.cell) = eval_literal((yyvsp[(2) - (2)].literal), (yyvsp[(1) - (2)].cbase), 32);
1668 #line 261 "dtc-parser.y"
1670 (yyval.data) = empty_data;
1675 #line 265 "dtc-parser.y"
1677 (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
1682 #line 269 "dtc-parser.y"
1684 (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
1689 #line 276 "dtc-parser.y"
1691 (yyval.nodelist) = NULL;
1696 #line 280 "dtc-parser.y"
1698 (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
1703 #line 284 "dtc-parser.y"
1705 yyerror("syntax error: properties must precede subnodes\n");
1711 #line 292 "dtc-parser.y"
1713 (yyval.node) = name_node((yyvsp[(3) - (3)].node), (yyvsp[(2) - (3)].propnodename), (yyvsp[(1) - (3)].labelref));
1718 #line 299 "dtc-parser.y"
1720 (yyval.labelref) = NULL;
1725 #line 303 "dtc-parser.y"
1727 (yyval.labelref) = (yyvsp[(1) - (1)].labelref);
1732 /* Line 1267 of yacc.c. */
1733 #line 1734 "dtc-parser.tab.c"
1736 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1740 YY_STACK_PRINT (yyss, yyssp);
1745 /* Now `shift' the result of the reduction. Determine what state
1746 that goes to, based on the state we popped back to and the rule
1747 number reduced by. */
1751 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1752 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1753 yystate = yytable[yystate];
1755 yystate = yydefgoto[yyn - YYNTOKENS];
1760 /*------------------------------------.
1761 | yyerrlab -- here on detecting error |
1762 `------------------------------------*/
1764 /* If not already recovering from an error, report this error. */
1768 #if ! YYERROR_VERBOSE
1769 yyerror (YY_("syntax error"));
1772 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1773 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1775 YYSIZE_T yyalloc = 2 * yysize;
1776 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1777 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1778 if (yymsg != yymsgbuf)
1779 YYSTACK_FREE (yymsg);
1780 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1782 yymsg_alloc = yyalloc;
1786 yymsg_alloc = sizeof yymsgbuf;
1790 if (0 < yysize && yysize <= yymsg_alloc)
1792 (void) yysyntax_error (yymsg, yystate, yychar);
1797 yyerror (YY_("syntax error"));
1799 goto yyexhaustedlab;
1805 yyerror_range[0] = yylloc;
1807 if (yyerrstatus == 3)
1809 /* If just tried and failed to reuse look-ahead token after an
1810 error, discard it. */
1812 if (yychar <= YYEOF)
1814 /* Return failure if at end of input. */
1815 if (yychar == YYEOF)
1820 yydestruct ("Error: discarding",
1821 yytoken, &yylval, &yylloc);
1826 /* Else will try to reuse look-ahead token after shifting the error
1831 /*---------------------------------------------------.
1832 | yyerrorlab -- error raised explicitly by YYERROR. |
1833 `---------------------------------------------------*/
1836 /* Pacify compilers like GCC when the user code never invokes
1837 YYERROR and the label yyerrorlab therefore never appears in user
1839 if (/*CONSTCOND*/ 0)
1842 yyerror_range[0] = yylsp[1-yylen];
1843 /* Do not reclaim the symbols of the rule which action triggered
1847 YY_STACK_PRINT (yyss, yyssp);
1852 /*-------------------------------------------------------------.
1853 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1854 `-------------------------------------------------------------*/
1856 yyerrstatus = 3; /* Each real token shifted decrements this. */
1860 yyn = yypact[yystate];
1861 if (yyn != YYPACT_NINF)
1864 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1872 /* Pop the current state because it cannot handle the error token. */
1876 yyerror_range[0] = *yylsp;
1877 yydestruct ("Error: popping",
1878 yystos[yystate], yyvsp, yylsp);
1881 YY_STACK_PRINT (yyss, yyssp);
1889 yyerror_range[1] = yylloc;
1890 /* Using YYLLOC is tempting, but would change the location of
1891 the look-ahead. YYLOC is available though. */
1892 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
1895 /* Shift the error token. */
1896 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1902 /*-------------------------------------.
1903 | yyacceptlab -- YYACCEPT comes here. |
1904 `-------------------------------------*/
1909 /*-----------------------------------.
1910 | yyabortlab -- YYABORT comes here. |
1911 `-----------------------------------*/
1917 /*-------------------------------------------------.
1918 | yyexhaustedlab -- memory exhaustion comes here. |
1919 `-------------------------------------------------*/
1921 yyerror (YY_("memory exhausted"));
1927 if (yychar != YYEOF && yychar != YYEMPTY)
1928 yydestruct ("Cleanup: discarding lookahead",
1929 yytoken, &yylval, &yylloc);
1930 /* Do not reclaim the symbols of the rule which action triggered
1931 this YYABORT or YYACCEPT. */
1933 YY_STACK_PRINT (yyss, yyssp);
1934 while (yyssp != yyss)
1936 yydestruct ("Cleanup: popping",
1937 yystos[*yyssp], yyvsp, yylsp);
1942 YYSTACK_FREE (yyss);
1945 if (yymsg != yymsgbuf)
1946 YYSTACK_FREE (yymsg);
1948 /* Make sure YYID is used. */
1949 return YYID (yyresult);
1953 #line 308 "dtc-parser.y"
1956 void yyerror (char const *s)
1958 const char *fname = srcpos_filename_for_num(yylloc.filenum);
1960 if (strcmp(fname, "-") == 0)
1963 fprintf(stderr, "%s:%d %s\n",
1964 fname, yylloc.first_line, s);
1967 unsigned long long eval_literal(const char *s, int base, int bits)
1969 unsigned long long val;
1973 val = strtoull(s, &e, base);
1975 yyerror("bad characters in literal");
1976 else if ((errno == ERANGE)
1977 || ((bits < 64) && (val >= (1ULL << bits))))
1978 yyerror("literal out of range");
1979 else if (errno != 0)
1980 yyerror("bad literal");