aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-02-27 18:28:47 -0500
committerRob Herring <robh@kernel.org>2018-03-05 21:58:17 -0500
commite039139be8c25145b103ab365ff1bd4a540066a3 (patch)
tree322c47daa93479e5139aba875c3bd253d17498a8
parenta54b81ea242309a098162c3284ed964074bee72a (diff)
scripts/dtc: generate lexer and parser during build instead of shipping
Now that the kernel build supports flex and bison, remove the _shipped files and generate them during the build instead. Based on Masahiro's original patch. Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Rob Herring <robh@kernel.org>
-rw-r--r--scripts/dtc/Makefile6
-rw-r--r--scripts/dtc/dtc-lexer.lex.c_shipped2259
-rw-r--r--scripts/dtc/dtc-parser.tab.c_shipped2321
-rw-r--r--scripts/dtc/dtc-parser.tab.h_shipped125
-rwxr-xr-xscripts/dtc/update-dtc-source.sh7
5 files changed, 5 insertions, 4713 deletions
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
index 0dc922bb7aea..a88b8c9bf46d 100644
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -28,5 +28,7 @@ HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC)
28# dependencies on generated files need to be listed explicitly 28# dependencies on generated files need to be listed explicitly
29$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h 29$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
30 30
31# generated files need to be cleaned explicitly 31# generated files need to include *.cmd and be cleaned explicitly
32clean-files := dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h 32generated-files := dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h
33targets := $(generated-files)
34clean-files := $(generated-files)
diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped
deleted file mode 100644
index 011bb9632ff2..000000000000
--- a/scripts/dtc/dtc-lexer.lex.c_shipped
+++ /dev/null
@@ -1,2259 +0,0 @@
1#line 2 "dtc-lexer.lex.c"
2
3#line 4 "dtc-lexer.lex.c"
4
5#define YY_INT_ALIGNED short int
6
7/* A lexical scanner generated by flex */
8
9#define FLEX_SCANNER
10#define YY_FLEX_MAJOR_VERSION 2
11#define YY_FLEX_MINOR_VERSION 6
12#define YY_FLEX_SUBMINOR_VERSION 1
13#if YY_FLEX_SUBMINOR_VERSION > 0
14#define FLEX_BETA
15#endif
16
17/* First, we deal with platform-specific or compiler-specific issues. */
18
19/* begin standard C headers. */
20#include <stdio.h>
21#include <string.h>
22#include <errno.h>
23#include <stdlib.h>
24
25/* end standard C headers. */
26
27/* flex integer type definitions */
28
29#ifndef FLEXINT_H
30#define FLEXINT_H
31
32/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
34#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35
36/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
38 */
39#ifndef __STDC_LIMIT_MACROS
40#define __STDC_LIMIT_MACROS 1
41#endif
42
43#include <inttypes.h>
44typedef int8_t flex_int8_t;
45typedef uint8_t flex_uint8_t;
46typedef int16_t flex_int16_t;
47typedef uint16_t flex_uint16_t;
48typedef int32_t flex_int32_t;
49typedef uint32_t flex_uint32_t;
50#else
51typedef signed char flex_int8_t;
52typedef short int flex_int16_t;
53typedef int flex_int32_t;
54typedef unsigned char flex_uint8_t;
55typedef unsigned short int flex_uint16_t;
56typedef unsigned int flex_uint32_t;
57
58/* Limits of integral types. */
59#ifndef INT8_MIN
60#define INT8_MIN (-128)
61#endif
62#ifndef INT16_MIN
63#define INT16_MIN (-32767-1)
64#endif
65#ifndef INT32_MIN
66#define INT32_MIN (-2147483647-1)
67#endif
68#ifndef INT8_MAX
69#define INT8_MAX (127)
70#endif
71#ifndef INT16_MAX
72#define INT16_MAX (32767)
73#endif
74#ifndef INT32_MAX
75#define INT32_MAX (2147483647)
76#endif
77#ifndef UINT8_MAX
78#define UINT8_MAX (255U)
79#endif
80#ifndef UINT16_MAX
81#define UINT16_MAX (65535U)
82#endif
83#ifndef UINT32_MAX
84#define UINT32_MAX (4294967295U)
85#endif
86
87#endif /* ! C99 */
88
89#endif /* ! FLEXINT_H */
90
91/* TODO: this is always defined, so inline it */
92#define yyconst const
93
94#if defined(__GNUC__) && __GNUC__ >= 3
95#define yynoreturn __attribute__((__noreturn__))
96#else
97#define yynoreturn
98#endif
99
100/* Returned upon end-of-file. */
101#define YY_NULL 0
102
103/* Promotes a possibly negative, possibly signed char to an unsigned
104 * integer for use as an array index. If the signed char is negative,
105 * we want to instead treat it as an 8-bit unsigned char, hence the
106 * double cast.
107 */
108#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
109
110/* Enter a start condition. This macro really ought to take a parameter,
111 * but we do it the disgusting crufty way forced on us by the ()-less
112 * definition of BEGIN.
113 */
114#define BEGIN (yy_start) = 1 + 2 *
115
116/* Translate the current start state into a value that can be later handed
117 * to BEGIN to return to the state. The YYSTATE alias is for lex
118 * compatibility.
119 */
120#define YY_START (((yy_start) - 1) / 2)
121#define YYSTATE YY_START
122
123/* Action number for EOF rule of a given start state. */
124#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
125
126/* Special action meaning "start processing a new file". */
127#define YY_NEW_FILE yyrestart(yyin )
128
129#define YY_END_OF_BUFFER_CHAR 0
130
131/* Size of default input buffer. */
132#ifndef YY_BUF_SIZE
133#ifdef __ia64__
134/* On IA-64, the buffer size is 16k, not 8k.
135 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
136 * Ditto for the __ia64__ case accordingly.
137 */
138#define YY_BUF_SIZE 32768
139#else
140#define YY_BUF_SIZE 16384
141#endif /* __ia64__ */
142#endif
143
144/* The state buf must be large enough to hold one state per character in the main buffer.
145 */
146#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
147
148#ifndef YY_TYPEDEF_YY_BUFFER_STATE
149#define YY_TYPEDEF_YY_BUFFER_STATE
150typedef struct yy_buffer_state *YY_BUFFER_STATE;
151#endif
152
153#ifndef YY_TYPEDEF_YY_SIZE_T
154#define YY_TYPEDEF_YY_SIZE_T
155typedef size_t yy_size_t;
156#endif
157
158extern int yyleng;
159
160extern FILE *yyin, *yyout;
161
162#define EOB_ACT_CONTINUE_SCAN 0
163#define EOB_ACT_END_OF_FILE 1
164#define EOB_ACT_LAST_MATCH 2
165
166 #define YY_LESS_LINENO(n)
167 #define YY_LINENO_REWIND_TO(ptr)
168
169/* Return all but the first "n" matched characters back to the input stream. */
170#define yyless(n) \
171 do \
172 { \
173 /* Undo effects of setting up yytext. */ \
174 int yyless_macro_arg = (n); \
175 YY_LESS_LINENO(yyless_macro_arg);\
176 *yy_cp = (yy_hold_char); \
177 YY_RESTORE_YY_MORE_OFFSET \
178 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
179 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
180 } \
181 while ( 0 )
182
183#define unput(c) yyunput( c, (yytext_ptr) )
184
185#ifndef YY_STRUCT_YY_BUFFER_STATE
186#define YY_STRUCT_YY_BUFFER_STATE
187struct yy_buffer_state
188 {
189 FILE *yy_input_file;
190
191 char *yy_ch_buf; /* input buffer */
192 char *yy_buf_pos; /* current position in input buffer */
193
194 /* Size of input buffer in bytes, not including room for EOB
195 * characters.
196 */
197 int yy_buf_size;
198
199 /* Number of characters read into yy_ch_buf, not including EOB
200 * characters.
201 */
202 int yy_n_chars;
203
204 /* Whether we "own" the buffer - i.e., we know we created it,
205 * and can realloc() it to grow it, and should free() it to
206 * delete it.
207 */
208 int yy_is_our_buffer;
209
210 /* Whether this is an "interactive" input source; if so, and
211 * if we're using stdio for input, then we want to use getc()
212 * instead of fread(), to make sure we stop fetching input after
213 * each newline.
214 */
215 int yy_is_interactive;
216
217 /* Whether we're considered to be at the beginning of a line.
218 * If so, '^' rules will be active on the next match, otherwise
219 * not.
220 */
221 int yy_at_bol;
222
223 int yy_bs_lineno; /**< The line count. */
224 int yy_bs_column; /**< The column count. */
225
226 /* Whether to try to fill the input buffer when we reach the
227 * end of it.
228 */
229 int yy_fill_buffer;
230
231 int yy_buffer_status;
232
233#define YY_BUFFER_NEW 0
234#define YY_BUFFER_NORMAL 1
235 /* When an EOF's been seen but there's still some text to process
236 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
237 * shouldn't try reading from the input source any more. We might
238 * still have a bunch of tokens to match, though, because of
239 * possible backing-up.
240 *
241 * When we actually see the EOF, we change the status to "new"
242 * (via yyrestart()), so that the user can continue scanning by
243 * just pointing yyin at a new input file.
244 */
245#define YY_BUFFER_EOF_PENDING 2
246
247 };
248#endif /* !YY_STRUCT_YY_BUFFER_STATE */
249
250/* Stack of input buffers. */
251static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
252static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
253static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
254
255/* We provide macros for accessing buffer states in case in the
256 * future we want to put the buffer states in a more general
257 * "scanner state".
258 *
259 * Returns the top of the stack, or NULL.
260 */
261#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
262 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
263 : NULL)
264
265/* Same as previous macro, but useful when we know that the buffer stack is not
266 * NULL or when we need an lvalue. For internal use only.
267 */
268#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
269
270/* yy_hold_char holds the character lost when yytext is formed. */
271static char yy_hold_char;
272static int yy_n_chars; /* number of characters read into yy_ch_buf */
273int yyleng;
274
275/* Points to current character in buffer. */
276static char *yy_c_buf_p = NULL;
277static int yy_init = 0; /* whether we need to initialize */
278static int yy_start = 0; /* start state number */
279
280/* Flag which is used to allow yywrap()'s to do buffer switches
281 * instead of setting up a fresh yyin. A bit of a hack ...
282 */
283static int yy_did_buffer_switch_on_eof;
284
285void yyrestart (FILE *input_file );
286void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
287YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
288void yy_delete_buffer (YY_BUFFER_STATE b );
289void yy_flush_buffer (YY_BUFFER_STATE b );
290void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
291void yypop_buffer_state (void );
292
293static void yyensure_buffer_stack (void );
294static void yy_load_buffer_state (void );
295static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
296
297#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
298
299YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
300YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
301YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
302
303void *yyalloc (yy_size_t );
304void *yyrealloc (void *,yy_size_t );
305void yyfree (void * );
306
307#define yy_new_buffer yy_create_buffer
308
309#define yy_set_interactive(is_interactive) \
310 { \
311 if ( ! YY_CURRENT_BUFFER ){ \
312 yyensure_buffer_stack (); \
313 YY_CURRENT_BUFFER_LVALUE = \
314 yy_create_buffer(yyin,YY_BUF_SIZE ); \
315 } \
316 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
317 }
318
319#define yy_set_bol(at_bol) \
320 { \
321 if ( ! YY_CURRENT_BUFFER ){\
322 yyensure_buffer_stack (); \
323 YY_CURRENT_BUFFER_LVALUE = \
324 yy_create_buffer(yyin,YY_BUF_SIZE ); \
325 } \
326 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
327 }
328
329#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
330
331/* Begin user sect3 */
332
333#define yywrap() (/*CONSTCOND*/1)
334#define YY_SKIP_YYWRAP
335
336typedef unsigned char YY_CHAR;
337
338FILE *yyin = NULL, *yyout = NULL;
339
340typedef int yy_state_type;
341
342extern int yylineno;
343
344int yylineno = 1;
345
346extern char *yytext;
347#ifdef yytext_ptr
348#undef yytext_ptr
349#endif
350#define yytext_ptr yytext
351
352static yy_state_type yy_get_previous_state (void );
353static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
354static int yy_get_next_buffer (void );
355static void yynoreturn yy_fatal_error (yyconst char* msg );
356
357/* Done after the current pattern has been matched and before the
358 * corresponding action - sets up yytext.
359 */
360#define YY_DO_BEFORE_ACTION \
361 (yytext_ptr) = yy_bp; \
362 yyleng = (int) (yy_cp - yy_bp); \
363 (yy_hold_char) = *yy_cp; \
364 *yy_cp = '\0'; \
365 (yy_c_buf_p) = yy_cp;
366
367#define YY_NUM_RULES 31
368#define YY_END_OF_BUFFER 32
369/* This struct is not used in this scanner,
370 but its presence is necessary. */
371struct yy_trans_info
372 {
373 flex_int32_t yy_verify;
374 flex_int32_t yy_nxt;
375 };
376static yyconst flex_int16_t yy_accept[166] =
377 { 0,
378 0, 0, 0, 0, 0, 0, 0, 0, 32, 30,
379 19, 19, 30, 30, 30, 30, 30, 30, 30, 30,
380 30, 30, 30, 30, 30, 30, 16, 17, 17, 30,
381 17, 11, 11, 19, 27, 0, 3, 0, 28, 13,
382 0, 0, 12, 0, 0, 0, 0, 0, 0, 0,
383 0, 22, 24, 26, 25, 23, 0, 10, 29, 0,
384 0, 0, 15, 15, 17, 17, 17, 11, 11, 11,
385 0, 13, 0, 12, 0, 0, 0, 21, 0, 0,
386 0, 0, 0, 0, 0, 0, 0, 17, 11, 11,
387 11, 0, 14, 20, 0, 0, 0, 0, 0, 0,
388
389 0, 0, 0, 0, 17, 0, 0, 0, 0, 0,
390 0, 0, 0, 0, 0, 17, 7, 0, 0, 0,
391 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
392 0, 0, 0, 0, 4, 18, 0, 0, 5, 2,
393 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
394 0, 0, 1, 0, 0, 0, 0, 6, 9, 0,
395 0, 0, 0, 8, 0
396 } ;
397
398static yyconst YY_CHAR yy_ec[256] =
399 { 0,
400 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
401 4, 4, 4, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 2, 5, 6, 7, 1, 1, 8, 9, 1,
404 1, 10, 11, 11, 12, 11, 13, 14, 15, 16,
405 16, 16, 16, 16, 16, 16, 16, 17, 1, 18,
406 19, 20, 11, 11, 21, 21, 21, 21, 21, 21,
407 22, 22, 22, 22, 22, 23, 22, 22, 22, 22,
408 22, 22, 22, 22, 24, 22, 22, 25, 22, 22,
409 1, 26, 27, 1, 22, 1, 21, 28, 29, 30,
410
411 31, 21, 32, 22, 33, 22, 22, 34, 35, 36,
412 37, 38, 22, 39, 40, 41, 42, 43, 22, 25,
413 44, 22, 45, 46, 47, 1, 1, 1, 1, 1,
414 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
415 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421
422 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 1, 1, 1, 1, 1
428 } ;
429
430static yyconst YY_CHAR yy_meta[48] =
431 { 0,
432 1, 1, 1, 1, 1, 1, 2, 3, 1, 2,
433 2, 2, 4, 5, 5, 5, 6, 1, 1, 1,
434 7, 8, 8, 8, 8, 1, 1, 7, 7, 7,
435 7, 8, 8, 8, 8, 8, 8, 8, 8, 8,
436 8, 8, 8, 8, 3, 1, 4
437 } ;
438
439static yyconst flex_uint16_t yy_base[180] =
440 { 0,
441 0, 393, 35, 392, 66, 391, 38, 107, 397, 401,
442 55, 113, 377, 112, 111, 111, 114, 42, 376, 106,
443 377, 347, 126, 120, 0, 147, 401, 0, 124, 0,
444 137, 158, 170, 163, 401, 153, 401, 389, 401, 0,
445 378, 120, 401, 131, 380, 386, 355, 139, 351, 355,
446 351, 401, 401, 401, 401, 401, 367, 401, 401, 185,
447 350, 346, 401, 364, 0, 185, 347, 189, 356, 355,
448 0, 0, 330, 180, 366, 141, 372, 361, 332, 338,
449 331, 341, 334, 326, 205, 331, 337, 329, 401, 341,
450 167, 316, 401, 349, 348, 320, 328, 346, 180, 318,
451
452 324, 209, 324, 320, 322, 342, 338, 309, 306, 315,
453 305, 315, 312, 192, 342, 341, 401, 293, 306, 282,
454 268, 252, 255, 203, 285, 282, 272, 268, 252, 233,
455 232, 239, 208, 107, 401, 401, 238, 211, 401, 211,
456 212, 208, 228, 203, 215, 207, 233, 222, 212, 211,
457 203, 227, 401, 237, 225, 204, 185, 401, 401, 149,
458 128, 88, 42, 401, 401, 253, 259, 267, 271, 275,
459 281, 288, 292, 300, 308, 312, 318, 326, 334
460 } ;
461
462static yyconst flex_int16_t yy_def[180] =
463 { 0,
464 165, 1, 1, 3, 165, 5, 1, 1, 165, 165,
465 165, 165, 165, 166, 167, 168, 165, 165, 165, 165,
466 169, 165, 165, 165, 170, 169, 165, 171, 172, 171,
467 171, 165, 165, 165, 165, 166, 165, 166, 165, 173,
468 165, 168, 165, 168, 174, 175, 165, 165, 165, 165,
469 165, 165, 165, 165, 165, 165, 169, 165, 165, 165,
470 165, 165, 165, 169, 171, 172, 171, 165, 165, 165,
471 176, 173, 177, 168, 174, 174, 175, 165, 165, 165,
472 165, 165, 165, 165, 165, 165, 165, 171, 165, 165,
473 176, 177, 165, 165, 165, 165, 165, 165, 165, 165,
474
475 165, 165, 165, 165, 171, 165, 165, 165, 165, 165,
476 165, 165, 165, 178, 165, 171, 165, 165, 165, 165,
477 165, 165, 165, 178, 165, 178, 165, 165, 165, 165,
478 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
479 165, 165, 165, 165, 165, 165, 165, 179, 165, 165,
480 165, 179, 165, 179, 165, 165, 165, 165, 165, 165,
481 165, 165, 165, 165, 0, 165, 165, 165, 165, 165,
482 165, 165, 165, 165, 165, 165, 165, 165, 165
483 } ;
484
485static yyconst flex_uint16_t yy_nxt[449] =
486 { 0,
487 10, 11, 12, 11, 13, 14, 10, 15, 16, 10,
488 10, 10, 17, 10, 10, 10, 10, 18, 19, 20,
489 21, 21, 21, 21, 21, 10, 10, 21, 21, 21,
490 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
491 21, 21, 21, 21, 10, 22, 10, 24, 25, 25,
492 25, 32, 33, 33, 164, 26, 34, 34, 34, 52,
493 53, 27, 26, 26, 26, 26, 10, 11, 12, 11,
494 13, 14, 28, 15, 16, 28, 28, 28, 24, 28,
495 28, 28, 10, 18, 19, 20, 29, 29, 29, 29,
496 29, 30, 10, 29, 29, 29, 29, 29, 29, 29,
497
498 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
499 10, 22, 10, 23, 34, 34, 34, 37, 39, 43,
500 32, 33, 33, 45, 55, 56, 46, 60, 43, 45,
501 65, 163, 46, 65, 65, 65, 44, 38, 60, 74,
502 58, 47, 141, 48, 142, 44, 49, 47, 50, 48,
503 76, 51, 62, 94, 50, 41, 44, 51, 37, 61,
504 64, 64, 64, 58, 34, 34, 34, 64, 162, 80,
505 67, 68, 68, 68, 64, 64, 64, 64, 38, 81,
506 69, 70, 71, 68, 68, 68, 60, 161, 43, 69,
507 70, 65, 69, 70, 65, 65, 65, 125, 85, 85,
508
509 85, 58, 68, 68, 68, 44, 102, 110, 125, 133,
510 102, 69, 70, 111, 114, 160, 159, 126, 85, 85,
511 85, 140, 140, 140, 140, 140, 140, 153, 126, 147,
512 147, 147, 153, 148, 147, 147, 147, 158, 148, 165,
513 157, 156, 155, 151, 150, 149, 146, 154, 145, 144,
514 143, 139, 154, 36, 36, 36, 36, 36, 36, 36,
515 36, 40, 138, 137, 136, 40, 40, 42, 42, 42,
516 42, 42, 42, 42, 42, 57, 57, 57, 57, 63,
517 135, 63, 65, 134, 165, 65, 133, 65, 65, 66,
518 132, 131, 66, 66, 66, 66, 72, 130, 72, 72,
519
520 75, 75, 75, 75, 75, 75, 75, 75, 77, 77,
521 77, 77, 77, 77, 77, 77, 91, 129, 91, 92,
522 128, 92, 92, 127, 92, 92, 124, 124, 124, 124,
523 124, 124, 124, 124, 152, 152, 152, 152, 152, 152,
524 152, 152, 60, 60, 123, 122, 121, 120, 119, 118,
525 117, 45, 116, 111, 115, 113, 112, 109, 108, 107,
526 46, 106, 93, 89, 105, 104, 103, 101, 100, 99,
527 98, 97, 96, 95, 78, 76, 93, 90, 89, 88,
528 58, 87, 86, 58, 84, 83, 82, 79, 78, 76,
529 73, 165, 59, 58, 54, 35, 165, 31, 23, 23,
530
531 9, 165, 165, 165, 165, 165, 165, 165, 165, 165,
532 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
533 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
534 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
535 165, 165, 165, 165, 165, 165, 165, 165
536 } ;
537
538static yyconst flex_int16_t yy_chk[449] =
539 { 0,
540 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
541 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
542 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
543 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
544 1, 1, 1, 1, 1, 1, 1, 3, 3, 3,
545 3, 7, 7, 7, 163, 3, 11, 11, 11, 18,
546 18, 3, 3, 3, 3, 3, 5, 5, 5, 5,
547 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
548 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
549 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
550
551 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
552 5, 5, 5, 8, 12, 12, 12, 14, 15, 16,
553 8, 8, 8, 17, 20, 20, 17, 23, 42, 24,
554 29, 162, 24, 29, 29, 29, 16, 14, 31, 44,
555 29, 17, 134, 17, 134, 42, 17, 24, 17, 24,
556 76, 17, 24, 76, 24, 15, 44, 24, 36, 23,
557 26, 26, 26, 26, 34, 34, 34, 26, 161, 48,
558 31, 32, 32, 32, 26, 26, 26, 26, 36, 48,
559 32, 32, 32, 33, 33, 33, 60, 160, 74, 91,
560 91, 66, 33, 33, 66, 66, 66, 114, 60, 60,
561
562 60, 66, 68, 68, 68, 74, 85, 99, 124, 133,
563 102, 68, 68, 99, 102, 157, 156, 114, 85, 85,
564 85, 133, 133, 133, 140, 140, 140, 148, 124, 143,
565 143, 143, 152, 143, 147, 147, 147, 155, 147, 154,
566 151, 150, 149, 146, 145, 144, 142, 148, 141, 138,
567 137, 132, 152, 166, 166, 166, 166, 166, 166, 166,
568 166, 167, 131, 130, 129, 167, 167, 168, 168, 168,
569 168, 168, 168, 168, 168, 169, 169, 169, 169, 170,
570 128, 170, 171, 127, 126, 171, 125, 171, 171, 172,
571 123, 122, 172, 172, 172, 172, 173, 121, 173, 173,
572
573 174, 174, 174, 174, 174, 174, 174, 174, 175, 175,
574 175, 175, 175, 175, 175, 175, 176, 120, 176, 177,
575 119, 177, 177, 118, 177, 177, 178, 178, 178, 178,
576 178, 178, 178, 178, 179, 179, 179, 179, 179, 179,
577 179, 179, 116, 115, 113, 112, 111, 110, 109, 108,
578 107, 106, 105, 104, 103, 101, 100, 98, 97, 96,
579 95, 94, 92, 90, 88, 87, 86, 84, 83, 82,
580 81, 80, 79, 78, 77, 75, 73, 70, 69, 67,
581 64, 62, 61, 57, 51, 50, 49, 47, 46, 45,
582 41, 38, 22, 21, 19, 13, 9, 6, 4, 2,
583
584 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
585 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
586 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
587 165, 165, 165, 165, 165, 165, 165, 165, 165, 165,
588 165, 165, 165, 165, 165, 165, 165, 165
589 } ;
590
591static yy_state_type yy_last_accepting_state;
592static char *yy_last_accepting_cpos;
593
594extern int yy_flex_debug;
595int yy_flex_debug = 0;
596
597/* The intent behind this definition is that it'll catch
598 * any uses of REJECT which flex missed.
599 */
600#define REJECT reject_used_but_not_detected
601#define yymore() yymore_used_but_not_detected
602#define YY_MORE_ADJ 0
603#define YY_RESTORE_YY_MORE_OFFSET
604char *yytext;
605#line 1 "dtc-lexer.l"
606/*
607 * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005.
608 *
609 *
610 * This program is free software; you can redistribute it and/or
611 * modify it under the terms of the GNU General Public License as
612 * published by the Free Software Foundation; either version 2 of the
613 * License, or (at your option) any later version.
614 *
615 * This program is distributed in the hope that it will be useful,
616 * but WITHOUT ANY WARRANTY; without even the implied warranty of
617 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
618 * General Public License for more details.
619 *
620 * You should have received a copy of the GNU General Public License
621 * along with this program; if not, write to the Free Software
622 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
623 * USA
624 */
625#define YY_NO_INPUT 1
626
627
628
629#line 37 "dtc-lexer.l"
630#include "dtc.h"
631#include "srcpos.h"
632#include "dtc-parser.tab.h"
633
634YYLTYPE yylloc;
635extern bool treesource_error;
636
637/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
638#define YY_USER_ACTION \
639 { \
640 srcpos_update(&yylloc, yytext, yyleng); \
641 }
642
643/*#define LEXDEBUG 1*/
644
645#ifdef LEXDEBUG
646#define DPRINT(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
647#else
648#define DPRINT(fmt, ...) do { } while (0)
649#endif
650
651static int dts_version = 1;
652
653#define BEGIN_DEFAULT() DPRINT("<V1>\n"); \
654 BEGIN(V1); \
655
656static void push_input_file(const char *filename);
657static bool pop_input_file(void);
658static void PRINTF(1, 2) lexical_error(const char *fmt, ...);
659
660#line 661 "dtc-lexer.lex.c"
661
662#define INITIAL 0
663#define BYTESTRING 1
664#define PROPNODENAME 2
665#define V1 3
666
667#ifndef YY_NO_UNISTD_H
668/* Special case for "unistd.h", since it is non-ANSI. We include it way
669 * down here because we want the user's section 1 to have been scanned first.
670 * The user has a chance to override it with an option.
671 */
672#include <unistd.h>
673#endif
674
675#ifndef YY_EXTRA_TYPE
676#define YY_EXTRA_TYPE void *
677#endif
678
679static int yy_init_globals (void );
680
681/* Accessor methods to globals.
682 These are made visible to non-reentrant scanners for convenience. */
683
684int yylex_destroy (void );
685
686int yyget_debug (void );
687
688void yyset_debug (int debug_flag );
689
690YY_EXTRA_TYPE yyget_extra (void );
691
692void yyset_extra (YY_EXTRA_TYPE user_defined );
693
694FILE *yyget_in (void );
695
696void yyset_in (FILE * _in_str );
697
698FILE *yyget_out (void );
699
700void yyset_out (FILE * _out_str );
701
702 int yyget_leng (void );
703
704char *yyget_text (void );
705
706int yyget_lineno (void );
707
708void yyset_lineno (int _line_number );
709
710/* Macros after this point can all be overridden by user definitions in
711 * section 1.
712 */
713
714#ifndef YY_SKIP_YYWRAP
715#ifdef __cplusplus
716extern "C" int yywrap (void );
717#else
718extern int yywrap (void );
719#endif
720#endif
721
722#ifndef YY_NO_UNPUT
723
724#endif
725
726#ifndef yytext_ptr
727static void yy_flex_strncpy (char *,yyconst char *,int );
728#endif
729
730#ifdef YY_NEED_STRLEN
731static int yy_flex_strlen (yyconst char * );
732#endif
733
734#ifndef YY_NO_INPUT
735
736#ifdef __cplusplus
737static int yyinput (void );
738#else
739static int input (void );
740#endif
741
742#endif
743
744/* Amount of stuff to slurp up with each read. */
745#ifndef YY_READ_BUF_SIZE
746#ifdef __ia64__
747/* On IA-64, the buffer size is 16k, not 8k */
748#define YY_READ_BUF_SIZE 16384
749#else
750#define YY_READ_BUF_SIZE 8192
751#endif /* __ia64__ */
752#endif
753
754/* Copy whatever the last rule matched to the standard output. */
755#ifndef ECHO
756/* This used to be an fputs(), but since the string might contain NUL's,
757 * we now use fwrite().
758 */
759#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
760#endif
761
762/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
763 * is returned in "result".
764 */
765#ifndef YY_INPUT
766#define YY_INPUT(buf,result,max_size) \
767 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
768 { \
769 int c = '*'; \
770 size_t n; \
771 for ( n = 0; n < max_size && \
772 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
773 buf[n] = (char) c; \
774 if ( c == '\n' ) \
775 buf[n++] = (char) c; \
776 if ( c == EOF && ferror( yyin ) ) \
777 YY_FATAL_ERROR( "input in flex scanner failed" ); \
778 result = n; \
779 } \
780 else \
781 { \
782 errno=0; \
783 while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
784 { \
785 if( errno != EINTR) \
786 { \
787 YY_FATAL_ERROR( "input in flex scanner failed" ); \
788 break; \
789 } \
790 errno=0; \
791 clearerr(yyin); \
792 } \
793 }\
794\
795
796#endif
797
798/* No semi-colon after return; correct usage is to write "yyterminate();" -
799 * we don't want an extra ';' after the "return" because that will cause
800 * some compilers to complain about unreachable statements.
801 */
802#ifndef yyterminate
803#define yyterminate() return YY_NULL
804#endif
805
806/* Number of entries by which start-condition stack grows. */
807#ifndef YY_START_STACK_INCR
808#define YY_START_STACK_INCR 25
809#endif
810
811/* Report a fatal error. */
812#ifndef YY_FATAL_ERROR
813#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
814#endif
815
816/* end tables serialization structures and prototypes */
817
818/* Default declaration of generated scanner - a define so the user can
819 * easily add parameters.
820 */
821#ifndef YY_DECL
822#define YY_DECL_IS_OURS 1
823
824extern int yylex (void);
825
826#define YY_DECL int yylex (void)
827#endif /* !YY_DECL */
828
829/* Code executed at the beginning of each rule, after yytext and yyleng
830 * have been set up.
831 */
832#ifndef YY_USER_ACTION
833#define YY_USER_ACTION
834#endif
835
836/* Code executed at the end of each rule. */
837#ifndef YY_BREAK
838#define YY_BREAK /*LINTED*/break;
839#endif
840
841#define YY_RULE_SETUP \
842 if ( yyleng > 0 ) \
843 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
844 (yytext[yyleng - 1] == '\n'); \
845 YY_USER_ACTION
846
847/** The main scanner function which does all the work.
848 */
849YY_DECL
850{
851 yy_state_type yy_current_state;
852 char *yy_cp, *yy_bp;
853 int yy_act;
854
855 if ( !(yy_init) )
856 {
857 (yy_init) = 1;
858
859#ifdef YY_USER_INIT
860 YY_USER_INIT;
861#endif
862
863 if ( ! (yy_start) )
864 (yy_start) = 1; /* first start state */
865
866 if ( ! yyin )
867 yyin = stdin;
868
869 if ( ! yyout )
870 yyout = stdout;
871
872 if ( ! YY_CURRENT_BUFFER ) {
873 yyensure_buffer_stack ();
874 YY_CURRENT_BUFFER_LVALUE =
875 yy_create_buffer(yyin,YY_BUF_SIZE );
876 }
877
878 yy_load_buffer_state( );
879 }
880
881 {
882#line 69 "dtc-lexer.l"
883
884#line 885 "dtc-lexer.lex.c"
885
886 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
887 {
888 yy_cp = (yy_c_buf_p);
889
890 /* Support of yytext. */
891 *yy_cp = (yy_hold_char);
892
893 /* yy_bp points to the position in yy_ch_buf of the start of
894 * the current run.
895 */
896 yy_bp = yy_cp;
897
898 yy_current_state = (yy_start);
899 yy_current_state += YY_AT_BOL();
900yy_match:
901 do
902 {
903 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
904 if ( yy_accept[yy_current_state] )
905 {
906 (yy_last_accepting_state) = yy_current_state;
907 (yy_last_accepting_cpos) = yy_cp;
908 }
909 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
910 {
911 yy_current_state = (int) yy_def[yy_current_state];
912 if ( yy_current_state >= 166 )
913 yy_c = yy_meta[(unsigned int) yy_c];
914 }
915 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
916 ++yy_cp;
917 }
918 while ( yy_current_state != 165 );
919 yy_cp = (yy_last_accepting_cpos);
920 yy_current_state = (yy_last_accepting_state);
921
922yy_find_action:
923 yy_act = yy_accept[yy_current_state];
924
925 YY_DO_BEFORE_ACTION;
926
927do_action: /* This label is used only to access EOF actions. */
928
929 switch ( yy_act )
930 { /* beginning of action switch */
931 case 0: /* must back up */
932 /* undo the effects of YY_DO_BEFORE_ACTION */
933 *yy_cp = (yy_hold_char);
934 yy_cp = (yy_last_accepting_cpos);
935 yy_current_state = (yy_last_accepting_state);
936 goto yy_find_action;
937
938case 1:
939/* rule 1 can match eol */
940YY_RULE_SETUP
941#line 70 "dtc-lexer.l"
942{
943 char *name = strchr(yytext, '\"') + 1;
944 yytext[yyleng-1] = '\0';
945 push_input_file(name);
946 }
947 YY_BREAK
948case 2:
949/* rule 2 can match eol */
950YY_RULE_SETUP
951#line 76 "dtc-lexer.l"
952{
953 char *line, *fnstart, *fnend;
954 struct data fn;
955 /* skip text before line # */
956 line = yytext;
957 while (!isdigit((unsigned char)*line))
958 line++;
959
960 /* regexp ensures that first and list "
961 * in the whole yytext are those at
962 * beginning and end of the filename string */
963 fnstart = memchr(yytext, '"', yyleng);
964 for (fnend = yytext + yyleng - 1;
965 *fnend != '"'; fnend--)
966 ;
967 assert(fnstart && fnend && (fnend > fnstart));
968
969 fn = data_copy_escape_string(fnstart + 1,
970 fnend - fnstart - 1);
971
972 /* Don't allow nuls in filenames */
973 if (memchr(fn.val, '\0', fn.len - 1))
974 lexical_error("nul in line number directive");
975
976 /* -1 since #line is the number of the next line */
977 srcpos_set_line(xstrdup(fn.val), atoi(line) - 1);
978 data_free(fn);
979 }
980 YY_BREAK
981case YY_STATE_EOF(INITIAL):
982case YY_STATE_EOF(BYTESTRING):
983case YY_STATE_EOF(PROPNODENAME):
984case YY_STATE_EOF(V1):
985#line 105 "dtc-lexer.l"
986{
987 if (!pop_input_file()) {
988 yyterminate();
989 }
990 }
991 YY_BREAK
992case 3:
993/* rule 3 can match eol */
994YY_RULE_SETUP
995#line 111 "dtc-lexer.l"
996{
997 DPRINT("String: %s\n", yytext);
998 yylval.data = data_copy_escape_string(yytext+1,
999 yyleng-2);
1000 return DT_STRING;
1001 }
1002 YY_BREAK
1003case 4:
1004YY_RULE_SETUP
1005#line 118 "dtc-lexer.l"
1006{
1007 DPRINT("Keyword: /dts-v1/\n");
1008 dts_version = 1;
1009 BEGIN_DEFAULT();
1010 return DT_V1;
1011 }
1012 YY_BREAK
1013case 5:
1014YY_RULE_SETUP
1015#line 125 "dtc-lexer.l"
1016{
1017 DPRINT("Keyword: /plugin/\n");
1018 return DT_PLUGIN;
1019 }
1020 YY_BREAK
1021case 6:
1022YY_RULE_SETUP
1023#line 130 "dtc-lexer.l"
1024{
1025 DPRINT("Keyword: /memreserve/\n");
1026 BEGIN_DEFAULT();
1027 return DT_MEMRESERVE;
1028 }
1029 YY_BREAK
1030case 7:
1031YY_RULE_SETUP
1032#line 136 "dtc-lexer.l"
1033{
1034 DPRINT("Keyword: /bits/\n");
1035 BEGIN_DEFAULT();
1036 return DT_BITS;
1037 }
1038 YY_BREAK
1039case 8:
1040YY_RULE_SETUP
1041#line 142 "dtc-lexer.l"
1042{
1043 DPRINT("Keyword: /delete-property/\n");
1044 DPRINT("<PROPNODENAME>\n");
1045 BEGIN(PROPNODENAME);
1046 return DT_DEL_PROP;
1047 }
1048 YY_BREAK
1049case 9:
1050YY_RULE_SETUP
1051#line 149 "dtc-lexer.l"
1052{
1053 DPRINT("Keyword: /delete-node/\n");
1054 DPRINT("<PROPNODENAME>\n");
1055 BEGIN(PROPNODENAME);
1056 return DT_DEL_NODE;
1057 }
1058 YY_BREAK
1059case 10:
1060YY_RULE_SETUP
1061#line 156 "dtc-lexer.l"
1062{
1063 DPRINT("Label: %s\n", yytext);
1064 yylval.labelref = xstrdup(yytext);
1065 yylval.labelref[yyleng-1] = '\0';
1066 return DT_LABEL;
1067 }
1068 YY_BREAK
1069case 11:
1070YY_RULE_SETUP
1071#line 163 "dtc-lexer.l"
1072{
1073 char *e;
1074 DPRINT("Integer Literal: '%s'\n", yytext);
1075
1076 errno = 0;
1077 yylval.integer = strtoull(yytext, &e, 0);
1078
1079 if (*e && e[strspn(e, "UL")]) {
1080 lexical_error("Bad integer literal '%s'",
1081 yytext);
1082 }
1083
1084 if (errno == ERANGE)
1085 lexical_error("Integer literal '%s' out of range",
1086 yytext);
1087 else
1088 /* ERANGE is the only strtoull error triggerable
1089 * by strings matching the pattern */
1090 assert(errno == 0);
1091 return DT_LITERAL;
1092 }
1093 YY_BREAK
1094case 12:
1095/* rule 12 can match eol */
1096YY_RULE_SETUP
1097#line 185 "dtc-lexer.l"
1098{
1099 struct data d;
1100 DPRINT("Character literal: %s\n", yytext);
1101
1102 d = data_copy_escape_string(yytext+1, yyleng-2);
1103 if (d.len == 1) {
1104 lexical_error("Empty character literal");
1105 yylval.integer = 0;
1106 } else {
1107 yylval.integer = (unsigned char)d.val[0];
1108
1109 if (d.len > 2)
1110 lexical_error("Character literal has %d"
1111 " characters instead of 1",
1112 d.len - 1);
1113 }
1114
1115 data_free(d);
1116 return DT_CHAR_LITERAL;
1117 }
1118 YY_BREAK
1119case 13:
1120YY_RULE_SETUP
1121#line 206 "dtc-lexer.l"
1122{ /* label reference */
1123 DPRINT("Ref: %s\n", yytext+1);
1124 yylval.labelref = xstrdup(yytext+1);
1125 return DT_REF;
1126 }
1127 YY_BREAK
1128case 14:
1129YY_RULE_SETUP
1130#line 212 "dtc-lexer.l"
1131{ /* new-style path reference */
1132 yytext[yyleng-1] = '\0';
1133 DPRINT("Ref: %s\n", yytext+2);
1134 yylval.labelref = xstrdup(yytext+2);
1135 return DT_REF;
1136 }
1137 YY_BREAK
1138case 15:
1139YY_RULE_SETUP
1140#line 219 "dtc-lexer.l"
1141{
1142 yylval.byte = strtol(yytext, NULL, 16);
1143 DPRINT("Byte: %02x\n", (int)yylval.byte);
1144 return DT_BYTE;
1145 }
1146 YY_BREAK
1147case 16:
1148YY_RULE_SETUP
1149#line 225 "dtc-lexer.l"
1150{
1151 DPRINT("/BYTESTRING\n");
1152 BEGIN_DEFAULT();
1153 return ']';
1154 }
1155 YY_BREAK
1156case 17:
1157YY_RULE_SETUP
1158#line 231 "dtc-lexer.l"
1159{
1160 DPRINT("PropNodeName: %s\n", yytext);
1161 yylval.propnodename = xstrdup((yytext[0] == '\\') ?
1162 yytext + 1 : yytext);
1163 BEGIN_DEFAULT();
1164 return DT_PROPNODENAME;
1165 }
1166 YY_BREAK
1167case 18:
1168YY_RULE_SETUP
1169#line 239 "dtc-lexer.l"
1170{
1171 DPRINT("Binary Include\n");
1172 return DT_INCBIN;
1173 }
1174 YY_BREAK
1175case 19:
1176/* rule 19 can match eol */
1177YY_RULE_SETUP
1178#line 244 "dtc-lexer.l"
1179/* eat whitespace */
1180 YY_BREAK
1181case 20:
1182/* rule 20 can match eol */
1183YY_RULE_SETUP
1184#line 245 "dtc-lexer.l"
1185/* eat C-style comments */
1186 YY_BREAK
1187case 21:
1188/* rule 21 can match eol */
1189YY_RULE_SETUP
1190#line 246 "dtc-lexer.l"
1191/* eat C++-style comments */
1192 YY_BREAK
1193case 22:
1194YY_RULE_SETUP
1195#line 248 "dtc-lexer.l"
1196{ return DT_LSHIFT; };
1197 YY_BREAK
1198case 23:
1199YY_RULE_SETUP
1200#line 249 "dtc-lexer.l"
1201{ return DT_RSHIFT; };
1202 YY_BREAK
1203case 24:
1204YY_RULE_SETUP
1205#line 250 "dtc-lexer.l"
1206{ return DT_LE; };
1207 YY_BREAK
1208case 25:
1209YY_RULE_SETUP
1210#line 251 "dtc-lexer.l"
1211{ return DT_GE; };
1212 YY_BREAK
1213case 26:
1214YY_RULE_SETUP
1215#line 252 "dtc-lexer.l"
1216{ return DT_EQ; };
1217 YY_BREAK
1218case 27:
1219YY_RULE_SETUP
1220#line 253 "dtc-lexer.l"
1221{ return DT_NE; };
1222 YY_BREAK
1223case 28:
1224YY_RULE_SETUP
1225#line 254 "dtc-lexer.l"
1226{ return DT_AND; };
1227 YY_BREAK
1228case 29:
1229YY_RULE_SETUP
1230#line 255 "dtc-lexer.l"
1231{ return DT_OR; };
1232 YY_BREAK
1233case 30:
1234YY_RULE_SETUP
1235#line 257 "dtc-lexer.l"
1236{
1237 DPRINT("Char: %c (\\x%02x)\n", yytext[0],
1238 (unsigned)yytext[0]);
1239 if (yytext[0] == '[') {
1240 DPRINT("<BYTESTRING>\n");
1241 BEGIN(BYTESTRING);
1242 }
1243 if ((yytext[0] == '{')
1244 || (yytext[0] == ';')) {
1245 DPRINT("<PROPNODENAME>\n");
1246 BEGIN(PROPNODENAME);
1247 }
1248 return yytext[0];
1249 }
1250 YY_BREAK
1251case 31:
1252YY_RULE_SETUP
1253#line 272 "dtc-lexer.l"
1254ECHO;
1255 YY_BREAK
1256#line 1257 "dtc-lexer.lex.c"
1257
1258 case YY_END_OF_BUFFER:
1259 {
1260 /* Amount of text matched not including the EOB char. */
1261 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1262
1263 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1264 *yy_cp = (yy_hold_char);
1265 YY_RESTORE_YY_MORE_OFFSET
1266
1267 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1268 {
1269 /* We're scanning a new file or input source. It's
1270 * possible that this happened because the user
1271 * just pointed yyin at a new source and called
1272 * yylex(). If so, then we have to assure
1273 * consistency between YY_CURRENT_BUFFER and our
1274 * globals. Here is the right place to do so, because
1275 * this is the first action (other than possibly a
1276 * back-up) that will match for the new input source.
1277 */
1278 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1279 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1280 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1281 }
1282
1283 /* Note that here we test for yy_c_buf_p "<=" to the position
1284 * of the first EOB in the buffer, since yy_c_buf_p will
1285 * already have been incremented past the NUL character
1286 * (since all states make transitions on EOB to the
1287 * end-of-buffer state). Contrast this with the test
1288 * in input().
1289 */
1290 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1291 { /* This was really a NUL. */
1292 yy_state_type yy_next_state;
1293
1294 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1295
1296 yy_current_state = yy_get_previous_state( );
1297
1298 /* Okay, we're now positioned to make the NUL
1299 * transition. We couldn't have
1300 * yy_get_previous_state() go ahead and do it
1301 * for us because it doesn't know how to deal
1302 * with the possibility of jamming (and we don't
1303 * want to build jamming into it because then it
1304 * will run more slowly).
1305 */
1306
1307 yy_next_state = yy_try_NUL_trans( yy_current_state );
1308
1309 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1310
1311 if ( yy_next_state )
1312 {
1313 /* Consume the NUL. */
1314 yy_cp = ++(yy_c_buf_p);
1315 yy_current_state = yy_next_state;
1316 goto yy_match;
1317 }
1318
1319 else
1320 {
1321 yy_cp = (yy_last_accepting_cpos);
1322 yy_current_state = (yy_last_accepting_state);
1323 goto yy_find_action;
1324 }
1325 }
1326
1327 else switch ( yy_get_next_buffer( ) )
1328 {
1329 case EOB_ACT_END_OF_FILE:
1330 {
1331 (yy_did_buffer_switch_on_eof) = 0;
1332
1333 if ( yywrap( ) )
1334 {
1335 /* Note: because we've taken care in
1336 * yy_get_next_buffer() to have set up
1337 * yytext, we can now set up
1338 * yy_c_buf_p so that if some total
1339 * hoser (like flex itself) wants to
1340 * call the scanner after we return the
1341 * YY_NULL, it'll still work - another
1342 * YY_NULL will get returned.
1343 */
1344 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1345
1346 yy_act = YY_STATE_EOF(YY_START);
1347 goto do_action;
1348 }
1349
1350 else
1351 {
1352 if ( ! (yy_did_buffer_switch_on_eof) )
1353 YY_NEW_FILE;
1354 }
1355 break;
1356 }
1357
1358 case EOB_ACT_CONTINUE_SCAN:
1359 (yy_c_buf_p) =
1360 (yytext_ptr) + yy_amount_of_matched_text;
1361
1362 yy_current_state = yy_get_previous_state( );
1363
1364 yy_cp = (yy_c_buf_p);
1365 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1366 goto yy_match;
1367
1368 case EOB_ACT_LAST_MATCH:
1369 (yy_c_buf_p) =
1370 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1371
1372 yy_current_state = yy_get_previous_state( );
1373
1374 yy_cp = (yy_c_buf_p);
1375 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1376 goto yy_find_action;
1377 }
1378 break;
1379 }
1380
1381 default:
1382 YY_FATAL_ERROR(
1383 "fatal flex scanner internal error--no action found" );
1384 } /* end of action switch */
1385 } /* end of scanning one token */
1386 } /* end of user's declarations */
1387} /* end of yylex */
1388
1389/* yy_get_next_buffer - try to read in a new buffer
1390 *
1391 * Returns a code representing an action:
1392 * EOB_ACT_LAST_MATCH -
1393 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1394 * EOB_ACT_END_OF_FILE - end of file
1395 */
1396static int yy_get_next_buffer (void)
1397{
1398 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1399 char *source = (yytext_ptr);
1400 int number_to_move, i;
1401 int ret_val;
1402
1403 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1404 YY_FATAL_ERROR(
1405 "fatal flex scanner internal error--end of buffer missed" );
1406
1407 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1408 { /* Don't try to fill the buffer, so this is an EOF. */
1409 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1410 {
1411 /* We matched a single character, the EOB, so
1412 * treat this as a final EOF.
1413 */
1414 return EOB_ACT_END_OF_FILE;
1415 }
1416
1417 else
1418 {
1419 /* We matched some text prior to the EOB, first
1420 * process it.
1421 */
1422 return EOB_ACT_LAST_MATCH;
1423 }
1424 }
1425
1426 /* Try to read more data. */
1427
1428 /* First move last chars to start of buffer. */
1429 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1430
1431 for ( i = 0; i < number_to_move; ++i )
1432 *(dest++) = *(source++);
1433
1434 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1435 /* don't do the read, it's not guaranteed to return an EOF,
1436 * just force an EOF
1437 */
1438 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1439
1440 else
1441 {
1442 int num_to_read =
1443 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1444
1445 while ( num_to_read <= 0 )
1446 { /* Not enough room in the buffer - grow it. */
1447
1448 /* just a shorter name for the current buffer */
1449 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1450
1451 int yy_c_buf_p_offset =
1452 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1453
1454 if ( b->yy_is_our_buffer )
1455 {
1456 int new_size = b->yy_buf_size * 2;
1457
1458 if ( new_size <= 0 )
1459 b->yy_buf_size += b->yy_buf_size / 8;
1460 else
1461 b->yy_buf_size *= 2;
1462
1463 b->yy_ch_buf = (char *)
1464 /* Include room in for 2 EOB chars. */
1465 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1466 }
1467 else
1468 /* Can't grow it, we don't own it. */
1469 b->yy_ch_buf = NULL;
1470
1471 if ( ! b->yy_ch_buf )
1472 YY_FATAL_ERROR(
1473 "fatal error - scanner input buffer overflow" );
1474
1475 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1476
1477 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1478 number_to_move - 1;
1479
1480 }
1481
1482 if ( num_to_read > YY_READ_BUF_SIZE )
1483 num_to_read = YY_READ_BUF_SIZE;
1484
1485 /* Read in more data. */
1486 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1487 (yy_n_chars), num_to_read );
1488
1489 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1490 }
1491
1492 if ( (yy_n_chars) == 0 )
1493 {
1494 if ( number_to_move == YY_MORE_ADJ )
1495 {
1496 ret_val = EOB_ACT_END_OF_FILE;
1497 yyrestart(yyin );
1498 }
1499
1500 else
1501 {
1502 ret_val = EOB_ACT_LAST_MATCH;
1503 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1504 YY_BUFFER_EOF_PENDING;
1505 }
1506 }
1507
1508 else
1509 ret_val = EOB_ACT_CONTINUE_SCAN;
1510
1511 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1512 /* Extend the array by 50%, plus the number we really need. */
1513 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1514 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1515 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1516 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1517 }
1518
1519 (yy_n_chars) += number_to_move;
1520 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1521 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1522
1523 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1524
1525 return ret_val;
1526}
1527
1528/* yy_get_previous_state - get the state just before the EOB char was reached */
1529
1530 static yy_state_type yy_get_previous_state (void)
1531{
1532 yy_state_type yy_current_state;
1533 char *yy_cp;
1534
1535 yy_current_state = (yy_start);
1536 yy_current_state += YY_AT_BOL();
1537
1538 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1539 {
1540 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1541 if ( yy_accept[yy_current_state] )
1542 {
1543 (yy_last_accepting_state) = yy_current_state;
1544 (yy_last_accepting_cpos) = yy_cp;
1545 }
1546 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1547 {
1548 yy_current_state = (int) yy_def[yy_current_state];
1549 if ( yy_current_state >= 166 )
1550 yy_c = yy_meta[(unsigned int) yy_c];
1551 }
1552 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1553 }
1554
1555 return yy_current_state;
1556}
1557
1558/* yy_try_NUL_trans - try to make a transition on the NUL character
1559 *
1560 * synopsis
1561 * next_state = yy_try_NUL_trans( current_state );
1562 */
1563 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1564{
1565 int yy_is_jam;
1566 char *yy_cp = (yy_c_buf_p);
1567
1568 YY_CHAR yy_c = 1;
1569 if ( yy_accept[yy_current_state] )
1570 {
1571 (yy_last_accepting_state) = yy_current_state;
1572 (yy_last_accepting_cpos) = yy_cp;
1573 }
1574 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1575 {
1576 yy_current_state = (int) yy_def[yy_current_state];
1577 if ( yy_current_state >= 166 )
1578 yy_c = yy_meta[(unsigned int) yy_c];
1579 }
1580 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1581 yy_is_jam = (yy_current_state == 165);
1582
1583 return yy_is_jam ? 0 : yy_current_state;
1584}
1585
1586#ifndef YY_NO_UNPUT
1587
1588#endif
1589
1590#ifndef YY_NO_INPUT
1591#ifdef __cplusplus
1592 static int yyinput (void)
1593#else
1594 static int input (void)
1595#endif
1596
1597{
1598 int c;
1599
1600 *(yy_c_buf_p) = (yy_hold_char);
1601
1602 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1603 {
1604 /* yy_c_buf_p now points to the character we want to return.
1605 * If this occurs *before* the EOB characters, then it's a
1606 * valid NUL; if not, then we've hit the end of the buffer.
1607 */
1608 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1609 /* This was really a NUL. */
1610 *(yy_c_buf_p) = '\0';
1611
1612 else
1613 { /* need more input */
1614 int offset = (yy_c_buf_p) - (yytext_ptr);
1615 ++(yy_c_buf_p);
1616
1617 switch ( yy_get_next_buffer( ) )
1618 {
1619 case EOB_ACT_LAST_MATCH:
1620 /* This happens because yy_g_n_b()
1621 * sees that we've accumulated a
1622 * token and flags that we need to
1623 * try matching the token before
1624 * proceeding. But for input(),
1625 * there's no matching to consider.
1626 * So convert the EOB_ACT_LAST_MATCH
1627 * to EOB_ACT_END_OF_FILE.
1628 */
1629
1630 /* Reset buffer status. */
1631 yyrestart(yyin );
1632
1633 /*FALLTHROUGH*/
1634
1635 case EOB_ACT_END_OF_FILE:
1636 {
1637 if ( yywrap( ) )
1638 return 0;
1639
1640 if ( ! (yy_did_buffer_switch_on_eof) )
1641 YY_NEW_FILE;
1642#ifdef __cplusplus
1643 return yyinput();
1644#else
1645 return input();
1646#endif
1647 }
1648
1649 case EOB_ACT_CONTINUE_SCAN:
1650 (yy_c_buf_p) = (yytext_ptr) + offset;
1651 break;
1652 }
1653 }
1654 }
1655
1656 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1657 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1658 (yy_hold_char) = *++(yy_c_buf_p);
1659
1660 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1661
1662 return c;
1663}
1664#endif /* ifndef YY_NO_INPUT */
1665
1666/** Immediately switch to a different input stream.
1667 * @param input_file A readable stream.
1668 *
1669 * @note This function does not reset the start condition to @c INITIAL .
1670 */
1671 void yyrestart (FILE * input_file )
1672{
1673
1674 if ( ! YY_CURRENT_BUFFER ){
1675 yyensure_buffer_stack ();
1676 YY_CURRENT_BUFFER_LVALUE =
1677 yy_create_buffer(yyin,YY_BUF_SIZE );
1678 }
1679
1680 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1681 yy_load_buffer_state( );
1682}
1683
1684/** Switch to a different input buffer.
1685 * @param new_buffer The new input buffer.
1686 *
1687 */
1688 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1689{
1690
1691 /* TODO. We should be able to replace this entire function body
1692 * with
1693 * yypop_buffer_state();
1694 * yypush_buffer_state(new_buffer);
1695 */
1696 yyensure_buffer_stack ();
1697 if ( YY_CURRENT_BUFFER == new_buffer )
1698 return;
1699
1700 if ( YY_CURRENT_BUFFER )
1701 {
1702 /* Flush out information for old buffer. */
1703 *(yy_c_buf_p) = (yy_hold_char);
1704 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1705 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1706 }
1707
1708 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1709 yy_load_buffer_state( );
1710
1711 /* We don't actually know whether we did this switch during
1712 * EOF (yywrap()) processing, but the only time this flag
1713 * is looked at is after yywrap() is called, so it's safe
1714 * to go ahead and always set it.
1715 */
1716 (yy_did_buffer_switch_on_eof) = 1;
1717}
1718
1719static void yy_load_buffer_state (void)
1720{
1721 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1722 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1723 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1724 (yy_hold_char) = *(yy_c_buf_p);
1725}
1726
1727/** Allocate and initialize an input buffer state.
1728 * @param file A readable stream.
1729 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1730 *
1731 * @return the allocated buffer state.
1732 */
1733 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1734{
1735 YY_BUFFER_STATE b;
1736
1737 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1738 if ( ! b )
1739 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1740
1741 b->yy_buf_size = (yy_size_t)size;
1742
1743 /* yy_ch_buf has to be 2 characters longer than the size given because
1744 * we need to put in 2 end-of-buffer characters.
1745 */
1746 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1747 if ( ! b->yy_ch_buf )
1748 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1749
1750 b->yy_is_our_buffer = 1;
1751
1752 yy_init_buffer(b,file );
1753
1754 return b;
1755}
1756
1757/** Destroy the buffer.
1758 * @param b a buffer created with yy_create_buffer()
1759 *
1760 */
1761 void yy_delete_buffer (YY_BUFFER_STATE b )
1762{
1763
1764 if ( ! b )
1765 return;
1766
1767 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1768 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1769
1770 if ( b->yy_is_our_buffer )
1771 yyfree((void *) b->yy_ch_buf );
1772
1773 yyfree((void *) b );
1774}
1775
1776/* Initializes or reinitializes a buffer.
1777 * This function is sometimes called more than once on the same buffer,
1778 * such as during a yyrestart() or at EOF.
1779 */
1780 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1781
1782{
1783 int oerrno = errno;
1784
1785 yy_flush_buffer(b );
1786
1787 b->yy_input_file = file;
1788 b->yy_fill_buffer = 1;
1789
1790 /* If b is the current buffer, then yy_init_buffer was _probably_
1791 * called from yyrestart() or through yy_get_next_buffer.
1792 * In that case, we don't want to reset the lineno or column.
1793 */
1794 if (b != YY_CURRENT_BUFFER){
1795 b->yy_bs_lineno = 1;
1796 b->yy_bs_column = 0;
1797 }
1798
1799 b->yy_is_interactive = 0;
1800
1801 errno = oerrno;
1802}
1803
1804/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1805 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1806 *
1807 */
1808 void yy_flush_buffer (YY_BUFFER_STATE b )
1809{
1810 if ( ! b )
1811 return;
1812
1813 b->yy_n_chars = 0;
1814
1815 /* We always need two end-of-buffer characters. The first causes
1816 * a transition to the end-of-buffer state. The second causes
1817 * a jam in that state.
1818 */
1819 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1820 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1821
1822 b->yy_buf_pos = &b->yy_ch_buf[0];
1823
1824 b->yy_at_bol = 1;
1825 b->yy_buffer_status = YY_BUFFER_NEW;
1826
1827 if ( b == YY_CURRENT_BUFFER )
1828 yy_load_buffer_state( );
1829}
1830
1831/** Pushes the new state onto the stack. The new state becomes
1832 * the current state. This function will allocate the stack
1833 * if necessary.
1834 * @param new_buffer The new state.
1835 *
1836 */
1837void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1838{
1839 if (new_buffer == NULL)
1840 return;
1841
1842 yyensure_buffer_stack();
1843
1844 /* This block is copied from yy_switch_to_buffer. */
1845 if ( YY_CURRENT_BUFFER )
1846 {
1847 /* Flush out information for old buffer. */
1848 *(yy_c_buf_p) = (yy_hold_char);
1849 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1850 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1851 }
1852
1853 /* Only push if top exists. Otherwise, replace top. */
1854 if (YY_CURRENT_BUFFER)
1855 (yy_buffer_stack_top)++;
1856 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1857
1858 /* copied from yy_switch_to_buffer. */
1859 yy_load_buffer_state( );
1860 (yy_did_buffer_switch_on_eof) = 1;
1861}
1862
1863/** Removes and deletes the top of the stack, if present.
1864 * The next element becomes the new top.
1865 *
1866 */
1867void yypop_buffer_state (void)
1868{
1869 if (!YY_CURRENT_BUFFER)
1870 return;
1871
1872 yy_delete_buffer(YY_CURRENT_BUFFER );
1873 YY_CURRENT_BUFFER_LVALUE = NULL;
1874 if ((yy_buffer_stack_top) > 0)
1875 --(yy_buffer_stack_top);
1876
1877 if (YY_CURRENT_BUFFER) {
1878 yy_load_buffer_state( );
1879 (yy_did_buffer_switch_on_eof) = 1;
1880 }
1881}
1882
1883/* Allocates the stack if it does not exist.
1884 * Guarantees space for at least one push.
1885 */
1886static void yyensure_buffer_stack (void)
1887{
1888 int num_to_alloc;
1889
1890 if (!(yy_buffer_stack)) {
1891
1892 /* First allocation is just for 2 elements, since we don't know if this
1893 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1894 * immediate realloc on the next call.
1895 */
1896 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1897 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1898 (num_to_alloc * sizeof(struct yy_buffer_state*)
1899 );
1900 if ( ! (yy_buffer_stack) )
1901 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1902
1903 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1904
1905 (yy_buffer_stack_max) = num_to_alloc;
1906 (yy_buffer_stack_top) = 0;
1907 return;
1908 }
1909
1910 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1911
1912 /* Increase the buffer to prepare for a possible push. */
1913 yy_size_t grow_size = 8 /* arbitrary grow size */;
1914
1915 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1916 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1917 ((yy_buffer_stack),
1918 num_to_alloc * sizeof(struct yy_buffer_state*)
1919 );
1920 if ( ! (yy_buffer_stack) )
1921 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1922
1923 /* zero only the new slots.*/
1924 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1925 (yy_buffer_stack_max) = num_to_alloc;
1926 }
1927}
1928
1929/** Setup the input buffer state to scan directly from a user-specified character buffer.
1930 * @param base the character buffer
1931 * @param size the size in bytes of the character buffer
1932 *
1933 * @return the newly allocated buffer state object.
1934 */
1935YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1936{
1937 YY_BUFFER_STATE b;
1938
1939 if ( size < 2 ||
1940 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1941 base[size-1] != YY_END_OF_BUFFER_CHAR )
1942 /* They forgot to leave room for the EOB's. */
1943 return NULL;
1944
1945 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1946 if ( ! b )
1947 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1948
1949 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1950 b->yy_buf_pos = b->yy_ch_buf = base;
1951 b->yy_is_our_buffer = 0;
1952 b->yy_input_file = NULL;
1953 b->yy_n_chars = b->yy_buf_size;
1954 b->yy_is_interactive = 0;
1955 b->yy_at_bol = 1;
1956 b->yy_fill_buffer = 0;
1957 b->yy_buffer_status = YY_BUFFER_NEW;
1958
1959 yy_switch_to_buffer(b );
1960
1961 return b;
1962}
1963
1964/** Setup the input buffer state to scan a string. The next call to yylex() will
1965 * scan from a @e copy of @a str.
1966 * @param yystr a NUL-terminated string to scan
1967 *
1968 * @return the newly allocated buffer state object.
1969 * @note If you want to scan bytes that may contain NUL values, then use
1970 * yy_scan_bytes() instead.
1971 */
1972YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1973{
1974
1975 return yy_scan_bytes(yystr,(int) strlen(yystr) );
1976}
1977
1978/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1979 * scan from a @e copy of @a bytes.
1980 * @param yybytes the byte buffer to scan
1981 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1982 *
1983 * @return the newly allocated buffer state object.
1984 */
1985YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1986{
1987 YY_BUFFER_STATE b;
1988 char *buf;
1989 yy_size_t n;
1990 int i;
1991
1992 /* Get memory for full buffer, including space for trailing EOB's. */
1993 n = (yy_size_t) (_yybytes_len + 2);
1994 buf = (char *) yyalloc(n );
1995 if ( ! buf )
1996 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1997
1998 for ( i = 0; i < _yybytes_len; ++i )
1999 buf[i] = yybytes[i];
2000
2001 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2002
2003 b = yy_scan_buffer(buf,n );
2004 if ( ! b )
2005 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2006
2007 /* It's okay to grow etc. this buffer, and we should throw it
2008 * away when we're done.
2009 */
2010 b->yy_is_our_buffer = 1;
2011
2012 return b;
2013}
2014
2015#ifndef YY_EXIT_FAILURE
2016#define YY_EXIT_FAILURE 2
2017#endif
2018
2019static void yynoreturn yy_fatal_error (yyconst char* msg )
2020{
2021 (void) fprintf( stderr, "%s\n", msg );
2022 exit( YY_EXIT_FAILURE );
2023}
2024
2025/* Redefine yyless() so it works in section 3 code. */
2026
2027#undef yyless
2028#define yyless(n) \
2029 do \
2030 { \
2031 /* Undo effects of setting up yytext. */ \
2032 int yyless_macro_arg = (n); \
2033 YY_LESS_LINENO(yyless_macro_arg);\
2034 yytext[yyleng] = (yy_hold_char); \
2035 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2036 (yy_hold_char) = *(yy_c_buf_p); \
2037 *(yy_c_buf_p) = '\0'; \
2038 yyleng = yyless_macro_arg; \
2039 } \
2040 while ( 0 )
2041
2042/* Accessor methods (get/set functions) to struct members. */
2043
2044/** Get the current line number.
2045 *
2046 */
2047int yyget_lineno (void)
2048{
2049
2050 return yylineno;
2051}
2052
2053/** Get the input stream.
2054 *
2055 */
2056FILE *yyget_in (void)
2057{
2058 return yyin;
2059}
2060
2061/** Get the output stream.
2062 *
2063 */
2064FILE *yyget_out (void)
2065{
2066 return yyout;
2067}
2068
2069/** Get the length of the current token.
2070 *
2071 */
2072int yyget_leng (void)
2073{
2074 return yyleng;
2075}
2076
2077/** Get the current token.
2078 *
2079 */
2080
2081char *yyget_text (void)
2082{
2083 return yytext;
2084}
2085
2086/** Set the current line number.
2087 * @param _line_number line number
2088 *
2089 */
2090void yyset_lineno (int _line_number )
2091{
2092
2093 yylineno = _line_number;
2094}
2095
2096/** Set the input stream. This does not discard the current
2097 * input buffer.
2098 * @param _in_str A readable stream.
2099 *
2100 * @see yy_switch_to_buffer
2101 */
2102void yyset_in (FILE * _in_str )
2103{
2104 yyin = _in_str ;
2105}
2106
2107void yyset_out (FILE * _out_str )
2108{
2109 yyout = _out_str ;
2110}
2111
2112int yyget_debug (void)
2113{
2114 return yy_flex_debug;
2115}
2116
2117void yyset_debug (int _bdebug )
2118{
2119 yy_flex_debug = _bdebug ;
2120}
2121
2122static int yy_init_globals (void)
2123{
2124 /* Initialization is the same as for the non-reentrant scanner.
2125 * This function is called from yylex_destroy(), so don't allocate here.
2126 */
2127
2128 (yy_buffer_stack) = NULL;
2129 (yy_buffer_stack_top) = 0;
2130 (yy_buffer_stack_max) = 0;
2131 (yy_c_buf_p) = NULL;
2132 (yy_init) = 0;
2133 (yy_start) = 0;
2134
2135/* Defined in main.c */
2136#ifdef YY_STDINIT
2137 yyin = stdin;
2138 yyout = stdout;
2139#else
2140 yyin = NULL;
2141 yyout = NULL;
2142#endif
2143
2144 /* For future reference: Set errno on error, since we are called by
2145 * yylex_init()
2146 */
2147 return 0;
2148}
2149
2150/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2151int yylex_destroy (void)
2152{
2153
2154 /* Pop the buffer stack, destroying each element. */
2155 while(YY_CURRENT_BUFFER){
2156 yy_delete_buffer(YY_CURRENT_BUFFER );
2157 YY_CURRENT_BUFFER_LVALUE = NULL;
2158 yypop_buffer_state();
2159 }
2160
2161 /* Destroy the stack itself. */
2162 yyfree((yy_buffer_stack) );
2163 (yy_buffer_stack) = NULL;
2164
2165 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2166 * yylex() is called, initialization will occur. */
2167 yy_init_globals( );
2168
2169 return 0;
2170}
2171
2172/*
2173 * Internal utility routines.
2174 */
2175
2176#ifndef yytext_ptr
2177static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2178{
2179
2180 int i;
2181 for ( i = 0; i < n; ++i )
2182 s1[i] = s2[i];
2183}
2184#endif
2185
2186#ifdef YY_NEED_STRLEN
2187static int yy_flex_strlen (yyconst char * s )
2188{
2189 int n;
2190 for ( n = 0; s[n]; ++n )
2191 ;
2192
2193 return n;
2194}
2195#endif
2196
2197void *yyalloc (yy_size_t size )
2198{
2199 return malloc(size);
2200}
2201
2202void *yyrealloc (void * ptr, yy_size_t size )
2203{
2204
2205 /* The cast to (char *) in the following accommodates both
2206 * implementations that use char* generic pointers, and those
2207 * that use void* generic pointers. It works with the latter
2208 * because both ANSI C and C++ allow castless assignment from
2209 * any pointer type to void*, and deal with argument conversions
2210 * as though doing an assignment.
2211 */
2212 return realloc(ptr, size);
2213}
2214
2215void yyfree (void * ptr )
2216{
2217 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2218}
2219
2220#define YYTABLES_NAME "yytables"
2221
2222#line 272 "dtc-lexer.l"
2223
2224
2225
2226static void push_input_file(const char *filename)
2227{
2228 assert(filename);
2229
2230 srcfile_push(filename);
2231
2232 yyin = current_srcfile->f;
2233
2234 yypush_buffer_state(yy_create_buffer(yyin,YY_BUF_SIZE));
2235}
2236
2237
2238static bool pop_input_file(void)
2239{
2240 if (srcfile_pop() == 0)
2241 return false;
2242
2243 yypop_buffer_state();
2244 yyin = current_srcfile->f;
2245
2246 return true;
2247}
2248
2249static void lexical_error(const char *fmt, ...)
2250{
2251 va_list ap;
2252
2253 va_start(ap, fmt);
2254 srcpos_verror(&yylloc, "Lexical error", fmt, ap);
2255 va_end(ap);
2256
2257 treesource_error = true;
2258}
2259
diff --git a/scripts/dtc/dtc-parser.tab.c_shipped b/scripts/dtc/dtc-parser.tab.c_shipped
deleted file mode 100644
index aea514fa6928..000000000000
--- a/scripts/dtc/dtc-parser.tab.c_shipped
+++ /dev/null
@@ -1,2321 +0,0 @@
1/* A Bison parser, made by GNU Bison 3.0.4. */
2
3/* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015 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.4"
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
73extern int yylex(void);
74extern 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
81extern struct dt_info *parser_output;
82extern 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
111extern 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
147union 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 unsigned int flags;
168
169#line 170 "dtc-parser.tab.c" /* yacc.c:355 */
170};
171
172typedef union YYSTYPE YYSTYPE;
173# define YYSTYPE_IS_TRIVIAL 1
174# define YYSTYPE_IS_DECLARED 1
175#endif
176
177/* Location type. */
178#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
179typedef struct YYLTYPE YYLTYPE;
180struct YYLTYPE
181{
182 int first_line;
183 int first_column;
184 int last_line;
185 int last_column;
186};
187# define YYLTYPE_IS_DECLARED 1
188# define YYLTYPE_IS_TRIVIAL 1
189#endif
190
191
192extern YYSTYPE yylval;
193extern YYLTYPE yylloc;
194int yyparse (void);
195
196#endif /* !YY_YY_DTC_PARSER_TAB_H_INCLUDED */
197
198/* Copy the second part of user declarations. */
199
200#line 201 "dtc-parser.tab.c" /* yacc.c:358 */
201
202#ifdef short
203# undef short
204#endif
205
206#ifdef YYTYPE_UINT8
207typedef YYTYPE_UINT8 yytype_uint8;
208#else
209typedef unsigned char yytype_uint8;
210#endif
211
212#ifdef YYTYPE_INT8
213typedef YYTYPE_INT8 yytype_int8;
214#else
215typedef signed char yytype_int8;
216#endif
217
218#ifdef YYTYPE_UINT16
219typedef YYTYPE_UINT16 yytype_uint16;
220#else
221typedef unsigned short int yytype_uint16;
222#endif
223
224#ifdef YYTYPE_INT16
225typedef YYTYPE_INT16 yytype_int16;
226#else
227typedef short int yytype_int16;
228#endif
229
230#ifndef YYSIZE_T
231# ifdef __SIZE_TYPE__
232# define YYSIZE_T __SIZE_TYPE__
233# elif defined size_t
234# define YYSIZE_T size_t
235# elif ! defined YYSIZE_T
236# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
237# define YYSIZE_T size_t
238# else
239# define YYSIZE_T unsigned int
240# endif
241#endif
242
243#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
244
245#ifndef YY_
246# if defined YYENABLE_NLS && YYENABLE_NLS
247# if ENABLE_NLS
248# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
249# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
250# endif
251# endif
252# ifndef YY_
253# define YY_(Msgid) Msgid
254# endif
255#endif
256
257#ifndef YY_ATTRIBUTE
258# if (defined __GNUC__ \
259 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
260 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
261# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
262# else
263# define YY_ATTRIBUTE(Spec) /* empty */
264# endif
265#endif
266
267#ifndef YY_ATTRIBUTE_PURE
268# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
269#endif
270
271#ifndef YY_ATTRIBUTE_UNUSED
272# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
273#endif
274
275#if !defined _Noreturn \
276 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
277# if defined _MSC_VER && 1200 <= _MSC_VER
278# define _Noreturn __declspec (noreturn)
279# else
280# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
281# endif
282#endif
283
284/* Suppress unused-variable warnings by "using" E. */
285#if ! defined lint || defined __GNUC__
286# define YYUSE(E) ((void) (E))
287#else
288# define YYUSE(E) /* empty */
289#endif
290
291#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
292/* Suppress an incorrect diagnostic about yylval being uninitialized. */
293# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
294 _Pragma ("GCC diagnostic push") \
295 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
296 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
297# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
298 _Pragma ("GCC diagnostic pop")
299#else
300# define YY_INITIAL_VALUE(Value) Value
301#endif
302#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
303# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
304# define YY_IGNORE_MAYBE_UNINITIALIZED_END
305#endif
306#ifndef YY_INITIAL_VALUE
307# define YY_INITIAL_VALUE(Value) /* Nothing. */
308#endif
309
310
311#if ! defined yyoverflow || YYERROR_VERBOSE
312
313/* The parser invokes alloca or malloc; define the necessary symbols. */
314
315# ifdef YYSTACK_USE_ALLOCA
316# if YYSTACK_USE_ALLOCA
317# ifdef __GNUC__
318# define YYSTACK_ALLOC __builtin_alloca
319# elif defined __BUILTIN_VA_ARG_INCR
320# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
321# elif defined _AIX
322# define YYSTACK_ALLOC __alloca
323# elif defined _MSC_VER
324# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
325# define alloca _alloca
326# else
327# define YYSTACK_ALLOC alloca
328# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
329# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
330 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
331# ifndef EXIT_SUCCESS
332# define EXIT_SUCCESS 0
333# endif
334# endif
335# endif
336# endif
337# endif
338
339# ifdef YYSTACK_ALLOC
340 /* Pacify GCC's 'empty if-body' warning. */
341# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
342# ifndef YYSTACK_ALLOC_MAXIMUM
343 /* The OS might guarantee only one guard page at the bottom of the stack,
344 and a page size can be as small as 4096 bytes. So we cannot safely
345 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
346 to allow for a few compiler-allocated temporary stack slots. */
347# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
348# endif
349# else
350# define YYSTACK_ALLOC YYMALLOC
351# define YYSTACK_FREE YYFREE
352# ifndef YYSTACK_ALLOC_MAXIMUM
353# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
354# endif
355# if (defined __cplusplus && ! defined EXIT_SUCCESS \
356 && ! ((defined YYMALLOC || defined malloc) \
357 && (defined YYFREE || defined free)))
358# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
359# ifndef EXIT_SUCCESS
360# define EXIT_SUCCESS 0
361# endif
362# endif
363# ifndef YYMALLOC
364# define YYMALLOC malloc
365# if ! defined malloc && ! defined EXIT_SUCCESS
366void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
367# endif
368# endif
369# ifndef YYFREE
370# define YYFREE free
371# if ! defined free && ! defined EXIT_SUCCESS
372void free (void *); /* INFRINGES ON USER NAME SPACE */
373# endif
374# endif
375# endif
376#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
377
378
379#if (! defined yyoverflow \
380 && (! defined __cplusplus \
381 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
382 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
383
384/* A type that is properly aligned for any stack member. */
385union yyalloc
386{
387 yytype_int16 yyss_alloc;
388 YYSTYPE yyvs_alloc;
389 YYLTYPE yyls_alloc;
390};
391
392/* The size of the maximum gap between one aligned stack and the next. */
393# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
394
395/* The size of an array large to enough to hold all stacks, each with
396 N elements. */
397# define YYSTACK_BYTES(N) \
398 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
399 + 2 * YYSTACK_GAP_MAXIMUM)
400
401# define YYCOPY_NEEDED 1
402
403/* Relocate STACK from its old location to the new one. The
404 local variables YYSIZE and YYSTACKSIZE give the old and new number of
405 elements in the stack, and YYPTR gives the new location of the
406 stack. Advance YYPTR to a properly aligned location for the next
407 stack. */
408# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
409 do \
410 { \
411 YYSIZE_T yynewbytes; \
412 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
413 Stack = &yyptr->Stack_alloc; \
414 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
415 yyptr += yynewbytes / sizeof (*yyptr); \
416 } \
417 while (0)
418
419#endif
420
421#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
422/* Copy COUNT objects from SRC to DST. The source and destination do
423 not overlap. */
424# ifndef YYCOPY
425# if defined __GNUC__ && 1 < __GNUC__
426# define YYCOPY(Dst, Src, Count) \
427 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
428# else
429# define YYCOPY(Dst, Src, Count) \
430 do \
431 { \
432 YYSIZE_T yyi; \
433 for (yyi = 0; yyi < (Count); yyi++) \
434 (Dst)[yyi] = (Src)[yyi]; \
435 } \
436 while (0)
437# endif
438# endif
439#endif /* !YYCOPY_NEEDED */
440
441/* YYFINAL -- State number of the termination state. */
442#define YYFINAL 6
443/* YYLAST -- Last index in YYTABLE. */
444#define YYLAST 138
445
446/* YYNTOKENS -- Number of terminals. */
447#define YYNTOKENS 48
448/* YYNNTS -- Number of nonterminals. */
449#define YYNNTS 30
450/* YYNRULES -- Number of rules. */
451#define YYNRULES 85
452/* YYNSTATES -- Number of states. */
453#define YYNSTATES 149
454
455/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
456 by yylex, with out-of-bounds checking. */
457#define YYUNDEFTOK 2
458#define YYMAXUTOK 279
459
460#define YYTRANSLATE(YYX) \
461 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
462
463/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
464 as returned by yylex, without out-of-bounds checking. */
465static const yytype_uint8 yytranslate[] =
466{
467 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 2, 2, 47, 2, 2, 2, 45, 41, 2,
471 33, 35, 44, 42, 34, 43, 2, 26, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 38, 25,
473 36, 29, 30, 37, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476 2, 31, 2, 32, 40, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 27, 39, 28, 46, 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, 2, 2, 2, 2,
491 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
492 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
493 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
494 15, 16, 17, 18, 19, 20, 21, 22, 23, 24
495};
496
497#if YYDEBUG
498 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
499static const yytype_uint16 yyrline[] =
500{
501 0, 109, 109, 117, 121, 128, 129, 139, 142, 149,
502 153, 161, 165, 170, 181, 200, 213, 220, 228, 231,
503 238, 242, 246, 250, 258, 262, 266, 270, 274, 290,
504 300, 308, 311, 315, 322, 338, 343, 362, 376, 383,
505 384, 385, 392, 396, 397, 401, 402, 406, 407, 411,
506 412, 416, 417, 421, 422, 426, 427, 428, 432, 433,
507 434, 435, 436, 440, 441, 442, 446, 447, 448, 452,
508 453, 462, 471, 475, 476, 477, 478, 483, 486, 490,
509 498, 501, 505, 513, 517, 521
510};
511#endif
512
513#if YYDEBUG || YYERROR_VERBOSE || 0
514/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
515 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
516static const char *const yytname[] =
517{
518 "$end", "error", "$undefined", "DT_V1", "DT_PLUGIN", "DT_MEMRESERVE",
519 "DT_LSHIFT", "DT_RSHIFT", "DT_LE", "DT_GE", "DT_EQ", "DT_NE", "DT_AND",
520 "DT_OR", "DT_BITS", "DT_DEL_PROP", "DT_DEL_NODE", "DT_PROPNODENAME",
521 "DT_LITERAL", "DT_CHAR_LITERAL", "DT_BYTE", "DT_STRING", "DT_LABEL",
522 "DT_REF", "DT_INCBIN", "';'", "'/'", "'{'", "'}'", "'='", "'>'", "'['",
523 "']'", "'('", "','", "')'", "'<'", "'?'", "':'", "'|'", "'^'", "'&'",
524 "'+'", "'-'", "'*'", "'%'", "'~'", "'!'", "$accept", "sourcefile",
525 "header", "headers", "memreserves", "memreserve", "devicetree",
526 "nodedef", "proplist", "propdef", "propdata", "propdataprefix",
527 "arrayprefix", "integer_prim", "integer_expr", "integer_trinary",
528 "integer_or", "integer_and", "integer_bitor", "integer_bitxor",
529 "integer_bitand", "integer_eq", "integer_rela", "integer_shift",
530 "integer_add", "integer_mul", "integer_unary", "bytestring", "subnodes",
531 "subnode", YY_NULLPTR
532};
533#endif
534
535# ifdef YYPRINT
536/* YYTOKNUM[NUM] -- (External) token number corresponding to the
537 (internal) symbol number NUM (which must be that of a token). */
538static const yytype_uint16 yytoknum[] =
539{
540 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
541 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
542 275, 276, 277, 278, 279, 59, 47, 123, 125, 61,
543 62, 91, 93, 40, 44, 41, 60, 63, 58, 124,
544 94, 38, 43, 45, 42, 37, 126, 33
545};
546# endif
547
548#define YYPACT_NINF -44
549
550#define yypact_value_is_default(Yystate) \
551 (!!((Yystate) == (-44)))
552
553#define YYTABLE_NINF -1
554
555#define yytable_value_is_error(Yytable_value) \
556 0
557
558 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
559 STATE-NUM. */
560static const yytype_int8 yypact[] =
561{
562 14, 27, 61, 14, 8, 18, -44, -44, 37, 8,
563 40, 8, 64, -44, -44, -12, 37, -44, 50, 52,
564 -44, -44, -12, -12, -12, -44, 51, -44, -4, 78,
565 53, 54, 55, 17, 2, 30, 38, -3, -44, 66,
566 -44, -44, 70, 72, 50, 50, -44, -44, -44, -44,
567 -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,
568 -12, -12, -12, -12, -12, -12, -12, -12, -12, -44,
569 3, 73, 50, -44, -44, 78, 59, 53, 54, 55,
570 17, 2, 2, 30, 30, 30, 30, 38, 38, -3,
571 -3, -44, -44, -44, 82, 83, 44, 3, -44, 74,
572 3, -44, -44, -12, 76, 79, -44, -44, -44, -44,
573 -44, 80, -44, -44, -44, -44, -44, -10, 36, -44,
574 -44, -44, -44, 85, -44, -44, -44, 75, -44, -44,
575 21, 71, 88, -6, -44, -44, -44, -44, -44, 11,
576 -44, -44, -44, 37, -44, 77, 37, 81, -44
577};
578
579 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
580 Performed when YYTABLE does not specify something else to do. Zero
581 means the default is an error. */
582static const yytype_uint8 yydefact[] =
583{
584 0, 0, 0, 5, 7, 3, 1, 6, 0, 0,
585 16, 7, 0, 39, 40, 0, 0, 10, 0, 2,
586 8, 4, 0, 0, 0, 73, 0, 42, 43, 45,
587 47, 49, 51, 53, 55, 58, 65, 68, 72, 0,
588 18, 11, 0, 0, 0, 0, 74, 75, 76, 41,
589 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
590 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,
591 80, 0, 0, 14, 12, 46, 0, 48, 50, 52,
592 54, 56, 57, 61, 62, 60, 59, 63, 64, 66,
593 67, 70, 69, 71, 0, 0, 0, 0, 19, 0,
594 80, 15, 13, 0, 0, 0, 21, 31, 83, 23,
595 85, 0, 82, 81, 44, 22, 84, 0, 0, 17,
596 30, 20, 32, 0, 24, 33, 27, 0, 77, 35,
597 0, 0, 0, 0, 38, 37, 25, 36, 34, 0,
598 78, 79, 26, 0, 29, 0, 0, 0, 28
599};
600
601 /* YYPGOTO[NTERM-NUM]. */
602static const yytype_int8 yypgoto[] =
603{
604 -44, -44, -44, 103, 99, 104, -44, -43, -44, -21,
605 -44, -44, -44, -8, 63, 9, -44, 65, 67, 68,
606 69, 62, 26, 4, 22, 23, -19, -44, 20, 28
607};
608
609 /* YYDEFGOTO[NTERM-NUM]. */
610static const yytype_int16 yydefgoto[] =
611{
612 -1, 2, 3, 4, 10, 11, 19, 41, 70, 98,
613 117, 118, 130, 25, 26, 27, 28, 29, 30, 31,
614 32, 33, 34, 35, 36, 37, 38, 133, 99, 100
615};
616
617 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
618 positive, shift that token. If negative, reduce the rule whose
619 number is the opposite. If YYTABLE_NINF, syntax error. */
620static const yytype_uint8 yytable[] =
621{
622 16, 73, 74, 46, 47, 48, 13, 14, 39, 50,
623 58, 59, 120, 8, 140, 121, 141, 1, 94, 95,
624 96, 15, 12, 66, 122, 97, 142, 56, 57, 102,
625 9, 22, 60, 51, 23, 24, 62, 63, 61, 13,
626 14, 67, 68, 134, 135, 143, 144, 91, 92, 93,
627 123, 136, 5, 108, 15, 13, 14, 124, 125, 126,
628 127, 6, 83, 84, 85, 86, 18, 128, 42, 106,
629 15, 40, 129, 107, 43, 44, 109, 40, 45, 112,
630 64, 65, 81, 82, 87, 88, 49, 89, 90, 21,
631 52, 69, 53, 71, 54, 72, 55, 103, 101, 104,
632 105, 115, 111, 131, 116, 119, 7, 138, 132, 139,
633 20, 146, 114, 17, 76, 75, 148, 80, 0, 77,
634 113, 78, 137, 79, 0, 110, 0, 0, 0, 0,
635 0, 0, 0, 0, 0, 145, 0, 0, 147
636};
637
638static const yytype_int16 yycheck[] =
639{
640 8, 44, 45, 22, 23, 24, 18, 19, 16, 13,
641 8, 9, 22, 5, 20, 25, 22, 3, 15, 16,
642 17, 33, 4, 26, 34, 22, 32, 10, 11, 72,
643 22, 43, 30, 37, 46, 47, 6, 7, 36, 18,
644 19, 44, 45, 22, 23, 34, 35, 66, 67, 68,
645 14, 30, 25, 96, 33, 18, 19, 21, 22, 23,
646 24, 0, 58, 59, 60, 61, 26, 31, 16, 25,
647 33, 27, 36, 29, 22, 23, 97, 27, 26, 100,
648 42, 43, 56, 57, 62, 63, 35, 64, 65, 25,
649 12, 25, 39, 23, 40, 23, 41, 38, 25, 17,
650 17, 25, 28, 18, 25, 25, 3, 36, 33, 21,
651 11, 34, 103, 9, 51, 50, 35, 55, -1, 52,
652 100, 53, 130, 54, -1, 97, -1, -1, -1, -1,
653 -1, -1, -1, -1, -1, 143, -1, -1, 146
654};
655
656 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
657 symbol of state STATE-NUM. */
658static const yytype_uint8 yystos[] =
659{
660 0, 3, 49, 50, 51, 25, 0, 51, 5, 22,
661 52, 53, 4, 18, 19, 33, 61, 53, 26, 54,
662 52, 25, 43, 46, 47, 61, 62, 63, 64, 65,
663 66, 67, 68, 69, 70, 71, 72, 73, 74, 61,
664 27, 55, 16, 22, 23, 26, 74, 74, 74, 35,
665 13, 37, 12, 39, 40, 41, 10, 11, 8, 9,
666 30, 36, 6, 7, 42, 43, 26, 44, 45, 25,
667 56, 23, 23, 55, 55, 65, 62, 66, 67, 68,
668 69, 70, 70, 71, 71, 71, 71, 72, 72, 73,
669 73, 74, 74, 74, 15, 16, 17, 22, 57, 76,
670 77, 25, 55, 38, 17, 17, 25, 29, 55, 57,
671 77, 28, 57, 76, 63, 25, 25, 58, 59, 25,
672 22, 25, 34, 14, 21, 22, 23, 24, 31, 36,
673 60, 18, 33, 75, 22, 23, 30, 61, 36, 21,
674 20, 22, 32, 34, 35, 61, 34, 61, 35
675};
676
677 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
678static const yytype_uint8 yyr1[] =
679{
680 0, 48, 49, 50, 50, 51, 51, 52, 52, 53,
681 53, 54, 54, 54, 54, 54, 54, 55, 56, 56,
682 57, 57, 57, 57, 58, 58, 58, 58, 58, 58,
683 58, 59, 59, 59, 60, 60, 60, 60, 60, 61,
684 61, 61, 62, 63, 63, 64, 64, 65, 65, 66,
685 66, 67, 67, 68, 68, 69, 69, 69, 70, 70,
686 70, 70, 70, 71, 71, 71, 72, 72, 72, 73,
687 73, 73, 73, 74, 74, 74, 74, 75, 75, 75,
688 76, 76, 76, 77, 77, 77
689};
690
691 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
692static const yytype_uint8 yyr2[] =
693{
694 0, 2, 3, 2, 4, 1, 2, 0, 2, 4,
695 2, 2, 3, 4, 3, 4, 0, 5, 0, 2,
696 4, 2, 3, 2, 2, 3, 4, 2, 9, 5,
697 2, 0, 2, 2, 3, 1, 2, 2, 2, 1,
698 1, 3, 1, 1, 5, 1, 3, 1, 3, 1,
699 3, 1, 3, 1, 3, 1, 3, 3, 1, 3,
700 3, 3, 3, 3, 3, 1, 3, 3, 1, 3,
701 3, 3, 1, 1, 2, 2, 2, 0, 2, 2,
702 0, 2, 2, 2, 3, 2
703};
704
705
706#define yyerrok (yyerrstatus = 0)
707#define yyclearin (yychar = YYEMPTY)
708#define YYEMPTY (-2)
709#define YYEOF 0
710
711#define YYACCEPT goto yyacceptlab
712#define YYABORT goto yyabortlab
713#define YYERROR goto yyerrorlab
714
715
716#define YYRECOVERING() (!!yyerrstatus)
717
718#define YYBACKUP(Token, Value) \
719do \
720 if (yychar == YYEMPTY) \
721 { \
722 yychar = (Token); \
723 yylval = (Value); \
724 YYPOPSTACK (yylen); \
725 yystate = *yyssp; \
726 goto yybackup; \
727 } \
728 else \
729 { \
730 yyerror (YY_("syntax error: cannot back up")); \
731 YYERROR; \
732 } \
733while (0)
734
735/* Error token number */
736#define YYTERROR 1
737#define YYERRCODE 256
738
739
740/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
741 If N is 0, then set CURRENT to the empty location which ends
742 the previous symbol: RHS[0] (always defined). */
743
744#ifndef YYLLOC_DEFAULT
745# define YYLLOC_DEFAULT(Current, Rhs, N) \
746 do \
747 if (N) \
748 { \
749 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
750 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
751 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
752 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
753 } \
754 else \
755 { \
756 (Current).first_line = (Current).last_line = \
757 YYRHSLOC (Rhs, 0).last_line; \
758 (Current).first_column = (Current).last_column = \
759 YYRHSLOC (Rhs, 0).last_column; \
760 } \
761 while (0)
762#endif
763
764#define YYRHSLOC(Rhs, K) ((Rhs)[K])
765
766
767/* Enable debugging if requested. */
768#if YYDEBUG
769
770# ifndef YYFPRINTF
771# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
772# define YYFPRINTF fprintf
773# endif
774
775# define YYDPRINTF(Args) \
776do { \
777 if (yydebug) \
778 YYFPRINTF Args; \
779} while (0)
780
781
782/* YY_LOCATION_PRINT -- Print the location on the stream.
783 This macro was not mandated originally: define only if we know
784 we won't break user code: when these are the locations we know. */
785
786#ifndef YY_LOCATION_PRINT
787# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
788
789/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
790
791YY_ATTRIBUTE_UNUSED
792static unsigned
793yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
794{
795 unsigned res = 0;
796 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
797 if (0 <= yylocp->first_line)
798 {
799 res += YYFPRINTF (yyo, "%d", yylocp->first_line);
800 if (0 <= yylocp->first_column)
801 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
802 }
803 if (0 <= yylocp->last_line)
804 {
805 if (yylocp->first_line < yylocp->last_line)
806 {
807 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
808 if (0 <= end_col)
809 res += YYFPRINTF (yyo, ".%d", end_col);
810 }
811 else if (0 <= end_col && yylocp->first_column < end_col)
812 res += YYFPRINTF (yyo, "-%d", end_col);
813 }
814 return res;
815 }
816
817# define YY_LOCATION_PRINT(File, Loc) \
818 yy_location_print_ (File, &(Loc))
819
820# else
821# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
822# endif
823#endif
824
825
826# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
827do { \
828 if (yydebug) \
829 { \
830 YYFPRINTF (stderr, "%s ", Title); \
831 yy_symbol_print (stderr, \
832 Type, Value, Location); \
833 YYFPRINTF (stderr, "\n"); \
834 } \
835} while (0)
836
837
838/*----------------------------------------.
839| Print this symbol's value on YYOUTPUT. |
840`----------------------------------------*/
841
842static void
843yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
844{
845 FILE *yyo = yyoutput;
846 YYUSE (yyo);
847 YYUSE (yylocationp);
848 if (!yyvaluep)
849 return;
850# ifdef YYPRINT
851 if (yytype < YYNTOKENS)
852 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
853# endif
854 YYUSE (yytype);
855}
856
857
858/*--------------------------------.
859| Print this symbol on YYOUTPUT. |
860`--------------------------------*/
861
862static void
863yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
864{
865 YYFPRINTF (yyoutput, "%s %s (",
866 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
867
868 YY_LOCATION_PRINT (yyoutput, *yylocationp);
869 YYFPRINTF (yyoutput, ": ");
870 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
871 YYFPRINTF (yyoutput, ")");
872}
873
874/*------------------------------------------------------------------.
875| yy_stack_print -- Print the state stack from its BOTTOM up to its |
876| TOP (included). |
877`------------------------------------------------------------------*/
878
879static void
880yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
881{
882 YYFPRINTF (stderr, "Stack now");
883 for (; yybottom <= yytop; yybottom++)
884 {
885 int yybot = *yybottom;
886 YYFPRINTF (stderr, " %d", yybot);
887 }
888 YYFPRINTF (stderr, "\n");
889}
890
891# define YY_STACK_PRINT(Bottom, Top) \
892do { \
893 if (yydebug) \
894 yy_stack_print ((Bottom), (Top)); \
895} while (0)
896
897
898/*------------------------------------------------.
899| Report that the YYRULE is going to be reduced. |
900`------------------------------------------------*/
901
902static void
903yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
904{
905 unsigned long int yylno = yyrline[yyrule];
906 int yynrhs = yyr2[yyrule];
907 int yyi;
908 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
909 yyrule - 1, yylno);
910 /* The symbols being reduced. */
911 for (yyi = 0; yyi < yynrhs; yyi++)
912 {
913 YYFPRINTF (stderr, " $%d = ", yyi + 1);
914 yy_symbol_print (stderr,
915 yystos[yyssp[yyi + 1 - yynrhs]],
916 &(yyvsp[(yyi + 1) - (yynrhs)])
917 , &(yylsp[(yyi + 1) - (yynrhs)]) );
918 YYFPRINTF (stderr, "\n");
919 }
920}
921
922# define YY_REDUCE_PRINT(Rule) \
923do { \
924 if (yydebug) \
925 yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \
926} while (0)
927
928/* Nonzero means print parse trace. It is left uninitialized so that
929 multiple parsers can coexist. */
930int yydebug;
931#else /* !YYDEBUG */
932# define YYDPRINTF(Args)
933# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
934# define YY_STACK_PRINT(Bottom, Top)
935# define YY_REDUCE_PRINT(Rule)
936#endif /* !YYDEBUG */
937
938
939/* YYINITDEPTH -- initial size of the parser's stacks. */
940#ifndef YYINITDEPTH
941# define YYINITDEPTH 200
942#endif
943
944/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
945 if the built-in stack extension method is used).
946
947 Do not make this value too large; the results are undefined if
948 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
949 evaluated with infinite-precision integer arithmetic. */
950
951#ifndef YYMAXDEPTH
952# define YYMAXDEPTH 10000
953#endif
954
955
956#if YYERROR_VERBOSE
957
958# ifndef yystrlen
959# if defined __GLIBC__ && defined _STRING_H
960# define yystrlen strlen
961# else
962/* Return the length of YYSTR. */
963static YYSIZE_T
964yystrlen (const char *yystr)
965{
966 YYSIZE_T yylen;
967 for (yylen = 0; yystr[yylen]; yylen++)
968 continue;
969 return yylen;
970}
971# endif
972# endif
973
974# ifndef yystpcpy
975# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
976# define yystpcpy stpcpy
977# else
978/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
979 YYDEST. */
980static char *
981yystpcpy (char *yydest, const char *yysrc)
982{
983 char *yyd = yydest;
984 const char *yys = yysrc;
985
986 while ((*yyd++ = *yys++) != '\0')
987 continue;
988
989 return yyd - 1;
990}
991# endif
992# endif
993
994# ifndef yytnamerr
995/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
996 quotes and backslashes, so that it's suitable for yyerror. The
997 heuristic is that double-quoting is unnecessary unless the string
998 contains an apostrophe, a comma, or backslash (other than
999 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1000 null, do not copy; instead, return the length of what the result
1001 would have been. */
1002static YYSIZE_T
1003yytnamerr (char *yyres, const char *yystr)
1004{
1005 if (*yystr == '"')
1006 {
1007 YYSIZE_T yyn = 0;
1008 char const *yyp = yystr;
1009
1010 for (;;)
1011 switch (*++yyp)
1012 {
1013 case '\'':
1014 case ',':
1015 goto do_not_strip_quotes;
1016
1017 case '\\':
1018 if (*++yyp != '\\')
1019 goto do_not_strip_quotes;
1020 /* Fall through. */
1021 default:
1022 if (yyres)
1023 yyres[yyn] = *yyp;
1024 yyn++;
1025 break;
1026
1027 case '"':
1028 if (yyres)
1029 yyres[yyn] = '\0';
1030 return yyn;
1031 }
1032 do_not_strip_quotes: ;
1033 }
1034
1035 if (! yyres)
1036 return yystrlen (yystr);
1037
1038 return yystpcpy (yyres, yystr) - yyres;
1039}
1040# endif
1041
1042/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1043 about the unexpected token YYTOKEN for the state stack whose top is
1044 YYSSP.
1045
1046 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1047 not large enough to hold the message. In that case, also set
1048 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1049 required number of bytes is too large to store. */
1050static int
1051yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1052 yytype_int16 *yyssp, int yytoken)
1053{
1054 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1055 YYSIZE_T yysize = yysize0;
1056 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1057 /* Internationalized format string. */
1058 const char *yyformat = YY_NULLPTR;
1059 /* Arguments of yyformat. */
1060 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1061 /* Number of reported tokens (one for the "unexpected", one per
1062 "expected"). */
1063 int yycount = 0;
1064
1065 /* There are many possibilities here to consider:
1066 - If this state is a consistent state with a default action, then
1067 the only way this function was invoked is if the default action
1068 is an error action. In that case, don't check for expected
1069 tokens because there are none.
1070 - The only way there can be no lookahead present (in yychar) is if
1071 this state is a consistent state with a default action. Thus,
1072 detecting the absence of a lookahead is sufficient to determine
1073 that there is no unexpected or expected token to report. In that
1074 case, just report a simple "syntax error".
1075 - Don't assume there isn't a lookahead just because this state is a
1076 consistent state with a default action. There might have been a
1077 previous inconsistent state, consistent state with a non-default
1078 action, or user semantic action that manipulated yychar.
1079 - Of course, the expected token list depends on states to have
1080 correct lookahead information, and it depends on the parser not
1081 to perform extra reductions after fetching a lookahead from the
1082 scanner and before detecting a syntax error. Thus, state merging
1083 (from LALR or IELR) and default reductions corrupt the expected
1084 token list. However, the list is correct for canonical LR with
1085 one exception: it will still contain any token that will not be
1086 accepted due to an error action in a later state.
1087 */
1088 if (yytoken != YYEMPTY)
1089 {
1090 int yyn = yypact[*yyssp];
1091 yyarg[yycount++] = yytname[yytoken];
1092 if (!yypact_value_is_default (yyn))
1093 {
1094 /* Start YYX at -YYN if negative to avoid negative indexes in
1095 YYCHECK. In other words, skip the first -YYN actions for
1096 this state because they are default actions. */
1097 int yyxbegin = yyn < 0 ? -yyn : 0;
1098 /* Stay within bounds of both yycheck and yytname. */
1099 int yychecklim = YYLAST - yyn + 1;
1100 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1101 int yyx;
1102
1103 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1104 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1105 && !yytable_value_is_error (yytable[yyx + yyn]))
1106 {
1107 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1108 {
1109 yycount = 1;
1110 yysize = yysize0;
1111 break;
1112 }
1113 yyarg[yycount++] = yytname[yyx];
1114 {
1115 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1116 if (! (yysize <= yysize1
1117 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1118 return 2;
1119 yysize = yysize1;
1120 }
1121 }
1122 }
1123 }
1124
1125 switch (yycount)
1126 {
1127# define YYCASE_(N, S) \
1128 case N: \
1129 yyformat = S; \
1130 break
1131 YYCASE_(0, YY_("syntax error"));
1132 YYCASE_(1, YY_("syntax error, unexpected %s"));
1133 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1134 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1135 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1136 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1137# undef YYCASE_
1138 }
1139
1140 {
1141 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1142 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1143 return 2;
1144 yysize = yysize1;
1145 }
1146
1147 if (*yymsg_alloc < yysize)
1148 {
1149 *yymsg_alloc = 2 * yysize;
1150 if (! (yysize <= *yymsg_alloc
1151 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1152 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1153 return 1;
1154 }
1155
1156 /* Avoid sprintf, as that infringes on the user's name space.
1157 Don't have undefined behavior even if the translation
1158 produced a string with the wrong number of "%s"s. */
1159 {
1160 char *yyp = *yymsg;
1161 int yyi = 0;
1162 while ((*yyp = *yyformat) != '\0')
1163 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1164 {
1165 yyp += yytnamerr (yyp, yyarg[yyi++]);
1166 yyformat += 2;
1167 }
1168 else
1169 {
1170 yyp++;
1171 yyformat++;
1172 }
1173 }
1174 return 0;
1175}
1176#endif /* YYERROR_VERBOSE */
1177
1178/*-----------------------------------------------.
1179| Release the memory associated to this symbol. |
1180`-----------------------------------------------*/
1181
1182static void
1183yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
1184{
1185 YYUSE (yyvaluep);
1186 YYUSE (yylocationp);
1187 if (!yymsg)
1188 yymsg = "Deleting";
1189 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1190
1191 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1192 YYUSE (yytype);
1193 YY_IGNORE_MAYBE_UNINITIALIZED_END
1194}
1195
1196
1197
1198
1199/* The lookahead symbol. */
1200int yychar;
1201
1202/* The semantic value of the lookahead symbol. */
1203YYSTYPE yylval;
1204/* Location data for the lookahead symbol. */
1205YYLTYPE yylloc
1206# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1207 = { 1, 1, 1, 1 }
1208# endif
1209;
1210/* Number of syntax errors so far. */
1211int yynerrs;
1212
1213
1214/*----------.
1215| yyparse. |
1216`----------*/
1217
1218int
1219yyparse (void)
1220{
1221 int yystate;
1222 /* Number of tokens to shift before error messages enabled. */
1223 int yyerrstatus;
1224
1225 /* The stacks and their tools:
1226 'yyss': related to states.
1227 'yyvs': related to semantic values.
1228 'yyls': related to locations.
1229
1230 Refer to the stacks through separate pointers, to allow yyoverflow
1231 to reallocate them elsewhere. */
1232
1233 /* The state stack. */
1234 yytype_int16 yyssa[YYINITDEPTH];
1235 yytype_int16 *yyss;
1236 yytype_int16 *yyssp;
1237
1238 /* The semantic value stack. */
1239 YYSTYPE yyvsa[YYINITDEPTH];
1240 YYSTYPE *yyvs;
1241 YYSTYPE *yyvsp;
1242
1243 /* The location stack. */
1244 YYLTYPE yylsa[YYINITDEPTH];
1245 YYLTYPE *yyls;
1246 YYLTYPE *yylsp;
1247
1248 /* The locations where the error started and ended. */
1249 YYLTYPE yyerror_range[3];
1250
1251 YYSIZE_T yystacksize;
1252
1253 int yyn;
1254 int yyresult;
1255 /* Lookahead token as an internal (translated) token number. */
1256 int yytoken = 0;
1257 /* The variables used to return semantic value and location from the
1258 action routines. */
1259 YYSTYPE yyval;
1260 YYLTYPE yyloc;
1261
1262#if YYERROR_VERBOSE
1263 /* Buffer for error messages, and its allocated size. */
1264 char yymsgbuf[128];
1265 char *yymsg = yymsgbuf;
1266 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1267#endif
1268
1269#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1270
1271 /* The number of symbols on the RHS of the reduced rule.
1272 Keep to zero when no symbol should be popped. */
1273 int yylen = 0;
1274
1275 yyssp = yyss = yyssa;
1276 yyvsp = yyvs = yyvsa;
1277 yylsp = yyls = yylsa;
1278 yystacksize = YYINITDEPTH;
1279
1280 YYDPRINTF ((stderr, "Starting parse\n"));
1281
1282 yystate = 0;
1283 yyerrstatus = 0;
1284 yynerrs = 0;
1285 yychar = YYEMPTY; /* Cause a token to be read. */
1286 yylsp[0] = yylloc;
1287 goto yysetstate;
1288
1289/*------------------------------------------------------------.
1290| yynewstate -- Push a new state, which is found in yystate. |
1291`------------------------------------------------------------*/
1292 yynewstate:
1293 /* In all cases, when you get here, the value and location stacks
1294 have just been pushed. So pushing a state here evens the stacks. */
1295 yyssp++;
1296
1297 yysetstate:
1298 *yyssp = yystate;
1299
1300 if (yyss + yystacksize - 1 <= yyssp)
1301 {
1302 /* Get the current used size of the three stacks, in elements. */
1303 YYSIZE_T yysize = yyssp - yyss + 1;
1304
1305#ifdef yyoverflow
1306 {
1307 /* Give user a chance to reallocate the stack. Use copies of
1308 these so that the &'s don't force the real ones into
1309 memory. */
1310 YYSTYPE *yyvs1 = yyvs;
1311 yytype_int16 *yyss1 = yyss;
1312 YYLTYPE *yyls1 = yyls;
1313
1314 /* Each stack pointer address is followed by the size of the
1315 data in use in that stack, in bytes. This used to be a
1316 conditional around just the two extra args, but that might
1317 be undefined if yyoverflow is a macro. */
1318 yyoverflow (YY_("memory exhausted"),
1319 &yyss1, yysize * sizeof (*yyssp),
1320 &yyvs1, yysize * sizeof (*yyvsp),
1321 &yyls1, yysize * sizeof (*yylsp),
1322 &yystacksize);
1323
1324 yyls = yyls1;
1325 yyss = yyss1;
1326 yyvs = yyvs1;
1327 }
1328#else /* no yyoverflow */
1329# ifndef YYSTACK_RELOCATE
1330 goto yyexhaustedlab;
1331# else
1332 /* Extend the stack our own way. */
1333 if (YYMAXDEPTH <= yystacksize)
1334 goto yyexhaustedlab;
1335 yystacksize *= 2;
1336 if (YYMAXDEPTH < yystacksize)
1337 yystacksize = YYMAXDEPTH;
1338
1339 {
1340 yytype_int16 *yyss1 = yyss;
1341 union yyalloc *yyptr =
1342 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1343 if (! yyptr)
1344 goto yyexhaustedlab;
1345 YYSTACK_RELOCATE (yyss_alloc, yyss);
1346 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1347 YYSTACK_RELOCATE (yyls_alloc, yyls);
1348# undef YYSTACK_RELOCATE
1349 if (yyss1 != yyssa)
1350 YYSTACK_FREE (yyss1);
1351 }
1352# endif
1353#endif /* no yyoverflow */
1354
1355 yyssp = yyss + yysize - 1;
1356 yyvsp = yyvs + yysize - 1;
1357 yylsp = yyls + yysize - 1;
1358
1359 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1360 (unsigned long int) yystacksize));
1361
1362 if (yyss + yystacksize - 1 <= yyssp)
1363 YYABORT;
1364 }
1365
1366 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1367
1368 if (yystate == YYFINAL)
1369 YYACCEPT;
1370
1371 goto yybackup;
1372
1373/*-----------.
1374| yybackup. |
1375`-----------*/
1376yybackup:
1377
1378 /* Do appropriate processing given the current state. Read a
1379 lookahead token if we need one and don't already have one. */
1380
1381 /* First try to decide what to do without reference to lookahead token. */
1382 yyn = yypact[yystate];
1383 if (yypact_value_is_default (yyn))
1384 goto yydefault;
1385
1386 /* Not known => get a lookahead token if don't already have one. */
1387
1388 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1389 if (yychar == YYEMPTY)
1390 {
1391 YYDPRINTF ((stderr, "Reading a token: "));
1392 yychar = yylex ();
1393 }
1394
1395 if (yychar <= YYEOF)
1396 {
1397 yychar = yytoken = YYEOF;
1398 YYDPRINTF ((stderr, "Now at end of input.\n"));
1399 }
1400 else
1401 {
1402 yytoken = YYTRANSLATE (yychar);
1403 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1404 }
1405
1406 /* If the proper action on seeing token YYTOKEN is to reduce or to
1407 detect an error, take that action. */
1408 yyn += yytoken;
1409 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1410 goto yydefault;
1411 yyn = yytable[yyn];
1412 if (yyn <= 0)
1413 {
1414 if (yytable_value_is_error (yyn))
1415 goto yyerrlab;
1416 yyn = -yyn;
1417 goto yyreduce;
1418 }
1419
1420 /* Count tokens shifted since error; after three, turn off error
1421 status. */
1422 if (yyerrstatus)
1423 yyerrstatus--;
1424
1425 /* Shift the lookahead token. */
1426 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1427
1428 /* Discard the shifted token. */
1429 yychar = YYEMPTY;
1430
1431 yystate = yyn;
1432 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1433 *++yyvsp = yylval;
1434 YY_IGNORE_MAYBE_UNINITIALIZED_END
1435 *++yylsp = yylloc;
1436 goto yynewstate;
1437
1438
1439/*-----------------------------------------------------------.
1440| yydefault -- do the default action for the current state. |
1441`-----------------------------------------------------------*/
1442yydefault:
1443 yyn = yydefact[yystate];
1444 if (yyn == 0)
1445 goto yyerrlab;
1446 goto yyreduce;
1447
1448
1449/*-----------------------------.
1450| yyreduce -- Do a reduction. |
1451`-----------------------------*/
1452yyreduce:
1453 /* yyn is the number of a rule to reduce with. */
1454 yylen = yyr2[yyn];
1455
1456 /* If YYLEN is nonzero, implement the default value of the action:
1457 '$$ = $1'.
1458
1459 Otherwise, the following line sets YYVAL to garbage.
1460 This behavior is undocumented and Bison
1461 users should not rely upon it. Assigning to YYVAL
1462 unconditionally makes the parser a bit smaller, and it avoids a
1463 GCC warning that YYVAL may be used uninitialized. */
1464 yyval = yyvsp[1-yylen];
1465
1466 /* Default location. */
1467 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1468 YY_REDUCE_PRINT (yyn);
1469 switch (yyn)
1470 {
1471 case 2:
1472#line 110 "dtc-parser.y" /* yacc.c:1646 */
1473 {
1474 parser_output = build_dt_info((yyvsp[-2].flags), (yyvsp[-1].re), (yyvsp[0].node),
1475 guess_boot_cpuid((yyvsp[0].node)));
1476 }
1477#line 1478 "dtc-parser.tab.c" /* yacc.c:1646 */
1478 break;
1479
1480 case 3:
1481#line 118 "dtc-parser.y" /* yacc.c:1646 */
1482 {
1483 (yyval.flags) = DTSF_V1;
1484 }
1485#line 1486 "dtc-parser.tab.c" /* yacc.c:1646 */
1486 break;
1487
1488 case 4:
1489#line 122 "dtc-parser.y" /* yacc.c:1646 */
1490 {
1491 (yyval.flags) = DTSF_V1 | DTSF_PLUGIN;
1492 }
1493#line 1494 "dtc-parser.tab.c" /* yacc.c:1646 */
1494 break;
1495
1496 case 6:
1497#line 130 "dtc-parser.y" /* yacc.c:1646 */
1498 {
1499 if ((yyvsp[0].flags) != (yyvsp[-1].flags))
1500 ERROR(&(yylsp[0]), "Header flags don't match earlier ones");
1501 (yyval.flags) = (yyvsp[-1].flags);
1502 }
1503#line 1504 "dtc-parser.tab.c" /* yacc.c:1646 */
1504 break;
1505
1506 case 7:
1507#line 139 "dtc-parser.y" /* yacc.c:1646 */
1508 {
1509 (yyval.re) = NULL;
1510 }
1511#line 1512 "dtc-parser.tab.c" /* yacc.c:1646 */
1512 break;
1513
1514 case 8:
1515#line 143 "dtc-parser.y" /* yacc.c:1646 */
1516 {
1517 (yyval.re) = chain_reserve_entry((yyvsp[-1].re), (yyvsp[0].re));
1518 }
1519#line 1520 "dtc-parser.tab.c" /* yacc.c:1646 */
1520 break;
1521
1522 case 9:
1523#line 150 "dtc-parser.y" /* yacc.c:1646 */
1524 {
1525 (yyval.re) = build_reserve_entry((yyvsp[-2].integer), (yyvsp[-1].integer));
1526 }
1527#line 1528 "dtc-parser.tab.c" /* yacc.c:1646 */
1528 break;
1529
1530 case 10:
1531#line 154 "dtc-parser.y" /* yacc.c:1646 */
1532 {
1533 add_label(&(yyvsp[0].re)->labels, (yyvsp[-1].labelref));
1534 (yyval.re) = (yyvsp[0].re);
1535 }
1536#line 1537 "dtc-parser.tab.c" /* yacc.c:1646 */
1537 break;
1538
1539 case 11:
1540#line 162 "dtc-parser.y" /* yacc.c:1646 */
1541 {
1542 (yyval.node) = name_node((yyvsp[0].node), "");
1543 }
1544#line 1545 "dtc-parser.tab.c" /* yacc.c:1646 */
1545 break;
1546
1547 case 12:
1548#line 166 "dtc-parser.y" /* yacc.c:1646 */
1549 {
1550 (yyval.node) = merge_nodes((yyvsp[-2].node), (yyvsp[0].node));
1551 }
1552#line 1553 "dtc-parser.tab.c" /* yacc.c:1646 */
1553 break;
1554
1555 case 13:
1556#line 171 "dtc-parser.y" /* yacc.c:1646 */
1557 {
1558 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1559
1560 if (target) {
1561 add_label(&target->labels, (yyvsp[-2].labelref));
1562 merge_nodes(target, (yyvsp[0].node));
1563 } else
1564 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1565 (yyval.node) = (yyvsp[-3].node);
1566 }
1567#line 1568 "dtc-parser.tab.c" /* yacc.c:1646 */
1568 break;
1569
1570 case 14:
1571#line 182 "dtc-parser.y" /* yacc.c:1646 */
1572 {
1573 struct node *target = get_node_by_ref((yyvsp[-2].node), (yyvsp[-1].labelref));
1574
1575 if (target) {
1576 merge_nodes(target, (yyvsp[0].node));
1577 } else {
1578 /*
1579 * We rely on the rule being always:
1580 * versioninfo plugindecl memreserves devicetree
1581 * so $-1 is what we want (plugindecl)
1582 */
1583 if ((yyvsp[(-1) - (3)].flags) & DTSF_PLUGIN)
1584 add_orphan_node((yyvsp[-2].node), (yyvsp[0].node), (yyvsp[-1].labelref));
1585 else
1586 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1587 }
1588 (yyval.node) = (yyvsp[-2].node);
1589 }
1590#line 1591 "dtc-parser.tab.c" /* yacc.c:1646 */
1591 break;
1592
1593 case 15:
1594#line 201 "dtc-parser.y" /* yacc.c:1646 */
1595 {
1596 struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref));
1597
1598 if (target)
1599 delete_node(target);
1600 else
1601 ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref));
1602
1603
1604 (yyval.node) = (yyvsp[-3].node);
1605 }
1606#line 1607 "dtc-parser.tab.c" /* yacc.c:1646 */
1607 break;
1608
1609 case 16:
1610#line 213 "dtc-parser.y" /* yacc.c:1646 */
1611 {
1612 /* build empty node */
1613 (yyval.node) = name_node(build_node(NULL, NULL), "");
1614 }
1615#line 1616 "dtc-parser.tab.c" /* yacc.c:1646 */
1616 break;
1617
1618 case 17:
1619#line 221 "dtc-parser.y" /* yacc.c:1646 */
1620 {
1621 (yyval.node) = build_node((yyvsp[-3].proplist), (yyvsp[-2].nodelist));
1622 }
1623#line 1624 "dtc-parser.tab.c" /* yacc.c:1646 */
1624 break;
1625
1626 case 18:
1627#line 228 "dtc-parser.y" /* yacc.c:1646 */
1628 {
1629 (yyval.proplist) = NULL;
1630 }
1631#line 1632 "dtc-parser.tab.c" /* yacc.c:1646 */
1632 break;
1633
1634 case 19:
1635#line 232 "dtc-parser.y" /* yacc.c:1646 */
1636 {
1637 (yyval.proplist) = chain_property((yyvsp[0].prop), (yyvsp[-1].proplist));
1638 }
1639#line 1640 "dtc-parser.tab.c" /* yacc.c:1646 */
1640 break;
1641
1642 case 20:
1643#line 239 "dtc-parser.y" /* yacc.c:1646 */
1644 {
1645 (yyval.prop) = build_property((yyvsp[-3].propnodename), (yyvsp[-1].data));
1646 }
1647#line 1648 "dtc-parser.tab.c" /* yacc.c:1646 */
1648 break;
1649
1650 case 21:
1651#line 243 "dtc-parser.y" /* yacc.c:1646 */
1652 {
1653 (yyval.prop) = build_property((yyvsp[-1].propnodename), empty_data);
1654 }
1655#line 1656 "dtc-parser.tab.c" /* yacc.c:1646 */
1656 break;
1657
1658 case 22:
1659#line 247 "dtc-parser.y" /* yacc.c:1646 */
1660 {
1661 (yyval.prop) = build_property_delete((yyvsp[-1].propnodename));
1662 }
1663#line 1664 "dtc-parser.tab.c" /* yacc.c:1646 */
1664 break;
1665
1666 case 23:
1667#line 251 "dtc-parser.y" /* yacc.c:1646 */
1668 {
1669 add_label(&(yyvsp[0].prop)->labels, (yyvsp[-1].labelref));
1670 (yyval.prop) = (yyvsp[0].prop);
1671 }
1672#line 1673 "dtc-parser.tab.c" /* yacc.c:1646 */
1673 break;
1674
1675 case 24:
1676#line 259 "dtc-parser.y" /* yacc.c:1646 */
1677 {
1678 (yyval.data) = data_merge((yyvsp[-1].data), (yyvsp[0].data));
1679 }
1680#line 1681 "dtc-parser.tab.c" /* yacc.c:1646 */
1681 break;
1682
1683 case 25:
1684#line 263 "dtc-parser.y" /* yacc.c:1646 */
1685 {
1686 (yyval.data) = data_merge((yyvsp[-2].data), (yyvsp[-1].array).data);
1687 }
1688#line 1689 "dtc-parser.tab.c" /* yacc.c:1646 */
1689 break;
1690
1691 case 26:
1692#line 267 "dtc-parser.y" /* yacc.c:1646 */
1693 {
1694 (yyval.data) = data_merge((yyvsp[-3].data), (yyvsp[-1].data));
1695 }
1696#line 1697 "dtc-parser.tab.c" /* yacc.c:1646 */
1697 break;
1698
1699 case 27:
1700#line 271 "dtc-parser.y" /* yacc.c:1646 */
1701 {
1702 (yyval.data) = data_add_marker((yyvsp[-1].data), REF_PATH, (yyvsp[0].labelref));
1703 }
1704#line 1705 "dtc-parser.tab.c" /* yacc.c:1646 */
1705 break;
1706
1707 case 28:
1708#line 275 "dtc-parser.y" /* yacc.c:1646 */
1709 {
1710 FILE *f = srcfile_relative_open((yyvsp[-5].data).val, NULL);
1711 struct data d;
1712
1713 if ((yyvsp[-3].integer) != 0)
1714 if (fseek(f, (yyvsp[-3].integer), SEEK_SET) != 0)
1715 die("Couldn't seek to offset %llu in \"%s\": %s",
1716 (unsigned long long)(yyvsp[-3].integer), (yyvsp[-5].data).val,
1717 strerror(errno));
1718
1719 d = data_copy_file(f, (yyvsp[-1].integer));
1720
1721 (yyval.data) = data_merge((yyvsp[-8].data), d);
1722 fclose(f);
1723 }
1724#line 1725 "dtc-parser.tab.c" /* yacc.c:1646 */
1725 break;
1726
1727 case 29:
1728#line 291 "dtc-parser.y" /* yacc.c:1646 */
1729 {
1730 FILE *f = srcfile_relative_open((yyvsp[-1].data).val, NULL);
1731 struct data d = empty_data;
1732
1733 d = data_copy_file(f, -1);
1734
1735 (yyval.data) = data_merge((yyvsp[-4].data), d);
1736 fclose(f);
1737 }
1738#line 1739 "dtc-parser.tab.c" /* yacc.c:1646 */
1739 break;
1740
1741 case 30:
1742#line 301 "dtc-parser.y" /* yacc.c:1646 */
1743 {
1744 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1745 }
1746#line 1747 "dtc-parser.tab.c" /* yacc.c:1646 */
1747 break;
1748
1749 case 31:
1750#line 308 "dtc-parser.y" /* yacc.c:1646 */
1751 {
1752 (yyval.data) = empty_data;
1753 }
1754#line 1755 "dtc-parser.tab.c" /* yacc.c:1646 */
1755 break;
1756
1757 case 32:
1758#line 312 "dtc-parser.y" /* yacc.c:1646 */
1759 {
1760 (yyval.data) = (yyvsp[-1].data);
1761 }
1762#line 1763 "dtc-parser.tab.c" /* yacc.c:1646 */
1763 break;
1764
1765 case 33:
1766#line 316 "dtc-parser.y" /* yacc.c:1646 */
1767 {
1768 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
1769 }
1770#line 1771 "dtc-parser.tab.c" /* yacc.c:1646 */
1771 break;
1772
1773 case 34:
1774#line 323 "dtc-parser.y" /* yacc.c:1646 */
1775 {
1776 unsigned long long bits;
1777
1778 bits = (yyvsp[-1].integer);
1779
1780 if ((bits != 8) && (bits != 16) &&
1781 (bits != 32) && (bits != 64)) {
1782 ERROR(&(yylsp[-1]), "Array elements must be"
1783 " 8, 16, 32 or 64-bits");
1784 bits = 32;
1785 }
1786
1787 (yyval.array).data = empty_data;
1788 (yyval.array).bits = bits;
1789 }
1790#line 1791 "dtc-parser.tab.c" /* yacc.c:1646 */
1791 break;
1792
1793 case 35:
1794#line 339 "dtc-parser.y" /* yacc.c:1646 */
1795 {
1796 (yyval.array).data = empty_data;
1797 (yyval.array).bits = 32;
1798 }
1799#line 1800 "dtc-parser.tab.c" /* yacc.c:1646 */
1800 break;
1801
1802 case 36:
1803#line 344 "dtc-parser.y" /* yacc.c:1646 */
1804 {
1805 if ((yyvsp[-1].array).bits < 64) {
1806 uint64_t mask = (1ULL << (yyvsp[-1].array).bits) - 1;
1807 /*
1808 * Bits above mask must either be all zero
1809 * (positive within range of mask) or all one
1810 * (negative and sign-extended). The second
1811 * condition is true if when we set all bits
1812 * within the mask to one (i.e. | in the
1813 * mask), all bits are one.
1814 */
1815 if (((yyvsp[0].integer) > mask) && (((yyvsp[0].integer) | mask) != -1ULL))
1816 ERROR(&(yylsp[0]), "Value out of range for"
1817 " %d-bit array element", (yyvsp[-1].array).bits);
1818 }
1819
1820 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, (yyvsp[0].integer), (yyvsp[-1].array).bits);
1821 }
1822#line 1823 "dtc-parser.tab.c" /* yacc.c:1646 */
1823 break;
1824
1825 case 37:
1826#line 363 "dtc-parser.y" /* yacc.c:1646 */
1827 {
1828 uint64_t val = ~0ULL >> (64 - (yyvsp[-1].array).bits);
1829
1830 if ((yyvsp[-1].array).bits == 32)
1831 (yyvsp[-1].array).data = data_add_marker((yyvsp[-1].array).data,
1832 REF_PHANDLE,
1833 (yyvsp[0].labelref));
1834 else
1835 ERROR(&(yylsp[0]), "References are only allowed in "
1836 "arrays with 32-bit elements.");
1837
1838 (yyval.array).data = data_append_integer((yyvsp[-1].array).data, val, (yyvsp[-1].array).bits);
1839 }
1840#line 1841 "dtc-parser.tab.c" /* yacc.c:1646 */
1841 break;
1842
1843 case 38:
1844#line 377 "dtc-parser.y" /* yacc.c:1646 */
1845 {
1846 (yyval.array).data = data_add_marker((yyvsp[-1].array).data, LABEL, (yyvsp[0].labelref));
1847 }
1848#line 1849 "dtc-parser.tab.c" /* yacc.c:1646 */
1849 break;
1850
1851 case 41:
1852#line 386 "dtc-parser.y" /* yacc.c:1646 */
1853 {
1854 (yyval.integer) = (yyvsp[-1].integer);
1855 }
1856#line 1857 "dtc-parser.tab.c" /* yacc.c:1646 */
1857 break;
1858
1859 case 44:
1860#line 397 "dtc-parser.y" /* yacc.c:1646 */
1861 { (yyval.integer) = (yyvsp[-4].integer) ? (yyvsp[-2].integer) : (yyvsp[0].integer); }
1862#line 1863 "dtc-parser.tab.c" /* yacc.c:1646 */
1863 break;
1864
1865 case 46:
1866#line 402 "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 48:
1872#line 407 "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 50:
1878#line 412 "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 52:
1884#line 417 "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 54:
1890#line 422 "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 56:
1896#line 427 "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 57:
1902#line 428 "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 59:
1908#line 433 "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 60:
1914#line 434 "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 61:
1920#line 435 "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 62:
1926#line 436 "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 63:
1932#line 440 "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 64:
1938#line 441 "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 66:
1944#line 446 "dtc-parser.y" /* yacc.c:1646 */
1945 { (yyval.integer) = (yyvsp[-2].integer) + (yyvsp[0].integer); }
1946#line 1947 "dtc-parser.tab.c" /* yacc.c:1646 */
1947 break;
1948
1949 case 67:
1950#line 447 "dtc-parser.y" /* yacc.c:1646 */
1951 { (yyval.integer) = (yyvsp[-2].integer) - (yyvsp[0].integer); }
1952#line 1953 "dtc-parser.tab.c" /* yacc.c:1646 */
1953 break;
1954
1955 case 69:
1956#line 452 "dtc-parser.y" /* yacc.c:1646 */
1957 { (yyval.integer) = (yyvsp[-2].integer) * (yyvsp[0].integer); }
1958#line 1959 "dtc-parser.tab.c" /* yacc.c:1646 */
1959 break;
1960
1961 case 70:
1962#line 454 "dtc-parser.y" /* yacc.c:1646 */
1963 {
1964 if ((yyvsp[0].integer) != 0) {
1965 (yyval.integer) = (yyvsp[-2].integer) / (yyvsp[0].integer);
1966 } else {
1967 ERROR(&(yyloc), "Division by zero");
1968 (yyval.integer) = 0;
1969 }
1970 }
1971#line 1972 "dtc-parser.tab.c" /* yacc.c:1646 */
1972 break;
1973
1974 case 71:
1975#line 463 "dtc-parser.y" /* yacc.c:1646 */
1976 {
1977 if ((yyvsp[0].integer) != 0) {
1978 (yyval.integer) = (yyvsp[-2].integer) % (yyvsp[0].integer);
1979 } else {
1980 ERROR(&(yyloc), "Division by zero");
1981 (yyval.integer) = 0;
1982 }
1983 }
1984#line 1985 "dtc-parser.tab.c" /* yacc.c:1646 */
1985 break;
1986
1987 case 74:
1988#line 476 "dtc-parser.y" /* yacc.c:1646 */
1989 { (yyval.integer) = -(yyvsp[0].integer); }
1990#line 1991 "dtc-parser.tab.c" /* yacc.c:1646 */
1991 break;
1992
1993 case 75:
1994#line 477 "dtc-parser.y" /* yacc.c:1646 */
1995 { (yyval.integer) = ~(yyvsp[0].integer); }
1996#line 1997 "dtc-parser.tab.c" /* yacc.c:1646 */
1997 break;
1998
1999 case 76:
2000#line 478 "dtc-parser.y" /* yacc.c:1646 */
2001 { (yyval.integer) = !(yyvsp[0].integer); }
2002#line 2003 "dtc-parser.tab.c" /* yacc.c:1646 */
2003 break;
2004
2005 case 77:
2006#line 483 "dtc-parser.y" /* yacc.c:1646 */
2007 {
2008 (yyval.data) = empty_data;
2009 }
2010#line 2011 "dtc-parser.tab.c" /* yacc.c:1646 */
2011 break;
2012
2013 case 78:
2014#line 487 "dtc-parser.y" /* yacc.c:1646 */
2015 {
2016 (yyval.data) = data_append_byte((yyvsp[-1].data), (yyvsp[0].byte));
2017 }
2018#line 2019 "dtc-parser.tab.c" /* yacc.c:1646 */
2019 break;
2020
2021 case 79:
2022#line 491 "dtc-parser.y" /* yacc.c:1646 */
2023 {
2024 (yyval.data) = data_add_marker((yyvsp[-1].data), LABEL, (yyvsp[0].labelref));
2025 }
2026#line 2027 "dtc-parser.tab.c" /* yacc.c:1646 */
2027 break;
2028
2029 case 80:
2030#line 498 "dtc-parser.y" /* yacc.c:1646 */
2031 {
2032 (yyval.nodelist) = NULL;
2033 }
2034#line 2035 "dtc-parser.tab.c" /* yacc.c:1646 */
2035 break;
2036
2037 case 81:
2038#line 502 "dtc-parser.y" /* yacc.c:1646 */
2039 {
2040 (yyval.nodelist) = chain_node((yyvsp[-1].node), (yyvsp[0].nodelist));
2041 }
2042#line 2043 "dtc-parser.tab.c" /* yacc.c:1646 */
2043 break;
2044
2045 case 82:
2046#line 506 "dtc-parser.y" /* yacc.c:1646 */
2047 {
2048 ERROR(&(yylsp[0]), "Properties must precede subnodes");
2049 YYERROR;
2050 }
2051#line 2052 "dtc-parser.tab.c" /* yacc.c:1646 */
2052 break;
2053
2054 case 83:
2055#line 514 "dtc-parser.y" /* yacc.c:1646 */
2056 {
2057 (yyval.node) = name_node((yyvsp[0].node), (yyvsp[-1].propnodename));
2058 }
2059#line 2060 "dtc-parser.tab.c" /* yacc.c:1646 */
2060 break;
2061
2062 case 84:
2063#line 518 "dtc-parser.y" /* yacc.c:1646 */
2064 {
2065 (yyval.node) = name_node(build_node_delete(), (yyvsp[-1].propnodename));
2066 }
2067#line 2068 "dtc-parser.tab.c" /* yacc.c:1646 */
2068 break;
2069
2070 case 85:
2071#line 522 "dtc-parser.y" /* yacc.c:1646 */
2072 {
2073 add_label(&(yyvsp[0].node)->labels, (yyvsp[-1].labelref));
2074 (yyval.node) = (yyvsp[0].node);
2075 }
2076#line 2077 "dtc-parser.tab.c" /* yacc.c:1646 */
2077 break;
2078
2079
2080#line 2081 "dtc-parser.tab.c" /* yacc.c:1646 */
2081 default: break;
2082 }
2083 /* User semantic actions sometimes alter yychar, and that requires
2084 that yytoken be updated with the new translation. We take the
2085 approach of translating immediately before every use of yytoken.
2086 One alternative is translating here after every semantic action,
2087 but that translation would be missed if the semantic action invokes
2088 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2089 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2090 incorrect destructor might then be invoked immediately. In the
2091 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2092 to an incorrect destructor call or verbose syntax error message
2093 before the lookahead is translated. */
2094 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2095
2096 YYPOPSTACK (yylen);
2097 yylen = 0;
2098 YY_STACK_PRINT (yyss, yyssp);
2099
2100 *++yyvsp = yyval;
2101 *++yylsp = yyloc;
2102
2103 /* Now 'shift' the result of the reduction. Determine what state
2104 that goes to, based on the state we popped back to and the rule
2105 number reduced by. */
2106
2107 yyn = yyr1[yyn];
2108
2109 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2110 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2111 yystate = yytable[yystate];
2112 else
2113 yystate = yydefgoto[yyn - YYNTOKENS];
2114
2115 goto yynewstate;
2116
2117
2118/*--------------------------------------.
2119| yyerrlab -- here on detecting error. |
2120`--------------------------------------*/
2121yyerrlab:
2122 /* Make sure we have latest lookahead translation. See comments at
2123 user semantic actions for why this is necessary. */
2124 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2125
2126 /* If not already recovering from an error, report this error. */
2127 if (!yyerrstatus)
2128 {
2129 ++yynerrs;
2130#if ! YYERROR_VERBOSE
2131 yyerror (YY_("syntax error"));
2132#else
2133# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2134 yyssp, yytoken)
2135 {
2136 char const *yymsgp = YY_("syntax error");
2137 int yysyntax_error_status;
2138 yysyntax_error_status = YYSYNTAX_ERROR;
2139 if (yysyntax_error_status == 0)
2140 yymsgp = yymsg;
2141 else if (yysyntax_error_status == 1)
2142 {
2143 if (yymsg != yymsgbuf)
2144 YYSTACK_FREE (yymsg);
2145 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2146 if (!yymsg)
2147 {
2148 yymsg = yymsgbuf;
2149 yymsg_alloc = sizeof yymsgbuf;
2150 yysyntax_error_status = 2;
2151 }
2152 else
2153 {
2154 yysyntax_error_status = YYSYNTAX_ERROR;
2155 yymsgp = yymsg;
2156 }
2157 }
2158 yyerror (yymsgp);
2159 if (yysyntax_error_status == 2)
2160 goto yyexhaustedlab;
2161 }
2162# undef YYSYNTAX_ERROR
2163#endif
2164 }
2165
2166 yyerror_range[1] = yylloc;
2167
2168 if (yyerrstatus == 3)
2169 {
2170 /* If just tried and failed to reuse lookahead token after an
2171 error, discard it. */
2172
2173 if (yychar <= YYEOF)
2174 {
2175 /* Return failure if at end of input. */
2176 if (yychar == YYEOF)
2177 YYABORT;
2178 }
2179 else
2180 {
2181 yydestruct ("Error: discarding",
2182 yytoken, &yylval, &yylloc);
2183 yychar = YYEMPTY;
2184 }
2185 }
2186
2187 /* Else will try to reuse lookahead token after shifting the error
2188 token. */
2189 goto yyerrlab1;
2190
2191
2192/*---------------------------------------------------.
2193| yyerrorlab -- error raised explicitly by YYERROR. |
2194`---------------------------------------------------*/
2195yyerrorlab:
2196
2197 /* Pacify compilers like GCC when the user code never invokes
2198 YYERROR and the label yyerrorlab therefore never appears in user
2199 code. */
2200 if (/*CONSTCOND*/ 0)
2201 goto yyerrorlab;
2202
2203 yyerror_range[1] = yylsp[1-yylen];
2204 /* Do not reclaim the symbols of the rule whose action triggered
2205 this YYERROR. */
2206 YYPOPSTACK (yylen);
2207 yylen = 0;
2208 YY_STACK_PRINT (yyss, yyssp);
2209 yystate = *yyssp;
2210 goto yyerrlab1;
2211
2212
2213/*-------------------------------------------------------------.
2214| yyerrlab1 -- common code for both syntax error and YYERROR. |
2215`-------------------------------------------------------------*/
2216yyerrlab1:
2217 yyerrstatus = 3; /* Each real token shifted decrements this. */
2218
2219 for (;;)
2220 {
2221 yyn = yypact[yystate];
2222 if (!yypact_value_is_default (yyn))
2223 {
2224 yyn += YYTERROR;
2225 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2226 {
2227 yyn = yytable[yyn];
2228 if (0 < yyn)
2229 break;
2230 }
2231 }
2232
2233 /* Pop the current state because it cannot handle the error token. */
2234 if (yyssp == yyss)
2235 YYABORT;
2236
2237 yyerror_range[1] = *yylsp;
2238 yydestruct ("Error: popping",
2239 yystos[yystate], yyvsp, yylsp);
2240 YYPOPSTACK (1);
2241 yystate = *yyssp;
2242 YY_STACK_PRINT (yyss, yyssp);
2243 }
2244
2245 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2246 *++yyvsp = yylval;
2247 YY_IGNORE_MAYBE_UNINITIALIZED_END
2248
2249 yyerror_range[2] = yylloc;
2250 /* Using YYLLOC is tempting, but would change the location of
2251 the lookahead. YYLOC is available though. */
2252 YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
2253 *++yylsp = yyloc;
2254
2255 /* Shift the error token. */
2256 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2257
2258 yystate = yyn;
2259 goto yynewstate;
2260
2261
2262/*-------------------------------------.
2263| yyacceptlab -- YYACCEPT comes here. |
2264`-------------------------------------*/
2265yyacceptlab:
2266 yyresult = 0;
2267 goto yyreturn;
2268
2269/*-----------------------------------.
2270| yyabortlab -- YYABORT comes here. |
2271`-----------------------------------*/
2272yyabortlab:
2273 yyresult = 1;
2274 goto yyreturn;
2275
2276#if !defined yyoverflow || YYERROR_VERBOSE
2277/*-------------------------------------------------.
2278| yyexhaustedlab -- memory exhaustion comes here. |
2279`-------------------------------------------------*/
2280yyexhaustedlab:
2281 yyerror (YY_("memory exhausted"));
2282 yyresult = 2;
2283 /* Fall through. */
2284#endif
2285
2286yyreturn:
2287 if (yychar != YYEMPTY)
2288 {
2289 /* Make sure we have latest lookahead translation. See comments at
2290 user semantic actions for why this is necessary. */
2291 yytoken = YYTRANSLATE (yychar);
2292 yydestruct ("Cleanup: discarding lookahead",
2293 yytoken, &yylval, &yylloc);
2294 }
2295 /* Do not reclaim the symbols of the rule whose action triggered
2296 this YYABORT or YYACCEPT. */
2297 YYPOPSTACK (yylen);
2298 YY_STACK_PRINT (yyss, yyssp);
2299 while (yyssp != yyss)
2300 {
2301 yydestruct ("Cleanup: popping",
2302 yystos[*yyssp], yyvsp, yylsp);
2303 YYPOPSTACK (1);
2304 }
2305#ifndef yyoverflow
2306 if (yyss != yyssa)
2307 YYSTACK_FREE (yyss);
2308#endif
2309#if YYERROR_VERBOSE
2310 if (yymsg != yymsgbuf)
2311 YYSTACK_FREE (yymsg);
2312#endif
2313 return yyresult;
2314}
2315#line 528 "dtc-parser.y" /* yacc.c:1906 */
2316
2317
2318void yyerror(char const *s)
2319{
2320 ERROR(&yylloc, "%s", s);
2321}
diff --git a/scripts/dtc/dtc-parser.tab.h_shipped b/scripts/dtc/dtc-parser.tab.h_shipped
deleted file mode 100644
index 6aa512c1b337..000000000000
--- a/scripts/dtc/dtc-parser.tab.h_shipped
+++ /dev/null
@@ -1,125 +0,0 @@
1/* A Bison parser, made by GNU Bison 3.0.4. */
2
3/* Bison interface for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015 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#ifndef YY_YY_DTC_PARSER_TAB_H_INCLUDED
34# define YY_YY_DTC_PARSER_TAB_H_INCLUDED
35/* Debug traces. */
36#ifndef YYDEBUG
37# define YYDEBUG 0
38#endif
39#if YYDEBUG
40extern int yydebug;
41#endif
42
43/* Token type. */
44#ifndef YYTOKENTYPE
45# define YYTOKENTYPE
46 enum yytokentype
47 {
48 DT_V1 = 258,
49 DT_PLUGIN = 259,
50 DT_MEMRESERVE = 260,
51 DT_LSHIFT = 261,
52 DT_RSHIFT = 262,
53 DT_LE = 263,
54 DT_GE = 264,
55 DT_EQ = 265,
56 DT_NE = 266,
57 DT_AND = 267,
58 DT_OR = 268,
59 DT_BITS = 269,
60 DT_DEL_PROP = 270,
61 DT_DEL_NODE = 271,
62 DT_PROPNODENAME = 272,
63 DT_LITERAL = 273,
64 DT_CHAR_LITERAL = 274,
65 DT_BYTE = 275,
66 DT_STRING = 276,
67 DT_LABEL = 277,
68 DT_REF = 278,
69 DT_INCBIN = 279
70 };
71#endif
72
73/* Value type. */
74#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
75
76union YYSTYPE
77{
78#line 39 "dtc-parser.y" /* yacc.c:1909 */
79
80 char *propnodename;
81 char *labelref;
82 uint8_t byte;
83 struct data data;
84
85 struct {
86 struct data data;
87 int bits;
88 } array;
89
90 struct property *prop;
91 struct property *proplist;
92 struct node *node;
93 struct node *nodelist;
94 struct reserve_info *re;
95 uint64_t integer;
96 unsigned int flags;
97
98#line 99 "dtc-parser.tab.h" /* yacc.c:1909 */
99};
100
101typedef union YYSTYPE YYSTYPE;
102# define YYSTYPE_IS_TRIVIAL 1
103# define YYSTYPE_IS_DECLARED 1
104#endif
105
106/* Location type. */
107#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
108typedef struct YYLTYPE YYLTYPE;
109struct YYLTYPE
110{
111 int first_line;
112 int first_column;
113 int last_line;
114 int last_column;
115};
116# define YYLTYPE_IS_DECLARED 1
117# define YYLTYPE_IS_TRIVIAL 1
118#endif
119
120
121extern YYSTYPE yylval;
122extern YYLTYPE yylloc;
123int yyparse (void);
124
125#endif /* !YY_YY_DTC_PARSER_TAB_H_INCLUDED */
diff --git a/scripts/dtc/update-dtc-source.sh b/scripts/dtc/update-dtc-source.sh
index fe8926bb3b54..1a009fd195d0 100755
--- a/scripts/dtc/update-dtc-source.sh
+++ b/scripts/dtc/update-dtc-source.sh
@@ -4,7 +4,7 @@
4# 4#
5# This script assumes that the dtc and the linux git trees are in the 5# This script assumes that the dtc and the linux git trees are in the
6# same directory. After building dtc in the dtc directory, it copies the 6# same directory. After building dtc in the dtc directory, it copies the
7# source files and generated source files into the scripts/dtc directory 7# source files and generated source file(s) into the scripts/dtc directory
8# in the kernel and creates a git commit updating them to the new 8# in the kernel and creates a git commit updating them to the new
9# version. 9# version.
10# 10#
@@ -34,7 +34,6 @@ DTC_LINUX_PATH=`pwd`/scripts/dtc
34DTC_SOURCE="checks.c data.c dtc.c dtc.h flattree.c fstree.c livetree.c srcpos.c \ 34DTC_SOURCE="checks.c data.c dtc.c dtc.h flattree.c fstree.c livetree.c srcpos.c \
35 srcpos.h treesource.c util.c util.h version_gen.h Makefile.dtc \ 35 srcpos.h treesource.c util.c util.h version_gen.h Makefile.dtc \
36 dtc-lexer.l dtc-parser.y" 36 dtc-lexer.l dtc-parser.y"
37DTC_GENERATED="dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h"
38LIBFDT_SOURCE="Makefile.libfdt fdt.c fdt.h fdt_addresses.c fdt_empty_tree.c \ 37LIBFDT_SOURCE="Makefile.libfdt fdt.c fdt.h fdt_addresses.c fdt_empty_tree.c \
39 fdt_overlay.c fdt_ro.c fdt_rw.c fdt_strerror.c fdt_sw.c \ 38 fdt_overlay.c fdt_ro.c fdt_rw.c fdt_strerror.c fdt_sw.c \
40 fdt_wip.c libfdt.h libfdt_env.h libfdt_internal.h" 39 fdt_wip.c libfdt.h libfdt_env.h libfdt_internal.h"
@@ -59,10 +58,6 @@ for f in $DTC_SOURCE; do
59 cp ${DTC_UPSTREAM_PATH}/${f} ${f} 58 cp ${DTC_UPSTREAM_PATH}/${f} ${f}
60 git add ${f} 59 git add ${f}
61done 60done
62for f in $DTC_GENERATED; do
63 cp ${DTC_UPSTREAM_PATH}/$f ${f}_shipped
64 git add ${f}_shipped
65done
66for f in $LIBFDT_SOURCE; do 61for f in $LIBFDT_SOURCE; do
67 cp ${DTC_UPSTREAM_PATH}/libfdt/${f} libfdt/${f} 62 cp ${DTC_UPSTREAM_PATH}/libfdt/${f} libfdt/${f}
68 git add libfdt/${f} 63 git add libfdt/${f}