1 /* A Bison parser, made by GNU Bison 3.8.2. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6 Inc.
7
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 3 of the License, or
11 (at your option) any later version.
12
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.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <https://www.gnu.org/licenses/>. */
20
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
36
37 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38 especially those whose name start with YY_ or yy_. They are
39 private implementation details that can be changed or removed. */
40
41 /* All symbols defined below should begin with yy or YY, to avoid
42 infringing on user name space. This should be done even for local
43 variables, as they might otherwise be expanded by user macros.
44 There are some unavoidable exceptions within include files to
45 define necessary library symbols; they are noted "INFRINGES ON
46 USER NAME SPACE" below. */
47
48 /* Identify Bison output, and Bison version. */
49 #define YYBISON 30802
50
51 /* Bison version string. */
52 #define YYBISON_VERSION "3.8.2"
53
54 /* Skeleton name. */
55 #define YYSKELETON_NAME "yacc.c"
56
57 /* Pure parsers. */
58 #define YYPURE 0
59
60 /* Push parsers. */
61 #define YYPUSH 0
62
63 /* Pull parsers. */
64 #define YYPULL 1
65
66
67
68
69 /* First part of user prologue. */
70 #line 7 "external/dtc/dtc-parser.y"
71
72 #include <stdio.h>
73 #include <inttypes.h>
74
75 #include "dtc.h"
76 #include "srcpos.h"
77
78 extern int yylex(void);
79 extern void yyerror(char const *s);
80 #define ERROR(loc, ...) \
81 do { \
82 srcpos_error((loc), "Error", __VA_ARGS__); \
83 treesource_error = true; \
84 } while (0)
85
86 #define YYERROR_CALL(msg) yyerror(msg)
87
88 extern struct dt_info *parser_output;
89 extern bool treesource_error;
90
is_ref_relative(const char * ref)91 static bool is_ref_relative(const char *ref)
92 {
93 return ref[0] != '/' && strchr(&ref[1], '/');
94 }
95
96
97 #line 98 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
98
99 # ifndef YY_CAST
100 # ifdef __cplusplus
101 # define YY_CAST(Type, Val) static_cast<Type> (Val)
102 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
103 # else
104 # define YY_CAST(Type, Val) ((Type) (Val))
105 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
106 # endif
107 # endif
108 # ifndef YY_NULLPTR
109 # if defined __cplusplus
110 # if 201103L <= __cplusplus
111 # define YY_NULLPTR nullptr
112 # else
113 # define YY_NULLPTR 0
114 # endif
115 # else
116 # define YY_NULLPTR ((void*)0)
117 # endif
118 # endif
119
120 #include "dtc-parser.h"
121 /* Symbol kind. */
122 enum yysymbol_kind_t
123 {
124 YYSYMBOL_YYEMPTY = -2,
125 YYSYMBOL_YYEOF = 0, /* "end of file" */
126 YYSYMBOL_YYerror = 1, /* error */
127 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
128 YYSYMBOL_DT_V1 = 3, /* DT_V1 */
129 YYSYMBOL_DT_PLUGIN = 4, /* DT_PLUGIN */
130 YYSYMBOL_DT_MEMRESERVE = 5, /* DT_MEMRESERVE */
131 YYSYMBOL_DT_LSHIFT = 6, /* DT_LSHIFT */
132 YYSYMBOL_DT_RSHIFT = 7, /* DT_RSHIFT */
133 YYSYMBOL_DT_LE = 8, /* DT_LE */
134 YYSYMBOL_DT_GE = 9, /* DT_GE */
135 YYSYMBOL_DT_EQ = 10, /* DT_EQ */
136 YYSYMBOL_DT_NE = 11, /* DT_NE */
137 YYSYMBOL_DT_AND = 12, /* DT_AND */
138 YYSYMBOL_DT_OR = 13, /* DT_OR */
139 YYSYMBOL_DT_BITS = 14, /* DT_BITS */
140 YYSYMBOL_DT_DEL_PROP = 15, /* DT_DEL_PROP */
141 YYSYMBOL_DT_DEL_NODE = 16, /* DT_DEL_NODE */
142 YYSYMBOL_DT_OMIT_NO_REF = 17, /* DT_OMIT_NO_REF */
143 YYSYMBOL_DT_PROPNODENAME = 18, /* DT_PROPNODENAME */
144 YYSYMBOL_DT_LITERAL = 19, /* DT_LITERAL */
145 YYSYMBOL_DT_CHAR_LITERAL = 20, /* DT_CHAR_LITERAL */
146 YYSYMBOL_DT_BYTE = 21, /* DT_BYTE */
147 YYSYMBOL_DT_STRING = 22, /* DT_STRING */
148 YYSYMBOL_DT_LABEL = 23, /* DT_LABEL */
149 YYSYMBOL_DT_LABEL_REF = 24, /* DT_LABEL_REF */
150 YYSYMBOL_DT_PATH_REF = 25, /* DT_PATH_REF */
151 YYSYMBOL_DT_INCBIN = 26, /* DT_INCBIN */
152 YYSYMBOL_27_ = 27, /* ';' */
153 YYSYMBOL_28_ = 28, /* '/' */
154 YYSYMBOL_29_ = 29, /* '{' */
155 YYSYMBOL_30_ = 30, /* '}' */
156 YYSYMBOL_31_ = 31, /* '=' */
157 YYSYMBOL_32_ = 32, /* '>' */
158 YYSYMBOL_33_ = 33, /* '[' */
159 YYSYMBOL_34_ = 34, /* ']' */
160 YYSYMBOL_35_ = 35, /* '(' */
161 YYSYMBOL_36_ = 36, /* ',' */
162 YYSYMBOL_37_ = 37, /* ')' */
163 YYSYMBOL_38_ = 38, /* '<' */
164 YYSYMBOL_39_ = 39, /* '?' */
165 YYSYMBOL_40_ = 40, /* ':' */
166 YYSYMBOL_41_ = 41, /* '|' */
167 YYSYMBOL_42_ = 42, /* '^' */
168 YYSYMBOL_43_ = 43, /* '&' */
169 YYSYMBOL_44_ = 44, /* '+' */
170 YYSYMBOL_45_ = 45, /* '-' */
171 YYSYMBOL_46_ = 46, /* '*' */
172 YYSYMBOL_47_ = 47, /* '%' */
173 YYSYMBOL_48_ = 48, /* '~' */
174 YYSYMBOL_49_ = 49, /* '!' */
175 YYSYMBOL_YYACCEPT = 50, /* $accept */
176 YYSYMBOL_sourcefile = 51, /* sourcefile */
177 YYSYMBOL_header = 52, /* header */
178 YYSYMBOL_headers = 53, /* headers */
179 YYSYMBOL_memreserves = 54, /* memreserves */
180 YYSYMBOL_memreserve = 55, /* memreserve */
181 YYSYMBOL_dt_ref = 56, /* dt_ref */
182 YYSYMBOL_devicetree = 57, /* devicetree */
183 YYSYMBOL_nodedef = 58, /* nodedef */
184 YYSYMBOL_proplist = 59, /* proplist */
185 YYSYMBOL_propdef = 60, /* propdef */
186 YYSYMBOL_propdata = 61, /* propdata */
187 YYSYMBOL_propdataprefix = 62, /* propdataprefix */
188 YYSYMBOL_arrayprefix = 63, /* arrayprefix */
189 YYSYMBOL_integer_prim = 64, /* integer_prim */
190 YYSYMBOL_integer_expr = 65, /* integer_expr */
191 YYSYMBOL_integer_trinary = 66, /* integer_trinary */
192 YYSYMBOL_integer_or = 67, /* integer_or */
193 YYSYMBOL_integer_and = 68, /* integer_and */
194 YYSYMBOL_integer_bitor = 69, /* integer_bitor */
195 YYSYMBOL_integer_bitxor = 70, /* integer_bitxor */
196 YYSYMBOL_integer_bitand = 71, /* integer_bitand */
197 YYSYMBOL_integer_eq = 72, /* integer_eq */
198 YYSYMBOL_integer_rela = 73, /* integer_rela */
199 YYSYMBOL_integer_shift = 74, /* integer_shift */
200 YYSYMBOL_integer_add = 75, /* integer_add */
201 YYSYMBOL_integer_mul = 76, /* integer_mul */
202 YYSYMBOL_integer_unary = 77, /* integer_unary */
203 YYSYMBOL_bytestring = 78, /* bytestring */
204 YYSYMBOL_subnodes = 79, /* subnodes */
205 YYSYMBOL_subnode = 80 /* subnode */
206 };
207 typedef enum yysymbol_kind_t yysymbol_kind_t;
208
209
210
211
212 #ifdef short
213 # undef short
214 #endif
215
216 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
217 <limits.h> and (if available) <stdint.h> are included
218 so that the code can choose integer types of a good width. */
219
220 #ifndef __PTRDIFF_MAX__
221 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
222 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
223 # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
224 # define YY_STDINT_H
225 # endif
226 #endif
227
228 /* Narrow types that promote to a signed type and that can represent a
229 signed or unsigned integer of at least N bits. In tables they can
230 save space and decrease cache pressure. Promoting to a signed type
231 helps avoid bugs in integer arithmetic. */
232
233 #ifdef __INT_LEAST8_MAX__
234 typedef __INT_LEAST8_TYPE__ yytype_int8;
235 #elif defined YY_STDINT_H
236 typedef int_least8_t yytype_int8;
237 #else
238 typedef signed char yytype_int8;
239 #endif
240
241 #ifdef __INT_LEAST16_MAX__
242 typedef __INT_LEAST16_TYPE__ yytype_int16;
243 #elif defined YY_STDINT_H
244 typedef int_least16_t yytype_int16;
245 #else
246 typedef short yytype_int16;
247 #endif
248
249 /* Work around bug in HP-UX 11.23, which defines these macros
250 incorrectly for preprocessor constants. This workaround can likely
251 be removed in 2023, as HPE has promised support for HP-UX 11.23
252 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
253 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
254 #ifdef __hpux
255 # undef UINT_LEAST8_MAX
256 # undef UINT_LEAST16_MAX
257 # define UINT_LEAST8_MAX 255
258 # define UINT_LEAST16_MAX 65535
259 #endif
260
261 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
262 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
263 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
264 && UINT_LEAST8_MAX <= INT_MAX)
265 typedef uint_least8_t yytype_uint8;
266 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
267 typedef unsigned char yytype_uint8;
268 #else
269 typedef short yytype_uint8;
270 #endif
271
272 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
273 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
274 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
275 && UINT_LEAST16_MAX <= INT_MAX)
276 typedef uint_least16_t yytype_uint16;
277 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
278 typedef unsigned short yytype_uint16;
279 #else
280 typedef int yytype_uint16;
281 #endif
282
283 #ifndef YYPTRDIFF_T
284 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
285 # define YYPTRDIFF_T __PTRDIFF_TYPE__
286 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
287 # elif defined PTRDIFF_MAX
288 # ifndef ptrdiff_t
289 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
290 # endif
291 # define YYPTRDIFF_T ptrdiff_t
292 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
293 # else
294 # define YYPTRDIFF_T long
295 # define YYPTRDIFF_MAXIMUM LONG_MAX
296 # endif
297 #endif
298
299 #ifndef YYSIZE_T
300 # ifdef __SIZE_TYPE__
301 # define YYSIZE_T __SIZE_TYPE__
302 # elif defined size_t
303 # define YYSIZE_T size_t
304 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
305 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
306 # define YYSIZE_T size_t
307 # else
308 # define YYSIZE_T unsigned
309 # endif
310 #endif
311
312 #define YYSIZE_MAXIMUM \
313 YY_CAST (YYPTRDIFF_T, \
314 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
315 ? YYPTRDIFF_MAXIMUM \
316 : YY_CAST (YYSIZE_T, -1)))
317
318 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
319
320
321 /* Stored state numbers (used for stacks). */
322 typedef yytype_uint8 yy_state_t;
323
324 /* State numbers in computations. */
325 typedef int yy_state_fast_t;
326
327 #ifndef YY_
328 # if defined YYENABLE_NLS && YYENABLE_NLS
329 # if ENABLE_NLS
330 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
331 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
332 # endif
333 # endif
334 # ifndef YY_
335 # define YY_(Msgid) Msgid
336 # endif
337 #endif
338
339
340 #ifndef YY_ATTRIBUTE_PURE
341 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
342 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
343 # else
344 # define YY_ATTRIBUTE_PURE
345 # endif
346 #endif
347
348 #ifndef YY_ATTRIBUTE_UNUSED
349 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
350 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
351 # else
352 # define YY_ATTRIBUTE_UNUSED
353 # endif
354 #endif
355
356 /* Suppress unused-variable warnings by "using" E. */
357 #if ! defined lint || defined __GNUC__
358 # define YY_USE(E) ((void) (E))
359 #else
360 # define YY_USE(E) /* empty */
361 #endif
362
363 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
364 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
365 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
366 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
367 _Pragma ("GCC diagnostic push") \
368 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
369 # else
370 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
371 _Pragma ("GCC diagnostic push") \
372 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
373 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
374 # endif
375 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
376 _Pragma ("GCC diagnostic pop")
377 #else
378 # define YY_INITIAL_VALUE(Value) Value
379 #endif
380 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
381 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
382 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
383 #endif
384 #ifndef YY_INITIAL_VALUE
385 # define YY_INITIAL_VALUE(Value) /* Nothing. */
386 #endif
387
388 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
389 # define YY_IGNORE_USELESS_CAST_BEGIN \
390 _Pragma ("GCC diagnostic push") \
391 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
392 # define YY_IGNORE_USELESS_CAST_END \
393 _Pragma ("GCC diagnostic pop")
394 #endif
395 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
396 # define YY_IGNORE_USELESS_CAST_BEGIN
397 # define YY_IGNORE_USELESS_CAST_END
398 #endif
399
400
401 #define YY_ASSERT(E) ((void) (0 && (E)))
402
403 #if !defined yyoverflow
404
405 /* The parser invokes alloca or malloc; define the necessary symbols. */
406
407 # ifdef YYSTACK_USE_ALLOCA
408 # if YYSTACK_USE_ALLOCA
409 # ifdef __GNUC__
410 # define YYSTACK_ALLOC __builtin_alloca
411 # elif defined __BUILTIN_VA_ARG_INCR
412 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
413 # elif defined _AIX
414 # define YYSTACK_ALLOC __alloca
415 # elif defined _MSC_VER
416 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
417 # define alloca _alloca
418 # else
419 # define YYSTACK_ALLOC alloca
420 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
421 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
422 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
423 # ifndef EXIT_SUCCESS
424 # define EXIT_SUCCESS 0
425 # endif
426 # endif
427 # endif
428 # endif
429 # endif
430
431 # ifdef YYSTACK_ALLOC
432 /* Pacify GCC's 'empty if-body' warning. */
433 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
434 # ifndef YYSTACK_ALLOC_MAXIMUM
435 /* The OS might guarantee only one guard page at the bottom of the stack,
436 and a page size can be as small as 4096 bytes. So we cannot safely
437 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
438 to allow for a few compiler-allocated temporary stack slots. */
439 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
440 # endif
441 # else
442 # define YYSTACK_ALLOC YYMALLOC
443 # define YYSTACK_FREE YYFREE
444 # ifndef YYSTACK_ALLOC_MAXIMUM
445 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
446 # endif
447 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
448 && ! ((defined YYMALLOC || defined malloc) \
449 && (defined YYFREE || defined free)))
450 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
451 # ifndef EXIT_SUCCESS
452 # define EXIT_SUCCESS 0
453 # endif
454 # endif
455 # ifndef YYMALLOC
456 # define YYMALLOC malloc
457 # if ! defined malloc && ! defined EXIT_SUCCESS
458 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
459 # endif
460 # endif
461 # ifndef YYFREE
462 # define YYFREE free
463 # if ! defined free && ! defined EXIT_SUCCESS
464 void free (void *); /* INFRINGES ON USER NAME SPACE */
465 # endif
466 # endif
467 # endif
468 #endif /* !defined yyoverflow */
469
470 #if (! defined yyoverflow \
471 && (! defined __cplusplus \
472 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
473 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
474
475 /* A type that is properly aligned for any stack member. */
476 union yyalloc
477 {
478 yy_state_t yyss_alloc;
479 YYSTYPE yyvs_alloc;
480 YYLTYPE yyls_alloc;
481 };
482
483 /* The size of the maximum gap between one aligned stack and the next. */
484 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
485
486 /* The size of an array large to enough to hold all stacks, each with
487 N elements. */
488 # define YYSTACK_BYTES(N) \
489 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
490 + YYSIZEOF (YYLTYPE)) \
491 + 2 * YYSTACK_GAP_MAXIMUM)
492
493 # define YYCOPY_NEEDED 1
494
495 /* Relocate STACK from its old location to the new one. The
496 local variables YYSIZE and YYSTACKSIZE give the old and new number of
497 elements in the stack, and YYPTR gives the new location of the
498 stack. Advance YYPTR to a properly aligned location for the next
499 stack. */
500 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
501 do \
502 { \
503 YYPTRDIFF_T yynewbytes; \
504 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
505 Stack = &yyptr->Stack_alloc; \
506 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
507 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
508 } \
509 while (0)
510
511 #endif
512
513 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
514 /* Copy COUNT objects from SRC to DST. The source and destination do
515 not overlap. */
516 # ifndef YYCOPY
517 # if defined __GNUC__ && 1 < __GNUC__
518 # define YYCOPY(Dst, Src, Count) \
519 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
520 # else
521 # define YYCOPY(Dst, Src, Count) \
522 do \
523 { \
524 YYPTRDIFF_T yyi; \
525 for (yyi = 0; yyi < (Count); yyi++) \
526 (Dst)[yyi] = (Src)[yyi]; \
527 } \
528 while (0)
529 # endif
530 # endif
531 #endif /* !YYCOPY_NEEDED */
532
533 /* YYFINAL -- State number of the termination state. */
534 #define YYFINAL 6
535 /* YYLAST -- Last index in YYTABLE. */
536 #define YYLAST 151
537
538 /* YYNTOKENS -- Number of terminals. */
539 #define YYNTOKENS 50
540 /* YYNNTS -- Number of nonterminals. */
541 #define YYNNTS 31
542 /* YYNRULES -- Number of rules. */
543 #define YYNRULES 91
544 /* YYNSTATES -- Number of states. */
545 #define YYNSTATES 162
546
547 /* YYMAXUTOK -- Last valid token kind. */
548 #define YYMAXUTOK 281
549
550
551 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
552 as returned by yylex, with out-of-bounds checking. */
553 #define YYTRANSLATE(YYX) \
554 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
555 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
556 : YYSYMBOL_YYUNDEF)
557
558 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
559 as returned by yylex. */
560 static const yytype_int8 yytranslate[] =
561 {
562 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
564 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565 2, 2, 2, 49, 2, 2, 2, 47, 43, 2,
566 35, 37, 46, 44, 36, 45, 2, 28, 2, 2,
567 2, 2, 2, 2, 2, 2, 2, 2, 40, 27,
568 38, 31, 32, 39, 2, 2, 2, 2, 2, 2,
569 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571 2, 33, 2, 34, 42, 2, 2, 2, 2, 2,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 29, 41, 30, 48, 2, 2, 2,
575 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
588 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
589 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
590 25, 26
591 };
592
593 #if YYDEBUG
594 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
595 static const yytype_int16 yyrline[] =
596 {
597 0, 107, 107, 115, 119, 126, 127, 137, 140, 147,
598 151, 158, 158, 161, 165, 169, 185, 199, 220, 239,
599 251, 264, 271, 279, 282, 289, 293, 297, 301, 309,
600 313, 317, 321, 326, 342, 352, 360, 363, 367, 374,
601 395, 400, 424, 438, 445, 446, 447, 454, 458, 459,
602 463, 464, 468, 469, 473, 474, 478, 479, 483, 484,
603 488, 489, 490, 494, 495, 496, 497, 498, 502, 503,
604 504, 508, 509, 510, 514, 515, 524, 533, 537, 538,
605 539, 540, 545, 548, 552, 560, 563, 567, 575, 579,
606 583, 587
607 };
608 #endif
609
610 /** Accessing symbol of state STATE. */
611 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
612
613 #if YYDEBUG || 0
614 /* The user-facing name of the symbol whose (internal) number is
615 YYSYMBOL. No bounds checking. */
616 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
617
618 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
619 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
620 static const char *const yytname[] =
621 {
622 "\"end of file\"", "error", "\"invalid token\"", "DT_V1", "DT_PLUGIN",
623 "DT_MEMRESERVE", "DT_LSHIFT", "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ",
624 "DT_NE", "DT_AND", "DT_OR", "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE",
625 "DT_OMIT_NO_REF", "DT_PROPNODENAME", "DT_LITERAL", "DT_CHAR_LITERAL",
626 "DT_BYTE", "DT_STRING", "DT_LABEL", "DT_LABEL_REF", "DT_PATH_REF",
627 "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['", "']'",
628 "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'", "'+'",
629 "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile", "header",
630 "headers", "memreserves", "memreserve", "dt_ref", "devicetree",
631 "nodedef", "proplist", "propdef", "propdata", "propdataprefix",
632 "arrayprefix", "integer_prim", "integer_expr", "integer_trinary",
633 "integer_or", "integer_and", "integer_bitor", "integer_bitxor",
634 "integer_bitand", "integer_eq", "integer_rela", "integer_shift",
635 "integer_add", "integer_mul", "integer_unary", "bytestring", "subnodes",
636 "subnode", YY_NULLPTR
637 };
638
639 static const char *
yysymbol_name(yysymbol_kind_t yysymbol)640 yysymbol_name (yysymbol_kind_t yysymbol)
641 {
642 return yytname[yysymbol];
643 }
644 #endif
645
646 #define YYPACT_NINF (-46)
647
648 #define yypact_value_is_default(Yyn) \
649 ((Yyn) == YYPACT_NINF)
650
651 #define YYTABLE_NINF (-1)
652
653 #define yytable_value_is_error(Yyn) \
654 0
655
656 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
657 STATE-NUM. */
658 static const yytype_int8 yypact[] =
659 {
660 16, 13, 21, 16, 15, 40, -46, -46, -3, 15,
661 26, 15, 25, -46, -46, -6, -3, -46, -46, -46,
662 38, 38, 59, -46, -46, -6, -6, -6, -46, 35,
663 -46, 2, 69, 44, 55, 52, 68, -2, 100, 64,
664 -19, -46, 75, -46, -46, -46, 86, 86, 86, 38,
665 38, 38, -46, -46, -46, -46, -6, -6, -6, -6,
666 -6, -6, -6, -6, -6, -6, -6, -6, -6, -6,
667 -6, -6, -6, -6, -6, -46, 73, 85, 92, 38,
668 -46, -46, -46, 69, 60, 44, 55, 52, 68, -2,
669 -2, 100, 100, 100, 100, 64, 64, -19, -19, -46,
670 -46, -46, 104, 105, 76, 74, 73, -46, 94, 73,
671 -46, -46, -46, -6, 98, 99, 38, 76, -46, -46,
672 -46, -46, -46, -46, 101, -46, -46, -46, -46, -46,
673 -5, 23, -46, -46, -46, -46, 108, -46, -46, 95,
674 -46, -46, -46, 45, 66, 107, 32, -46, -46, -46,
675 -46, -46, 77, -46, -46, -46, -3, -46, 96, -3,
676 97, -46
677 };
678
679 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
680 Performed when YYTABLE does not specify something else to do. Zero
681 means the default is an error. */
682 static const yytype_int8 yydefact[] =
683 {
684 0, 0, 0, 5, 7, 3, 1, 6, 0, 0,
685 21, 7, 0, 44, 45, 0, 0, 10, 11, 12,
686 0, 0, 2, 8, 4, 0, 0, 0, 78, 0,
687 47, 48, 50, 52, 54, 56, 58, 60, 63, 70,
688 73, 77, 0, 23, 13, 15, 0, 0, 0, 0,
689 0, 0, 79, 80, 81, 46, 0, 0, 0, 0,
690 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
691 0, 0, 0, 0, 0, 9, 85, 0, 0, 0,
692 18, 17, 14, 51, 0, 53, 55, 57, 59, 61,
693 62, 66, 67, 65, 64, 68, 69, 71, 72, 75,
694 74, 76, 0, 0, 0, 0, 0, 24, 0, 85,
695 19, 20, 16, 0, 0, 0, 0, 0, 90, 26,
696 36, 88, 28, 91, 0, 87, 86, 49, 27, 89,
697 0, 0, 22, 35, 25, 37, 0, 29, 38, 0,
698 82, 40, 32, 0, 0, 0, 0, 43, 30, 42,
699 41, 39, 0, 83, 84, 31, 0, 34, 0, 0,
700 0, 33
701 };
702
703 /* YYPGOTO[NTERM-NUM]. */
704 static const yytype_int16 yypgoto[] =
705 {
706 -46, -46, -46, 128, 122, 127, -45, -46, -16, -46,
707 -35, -46, -46, -46, -8, 80, 27, -46, 82, 81,
708 83, 84, 88, 53, -41, 49, 50, -15, -46, 34,
709 -44
710 };
711
712 /* YYDEFGOTO[NTERM-NUM]. */
713 static const yytype_uint8 yydefgoto[] =
714 {
715 0, 2, 3, 4, 10, 11, 21, 22, 121, 76,
716 107, 130, 131, 143, 28, 29, 30, 31, 32, 33,
717 34, 35, 36, 37, 38, 39, 40, 41, 146, 108,
718 109
719 };
720
721 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
722 positive, shift that token. If negative, reduce the rule whose
723 number is the opposite. If YYTABLE_NINF, syntax error. */
724 static const yytype_uint8 yytable[] =
725 {
726 16, 77, 78, 79, 44, 45, 64, 65, 42, 72,
727 52, 53, 54, 13, 14, 56, 13, 14, 133, 1,
728 8, 6, 134, 91, 92, 93, 94, 73, 74, 15,
729 66, 135, 15, 80, 81, 82, 67, 136, 9, 25,
730 5, 57, 26, 27, 12, 137, 138, 18, 19, 139,
731 18, 19, 24, 153, 20, 154, 140, 99, 100, 101,
732 118, 141, 123, 112, 13, 14, 155, 43, 147, 18,
733 19, 122, 55, 123, 125, 46, 47, 148, 62, 63,
734 15, 58, 48, 49, 50, 59, 142, 51, 102, 103,
735 104, 105, 103, 104, 116, 61, 106, 60, 149, 117,
736 113, 119, 75, 43, 151, 120, 68, 69, 70, 71,
737 18, 19, 110, 156, 157, 89, 90, 95, 96, 111,
738 97, 98, 114, 115, 124, 128, 129, 144, 132, 152,
739 145, 7, 159, 23, 161, 150, 17, 84, 83, 85,
740 127, 0, 86, 126, 87, 0, 0, 0, 158, 88,
741 0, 160
742 };
743
744 static const yytype_int16 yycheck[] =
745 {
746 8, 46, 47, 48, 20, 21, 8, 9, 16, 28,
747 25, 26, 27, 19, 20, 13, 19, 20, 23, 3,
748 5, 0, 27, 64, 65, 66, 67, 46, 47, 35,
749 32, 36, 35, 49, 50, 51, 38, 14, 23, 45,
750 27, 39, 48, 49, 4, 22, 23, 24, 25, 26,
751 24, 25, 27, 21, 28, 23, 33, 72, 73, 74,
752 104, 38, 106, 79, 19, 20, 34, 29, 23, 24,
753 25, 106, 37, 117, 109, 16, 17, 32, 10, 11,
754 35, 12, 23, 24, 25, 41, 131, 28, 15, 16,
755 17, 18, 16, 17, 18, 43, 23, 42, 143, 23,
756 40, 27, 27, 29, 38, 31, 6, 7, 44, 45,
757 24, 25, 27, 36, 37, 62, 63, 68, 69, 27,
758 70, 71, 18, 18, 30, 27, 27, 19, 27, 22,
759 35, 3, 36, 11, 37, 143, 9, 57, 56, 58,
760 113, -1, 59, 109, 60, -1, -1, -1, 156, 61,
761 -1, 159
762 };
763
764 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
765 state STATE-NUM. */
766 static const yytype_int8 yystos[] =
767 {
768 0, 3, 51, 52, 53, 27, 0, 53, 5, 23,
769 54, 55, 4, 19, 20, 35, 64, 55, 24, 25,
770 28, 56, 57, 54, 27, 45, 48, 49, 64, 65,
771 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
772 76, 77, 64, 29, 58, 58, 16, 17, 23, 24,
773 25, 28, 77, 77, 77, 37, 13, 39, 12, 41,
774 42, 43, 10, 11, 8, 9, 32, 38, 6, 7,
775 44, 45, 28, 46, 47, 27, 59, 56, 56, 56,
776 58, 58, 58, 68, 65, 69, 70, 71, 72, 73,
777 73, 74, 74, 74, 74, 75, 75, 76, 76, 77,
778 77, 77, 15, 16, 17, 18, 23, 60, 79, 80,
779 27, 27, 58, 40, 18, 18, 18, 23, 80, 27,
780 31, 58, 60, 80, 30, 60, 79, 66, 27, 27,
781 61, 62, 27, 23, 27, 36, 14, 22, 23, 26,
782 33, 38, 56, 63, 19, 35, 78, 23, 32, 56,
783 64, 38, 22, 21, 23, 34, 36, 37, 64, 36,
784 64, 37
785 };
786
787 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
788 static const yytype_int8 yyr1[] =
789 {
790 0, 50, 51, 52, 52, 53, 53, 54, 54, 55,
791 55, 56, 56, 57, 57, 57, 57, 57, 57, 57,
792 57, 57, 58, 59, 59, 60, 60, 60, 60, 61,
793 61, 61, 61, 61, 61, 61, 62, 62, 62, 63,
794 63, 63, 63, 63, 64, 64, 64, 65, 66, 66,
795 67, 67, 68, 68, 69, 69, 70, 70, 71, 71,
796 72, 72, 72, 73, 73, 73, 73, 73, 74, 74,
797 74, 75, 75, 75, 76, 76, 76, 76, 77, 77,
798 77, 77, 78, 78, 78, 79, 79, 79, 80, 80,
799 80, 80
800 };
801
802 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
803 static const yytype_int8 yyr2[] =
804 {
805 0, 2, 3, 2, 4, 1, 2, 0, 2, 4,
806 2, 1, 1, 2, 3, 2, 4, 3, 3, 4,
807 4, 0, 5, 0, 2, 4, 2, 3, 2, 2,
808 3, 4, 2, 9, 5, 2, 0, 2, 2, 3,
809 1, 2, 2, 2, 1, 1, 3, 1, 1, 5,
810 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
811 1, 3, 3, 1, 3, 3, 3, 3, 3, 3,
812 1, 3, 3, 1, 3, 3, 3, 1, 1, 2,
813 2, 2, 0, 2, 2, 0, 2, 2, 2, 3,
814 2, 2
815 };
816
817
818 enum { YYENOMEM = -2 };
819
820 #define yyerrok (yyerrstatus = 0)
821 #define yyclearin (yychar = YYEMPTY)
822
823 #define YYACCEPT goto yyacceptlab
824 #define YYABORT goto yyabortlab
825 #define YYERROR goto yyerrorlab
826 #define YYNOMEM goto yyexhaustedlab
827
828
829 #define YYRECOVERING() (!!yyerrstatus)
830
831 #define YYBACKUP(Token, Value) \
832 do \
833 if (yychar == YYEMPTY) \
834 { \
835 yychar = (Token); \
836 yylval = (Value); \
837 YYPOPSTACK (yylen); \
838 yystate = *yyssp; \
839 goto yybackup; \
840 } \
841 else \
842 { \
843 yyerror (YY_("syntax error: cannot back up")); \
844 YYERROR; \
845 } \
846 while (0)
847
848 /* Backward compatibility with an undocumented macro.
849 Use YYerror or YYUNDEF. */
850 #define YYERRCODE YYUNDEF
851
852 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
853 If N is 0, then set CURRENT to the empty location which ends
854 the previous symbol: RHS[0] (always defined). */
855
856 #ifndef YYLLOC_DEFAULT
857 # define YYLLOC_DEFAULT(Current, Rhs, N) \
858 do \
859 if (N) \
860 { \
861 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
862 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
863 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
864 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
865 } \
866 else \
867 { \
868 (Current).first_line = (Current).last_line = \
869 YYRHSLOC (Rhs, 0).last_line; \
870 (Current).first_column = (Current).last_column = \
871 YYRHSLOC (Rhs, 0).last_column; \
872 } \
873 while (0)
874 #endif
875
876 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
877
878
879 /* Enable debugging if requested. */
880 #if YYDEBUG
881
882 # ifndef YYFPRINTF
883 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
884 # define YYFPRINTF fprintf
885 # endif
886
887 # define YYDPRINTF(Args) \
888 do { \
889 if (yydebug) \
890 YYFPRINTF Args; \
891 } while (0)
892
893
894 /* YYLOCATION_PRINT -- Print the location on the stream.
895 This macro was not mandated originally: define only if we know
896 we won't break user code: when these are the locations we know. */
897
898 # ifndef YYLOCATION_PRINT
899
900 # if defined YY_LOCATION_PRINT
901
902 /* Temporary convenience wrapper in case some people defined the
903 undocumented and private YY_LOCATION_PRINT macros. */
904 # define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc))
905
906 # elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
907
908 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
909
910 YY_ATTRIBUTE_UNUSED
911 static int
yy_location_print_(FILE * yyo,YYLTYPE const * const yylocp)912 yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
913 {
914 int res = 0;
915 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
916 if (0 <= yylocp->first_line)
917 {
918 res += YYFPRINTF (yyo, "%d", yylocp->first_line);
919 if (0 <= yylocp->first_column)
920 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
921 }
922 if (0 <= yylocp->last_line)
923 {
924 if (yylocp->first_line < yylocp->last_line)
925 {
926 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
927 if (0 <= end_col)
928 res += YYFPRINTF (yyo, ".%d", end_col);
929 }
930 else if (0 <= end_col && yylocp->first_column < end_col)
931 res += YYFPRINTF (yyo, "-%d", end_col);
932 }
933 return res;
934 }
935
936 # define YYLOCATION_PRINT yy_location_print_
937
938 /* Temporary convenience wrapper in case some people defined the
939 undocumented and private YY_LOCATION_PRINT macros. */
940 # define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc))
941
942 # else
943
944 # define YYLOCATION_PRINT(File, Loc) ((void) 0)
945 /* Temporary convenience wrapper in case some people defined the
946 undocumented and private YY_LOCATION_PRINT macros. */
947 # define YY_LOCATION_PRINT YYLOCATION_PRINT
948
949 # endif
950 # endif /* !defined YYLOCATION_PRINT */
951
952
953 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
954 do { \
955 if (yydebug) \
956 { \
957 YYFPRINTF (stderr, "%s ", Title); \
958 yy_symbol_print (stderr, \
959 Kind, Value, Location); \
960 YYFPRINTF (stderr, "\n"); \
961 } \
962 } while (0)
963
964
965 /*-----------------------------------.
966 | Print this symbol's value on YYO. |
967 `-----------------------------------*/
968
969 static void
yy_symbol_value_print(FILE * yyo,yysymbol_kind_t yykind,YYSTYPE const * const yyvaluep,YYLTYPE const * const yylocationp)970 yy_symbol_value_print (FILE *yyo,
971 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
972 {
973 FILE *yyoutput = yyo;
974 YY_USE (yyoutput);
975 YY_USE (yylocationp);
976 if (!yyvaluep)
977 return;
978 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
979 YY_USE (yykind);
980 YY_IGNORE_MAYBE_UNINITIALIZED_END
981 }
982
983
984 /*---------------------------.
985 | Print this symbol on YYO. |
986 `---------------------------*/
987
988 static void
yy_symbol_print(FILE * yyo,yysymbol_kind_t yykind,YYSTYPE const * const yyvaluep,YYLTYPE const * const yylocationp)989 yy_symbol_print (FILE *yyo,
990 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
991 {
992 YYFPRINTF (yyo, "%s %s (",
993 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
994
995 YYLOCATION_PRINT (yyo, yylocationp);
996 YYFPRINTF (yyo, ": ");
997 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp);
998 YYFPRINTF (yyo, ")");
999 }
1000
1001 /*------------------------------------------------------------------.
1002 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1003 | TOP (included). |
1004 `------------------------------------------------------------------*/
1005
1006 static void
yy_stack_print(yy_state_t * yybottom,yy_state_t * yytop)1007 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1008 {
1009 YYFPRINTF (stderr, "Stack now");
1010 for (; yybottom <= yytop; yybottom++)
1011 {
1012 int yybot = *yybottom;
1013 YYFPRINTF (stderr, " %d", yybot);
1014 }
1015 YYFPRINTF (stderr, "\n");
1016 }
1017
1018 # define YY_STACK_PRINT(Bottom, Top) \
1019 do { \
1020 if (yydebug) \
1021 yy_stack_print ((Bottom), (Top)); \
1022 } while (0)
1023
1024
1025 /*------------------------------------------------.
1026 | Report that the YYRULE is going to be reduced. |
1027 `------------------------------------------------*/
1028
1029 static void
yy_reduce_print(yy_state_t * yyssp,YYSTYPE * yyvsp,YYLTYPE * yylsp,int yyrule)1030 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
1031 int yyrule)
1032 {
1033 int yylno = yyrline[yyrule];
1034 int yynrhs = yyr2[yyrule];
1035 int yyi;
1036 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1037 yyrule - 1, yylno);
1038 /* The symbols being reduced. */
1039 for (yyi = 0; yyi < yynrhs; yyi++)
1040 {
1041 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1042 yy_symbol_print (stderr,
1043 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1044 &yyvsp[(yyi + 1) - (yynrhs)],
1045 &(yylsp[(yyi + 1) - (yynrhs)]));
1046 YYFPRINTF (stderr, "\n");
1047 }
1048 }
1049
1050 # define YY_REDUCE_PRINT(Rule) \
1051 do { \
1052 if (yydebug) \
1053 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
1054 } while (0)
1055
1056 /* Nonzero means print parse trace. It is left uninitialized so that
1057 multiple parsers can coexist. */
1058 int yydebug;
1059 #else /* !YYDEBUG */
1060 # define YYDPRINTF(Args) ((void) 0)
1061 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1062 # define YY_STACK_PRINT(Bottom, Top)
1063 # define YY_REDUCE_PRINT(Rule)
1064 #endif /* !YYDEBUG */
1065
1066
1067 /* YYINITDEPTH -- initial size of the parser's stacks. */
1068 #ifndef YYINITDEPTH
1069 # define YYINITDEPTH 200
1070 #endif
1071
1072 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1073 if the built-in stack extension method is used).
1074
1075 Do not make this value too large; the results are undefined if
1076 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1077 evaluated with infinite-precision integer arithmetic. */
1078
1079 #ifndef YYMAXDEPTH
1080 # define YYMAXDEPTH 10000
1081 #endif
1082
1083
1084
1085
1086
1087
1088 /*-----------------------------------------------.
1089 | Release the memory associated to this symbol. |
1090 `-----------------------------------------------*/
1091
1092 static void
yydestruct(const char * yymsg,yysymbol_kind_t yykind,YYSTYPE * yyvaluep,YYLTYPE * yylocationp)1093 yydestruct (const char *yymsg,
1094 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
1095 {
1096 YY_USE (yyvaluep);
1097 YY_USE (yylocationp);
1098 if (!yymsg)
1099 yymsg = "Deleting";
1100 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1101
1102 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1103 YY_USE (yykind);
1104 YY_IGNORE_MAYBE_UNINITIALIZED_END
1105 }
1106
1107
1108 /* Lookahead token kind. */
1109 int yychar;
1110
1111 /* The semantic value of the lookahead symbol. */
1112 YYSTYPE yylval;
1113 /* Location data for the lookahead symbol. */
1114 YYLTYPE yylloc
1115 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1116 = { 1, 1, 1, 1 }
1117 # endif
1118 ;
1119 /* Number of syntax errors so far. */
1120 int yynerrs;
1121
1122
1123
1124
1125 /*----------.
1126 | yyparse. |
1127 `----------*/
1128
1129 int
yyparse(void)1130 yyparse (void)
1131 {
1132 yy_state_fast_t yystate = 0;
1133 /* Number of tokens to shift before error messages enabled. */
1134 int yyerrstatus = 0;
1135
1136 /* Refer to the stacks through separate pointers, to allow yyoverflow
1137 to reallocate them elsewhere. */
1138
1139 /* Their size. */
1140 YYPTRDIFF_T yystacksize = YYINITDEPTH;
1141
1142 /* The state stack: array, bottom, top. */
1143 yy_state_t yyssa[YYINITDEPTH];
1144 yy_state_t *yyss = yyssa;
1145 yy_state_t *yyssp = yyss;
1146
1147 /* The semantic value stack: array, bottom, top. */
1148 YYSTYPE yyvsa[YYINITDEPTH];
1149 YYSTYPE *yyvs = yyvsa;
1150 YYSTYPE *yyvsp = yyvs;
1151
1152 /* The location stack: array, bottom, top. */
1153 YYLTYPE yylsa[YYINITDEPTH];
1154 YYLTYPE *yyls = yylsa;
1155 YYLTYPE *yylsp = yyls;
1156
1157 int yyn;
1158 /* The return value of yyparse. */
1159 int yyresult;
1160 /* Lookahead symbol kind. */
1161 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1162 /* The variables used to return semantic value and location from the
1163 action routines. */
1164 YYSTYPE yyval;
1165 YYLTYPE yyloc;
1166
1167 /* The locations where the error started and ended. */
1168 YYLTYPE yyerror_range[3];
1169
1170
1171
1172 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1173
1174 /* The number of symbols on the RHS of the reduced rule.
1175 Keep to zero when no symbol should be popped. */
1176 int yylen = 0;
1177
1178 YYDPRINTF ((stderr, "Starting parse\n"));
1179
1180 yychar = YYEMPTY; /* Cause a token to be read. */
1181
1182 yylsp[0] = yylloc;
1183 goto yysetstate;
1184
1185
1186 /*------------------------------------------------------------.
1187 | yynewstate -- push a new state, which is found in yystate. |
1188 `------------------------------------------------------------*/
1189 yynewstate:
1190 /* In all cases, when you get here, the value and location stacks
1191 have just been pushed. So pushing a state here evens the stacks. */
1192 yyssp++;
1193
1194
1195 /*--------------------------------------------------------------------.
1196 | yysetstate -- set current state (the top of the stack) to yystate. |
1197 `--------------------------------------------------------------------*/
1198 yysetstate:
1199 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1200 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1201 YY_IGNORE_USELESS_CAST_BEGIN
1202 *yyssp = YY_CAST (yy_state_t, yystate);
1203 YY_IGNORE_USELESS_CAST_END
1204 YY_STACK_PRINT (yyss, yyssp);
1205
1206 if (yyss + yystacksize - 1 <= yyssp)
1207 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1208 YYNOMEM;
1209 #else
1210 {
1211 /* Get the current used size of the three stacks, in elements. */
1212 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1213
1214 # if defined yyoverflow
1215 {
1216 /* Give user a chance to reallocate the stack. Use copies of
1217 these so that the &'s don't force the real ones into
1218 memory. */
1219 yy_state_t *yyss1 = yyss;
1220 YYSTYPE *yyvs1 = yyvs;
1221 YYLTYPE *yyls1 = yyls;
1222
1223 /* Each stack pointer address is followed by the size of the
1224 data in use in that stack, in bytes. This used to be a
1225 conditional around just the two extra args, but that might
1226 be undefined if yyoverflow is a macro. */
1227 yyoverflow (YY_("memory exhausted"),
1228 &yyss1, yysize * YYSIZEOF (*yyssp),
1229 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1230 &yyls1, yysize * YYSIZEOF (*yylsp),
1231 &yystacksize);
1232 yyss = yyss1;
1233 yyvs = yyvs1;
1234 yyls = yyls1;
1235 }
1236 # else /* defined YYSTACK_RELOCATE */
1237 /* Extend the stack our own way. */
1238 if (YYMAXDEPTH <= yystacksize)
1239 YYNOMEM;
1240 yystacksize *= 2;
1241 if (YYMAXDEPTH < yystacksize)
1242 yystacksize = YYMAXDEPTH;
1243
1244 {
1245 yy_state_t *yyss1 = yyss;
1246 union yyalloc *yyptr =
1247 YY_CAST (union yyalloc *,
1248 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1249 if (! yyptr)
1250 YYNOMEM;
1251 YYSTACK_RELOCATE (yyss_alloc, yyss);
1252 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1253 YYSTACK_RELOCATE (yyls_alloc, yyls);
1254 # undef YYSTACK_RELOCATE
1255 if (yyss1 != yyssa)
1256 YYSTACK_FREE (yyss1);
1257 }
1258 # endif
1259
1260 yyssp = yyss + yysize - 1;
1261 yyvsp = yyvs + yysize - 1;
1262 yylsp = yyls + yysize - 1;
1263
1264 YY_IGNORE_USELESS_CAST_BEGIN
1265 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1266 YY_CAST (long, yystacksize)));
1267 YY_IGNORE_USELESS_CAST_END
1268
1269 if (yyss + yystacksize - 1 <= yyssp)
1270 YYABORT;
1271 }
1272 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1273
1274
1275 if (yystate == YYFINAL)
1276 YYACCEPT;
1277
1278 goto yybackup;
1279
1280
1281 /*-----------.
1282 | yybackup. |
1283 `-----------*/
1284 yybackup:
1285 /* Do appropriate processing given the current state. Read a
1286 lookahead token if we need one and don't already have one. */
1287
1288 /* First try to decide what to do without reference to lookahead token. */
1289 yyn = yypact[yystate];
1290 if (yypact_value_is_default (yyn))
1291 goto yydefault;
1292
1293 /* Not known => get a lookahead token if don't already have one. */
1294
1295 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1296 if (yychar == YYEMPTY)
1297 {
1298 YYDPRINTF ((stderr, "Reading a token\n"));
1299 yychar = yylex ();
1300 }
1301
1302 if (yychar <= YYEOF)
1303 {
1304 yychar = YYEOF;
1305 yytoken = YYSYMBOL_YYEOF;
1306 YYDPRINTF ((stderr, "Now at end of input.\n"));
1307 }
1308 else if (yychar == YYerror)
1309 {
1310 /* The scanner already issued an error message, process directly
1311 to error recovery. But do not keep the error token as
1312 lookahead, it is too special and may lead us to an endless
1313 loop in error recovery. */
1314 yychar = YYUNDEF;
1315 yytoken = YYSYMBOL_YYerror;
1316 yyerror_range[1] = yylloc;
1317 goto yyerrlab1;
1318 }
1319 else
1320 {
1321 yytoken = YYTRANSLATE (yychar);
1322 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1323 }
1324
1325 /* If the proper action on seeing token YYTOKEN is to reduce or to
1326 detect an error, take that action. */
1327 yyn += yytoken;
1328 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1329 goto yydefault;
1330 yyn = yytable[yyn];
1331 if (yyn <= 0)
1332 {
1333 if (yytable_value_is_error (yyn))
1334 goto yyerrlab;
1335 yyn = -yyn;
1336 goto yyreduce;
1337 }
1338
1339 /* Count tokens shifted since error; after three, turn off error
1340 status. */
1341 if (yyerrstatus)
1342 yyerrstatus--;
1343
1344 /* Shift the lookahead token. */
1345 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1346 yystate = yyn;
1347 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1348 *++yyvsp = yylval;
1349 YY_IGNORE_MAYBE_UNINITIALIZED_END
1350 *++yylsp = yylloc;
1351
1352 /* Discard the shifted token. */
1353 yychar = YYEMPTY;
1354 goto yynewstate;
1355
1356
1357 /*-----------------------------------------------------------.
1358 | yydefault -- do the default action for the current state. |
1359 `-----------------------------------------------------------*/
1360 yydefault:
1361 yyn = yydefact[yystate];
1362 if (yyn == 0)
1363 goto yyerrlab;
1364 goto yyreduce;
1365
1366
1367 /*-----------------------------.
1368 | yyreduce -- do a reduction. |
1369 `-----------------------------*/
1370 yyreduce:
1371 /* yyn is the number of a rule to reduce with. */
1372 yylen = yyr2[yyn];
1373
1374 /* If YYLEN is nonzero, implement the default value of the action:
1375 '$$ = $1'.
1376
1377 Otherwise, the following line sets YYVAL to garbage.
1378 This behavior is undocumented and Bison
1379 users should not rely upon it. Assigning to YYVAL
1380 unconditionally makes the parser a bit smaller, and it avoids a
1381 GCC warning that YYVAL may be used uninitialized. */
1382 yyval = yyvsp[1-yylen];
1383
1384 /* Default location. */
1385 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1386 yyerror_range[1] = yyloc;
1387 YY_REDUCE_PRINT (yyn);
1388 switch (yyn)
1389 {
1390 case 2: /* sourcefile: headers memreserves devicetree */
1391 #line 108 "external/dtc/dtc-parser.y"
1392 {
1393 parser_output = build_dt_info((yyvsp[-2].flags), (yyvsp[-1].re), (yyvsp[0].node),
1394 guess_boot_cpuid((yyvsp[0].node)));
1395 }
1396 #line 1397 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1397 break;
1398
1399 case 3: /* header: DT_V1 ';' */
1400 #line 116 "external/dtc/dtc-parser.y"
1401 {
1402 (yyval.flags) = DTSF_V1;
1403 }
1404 #line 1405 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1405 break;
1406
1407 case 4: /* header: DT_V1 ';' DT_PLUGIN ';' */
1408 #line 120 "external/dtc/dtc-parser.y"
1409 {
1410 (yyval.flags) = DTSF_V1 | DTSF_PLUGIN;
1411 }
1412 #line 1413 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1413 break;
1414
1415 case 6: /* headers: header headers */
1416 #line 128 "external/dtc/dtc-parser.y"
1417 {
1418 if ((yyvsp[0].flags) != (yyvsp[-1].flags))
1419 ERROR(&(yylsp[0]), "Header flags don't match earlier ones");
1420 (yyval.flags) = (yyvsp[-1].flags);
1421 }
1422 #line 1423 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1423 break;
1424
1425 case 7: /* memreserves: %empty */
1426 #line 137 "external/dtc/dtc-parser.y"
1427 {
1428 (yyval.re) = NULL;
1429 }
1430 #line 1431 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1431 break;
1432
1433 case 8: /* memreserves: memreserve memreserves */
1434 #line 141 "external/dtc/dtc-parser.y"
1435 {
1436 (yyval.re) = chain_reserve_entry((yyvsp[-1].re), (yyvsp[0].re));
1437 }
1438 #line 1439 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1439 break;
1440
1441 case 9: /* memreserve: DT_MEMRESERVE integer_prim integer_prim ';' */
1442 #line 148 "external/dtc/dtc-parser.y"
1443 {
1444 (yyval.re) = build_reserve_entry((yyvsp[-2].integer), (yyvsp[-1].integer));
1445 }
1446 #line 1447 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1447 break;
1448
1449 case 10: /* memreserve: DT_LABEL memreserve */
1450 #line 152 "external/dtc/dtc-parser.y"
1451 {
1452 add_label(&(yyvsp[0].re)->labels, (yyvsp[-1].labelref));
1453 (yyval.re) = (yyvsp[0].re);
1454 }
1455 #line 1456 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1456 break;
1457
1458 case 13: /* devicetree: '/' nodedef */
1459 #line 162 "external/dtc/dtc-parser.y"
1460 {
1461 (yyval.node) = name_node((yyvsp[0].node), "");
1462 }
1463 #line 1464 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1464 break;
1465
1466 case 14: /* devicetree: devicetree '/' nodedef */
1467 #line 166 "external/dtc/dtc-parser.y"
1468 {
1469 (yyval.node) = merge_nodes((yyvsp[-2].node), (yyvsp[0].node));
1470 }
1471 #line 1472 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1472 break;
1473
1474 case 15: /* devicetree: dt_ref nodedef */
1475 #line 170 "external/dtc/dtc-parser.y"
1476 {
1477 /*
1478 * We rely on the rule being always:
1479 * versioninfo plugindecl memreserves devicetree
1480 * so $-1 is what we want (plugindecl)
1481 */
1482 if (!((yyvsp[(-1) - (2)].flags) & DTSF_PLUGIN))
1483 ERROR(&(yylsp[0]), "Label or path %s not found", (yyvsp[-1].labelref));
1484 else if (is_ref_relative((yyvsp[-1].labelref)))
1485 ERROR(&(yylsp[0]), "Label-relative reference %s not supported in plugin", (yyvsp[-1].labelref));
1486 (yyval.node) = add_orphan_node(
1487 name_node(build_node(NULL, NULL, NULL),
1488 ""),
1489 (yyvsp[0].node), (yyvsp[-1].labelref));
1490 }
1491 #line 1492 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1492 break;
1493
1494 case 16: /* devicetree: devicetree DT_LABEL dt_ref nodedef */
1495 #line 186 "external/dtc/dtc-parser.y"
1496 {
1497 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1498
1499 if (((yyvsp[(-1) - (4)].flags) & DTSF_PLUGIN) && is_ref_relative((yyvsp[-1].labelref)))
1500 ERROR(&(yylsp[-2]), "Label-relative reference %s not supported in plugin", (yyvsp[-1].labelref));
1501
1502 if (target) {
1503 add_label(&target->labels, (yyvsp[-2].labelref));
1504 merge_nodes(target, (yyvsp[0].node));
1505 } else
1506 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1507 (yyval.node) = (yyvsp[-3].node);
1508 }
1509 #line 1510 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1510 break;
1511
1512 case 17: /* devicetree: devicetree DT_PATH_REF nodedef */
1513 #line 200 "external/dtc/dtc-parser.y"
1514 {
1515 /*
1516 * We rely on the rule being always:
1517 * versioninfo plugindecl memreserves devicetree
1518 * so $-1 is what we want (plugindecl)
1519 */
1520 if ((yyvsp[(-1) - (3)].flags) & DTSF_PLUGIN) {
1521 if (is_ref_relative((yyvsp[-1].labelref)))
1522 ERROR(&(yylsp[-1]), "Label-relative reference %s not supported in plugin", (yyvsp[-1].labelref));
1523 add_orphan_node((yyvsp[-2].node), (yyvsp[0].node), (yyvsp[-1].labelref));
1524 } else {
1525 struct node *target = get_node_by_ref((yyvsp[-2].node), (yyvsp[-1].labelref));
1526
1527 if (target)
1528 merge_nodes(target, (yyvsp[0].node));
1529 else
1530 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1531 }
1532 (yyval.node) = (yyvsp[-2].node);
1533 }
1534 #line 1535 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1535 break;
1536
1537 case 18: /* devicetree: devicetree DT_LABEL_REF nodedef */
1538 #line 221 "external/dtc/dtc-parser.y"
1539 {
1540 struct node *target = get_node_by_ref((yyvsp[-2].node), (yyvsp[-1].labelref));
1541
1542 if (target) {
1543 merge_nodes(target, (yyvsp[0].node));
1544 } else {
1545 /*
1546 * We rely on the rule being always:
1547 * versioninfo plugindecl memreserves devicetree
1548 * so $-1 is what we want (plugindecl)
1549 */
1550 if ((yyvsp[(-1) - (3)].flags) & DTSF_PLUGIN)
1551 add_orphan_node((yyvsp[-2].node), (yyvsp[0].node), (yyvsp[-1].labelref));
1552 else
1553 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1554 }
1555 (yyval.node) = (yyvsp[-2].node);
1556 }
1557 #line 1558 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1558 break;
1559
1560 case 19: /* devicetree: devicetree DT_DEL_NODE dt_ref ';' */
1561 #line 240 "external/dtc/dtc-parser.y"
1562 {
1563 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1564
1565 if (target)
1566 delete_node(target);
1567 else
1568 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1569
1570
1571 (yyval.node) = (yyvsp[-3].node);
1572 }
1573 #line 1574 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1574 break;
1575
1576 case 20: /* devicetree: devicetree DT_OMIT_NO_REF dt_ref ';' */
1577 #line 252 "external/dtc/dtc-parser.y"
1578 {
1579 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1580
1581 if (target)
1582 omit_node_if_unused(target);
1583 else
1584 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1585
1586
1587 (yyval.node) = (yyvsp[-3].node);
1588 }
1589 #line 1590 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1590 break;
1591
1592 case 21: /* devicetree: %empty */
1593 #line 264 "external/dtc/dtc-parser.y"
1594 {
1595 /* build empty node */
1596 (yyval.node) = name_node(build_node(NULL, NULL, NULL), "");
1597 }
1598 #line 1599 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1599 break;
1600
1601 case 22: /* nodedef: '{' proplist subnodes '}' ';' */
1602 #line 272 "external/dtc/dtc-parser.y"
1603 {
1604 (yyval.node) = build_node((yyvsp[-3].proplist), (yyvsp[-2].nodelist), &(yyloc));
1605 }
1606 #line 1607 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1607 break;
1608
1609 case 23: /* proplist: %empty */
1610 #line 279 "external/dtc/dtc-parser.y"
1611 {
1612 (yyval.proplist) = NULL;
1613 }
1614 #line 1615 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1615 break;
1616
1617 case 24: /* proplist: proplist propdef */
1618 #line 283 "external/dtc/dtc-parser.y"
1619 {
1620 (yyval.proplist) = chain_property((yyvsp[0].prop), (yyvsp[-1].proplist));
1621 }
1622 #line 1623 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1623 break;
1624
1625 case 25: /* propdef: DT_PROPNODENAME '=' propdata ';' */
1626 #line 290 "external/dtc/dtc-parser.y"
1627 {
1628 (yyval.prop) = build_property((yyvsp[-3].propnodename), (yyvsp[-1].data), &(yyloc));
1629 }
1630 #line 1631 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1631 break;
1632
1633 case 26: /* propdef: DT_PROPNODENAME ';' */
1634 #line 294 "external/dtc/dtc-parser.y"
1635 {
1636 (yyval.prop) = build_property((yyvsp[-1].propnodename), empty_data, &(yyloc));
1637 }
1638 #line 1639 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1639 break;
1640
1641 case 27: /* propdef: DT_DEL_PROP DT_PROPNODENAME ';' */
1642 #line 298 "external/dtc/dtc-parser.y"
1643 {
1644 (yyval.prop) = build_property_delete((yyvsp[-1].propnodename));
1645 }
1646 #line 1647 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1647 break;
1648
1649 case 28: /* propdef: DT_LABEL propdef */
1650 #line 302 "external/dtc/dtc-parser.y"
1651 {
1652 add_label(&(yyvsp[0].prop)->labels, (yyvsp[-1].labelref));
1653 (yyval.prop) = (yyvsp[0].prop);
1654 }
1655 #line 1656 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1656 break;
1657
1658 case 29: /* propdata: propdataprefix DT_STRING */
1659 #line 310 "external/dtc/dtc-parser.y"
1660 {
1661 (yyval.data) = data_merge((yyvsp[-1].data), (yyvsp[0].data));
1662 }
1663 #line 1664 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1664 break;
1665
1666 case 30: /* propdata: propdataprefix arrayprefix '>' */
1667 #line 314 "external/dtc/dtc-parser.y"
1668 {
1669 (yyval.data) = data_merge((yyvsp[-2].data), (yyvsp[-1].array).data);
1670 }
1671 #line 1672 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1672 break;
1673
1674 case 31: /* propdata: propdataprefix '[' bytestring ']' */
1675 #line 318 "external/dtc/dtc-parser.y"
1676 {
1677 (yyval.data) = data_merge((yyvsp[-3].data), (yyvsp[-1].data));
1678 }
1679 #line 1680 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1680 break;
1681
1682 case 32: /* propdata: propdataprefix dt_ref */
1683 #line 322 "external/dtc/dtc-parser.y"
1684 {
1685 (yyvsp[-1].data) = data_add_marker((yyvsp[-1].data), TYPE_STRING, (yyvsp[0].labelref));
1686 (yyval.data) = data_add_marker((yyvsp[-1].data), REF_PATH, (yyvsp[0].labelref));
1687 }
1688 #line 1689 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1689 break;
1690
1691 case 33: /* propdata: propdataprefix DT_INCBIN '(' DT_STRING ',' integer_prim ',' integer_prim ')' */
1692 #line 327 "external/dtc/dtc-parser.y"
1693 {
1694 FILE *f = srcfile_relative_open((yyvsp[-5].data).val, NULL);
1695 struct data d;
1696
1697 if ((yyvsp[-3].integer) != 0)
1698 if (fseek(f, (yyvsp[-3].integer), SEEK_SET) != 0)
1699 die("Couldn't seek to offset %llu in \"%s\": %s",
1700 (unsigned long long)(yyvsp[-3].integer), (yyvsp[-5].data).val,
1701 strerror(errno));
1702
1703 d = data_copy_file(f, (yyvsp[-1].integer));
1704
1705 (yyval.data) = data_merge((yyvsp[-8].data), d);
1706 fclose(f);
1707 }
1708 #line 1709 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1709 break;
1710
1711 case 34: /* propdata: propdataprefix DT_INCBIN '(' DT_STRING ')' */
1712 #line 343 "external/dtc/dtc-parser.y"
1713 {
1714 FILE *f = srcfile_relative_open((yyvsp[-1].data).val, NULL);
1715 struct data d = empty_data;
1716
1717 d = data_copy_file(f, -1);
1718
1719 (yyval.data) = data_merge((yyvsp[-4].data), d);
1720 fclose(f);
1721 }
1722 #line 1723 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1723 break;
1724
1725 case 35: /* propdata: propdata DT_LABEL */
1726 #line 353 "external/dtc/dtc-parser.y"
1727 {
1728 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1729 }
1730 #line 1731 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1731 break;
1732
1733 case 36: /* propdataprefix: %empty */
1734 #line 360 "external/dtc/dtc-parser.y"
1735 {
1736 (yyval.data) = empty_data;
1737 }
1738 #line 1739 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1739 break;
1740
1741 case 37: /* propdataprefix: propdata ',' */
1742 #line 364 "external/dtc/dtc-parser.y"
1743 {
1744 (yyval.data) = (yyvsp[-1].data);
1745 }
1746 #line 1747 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1747 break;
1748
1749 case 38: /* propdataprefix: propdataprefix DT_LABEL */
1750 #line 368 "external/dtc/dtc-parser.y"
1751 {
1752 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1753 }
1754 #line 1755 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1755 break;
1756
1757 case 39: /* arrayprefix: DT_BITS DT_LITERAL '<' */
1758 #line 375 "external/dtc/dtc-parser.y"
1759 {
1760 unsigned long long bits;
1761 enum markertype type = TYPE_UINT32;
1762
1763 bits = (yyvsp[-1].integer);
1764
1765 switch (bits) {
1766 case 8: type = TYPE_UINT8; break;
1767 case 16: type = TYPE_UINT16; break;
1768 case 32: type = TYPE_UINT32; break;
1769 case 64: type = TYPE_UINT64; break;
1770 default:
1771 ERROR(&(yylsp[-1]), "Array elements must be"
1772 " 8, 16, 32 or 64-bits");
1773 bits = 32;
1774 }
1775
1776 (yyval.array).data = data_add_marker(empty_data, type, NULL);
1777 (yyval.array).bits = bits;
1778 }
1779 #line 1780 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1780 break;
1781
1782 case 40: /* arrayprefix: '<' */
1783 #line 396 "external/dtc/dtc-parser.y"
1784 {
1785 (yyval.array).data = data_add_marker(empty_data, TYPE_UINT32, NULL);
1786 (yyval.array).bits = 32;
1787 }
1788 #line 1789 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1789 break;
1790
1791 case 41: /* arrayprefix: arrayprefix integer_prim */
1792 #line 401 "external/dtc/dtc-parser.y"
1793 {
1794 if ((yyvsp[-1].array).bits < 64) {
1795 uint64_t mask = (1ULL << (yyvsp[-1].array).bits) - 1;
1796 /*
1797 * Bits above mask must either be all zero
1798 * (positive within range of mask) or all one
1799 * (negative and sign-extended). The second
1800 * condition is true if when we set all bits
1801 * within the mask to one (i.e. | in the
1802 * mask), all bits are one.
1803 */
1804 if (((yyvsp[0].integer) > mask) && (((yyvsp[0].integer) | mask) != -1ULL)) {
1805 char *loc = srcpos_string(&(yylsp[0]));
1806 fprintf(stderr,
1807 "WARNING: %s: Value 0x%016" PRIx64
1808 " truncated to 0x%0*" PRIx64 "\n",
1809 loc, (yyvsp[0].integer), (yyvsp[-1].array).bits / 4, ((yyvsp[0].integer) & mask));
1810 free(loc);
1811 }
1812 }
1813
1814 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, (yyvsp[0].integer), (yyvsp[-1].array).bits);
1815 }
1816 #line 1817 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1817 break;
1818
1819 case 42: /* arrayprefix: arrayprefix dt_ref */
1820 #line 425 "external/dtc/dtc-parser.y"
1821 {
1822 uint64_t val = ~0ULL >> (64 - (yyvsp[-1].array).bits);
1823
1824 if ((yyvsp[-1].array).bits == 32)
1825 (yyvsp[-1].array).data = data_add_marker((yyvsp[-1].array).data,
1826 REF_PHANDLE,
1827 (yyvsp[0].labelref));
1828 else
1829 ERROR(&(yylsp[0]), "References are only allowed in "
1830 "arrays with 32-bit elements.");
1831
1832 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, val, (yyvsp[-1].array).bits);
1833 }
1834 #line 1835 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1835 break;
1836
1837 case 43: /* arrayprefix: arrayprefix DT_LABEL */
1838 #line 439 "external/dtc/dtc-parser.y"
1839 {
1840 (yyval.array).data = data_add_marker((yyvsp[-1].array).data, LABEL, (yyvsp[0].labelref));
1841 }
1842 #line 1843 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1843 break;
1844
1845 case 46: /* integer_prim: '(' integer_expr ')' */
1846 #line 448 "external/dtc/dtc-parser.y"
1847 {
1848 (yyval.integer) = (yyvsp[-1].integer);
1849 }
1850 #line 1851 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1851 break;
1852
1853 case 49: /* integer_trinary: integer_or '?' integer_expr ':' integer_trinary */
1854 #line 459 "external/dtc/dtc-parser.y"
1855 { (yyval.integer) = (yyvsp[-4].integer) ? (yyvsp[-2].integer) : (yyvsp[0].integer); }
1856 #line 1857 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1857 break;
1858
1859 case 51: /* integer_or: integer_or DT_OR integer_and */
1860 #line 464 "external/dtc/dtc-parser.y"
1861 { (yyval.integer) = (yyvsp[-2].integer) || (yyvsp[0].integer); }
1862 #line 1863 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1863 break;
1864
1865 case 53: /* integer_and: integer_and DT_AND integer_bitor */
1866 #line 469 "external/dtc/dtc-parser.y"
1867 { (yyval.integer) = (yyvsp[-2].integer) && (yyvsp[0].integer); }
1868 #line 1869 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1869 break;
1870
1871 case 55: /* integer_bitor: integer_bitor '|' integer_bitxor */
1872 #line 474 "external/dtc/dtc-parser.y"
1873 { (yyval.integer) = (yyvsp[-2].integer) | (yyvsp[0].integer); }
1874 #line 1875 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1875 break;
1876
1877 case 57: /* integer_bitxor: integer_bitxor '^' integer_bitand */
1878 #line 479 "external/dtc/dtc-parser.y"
1879 { (yyval.integer) = (yyvsp[-2].integer) ^ (yyvsp[0].integer); }
1880 #line 1881 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1881 break;
1882
1883 case 59: /* integer_bitand: integer_bitand '&' integer_eq */
1884 #line 484 "external/dtc/dtc-parser.y"
1885 { (yyval.integer) = (yyvsp[-2].integer) & (yyvsp[0].integer); }
1886 #line 1887 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1887 break;
1888
1889 case 61: /* integer_eq: integer_eq DT_EQ integer_rela */
1890 #line 489 "external/dtc/dtc-parser.y"
1891 { (yyval.integer) = (yyvsp[-2].integer) == (yyvsp[0].integer); }
1892 #line 1893 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1893 break;
1894
1895 case 62: /* integer_eq: integer_eq DT_NE integer_rela */
1896 #line 490 "external/dtc/dtc-parser.y"
1897 { (yyval.integer) = (yyvsp[-2].integer) != (yyvsp[0].integer); }
1898 #line 1899 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1899 break;
1900
1901 case 64: /* integer_rela: integer_rela '<' integer_shift */
1902 #line 495 "external/dtc/dtc-parser.y"
1903 { (yyval.integer) = (yyvsp[-2].integer) < (yyvsp[0].integer); }
1904 #line 1905 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1905 break;
1906
1907 case 65: /* integer_rela: integer_rela '>' integer_shift */
1908 #line 496 "external/dtc/dtc-parser.y"
1909 { (yyval.integer) = (yyvsp[-2].integer) > (yyvsp[0].integer); }
1910 #line 1911 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1911 break;
1912
1913 case 66: /* integer_rela: integer_rela DT_LE integer_shift */
1914 #line 497 "external/dtc/dtc-parser.y"
1915 { (yyval.integer) = (yyvsp[-2].integer) <= (yyvsp[0].integer); }
1916 #line 1917 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1917 break;
1918
1919 case 67: /* integer_rela: integer_rela DT_GE integer_shift */
1920 #line 498 "external/dtc/dtc-parser.y"
1921 { (yyval.integer) = (yyvsp[-2].integer) >= (yyvsp[0].integer); }
1922 #line 1923 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1923 break;
1924
1925 case 68: /* integer_shift: integer_shift DT_LSHIFT integer_add */
1926 #line 502 "external/dtc/dtc-parser.y"
1927 { (yyval.integer) = ((yyvsp[0].integer) < 64) ? ((yyvsp[-2].integer) << (yyvsp[0].integer)) : 0; }
1928 #line 1929 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1929 break;
1930
1931 case 69: /* integer_shift: integer_shift DT_RSHIFT integer_add */
1932 #line 503 "external/dtc/dtc-parser.y"
1933 { (yyval.integer) = ((yyvsp[0].integer) < 64) ? ((yyvsp[-2].integer) >> (yyvsp[0].integer)) : 0; }
1934 #line 1935 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1935 break;
1936
1937 case 71: /* integer_add: integer_add '+' integer_mul */
1938 #line 508 "external/dtc/dtc-parser.y"
1939 { (yyval.integer) = (yyvsp[-2].integer) + (yyvsp[0].integer); }
1940 #line 1941 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1941 break;
1942
1943 case 72: /* integer_add: integer_add '-' integer_mul */
1944 #line 509 "external/dtc/dtc-parser.y"
1945 { (yyval.integer) = (yyvsp[-2].integer) - (yyvsp[0].integer); }
1946 #line 1947 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1947 break;
1948
1949 case 74: /* integer_mul: integer_mul '*' integer_unary */
1950 #line 514 "external/dtc/dtc-parser.y"
1951 { (yyval.integer) = (yyvsp[-2].integer) * (yyvsp[0].integer); }
1952 #line 1953 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1953 break;
1954
1955 case 75: /* integer_mul: integer_mul '/' integer_unary */
1956 #line 516 "external/dtc/dtc-parser.y"
1957 {
1958 if ((yyvsp[0].integer) != 0) {
1959 (yyval.integer) = (yyvsp[-2].integer) / (yyvsp[0].integer);
1960 } else {
1961 ERROR(&(yyloc), "Division by zero");
1962 (yyval.integer) = 0;
1963 }
1964 }
1965 #line 1966 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1966 break;
1967
1968 case 76: /* integer_mul: integer_mul '%' integer_unary */
1969 #line 525 "external/dtc/dtc-parser.y"
1970 {
1971 if ((yyvsp[0].integer) != 0) {
1972 (yyval.integer) = (yyvsp[-2].integer) % (yyvsp[0].integer);
1973 } else {
1974 ERROR(&(yyloc), "Division by zero");
1975 (yyval.integer) = 0;
1976 }
1977 }
1978 #line 1979 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1979 break;
1980
1981 case 79: /* integer_unary: '-' integer_unary */
1982 #line 538 "external/dtc/dtc-parser.y"
1983 { (yyval.integer) = -(yyvsp[0].integer); }
1984 #line 1985 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1985 break;
1986
1987 case 80: /* integer_unary: '~' integer_unary */
1988 #line 539 "external/dtc/dtc-parser.y"
1989 { (yyval.integer) = ~(yyvsp[0].integer); }
1990 #line 1991 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1991 break;
1992
1993 case 81: /* integer_unary: '!' integer_unary */
1994 #line 540 "external/dtc/dtc-parser.y"
1995 { (yyval.integer) = !(yyvsp[0].integer); }
1996 #line 1997 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
1997 break;
1998
1999 case 82: /* bytestring: %empty */
2000 #line 545 "external/dtc/dtc-parser.y"
2001 {
2002 (yyval.data) = data_add_marker(empty_data, TYPE_UINT8, NULL);
2003 }
2004 #line 2005 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
2005 break;
2006
2007 case 83: /* bytestring: bytestring DT_BYTE */
2008 #line 549 "external/dtc/dtc-parser.y"
2009 {
2010 (yyval.data) = data_append_byte((yyvsp[-1].data), (yyvsp[0].byte));
2011 }
2012 #line 2013 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
2013 break;
2014
2015 case 84: /* bytestring: bytestring DT_LABEL */
2016 #line 553 "external/dtc/dtc-parser.y"
2017 {
2018 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
2019 }
2020 #line 2021 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
2021 break;
2022
2023 case 85: /* subnodes: %empty */
2024 #line 560 "external/dtc/dtc-parser.y"
2025 {
2026 (yyval.nodelist) = NULL;
2027 }
2028 #line 2029 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
2029 break;
2030
2031 case 86: /* subnodes: subnode subnodes */
2032 #line 564 "external/dtc/dtc-parser.y"
2033 {
2034 (yyval.nodelist) = chain_node((yyvsp[-1].node), (yyvsp[0].nodelist));
2035 }
2036 #line 2037 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
2037 break;
2038
2039 case 87: /* subnodes: subnode propdef */
2040 #line 568 "external/dtc/dtc-parser.y"
2041 {
2042 ERROR(&(yylsp[0]), "Properties must precede subnodes");
2043 YYERROR;
2044 }
2045 #line 2046 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
2046 break;
2047
2048 case 88: /* subnode: DT_PROPNODENAME nodedef */
2049 #line 576 "external/dtc/dtc-parser.y"
2050 {
2051 (yyval.node) = name_node((yyvsp[0].node), (yyvsp[-1].propnodename));
2052 }
2053 #line 2054 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
2054 break;
2055
2056 case 89: /* subnode: DT_DEL_NODE DT_PROPNODENAME ';' */
2057 #line 580 "external/dtc/dtc-parser.y"
2058 {
2059 (yyval.node) = name_node(build_node_delete(&(yyloc)), (yyvsp[-1].propnodename));
2060 }
2061 #line 2062 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
2062 break;
2063
2064 case 90: /* subnode: DT_OMIT_NO_REF subnode */
2065 #line 584 "external/dtc/dtc-parser.y"
2066 {
2067 (yyval.node) = omit_node_if_unused((yyvsp[0].node));
2068 }
2069 #line 2070 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
2070 break;
2071
2072 case 91: /* subnode: DT_LABEL subnode */
2073 #line 588 "external/dtc/dtc-parser.y"
2074 {
2075 add_label(&(yyvsp[0].node)->labels, (yyvsp[-1].labelref));
2076 (yyval.node) = (yyvsp[0].node);
2077 }
2078 #line 2079 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
2079 break;
2080
2081
2082 #line 2083 "out/soong/.intermediates/external/dtc/dtc/linux_glibc_x86_64/gen/yacc/external/dtc/dtc-parser.c"
2083
2084 default: break;
2085 }
2086 /* User semantic actions sometimes alter yychar, and that requires
2087 that yytoken be updated with the new translation. We take the
2088 approach of translating immediately before every use of yytoken.
2089 One alternative is translating here after every semantic action,
2090 but that translation would be missed if the semantic action invokes
2091 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2092 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2093 incorrect destructor might then be invoked immediately. In the
2094 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2095 to an incorrect destructor call or verbose syntax error message
2096 before the lookahead is translated. */
2097 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
2098
2099 YYPOPSTACK (yylen);
2100 yylen = 0;
2101
2102 *++yyvsp = yyval;
2103 *++yylsp = yyloc;
2104
2105 /* Now 'shift' the result of the reduction. Determine what state
2106 that goes to, based on the state we popped back to and the rule
2107 number reduced by. */
2108 {
2109 const int yylhs = yyr1[yyn] - YYNTOKENS;
2110 const int yyi = yypgoto[yylhs] + *yyssp;
2111 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2112 ? yytable[yyi]
2113 : yydefgoto[yylhs]);
2114 }
2115
2116 goto yynewstate;
2117
2118
2119 /*--------------------------------------.
2120 | yyerrlab -- here on detecting error. |
2121 `--------------------------------------*/
2122 yyerrlab:
2123 /* Make sure we have latest lookahead translation. See comments at
2124 user semantic actions for why this is necessary. */
2125 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
2126 /* If not already recovering from an error, report this error. */
2127 if (!yyerrstatus)
2128 {
2129 ++yynerrs;
2130 yyerror (YY_("syntax error"));
2131 }
2132
2133 yyerror_range[1] = yylloc;
2134 if (yyerrstatus == 3)
2135 {
2136 /* If just tried and failed to reuse lookahead token after an
2137 error, discard it. */
2138
2139 if (yychar <= YYEOF)
2140 {
2141 /* Return failure if at end of input. */
2142 if (yychar == YYEOF)
2143 YYABORT;
2144 }
2145 else
2146 {
2147 yydestruct ("Error: discarding",
2148 yytoken, &yylval, &yylloc);
2149 yychar = YYEMPTY;
2150 }
2151 }
2152
2153 /* Else will try to reuse lookahead token after shifting the error
2154 token. */
2155 goto yyerrlab1;
2156
2157
2158 /*---------------------------------------------------.
2159 | yyerrorlab -- error raised explicitly by YYERROR. |
2160 `---------------------------------------------------*/
2161 yyerrorlab:
2162 /* Pacify compilers when the user code never invokes YYERROR and the
2163 label yyerrorlab therefore never appears in user code. */
2164 if (0)
2165 YYERROR;
2166 ++yynerrs;
2167
2168 /* Do not reclaim the symbols of the rule whose action triggered
2169 this YYERROR. */
2170 YYPOPSTACK (yylen);
2171 yylen = 0;
2172 YY_STACK_PRINT (yyss, yyssp);
2173 yystate = *yyssp;
2174 goto yyerrlab1;
2175
2176
2177 /*-------------------------------------------------------------.
2178 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2179 `-------------------------------------------------------------*/
2180 yyerrlab1:
2181 yyerrstatus = 3; /* Each real token shifted decrements this. */
2182
2183 /* Pop stack until we find a state that shifts the error token. */
2184 for (;;)
2185 {
2186 yyn = yypact[yystate];
2187 if (!yypact_value_is_default (yyn))
2188 {
2189 yyn += YYSYMBOL_YYerror;
2190 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
2191 {
2192 yyn = yytable[yyn];
2193 if (0 < yyn)
2194 break;
2195 }
2196 }
2197
2198 /* Pop the current state because it cannot handle the error token. */
2199 if (yyssp == yyss)
2200 YYABORT;
2201
2202 yyerror_range[1] = *yylsp;
2203 yydestruct ("Error: popping",
2204 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp);
2205 YYPOPSTACK (1);
2206 yystate = *yyssp;
2207 YY_STACK_PRINT (yyss, yyssp);
2208 }
2209
2210 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2211 *++yyvsp = yylval;
2212 YY_IGNORE_MAYBE_UNINITIALIZED_END
2213
2214 yyerror_range[2] = yylloc;
2215 ++yylsp;
2216 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
2217
2218 /* Shift the error token. */
2219 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
2220
2221 yystate = yyn;
2222 goto yynewstate;
2223
2224
2225 /*-------------------------------------.
2226 | yyacceptlab -- YYACCEPT comes here. |
2227 `-------------------------------------*/
2228 yyacceptlab:
2229 yyresult = 0;
2230 goto yyreturnlab;
2231
2232
2233 /*-----------------------------------.
2234 | yyabortlab -- YYABORT comes here. |
2235 `-----------------------------------*/
2236 yyabortlab:
2237 yyresult = 1;
2238 goto yyreturnlab;
2239
2240
2241 /*-----------------------------------------------------------.
2242 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
2243 `-----------------------------------------------------------*/
2244 yyexhaustedlab:
2245 yyerror (YY_("memory exhausted"));
2246 yyresult = 2;
2247 goto yyreturnlab;
2248
2249
2250 /*----------------------------------------------------------.
2251 | yyreturnlab -- parsing is finished, clean up and return. |
2252 `----------------------------------------------------------*/
2253 yyreturnlab:
2254 if (yychar != YYEMPTY)
2255 {
2256 /* Make sure we have latest lookahead translation. See comments at
2257 user semantic actions for why this is necessary. */
2258 yytoken = YYTRANSLATE (yychar);
2259 yydestruct ("Cleanup: discarding lookahead",
2260 yytoken, &yylval, &yylloc);
2261 }
2262 /* Do not reclaim the symbols of the rule whose action triggered
2263 this YYABORT or YYACCEPT. */
2264 YYPOPSTACK (yylen);
2265 YY_STACK_PRINT (yyss, yyssp);
2266 while (yyssp != yyss)
2267 {
2268 yydestruct ("Cleanup: popping",
2269 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp);
2270 YYPOPSTACK (1);
2271 }
2272 #ifndef yyoverflow
2273 if (yyss != yyssa)
2274 YYSTACK_FREE (yyss);
2275 #endif
2276
2277 return yyresult;
2278 }
2279
2280 #line 594 "external/dtc/dtc-parser.y"
2281
2282
yyerror(char const * s)2283 void yyerror(char const *s)
2284 {
2285 ERROR(&yylloc, "%s", s);
2286 }
2287