]>
Commit | Line | Data |
---|---|---|
47605971 | 1 | /* A Bison parser, made by GNU Bison 3.0.2. */ |
cd296721 | 2 | |
2a6a08ca | 3 | /* Bison implementation for Yacc-like parsers in C |
47605971 RH |
4 | |
5 | Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. | |
6 | ||
658f29a5 | 7 | This program is free software: you can redistribute it and/or modify |
a4da2e3e | 8 | it under the terms of the GNU General Public License as published by |
658f29a5 JB |
9 | the Free Software Foundation, either version 3 of the License, or |
10 | (at your option) any later version. | |
47605971 | 11 | |
a4da2e3e DG |
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. | |
47605971 | 16 | |
a4da2e3e | 17 | You should have received a copy of the GNU General Public License |
658f29a5 | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
a4da2e3e DG |
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. | |
47605971 | 29 | |
a4da2e3e DG |
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. */ | |
47605971 | 47 | #define YYBISON_VERSION "3.0.2" |
a4da2e3e DG |
48 | |
49 | /* Skeleton name. */ | |
50 | #define YYSKELETON_NAME "yacc.c" | |
51 | ||
52 | /* Pure parsers. */ | |
53 | #define YYPURE 0 | |
54 | ||
658f29a5 JB |
55 | /* Push parsers. */ |
56 | #define YYPUSH 0 | |
a4da2e3e | 57 | |
658f29a5 JB |
58 | /* Pull parsers. */ |
59 | #define YYPULL 1 | |
a4da2e3e | 60 | |
a4da2e3e DG |
61 | |
62 | ||
63 | ||
64 | /* Copy the first part of user declarations. */ | |
47605971 | 65 | #line 20 "dtc-parser.y" /* yacc.c:339 */ |
a4da2e3e | 66 | |
ed95d745 | 67 | #include <stdio.h> |
53e5e540 | 68 | #include <inttypes.h> |
ed95d745 | 69 | |
a4da2e3e DG |
70 | #include "dtc.h" |
71 | #include "srcpos.h" | |
72 | ||
ed95d745 | 73 | extern int yylex(void); |
658f29a5 | 74 | extern void yyerror(char const *s); |
47605971 RH |
75 | #define ERROR(loc, ...) \ |
76 | do { \ | |
77 | srcpos_error((loc), "Error", __VA_ARGS__); \ | |
78 | treesource_error = true; \ | |
79 | } while (0) | |
a4da2e3e DG |
80 | |
81 | extern struct boot_info *the_boot_info; | |
47605971 | 82 | extern bool treesource_error; |
a4da2e3e | 83 | |
53e5e540 | 84 | #line 85 "dtc-parser.tab.c" /* yacc.c:339 */ |
a4da2e3e | 85 | |
47605971 | 86 | # ifndef YY_NULLPTR |
a878b910 | 87 | # if defined __cplusplus && 201103L <= __cplusplus |
47605971 | 88 | # define YY_NULLPTR nullptr |
a878b910 | 89 | # else |
47605971 | 90 | # define YY_NULLPTR 0 |
a878b910 GL |
91 | # endif |
92 | # endif | |
a4da2e3e DG |
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 | ||
a878b910 GL |
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 | |
47605971 | 106 | /* Debug traces. */ |
a878b910 GL |
107 | #ifndef YYDEBUG |
108 | # define YYDEBUG 0 | |
109 | #endif | |
110 | #if YYDEBUG | |
111 | extern int yydebug; | |
a4da2e3e | 112 | #endif |
658f29a5 | 113 | |
47605971 | 114 | /* Token type. */ |
658f29a5 JB |
115 | #ifndef YYTOKENTYPE |
116 | # define YYTOKENTYPE | |
47605971 RH |
117 | enum yytokentype |
118 | { | |
119 | DT_V1 = 258, | |
53e5e540 PE |
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 | |
47605971 | 141 | }; |
658f29a5 JB |
142 | #endif |
143 | ||
47605971 | 144 | /* Value type. */ |
a4da2e3e | 145 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
47605971 RH |
146 | typedef union YYSTYPE YYSTYPE; |
147 | union YYSTYPE | |
a4da2e3e | 148 | { |
53e5e540 | 149 | #line 39 "dtc-parser.y" /* yacc.c:355 */ |
658f29a5 | 150 | |
a4da2e3e | 151 | char *propnodename; |
a4da2e3e | 152 | char *labelref; |
ed95d745 | 153 | uint8_t byte; |
a4da2e3e DG |
154 | struct data data; |
155 | ||
cd296721 SW |
156 | struct { |
157 | struct data data; | |
158 | int bits; | |
159 | } array; | |
160 | ||
a4da2e3e DG |
161 | struct property *prop; |
162 | struct property *proplist; | |
163 | struct node *node; | |
164 | struct node *nodelist; | |
165 | struct reserve_info *re; | |
cd296721 | 166 | uint64_t integer; |
53e5e540 | 167 | bool is_plugin; |
658f29a5 | 168 | |
53e5e540 | 169 | #line 170 "dtc-parser.tab.c" /* yacc.c:355 */ |
47605971 | 170 | }; |
658f29a5 | 171 | # define YYSTYPE_IS_TRIVIAL 1 |
a4da2e3e | 172 | # define YYSTYPE_IS_DECLARED 1 |
a4da2e3e DG |
173 | #endif |
174 | ||
47605971 RH |
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 | |
a878b910 | 187 | #endif |
47605971 RH |
188 | |
189 | ||
190 | extern YYSTYPE yylval; | |
191 | extern YYLTYPE yylloc; | |
a878b910 | 192 | int yyparse (void); |
a4da2e3e | 193 | |
a878b910 | 194 | #endif /* !YY_YY_DTC_PARSER_TAB_H_INCLUDED */ |
a4da2e3e | 195 | |
a878b910 GL |
196 | /* Copy the second part of user declarations. */ |
197 | ||
53e5e540 | 198 | #line 199 "dtc-parser.tab.c" /* yacc.c:358 */ |
a4da2e3e DG |
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; | |
a4da2e3e | 212 | #else |
47605971 | 213 | typedef signed char yytype_int8; |
a4da2e3e DG |
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 | |
47605971 | 233 | # elif ! defined YYSIZE_T |
a4da2e3e DG |
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_ | |
2a6a08ca | 244 | # if defined YYENABLE_NLS && YYENABLE_NLS |
a4da2e3e DG |
245 | # if ENABLE_NLS |
246 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ | |
a878b910 | 247 | # define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
a4da2e3e DG |
248 | # endif |
249 | # endif | |
250 | # ifndef YY_ | |
a878b910 GL |
251 | # define YY_(Msgid) Msgid |
252 | # endif | |
253 | #endif | |
254 | ||
47605971 RH |
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__)) | |
a4da2e3e DG |
279 | # endif |
280 | #endif | |
281 | ||
282 | /* Suppress unused-variable warnings by "using" E. */ | |
283 | #if ! defined lint || defined __GNUC__ | |
a878b910 | 284 | # define YYUSE(E) ((void) (E)) |
a4da2e3e | 285 | #else |
a878b910 | 286 | # define YYUSE(E) /* empty */ |
a4da2e3e DG |
287 | #endif |
288 | ||
47605971 RH |
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") | |
a4da2e3e | 297 | #else |
47605971 | 298 | # define YY_INITIAL_VALUE(Value) Value |
a4da2e3e | 299 | #endif |
47605971 RH |
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. */ | |
a4da2e3e DG |
306 | #endif |
307 | ||
47605971 | 308 | |
a4da2e3e DG |
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 | |
47605971 | 326 | # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS |
a4da2e3e | 327 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
a878b910 | 328 | /* Use EXIT_SUCCESS as a witness for stdlib.h. */ |
2a6a08ca GL |
329 | # ifndef EXIT_SUCCESS |
330 | # define EXIT_SUCCESS 0 | |
a4da2e3e DG |
331 | # endif |
332 | # endif | |
333 | # endif | |
334 | # endif | |
335 | # endif | |
336 | ||
337 | # ifdef YYSTACK_ALLOC | |
47605971 RH |
338 | /* Pacify GCC's 'empty if-body' warning. */ |
339 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) | |
a4da2e3e DG |
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 | |
2a6a08ca | 353 | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
a4da2e3e | 354 | && ! ((defined YYMALLOC || defined malloc) \ |
47605971 | 355 | && (defined YYFREE || defined free))) |
a4da2e3e | 356 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
2a6a08ca GL |
357 | # ifndef EXIT_SUCCESS |
358 | # define EXIT_SUCCESS 0 | |
a4da2e3e DG |
359 | # endif |
360 | # endif | |
361 | # ifndef YYMALLOC | |
362 | # define YYMALLOC malloc | |
47605971 | 363 | # if ! defined malloc && ! defined EXIT_SUCCESS |
a4da2e3e DG |
364 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
365 | # endif | |
366 | # endif | |
367 | # ifndef YYFREE | |
368 | # define YYFREE free | |
47605971 | 369 | # if ! defined free && ! defined EXIT_SUCCESS |
a4da2e3e DG |
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 \ | |
47605971 RH |
379 | || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ |
380 | && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) | |
a4da2e3e DG |
381 | |
382 | /* A type that is properly aligned for any stack member. */ | |
383 | union yyalloc | |
384 | { | |
658f29a5 JB |
385 | yytype_int16 yyss_alloc; |
386 | YYSTYPE yyvs_alloc; | |
47605971 | 387 | YYLTYPE yyls_alloc; |
a4da2e3e DG |
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) \ | |
47605971 RH |
396 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ |
397 | + 2 * YYSTACK_GAP_MAXIMUM) | |
a4da2e3e | 398 | |
2a6a08ca | 399 | # define YYCOPY_NEEDED 1 |
a4da2e3e DG |
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. */ | |
47605971 RH |
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) | |
a4da2e3e DG |
416 | |
417 | #endif | |
418 | ||
2a6a08ca | 419 | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
a878b910 | 420 | /* Copy COUNT objects from SRC to DST. The source and destination do |
2a6a08ca GL |
421 | not overlap. */ |
422 | # ifndef YYCOPY | |
423 | # if defined __GNUC__ && 1 < __GNUC__ | |
a878b910 GL |
424 | # define YYCOPY(Dst, Src, Count) \ |
425 | __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) | |
2a6a08ca | 426 | # else |
a878b910 GL |
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 | } \ | |
47605971 | 434 | while (0) |
2a6a08ca GL |
435 | # endif |
436 | # endif | |
437 | #endif /* !YYCOPY_NEEDED */ | |
438 | ||
a4da2e3e | 439 | /* YYFINAL -- State number of the termination state. */ |
658f29a5 | 440 | #define YYFINAL 4 |
a4da2e3e | 441 | /* YYLAST -- Last index in YYTABLE. */ |
47605971 | 442 | #define YYLAST 136 |
a4da2e3e DG |
443 | |
444 | /* YYNTOKENS -- Number of terminals. */ | |
53e5e540 | 445 | #define YYNTOKENS 48 |
a4da2e3e | 446 | /* YYNNTS -- Number of nonterminals. */ |
53e5e540 | 447 | #define YYNNTS 29 |
a4da2e3e | 448 | /* YYNRULES -- Number of rules. */ |
53e5e540 | 449 | #define YYNRULES 82 |
47605971 | 450 | /* YYNSTATES -- Number of states. */ |
53e5e540 | 451 | #define YYNSTATES 147 |
a4da2e3e | 452 | |
47605971 RH |
453 | /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned |
454 | by yylex, with out-of-bounds checking. */ | |
a4da2e3e | 455 | #define YYUNDEFTOK 2 |
53e5e540 | 456 | #define YYMAXUTOK 279 |
a4da2e3e | 457 | |
47605971 | 458 | #define YYTRANSLATE(YYX) \ |
a4da2e3e DG |
459 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
460 | ||
47605971 RH |
461 | /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM |
462 | as returned by yylex, without out-of-bounds checking. */ | |
a4da2e3e DG |
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, | |
53e5e540 PE |
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, | |
a4da2e3e DG |
472 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
473 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
53e5e540 | 474 | 2, 31, 2, 32, 40, 2, 2, 2, 2, 2, |
a4da2e3e DG |
475 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
476 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
53e5e540 | 477 | 2, 2, 2, 27, 39, 28, 46, 2, 2, 2, |
a4da2e3e DG |
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, | |
cd296721 | 491 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
53e5e540 | 492 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 |
a4da2e3e DG |
493 | }; |
494 | ||
495 | #if YYDEBUG | |
47605971 | 496 | /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ |
a4da2e3e DG |
497 | static const yytype_uint16 yyrline[] = |
498 | { | |
53e5e540 PE |
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 | |
a4da2e3e DG |
508 | }; |
509 | #endif | |
510 | ||
a878b910 | 511 | #if YYDEBUG || YYERROR_VERBOSE || 0 |
a4da2e3e DG |
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 | { | |
53e5e540 PE |
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 | |
a4da2e3e DG |
529 | }; |
530 | #endif | |
531 | ||
532 | # ifdef YYPRINT | |
47605971 RH |
533 | /* YYTOKNUM[NUM] -- (External) token number corresponding to the |
534 | (internal) symbol number NUM (which must be that of a token). */ | |
a4da2e3e DG |
535 | static const yytype_uint16 yytoknum[] = |
536 | { | |
537 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, | |
cd296721 | 538 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
53e5e540 PE |
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 | |
a4da2e3e DG |
542 | }; |
543 | # endif | |
544 | ||
53e5e540 | 545 | #define YYPACT_NINF -84 |
a4da2e3e | 546 | |
47605971 | 547 | #define yypact_value_is_default(Yystate) \ |
53e5e540 | 548 | (!!((Yystate) == (-84))) |
47605971 RH |
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[] = | |
a4da2e3e | 558 | { |
53e5e540 PE |
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 | |
a4da2e3e DG |
574 | }; |
575 | ||
47605971 RH |
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. */ | |
a4da2e3e DG |
579 | static const yytype_uint8 yydefact[] = |
580 | { | |
53e5e540 PE |
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, | |
cd296721 | 586 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
53e5e540 PE |
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 | |
a4da2e3e DG |
596 | }; |
597 | ||
47605971 RH |
598 | /* YYPGOTO[NTERM-NUM]. */ |
599 | static const yytype_int8 yypgoto[] = | |
a4da2e3e | 600 | { |
53e5e540 PE |
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 | |
a4da2e3e DG |
604 | }; |
605 | ||
47605971 RH |
606 | /* YYDEFGOTO[NTERM-NUM]. */ |
607 | static const yytype_int16 yydefgoto[] = | |
a4da2e3e | 608 | { |
53e5e540 PE |
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 | |
a4da2e3e DG |
612 | }; |
613 | ||
47605971 RH |
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[] = | |
a4da2e3e | 618 | { |
53e5e540 PE |
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 | |
a4da2e3e DG |
633 | }; |
634 | ||
47605971 | 635 | static const yytype_int16 yycheck[] = |
a4da2e3e | 636 | { |
53e5e540 PE |
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 | |
a4da2e3e DG |
651 | }; |
652 | ||
47605971 RH |
653 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
654 | symbol of state STATE-NUM. */ | |
655 | static const yytype_uint8 yystos[] = | |
656 | { | |
53e5e540 PE |
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 | |
47605971 | 672 | }; |
2a6a08ca | 673 | |
47605971 RH |
674 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
675 | static const yytype_uint8 yyr1[] = | |
a4da2e3e | 676 | { |
53e5e540 PE |
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 | |
a4da2e3e DG |
686 | }; |
687 | ||
47605971 RH |
688 | /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ |
689 | static const yytype_uint8 yyr2[] = | |
a4da2e3e | 690 | { |
53e5e540 PE |
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 | |
a4da2e3e DG |
700 | }; |
701 | ||
47605971 RH |
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 | ||
a4da2e3e DG |
712 | |
713 | #define YYRECOVERING() (!!yyerrstatus) | |
714 | ||
a878b910 GL |
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 | { \ | |
a4da2e3e | 727 | yyerror (YY_("syntax error: cannot back up")); \ |
47605971 RH |
728 | YYERROR; \ |
729 | } \ | |
730 | while (0) | |
a4da2e3e | 731 | |
a878b910 | 732 | /* Error token number */ |
47605971 RH |
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) | |
a4da2e3e DG |
759 | #endif |
760 | ||
47605971 | 761 | #define YYRHSLOC(Rhs, K) ((Rhs)[K]) |
a4da2e3e | 762 | |
a4da2e3e DG |
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 | ||
47605971 RH |
772 | # define YYDPRINTF(Args) \ |
773 | do { \ | |
774 | if (yydebug) \ | |
775 | YYFPRINTF Args; \ | |
776 | } while (0) | |
a4da2e3e | 777 | |
a4da2e3e | 778 | |
47605971 RH |
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. */ | |
a4da2e3e | 782 | |
47605971 RH |
783 | #ifndef YY_LOCATION_PRINT |
784 | # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL | |
a4da2e3e | 785 | |
47605971 RH |
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 | |
a4da2e3e | 820 | #endif |
47605971 RH |
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) | |
a4da2e3e | 841 | { |
a878b910 GL |
842 | FILE *yyo = yyoutput; |
843 | YYUSE (yyo); | |
47605971 | 844 | YYUSE (yylocationp); |
a4da2e3e DG |
845 | if (!yyvaluep) |
846 | return; | |
a4da2e3e DG |
847 | # ifdef YYPRINT |
848 | if (yytype < YYNTOKENS) | |
849 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); | |
a4da2e3e | 850 | # endif |
a878b910 | 851 | YYUSE (yytype); |
a4da2e3e DG |
852 | } |
853 | ||
854 | ||
855 | /*--------------------------------. | |
856 | | Print this symbol on YYOUTPUT. | | |
857 | `--------------------------------*/ | |
858 | ||
a4da2e3e | 859 | static void |
47605971 | 860 | yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) |
a4da2e3e | 861 | { |
47605971 RH |
862 | YYFPRINTF (yyoutput, "%s %s (", |
863 | yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); | |
a4da2e3e | 864 | |
47605971 RH |
865 | YY_LOCATION_PRINT (yyoutput, *yylocationp); |
866 | YYFPRINTF (yyoutput, ": "); | |
867 | yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp); | |
a4da2e3e DG |
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 | ||
a4da2e3e | 876 | static void |
658f29a5 | 877 | yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) |
a4da2e3e DG |
878 | { |
879 | YYFPRINTF (stderr, "Stack now"); | |
658f29a5 JB |
880 | for (; yybottom <= yytop; yybottom++) |
881 | { | |
882 | int yybot = *yybottom; | |
883 | YYFPRINTF (stderr, " %d", yybot); | |
884 | } | |
a4da2e3e DG |
885 | YYFPRINTF (stderr, "\n"); |
886 | } | |
887 | ||
47605971 RH |
888 | # define YY_STACK_PRINT(Bottom, Top) \ |
889 | do { \ | |
890 | if (yydebug) \ | |
891 | yy_stack_print ((Bottom), (Top)); \ | |
892 | } while (0) | |
a4da2e3e DG |
893 | |
894 | ||
895 | /*------------------------------------------------. | |
896 | | Report that the YYRULE is going to be reduced. | | |
897 | `------------------------------------------------*/ | |
898 | ||
a4da2e3e | 899 | static void |
47605971 | 900 | yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule) |
a4da2e3e | 901 | { |
47605971 | 902 | unsigned long int yylno = yyrline[yyrule]; |
a4da2e3e DG |
903 | int yynrhs = yyr2[yyrule]; |
904 | int yyi; | |
a4da2e3e | 905 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", |
47605971 | 906 | yyrule - 1, yylno); |
a4da2e3e DG |
907 | /* The symbols being reduced. */ |
908 | for (yyi = 0; yyi < yynrhs; yyi++) | |
909 | { | |
658f29a5 | 910 | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
47605971 RH |
911 | yy_symbol_print (stderr, |
912 | yystos[yyssp[yyi + 1 - yynrhs]], | |
913 | &(yyvsp[(yyi + 1) - (yynrhs)]) | |
914 | , &(yylsp[(yyi + 1) - (yynrhs)]) ); | |
658f29a5 | 915 | YYFPRINTF (stderr, "\n"); |
a4da2e3e DG |
916 | } |
917 | } | |
918 | ||
47605971 RH |
919 | # define YY_REDUCE_PRINT(Rule) \ |
920 | do { \ | |
921 | if (yydebug) \ | |
922 | yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \ | |
923 | } while (0) | |
a4da2e3e DG |
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. */ | |
47605971 | 937 | #ifndef YYINITDEPTH |
a4da2e3e DG |
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 | ||
a4da2e3e DG |
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. */ | |
a4da2e3e DG |
960 | static YYSIZE_T |
961 | yystrlen (const char *yystr) | |
a4da2e3e DG |
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. */ | |
a4da2e3e DG |
977 | static char * |
978 | yystpcpy (char *yydest, const char *yysrc) | |
a4da2e3e DG |
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 (;;) | |
47605971 RH |
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 | } | |
a4da2e3e DG |
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 | ||
2a6a08ca GL |
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. | |
a4da2e3e | 1042 | |
2a6a08ca GL |
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 | { | |
47605971 | 1051 | YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); |
2a6a08ca | 1052 | YYSIZE_T yysize = yysize0; |
2a6a08ca GL |
1053 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
1054 | /* Internationalized format string. */ | |
47605971 | 1055 | const char *yyformat = YY_NULLPTR; |
2a6a08ca GL |
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: | |
2a6a08ca GL |
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) | |
a4da2e3e | 1086 | { |
2a6a08ca GL |
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]; | |
a878b910 | 1111 | { |
47605971 | 1112 | YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); |
a878b910 GL |
1113 | if (! (yysize <= yysize1 |
1114 | && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
1115 | return 2; | |
1116 | yysize = yysize1; | |
1117 | } | |
2a6a08ca GL |
1118 | } |
1119 | } | |
1120 | } | |
a4da2e3e | 1121 | |
2a6a08ca GL |
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 | } | |
a4da2e3e | 1136 | |
a878b910 GL |
1137 | { |
1138 | YYSIZE_T yysize1 = yysize + yystrlen (yyformat); | |
1139 | if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
1140 | return 2; | |
1141 | yysize = yysize1; | |
1142 | } | |
a4da2e3e | 1143 | |
2a6a08ca GL |
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; | |
a4da2e3e | 1151 | } |
2a6a08ca GL |
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; | |
a4da2e3e DG |
1172 | } |
1173 | #endif /* YYERROR_VERBOSE */ | |
a4da2e3e DG |
1174 | |
1175 | /*-----------------------------------------------. | |
1176 | | Release the memory associated to this symbol. | | |
1177 | `-----------------------------------------------*/ | |
1178 | ||
a4da2e3e | 1179 | static void |
47605971 | 1180 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) |
a4da2e3e DG |
1181 | { |
1182 | YYUSE (yyvaluep); | |
47605971 | 1183 | YYUSE (yylocationp); |
a4da2e3e DG |
1184 | if (!yymsg) |
1185 | yymsg = "Deleting"; | |
1186 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); | |
1187 | ||
47605971 | 1188 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
a878b910 | 1189 | YYUSE (yytype); |
47605971 | 1190 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
a4da2e3e | 1191 | } |
a4da2e3e | 1192 | |
2a6a08ca | 1193 | |
a4da2e3e DG |
1194 | |
1195 | ||
658f29a5 | 1196 | /* The lookahead symbol. */ |
a4da2e3e DG |
1197 | int yychar; |
1198 | ||
658f29a5 | 1199 | /* The semantic value of the lookahead symbol. */ |
47605971 RH |
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 | ; | |
a4da2e3e DG |
1207 | /* Number of syntax errors so far. */ |
1208 | int yynerrs; | |
a4da2e3e DG |
1209 | |
1210 | ||
2a6a08ca GL |
1211 | /*----------. |
1212 | | yyparse. | | |
1213 | `----------*/ | |
a4da2e3e | 1214 | |
a4da2e3e DG |
1215 | int |
1216 | yyparse (void) | |
a4da2e3e | 1217 | { |
658f29a5 JB |
1218 | int yystate; |
1219 | /* Number of tokens to shift before error messages enabled. */ | |
1220 | int yyerrstatus; | |
a4da2e3e | 1221 | |
658f29a5 | 1222 | /* The stacks and their tools: |
47605971 RH |
1223 | 'yyss': related to states. |
1224 | 'yyvs': related to semantic values. | |
1225 | 'yyls': related to locations. | |
a4da2e3e | 1226 | |
a878b910 | 1227 | Refer to the stacks through separate pointers, to allow yyoverflow |
658f29a5 | 1228 | to reallocate them elsewhere. */ |
a4da2e3e | 1229 | |
658f29a5 JB |
1230 | /* The state stack. */ |
1231 | yytype_int16 yyssa[YYINITDEPTH]; | |
1232 | yytype_int16 *yyss; | |
1233 | yytype_int16 *yyssp; | |
a4da2e3e | 1234 | |
658f29a5 JB |
1235 | /* The semantic value stack. */ |
1236 | YYSTYPE yyvsa[YYINITDEPTH]; | |
1237 | YYSTYPE *yyvs; | |
1238 | YYSTYPE *yyvsp; | |
a4da2e3e | 1239 | |
47605971 RH |
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 | ||
658f29a5 | 1248 | YYSIZE_T yystacksize; |
a4da2e3e | 1249 | |
658f29a5 JB |
1250 | int yyn; |
1251 | int yyresult; | |
1252 | /* Lookahead token as an internal (translated) token number. */ | |
a878b910 | 1253 | int yytoken = 0; |
a4da2e3e DG |
1254 | /* The variables used to return semantic value and location from the |
1255 | action routines. */ | |
1256 | YYSTYPE yyval; | |
47605971 | 1257 | YYLTYPE yyloc; |
658f29a5 JB |
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 | ||
47605971 | 1266 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) |
a4da2e3e DG |
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 | ||
a878b910 GL |
1272 | yyssp = yyss = yyssa; |
1273 | yyvsp = yyvs = yyvsa; | |
47605971 | 1274 | yylsp = yyls = yylsa; |
658f29a5 JB |
1275 | yystacksize = YYINITDEPTH; |
1276 | ||
a4da2e3e DG |
1277 | YYDPRINTF ((stderr, "Starting parse\n")); |
1278 | ||
1279 | yystate = 0; | |
1280 | yyerrstatus = 0; | |
1281 | yynerrs = 0; | |
658f29a5 | 1282 | yychar = YYEMPTY; /* Cause a token to be read. */ |
47605971 | 1283 | yylsp[0] = yylloc; |
a4da2e3e DG |
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 | { | |
47605971 RH |
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; | |
a4da2e3e DG |
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) | |
47605971 | 1331 | goto yyexhaustedlab; |
a4da2e3e DG |
1332 | yystacksize *= 2; |
1333 | if (YYMAXDEPTH < yystacksize) | |
47605971 | 1334 | yystacksize = YYMAXDEPTH; |
a4da2e3e DG |
1335 | |
1336 | { | |
47605971 RH |
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); | |
a4da2e3e | 1345 | # undef YYSTACK_RELOCATE |
47605971 RH |
1346 | if (yyss1 != yyssa) |
1347 | YYSTACK_FREE (yyss1); | |
a4da2e3e DG |
1348 | } |
1349 | # endif | |
1350 | #endif /* no yyoverflow */ | |
1351 | ||
1352 | yyssp = yyss + yysize - 1; | |
1353 | yyvsp = yyvs + yysize - 1; | |
47605971 | 1354 | yylsp = yyls + yysize - 1; |
a4da2e3e DG |
1355 | |
1356 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", | |
47605971 | 1357 | (unsigned long int) yystacksize)); |
a4da2e3e DG |
1358 | |
1359 | if (yyss + yystacksize - 1 <= yyssp) | |
47605971 | 1360 | YYABORT; |
a4da2e3e DG |
1361 | } |
1362 | ||
1363 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); | |
1364 | ||
658f29a5 JB |
1365 | if (yystate == YYFINAL) |
1366 | YYACCEPT; | |
1367 | ||
a4da2e3e DG |
1368 | goto yybackup; |
1369 | ||
1370 | /*-----------. | |
1371 | | yybackup. | | |
1372 | `-----------*/ | |
1373 | yybackup: | |
1374 | ||
1375 | /* Do appropriate processing given the current state. Read a | |
658f29a5 | 1376 | lookahead token if we need one and don't already have one. */ |
a4da2e3e | 1377 | |
658f29a5 | 1378 | /* First try to decide what to do without reference to lookahead token. */ |
a4da2e3e | 1379 | yyn = yypact[yystate]; |
2a6a08ca | 1380 | if (yypact_value_is_default (yyn)) |
a4da2e3e DG |
1381 | goto yydefault; |
1382 | ||
658f29a5 | 1383 | /* Not known => get a lookahead token if don't already have one. */ |
a4da2e3e | 1384 | |
658f29a5 | 1385 | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
a4da2e3e DG |
1386 | if (yychar == YYEMPTY) |
1387 | { | |
1388 | YYDPRINTF ((stderr, "Reading a token: ")); | |
47605971 | 1389 | yychar = yylex (); |
a4da2e3e DG |
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 | { | |
2a6a08ca GL |
1411 | if (yytable_value_is_error (yyn)) |
1412 | goto yyerrlab; | |
a4da2e3e DG |
1413 | yyn = -yyn; |
1414 | goto yyreduce; | |
1415 | } | |
1416 | ||
a4da2e3e DG |
1417 | /* Count tokens shifted since error; after three, turn off error |
1418 | status. */ | |
1419 | if (yyerrstatus) | |
1420 | yyerrstatus--; | |
1421 | ||
658f29a5 | 1422 | /* Shift the lookahead token. */ |
a4da2e3e DG |
1423 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
1424 | ||
658f29a5 JB |
1425 | /* Discard the shifted token. */ |
1426 | yychar = YYEMPTY; | |
a4da2e3e DG |
1427 | |
1428 | yystate = yyn; | |
a878b910 | 1429 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
a4da2e3e | 1430 | *++yyvsp = yylval; |
a878b910 | 1431 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
47605971 | 1432 | *++yylsp = yylloc; |
a4da2e3e DG |
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: | |
47605971 | 1454 | '$$ = $1'. |
a4da2e3e DG |
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 | ||
47605971 RH |
1463 | /* Default location. */ |
1464 | YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); | |
a4da2e3e DG |
1465 | YY_REDUCE_PRINT (yyn); |
1466 | switch (yyn) | |
1467 | { | |
1468 | case 2: | |
53e5e540 | 1469 | #line 109 "dtc-parser.y" /* yacc.c:1646 */ |
a4da2e3e | 1470 | { |
53e5e540 | 1471 | (yyvsp[0].node)->is_plugin = (yyvsp[-2].is_plugin); |
47605971 RH |
1472 | the_boot_info = build_boot_info((yyvsp[-1].re), (yyvsp[0].node), |
1473 | guess_boot_cpuid((yyvsp[0].node))); | |
2a6a08ca | 1474 | } |
53e5e540 | 1475 | #line 1476 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1476 | break; |
1477 | ||
1478 | case 3: | |
53e5e540 | 1479 | #line 118 "dtc-parser.y" /* yacc.c:1646 */ |
a4da2e3e | 1480 | { |
53e5e540 | 1481 | (yyval.is_plugin) = false; |
2a6a08ca | 1482 | } |
53e5e540 | 1483 | #line 1484 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1484 | break; |
1485 | ||
1486 | case 4: | |
53e5e540 | 1487 | #line 122 "dtc-parser.y" /* yacc.c:1646 */ |
a4da2e3e | 1488 | { |
53e5e540 | 1489 | (yyval.is_plugin) = true; |
2a6a08ca | 1490 | } |
53e5e540 | 1491 | #line 1492 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1492 | break; |
1493 | ||
1494 | case 5: | |
53e5e540 | 1495 | #line 129 "dtc-parser.y" /* yacc.c:1646 */ |
a4da2e3e | 1496 | { |
53e5e540 | 1497 | (yyval.re) = NULL; |
2a6a08ca | 1498 | } |
53e5e540 | 1499 | #line 1500 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1500 | break; |
1501 | ||
1502 | case 6: | |
53e5e540 PE |
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 */ | |
a4da2e3e | 1520 | { |
47605971 RH |
1521 | add_label(&(yyvsp[0].re)->labels, (yyvsp[-1].labelref)); |
1522 | (yyval.re) = (yyvsp[0].re); | |
2a6a08ca | 1523 | } |
53e5e540 | 1524 | #line 1525 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1525 | break; |
1526 | ||
53e5e540 PE |
1527 | case 9: |
1528 | #line 152 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1529 | { |
47605971 | 1530 | (yyval.node) = name_node((yyvsp[0].node), ""); |
2a6a08ca | 1531 | } |
53e5e540 | 1532 | #line 1533 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1533 | break; |
1534 | ||
53e5e540 PE |
1535 | case 10: |
1536 | #line 156 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1537 | { |
47605971 | 1538 | (yyval.node) = merge_nodes((yyvsp[-2].node), (yyvsp[0].node)); |
2a6a08ca | 1539 | } |
53e5e540 | 1540 | #line 1541 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1541 | break; |
1542 | ||
53e5e540 PE |
1543 | case 11: |
1544 | #line 161 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1545 | { |
47605971 | 1546 | struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref)); |
cd296721 | 1547 | |
47605971 | 1548 | add_label(&target->labels, (yyvsp[-2].labelref)); |
cd296721 | 1549 | if (target) |
47605971 | 1550 | merge_nodes(target, (yyvsp[0].node)); |
cd296721 | 1551 | else |
47605971 RH |
1552 | ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref)); |
1553 | (yyval.node) = (yyvsp[-3].node); | |
2a6a08ca | 1554 | } |
53e5e540 | 1555 | #line 1556 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1556 | break; |
1557 | ||
53e5e540 PE |
1558 | case 12: |
1559 | #line 172 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1560 | { |
47605971 | 1561 | struct node *target = get_node_by_ref((yyvsp[-2].node), (yyvsp[-1].labelref)); |
658f29a5 | 1562 | |
47605971 RH |
1563 | if (target) |
1564 | merge_nodes(target, (yyvsp[0].node)); | |
658f29a5 | 1565 | else |
47605971 RH |
1566 | ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref)); |
1567 | (yyval.node) = (yyvsp[-2].node); | |
2a6a08ca | 1568 | } |
53e5e540 | 1569 | #line 1570 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1570 | break; |
1571 | ||
53e5e540 PE |
1572 | case 13: |
1573 | #line 182 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1574 | { |
47605971 RH |
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); | |
2a6a08ca | 1584 | } |
53e5e540 | 1585 | #line 1586 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1586 | break; |
1587 | ||
53e5e540 PE |
1588 | case 14: |
1589 | #line 197 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1590 | { |
47605971 | 1591 | (yyval.node) = build_node((yyvsp[-3].proplist), (yyvsp[-2].nodelist)); |
2a6a08ca | 1592 | } |
53e5e540 | 1593 | #line 1594 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1594 | break; |
1595 | ||
53e5e540 PE |
1596 | case 15: |
1597 | #line 204 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1598 | { |
47605971 | 1599 | (yyval.proplist) = NULL; |
2a6a08ca | 1600 | } |
53e5e540 | 1601 | #line 1602 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1602 | break; |
1603 | ||
53e5e540 PE |
1604 | case 16: |
1605 | #line 208 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1606 | { |
47605971 | 1607 | (yyval.proplist) = chain_property((yyvsp[0].prop), (yyvsp[-1].proplist)); |
2a6a08ca | 1608 | } |
53e5e540 | 1609 | #line 1610 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1610 | break; |
1611 | ||
53e5e540 PE |
1612 | case 17: |
1613 | #line 215 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1614 | { |
47605971 | 1615 | (yyval.prop) = build_property((yyvsp[-3].propnodename), (yyvsp[-1].data)); |
2a6a08ca | 1616 | } |
53e5e540 | 1617 | #line 1618 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1618 | break; |
1619 | ||
53e5e540 PE |
1620 | case 18: |
1621 | #line 219 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1622 | { |
47605971 | 1623 | (yyval.prop) = build_property((yyvsp[-1].propnodename), empty_data); |
2a6a08ca | 1624 | } |
53e5e540 | 1625 | #line 1626 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1626 | break; |
1627 | ||
53e5e540 PE |
1628 | case 19: |
1629 | #line 223 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1630 | { |
47605971 | 1631 | (yyval.prop) = build_property_delete((yyvsp[-1].propnodename)); |
2a6a08ca | 1632 | } |
53e5e540 | 1633 | #line 1634 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1634 | break; |
1635 | ||
53e5e540 PE |
1636 | case 20: |
1637 | #line 227 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1638 | { |
47605971 RH |
1639 | add_label(&(yyvsp[0].prop)->labels, (yyvsp[-1].labelref)); |
1640 | (yyval.prop) = (yyvsp[0].prop); | |
2a6a08ca | 1641 | } |
53e5e540 | 1642 | #line 1643 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1643 | break; |
1644 | ||
53e5e540 PE |
1645 | case 21: |
1646 | #line 235 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1647 | { |
47605971 | 1648 | (yyval.data) = data_merge((yyvsp[-1].data), (yyvsp[0].data)); |
2a6a08ca | 1649 | } |
53e5e540 | 1650 | #line 1651 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1651 | break; |
1652 | ||
53e5e540 PE |
1653 | case 22: |
1654 | #line 239 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1655 | { |
47605971 | 1656 | (yyval.data) = data_merge((yyvsp[-2].data), (yyvsp[-1].array).data); |
2a6a08ca | 1657 | } |
53e5e540 | 1658 | #line 1659 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1659 | break; |
1660 | ||
53e5e540 PE |
1661 | case 23: |
1662 | #line 243 "dtc-parser.y" /* yacc.c:1646 */ | |
cd296721 | 1663 | { |
47605971 | 1664 | (yyval.data) = data_merge((yyvsp[-3].data), (yyvsp[-1].data)); |
2a6a08ca | 1665 | } |
53e5e540 | 1666 | #line 1667 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1667 | break; |
1668 | ||
53e5e540 PE |
1669 | case 24: |
1670 | #line 247 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1671 | { |
47605971 RH |
1672 | (yyval.data) = data_add_marker((yyvsp[-1].data), REF_PATH, (yyvsp[0].labelref)); |
1673 | } | |
53e5e540 | 1674 | #line 1675 "dtc-parser.tab.c" /* yacc.c:1646 */ |
47605971 RH |
1675 | break; |
1676 | ||
53e5e540 PE |
1677 | case 25: |
1678 | #line 251 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 RH |
1679 | { |
1680 | FILE *f = srcfile_relative_open((yyvsp[-5].data).val, NULL); | |
658f29a5 | 1681 | struct data d; |
ed95d745 | 1682 | |
47605971 RH |
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)); | |
ed95d745 | 1688 | |
47605971 | 1689 | d = data_copy_file(f, (yyvsp[-1].integer)); |
ed95d745 | 1690 | |
47605971 | 1691 | (yyval.data) = data_merge((yyvsp[-8].data), d); |
658f29a5 | 1692 | fclose(f); |
2a6a08ca | 1693 | } |
53e5e540 | 1694 | #line 1695 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1695 | break; |
1696 | ||
53e5e540 PE |
1697 | case 26: |
1698 | #line 267 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1699 | { |
47605971 | 1700 | FILE *f = srcfile_relative_open((yyvsp[-1].data).val, NULL); |
ed95d745 DG |
1701 | struct data d = empty_data; |
1702 | ||
658f29a5 | 1703 | d = data_copy_file(f, -1); |
ed95d745 | 1704 | |
47605971 | 1705 | (yyval.data) = data_merge((yyvsp[-4].data), d); |
658f29a5 | 1706 | fclose(f); |
2a6a08ca | 1707 | } |
53e5e540 | 1708 | #line 1709 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1709 | break; |
1710 | ||
53e5e540 PE |
1711 | case 27: |
1712 | #line 277 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1713 | { |
47605971 | 1714 | (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref)); |
2a6a08ca | 1715 | } |
53e5e540 | 1716 | #line 1717 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1717 | break; |
1718 | ||
53e5e540 PE |
1719 | case 28: |
1720 | #line 284 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1721 | { |
cd296721 | 1722 | (yyval.data) = empty_data; |
2a6a08ca | 1723 | } |
53e5e540 | 1724 | #line 1725 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1725 | break; |
1726 | ||
53e5e540 PE |
1727 | case 29: |
1728 | #line 288 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1729 | { |
47605971 | 1730 | (yyval.data) = (yyvsp[-1].data); |
2a6a08ca | 1731 | } |
53e5e540 | 1732 | #line 1733 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1733 | break; |
1734 | ||
53e5e540 PE |
1735 | case 30: |
1736 | #line 292 "dtc-parser.y" /* yacc.c:1646 */ | |
ed95d745 | 1737 | { |
47605971 | 1738 | (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref)); |
2a6a08ca | 1739 | } |
53e5e540 | 1740 | #line 1741 "dtc-parser.tab.c" /* yacc.c:1646 */ |
ed95d745 DG |
1741 | break; |
1742 | ||
53e5e540 PE |
1743 | case 31: |
1744 | #line 299 "dtc-parser.y" /* yacc.c:1646 */ | |
ed95d745 | 1745 | { |
47605971 RH |
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; | |
cd296721 | 1755 | } |
47605971 RH |
1756 | |
1757 | (yyval.array).data = empty_data; | |
1758 | (yyval.array).bits = bits; | |
2a6a08ca | 1759 | } |
53e5e540 | 1760 | #line 1761 "dtc-parser.tab.c" /* yacc.c:1646 */ |
ed95d745 DG |
1761 | break; |
1762 | ||
53e5e540 PE |
1763 | case 32: |
1764 | #line 315 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1765 | { |
cd296721 SW |
1766 | (yyval.array).data = empty_data; |
1767 | (yyval.array).bits = 32; | |
2a6a08ca | 1768 | } |
53e5e540 | 1769 | #line 1770 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1770 | break; |
1771 | ||
53e5e540 PE |
1772 | case 33: |
1773 | #line 320 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1774 | { |
47605971 RH |
1775 | if ((yyvsp[-1].array).bits < 64) { |
1776 | uint64_t mask = (1ULL << (yyvsp[-1].array).bits) - 1; | |
cd296721 SW |
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 | */ | |
47605971 RH |
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); | |
cd296721 SW |
1788 | } |
1789 | ||
47605971 | 1790 | (yyval.array).data = data_append_integer((yyvsp[-1].array).data, (yyvsp[0].integer), (yyvsp[-1].array).bits); |
2a6a08ca | 1791 | } |
53e5e540 | 1792 | #line 1793 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1793 | break; |
1794 | ||
53e5e540 PE |
1795 | case 34: |
1796 | #line 339 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1797 | { |
47605971 | 1798 | uint64_t val = ~0ULL >> (64 - (yyvsp[-1].array).bits); |
cd296721 | 1799 | |
47605971 RH |
1800 | if ((yyvsp[-1].array).bits == 32) |
1801 | (yyvsp[-1].array).data = data_add_marker((yyvsp[-1].array).data, | |
cd296721 | 1802 | REF_PHANDLE, |
47605971 | 1803 | (yyvsp[0].labelref)); |
cd296721 | 1804 | else |
47605971 | 1805 | ERROR(&(yylsp[0]), "References are only allowed in " |
cd296721 SW |
1806 | "arrays with 32-bit elements."); |
1807 | ||
47605971 | 1808 | (yyval.array).data = data_append_integer((yyvsp[-1].array).data, val, (yyvsp[-1].array).bits); |
2a6a08ca | 1809 | } |
53e5e540 | 1810 | #line 1811 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1811 | break; |
1812 | ||
53e5e540 PE |
1813 | case 35: |
1814 | #line 353 "dtc-parser.y" /* yacc.c:1646 */ | |
a4da2e3e | 1815 | { |
47605971 | 1816 | (yyval.array).data = data_add_marker((yyvsp[-1].array).data, LABEL, (yyvsp[0].labelref)); |
2a6a08ca | 1817 | } |
53e5e540 | 1818 | #line 1819 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1819 | break; |
1820 | ||
53e5e540 PE |
1821 | case 38: |
1822 | #line 362 "dtc-parser.y" /* yacc.c:1646 */ | |
cd296721 | 1823 | { |
47605971 | 1824 | (yyval.integer) = (yyvsp[-1].integer); |
2a6a08ca | 1825 | } |
53e5e540 | 1826 | #line 1827 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1827 | break; |
1828 | ||
53e5e540 PE |
1829 | case 41: |
1830 | #line 373 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1831 | { (yyval.integer) = (yyvsp[-4].integer) ? (yyvsp[-2].integer) : (yyvsp[0].integer); } |
53e5e540 | 1832 | #line 1833 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1833 | break; |
1834 | ||
53e5e540 PE |
1835 | case 43: |
1836 | #line 378 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1837 | { (yyval.integer) = (yyvsp[-2].integer) || (yyvsp[0].integer); } |
53e5e540 | 1838 | #line 1839 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1839 | break; |
1840 | ||
53e5e540 PE |
1841 | case 45: |
1842 | #line 383 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1843 | { (yyval.integer) = (yyvsp[-2].integer) && (yyvsp[0].integer); } |
53e5e540 | 1844 | #line 1845 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1845 | break; |
1846 | ||
53e5e540 PE |
1847 | case 47: |
1848 | #line 388 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1849 | { (yyval.integer) = (yyvsp[-2].integer) | (yyvsp[0].integer); } |
53e5e540 | 1850 | #line 1851 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1851 | break; |
1852 | ||
53e5e540 PE |
1853 | case 49: |
1854 | #line 393 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1855 | { (yyval.integer) = (yyvsp[-2].integer) ^ (yyvsp[0].integer); } |
53e5e540 | 1856 | #line 1857 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1857 | break; |
1858 | ||
53e5e540 PE |
1859 | case 51: |
1860 | #line 398 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1861 | { (yyval.integer) = (yyvsp[-2].integer) & (yyvsp[0].integer); } |
53e5e540 | 1862 | #line 1863 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1863 | break; |
1864 | ||
53e5e540 PE |
1865 | case 53: |
1866 | #line 403 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1867 | { (yyval.integer) = (yyvsp[-2].integer) == (yyvsp[0].integer); } |
53e5e540 | 1868 | #line 1869 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1869 | break; |
1870 | ||
53e5e540 PE |
1871 | case 54: |
1872 | #line 404 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1873 | { (yyval.integer) = (yyvsp[-2].integer) != (yyvsp[0].integer); } |
53e5e540 | 1874 | #line 1875 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1875 | break; |
1876 | ||
53e5e540 PE |
1877 | case 56: |
1878 | #line 409 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1879 | { (yyval.integer) = (yyvsp[-2].integer) < (yyvsp[0].integer); } |
53e5e540 | 1880 | #line 1881 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1881 | break; |
1882 | ||
53e5e540 PE |
1883 | case 57: |
1884 | #line 410 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1885 | { (yyval.integer) = (yyvsp[-2].integer) > (yyvsp[0].integer); } |
53e5e540 | 1886 | #line 1887 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1887 | break; |
1888 | ||
53e5e540 PE |
1889 | case 58: |
1890 | #line 411 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1891 | { (yyval.integer) = (yyvsp[-2].integer) <= (yyvsp[0].integer); } |
53e5e540 | 1892 | #line 1893 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1893 | break; |
1894 | ||
53e5e540 PE |
1895 | case 59: |
1896 | #line 412 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1897 | { (yyval.integer) = (yyvsp[-2].integer) >= (yyvsp[0].integer); } |
53e5e540 | 1898 | #line 1899 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1899 | break; |
1900 | ||
53e5e540 PE |
1901 | case 60: |
1902 | #line 416 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1903 | { (yyval.integer) = (yyvsp[-2].integer) << (yyvsp[0].integer); } |
53e5e540 | 1904 | #line 1905 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1905 | break; |
1906 | ||
53e5e540 PE |
1907 | case 61: |
1908 | #line 417 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1909 | { (yyval.integer) = (yyvsp[-2].integer) >> (yyvsp[0].integer); } |
53e5e540 | 1910 | #line 1911 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1911 | break; |
1912 | ||
53e5e540 PE |
1913 | case 63: |
1914 | #line 422 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1915 | { (yyval.integer) = (yyvsp[-2].integer) + (yyvsp[0].integer); } |
53e5e540 | 1916 | #line 1917 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1917 | break; |
1918 | ||
53e5e540 PE |
1919 | case 64: |
1920 | #line 423 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1921 | { (yyval.integer) = (yyvsp[-2].integer) - (yyvsp[0].integer); } |
53e5e540 | 1922 | #line 1923 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1923 | break; |
1924 | ||
53e5e540 PE |
1925 | case 66: |
1926 | #line 428 "dtc-parser.y" /* yacc.c:1646 */ | |
47605971 | 1927 | { (yyval.integer) = (yyvsp[-2].integer) * (yyvsp[0].integer); } |
53e5e540 | 1928 | #line 1929 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1929 | break; |
1930 | ||
53e5e540 PE |
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 */ | |
cd296721 SW |
1935 | break; |
1936 | ||
53e5e540 PE |
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 */ | |
cd296721 SW |
1941 | break; |
1942 | ||
53e5e540 | 1943 | case 71: |
91feabc2 | 1944 | #line 436 "dtc-parser.y" /* yacc.c:1646 */ |
47605971 | 1945 | { (yyval.integer) = -(yyvsp[0].integer); } |
53e5e540 | 1946 | #line 1947 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1947 | break; |
1948 | ||
53e5e540 | 1949 | case 72: |
91feabc2 | 1950 | #line 437 "dtc-parser.y" /* yacc.c:1646 */ |
47605971 | 1951 | { (yyval.integer) = ~(yyvsp[0].integer); } |
53e5e540 | 1952 | #line 1953 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1953 | break; |
1954 | ||
53e5e540 | 1955 | case 73: |
91feabc2 | 1956 | #line 438 "dtc-parser.y" /* yacc.c:1646 */ |
47605971 | 1957 | { (yyval.integer) = !(yyvsp[0].integer); } |
53e5e540 | 1958 | #line 1959 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1959 | break; |
1960 | ||
53e5e540 | 1961 | case 74: |
91feabc2 | 1962 | #line 443 "dtc-parser.y" /* yacc.c:1646 */ |
cd296721 | 1963 | { |
47605971 | 1964 | (yyval.data) = empty_data; |
2a6a08ca | 1965 | } |
53e5e540 | 1966 | #line 1967 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1967 | break; |
1968 | ||
53e5e540 | 1969 | case 75: |
91feabc2 | 1970 | #line 447 "dtc-parser.y" /* yacc.c:1646 */ |
cd296721 | 1971 | { |
47605971 | 1972 | (yyval.data) = data_append_byte((yyvsp[-1].data), (yyvsp[0].byte)); |
2a6a08ca | 1973 | } |
53e5e540 | 1974 | #line 1975 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
1975 | break; |
1976 | ||
53e5e540 | 1977 | case 76: |
91feabc2 | 1978 | #line 451 "dtc-parser.y" /* yacc.c:1646 */ |
a4da2e3e | 1979 | { |
47605971 | 1980 | (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref)); |
2a6a08ca | 1981 | } |
53e5e540 | 1982 | #line 1983 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1983 | break; |
1984 | ||
53e5e540 | 1985 | case 77: |
91feabc2 | 1986 | #line 458 "dtc-parser.y" /* yacc.c:1646 */ |
a4da2e3e | 1987 | { |
47605971 | 1988 | (yyval.nodelist) = NULL; |
2a6a08ca | 1989 | } |
53e5e540 | 1990 | #line 1991 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1991 | break; |
1992 | ||
53e5e540 | 1993 | case 78: |
91feabc2 | 1994 | #line 462 "dtc-parser.y" /* yacc.c:1646 */ |
a4da2e3e | 1995 | { |
47605971 | 1996 | (yyval.nodelist) = chain_node((yyvsp[-1].node), (yyvsp[0].nodelist)); |
2a6a08ca | 1997 | } |
53e5e540 | 1998 | #line 1999 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
1999 | break; |
2000 | ||
53e5e540 | 2001 | case 79: |
91feabc2 | 2002 | #line 466 "dtc-parser.y" /* yacc.c:1646 */ |
a4da2e3e | 2003 | { |
47605971 RH |
2004 | ERROR(&(yylsp[0]), "Properties must precede subnodes"); |
2005 | YYERROR; | |
2a6a08ca | 2006 | } |
53e5e540 | 2007 | #line 2008 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
2008 | break; |
2009 | ||
53e5e540 | 2010 | case 80: |
91feabc2 | 2011 | #line 474 "dtc-parser.y" /* yacc.c:1646 */ |
cd296721 | 2012 | { |
47605971 | 2013 | (yyval.node) = name_node((yyvsp[0].node), (yyvsp[-1].propnodename)); |
2a6a08ca | 2014 | } |
53e5e540 | 2015 | #line 2016 "dtc-parser.tab.c" /* yacc.c:1646 */ |
cd296721 SW |
2016 | break; |
2017 | ||
53e5e540 | 2018 | case 81: |
91feabc2 | 2019 | #line 478 "dtc-parser.y" /* yacc.c:1646 */ |
47605971 RH |
2020 | { |
2021 | (yyval.node) = name_node(build_node_delete(), (yyvsp[-1].propnodename)); | |
2022 | } | |
53e5e540 | 2023 | #line 2024 "dtc-parser.tab.c" /* yacc.c:1646 */ |
47605971 RH |
2024 | break; |
2025 | ||
53e5e540 | 2026 | case 82: |
91feabc2 | 2027 | #line 482 "dtc-parser.y" /* yacc.c:1646 */ |
a4da2e3e | 2028 | { |
47605971 RH |
2029 | add_label(&(yyvsp[0].node)->labels, (yyvsp[-1].labelref)); |
2030 | (yyval.node) = (yyvsp[0].node); | |
2a6a08ca | 2031 | } |
53e5e540 | 2032 | #line 2033 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
2033 | break; |
2034 | ||
2035 | ||
53e5e540 | 2036 | #line 2037 "dtc-parser.tab.c" /* yacc.c:1646 */ |
a4da2e3e DG |
2037 | default: break; |
2038 | } | |
2a6a08ca GL |
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. */ | |
a4da2e3e DG |
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; | |
47605971 | 2057 | *++yylsp = yyloc; |
a4da2e3e | 2058 | |
47605971 | 2059 | /* Now 'shift' the result of the reduction. Determine what state |
a4da2e3e DG |
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 | ||
47605971 RH |
2074 | /*--------------------------------------. |
2075 | | yyerrlab -- here on detecting error. | | |
2076 | `--------------------------------------*/ | |
a4da2e3e | 2077 | yyerrlab: |
2a6a08ca GL |
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 | ||
a4da2e3e DG |
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 | |
2a6a08ca GL |
2089 | # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ |
2090 | yyssp, yytoken) | |
a4da2e3e | 2091 | { |
2a6a08ca GL |
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; | |
a4da2e3e | 2117 | } |
2a6a08ca | 2118 | # undef YYSYNTAX_ERROR |
a4da2e3e DG |
2119 | #endif |
2120 | } | |
2121 | ||
47605971 | 2122 | yyerror_range[1] = yylloc; |
a4da2e3e DG |
2123 | |
2124 | if (yyerrstatus == 3) | |
2125 | { | |
658f29a5 | 2126 | /* If just tried and failed to reuse lookahead token after an |
47605971 | 2127 | error, discard it. */ |
a4da2e3e DG |
2128 | |
2129 | if (yychar <= YYEOF) | |
47605971 RH |
2130 | { |
2131 | /* Return failure if at end of input. */ | |
2132 | if (yychar == YYEOF) | |
2133 | YYABORT; | |
2134 | } | |
a4da2e3e | 2135 | else |
47605971 RH |
2136 | { |
2137 | yydestruct ("Error: discarding", | |
2138 | yytoken, &yylval, &yylloc); | |
2139 | yychar = YYEMPTY; | |
2140 | } | |
a4da2e3e DG |
2141 | } |
2142 | ||
658f29a5 | 2143 | /* Else will try to reuse lookahead token after shifting the error |
a4da2e3e DG |
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 | ||
47605971 RH |
2159 | yyerror_range[1] = yylsp[1-yylen]; |
2160 | /* Do not reclaim the symbols of the rule whose action triggered | |
a4da2e3e DG |
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: | |
47605971 | 2173 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
a4da2e3e DG |
2174 | |
2175 | for (;;) | |
2176 | { | |
2177 | yyn = yypact[yystate]; | |
2a6a08ca | 2178 | if (!yypact_value_is_default (yyn)) |
47605971 RH |
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 | } | |
a4da2e3e DG |
2188 | |
2189 | /* Pop the current state because it cannot handle the error token. */ | |
2190 | if (yyssp == yyss) | |
47605971 | 2191 | YYABORT; |
658f29a5 | 2192 | |
47605971 | 2193 | yyerror_range[1] = *yylsp; |
a4da2e3e | 2194 | yydestruct ("Error: popping", |
47605971 | 2195 | yystos[yystate], yyvsp, yylsp); |
a4da2e3e DG |
2196 | YYPOPSTACK (1); |
2197 | yystate = *yyssp; | |
2198 | YY_STACK_PRINT (yyss, yyssp); | |
2199 | } | |
2200 | ||
a878b910 | 2201 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
a4da2e3e | 2202 | *++yyvsp = yylval; |
a878b910 | 2203 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
a4da2e3e | 2204 | |
47605971 RH |
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; | |
a4da2e3e DG |
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 | ||
a878b910 | 2232 | #if !defined yyoverflow || YYERROR_VERBOSE |
a4da2e3e DG |
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: | |
658f29a5 | 2243 | if (yychar != YYEMPTY) |
2a6a08ca GL |
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", | |
47605971 | 2249 | yytoken, &yylval, &yylloc); |
2a6a08ca | 2250 | } |
47605971 | 2251 | /* Do not reclaim the symbols of the rule whose action triggered |
a4da2e3e DG |
2252 | this YYABORT or YYACCEPT. */ |
2253 | YYPOPSTACK (yylen); | |
2254 | YY_STACK_PRINT (yyss, yyssp); | |
2255 | while (yyssp != yyss) | |
2256 | { | |
2257 | yydestruct ("Cleanup: popping", | |
47605971 | 2258 | yystos[*yyssp], yyvsp, yylsp); |
a4da2e3e DG |
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 | |
47605971 | 2269 | return yyresult; |
a4da2e3e | 2270 | } |
91feabc2 | 2271 | #line 488 "dtc-parser.y" /* yacc.c:1906 */ |
a4da2e3e DG |
2272 | |
2273 | ||
47605971 | 2274 | void yyerror(char const *s) |
cd296721 | 2275 | { |
47605971 | 2276 | ERROR(&yylloc, "%s", s); |
cd296721 | 2277 | } |