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