2 #line 3 "/home/svens/coreboot/coreboot-svn/util/sconfig/lex.yy.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;
57 /* Limits of integral types. */
59 #define INT8_MIN (-128)
62 #define INT16_MIN (-32767-1)
65 #define INT32_MIN (-2147483647-1)
68 #define INT8_MAX (127)
71 #define INT16_MAX (32767)
74 #define INT32_MAX (2147483647)
77 #define UINT8_MAX (255U)
80 #define UINT16_MAX (65535U)
83 #define UINT32_MAX (4294967295U)
88 #endif /* ! FLEXINT_H */
92 /* The "const" storage-class-modifier is valid. */
95 #else /* ! __cplusplus */
97 /* C99 requires __STDC__ to be defined as 1. */
98 #if defined (__STDC__)
102 #endif /* defined (__STDC__) */
103 #endif /* ! __cplusplus */
106 #define yyconst const
111 /* Returned upon end-of-file. */
114 /* Promotes a possibly negative, possibly signed char to an unsigned
115 * integer for use as an array index. If the signed char is negative,
116 * we want to instead treat it as an 8-bit unsigned char, hence the
119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
121 /* Enter a start condition. This macro really ought to take a parameter,
122 * but we do it the disgusting crufty way forced on us by the ()-less
123 * definition of BEGIN.
125 #define BEGIN (yy_start) = 1 + 2 *
127 /* Translate the current start state into a value that can be later handed
128 * to BEGIN to return to the state. The YYSTATE alias is for lex
131 #define YY_START (((yy_start) - 1) / 2)
132 #define YYSTATE YY_START
134 /* Action number for EOF rule of a given start state. */
135 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
137 /* Special action meaning "start processing a new file". */
138 #define YY_NEW_FILE yyrestart(yyin )
140 #define YY_END_OF_BUFFER_CHAR 0
142 /* Size of default input buffer. */
145 /* On IA-64, the buffer size is 16k, not 8k.
146 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
147 * Ditto for the __ia64__ case accordingly.
149 #define YY_BUF_SIZE 32768
151 #define YY_BUF_SIZE 16384
152 #endif /* __ia64__ */
155 /* The state buf must be large enough to hold one state per character in the main buffer.
157 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
159 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
160 #define YY_TYPEDEF_YY_BUFFER_STATE
161 typedef struct yy_buffer_state *YY_BUFFER_STATE;
166 extern FILE *yyin, *yyout;
168 #define EOB_ACT_CONTINUE_SCAN 0
169 #define EOB_ACT_END_OF_FILE 1
170 #define EOB_ACT_LAST_MATCH 2
172 #define YY_LESS_LINENO(n)
174 /* Return all but the first "n" matched characters back to the input stream. */
178 /* Undo effects of setting up yytext. */ \
179 int yyless_macro_arg = (n); \
180 YY_LESS_LINENO(yyless_macro_arg);\
181 *yy_cp = (yy_hold_char); \
182 YY_RESTORE_YY_MORE_OFFSET \
183 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
184 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
188 #define unput(c) yyunput( c, (yytext_ptr) )
190 #ifndef YY_TYPEDEF_YY_SIZE_T
191 #define YY_TYPEDEF_YY_SIZE_T
192 typedef size_t yy_size_t;
195 #ifndef YY_STRUCT_YY_BUFFER_STATE
196 #define YY_STRUCT_YY_BUFFER_STATE
197 struct yy_buffer_state
201 char *yy_ch_buf; /* input buffer */
202 char *yy_buf_pos; /* current position in input buffer */
204 /* Size of input buffer in bytes, not including room for EOB
207 yy_size_t yy_buf_size;
209 /* Number of characters read into yy_ch_buf, not including EOB
214 /* Whether we "own" the buffer - i.e., we know we created it,
215 * and can realloc() it to grow it, and should free() it to
218 int yy_is_our_buffer;
220 /* Whether this is an "interactive" input source; if so, and
221 * if we're using stdio for input, then we want to use getc()
222 * instead of fread(), to make sure we stop fetching input after
225 int yy_is_interactive;
227 /* Whether we're considered to be at the beginning of a line.
228 * If so, '^' rules will be active on the next match, otherwise
233 int yy_bs_lineno; /**< The line count. */
234 int yy_bs_column; /**< The column count. */
236 /* Whether to try to fill the input buffer when we reach the
241 int yy_buffer_status;
243 #define YY_BUFFER_NEW 0
244 #define YY_BUFFER_NORMAL 1
245 /* When an EOF's been seen but there's still some text to process
246 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
247 * shouldn't try reading from the input source any more. We might
248 * still have a bunch of tokens to match, though, because of
249 * possible backing-up.
251 * When we actually see the EOF, we change the status to "new"
252 * (via yyrestart()), so that the user can continue scanning by
253 * just pointing yyin at a new input file.
255 #define YY_BUFFER_EOF_PENDING 2
258 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
260 /* Stack of input buffers. */
261 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
262 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
263 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
265 /* We provide macros for accessing buffer states in case in the
266 * future we want to put the buffer states in a more general
269 * Returns the top of the stack, or NULL.
271 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
272 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
275 /* Same as previous macro, but useful when we know that the buffer stack is not
276 * NULL or when we need an lvalue. For internal use only.
278 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
280 /* yy_hold_char holds the character lost when yytext is formed. */
281 static char yy_hold_char;
282 static int yy_n_chars; /* number of characters read into yy_ch_buf */
285 /* Points to current character in buffer. */
286 static char *yy_c_buf_p = (char *) 0;
287 static int yy_init = 0; /* whether we need to initialize */
288 static int yy_start = 0; /* start state number */
290 /* Flag which is used to allow yywrap()'s to do buffer switches
291 * instead of setting up a fresh yyin. A bit of a hack ...
293 static int yy_did_buffer_switch_on_eof;
295 void yyrestart (FILE *input_file );
296 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
297 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
298 void yy_delete_buffer (YY_BUFFER_STATE b );
299 void yy_flush_buffer (YY_BUFFER_STATE b );
300 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
301 void yypop_buffer_state (void );
303 static void yyensure_buffer_stack (void );
304 static void yy_load_buffer_state (void );
305 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
307 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
309 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
310 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
311 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
313 void *yyalloc (yy_size_t );
314 void *yyrealloc (void *,yy_size_t );
315 void yyfree (void * );
317 #define yy_new_buffer yy_create_buffer
319 #define yy_set_interactive(is_interactive) \
321 if ( ! YY_CURRENT_BUFFER ){ \
322 yyensure_buffer_stack (); \
323 YY_CURRENT_BUFFER_LVALUE = \
324 yy_create_buffer(yyin,YY_BUF_SIZE ); \
326 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
329 #define yy_set_bol(at_bol) \
331 if ( ! YY_CURRENT_BUFFER ){\
332 yyensure_buffer_stack (); \
333 YY_CURRENT_BUFFER_LVALUE = \
334 yy_create_buffer(yyin,YY_BUF_SIZE ); \
336 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
339 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
341 /* Begin user sect3 */
343 typedef unsigned char YY_CHAR;
345 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
347 typedef int yy_state_type;
354 #define yytext_ptr yytext
356 static yy_state_type yy_get_previous_state (void );
357 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
358 static int yy_get_next_buffer (void );
359 static void yy_fatal_error (yyconst char msg[] );
361 /* Done after the current pattern has been matched and before the
362 * corresponding action - sets up yytext.
364 #define YY_DO_BEFORE_ACTION \
365 (yytext_ptr) = yy_bp; \
366 yyleng = (size_t) (yy_cp - yy_bp); \
367 (yy_hold_char) = *yy_cp; \
369 (yy_c_buf_p) = yy_cp;
371 #define YY_NUM_RULES 27
372 #define YY_END_OF_BUFFER 28
373 /* This struct is not used in this scanner,
374 but its presence is necessary. */
377 flex_int32_t yy_verify;
380 static yyconst flex_int16_t yy_accept[104] =
382 0, 0, 28, 26, 1, 3, 26, 26, 26, 23,
383 23, 21, 24, 24, 24, 24, 26, 26, 26, 26,
384 26, 26, 26, 1, 3, 26, 0, 26, 0, 2,
385 23, 24, 26, 26, 24, 26, 26, 26, 26, 17,
386 26, 26, 26, 7, 26, 26, 26, 26, 25, 25,
387 22, 26, 26, 16, 20, 11, 26, 15, 26, 8,
388 9, 10, 26, 26, 4, 26, 26, 26, 26, 26,
389 26, 26, 26, 12, 26, 26, 26, 5, 26, 26,
390 26, 26, 26, 18, 26, 26, 26, 26, 26, 26,
391 6, 26, 26, 26, 26, 26, 14, 26, 26, 19,
396 static yyconst flex_int32_t yy_ec[256] =
398 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
399 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 2, 1, 5, 6, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 7, 1, 8, 7, 9,
403 7, 7, 7, 7, 7, 7, 7, 1, 1, 1,
404 10, 1, 1, 1, 11, 11, 11, 11, 11, 11,
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, 12, 1, 13, 14, 15, 16,
409 17, 18, 19, 20, 21, 1, 1, 22, 23, 24,
410 25, 26, 27, 28, 29, 30, 31, 32, 1, 33,
411 34, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 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,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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,
428 static yyconst flex_int32_t yy_meta[35] =
430 1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
432 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436 static yyconst flex_int16_t yy_base[109] =
438 0, 0, 164, 0, 161, 165, 159, 33, 37, 34,
439 128, 0, 46, 49, 53, 56, 50, 147, 48, 22,
440 142, 127, 0, 155, 165, 74, 151, 65, 152, 165,
441 0, 75, 78, 133, 90, 126, 136, 136, 130, 0,
442 122, 122, 129, 0, 125, 119, 125, 129, 0, 165,
443 0, 116, 120, 0, 0, 0, 123, 0, 118, 0,
444 126, 0, 116, 107, 0, 120, 106, 118, 116, 102,
445 87, 103, 98, 106, 92, 86, 86, 0, 84, 98,
446 89, 94, 80, 0, 87, 95, 79, 89, 74, 83,
447 0, 80, 73, 77, 79, 60, 0, 72, 56, 0,
449 43, 0, 165, 43, 122, 124, 126, 128
452 static yyconst flex_int16_t yy_def[109] =
454 103, 1, 103, 104, 103, 103, 104, 105, 106, 104,
455 10, 104, 10, 10, 10, 10, 104, 104, 104, 104,
456 104, 104, 104, 103, 103, 105, 107, 106, 108, 103,
457 10, 10, 10, 104, 10, 104, 104, 104, 104, 104,
458 104, 104, 104, 104, 104, 104, 104, 104, 104, 103,
459 33, 104, 104, 104, 104, 104, 104, 104, 104, 104,
460 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
461 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
462 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
463 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
465 104, 104, 0, 103, 103, 103, 103, 103
468 static yyconst flex_int16_t yy_nxt[200] =
470 4, 5, 6, 7, 8, 9, 10, 11, 10, 12,
471 13, 4, 13, 13, 14, 15, 16, 13, 4, 4,
472 17, 18, 4, 4, 19, 20, 4, 21, 22, 4,
473 4, 4, 4, 4, 27, 27, 45, 23, 29, 30,
474 31, 31, 31, 23, 32, 46, 32, 32, 32, 32,
475 32, 32, 32, 32, 32, 32, 32, 32, 38, 32,
476 32, 32, 32, 32, 32, 43, 29, 30, 34, 35,
477 102, 44, 101, 39, 40, 27, 27, 41, 49, 37,
478 36, 32, 32, 32, 51, 51, 51, 100, 51, 99,
479 51, 51, 51, 51, 51, 51, 32, 32, 32, 98,
481 97, 96, 95, 94, 93, 92, 91, 90, 89, 88,
482 87, 86, 85, 84, 83, 82, 81, 80, 79, 78,
483 77, 53, 26, 26, 28, 28, 27, 27, 29, 29,
484 76, 75, 74, 73, 72, 71, 70, 69, 68, 67,
485 66, 65, 64, 63, 62, 61, 60, 59, 58, 57,
486 56, 55, 54, 52, 30, 50, 24, 48, 47, 42,
487 33, 25, 24, 103, 3, 103, 103, 103, 103, 103,
488 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
489 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
490 103, 103, 103, 103, 103, 103, 103, 103, 103
494 static yyconst flex_int16_t yy_chk[200] =
496 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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, 8, 8, 20, 8, 9, 9,
500 10, 10, 10, 104, 10, 20, 10, 10, 10, 10,
501 10, 10, 13, 13, 13, 14, 14, 14, 17, 15,
502 15, 15, 16, 16, 16, 19, 28, 28, 14, 15,
503 101, 19, 99, 17, 17, 26, 26, 17, 26, 16,
504 15, 32, 32, 32, 33, 33, 33, 98, 33, 96,
505 33, 33, 33, 33, 33, 33, 35, 35, 35, 95,
507 94, 93, 92, 90, 89, 88, 87, 86, 85, 83,
508 82, 81, 80, 79, 77, 76, 75, 74, 73, 72,
509 71, 35, 105, 105, 106, 106, 107, 107, 108, 108,
510 70, 69, 68, 67, 66, 64, 63, 61, 59, 57,
511 53, 52, 48, 47, 46, 45, 43, 42, 41, 39,
512 38, 37, 36, 34, 29, 27, 24, 22, 21, 18,
513 11, 7, 5, 3, 103, 103, 103, 103, 103, 103,
514 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
515 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
516 103, 103, 103, 103, 103, 103, 103, 103, 103
520 static yy_state_type yy_last_accepting_state;
521 static char *yy_last_accepting_cpos;
523 extern int yy_flex_debug;
524 int yy_flex_debug = 0;
526 /* The intent behind this definition is that it'll catch
527 * any uses of REJECT which flex missed.
529 #define REJECT reject_used_but_not_detected
530 #define yymore() yymore_used_but_not_detected
531 #define YY_MORE_ADJ 0
532 #define YY_RESTORE_YY_MORE_OFFSET
535 * sconfig, coreboot device tree compiler
537 * Copyright (C) 2010 coresystems GmbH
538 * written by Patrick Georgi <patrick.georgi@coresystems.de>
540 * This program is free software; you can redistribute it and/or modify
541 * it under the terms of the GNU General Public License as published by
542 * the Free Software Foundation; version 2 of the License.
544 * This program is distributed in the hope that it will be useful,
545 * but WITHOUT ANY WARRANTY; without even the implied warranty of
546 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
547 * GNU General Public License for more details.
549 * You should have received a copy of the GNU General Public License
550 * along with this program; if not, write to the Free Software
551 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
554 #include "sconfig.tab.h"
560 #ifndef YY_NO_UNISTD_H
561 /* Special case for "unistd.h", since it is non-ANSI. We include it way
562 * down here because we want the user's section 1 to have been scanned first.
563 * The user has a chance to override it with an option.
568 #ifndef YY_EXTRA_TYPE
569 #define YY_EXTRA_TYPE void *
572 static int yy_init_globals (void );
574 /* Accessor methods to globals.
575 These are made visible to non-reentrant scanners for convenience. */
577 int yylex_destroy (void );
579 int yyget_debug (void );
581 void yyset_debug (int debug_flag );
583 YY_EXTRA_TYPE yyget_extra (void );
585 void yyset_extra (YY_EXTRA_TYPE user_defined );
587 FILE *yyget_in (void );
589 void yyset_in (FILE * in_str );
591 FILE *yyget_out (void );
593 void yyset_out (FILE * out_str );
595 int yyget_leng (void );
597 char *yyget_text (void );
599 int yyget_lineno (void );
601 void yyset_lineno (int line_number );
603 /* Macros after this point can all be overridden by user definitions in
607 #ifndef YY_SKIP_YYWRAP
609 extern "C" int yywrap (void );
611 extern int yywrap (void );
615 static void yyunput (int c,char *buf_ptr );
618 static void yy_flex_strncpy (char *,yyconst char *,int );
621 #ifdef YY_NEED_STRLEN
622 static int yy_flex_strlen (yyconst char * );
628 static int yyinput (void );
630 static int input (void );
635 /* Amount of stuff to slurp up with each read. */
636 #ifndef YY_READ_BUF_SIZE
638 /* On IA-64, the buffer size is 16k, not 8k */
639 #define YY_READ_BUF_SIZE 16384
641 #define YY_READ_BUF_SIZE 8192
642 #endif /* __ia64__ */
645 /* Copy whatever the last rule matched to the standard output. */
647 /* This used to be an fputs(), but since the string might contain NUL's,
648 * we now use fwrite().
650 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
653 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
654 * is returned in "result".
657 #define YY_INPUT(buf,result,max_size) \
658 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
662 for ( n = 0; n < max_size && \
663 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
666 buf[n++] = (char) c; \
667 if ( c == EOF && ferror( yyin ) ) \
668 YY_FATAL_ERROR( "input in flex scanner failed" ); \
674 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
676 if( errno != EINTR) \
678 YY_FATAL_ERROR( "input in flex scanner failed" ); \
689 /* No semi-colon after return; correct usage is to write "yyterminate();" -
690 * we don't want an extra ';' after the "return" because that will cause
691 * some compilers to complain about unreachable statements.
694 #define yyterminate() return YY_NULL
697 /* Number of entries by which start-condition stack grows. */
698 #ifndef YY_START_STACK_INCR
699 #define YY_START_STACK_INCR 25
702 /* Report a fatal error. */
703 #ifndef YY_FATAL_ERROR
704 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
707 /* end tables serialization structures and prototypes */
709 /* Default declaration of generated scanner - a define so the user can
710 * easily add parameters.
713 #define YY_DECL_IS_OURS 1
715 extern int yylex (void);
717 #define YY_DECL int yylex (void)
718 #endif /* !YY_DECL */
720 /* Code executed at the beginning of each rule, after yytext and yyleng
723 #ifndef YY_USER_ACTION
724 #define YY_USER_ACTION
727 /* Code executed at the end of each rule. */
729 #define YY_BREAK break;
732 #define YY_RULE_SETUP \
735 /** The main scanner function which does all the work.
739 register yy_state_type yy_current_state;
740 register char *yy_cp, *yy_bp;
752 (yy_start) = 1; /* first start state */
760 if ( ! YY_CURRENT_BUFFER ) {
761 yyensure_buffer_stack ();
762 YY_CURRENT_BUFFER_LVALUE =
763 yy_create_buffer(yyin,YY_BUF_SIZE );
766 yy_load_buffer_state( );
769 while ( 1 ) /* loops until end-of-file is reached */
771 yy_cp = (yy_c_buf_p);
773 /* Support of yytext. */
774 *yy_cp = (yy_hold_char);
776 /* yy_bp points to the position in yy_ch_buf of the start of
781 yy_current_state = (yy_start);
785 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
786 if ( yy_accept[yy_current_state] )
788 (yy_last_accepting_state) = yy_current_state;
789 (yy_last_accepting_cpos) = yy_cp;
791 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
793 yy_current_state = (int) yy_def[yy_current_state];
794 if ( yy_current_state >= 104 )
795 yy_c = yy_meta[(unsigned int) yy_c];
797 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
800 while ( yy_base[yy_current_state] != 165 );
803 yy_act = yy_accept[yy_current_state];
805 { /* have to back up */
806 yy_cp = (yy_last_accepting_cpos);
807 yy_current_state = (yy_last_accepting_state);
808 yy_act = yy_accept[yy_current_state];
813 do_action: /* This label is used only to access EOF actions. */
816 { /* beginning of action switch */
817 case 0: /* must back up */
818 /* undo the effects of YY_DO_BEFORE_ACTION */
819 *yy_cp = (yy_hold_char);
820 yy_cp = (yy_last_accepting_cpos);
821 yy_current_state = (yy_last_accepting_state);
829 /* rule 2 can match eol */
834 /* rule 3 can match eol */
852 {yylval.number=1; return(BOOL);}
856 {yylval.number=0; return(BOOL);}
860 {yylval.number=PCI; return(BUS);}
864 {yylval.number=PNP; return(BUS);}
868 {yylval.number=I2C; return(BUS);}
872 {yylval.number=APIC; return(BUS);}
876 {yylval.number=APIC_CLUSTER; return(BUS);}
880 {yylval.number=PCI_DOMAIN; return(BUS);}
884 {yylval.number=IRQ; return(RESOURCE);}
888 {yylval.number=DRQ; return(RESOURCE);}
892 {yylval.number=IO; return(RESOURCE);}
900 {return(SUBSYSTEMID);}
912 {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
916 {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
920 {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
923 /* rule 25 can match eol */
925 {yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
929 {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(STRING);}
935 case YY_STATE_EOF(INITIAL):
938 case YY_END_OF_BUFFER:
940 /* Amount of text matched not including the EOB char. */
941 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
943 /* Undo the effects of YY_DO_BEFORE_ACTION. */
944 *yy_cp = (yy_hold_char);
945 YY_RESTORE_YY_MORE_OFFSET
947 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
949 /* We're scanning a new file or input source. It's
950 * possible that this happened because the user
951 * just pointed yyin at a new source and called
952 * yylex(). If so, then we have to assure
953 * consistency between YY_CURRENT_BUFFER and our
954 * globals. Here is the right place to do so, because
955 * this is the first action (other than possibly a
956 * back-up) that will match for the new input source.
958 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
959 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
960 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
963 /* Note that here we test for yy_c_buf_p "<=" to the position
964 * of the first EOB in the buffer, since yy_c_buf_p will
965 * already have been incremented past the NUL character
966 * (since all states make transitions on EOB to the
967 * end-of-buffer state). Contrast this with the test
970 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
971 { /* This was really a NUL. */
972 yy_state_type yy_next_state;
974 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
976 yy_current_state = yy_get_previous_state( );
978 /* Okay, we're now positioned to make the NUL
979 * transition. We couldn't have
980 * yy_get_previous_state() go ahead and do it
981 * for us because it doesn't know how to deal
982 * with the possibility of jamming (and we don't
983 * want to build jamming into it because then it
984 * will run more slowly).
987 yy_next_state = yy_try_NUL_trans( yy_current_state );
989 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
993 /* Consume the NUL. */
994 yy_cp = ++(yy_c_buf_p);
995 yy_current_state = yy_next_state;
1001 yy_cp = (yy_c_buf_p);
1002 goto yy_find_action;
1006 else switch ( yy_get_next_buffer( ) )
1008 case EOB_ACT_END_OF_FILE:
1010 (yy_did_buffer_switch_on_eof) = 0;
1014 /* Note: because we've taken care in
1015 * yy_get_next_buffer() to have set up
1016 * yytext, we can now set up
1017 * yy_c_buf_p so that if some total
1018 * hoser (like flex itself) wants to
1019 * call the scanner after we return the
1020 * YY_NULL, it'll still work - another
1021 * YY_NULL will get returned.
1023 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1025 yy_act = YY_STATE_EOF(YY_START);
1031 if ( ! (yy_did_buffer_switch_on_eof) )
1037 case EOB_ACT_CONTINUE_SCAN:
1039 (yytext_ptr) + yy_amount_of_matched_text;
1041 yy_current_state = yy_get_previous_state( );
1043 yy_cp = (yy_c_buf_p);
1044 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1047 case EOB_ACT_LAST_MATCH:
1049 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1051 yy_current_state = yy_get_previous_state( );
1053 yy_cp = (yy_c_buf_p);
1054 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1055 goto yy_find_action;
1062 "fatal flex scanner internal error--no action found" );
1063 } /* end of action switch */
1064 } /* end of scanning one token */
1065 } /* end of yylex */
1067 /* yy_get_next_buffer - try to read in a new buffer
1069 * Returns a code representing an action:
1070 * EOB_ACT_LAST_MATCH -
1071 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1072 * EOB_ACT_END_OF_FILE - end of file
1074 static int yy_get_next_buffer (void)
1076 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1077 register char *source = (yytext_ptr);
1078 register int number_to_move, i;
1081 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1083 "fatal flex scanner internal error--end of buffer missed" );
1085 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1086 { /* Don't try to fill the buffer, so this is an EOF. */
1087 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1089 /* We matched a single character, the EOB, so
1090 * treat this as a final EOF.
1092 return EOB_ACT_END_OF_FILE;
1097 /* We matched some text prior to the EOB, first
1100 return EOB_ACT_LAST_MATCH;
1104 /* Try to read more data. */
1106 /* First move last chars to start of buffer. */
1107 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1109 for ( i = 0; i < number_to_move; ++i )
1110 *(dest++) = *(source++);
1112 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1113 /* don't do the read, it's not guaranteed to return an EOF,
1116 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1121 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1123 while ( num_to_read <= 0 )
1124 { /* Not enough room in the buffer - grow it. */
1126 /* just a shorter name for the current buffer */
1127 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1129 int yy_c_buf_p_offset =
1130 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1132 if ( b->yy_is_our_buffer )
1134 int new_size = b->yy_buf_size * 2;
1136 if ( new_size <= 0 )
1137 b->yy_buf_size += b->yy_buf_size / 8;
1139 b->yy_buf_size *= 2;
1141 b->yy_ch_buf = (char *)
1142 /* Include room in for 2 EOB chars. */
1143 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1146 /* Can't grow it, we don't own it. */
1149 if ( ! b->yy_ch_buf )
1151 "fatal error - scanner input buffer overflow" );
1153 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1155 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1160 if ( num_to_read > YY_READ_BUF_SIZE )
1161 num_to_read = YY_READ_BUF_SIZE;
1163 /* Read in more data. */
1164 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1165 (yy_n_chars), (size_t) num_to_read );
1167 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1170 if ( (yy_n_chars) == 0 )
1172 if ( number_to_move == YY_MORE_ADJ )
1174 ret_val = EOB_ACT_END_OF_FILE;
1180 ret_val = EOB_ACT_LAST_MATCH;
1181 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1182 YY_BUFFER_EOF_PENDING;
1187 ret_val = EOB_ACT_CONTINUE_SCAN;
1189 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1190 /* Extend the array by 50%, plus the number we really need. */
1191 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1192 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1193 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1194 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1197 (yy_n_chars) += number_to_move;
1198 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1199 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1201 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1206 /* yy_get_previous_state - get the state just before the EOB char was reached */
1208 static yy_state_type yy_get_previous_state (void)
1210 register yy_state_type yy_current_state;
1211 register char *yy_cp;
1213 yy_current_state = (yy_start);
1215 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1217 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1218 if ( yy_accept[yy_current_state] )
1220 (yy_last_accepting_state) = yy_current_state;
1221 (yy_last_accepting_cpos) = yy_cp;
1223 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1225 yy_current_state = (int) yy_def[yy_current_state];
1226 if ( yy_current_state >= 104 )
1227 yy_c = yy_meta[(unsigned int) yy_c];
1229 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1232 return yy_current_state;
1235 /* yy_try_NUL_trans - try to make a transition on the NUL character
1238 * next_state = yy_try_NUL_trans( current_state );
1240 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1242 register int yy_is_jam;
1243 register char *yy_cp = (yy_c_buf_p);
1245 register YY_CHAR yy_c = 1;
1246 if ( yy_accept[yy_current_state] )
1248 (yy_last_accepting_state) = yy_current_state;
1249 (yy_last_accepting_cpos) = yy_cp;
1251 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1253 yy_current_state = (int) yy_def[yy_current_state];
1254 if ( yy_current_state >= 104 )
1255 yy_c = yy_meta[(unsigned int) yy_c];
1257 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1258 yy_is_jam = (yy_current_state == 103);
1260 return yy_is_jam ? 0 : yy_current_state;
1263 static void yyunput (int c, register char * yy_bp )
1265 register char *yy_cp;
1267 yy_cp = (yy_c_buf_p);
1269 /* undo effects of setting up yytext */
1270 *yy_cp = (yy_hold_char);
1272 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1273 { /* need to shift things up to make room */
1274 /* +2 for EOB chars. */
1275 register int number_to_move = (yy_n_chars) + 2;
1276 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1277 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1278 register char *source =
1279 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1281 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1282 *--dest = *--source;
1284 yy_cp += (int) (dest - source);
1285 yy_bp += (int) (dest - source);
1286 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1287 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1289 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1290 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1293 *--yy_cp = (char) c;
1295 (yytext_ptr) = yy_bp;
1296 (yy_hold_char) = *yy_cp;
1297 (yy_c_buf_p) = yy_cp;
1302 static int yyinput (void)
1304 static int input (void)
1310 *(yy_c_buf_p) = (yy_hold_char);
1312 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1314 /* yy_c_buf_p now points to the character we want to return.
1315 * If this occurs *before* the EOB characters, then it's a
1316 * valid NUL; if not, then we've hit the end of the buffer.
1318 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1319 /* This was really a NUL. */
1320 *(yy_c_buf_p) = '\0';
1323 { /* need more input */
1324 int offset = (yy_c_buf_p) - (yytext_ptr);
1327 switch ( yy_get_next_buffer( ) )
1329 case EOB_ACT_LAST_MATCH:
1330 /* This happens because yy_g_n_b()
1331 * sees that we've accumulated a
1332 * token and flags that we need to
1333 * try matching the token before
1334 * proceeding. But for input(),
1335 * there's no matching to consider.
1336 * So convert the EOB_ACT_LAST_MATCH
1337 * to EOB_ACT_END_OF_FILE.
1340 /* Reset buffer status. */
1345 case EOB_ACT_END_OF_FILE:
1350 if ( ! (yy_did_buffer_switch_on_eof) )
1359 case EOB_ACT_CONTINUE_SCAN:
1360 (yy_c_buf_p) = (yytext_ptr) + offset;
1366 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1367 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1368 (yy_hold_char) = *++(yy_c_buf_p);
1372 #endif /* ifndef YY_NO_INPUT */
1374 /** Immediately switch to a different input stream.
1375 * @param input_file A readable stream.
1377 * @note This function does not reset the start condition to @c INITIAL .
1379 void yyrestart (FILE * input_file )
1382 if ( ! YY_CURRENT_BUFFER ){
1383 yyensure_buffer_stack ();
1384 YY_CURRENT_BUFFER_LVALUE =
1385 yy_create_buffer(yyin,YY_BUF_SIZE );
1388 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1389 yy_load_buffer_state( );
1392 /** Switch to a different input buffer.
1393 * @param new_buffer The new input buffer.
1396 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1399 /* TODO. We should be able to replace this entire function body
1401 * yypop_buffer_state();
1402 * yypush_buffer_state(new_buffer);
1404 yyensure_buffer_stack ();
1405 if ( YY_CURRENT_BUFFER == new_buffer )
1408 if ( YY_CURRENT_BUFFER )
1410 /* Flush out information for old buffer. */
1411 *(yy_c_buf_p) = (yy_hold_char);
1412 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1413 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1416 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1417 yy_load_buffer_state( );
1419 /* We don't actually know whether we did this switch during
1420 * EOF (yywrap()) processing, but the only time this flag
1421 * is looked at is after yywrap() is called, so it's safe
1422 * to go ahead and always set it.
1424 (yy_did_buffer_switch_on_eof) = 1;
1427 static void yy_load_buffer_state (void)
1429 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1430 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1431 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1432 (yy_hold_char) = *(yy_c_buf_p);
1435 /** Allocate and initialize an input buffer state.
1436 * @param file A readable stream.
1437 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1439 * @return the allocated buffer state.
1441 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1445 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1447 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1449 b->yy_buf_size = size;
1451 /* yy_ch_buf has to be 2 characters longer than the size given because
1452 * we need to put in 2 end-of-buffer characters.
1454 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1455 if ( ! b->yy_ch_buf )
1456 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1458 b->yy_is_our_buffer = 1;
1460 yy_init_buffer(b,file );
1465 /** Destroy the buffer.
1466 * @param b a buffer created with yy_create_buffer()
1469 void yy_delete_buffer (YY_BUFFER_STATE b )
1475 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1476 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1478 if ( b->yy_is_our_buffer )
1479 yyfree((void *) b->yy_ch_buf );
1481 yyfree((void *) b );
1485 extern int isatty (int );
1486 #endif /* __cplusplus */
1488 /* Initializes or reinitializes a buffer.
1489 * This function is sometimes called more than once on the same buffer,
1490 * such as during a yyrestart() or at EOF.
1492 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1497 yy_flush_buffer(b );
1499 b->yy_input_file = file;
1500 b->yy_fill_buffer = 1;
1502 /* If b is the current buffer, then yy_init_buffer was _probably_
1503 * called from yyrestart() or through yy_get_next_buffer.
1504 * In that case, we don't want to reset the lineno or column.
1506 if (b != YY_CURRENT_BUFFER){
1507 b->yy_bs_lineno = 1;
1508 b->yy_bs_column = 0;
1511 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1516 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1517 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1520 void yy_flush_buffer (YY_BUFFER_STATE b )
1527 /* We always need two end-of-buffer characters. The first causes
1528 * a transition to the end-of-buffer state. The second causes
1529 * a jam in that state.
1531 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1532 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1534 b->yy_buf_pos = &b->yy_ch_buf[0];
1537 b->yy_buffer_status = YY_BUFFER_NEW;
1539 if ( b == YY_CURRENT_BUFFER )
1540 yy_load_buffer_state( );
1543 /** Pushes the new state onto the stack. The new state becomes
1544 * the current state. This function will allocate the stack
1546 * @param new_buffer The new state.
1549 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1551 if (new_buffer == NULL)
1554 yyensure_buffer_stack();
1556 /* This block is copied from yy_switch_to_buffer. */
1557 if ( YY_CURRENT_BUFFER )
1559 /* Flush out information for old buffer. */
1560 *(yy_c_buf_p) = (yy_hold_char);
1561 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1562 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1565 /* Only push if top exists. Otherwise, replace top. */
1566 if (YY_CURRENT_BUFFER)
1567 (yy_buffer_stack_top)++;
1568 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1570 /* copied from yy_switch_to_buffer. */
1571 yy_load_buffer_state( );
1572 (yy_did_buffer_switch_on_eof) = 1;
1575 /** Removes and deletes the top of the stack, if present.
1576 * The next element becomes the new top.
1579 void yypop_buffer_state (void)
1581 if (!YY_CURRENT_BUFFER)
1584 yy_delete_buffer(YY_CURRENT_BUFFER );
1585 YY_CURRENT_BUFFER_LVALUE = NULL;
1586 if ((yy_buffer_stack_top) > 0)
1587 --(yy_buffer_stack_top);
1589 if (YY_CURRENT_BUFFER) {
1590 yy_load_buffer_state( );
1591 (yy_did_buffer_switch_on_eof) = 1;
1595 /* Allocates the stack if it does not exist.
1596 * Guarantees space for at least one push.
1598 static void yyensure_buffer_stack (void)
1602 if (!(yy_buffer_stack)) {
1604 /* First allocation is just for 2 elements, since we don't know if this
1605 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1606 * immediate realloc on the next call.
1609 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1610 (num_to_alloc * sizeof(struct yy_buffer_state*)
1612 if ( ! (yy_buffer_stack) )
1613 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1615 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1617 (yy_buffer_stack_max) = num_to_alloc;
1618 (yy_buffer_stack_top) = 0;
1622 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1624 /* Increase the buffer to prepare for a possible push. */
1625 int grow_size = 8 /* arbitrary grow size */;
1627 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1628 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1630 num_to_alloc * sizeof(struct yy_buffer_state*)
1632 if ( ! (yy_buffer_stack) )
1633 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1635 /* zero only the new slots.*/
1636 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1637 (yy_buffer_stack_max) = num_to_alloc;
1641 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1642 * @param base the character buffer
1643 * @param size the size in bytes of the character buffer
1645 * @return the newly allocated buffer state object.
1647 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1652 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1653 base[size-1] != YY_END_OF_BUFFER_CHAR )
1654 /* They forgot to leave room for the EOB's. */
1657 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1659 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1661 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1662 b->yy_buf_pos = b->yy_ch_buf = base;
1663 b->yy_is_our_buffer = 0;
1664 b->yy_input_file = 0;
1665 b->yy_n_chars = b->yy_buf_size;
1666 b->yy_is_interactive = 0;
1668 b->yy_fill_buffer = 0;
1669 b->yy_buffer_status = YY_BUFFER_NEW;
1671 yy_switch_to_buffer(b );
1676 /** Setup the input buffer state to scan a string. The next call to yylex() will
1677 * scan from a @e copy of @a str.
1678 * @param yystr a NUL-terminated string to scan
1680 * @return the newly allocated buffer state object.
1681 * @note If you want to scan bytes that may contain NUL values, then use
1682 * yy_scan_bytes() instead.
1684 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1687 return yy_scan_bytes(yystr,strlen(yystr) );
1690 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1691 * scan from a @e copy of @a bytes.
1692 * @param yybytes the byte buffer to scan
1693 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1695 * @return the newly allocated buffer state object.
1697 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1704 /* Get memory for full buffer, including space for trailing EOB's. */
1705 n = _yybytes_len + 2;
1706 buf = (char *) yyalloc(n );
1708 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1710 for ( i = 0; i < _yybytes_len; ++i )
1711 buf[i] = yybytes[i];
1713 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1715 b = yy_scan_buffer(buf,n );
1717 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1719 /* It's okay to grow etc. this buffer, and we should throw it
1720 * away when we're done.
1722 b->yy_is_our_buffer = 1;
1727 #ifndef YY_EXIT_FAILURE
1728 #define YY_EXIT_FAILURE 2
1731 static void yy_fatal_error (yyconst char* msg )
1733 (void) fprintf( stderr, "%s\n", msg );
1734 exit( YY_EXIT_FAILURE );
1737 /* Redefine yyless() so it works in section 3 code. */
1743 /* Undo effects of setting up yytext. */ \
1744 int yyless_macro_arg = (n); \
1745 YY_LESS_LINENO(yyless_macro_arg);\
1746 yytext[yyleng] = (yy_hold_char); \
1747 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1748 (yy_hold_char) = *(yy_c_buf_p); \
1749 *(yy_c_buf_p) = '\0'; \
1750 yyleng = yyless_macro_arg; \
1754 /* Accessor methods (get/set functions) to struct members. */
1756 /** Get the current line number.
1759 int yyget_lineno (void)
1765 /** Get the input stream.
1768 FILE *yyget_in (void)
1773 /** Get the output stream.
1776 FILE *yyget_out (void)
1781 /** Get the length of the current token.
1784 int yyget_leng (void)
1789 /** Get the current token.
1793 char *yyget_text (void)
1798 /** Set the current line number.
1799 * @param line_number
1802 void yyset_lineno (int line_number )
1805 yylineno = line_number;
1808 /** Set the input stream. This does not discard the current
1810 * @param in_str A readable stream.
1812 * @see yy_switch_to_buffer
1814 void yyset_in (FILE * in_str )
1819 void yyset_out (FILE * out_str )
1824 int yyget_debug (void)
1826 return yy_flex_debug;
1829 void yyset_debug (int bdebug )
1831 yy_flex_debug = bdebug ;
1834 static int yy_init_globals (void)
1836 /* Initialization is the same as for the non-reentrant scanner.
1837 * This function is called from yylex_destroy(), so don't allocate here.
1840 (yy_buffer_stack) = 0;
1841 (yy_buffer_stack_top) = 0;
1842 (yy_buffer_stack_max) = 0;
1843 (yy_c_buf_p) = (char *) 0;
1847 /* Defined in main.c */
1856 /* For future reference: Set errno on error, since we are called by
1862 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1863 int yylex_destroy (void)
1866 /* Pop the buffer stack, destroying each element. */
1867 while(YY_CURRENT_BUFFER){
1868 yy_delete_buffer(YY_CURRENT_BUFFER );
1869 YY_CURRENT_BUFFER_LVALUE = NULL;
1870 yypop_buffer_state();
1873 /* Destroy the stack itself. */
1874 yyfree((yy_buffer_stack) );
1875 (yy_buffer_stack) = NULL;
1877 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1878 * yylex() is called, initialization will occur. */
1885 * Internal utility routines.
1889 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1892 for ( i = 0; i < n; ++i )
1897 #ifdef YY_NEED_STRLEN
1898 static int yy_flex_strlen (yyconst char * s )
1901 for ( n = 0; s[n]; ++n )
1908 void *yyalloc (yy_size_t size )
1910 return (void *) malloc( size );
1913 void *yyrealloc (void * ptr, yy_size_t size )
1915 /* The cast to (char *) in the following accommodates both
1916 * implementations that use char* generic pointers, and those
1917 * that use void* generic pointers. It works with the latter
1918 * because both ANSI C and C++ allow castless assignment from
1919 * any pointer type to void*, and deal with argument conversions
1920 * as though doing an assignment.
1922 return (void *) realloc( (char *) ptr, size );
1925 void yyfree (void * ptr )
1927 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1930 #define YYTABLES_NAME "yytables"