2 #line 3 "scripts/dtc/dtc-lexer.lex.c_shipped"
4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11 #define YY_FLEX_SUBMINOR_VERSION 35
12 #if YY_FLEX_SUBMINOR_VERSION > 0
16 /* First, we deal with platform-specific or compiler-specific issues. */
18 /* begin standard C headers. */
24 /* end standard C headers. */
26 /* flex integer type definitions */
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t;
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
58 /* Limits of integral types. */
60 #define INT8_MIN (-128)
63 #define INT16_MIN (-32767-1)
66 #define INT32_MIN (-2147483647-1)
69 #define INT8_MAX (127)
72 #define INT16_MAX (32767)
75 #define INT32_MAX (2147483647)
78 #define UINT8_MAX (255U)
81 #define UINT16_MAX (65535U)
84 #define UINT32_MAX (4294967295U)
87 #endif /* ! FLEXINT_H */
91 /* The "const" storage-class-modifier is valid. */
94 #else /* ! __cplusplus */
96 /* C99 requires __STDC__ to be defined as 1. */
97 #if defined (__STDC__)
101 #endif /* defined (__STDC__) */
102 #endif /* ! __cplusplus */
105 #define yyconst const
110 /* Returned upon end-of-file. */
113 /* Promotes a possibly negative, possibly signed char to an unsigned
114 * integer for use as an array index. If the signed char is negative,
115 * we want to instead treat it as an 8-bit unsigned char, hence the
118 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120 /* Enter a start condition. This macro really ought to take a parameter,
121 * but we do it the disgusting crufty way forced on us by the ()-less
122 * definition of BEGIN.
124 #define BEGIN (yy_start) = 1 + 2 *
126 /* Translate the current start state into a value that can be later handed
127 * to BEGIN to return to the state. The YYSTATE alias is for lex
130 #define YY_START (((yy_start) - 1) / 2)
131 #define YYSTATE YY_START
133 /* Action number for EOF rule of a given start state. */
134 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
136 /* Special action meaning "start processing a new file". */
137 #define YY_NEW_FILE yyrestart(yyin )
139 #define YY_END_OF_BUFFER_CHAR 0
141 /* Size of default input buffer. */
143 #define YY_BUF_SIZE 16384
146 /* The state buf must be large enough to hold one state per character in the main buffer.
148 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
150 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
151 #define YY_TYPEDEF_YY_BUFFER_STATE
152 typedef struct yy_buffer_state *YY_BUFFER_STATE;
157 extern FILE *yyin, *yyout;
159 #define EOB_ACT_CONTINUE_SCAN 0
160 #define EOB_ACT_END_OF_FILE 1
161 #define EOB_ACT_LAST_MATCH 2
163 #define YY_LESS_LINENO(n)
165 /* Return all but the first "n" matched characters back to the input stream. */
169 /* Undo effects of setting up yytext. */ \
170 int yyless_macro_arg = (n); \
171 YY_LESS_LINENO(yyless_macro_arg);\
172 *yy_cp = (yy_hold_char); \
173 YY_RESTORE_YY_MORE_OFFSET \
174 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
175 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
179 #define unput(c) yyunput( c, (yytext_ptr) )
181 #ifndef YY_TYPEDEF_YY_SIZE_T
182 #define YY_TYPEDEF_YY_SIZE_T
183 typedef size_t yy_size_t;
186 #ifndef YY_STRUCT_YY_BUFFER_STATE
187 #define YY_STRUCT_YY_BUFFER_STATE
188 struct yy_buffer_state
192 char *yy_ch_buf; /* input buffer */
193 char *yy_buf_pos; /* current position in input buffer */
195 /* Size of input buffer in bytes, not including room for EOB
198 yy_size_t yy_buf_size;
200 /* Number of characters read into yy_ch_buf, not including EOB
205 /* Whether we "own" the buffer - i.e., we know we created it,
206 * and can realloc() it to grow it, and should free() it to
209 int yy_is_our_buffer;
211 /* Whether this is an "interactive" input source; if so, and
212 * if we're using stdio for input, then we want to use getc()
213 * instead of fread(), to make sure we stop fetching input after
216 int yy_is_interactive;
218 /* Whether we're considered to be at the beginning of a line.
219 * If so, '^' rules will be active on the next match, otherwise
224 int yy_bs_lineno; /**< The line count. */
225 int yy_bs_column; /**< The column count. */
227 /* Whether to try to fill the input buffer when we reach the
232 int yy_buffer_status;
234 #define YY_BUFFER_NEW 0
235 #define YY_BUFFER_NORMAL 1
236 /* When an EOF's been seen but there's still some text to process
237 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
238 * shouldn't try reading from the input source any more. We might
239 * still have a bunch of tokens to match, though, because of
240 * possible backing-up.
242 * When we actually see the EOF, we change the status to "new"
243 * (via yyrestart()), so that the user can continue scanning by
244 * just pointing yyin at a new input file.
246 #define YY_BUFFER_EOF_PENDING 2
249 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
251 /* Stack of input buffers. */
252 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
253 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
254 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
256 /* We provide macros for accessing buffer states in case in the
257 * future we want to put the buffer states in a more general
260 * Returns the top of the stack, or NULL.
262 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
263 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
266 /* Same as previous macro, but useful when we know that the buffer stack is not
267 * NULL or when we need an lvalue. For internal use only.
269 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
271 /* yy_hold_char holds the character lost when yytext is formed. */
272 static char yy_hold_char;
273 static int yy_n_chars; /* number of characters read into yy_ch_buf */
276 /* Points to current character in buffer. */
277 static char *yy_c_buf_p = (char *) 0;
278 static int yy_init = 0; /* whether we need to initialize */
279 static int yy_start = 0; /* start state number */
281 /* Flag which is used to allow yywrap()'s to do buffer switches
282 * instead of setting up a fresh yyin. A bit of a hack ...
284 static int yy_did_buffer_switch_on_eof;
286 void yyrestart (FILE *input_file );
287 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
288 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
289 void yy_delete_buffer (YY_BUFFER_STATE b );
290 void yy_flush_buffer (YY_BUFFER_STATE b );
291 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
292 void yypop_buffer_state (void );
294 static void yyensure_buffer_stack (void );
295 static void yy_load_buffer_state (void );
296 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
298 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
300 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
301 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
302 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
304 void *yyalloc (yy_size_t );
305 void *yyrealloc (void *,yy_size_t );
306 void yyfree (void * );
308 #define yy_new_buffer yy_create_buffer
310 #define yy_set_interactive(is_interactive) \
312 if ( ! YY_CURRENT_BUFFER ){ \
313 yyensure_buffer_stack (); \
314 YY_CURRENT_BUFFER_LVALUE = \
315 yy_create_buffer(yyin,YY_BUF_SIZE ); \
317 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
320 #define yy_set_bol(at_bol) \
322 if ( ! YY_CURRENT_BUFFER ){\
323 yyensure_buffer_stack (); \
324 YY_CURRENT_BUFFER_LVALUE = \
325 yy_create_buffer(yyin,YY_BUF_SIZE ); \
327 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
330 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
332 /* Begin user sect3 */
335 #define YY_SKIP_YYWRAP
337 typedef unsigned char YY_CHAR;
339 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
341 typedef int yy_state_type;
348 #define yytext_ptr yytext
350 static yy_state_type yy_get_previous_state (void );
351 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
352 static int yy_get_next_buffer (void );
353 static void yy_fatal_error (yyconst char msg[] );
355 /* Done after the current pattern has been matched and before the
356 * corresponding action - sets up yytext.
358 #define YY_DO_BEFORE_ACTION \
359 (yytext_ptr) = yy_bp; \
360 yyleng = (size_t) (yy_cp - yy_bp); \
361 (yy_hold_char) = *yy_cp; \
363 (yy_c_buf_p) = yy_cp;
365 #define YY_NUM_RULES 17
366 #define YY_END_OF_BUFFER 18
367 /* This struct is not used in this scanner,
368 but its presence is necessary. */
371 flex_int32_t yy_verify;
374 static yyconst flex_int16_t yy_accept[94] =
376 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
377 18, 16, 13, 13, 16, 16, 16, 16, 16, 16,
378 16, 10, 11, 11, 6, 6, 13, 0, 2, 0,
379 7, 0, 0, 0, 0, 0, 0, 0, 5, 0,
380 9, 9, 11, 11, 6, 0, 7, 0, 0, 0,
381 0, 15, 0, 0, 0, 0, 6, 0, 14, 0,
382 0, 0, 0, 0, 8, 0, 0, 0, 0, 0,
383 0, 0, 0, 0, 0, 0, 0, 0, 3, 12,
384 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
389 static yyconst flex_int32_t yy_ec[256] =
391 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
392 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 2, 1, 4, 5, 1, 1, 6, 1, 1,
395 1, 7, 5, 5, 8, 5, 9, 10, 11, 12,
396 12, 12, 12, 12, 12, 12, 12, 13, 1, 1,
397 1, 1, 5, 5, 14, 14, 14, 14, 14, 14,
398 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
399 15, 15, 15, 15, 15, 15, 15, 16, 15, 15,
400 1, 17, 18, 1, 15, 1, 14, 19, 20, 21,
402 22, 14, 15, 15, 23, 15, 15, 24, 25, 26,
403 15, 15, 15, 27, 28, 29, 30, 31, 15, 16,
404 15, 15, 32, 1, 33, 1, 1, 1, 1, 1,
405 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 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,
421 static yyconst flex_int32_t yy_meta[34] =
423 1, 1, 1, 1, 2, 1, 2, 2, 3, 4,
424 4, 4, 5, 6, 7, 7, 1, 1, 6, 6,
425 6, 6, 7, 7, 7, 7, 7, 7, 7, 7,
429 static yyconst flex_int16_t yy_base[106] =
431 0, 0, 237, 236, 25, 0, 47, 0, 30, 71,
432 244, 247, 82, 84, 84, 211, 95, 229, 218, 0,
433 111, 247, 0, 84, 83, 95, 106, 86, 247, 237,
434 0, 230, 231, 234, 207, 209, 212, 220, 247, 206,
435 247, 218, 0, 106, 116, 0, 0, 0, 223, 89,
436 226, 219, 199, 206, 200, 204, 0, 190, 213, 212,
437 202, 91, 178, 161, 247, 172, 144, 150, 140, 130,
438 140, 124, 128, 120, 138, 137, 123, 122, 247, 247,
439 134, 114, 132, 86, 135, 125, 90, 136, 247, 97,
440 29, 247, 247, 153, 156, 161, 165, 170, 176, 180,
442 187, 195, 200, 205, 212
445 static yyconst flex_int16_t yy_def[106] =
447 93, 1, 1, 1, 1, 5, 93, 7, 1, 1,
448 93, 93, 93, 93, 94, 95, 93, 96, 17, 97,
449 96, 93, 98, 99, 93, 93, 93, 94, 93, 94,
450 100, 93, 101, 102, 93, 93, 93, 96, 93, 93,
451 93, 96, 98, 99, 93, 103, 100, 104, 101, 101,
452 102, 93, 93, 93, 93, 93, 103, 104, 93, 93,
453 93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
454 93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
455 93, 93, 93, 93, 93, 105, 93, 105, 93, 105,
456 93, 93, 0, 93, 93, 93, 93, 93, 93, 93,
461 static yyconst flex_int16_t yy_nxt[281] =
463 12, 13, 14, 15, 12, 16, 12, 12, 17, 12,
464 12, 12, 12, 18, 18, 18, 12, 12, 18, 18,
465 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
466 18, 12, 12, 19, 20, 20, 20, 92, 21, 25,
467 26, 26, 22, 21, 21, 21, 21, 12, 13, 14,
468 15, 23, 16, 23, 23, 19, 23, 23, 23, 12,
469 24, 24, 24, 12, 12, 24, 24, 24, 24, 24,
470 24, 24, 24, 24, 24, 24, 24, 24, 12, 12,
471 25, 26, 26, 27, 27, 27, 27, 29, 43, 29,
472 43, 43, 45, 45, 45, 50, 39, 59, 46, 93,
474 30, 33, 30, 34, 45, 45, 45, 27, 27, 68,
475 43, 91, 43, 43, 69, 35, 87, 36, 39, 37,
476 42, 42, 42, 39, 42, 45, 45, 45, 89, 42,
477 42, 42, 42, 85, 85, 86, 85, 85, 86, 89,
478 84, 90, 83, 82, 81, 80, 79, 78, 77, 76,
479 75, 74, 90, 28, 28, 28, 28, 28, 28, 28,
480 28, 31, 31, 31, 38, 38, 38, 38, 41, 73,
481 41, 43, 72, 43, 71, 43, 43, 44, 33, 44,
482 44, 44, 44, 47, 69, 47, 47, 49, 49, 49,
483 49, 49, 49, 49, 49, 51, 51, 51, 51, 51,
485 51, 51, 51, 57, 70, 57, 58, 58, 58, 67,
486 58, 58, 88, 88, 88, 88, 88, 88, 88, 88,
487 34, 66, 65, 64, 63, 62, 61, 60, 52, 50,
488 39, 56, 39, 55, 54, 53, 52, 50, 48, 93,
489 40, 39, 32, 93, 19, 19, 11, 93, 93, 93,
490 93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
491 93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
492 93, 93, 93, 93, 93, 93, 93, 93, 93, 93
495 static yyconst flex_int16_t yy_chk[281] =
497 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
498 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
499 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
500 1, 1, 1, 5, 5, 5, 5, 91, 5, 9,
501 9, 9, 5, 5, 5, 5, 5, 7, 7, 7,
502 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
503 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
504 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
505 10, 10, 10, 13, 13, 14, 14, 15, 24, 28,
506 24, 24, 25, 25, 25, 50, 24, 50, 25, 90,
508 15, 17, 28, 17, 26, 26, 26, 27, 27, 62,
509 44, 87, 44, 44, 62, 17, 84, 17, 44, 17,
510 21, 21, 21, 21, 21, 45, 45, 45, 86, 21,
511 21, 21, 21, 83, 83, 83, 85, 85, 85, 88,
512 82, 86, 81, 78, 77, 76, 75, 74, 73, 72,
513 71, 70, 88, 94, 94, 94, 94, 94, 94, 94,
514 94, 95, 95, 95, 96, 96, 96, 96, 97, 69,
515 97, 98, 68, 98, 67, 98, 98, 99, 66, 99,
516 99, 99, 99, 100, 64, 100, 100, 101, 101, 101,
517 101, 101, 101, 101, 101, 102, 102, 102, 102, 102,
519 102, 102, 102, 103, 63, 103, 104, 104, 104, 61,
520 104, 104, 105, 105, 105, 105, 105, 105, 105, 105,
521 60, 59, 58, 56, 55, 54, 53, 52, 51, 49,
522 42, 40, 38, 37, 36, 35, 34, 33, 32, 30,
523 19, 18, 16, 11, 4, 3, 93, 93, 93, 93,
524 93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
525 93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
526 93, 93, 93, 93, 93, 93, 93, 93, 93, 93
529 static yy_state_type yy_last_accepting_state;
530 static char *yy_last_accepting_cpos;
532 extern int yy_flex_debug;
533 int yy_flex_debug = 0;
535 /* The intent behind this definition is that it'll catch
536 * any uses of REJECT which flex missed.
538 #define REJECT reject_used_but_not_detected
539 #define yymore() yymore_used_but_not_detected
540 #define YY_MORE_ADJ 0
541 #define YY_RESTORE_YY_MORE_OFFSET
544 * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005.
547 * This program is free software; you can redistribute it and/or
548 * modify it under the terms of the GNU General Public License as
549 * published by the Free Software Foundation; either version 2 of the
550 * License, or (at your option) any later version.
552 * This program is distributed in the hope that it will be useful,
553 * but WITHOUT ANY WARRANTY; without even the implied warranty of
554 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
555 * General Public License for more details.
557 * You should have received a copy of the GNU General Public License
558 * along with this program; if not, write to the Free Software
559 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
562 #define YY_NO_INPUT 1
566 #include "dtc-parser.tab.h"
570 /* CAUTION: this will stop working if we ever use yyless() or yyunput() */
571 #define YY_USER_ACTION \
573 srcpos_update(&yylloc, yytext, yyleng); \
576 /*#define LEXDEBUG 1*/
579 #define DPRINT(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
581 #define DPRINT(fmt, ...) do { } while (0)
584 static int dts_version = 1;
586 #define BEGIN_DEFAULT() DPRINT("<V1>\n"); \
589 static void push_input_file(const char *filename);
590 static int pop_input_file(void);
595 #define PROPNODENAME 3
598 #ifndef YY_NO_UNISTD_H
599 /* Special case for "unistd.h", since it is non-ANSI. We include it way
600 * down here because we want the user's section 1 to have been scanned first.
601 * The user has a chance to override it with an option.
606 #ifndef YY_EXTRA_TYPE
607 #define YY_EXTRA_TYPE void *
610 static int yy_init_globals (void );
612 /* Accessor methods to globals.
613 These are made visible to non-reentrant scanners for convenience. */
615 int yylex_destroy (void );
617 int yyget_debug (void );
619 void yyset_debug (int debug_flag );
621 YY_EXTRA_TYPE yyget_extra (void );
623 void yyset_extra (YY_EXTRA_TYPE user_defined );
625 FILE *yyget_in (void );
627 void yyset_in (FILE * in_str );
629 FILE *yyget_out (void );
631 void yyset_out (FILE * out_str );
633 int yyget_leng (void );
635 char *yyget_text (void );
637 int yyget_lineno (void );
639 void yyset_lineno (int line_number );
641 /* Macros after this point can all be overridden by user definitions in
645 #ifndef YY_SKIP_YYWRAP
647 extern "C" int yywrap (void );
649 extern int yywrap (void );
654 static void yy_flex_strncpy (char *,yyconst char *,int );
657 #ifdef YY_NEED_STRLEN
658 static int yy_flex_strlen (yyconst char * );
664 static int yyinput (void );
666 static int input (void );
671 /* Amount of stuff to slurp up with each read. */
672 #ifndef YY_READ_BUF_SIZE
673 #define YY_READ_BUF_SIZE 8192
676 /* Copy whatever the last rule matched to the standard output. */
678 /* This used to be an fputs(), but since the string might contain NUL's,
679 * we now use fwrite().
681 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
684 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
685 * is returned in "result".
688 #define YY_INPUT(buf,result,max_size) \
689 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
693 for ( n = 0; n < max_size && \
694 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
697 buf[n++] = (char) c; \
698 if ( c == EOF && ferror( yyin ) ) \
699 YY_FATAL_ERROR( "input in flex scanner failed" ); \
705 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
707 if( errno != EINTR) \
709 YY_FATAL_ERROR( "input in flex scanner failed" ); \
720 /* No semi-colon after return; correct usage is to write "yyterminate();" -
721 * we don't want an extra ';' after the "return" because that will cause
722 * some compilers to complain about unreachable statements.
725 #define yyterminate() return YY_NULL
728 /* Number of entries by which start-condition stack grows. */
729 #ifndef YY_START_STACK_INCR
730 #define YY_START_STACK_INCR 25
733 /* Report a fatal error. */
734 #ifndef YY_FATAL_ERROR
735 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
738 /* end tables serialization structures and prototypes */
740 /* Default declaration of generated scanner - a define so the user can
741 * easily add parameters.
744 #define YY_DECL_IS_OURS 1
746 extern int yylex (void);
748 #define YY_DECL int yylex (void)
749 #endif /* !YY_DECL */
751 /* Code executed at the beginning of each rule, after yytext and yyleng
754 #ifndef YY_USER_ACTION
755 #define YY_USER_ACTION
758 /* Code executed at the end of each rule. */
760 #define YY_BREAK break;
763 #define YY_RULE_SETUP \
766 /** The main scanner function which does all the work.
770 register yy_state_type yy_current_state;
771 register char *yy_cp, *yy_bp;
783 (yy_start) = 1; /* first start state */
791 if ( ! YY_CURRENT_BUFFER ) {
792 yyensure_buffer_stack ();
793 YY_CURRENT_BUFFER_LVALUE =
794 yy_create_buffer(yyin,YY_BUF_SIZE );
797 yy_load_buffer_state( );
800 while ( 1 ) /* loops until end-of-file is reached */
802 yy_cp = (yy_c_buf_p);
804 /* Support of yytext. */
805 *yy_cp = (yy_hold_char);
807 /* yy_bp points to the position in yy_ch_buf of the start of
812 yy_current_state = (yy_start);
816 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
817 if ( yy_accept[yy_current_state] )
819 (yy_last_accepting_state) = yy_current_state;
820 (yy_last_accepting_cpos) = yy_cp;
822 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
824 yy_current_state = (int) yy_def[yy_current_state];
825 if ( yy_current_state >= 94 )
826 yy_c = yy_meta[(unsigned int) yy_c];
828 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
831 while ( yy_current_state != 93 );
832 yy_cp = (yy_last_accepting_cpos);
833 yy_current_state = (yy_last_accepting_state);
836 yy_act = yy_accept[yy_current_state];
840 do_action: /* This label is used only to access EOF actions. */
843 { /* beginning of action switch */
844 case 0: /* must back up */
845 /* undo the effects of YY_DO_BEFORE_ACTION */
846 *yy_cp = (yy_hold_char);
847 yy_cp = (yy_last_accepting_cpos);
848 yy_current_state = (yy_last_accepting_state);
852 /* rule 1 can match eol */
855 char *name = strchr(yytext, '\"') + 1;
856 yytext[yyleng-1] = '\0';
857 push_input_file(name);
860 case YY_STATE_EOF(INITIAL):
861 case YY_STATE_EOF(INCLUDE):
862 case YY_STATE_EOF(BYTESTRING):
863 case YY_STATE_EOF(PROPNODENAME):
864 case YY_STATE_EOF(V1):
866 if (!pop_input_file()) {
872 /* rule 2 can match eol */
875 DPRINT("String: %s\n", yytext);
876 yylval.data = data_copy_escape_string(yytext+1,
884 DPRINT("Keyword: /dts-v1/\n");
893 DPRINT("Keyword: /memreserve/\n");
895 return DT_MEMRESERVE;
901 DPRINT("Label: %s\n", yytext);
902 yylval.labelref = xstrdup(yytext);
903 yylval.labelref[yyleng-1] = '\0';
910 yylval.literal = xstrdup(yytext);
911 DPRINT("Literal: '%s'\n", yylval.literal);
917 { /* label reference */
918 DPRINT("Ref: %s\n", yytext+1);
919 yylval.labelref = xstrdup(yytext+1);
925 { /* new-style path reference */
926 yytext[yyleng-1] = '\0';
927 DPRINT("Ref: %s\n", yytext+2);
928 yylval.labelref = xstrdup(yytext+2);
935 yylval.byte = strtol(yytext, NULL, 16);
936 DPRINT("Byte: %02x\n", (int)yylval.byte);
943 DPRINT("/BYTESTRING\n");
951 DPRINT("PropNodeName: %s\n", yytext);
952 yylval.propnodename = xstrdup(yytext);
954 return DT_PROPNODENAME;
960 DPRINT("Binary Include\n");
965 /* rule 13 can match eol */
970 /* rule 14 can match eol */
972 /* eat C-style comments */
975 /* rule 15 can match eol */
977 /* eat C++-style comments */
982 DPRINT("Char: %c (\\x%02x)\n", yytext[0],
983 (unsigned)yytext[0]);
984 if (yytext[0] == '[') {
985 DPRINT("<BYTESTRING>\n");
988 if ((yytext[0] == '{')
989 || (yytext[0] == ';')) {
990 DPRINT("<PROPNODENAME>\n");
1001 case YY_END_OF_BUFFER:
1003 /* Amount of text matched not including the EOB char. */
1004 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1006 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1007 *yy_cp = (yy_hold_char);
1008 YY_RESTORE_YY_MORE_OFFSET
1010 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1012 /* We're scanning a new file or input source. It's
1013 * possible that this happened because the user
1014 * just pointed yyin at a new source and called
1015 * yylex(). If so, then we have to assure
1016 * consistency between YY_CURRENT_BUFFER and our
1017 * globals. Here is the right place to do so, because
1018 * this is the first action (other than possibly a
1019 * back-up) that will match for the new input source.
1021 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1022 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1023 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1026 /* Note that here we test for yy_c_buf_p "<=" to the position
1027 * of the first EOB in the buffer, since yy_c_buf_p will
1028 * already have been incremented past the NUL character
1029 * (since all states make transitions on EOB to the
1030 * end-of-buffer state). Contrast this with the test
1033 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1034 { /* This was really a NUL. */
1035 yy_state_type yy_next_state;
1037 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1039 yy_current_state = yy_get_previous_state( );
1041 /* Okay, we're now positioned to make the NUL
1042 * transition. We couldn't have
1043 * yy_get_previous_state() go ahead and do it
1044 * for us because it doesn't know how to deal
1045 * with the possibility of jamming (and we don't
1046 * want to build jamming into it because then it
1047 * will run more slowly).
1050 yy_next_state = yy_try_NUL_trans( yy_current_state );
1052 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1054 if ( yy_next_state )
1056 /* Consume the NUL. */
1057 yy_cp = ++(yy_c_buf_p);
1058 yy_current_state = yy_next_state;
1064 yy_cp = (yy_last_accepting_cpos);
1065 yy_current_state = (yy_last_accepting_state);
1066 goto yy_find_action;
1070 else switch ( yy_get_next_buffer( ) )
1072 case EOB_ACT_END_OF_FILE:
1074 (yy_did_buffer_switch_on_eof) = 0;
1078 /* Note: because we've taken care in
1079 * yy_get_next_buffer() to have set up
1080 * yytext, we can now set up
1081 * yy_c_buf_p so that if some total
1082 * hoser (like flex itself) wants to
1083 * call the scanner after we return the
1084 * YY_NULL, it'll still work - another
1085 * YY_NULL will get returned.
1087 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1089 yy_act = YY_STATE_EOF(YY_START);
1095 if ( ! (yy_did_buffer_switch_on_eof) )
1101 case EOB_ACT_CONTINUE_SCAN:
1103 (yytext_ptr) + yy_amount_of_matched_text;
1105 yy_current_state = yy_get_previous_state( );
1107 yy_cp = (yy_c_buf_p);
1108 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1111 case EOB_ACT_LAST_MATCH:
1113 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1115 yy_current_state = yy_get_previous_state( );
1117 yy_cp = (yy_c_buf_p);
1118 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1119 goto yy_find_action;
1126 "fatal flex scanner internal error--no action found" );
1127 } /* end of action switch */
1128 } /* end of scanning one token */
1129 } /* end of yylex */
1131 /* yy_get_next_buffer - try to read in a new buffer
1133 * Returns a code representing an action:
1134 * EOB_ACT_LAST_MATCH -
1135 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1136 * EOB_ACT_END_OF_FILE - end of file
1138 static int yy_get_next_buffer (void)
1140 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1141 register char *source = (yytext_ptr);
1142 register int number_to_move, i;
1145 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1147 "fatal flex scanner internal error--end of buffer missed" );
1149 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1150 { /* Don't try to fill the buffer, so this is an EOF. */
1151 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1153 /* We matched a single character, the EOB, so
1154 * treat this as a final EOF.
1156 return EOB_ACT_END_OF_FILE;
1161 /* We matched some text prior to the EOB, first
1164 return EOB_ACT_LAST_MATCH;
1168 /* Try to read more data. */
1170 /* First move last chars to start of buffer. */
1171 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1173 for ( i = 0; i < number_to_move; ++i )
1174 *(dest++) = *(source++);
1176 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1177 /* don't do the read, it's not guaranteed to return an EOF,
1180 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1185 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1187 while ( num_to_read <= 0 )
1188 { /* Not enough room in the buffer - grow it. */
1190 /* just a shorter name for the current buffer */
1191 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1193 int yy_c_buf_p_offset =
1194 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1196 if ( b->yy_is_our_buffer )
1198 int new_size = b->yy_buf_size * 2;
1200 if ( new_size <= 0 )
1201 b->yy_buf_size += b->yy_buf_size / 8;
1203 b->yy_buf_size *= 2;
1205 b->yy_ch_buf = (char *)
1206 /* Include room in for 2 EOB chars. */
1207 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1210 /* Can't grow it, we don't own it. */
1213 if ( ! b->yy_ch_buf )
1215 "fatal error - scanner input buffer overflow" );
1217 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1219 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1224 if ( num_to_read > YY_READ_BUF_SIZE )
1225 num_to_read = YY_READ_BUF_SIZE;
1227 /* Read in more data. */
1228 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1229 (yy_n_chars), (size_t) num_to_read );
1231 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1234 if ( (yy_n_chars) == 0 )
1236 if ( number_to_move == YY_MORE_ADJ )
1238 ret_val = EOB_ACT_END_OF_FILE;
1244 ret_val = EOB_ACT_LAST_MATCH;
1245 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1246 YY_BUFFER_EOF_PENDING;
1251 ret_val = EOB_ACT_CONTINUE_SCAN;
1253 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1254 /* Extend the array by 50%, plus the number we really need. */
1255 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1256 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1257 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1258 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1261 (yy_n_chars) += number_to_move;
1262 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1263 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1265 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1270 /* yy_get_previous_state - get the state just before the EOB char was reached */
1272 static yy_state_type yy_get_previous_state (void)
1274 register yy_state_type yy_current_state;
1275 register char *yy_cp;
1277 yy_current_state = (yy_start);
1279 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1281 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1282 if ( yy_accept[yy_current_state] )
1284 (yy_last_accepting_state) = yy_current_state;
1285 (yy_last_accepting_cpos) = yy_cp;
1287 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1289 yy_current_state = (int) yy_def[yy_current_state];
1290 if ( yy_current_state >= 94 )
1291 yy_c = yy_meta[(unsigned int) yy_c];
1293 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1296 return yy_current_state;
1299 /* yy_try_NUL_trans - try to make a transition on the NUL character
1302 * next_state = yy_try_NUL_trans( current_state );
1304 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1306 register int yy_is_jam;
1307 register char *yy_cp = (yy_c_buf_p);
1309 register YY_CHAR yy_c = 1;
1310 if ( yy_accept[yy_current_state] )
1312 (yy_last_accepting_state) = yy_current_state;
1313 (yy_last_accepting_cpos) = yy_cp;
1315 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1317 yy_current_state = (int) yy_def[yy_current_state];
1318 if ( yy_current_state >= 94 )
1319 yy_c = yy_meta[(unsigned int) yy_c];
1321 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1322 yy_is_jam = (yy_current_state == 93);
1324 return yy_is_jam ? 0 : yy_current_state;
1329 static int yyinput (void)
1331 static int input (void)
1337 *(yy_c_buf_p) = (yy_hold_char);
1339 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1341 /* yy_c_buf_p now points to the character we want to return.
1342 * If this occurs *before* the EOB characters, then it's a
1343 * valid NUL; if not, then we've hit the end of the buffer.
1345 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1346 /* This was really a NUL. */
1347 *(yy_c_buf_p) = '\0';
1350 { /* need more input */
1351 int offset = (yy_c_buf_p) - (yytext_ptr);
1354 switch ( yy_get_next_buffer( ) )
1356 case EOB_ACT_LAST_MATCH:
1357 /* This happens because yy_g_n_b()
1358 * sees that we've accumulated a
1359 * token and flags that we need to
1360 * try matching the token before
1361 * proceeding. But for input(),
1362 * there's no matching to consider.
1363 * So convert the EOB_ACT_LAST_MATCH
1364 * to EOB_ACT_END_OF_FILE.
1367 /* Reset buffer status. */
1372 case EOB_ACT_END_OF_FILE:
1377 if ( ! (yy_did_buffer_switch_on_eof) )
1386 case EOB_ACT_CONTINUE_SCAN:
1387 (yy_c_buf_p) = (yytext_ptr) + offset;
1393 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1394 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1395 (yy_hold_char) = *++(yy_c_buf_p);
1399 #endif /* ifndef YY_NO_INPUT */
1401 /** Immediately switch to a different input stream.
1402 * @param input_file A readable stream.
1404 * @note This function does not reset the start condition to @c INITIAL .
1406 void yyrestart (FILE * input_file )
1409 if ( ! YY_CURRENT_BUFFER ){
1410 yyensure_buffer_stack ();
1411 YY_CURRENT_BUFFER_LVALUE =
1412 yy_create_buffer(yyin,YY_BUF_SIZE );
1415 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1416 yy_load_buffer_state( );
1419 /** Switch to a different input buffer.
1420 * @param new_buffer The new input buffer.
1423 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1426 /* TODO. We should be able to replace this entire function body
1428 * yypop_buffer_state();
1429 * yypush_buffer_state(new_buffer);
1431 yyensure_buffer_stack ();
1432 if ( YY_CURRENT_BUFFER == new_buffer )
1435 if ( YY_CURRENT_BUFFER )
1437 /* Flush out information for old buffer. */
1438 *(yy_c_buf_p) = (yy_hold_char);
1439 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1440 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1443 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1444 yy_load_buffer_state( );
1446 /* We don't actually know whether we did this switch during
1447 * EOF (yywrap()) processing, but the only time this flag
1448 * is looked at is after yywrap() is called, so it's safe
1449 * to go ahead and always set it.
1451 (yy_did_buffer_switch_on_eof) = 1;
1454 static void yy_load_buffer_state (void)
1456 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1457 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1458 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1459 (yy_hold_char) = *(yy_c_buf_p);
1462 /** Allocate and initialize an input buffer state.
1463 * @param file A readable stream.
1464 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1466 * @return the allocated buffer state.
1468 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1472 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1474 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1476 b->yy_buf_size = size;
1478 /* yy_ch_buf has to be 2 characters longer than the size given because
1479 * we need to put in 2 end-of-buffer characters.
1481 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1482 if ( ! b->yy_ch_buf )
1483 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1485 b->yy_is_our_buffer = 1;
1487 yy_init_buffer(b,file );
1492 /** Destroy the buffer.
1493 * @param b a buffer created with yy_create_buffer()
1496 void yy_delete_buffer (YY_BUFFER_STATE b )
1502 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1503 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1505 if ( b->yy_is_our_buffer )
1506 yyfree((void *) b->yy_ch_buf );
1508 yyfree((void *) b );
1511 /* Initializes or reinitializes a buffer.
1512 * This function is sometimes called more than once on the same buffer,
1513 * such as during a yyrestart() or at EOF.
1515 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1520 yy_flush_buffer(b );
1522 b->yy_input_file = file;
1523 b->yy_fill_buffer = 1;
1525 /* If b is the current buffer, then yy_init_buffer was _probably_
1526 * called from yyrestart() or through yy_get_next_buffer.
1527 * In that case, we don't want to reset the lineno or column.
1529 if (b != YY_CURRENT_BUFFER){
1530 b->yy_bs_lineno = 1;
1531 b->yy_bs_column = 0;
1534 b->yy_is_interactive = 0;
1539 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1540 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1543 void yy_flush_buffer (YY_BUFFER_STATE b )
1550 /* We always need two end-of-buffer characters. The first causes
1551 * a transition to the end-of-buffer state. The second causes
1552 * a jam in that state.
1554 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1555 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1557 b->yy_buf_pos = &b->yy_ch_buf[0];
1560 b->yy_buffer_status = YY_BUFFER_NEW;
1562 if ( b == YY_CURRENT_BUFFER )
1563 yy_load_buffer_state( );
1566 /** Pushes the new state onto the stack. The new state becomes
1567 * the current state. This function will allocate the stack
1569 * @param new_buffer The new state.
1572 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1574 if (new_buffer == NULL)
1577 yyensure_buffer_stack();
1579 /* This block is copied from yy_switch_to_buffer. */
1580 if ( YY_CURRENT_BUFFER )
1582 /* Flush out information for old buffer. */
1583 *(yy_c_buf_p) = (yy_hold_char);
1584 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1585 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1588 /* Only push if top exists. Otherwise, replace top. */
1589 if (YY_CURRENT_BUFFER)
1590 (yy_buffer_stack_top)++;
1591 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1593 /* copied from yy_switch_to_buffer. */
1594 yy_load_buffer_state( );
1595 (yy_did_buffer_switch_on_eof) = 1;
1598 /** Removes and deletes the top of the stack, if present.
1599 * The next element becomes the new top.
1602 void yypop_buffer_state (void)
1604 if (!YY_CURRENT_BUFFER)
1607 yy_delete_buffer(YY_CURRENT_BUFFER );
1608 YY_CURRENT_BUFFER_LVALUE = NULL;
1609 if ((yy_buffer_stack_top) > 0)
1610 --(yy_buffer_stack_top);
1612 if (YY_CURRENT_BUFFER) {
1613 yy_load_buffer_state( );
1614 (yy_did_buffer_switch_on_eof) = 1;
1618 /* Allocates the stack if it does not exist.
1619 * Guarantees space for at least one push.
1621 static void yyensure_buffer_stack (void)
1625 if (!(yy_buffer_stack)) {
1627 /* First allocation is just for 2 elements, since we don't know if this
1628 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1629 * immediate realloc on the next call.
1632 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1633 (num_to_alloc * sizeof(struct yy_buffer_state*)
1635 if ( ! (yy_buffer_stack) )
1636 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1638 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1640 (yy_buffer_stack_max) = num_to_alloc;
1641 (yy_buffer_stack_top) = 0;
1645 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1647 /* Increase the buffer to prepare for a possible push. */
1648 int grow_size = 8 /* arbitrary grow size */;
1650 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1651 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1653 num_to_alloc * sizeof(struct yy_buffer_state*)
1655 if ( ! (yy_buffer_stack) )
1656 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1658 /* zero only the new slots.*/
1659 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1660 (yy_buffer_stack_max) = num_to_alloc;
1664 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1665 * @param base the character buffer
1666 * @param size the size in bytes of the character buffer
1668 * @return the newly allocated buffer state object.
1670 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1675 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1676 base[size-1] != YY_END_OF_BUFFER_CHAR )
1677 /* They forgot to leave room for the EOB's. */
1680 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1682 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1684 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1685 b->yy_buf_pos = b->yy_ch_buf = base;
1686 b->yy_is_our_buffer = 0;
1687 b->yy_input_file = 0;
1688 b->yy_n_chars = b->yy_buf_size;
1689 b->yy_is_interactive = 0;
1691 b->yy_fill_buffer = 0;
1692 b->yy_buffer_status = YY_BUFFER_NEW;
1694 yy_switch_to_buffer(b );
1699 /** Setup the input buffer state to scan a string. The next call to yylex() will
1700 * scan from a @e copy of @a str.
1701 * @param yystr a NUL-terminated string to scan
1703 * @return the newly allocated buffer state object.
1704 * @note If you want to scan bytes that may contain NUL values, then use
1705 * yy_scan_bytes() instead.
1707 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1710 return yy_scan_bytes(yystr,strlen(yystr) );
1713 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1714 * scan from a @e copy of @a bytes.
1715 * @param bytes the byte buffer to scan
1716 * @param len the number of bytes in the buffer pointed to by @a bytes.
1718 * @return the newly allocated buffer state object.
1720 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1727 /* Get memory for full buffer, including space for trailing EOB's. */
1728 n = _yybytes_len + 2;
1729 buf = (char *) yyalloc(n );
1731 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1733 for ( i = 0; i < _yybytes_len; ++i )
1734 buf[i] = yybytes[i];
1736 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1738 b = yy_scan_buffer(buf,n );
1740 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1742 /* It's okay to grow etc. this buffer, and we should throw it
1743 * away when we're done.
1745 b->yy_is_our_buffer = 1;
1750 #ifndef YY_EXIT_FAILURE
1751 #define YY_EXIT_FAILURE 2
1754 static void yy_fatal_error (yyconst char* msg )
1756 (void) fprintf( stderr, "%s\n", msg );
1757 exit( YY_EXIT_FAILURE );
1760 /* Redefine yyless() so it works in section 3 code. */
1766 /* Undo effects of setting up yytext. */ \
1767 int yyless_macro_arg = (n); \
1768 YY_LESS_LINENO(yyless_macro_arg);\
1769 yytext[yyleng] = (yy_hold_char); \
1770 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1771 (yy_hold_char) = *(yy_c_buf_p); \
1772 *(yy_c_buf_p) = '\0'; \
1773 yyleng = yyless_macro_arg; \
1777 /* Accessor methods (get/set functions) to struct members. */
1779 /** Get the current line number.
1782 int yyget_lineno (void)
1788 /** Get the input stream.
1791 FILE *yyget_in (void)
1796 /** Get the output stream.
1799 FILE *yyget_out (void)
1804 /** Get the length of the current token.
1807 int yyget_leng (void)
1812 /** Get the current token.
1816 char *yyget_text (void)
1821 /** Set the current line number.
1822 * @param line_number
1825 void yyset_lineno (int line_number )
1828 yylineno = line_number;
1831 /** Set the input stream. This does not discard the current
1833 * @param in_str A readable stream.
1835 * @see yy_switch_to_buffer
1837 void yyset_in (FILE * in_str )
1842 void yyset_out (FILE * out_str )
1847 int yyget_debug (void)
1849 return yy_flex_debug;
1852 void yyset_debug (int bdebug )
1854 yy_flex_debug = bdebug ;
1857 static int yy_init_globals (void)
1859 /* Initialization is the same as for the non-reentrant scanner.
1860 * This function is called from yylex_destroy(), so don't allocate here.
1863 (yy_buffer_stack) = 0;
1864 (yy_buffer_stack_top) = 0;
1865 (yy_buffer_stack_max) = 0;
1866 (yy_c_buf_p) = (char *) 0;
1870 /* Defined in main.c */
1879 /* For future reference: Set errno on error, since we are called by
1885 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1886 int yylex_destroy (void)
1889 /* Pop the buffer stack, destroying each element. */
1890 while(YY_CURRENT_BUFFER){
1891 yy_delete_buffer(YY_CURRENT_BUFFER );
1892 YY_CURRENT_BUFFER_LVALUE = NULL;
1893 yypop_buffer_state();
1896 /* Destroy the stack itself. */
1897 yyfree((yy_buffer_stack) );
1898 (yy_buffer_stack) = NULL;
1900 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1901 * yylex() is called, initialization will occur. */
1908 * Internal utility routines.
1912 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1915 for ( i = 0; i < n; ++i )
1920 #ifdef YY_NEED_STRLEN
1921 static int yy_flex_strlen (yyconst char * s )
1924 for ( n = 0; s[n]; ++n )
1931 void *yyalloc (yy_size_t size )
1933 return (void *) malloc( size );
1936 void *yyrealloc (void * ptr, yy_size_t size )
1938 /* The cast to (char *) in the following accommodates both
1939 * implementations that use char* generic pointers, and those
1940 * that use void* generic pointers. It works with the latter
1941 * because both ANSI C and C++ allow castless assignment from
1942 * any pointer type to void*, and deal with argument conversions
1943 * as though doing an assignment.
1945 return (void *) realloc( (char *) ptr, size );
1948 void yyfree (void * ptr )
1950 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1953 #define YYTABLES_NAME "yytables"
1955 static void push_input_file(const char *filename)
1959 srcfile_push(filename);
1961 yyin = current_srcfile->f;
1963 yypush_buffer_state(yy_create_buffer(yyin,YY_BUF_SIZE));
1966 static int pop_input_file(void)
1968 if (srcfile_pop() == 0)
1971 yypop_buffer_state();
1972 yyin = current_srcfile->f;