blob: 64c243772398d614d7cd0a6ec9cfd0d6baeb8da3 [file] [log] [blame]
Stephen Warrencd296722012-09-28 21:25:59 +00001#line 2 "dtc-lexer.lex.c"
David Gibsona4da2e32007-12-18 15:06:42 +11002
Stephen Warrencd296722012-09-28 21:25:59 +00003#line 4 "dtc-lexer.lex.c"
David Gibsona4da2e32007-12-18 15:06:42 +11004
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
Rob Herring6f05afc2017-01-04 10:45:20 -060011#define YY_FLEX_MINOR_VERSION 6
12#define YY_FLEX_SUBMINOR_VERSION 1
David Gibsona4da2e32007-12-18 15:06:42 +110013#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
David Gibsoned95d742008-08-07 12:24:17 +100034#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
David Gibsona4da2e32007-12-18 15:06:42 +110035
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;
David Gibsona4da2e32007-12-18 15:06:42 +110057
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
Stephen Warrencd296722012-09-28 21:25:59 +000087#endif /* ! C99 */
88
David Gibsona4da2e32007-12-18 15:06:42 +110089#endif /* ! FLEXINT_H */
90
Rob Herring6f05afc2017-01-04 10:45:20 -060091/* TODO: this is always defined, so inline it */
David Gibsona4da2e32007-12-18 15:06:42 +110092#define yyconst const
Rob Herring6f05afc2017-01-04 10:45:20 -060093
94#if defined(__GNUC__) && __GNUC__ >= 3
95#define yynoreturn __attribute__((__noreturn__))
David Gibsona4da2e32007-12-18 15:06:42 +110096#else
Rob Herring6f05afc2017-01-04 10:45:20 -060097#define yynoreturn
David Gibsona4da2e32007-12-18 15:06:42 +110098#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
Stephen Warrencd296722012-09-28 21:25:59 +0000133#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
David Gibsona4da2e32007-12-18 15:06:42 +1100140#define YY_BUF_SIZE 16384
Stephen Warrencd296722012-09-28 21:25:59 +0000141#endif /* __ia64__ */
David Gibsona4da2e32007-12-18 15:06:42 +1100142#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
Rob Herring47605972015-04-29 16:00:05 -0500153#ifndef YY_TYPEDEF_YY_SIZE_T
154#define YY_TYPEDEF_YY_SIZE_T
155typedef size_t yy_size_t;
156#endif
157
Rob Herring6f05afc2017-01-04 10:45:20 -0600158extern int yyleng;
David Gibsona4da2e32007-12-18 15:06:42 +1100159
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
John Bonesio658f29a2010-11-17 15:28:20 -0800166 #define YY_LESS_LINENO(n)
Rob Herring47605972015-04-29 16:00:05 -0500167 #define YY_LINENO_REWIND_TO(ptr)
David Gibsona4da2e32007-12-18 15:06:42 +1100168
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
David Gibsona4da2e32007-12-18 15:06:42 +1100185#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 */
Rob Herring6f05afc2017-01-04 10:45:20 -0600197 int yy_buf_size;
David Gibsona4da2e32007-12-18 15:06:42 +1100198
199 /* Number of characters read into yy_ch_buf, not including EOB
200 * characters.
201 */
Rob Herring6f05afc2017-01-04 10:45:20 -0600202 int yy_n_chars;
David Gibsona4da2e32007-12-18 15:06:42 +1100203
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. */
Rob Herring6f05afc2017-01-04 10:45:20 -0600225
David Gibsona4da2e32007-12-18 15:06:42 +1100226 /* 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. */
Rob Herring6f05afc2017-01-04 10:45:20 -0600253static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
David Gibsona4da2e32007-12-18 15:06:42 +1100254
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;
Rob Herring6f05afc2017-01-04 10:45:20 -0600272static int yy_n_chars; /* number of characters read into yy_ch_buf */
273int yyleng;
David Gibsona4da2e32007-12-18 15:06:42 +1100274
275/* Points to current character in buffer. */
Rob Herring6f05afc2017-01-04 10:45:20 -0600276static char *yy_c_buf_p = NULL;
David Gibsona4da2e32007-12-18 15:06:42 +1100277static 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 );
Rob Herring6f05afc2017-01-04 10:45:20 -0600301YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
David Gibsona4da2e32007-12-18 15:06:42 +1100302
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
Rob Herring6f05afc2017-01-04 10:45:20 -0600333#define yywrap() (/*CONSTCOND*/1)
David Gibsona4da2e32007-12-18 15:06:42 +1100334#define YY_SKIP_YYWRAP
335
336typedef unsigned char YY_CHAR;
337
Rob Herring6f05afc2017-01-04 10:45:20 -0600338FILE *yyin = NULL, *yyout = NULL;
David Gibsona4da2e32007-12-18 15:06:42 +1100339
340typedef int yy_state_type;
341
342extern int yylineno;
343
344int yylineno = 1;
345
346extern char *yytext;
Rob Herring6f05afc2017-01-04 10:45:20 -0600347#ifdef yytext_ptr
348#undef yytext_ptr
349#endif
David Gibsona4da2e32007-12-18 15:06:42 +1100350#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 );
Rob Herring6f05afc2017-01-04 10:45:20 -0600355static void yynoreturn yy_fatal_error (yyconst char* msg );
David Gibsona4da2e32007-12-18 15:06:42 +1100356
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; \
Rob Herring6f05afc2017-01-04 10:45:20 -0600362 yyleng = (int) (yy_cp - yy_bp); \
David Gibsona4da2e32007-12-18 15:06:42 +1100363 (yy_hold_char) = *yy_cp; \
364 *yy_cp = '\0'; \
365 (yy_c_buf_p) = yy_cp;
366
Rob Herring6f05afc2017-01-04 10:45:20 -0600367#define YY_NUM_RULES 31
368#define YY_END_OF_BUFFER 32
David Gibsona4da2e32007-12-18 15:06:42 +1100369/* 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 };
Rob Herring6f05afc2017-01-04 10:45:20 -0600376static yyconst flex_int16_t yy_accept[166] =
David Gibsona4da2e32007-12-18 15:06:42 +1100377 { 0,
Rob Herring6f05afc2017-01-04 10:45:20 -0600378 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,
John Bonesio658f29a2010-11-17 15:28:20 -0800388
Rob Herring6f05afc2017-01-04 10:45:20 -0600389 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
David Gibsona4da2e32007-12-18 15:06:42 +1100396 } ;
397
Rob Herring6f05afc2017-01-04 10:45:20 -0600398static yyconst YY_CHAR yy_ec[256] =
David Gibsona4da2e32007-12-18 15:06:42 +1100399 { 0,
400 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
Grant Likely706b78f2013-06-13 12:57:44 +0100401 4, 4, 4, 1, 1, 1, 1, 1, 1, 1,
David Gibsona4da2e32007-12-18 15:06:42 +1100402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Grant Likely706b78f2013-06-13 12:57:44 +0100403 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,
David Gibsona4da2e32007-12-18 15:06:42 +1100410
Rob Herring6f05afc2017-01-04 10:45:20 -0600411 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,
David Gibsona4da2e32007-12-18 15:06:42 +1100414 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
Rob Herring6f05afc2017-01-04 10:45:20 -0600430static yyconst YY_CHAR yy_meta[48] =
David Gibsona4da2e32007-12-18 15:06:42 +1100431 { 0,
Grant Likely706b78f2013-06-13 12:57:44 +0100432 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,
Rob Herring6f05afc2017-01-04 10:45:20 -0600436 8, 8, 8, 8, 3, 1, 4
David Gibsona4da2e32007-12-18 15:06:42 +1100437 } ;
438
Rob Herring6f05afc2017-01-04 10:45:20 -0600439static yyconst flex_uint16_t yy_base[180] =
David Gibsona4da2e32007-12-18 15:06:42 +1100440 { 0,
Rob Herring6f05afc2017-01-04 10:45:20 -0600441 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,
David Gibsona4da2e32007-12-18 15:06:42 +1100451
Rob Herring6f05afc2017-01-04 10:45:20 -0600452 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
David Gibsona4da2e32007-12-18 15:06:42 +1100460 } ;
461
Rob Herring6f05afc2017-01-04 10:45:20 -0600462static yyconst flex_int16_t yy_def[180] =
David Gibsona4da2e32007-12-18 15:06:42 +1100463 { 0,
Rob Herring6f05afc2017-01-04 10:45:20 -0600464 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,
David Gibsona4da2e32007-12-18 15:06:42 +1100474
Rob Herring6f05afc2017-01-04 10:45:20 -0600475 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
David Gibsona4da2e32007-12-18 15:06:42 +1100483 } ;
484
Rob Herring6f05afc2017-01-04 10:45:20 -0600485static yyconst flex_uint16_t yy_nxt[449] =
David Gibsona4da2e32007-12-18 15:06:42 +1100486 { 0,
Rob Herring47605972015-04-29 16:00:05 -0500487 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,
Rob Herring6f05afc2017-01-04 10:45:20 -0600491 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,
David Gibsona4da2e32007-12-18 15:06:42 +1100497
Rob Herring6f05afc2017-01-04 10:45:20 -0600498 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,
David Gibsona4da2e32007-12-18 15:06:42 +1100508
Rob Herring6f05afc2017-01-04 10:45:20 -0600509 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,
Stephen Warrencd296722012-09-28 21:25:59 +0000519
Rob Herring6f05afc2017-01-04 10:45:20 -0600520 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,
Stephen Warrencd296722012-09-28 21:25:59 +0000530
Rob Herring6f05afc2017-01-04 10:45:20 -0600531 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
David Gibsona4da2e32007-12-18 15:06:42 +1100536 } ;
537
Rob Herring6f05afc2017-01-04 10:45:20 -0600538static yyconst flex_int16_t yy_chk[449] =
David Gibsona4da2e32007-12-18 15:06:42 +1100539 { 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,
Stephen Warrencd296722012-09-28 21:25:59 +0000543 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Rob Herring6f05afc2017-01-04 10:45:20 -0600544 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,
Rob Herring47605972015-04-29 16:00:05 -0500547 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,
David Gibsona4da2e32007-12-18 15:06:42 +1100550
Rob Herring47605972015-04-29 16:00:05 -0500551 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
Rob Herring6f05afc2017-01-04 10:45:20 -0600552 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,
David Gibsona4da2e32007-12-18 15:06:42 +1100561
Rob Herring6f05afc2017-01-04 10:45:20 -0600562 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,
Stephen Warrencd296722012-09-28 21:25:59 +0000572
Rob Herring6f05afc2017-01-04 10:45:20 -0600573 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,
Rob Herring47605972015-04-29 16:00:05 -0500582 41, 38, 22, 21, 19, 13, 9, 6, 4, 2,
Stephen Warrencd296722012-09-28 21:25:59 +0000583
Rob Herring6f05afc2017-01-04 10:45:20 -0600584 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
David Gibsona4da2e32007-12-18 15:06:42 +1100589 } ;
590
David Gibsona4da2e32007-12-18 15:06:42 +1100591static 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;
Stephen Warrencd296722012-09-28 21:25:59 +0000605#line 1 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +1100606/*
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 */
Josh Triplett23c4ace2009-10-16 15:52:06 -0700625#define YY_NO_INPUT 1
David Gibsona4da2e32007-12-18 15:06:42 +1100626
Stephen Warrencd296722012-09-28 21:25:59 +0000627
628
Rob Herring47605972015-04-29 16:00:05 -0500629#line 37 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +1100630#include "dtc.h"
631#include "srcpos.h"
632#include "dtc-parser.tab.h"
633
John Bonesio658f29a2010-11-17 15:28:20 -0800634YYLTYPE yylloc;
Rob Herring47605972015-04-29 16:00:05 -0500635extern bool treesource_error;
John Bonesio658f29a2010-11-17 15:28:20 -0800636
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 }
David Gibsona4da2e32007-12-18 15:06:42 +1100642
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
John Bonesio658f29a2010-11-17 15:28:20 -0800651static int dts_version = 1;
David Gibsona4da2e32007-12-18 15:06:42 +1100652
John Bonesio658f29a2010-11-17 15:28:20 -0800653#define BEGIN_DEFAULT() DPRINT("<V1>\n"); \
David Gibsona4da2e32007-12-18 15:06:42 +1100654 BEGIN(V1); \
David Gibsoned95d742008-08-07 12:24:17 +1000655
656static void push_input_file(const char *filename);
Rob Herring47605972015-04-29 16:00:05 -0500657static bool pop_input_file(void);
Rob Herring89d12312017-03-21 09:01:08 -0500658static void PRINTF(1, 2) lexical_error(const char *fmt, ...);
659
660#line 661 "dtc-lexer.lex.c"
David Gibsona4da2e32007-12-18 15:06:42 +1100661
662#define INITIAL 0
Rob Herring47605972015-04-29 16:00:05 -0500663#define BYTESTRING 1
664#define PROPNODENAME 2
665#define V1 3
David Gibsona4da2e32007-12-18 15:06:42 +1100666
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
Josh Triplett23c4ace2009-10-16 15:52:06 -0700681/* 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
Rob Herring6f05afc2017-01-04 10:45:20 -0600696void yyset_in (FILE * _in_str );
Josh Triplett23c4ace2009-10-16 15:52:06 -0700697
698FILE *yyget_out (void );
699
Rob Herring6f05afc2017-01-04 10:45:20 -0600700void yyset_out (FILE * _out_str );
Josh Triplett23c4ace2009-10-16 15:52:06 -0700701
Rob Herring6f05afc2017-01-04 10:45:20 -0600702 int yyget_leng (void );
Josh Triplett23c4ace2009-10-16 15:52:06 -0700703
704char *yyget_text (void );
705
706int yyget_lineno (void );
707
Rob Herring6f05afc2017-01-04 10:45:20 -0600708void yyset_lineno (int _line_number );
Josh Triplett23c4ace2009-10-16 15:52:06 -0700709
David Gibsona4da2e32007-12-18 15:06:42 +1100710/* 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
Rob Herring6f05afc2017-01-04 10:45:20 -0600722#ifndef YY_NO_UNPUT
723
724#endif
725
David Gibsona4da2e32007-12-18 15:06:42 +1100726#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
Stephen Warrencd296722012-09-28 21:25:59 +0000746#ifdef __ia64__
747/* On IA-64, the buffer size is 16k, not 8k */
748#define YY_READ_BUF_SIZE 16384
749#else
David Gibsona4da2e32007-12-18 15:06:42 +1100750#define YY_READ_BUF_SIZE 8192
Stephen Warrencd296722012-09-28 21:25:59 +0000751#endif /* __ia64__ */
David Gibsona4da2e32007-12-18 15:06:42 +1100752#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 */
Rob Herring6f05afc2017-01-04 10:45:20 -0600759#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
David Gibsona4da2e32007-12-18 15:06:42 +1100760#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 = '*'; \
Stephen Warrencd296722012-09-28 21:25:59 +0000770 size_t n; \
David Gibsona4da2e32007-12-18 15:06:42 +1100771 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; \
Rob Herring6f05afc2017-01-04 10:45:20 -0600783 while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
David Gibsona4da2e32007-12-18 15:06:42 +1100784 { \
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
Rob Herring6f05afc2017-01-04 10:45:20 -0600838#define YY_BREAK /*LINTED*/break;
David Gibsona4da2e32007-12-18 15:06:42 +1100839#endif
840
841#define YY_RULE_SETUP \
Stephen Warrencd296722012-09-28 21:25:59 +0000842 if ( yyleng > 0 ) \
843 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
844 (yytext[yyleng - 1] == '\n'); \
David Gibsona4da2e32007-12-18 15:06:42 +1100845 YY_USER_ACTION
846
847/** The main scanner function which does all the work.
848 */
849YY_DECL
850{
Rob Herring6f05afc2017-01-04 10:45:20 -0600851 yy_state_type yy_current_state;
852 char *yy_cp, *yy_bp;
853 int yy_act;
David Gibsona4da2e32007-12-18 15:06:42 +1100854
David Gibsona4da2e32007-12-18 15:06:42 +1100855 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
Rob Herring47605972015-04-29 16:00:05 -0500881 {
Rob Herring89d12312017-03-21 09:01:08 -0500882#line 69 "dtc-lexer.l"
Rob Herring47605972015-04-29 16:00:05 -0500883
Rob Herring89d12312017-03-21 09:01:08 -0500884#line 885 "dtc-lexer.lex.c"
Rob Herring47605972015-04-29 16:00:05 -0500885
Rob Herring6f05afc2017-01-04 10:45:20 -0600886 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
David Gibsona4da2e32007-12-18 15:06:42 +1100887 {
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);
Stephen Warrencd296722012-09-28 21:25:59 +0000899 yy_current_state += YY_AT_BOL();
David Gibsona4da2e32007-12-18 15:06:42 +1100900yy_match:
901 do
902 {
Rob Herring6f05afc2017-01-04 10:45:20 -0600903 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
David Gibsona4da2e32007-12-18 15:06:42 +1100904 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];
Rob Herring6f05afc2017-01-04 10:45:20 -0600912 if ( yy_current_state >= 166 )
David Gibsona4da2e32007-12-18 15:06:42 +1100913 yy_c = yy_meta[(unsigned int) yy_c];
914 }
Rob Herring6f05afc2017-01-04 10:45:20 -0600915 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
David Gibsona4da2e32007-12-18 15:06:42 +1100916 ++yy_cp;
917 }
Rob Herring6f05afc2017-01-04 10:45:20 -0600918 while ( yy_current_state != 165 );
John Bonesio658f29a2010-11-17 15:28:20 -0800919 yy_cp = (yy_last_accepting_cpos);
920 yy_current_state = (yy_last_accepting_state);
David Gibsona4da2e32007-12-18 15:06:42 +1100921
922yy_find_action:
923 yy_act = yy_accept[yy_current_state];
David Gibsona4da2e32007-12-18 15:06:42 +1100924
925 YY_DO_BEFORE_ACTION;
926
David Gibsona4da2e32007-12-18 15:06:42 +1100927do_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:
David Gibsoned95d742008-08-07 12:24:17 +1000939/* rule 1 can match eol */
David Gibsona4da2e32007-12-18 15:06:42 +1100940YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -0500941#line 70 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +1100942{
David Gibsoned95d742008-08-07 12:24:17 +1000943 char *name = strchr(yytext, '\"') + 1;
944 yytext[yyleng-1] = '\0';
945 push_input_file(name);
David Gibsona4da2e32007-12-18 15:06:42 +1100946 }
947 YY_BREAK
Stephen Warrencd296722012-09-28 21:25:59 +0000948case 2:
949/* rule 2 can match eol */
950YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -0500951#line 76 "dtc-lexer.l"
Stephen Warrencd296722012-09-28 21:25:59 +0000952{
Rob Herring91feabc2016-01-26 09:04:11 -0600953 char *line, *fnstart, *fnend;
954 struct data fn;
Stephen Warrencd296722012-09-28 21:25:59 +0000955 /* skip text before line # */
956 line = yytext;
Rob Herring47605972015-04-29 16:00:05 -0500957 while (!isdigit((unsigned char)*line))
Stephen Warrencd296722012-09-28 21:25:59 +0000958 line++;
Rob Herring91feabc2016-01-26 09:04:11 -0600959
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
Stephen Warrencd296722012-09-28 21:25:59 +0000976 /* -1 since #line is the number of the next line */
Rob Herring91feabc2016-01-26 09:04:11 -0600977 srcpos_set_line(xstrdup(fn.val), atoi(line) - 1);
978 data_free(fn);
Stephen Warrencd296722012-09-28 21:25:59 +0000979 }
980 YY_BREAK
David Gibsona4da2e32007-12-18 15:06:42 +1100981case YY_STATE_EOF(INITIAL):
David Gibsona4da2e32007-12-18 15:06:42 +1100982case YY_STATE_EOF(BYTESTRING):
983case YY_STATE_EOF(PROPNODENAME):
984case YY_STATE_EOF(V1):
Rob Herring89d12312017-03-21 09:01:08 -0500985#line 105 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +1100986{
987 if (!pop_input_file()) {
988 yyterminate();
989 }
990 }
991 YY_BREAK
Stephen Warrencd296722012-09-28 21:25:59 +0000992case 3:
993/* rule 3 can match eol */
David Gibsona4da2e32007-12-18 15:06:42 +1100994YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -0500995#line 111 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +1100996{
David Gibsona4da2e32007-12-18 15:06:42 +1100997 DPRINT("String: %s\n", yytext);
998 yylval.data = data_copy_escape_string(yytext+1,
999 yyleng-2);
David Gibsona4da2e32007-12-18 15:06:42 +11001000 return DT_STRING;
1001 }
1002 YY_BREAK
Stephen Warrencd296722012-09-28 21:25:59 +00001003case 4:
David Gibsona4da2e32007-12-18 15:06:42 +11001004YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001005#line 118 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +11001006{
David Gibsona4da2e32007-12-18 15:06:42 +11001007 DPRINT("Keyword: /dts-v1/\n");
1008 dts_version = 1;
1009 BEGIN_DEFAULT();
1010 return DT_V1;
1011 }
1012 YY_BREAK
Stephen Warrencd296722012-09-28 21:25:59 +00001013case 5:
David Gibsona4da2e32007-12-18 15:06:42 +11001014YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001015#line 125 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +11001016{
Rob Herring6f05afc2017-01-04 10:45:20 -06001017 DPRINT("Keyword: /plugin/\n");
1018 return DT_PLUGIN;
1019 }
1020 YY_BREAK
1021case 6:
1022YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001023#line 130 "dtc-lexer.l"
Rob Herring6f05afc2017-01-04 10:45:20 -06001024{
David Gibsona4da2e32007-12-18 15:06:42 +11001025 DPRINT("Keyword: /memreserve/\n");
1026 BEGIN_DEFAULT();
1027 return DT_MEMRESERVE;
1028 }
1029 YY_BREAK
Rob Herring6f05afc2017-01-04 10:45:20 -06001030case 7:
David Gibsona4da2e32007-12-18 15:06:42 +11001031YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001032#line 136 "dtc-lexer.l"
Stephen Warrencd296722012-09-28 21:25:59 +00001033{
1034 DPRINT("Keyword: /bits/\n");
1035 BEGIN_DEFAULT();
1036 return DT_BITS;
1037 }
1038 YY_BREAK
Rob Herring6f05afc2017-01-04 10:45:20 -06001039case 8:
Stephen Warrencd296722012-09-28 21:25:59 +00001040YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001041#line 142 "dtc-lexer.l"
Stephen Warrencd296722012-09-28 21:25:59 +00001042{
1043 DPRINT("Keyword: /delete-property/\n");
1044 DPRINT("<PROPNODENAME>\n");
1045 BEGIN(PROPNODENAME);
1046 return DT_DEL_PROP;
1047 }
1048 YY_BREAK
Rob Herring6f05afc2017-01-04 10:45:20 -06001049case 9:
Stephen Warrencd296722012-09-28 21:25:59 +00001050YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001051#line 149 "dtc-lexer.l"
Stephen Warrencd296722012-09-28 21:25:59 +00001052{
1053 DPRINT("Keyword: /delete-node/\n");
1054 DPRINT("<PROPNODENAME>\n");
1055 BEGIN(PROPNODENAME);
1056 return DT_DEL_NODE;
1057 }
1058 YY_BREAK
Rob Herring6f05afc2017-01-04 10:45:20 -06001059case 10:
Stephen Warrencd296722012-09-28 21:25:59 +00001060YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001061#line 156 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +11001062{
David Gibsona4da2e32007-12-18 15:06:42 +11001063 DPRINT("Label: %s\n", yytext);
John Bonesio658f29a2010-11-17 15:28:20 -08001064 yylval.labelref = xstrdup(yytext);
David Gibsona4da2e32007-12-18 15:06:42 +11001065 yylval.labelref[yyleng-1] = '\0';
1066 return DT_LABEL;
1067 }
1068 YY_BREAK
Rob Herring6f05afc2017-01-04 10:45:20 -06001069case 11:
David Gibsona4da2e32007-12-18 15:06:42 +11001070YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001071#line 163 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +11001072{
Rob Herring47605972015-04-29 16:00:05 -05001073 char *e;
1074 DPRINT("Integer Literal: '%s'\n", yytext);
1075
1076 errno = 0;
1077 yylval.integer = strtoull(yytext, &e, 0);
1078
Rob Herring91feabc2016-01-26 09:04:11 -06001079 if (*e && e[strspn(e, "UL")]) {
1080 lexical_error("Bad integer literal '%s'",
1081 yytext);
1082 }
Rob Herring47605972015-04-29 16:00:05 -05001083
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);
David Gibsona4da2e32007-12-18 15:06:42 +11001091 return DT_LITERAL;
1092 }
1093 YY_BREAK
Rob Herring6f05afc2017-01-04 10:45:20 -06001094case 12:
1095/* rule 12 can match eol */
David Gibsona4da2e32007-12-18 15:06:42 +11001096YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001097#line 185 "dtc-lexer.l"
Stephen Warrencd296722012-09-28 21:25:59 +00001098{
Rob Herring47605972015-04-29 16:00:05 -05001099 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;
Rob Herring6f05afc2017-01-04 10:45:20 -06001106 } 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);
Rob Herring47605972015-04-29 16:00:05 -05001113 }
1114
Rob Herring6f05afc2017-01-04 10:45:20 -06001115 data_free(d);
Stephen Warrencd296722012-09-28 21:25:59 +00001116 return DT_CHAR_LITERAL;
1117 }
1118 YY_BREAK
Rob Herring6f05afc2017-01-04 10:45:20 -06001119case 13:
Stephen Warrencd296722012-09-28 21:25:59 +00001120YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001121#line 206 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +11001122{ /* label reference */
David Gibsona4da2e32007-12-18 15:06:42 +11001123 DPRINT("Ref: %s\n", yytext+1);
John Bonesio658f29a2010-11-17 15:28:20 -08001124 yylval.labelref = xstrdup(yytext+1);
David Gibsona4da2e32007-12-18 15:06:42 +11001125 return DT_REF;
1126 }
1127 YY_BREAK
Rob Herring6f05afc2017-01-04 10:45:20 -06001128case 14:
David Gibsona4da2e32007-12-18 15:06:42 +11001129YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001130#line 212 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +11001131{ /* new-style path reference */
David Gibsona4da2e32007-12-18 15:06:42 +11001132 yytext[yyleng-1] = '\0';
1133 DPRINT("Ref: %s\n", yytext+2);
John Bonesio658f29a2010-11-17 15:28:20 -08001134 yylval.labelref = xstrdup(yytext+2);
David Gibsona4da2e32007-12-18 15:06:42 +11001135 return DT_REF;
1136 }
1137 YY_BREAK
Rob Herring6f05afc2017-01-04 10:45:20 -06001138case 15:
David Gibsona4da2e32007-12-18 15:06:42 +11001139YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001140#line 219 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +11001141{
David Gibsona4da2e32007-12-18 15:06:42 +11001142 yylval.byte = strtol(yytext, NULL, 16);
1143 DPRINT("Byte: %02x\n", (int)yylval.byte);
1144 return DT_BYTE;
1145 }
1146 YY_BREAK
Rob Herring6f05afc2017-01-04 10:45:20 -06001147case 16:
David Gibsona4da2e32007-12-18 15:06:42 +11001148YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001149#line 225 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +11001150{
David Gibsona4da2e32007-12-18 15:06:42 +11001151 DPRINT("/BYTESTRING\n");
1152 BEGIN_DEFAULT();
1153 return ']';
1154 }
1155 YY_BREAK
Rob Herring6f05afc2017-01-04 10:45:20 -06001156case 17:
David Gibsona4da2e32007-12-18 15:06:42 +11001157YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001158#line 231 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +11001159{
David Gibsona4da2e32007-12-18 15:06:42 +11001160 DPRINT("PropNodeName: %s\n", yytext);
Stephen Warrencd296722012-09-28 21:25:59 +00001161 yylval.propnodename = xstrdup((yytext[0] == '\\') ?
1162 yytext + 1 : yytext);
David Gibsona4da2e32007-12-18 15:06:42 +11001163 BEGIN_DEFAULT();
1164 return DT_PROPNODENAME;
1165 }
1166 YY_BREAK
Rob Herring6f05afc2017-01-04 10:45:20 -06001167case 18:
David Gibsoned95d742008-08-07 12:24:17 +10001168YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001169#line 239 "dtc-lexer.l"
David Gibsoned95d742008-08-07 12:24:17 +10001170{
David Gibsoned95d742008-08-07 12:24:17 +10001171 DPRINT("Binary Include\n");
1172 return DT_INCBIN;
1173 }
1174 YY_BREAK
Stephen Warrencd296722012-09-28 21:25:59 +00001175case 19:
1176/* rule 19 can match eol */
David Gibsona4da2e32007-12-18 15:06:42 +11001177YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001178#line 244 "dtc-lexer.l"
Rob Herring6f05afc2017-01-04 10:45:20 -06001179/* eat whitespace */
David Gibsona4da2e32007-12-18 15:06:42 +11001180 YY_BREAK
Stephen Warrencd296722012-09-28 21:25:59 +00001181case 20:
1182/* rule 20 can match eol */
David Gibsona4da2e32007-12-18 15:06:42 +11001183YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001184#line 245 "dtc-lexer.l"
Rob Herring6f05afc2017-01-04 10:45:20 -06001185/* eat C-style comments */
David Gibsona4da2e32007-12-18 15:06:42 +11001186 YY_BREAK
Stephen Warrencd296722012-09-28 21:25:59 +00001187case 21:
Rob Herring6f05afc2017-01-04 10:45:20 -06001188/* rule 21 can match eol */
David Gibsona4da2e32007-12-18 15:06:42 +11001189YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001190#line 246 "dtc-lexer.l"
Rob Herring6f05afc2017-01-04 10:45:20 -06001191/* eat C++-style comments */
Stephen Warrencd296722012-09-28 21:25:59 +00001192 YY_BREAK
1193case 22:
1194YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001195#line 248 "dtc-lexer.l"
Rob Herring6f05afc2017-01-04 10:45:20 -06001196{ return DT_LSHIFT; };
Stephen Warrencd296722012-09-28 21:25:59 +00001197 YY_BREAK
1198case 23:
1199YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001200#line 249 "dtc-lexer.l"
Rob Herring6f05afc2017-01-04 10:45:20 -06001201{ return DT_RSHIFT; };
Stephen Warrencd296722012-09-28 21:25:59 +00001202 YY_BREAK
1203case 24:
1204YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001205#line 250 "dtc-lexer.l"
Rob Herring6f05afc2017-01-04 10:45:20 -06001206{ return DT_LE; };
Stephen Warrencd296722012-09-28 21:25:59 +00001207 YY_BREAK
1208case 25:
1209YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001210#line 251 "dtc-lexer.l"
Rob Herring6f05afc2017-01-04 10:45:20 -06001211{ return DT_GE; };
Stephen Warrencd296722012-09-28 21:25:59 +00001212 YY_BREAK
1213case 26:
1214YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001215#line 252 "dtc-lexer.l"
Rob Herring6f05afc2017-01-04 10:45:20 -06001216{ return DT_EQ; };
Stephen Warrencd296722012-09-28 21:25:59 +00001217 YY_BREAK
1218case 27:
1219YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001220#line 253 "dtc-lexer.l"
Rob Herring6f05afc2017-01-04 10:45:20 -06001221{ return DT_NE; };
Stephen Warrencd296722012-09-28 21:25:59 +00001222 YY_BREAK
1223case 28:
1224YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001225#line 254 "dtc-lexer.l"
Rob Herring6f05afc2017-01-04 10:45:20 -06001226{ return DT_AND; };
Stephen Warrencd296722012-09-28 21:25:59 +00001227 YY_BREAK
1228case 29:
1229YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001230#line 255 "dtc-lexer.l"
Rob Herring6f05afc2017-01-04 10:45:20 -06001231{ return DT_OR; };
1232 YY_BREAK
1233case 30:
1234YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001235#line 257 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +11001236{
David Gibsona4da2e32007-12-18 15:06:42 +11001237 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
Rob Herring6f05afc2017-01-04 10:45:20 -06001251case 31:
David Gibsona4da2e32007-12-18 15:06:42 +11001252YY_RULE_SETUP
Rob Herring89d12312017-03-21 09:01:08 -05001253#line 272 "dtc-lexer.l"
David Gibsona4da2e32007-12-18 15:06:42 +11001254ECHO;
1255 YY_BREAK
Rob Herring89d12312017-03-21 09:01:08 -05001256#line 1257 "dtc-lexer.lex.c"
David Gibsona4da2e32007-12-18 15:06:42 +11001257
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 {
John Bonesio658f29a2010-11-17 15:28:20 -08001321 yy_cp = (yy_last_accepting_cpos);
1322 yy_current_state = (yy_last_accepting_state);
David Gibsona4da2e32007-12-18 15:06:42 +11001323 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 */
Rob Herring47605972015-04-29 16:00:05 -05001386 } /* end of user's declarations */
David Gibsona4da2e32007-12-18 15:06:42 +11001387} /* 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{
Rob Herring6f05afc2017-01-04 10:45:20 -06001398 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1399 char *source = (yytext_ptr);
1400 yy_size_t number_to_move, i;
David Gibsona4da2e32007-12-18 15:06:42 +11001401 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. */
Rob Herring6f05afc2017-01-04 10:45:20 -06001429 number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
David Gibsona4da2e32007-12-18 15:06:42 +11001430
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 {
Rob Herring6f05afc2017-01-04 10:45:20 -06001442 int num_to_read =
David Gibsona4da2e32007-12-18 15:06:42 +11001443 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 */
Rob Herring47605972015-04-29 16:00:05 -05001449 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
David Gibsona4da2e32007-12-18 15:06:42 +11001450
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 {
Rob Herring6f05afc2017-01-04 10:45:20 -06001456 int new_size = b->yy_buf_size * 2;
David Gibsona4da2e32007-12-18 15:06:42 +11001457
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. */
Rob Herring6f05afc2017-01-04 10:45:20 -06001469 b->yy_ch_buf = NULL;
David Gibsona4da2e32007-12-18 15:06:42 +11001470
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]),
Rob Herring47605972015-04-29 16:00:05 -05001487 (yy_n_chars), num_to_read );
David Gibsona4da2e32007-12-18 15:06:42 +11001488
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
Rob Herring6f05afc2017-01-04 10:45:20 -06001511 if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
David Gibsoned95d742008-08-07 12:24:17 +10001512 /* Extend the array by 50%, plus the number we really need. */
Rob Herring6f05afc2017-01-04 10:45:20 -06001513 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
David Gibsoned95d742008-08-07 12:24:17 +10001514 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
David Gibsona4da2e32007-12-18 15:06:42 +11001519 (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{
Rob Herring6f05afc2017-01-04 10:45:20 -06001532 yy_state_type yy_current_state;
1533 char *yy_cp;
David Gibsona4da2e32007-12-18 15:06:42 +11001534
1535 yy_current_state = (yy_start);
Stephen Warrencd296722012-09-28 21:25:59 +00001536 yy_current_state += YY_AT_BOL();
David Gibsona4da2e32007-12-18 15:06:42 +11001537
1538 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1539 {
Rob Herring6f05afc2017-01-04 10:45:20 -06001540 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
David Gibsona4da2e32007-12-18 15:06:42 +11001541 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];
Rob Herring6f05afc2017-01-04 10:45:20 -06001549 if ( yy_current_state >= 166 )
David Gibsona4da2e32007-12-18 15:06:42 +11001550 yy_c = yy_meta[(unsigned int) yy_c];
1551 }
Rob Herring6f05afc2017-01-04 10:45:20 -06001552 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
David Gibsona4da2e32007-12-18 15:06:42 +11001553 }
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{
Rob Herring6f05afc2017-01-04 10:45:20 -06001565 int yy_is_jam;
1566 char *yy_cp = (yy_c_buf_p);
David Gibsona4da2e32007-12-18 15:06:42 +11001567
Rob Herring6f05afc2017-01-04 10:45:20 -06001568 YY_CHAR yy_c = 1;
David Gibsona4da2e32007-12-18 15:06:42 +11001569 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];
Rob Herring6f05afc2017-01-04 10:45:20 -06001577 if ( yy_current_state >= 166 )
David Gibsona4da2e32007-12-18 15:06:42 +11001578 yy_c = yy_meta[(unsigned int) yy_c];
1579 }
Rob Herring6f05afc2017-01-04 10:45:20 -06001580 yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c];
1581 yy_is_jam = (yy_current_state == 165);
David Gibsona4da2e32007-12-18 15:06:42 +11001582
Rob Herring47605972015-04-29 16:00:05 -05001583 return yy_is_jam ? 0 : yy_current_state;
David Gibsona4da2e32007-12-18 15:06:42 +11001584}
1585
Rob Herring6f05afc2017-01-04 10:45:20 -06001586#ifndef YY_NO_UNPUT
1587
1588#endif
1589
David Gibsona4da2e32007-12-18 15:06:42 +11001590#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 */
Rob Herring6f05afc2017-01-04 10:45:20 -06001614 int offset = (yy_c_buf_p) - (yytext_ptr);
David Gibsona4da2e32007-12-18 15:06:42 +11001615 ++(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( ) )
Rob Herring6f05afc2017-01-04 10:45:20 -06001638 return 0;
David Gibsona4da2e32007-12-18 15:06:42 +11001639
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
Stephen Warrencd296722012-09-28 21:25:59 +00001660 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1661
David Gibsona4da2e32007-12-18 15:06:42 +11001662 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
Rob Herring6f05afc2017-01-04 10:45:20 -06001741 b->yy_buf_size = (yy_size_t)size;
David Gibsona4da2e32007-12-18 15:06:42 +11001742
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
David Gibsona4da2e32007-12-18 15:06:42 +11001776/* 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
John Bonesio658f29a2010-11-17 15:28:20 -08001799 b->yy_is_interactive = 0;
David Gibsona4da2e32007-12-18 15:06:42 +11001800
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{
Rob Herring6f05afc2017-01-04 10:45:20 -06001888 int num_to_alloc;
David Gibsona4da2e32007-12-18 15:06:42 +11001889
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 */
Rob Herring6f05afc2017-01-04 10:45:20 -06001896 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
David Gibsona4da2e32007-12-18 15:06:42 +11001897 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1898 (num_to_alloc * sizeof(struct yy_buffer_state*)
1899 );
David Gibsoned95d742008-08-07 12:24:17 +10001900 if ( ! (yy_buffer_stack) )
1901 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
Rob Herring6f05afc2017-01-04 10:45:20 -06001902
David Gibsona4da2e32007-12-18 15:06:42 +11001903 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
Rob Herring6f05afc2017-01-04 10:45:20 -06001904
David Gibsona4da2e32007-12-18 15:06:42 +11001905 (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. */
Rob Herring6f05afc2017-01-04 10:45:20 -06001913 yy_size_t grow_size = 8 /* arbitrary grow size */;
David Gibsona4da2e32007-12-18 15:06:42 +11001914
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 );
David Gibsoned95d742008-08-07 12:24:17 +10001920 if ( ! (yy_buffer_stack) )
1921 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
David Gibsona4da2e32007-12-18 15:06:42 +11001922
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 *
Rob Herring6f05afc2017-01-04 10:45:20 -06001933 * @return the newly allocated buffer state object.
David Gibsona4da2e32007-12-18 15:06:42 +11001934 */
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. */
Rob Herring6f05afc2017-01-04 10:45:20 -06001943 return NULL;
David Gibsona4da2e32007-12-18 15:06:42 +11001944
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;
Rob Herring6f05afc2017-01-04 10:45:20 -06001952 b->yy_input_file = NULL;
David Gibsona4da2e32007-12-18 15:06:42 +11001953 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
Rob Herring6f05afc2017-01-04 10:45:20 -06001975 return yy_scan_bytes(yystr,(int) strlen(yystr) );
David Gibsona4da2e32007-12-18 15:06:42 +11001976}
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.
Stephen Warrencd296722012-09-28 21:25:59 +00001980 * @param yybytes the byte buffer to scan
1981 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
David Gibsona4da2e32007-12-18 15:06:42 +11001982 *
1983 * @return the newly allocated buffer state object.
1984 */
Rob Herring6f05afc2017-01-04 10:45:20 -06001985YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
David Gibsona4da2e32007-12-18 15:06:42 +11001986{
1987 YY_BUFFER_STATE b;
1988 char *buf;
1989 yy_size_t n;
Rob Herring47605972015-04-29 16:00:05 -05001990 yy_size_t i;
David Gibsona4da2e32007-12-18 15:06:42 +11001991
1992 /* Get memory for full buffer, including space for trailing EOB's. */
Rob Herring6f05afc2017-01-04 10:45:20 -06001993 n = (yy_size_t) _yybytes_len + 2;
David Gibsona4da2e32007-12-18 15:06:42 +11001994 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
Rob Herring6f05afc2017-01-04 10:45:20 -06002019static void yynoreturn yy_fatal_error (yyconst char* msg )
David Gibsona4da2e32007-12-18 15:06:42 +11002020{
Rob Herring6f05afc2017-01-04 10:45:20 -06002021 (void) fprintf( stderr, "%s\n", msg );
David Gibsona4da2e32007-12-18 15:06:42 +11002022 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{
Rob Herring6f05afc2017-01-04 10:45:20 -06002049
David Gibsona4da2e32007-12-18 15:06:42 +11002050 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 */
Rob Herring6f05afc2017-01-04 10:45:20 -06002072int yyget_leng (void)
David Gibsona4da2e32007-12-18 15:06:42 +11002073{
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.
Rob Herring6f05afc2017-01-04 10:45:20 -06002087 * @param _line_number line number
David Gibsona4da2e32007-12-18 15:06:42 +11002088 *
2089 */
Rob Herring6f05afc2017-01-04 10:45:20 -06002090void yyset_lineno (int _line_number )
David Gibsona4da2e32007-12-18 15:06:42 +11002091{
2092
Rob Herring6f05afc2017-01-04 10:45:20 -06002093 yylineno = _line_number;
David Gibsona4da2e32007-12-18 15:06:42 +11002094}
2095
2096/** Set the input stream. This does not discard the current
2097 * input buffer.
Rob Herring6f05afc2017-01-04 10:45:20 -06002098 * @param _in_str A readable stream.
David Gibsona4da2e32007-12-18 15:06:42 +11002099 *
2100 * @see yy_switch_to_buffer
2101 */
Rob Herring6f05afc2017-01-04 10:45:20 -06002102void yyset_in (FILE * _in_str )
David Gibsona4da2e32007-12-18 15:06:42 +11002103{
Rob Herring6f05afc2017-01-04 10:45:20 -06002104 yyin = _in_str ;
David Gibsona4da2e32007-12-18 15:06:42 +11002105}
2106
Rob Herring6f05afc2017-01-04 10:45:20 -06002107void yyset_out (FILE * _out_str )
David Gibsona4da2e32007-12-18 15:06:42 +11002108{
Rob Herring6f05afc2017-01-04 10:45:20 -06002109 yyout = _out_str ;
David Gibsona4da2e32007-12-18 15:06:42 +11002110}
2111
2112int yyget_debug (void)
2113{
2114 return yy_flex_debug;
2115}
2116
Rob Herring6f05afc2017-01-04 10:45:20 -06002117void yyset_debug (int _bdebug )
David Gibsona4da2e32007-12-18 15:06:42 +11002118{
Rob Herring6f05afc2017-01-04 10:45:20 -06002119 yy_flex_debug = _bdebug ;
David Gibsona4da2e32007-12-18 15:06:42 +11002120}
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
Rob Herring6f05afc2017-01-04 10:45:20 -06002128 (yy_buffer_stack) = NULL;
David Gibsona4da2e32007-12-18 15:06:42 +11002129 (yy_buffer_stack_top) = 0;
2130 (yy_buffer_stack_max) = 0;
Rob Herring6f05afc2017-01-04 10:45:20 -06002131 (yy_c_buf_p) = NULL;
David Gibsona4da2e32007-12-18 15:06:42 +11002132 (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
Rob Herring6f05afc2017-01-04 10:45:20 -06002140 yyin = NULL;
2141 yyout = NULL;
David Gibsona4da2e32007-12-18 15:06:42 +11002142#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{
Rob Herring6f05afc2017-01-04 10:45:20 -06002179
2180 int i;
David Gibsona4da2e32007-12-18 15:06:42 +11002181 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{
Rob Herring6f05afc2017-01-04 10:45:20 -06002189 int n;
David Gibsona4da2e32007-12-18 15:06:42 +11002190 for ( n = 0; s[n]; ++n )
2191 ;
2192
2193 return n;
2194}
2195#endif
2196
2197void *yyalloc (yy_size_t size )
2198{
Rob Herring6f05afc2017-01-04 10:45:20 -06002199 return malloc(size);
David Gibsona4da2e32007-12-18 15:06:42 +11002200}
2201
2202void *yyrealloc (void * ptr, yy_size_t size )
2203{
Rob Herring6f05afc2017-01-04 10:45:20 -06002204
David Gibsona4da2e32007-12-18 15:06:42 +11002205 /* 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 */
Rob Herring6f05afc2017-01-04 10:45:20 -06002212 return realloc(ptr, size);
David Gibsona4da2e32007-12-18 15:06:42 +11002213}
2214
2215void yyfree (void * ptr )
2216{
Rob Herring6f05afc2017-01-04 10:45:20 -06002217 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
David Gibsona4da2e32007-12-18 15:06:42 +11002218}
2219
2220#define YYTABLES_NAME "yytables"
2221
Rob Herring89d12312017-03-21 09:01:08 -05002222#line 272 "dtc-lexer.l"
Stephen Warrencd296722012-09-28 21:25:59 +00002223
2224
2225
David Gibsoned95d742008-08-07 12:24:17 +10002226static void push_input_file(const char *filename)
David Gibsona4da2e32007-12-18 15:06:42 +11002227{
David Gibsoned95d742008-08-07 12:24:17 +10002228 assert(filename);
2229
John Bonesio658f29a2010-11-17 15:28:20 -08002230 srcfile_push(filename);
David Gibsoned95d742008-08-07 12:24:17 +10002231
John Bonesio658f29a2010-11-17 15:28:20 -08002232 yyin = current_srcfile->f;
David Gibsona4da2e32007-12-18 15:06:42 +11002233
John Bonesio658f29a2010-11-17 15:28:20 -08002234 yypush_buffer_state(yy_create_buffer(yyin,YY_BUF_SIZE));
David Gibsona4da2e32007-12-18 15:06:42 +11002235}
2236
Stephen Warrencd296722012-09-28 21:25:59 +00002237
Rob Herring47605972015-04-29 16:00:05 -05002238static bool pop_input_file(void)
David Gibsona4da2e32007-12-18 15:06:42 +11002239{
John Bonesio658f29a2010-11-17 15:28:20 -08002240 if (srcfile_pop() == 0)
Rob Herring47605972015-04-29 16:00:05 -05002241 return false;
David Gibsona4da2e32007-12-18 15:06:42 +11002242
John Bonesio658f29a2010-11-17 15:28:20 -08002243 yypop_buffer_state();
2244 yyin = current_srcfile->f;
David Gibsona4da2e32007-12-18 15:06:42 +11002245
Rob Herring47605972015-04-29 16:00:05 -05002246 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;
David Gibsona4da2e32007-12-18 15:06:42 +11002258}
2259