1 #line 2 "/home/Patrick/work/coreboot/util/sconfig/lex.yy.c_shipped"
3 #line 4 "/home/Patrick/work/coreboot/util/sconfig/lex.yy.c_shipped"
5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 35
13 #if YY_FLEX_SUBMINOR_VERSION > 0
17 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
25 /* end standard C headers. */
27 /* flex integer type definitions */
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
44 typedef int8_t flex_int8_t;
45 typedef uint8_t flex_uint8_t;
46 typedef int16_t flex_int16_t;
47 typedef uint16_t flex_uint16_t;
48 typedef int32_t flex_int32_t;
49 typedef uint32_t flex_uint32_t;
51 typedef signed char flex_int8_t;
52 typedef short int flex_int16_t;
53 typedef int flex_int32_t;
54 typedef unsigned char flex_uint8_t;
55 typedef unsigned short int flex_uint16_t;
56 typedef unsigned int flex_uint32_t;
59 /* Limits of integral types. */
61 #define INT8_MIN (-128)
64 #define INT16_MIN (-32767-1)
67 #define INT32_MIN (-2147483647-1)
70 #define INT8_MAX (127)
73 #define INT16_MAX (32767)
76 #define INT32_MAX (2147483647)
79 #define UINT8_MAX (255U)
82 #define UINT16_MAX (65535U)
85 #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. */
144 #define YY_BUF_SIZE 16384
147 /* The state buf must be large enough to hold one state per character in the main buffer.
149 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
151 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
152 #define YY_TYPEDEF_YY_BUFFER_STATE
153 typedef struct yy_buffer_state *YY_BUFFER_STATE;
158 extern FILE *yyin, *yyout;
160 #define EOB_ACT_CONTINUE_SCAN 0
161 #define EOB_ACT_END_OF_FILE 1
162 #define EOB_ACT_LAST_MATCH 2
164 #define YY_LESS_LINENO(n)
166 /* Return all but the first "n" matched characters back to the input stream. */
170 /* Undo effects of setting up yytext. */ \
171 int yyless_macro_arg = (n); \
172 YY_LESS_LINENO(yyless_macro_arg);\
173 *yy_cp = (yy_hold_char); \
174 YY_RESTORE_YY_MORE_OFFSET \
175 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
176 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
180 #define unput(c) yyunput( c, (yytext_ptr) )
182 #ifndef YY_TYPEDEF_YY_SIZE_T
183 #define YY_TYPEDEF_YY_SIZE_T
184 typedef size_t yy_size_t;
187 #ifndef YY_STRUCT_YY_BUFFER_STATE
188 #define YY_STRUCT_YY_BUFFER_STATE
189 struct yy_buffer_state
193 char *yy_ch_buf; /* input buffer */
194 char *yy_buf_pos; /* current position in input buffer */
196 /* Size of input buffer in bytes, not including room for EOB
199 yy_size_t yy_buf_size;
201 /* Number of characters read into yy_ch_buf, not including EOB
206 /* Whether we "own" the buffer - i.e., we know we created it,
207 * and can realloc() it to grow it, and should free() it to
210 int yy_is_our_buffer;
212 /* Whether this is an "interactive" input source; if so, and
213 * if we're using stdio for input, then we want to use getc()
214 * instead of fread(), to make sure we stop fetching input after
217 int yy_is_interactive;
219 /* Whether we're considered to be at the beginning of a line.
220 * If so, '^' rules will be active on the next match, otherwise
225 int yy_bs_lineno; /**< The line count. */
226 int yy_bs_column; /**< The column count. */
228 /* Whether to try to fill the input buffer when we reach the
233 int yy_buffer_status;
235 #define YY_BUFFER_NEW 0
236 #define YY_BUFFER_NORMAL 1
237 /* When an EOF's been seen but there's still some text to process
238 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
239 * shouldn't try reading from the input source any more. We might
240 * still have a bunch of tokens to match, though, because of
241 * possible backing-up.
243 * When we actually see the EOF, we change the status to "new"
244 * (via yyrestart()), so that the user can continue scanning by
245 * just pointing yyin at a new input file.
247 #define YY_BUFFER_EOF_PENDING 2
250 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
252 /* Stack of input buffers. */
253 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
254 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
255 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
257 /* We provide macros for accessing buffer states in case in the
258 * future we want to put the buffer states in a more general
261 * Returns the top of the stack, or NULL.
263 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
264 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
267 /* Same as previous macro, but useful when we know that the buffer stack is not
268 * NULL or when we need an lvalue. For internal use only.
270 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
272 /* yy_hold_char holds the character lost when yytext is formed. */
273 static char yy_hold_char;
274 static int yy_n_chars; /* number of characters read into yy_ch_buf */
277 /* Points to current character in buffer. */
278 static char *yy_c_buf_p = (char *) 0;
279 static int yy_init = 0; /* whether we need to initialize */
280 static int yy_start = 0; /* start state number */
282 /* Flag which is used to allow yywrap()'s to do buffer switches
283 * instead of setting up a fresh yyin. A bit of a hack ...
285 static int yy_did_buffer_switch_on_eof;
287 void yyrestart (FILE *input_file );
288 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
289 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
290 void yy_delete_buffer (YY_BUFFER_STATE b );
291 void yy_flush_buffer (YY_BUFFER_STATE b );
292 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
293 void yypop_buffer_state (void );
295 static void yyensure_buffer_stack (void );
296 static void yy_load_buffer_state (void );
297 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
299 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
301 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
302 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
303 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
305 void *yyalloc (yy_size_t );
306 void *yyrealloc (void *,yy_size_t );
307 void yyfree (void * );
309 #define yy_new_buffer yy_create_buffer
311 #define yy_set_interactive(is_interactive) \
313 if ( ! YY_CURRENT_BUFFER ){ \
314 yyensure_buffer_stack (); \
315 YY_CURRENT_BUFFER_LVALUE = \
316 yy_create_buffer(yyin,YY_BUF_SIZE ); \
318 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
321 #define yy_set_bol(at_bol) \
323 if ( ! YY_CURRENT_BUFFER ){\
324 yyensure_buffer_stack (); \
325 YY_CURRENT_BUFFER_LVALUE = \
326 yy_create_buffer(yyin,YY_BUF_SIZE ); \
328 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
331 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
333 /* Begin user sect3 */
335 typedef unsigned char YY_CHAR;
337 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
339 typedef int yy_state_type;
346 #define yytext_ptr yytext
348 static yy_state_type yy_get_previous_state (void );
349 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
350 static int yy_get_next_buffer (void );
351 static void yy_fatal_error (yyconst char msg[] );
353 /* Done after the current pattern has been matched and before the
354 * corresponding action - sets up yytext.
356 #define YY_DO_BEFORE_ACTION \
357 (yytext_ptr) = yy_bp; \
358 yyleng = (size_t) (yy_cp - yy_bp); \
359 (yy_hold_char) = *yy_cp; \
361 (yy_c_buf_p) = yy_cp;
363 #define YY_NUM_RULES 25
364 #define YY_END_OF_BUFFER 26
365 /* This struct is not used in this scanner,
366 but its presence is necessary. */
369 flex_int32_t yy_verify;
372 static yyconst flex_int16_t yy_accept[86] =
374 0, 0, 26, 24, 1, 3, 24, 24, 24, 21,
375 21, 19, 22, 22, 22, 22, 22, 24, 24, 24,
376 24, 24, 1, 3, 24, 0, 24, 0, 2, 21,
377 22, 24, 24, 24, 22, 24, 24, 24, 17, 24,
378 24, 7, 24, 24, 24, 23, 23, 20, 24, 24,
379 24, 16, 18, 11, 15, 8, 9, 10, 24, 12,
380 4, 24, 24, 24, 24, 24, 24, 24, 24, 5,
381 24, 24, 24, 24, 24, 24, 24, 6, 24, 24,
385 static yyconst flex_int32_t yy_ec[256] =
387 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
388 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 2, 1, 5, 6, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 7, 1, 8, 7, 9,
392 7, 7, 7, 7, 7, 7, 7, 1, 1, 1,
393 10, 1, 1, 1, 11, 11, 11, 11, 11, 11,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 12, 1, 13, 11, 14, 15,
398 16, 17, 18, 19, 20, 1, 1, 21, 22, 23,
399 24, 25, 26, 27, 28, 29, 30, 31, 1, 32,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 1, 1, 1, 1, 1, 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,
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,
412 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 static yyconst flex_int32_t yy_meta[33] =
419 1, 2, 2, 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,
425 static yyconst flex_int16_t yy_base[91] =
427 0, 0, 146, 0, 143, 147, 141, 31, 35, 32,
428 111, 0, 43, 46, 49, 65, 52, 53, 46, 21,
429 126, 0, 139, 147, 62, 135, 76, 136, 147, 0,
430 75, 86, 118, 117, 78, 110, 120, 120, 0, 107,
431 115, 0, 111, 105, 111, 0, 147, 0, 114, 102,
432 106, 0, 0, 0, 0, 0, 113, 0, 104, 111,
433 0, 108, 106, 92, 105, 102, 84, 78, 85, 0,
434 83, 88, 68, 83, 64, 62, 69, 0, 59, 53,
435 54, 0, 39, 0, 147, 41, 109, 111, 113, 115
438 static yyconst flex_int16_t yy_def[91] =
440 85, 1, 85, 86, 85, 85, 86, 87, 88, 86,
441 10, 86, 10, 10, 10, 10, 10, 86, 86, 86,
442 86, 86, 85, 85, 87, 89, 88, 90, 85, 10,
443 10, 10, 86, 86, 10, 86, 86, 86, 86, 86,
444 86, 86, 86, 86, 86, 86, 85, 32, 86, 86,
445 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
446 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
447 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
448 86, 86, 86, 86, 0, 85, 85, 85, 85, 85
451 static yyconst flex_int16_t yy_nxt[180] =
453 4, 5, 6, 7, 8, 9, 10, 11, 10, 12,
454 13, 4, 14, 15, 16, 17, 13, 4, 4, 18,
455 4, 4, 4, 19, 20, 4, 21, 4, 4, 4,
456 4, 4, 26, 26, 43, 22, 28, 29, 30, 30,
457 30, 22, 31, 44, 31, 31, 31, 31, 31, 31,
458 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
459 31, 38, 41, 26, 26, 84, 46, 34, 42, 83,
460 33, 31, 31, 31, 37, 82, 39, 28, 29, 40,
461 35, 31, 31, 31, 31, 31, 31, 81, 80, 79,
462 78, 36, 48, 48, 48, 77, 48, 76, 48, 48,
464 48, 48, 48, 75, 74, 73, 72, 71, 51, 25,
465 25, 27, 27, 26, 26, 28, 28, 70, 69, 68,
466 67, 66, 65, 64, 63, 62, 61, 60, 59, 58,
467 57, 56, 55, 54, 53, 52, 50, 49, 29, 47,
468 23, 45, 32, 24, 23, 85, 3, 85, 85, 85,
469 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
470 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
471 85, 85, 85, 85, 85, 85, 85, 85, 85
474 static yyconst flex_int16_t yy_chk[180] =
476 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
477 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
478 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
479 1, 1, 8, 8, 20, 8, 9, 9, 10, 10,
480 10, 86, 10, 20, 10, 10, 10, 10, 10, 13,
481 13, 13, 14, 14, 14, 15, 15, 15, 17, 17,
482 17, 18, 19, 25, 25, 83, 25, 15, 19, 81,
483 14, 16, 16, 16, 17, 80, 18, 27, 27, 18,
484 16, 31, 31, 31, 35, 35, 35, 79, 77, 76,
485 75, 16, 32, 32, 32, 74, 32, 73, 32, 32,
487 32, 32, 32, 72, 71, 69, 68, 67, 35, 87,
488 87, 88, 88, 89, 89, 90, 90, 66, 65, 64,
489 63, 62, 60, 59, 57, 51, 50, 49, 45, 44,
490 43, 41, 40, 38, 37, 36, 34, 33, 28, 26,
491 23, 21, 11, 7, 5, 3, 85, 85, 85, 85,
492 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
493 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
494 85, 85, 85, 85, 85, 85, 85, 85, 85
497 static yy_state_type yy_last_accepting_state;
498 static char *yy_last_accepting_cpos;
500 extern int yy_flex_debug;
501 int yy_flex_debug = 0;
503 /* The intent behind this definition is that it'll catch
504 * any uses of REJECT which flex missed.
506 #define REJECT reject_used_but_not_detected
507 #define yymore() yymore_used_but_not_detected
508 #define YY_MORE_ADJ 0
509 #define YY_RESTORE_YY_MORE_OFFSET
511 #line 1 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
512 #line 2 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
514 * sconfig, coreboot device tree compiler
516 * Copyright (C) 2010 coresystems GmbH
517 * written by Patrick Georgi <patrick.georgi@coresystems.de>
519 * This program is free software; you can redistribute it and/or modify
520 * it under the terms of the GNU General Public License as published by
521 * the Free Software Foundation; version 2 of the License.
523 * This program is distributed in the hope that it will be useful,
524 * but WITHOUT ANY WARRANTY; without even the implied warranty of
525 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
526 * GNU General Public License for more details.
528 * You should have received a copy of the GNU General Public License
529 * along with this program; if not, write to the Free Software
530 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
533 #include "sconfig.tab.h"
536 #line 537 "/home/Patrick/work/coreboot/util/sconfig/lex.yy.c_shipped"
540 #ifndef YY_NO_UNISTD_H
541 /* Special case for "unistd.h", since it is non-ANSI. We include it way
542 * down here because we want the user's section 1 to have been scanned first.
543 * The user has a chance to override it with an option.
548 #ifndef YY_EXTRA_TYPE
549 #define YY_EXTRA_TYPE void *
552 static int yy_init_globals (void );
554 /* Accessor methods to globals.
555 These are made visible to non-reentrant scanners for convenience. */
557 int yylex_destroy (void );
559 int yyget_debug (void );
561 void yyset_debug (int debug_flag );
563 YY_EXTRA_TYPE yyget_extra (void );
565 void yyset_extra (YY_EXTRA_TYPE user_defined );
567 FILE *yyget_in (void );
569 void yyset_in (FILE * in_str );
571 FILE *yyget_out (void );
573 void yyset_out (FILE * out_str );
575 int yyget_leng (void );
577 char *yyget_text (void );
579 int yyget_lineno (void );
581 void yyset_lineno (int line_number );
583 /* Macros after this point can all be overridden by user definitions in
587 #ifndef YY_SKIP_YYWRAP
589 extern "C" int yywrap (void );
591 extern int yywrap (void );
595 static void yyunput (int c,char *buf_ptr );
598 static void yy_flex_strncpy (char *,yyconst char *,int );
601 #ifdef YY_NEED_STRLEN
602 static int yy_flex_strlen (yyconst char * );
608 static int yyinput (void );
610 static int input (void );
615 /* Amount of stuff to slurp up with each read. */
616 #ifndef YY_READ_BUF_SIZE
617 #define YY_READ_BUF_SIZE 8192
620 /* Copy whatever the last rule matched to the standard output. */
622 /* This used to be an fputs(), but since the string might contain NUL's,
623 * we now use fwrite().
625 #define ECHO fwrite( yytext, yyleng, 1, yyout )
628 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
629 * is returned in "result".
632 #define YY_INPUT(buf,result,max_size) \
633 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
637 for ( n = 0; n < max_size && \
638 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
641 buf[n++] = (char) c; \
642 if ( c == EOF && ferror( yyin ) ) \
643 YY_FATAL_ERROR( "input in flex scanner failed" ); \
649 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
651 if( errno != EINTR) \
653 YY_FATAL_ERROR( "input in flex scanner failed" ); \
664 /* No semi-colon after return; correct usage is to write "yyterminate();" -
665 * we don't want an extra ';' after the "return" because that will cause
666 * some compilers to complain about unreachable statements.
669 #define yyterminate() return YY_NULL
672 /* Number of entries by which start-condition stack grows. */
673 #ifndef YY_START_STACK_INCR
674 #define YY_START_STACK_INCR 25
677 /* Report a fatal error. */
678 #ifndef YY_FATAL_ERROR
679 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
682 /* end tables serialization structures and prototypes */
684 /* Default declaration of generated scanner - a define so the user can
685 * easily add parameters.
688 #define YY_DECL_IS_OURS 1
690 extern int yylex (void);
692 #define YY_DECL int yylex (void)
693 #endif /* !YY_DECL */
695 /* Code executed at the beginning of each rule, after yytext and yyleng
698 #ifndef YY_USER_ACTION
699 #define YY_USER_ACTION
702 /* Code executed at the end of each rule. */
704 #define YY_BREAK break;
707 #define YY_RULE_SETUP \
710 /** The main scanner function which does all the work.
714 register yy_state_type yy_current_state;
715 register char *yy_cp, *yy_bp;
718 #line 27 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
720 #line 721 "/home/Patrick/work/coreboot/util/sconfig/lex.yy.c_shipped"
731 (yy_start) = 1; /* first start state */
739 if ( ! YY_CURRENT_BUFFER ) {
740 yyensure_buffer_stack ();
741 YY_CURRENT_BUFFER_LVALUE =
742 yy_create_buffer(yyin,YY_BUF_SIZE );
745 yy_load_buffer_state( );
748 while ( 1 ) /* loops until end-of-file is reached */
750 yy_cp = (yy_c_buf_p);
752 /* Support of yytext. */
753 *yy_cp = (yy_hold_char);
755 /* yy_bp points to the position in yy_ch_buf of the start of
760 yy_current_state = (yy_start);
764 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
765 if ( yy_accept[yy_current_state] )
767 (yy_last_accepting_state) = yy_current_state;
768 (yy_last_accepting_cpos) = yy_cp;
770 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
772 yy_current_state = (int) yy_def[yy_current_state];
773 if ( yy_current_state >= 86 )
774 yy_c = yy_meta[(unsigned int) yy_c];
776 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
779 while ( yy_base[yy_current_state] != 147 );
782 yy_act = yy_accept[yy_current_state];
784 { /* have to back up */
785 yy_cp = (yy_last_accepting_cpos);
786 yy_current_state = (yy_last_accepting_state);
787 yy_act = yy_accept[yy_current_state];
792 do_action: /* This label is used only to access EOF actions. */
795 { /* beginning of action switch */
796 case 0: /* must back up */
797 /* undo the effects of YY_DO_BEFORE_ACTION */
798 *yy_cp = (yy_hold_char);
799 yy_cp = (yy_last_accepting_cpos);
800 yy_current_state = (yy_last_accepting_state);
805 #line 28 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
809 /* rule 2 can match eol */
811 #line 29 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
815 /* rule 3 can match eol */
817 #line 30 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
822 #line 31 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
827 #line 32 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
832 #line 33 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
837 #line 34 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
838 {yylval.number=1; return(BOOL);}
842 #line 35 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
843 {yylval.number=0; return(BOOL);}
847 #line 36 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
848 {yylval.number=PCI; return(BUS);}
852 #line 37 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
853 {yylval.number=PNP; return(BUS);}
857 #line 38 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
858 {yylval.number=I2C; return(BUS);}
862 #line 39 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
863 {yylval.number=APIC; return(BUS);}
867 #line 40 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
868 {yylval.number=APIC_CLUSTER; return(BUS);}
872 #line 41 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
873 {yylval.number=PCI_DOMAIN; return(BUS);}
877 #line 42 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
878 {yylval.number=IRQ; return(RESOURCE);}
882 #line 43 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
883 {yylval.number=DRQ; return(RESOURCE);}
887 #line 44 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
888 {yylval.number=IO; return(RESOURCE);}
892 #line 45 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
897 #line 46 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
902 #line 47 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
903 {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
907 #line 48 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
908 {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
912 #line 49 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
913 {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
916 /* rule 23 can match eol */
918 #line 50 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
919 {yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
923 #line 51 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
924 {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(STRING);}
928 #line 52 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"
931 #line 932 "/home/Patrick/work/coreboot/util/sconfig/lex.yy.c_shipped"
932 case YY_STATE_EOF(INITIAL):
935 case YY_END_OF_BUFFER:
937 /* Amount of text matched not including the EOB char. */
938 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
940 /* Undo the effects of YY_DO_BEFORE_ACTION. */
941 *yy_cp = (yy_hold_char);
942 YY_RESTORE_YY_MORE_OFFSET
944 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
946 /* We're scanning a new file or input source. It's
947 * possible that this happened because the user
948 * just pointed yyin at a new source and called
949 * yylex(). If so, then we have to assure
950 * consistency between YY_CURRENT_BUFFER and our
951 * globals. Here is the right place to do so, because
952 * this is the first action (other than possibly a
953 * back-up) that will match for the new input source.
955 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
956 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
957 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
960 /* Note that here we test for yy_c_buf_p "<=" to the position
961 * of the first EOB in the buffer, since yy_c_buf_p will
962 * already have been incremented past the NUL character
963 * (since all states make transitions on EOB to the
964 * end-of-buffer state). Contrast this with the test
967 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
968 { /* This was really a NUL. */
969 yy_state_type yy_next_state;
971 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
973 yy_current_state = yy_get_previous_state( );
975 /* Okay, we're now positioned to make the NUL
976 * transition. We couldn't have
977 * yy_get_previous_state() go ahead and do it
978 * for us because it doesn't know how to deal
979 * with the possibility of jamming (and we don't
980 * want to build jamming into it because then it
981 * will run more slowly).
984 yy_next_state = yy_try_NUL_trans( yy_current_state );
986 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
990 /* Consume the NUL. */
991 yy_cp = ++(yy_c_buf_p);
992 yy_current_state = yy_next_state;
998 yy_cp = (yy_c_buf_p);
1003 else switch ( yy_get_next_buffer( ) )
1005 case EOB_ACT_END_OF_FILE:
1007 (yy_did_buffer_switch_on_eof) = 0;
1011 /* Note: because we've taken care in
1012 * yy_get_next_buffer() to have set up
1013 * yytext, we can now set up
1014 * yy_c_buf_p so that if some total
1015 * hoser (like flex itself) wants to
1016 * call the scanner after we return the
1017 * YY_NULL, it'll still work - another
1018 * YY_NULL will get returned.
1020 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1022 yy_act = YY_STATE_EOF(YY_START);
1028 if ( ! (yy_did_buffer_switch_on_eof) )
1034 case EOB_ACT_CONTINUE_SCAN:
1036 (yytext_ptr) + yy_amount_of_matched_text;
1038 yy_current_state = yy_get_previous_state( );
1040 yy_cp = (yy_c_buf_p);
1041 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1044 case EOB_ACT_LAST_MATCH:
1046 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1048 yy_current_state = yy_get_previous_state( );
1050 yy_cp = (yy_c_buf_p);
1051 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1052 goto yy_find_action;
1059 "fatal flex scanner internal error--no action found" );
1060 } /* end of action switch */
1061 } /* end of scanning one token */
1062 } /* end of yylex */
1064 /* yy_get_next_buffer - try to read in a new buffer
1066 * Returns a code representing an action:
1067 * EOB_ACT_LAST_MATCH -
1068 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1069 * EOB_ACT_END_OF_FILE - end of file
1071 static int yy_get_next_buffer (void)
1073 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1074 register char *source = (yytext_ptr);
1075 register int number_to_move, i;
1078 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1080 "fatal flex scanner internal error--end of buffer missed" );
1082 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1083 { /* Don't try to fill the buffer, so this is an EOF. */
1084 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1086 /* We matched a single character, the EOB, so
1087 * treat this as a final EOF.
1089 return EOB_ACT_END_OF_FILE;
1094 /* We matched some text prior to the EOB, first
1097 return EOB_ACT_LAST_MATCH;
1101 /* Try to read more data. */
1103 /* First move last chars to start of buffer. */
1104 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1106 for ( i = 0; i < number_to_move; ++i )
1107 *(dest++) = *(source++);
1109 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1110 /* don't do the read, it's not guaranteed to return an EOF,
1113 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1118 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1120 while ( num_to_read <= 0 )
1121 { /* Not enough room in the buffer - grow it. */
1123 /* just a shorter name for the current buffer */
1124 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1126 int yy_c_buf_p_offset =
1127 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1129 if ( b->yy_is_our_buffer )
1131 int new_size = b->yy_buf_size * 2;
1133 if ( new_size <= 0 )
1134 b->yy_buf_size += b->yy_buf_size / 8;
1136 b->yy_buf_size *= 2;
1138 b->yy_ch_buf = (char *)
1139 /* Include room in for 2 EOB chars. */
1140 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1143 /* Can't grow it, we don't own it. */
1146 if ( ! b->yy_ch_buf )
1148 "fatal error - scanner input buffer overflow" );
1150 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1152 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1157 if ( num_to_read > YY_READ_BUF_SIZE )
1158 num_to_read = YY_READ_BUF_SIZE;
1160 /* Read in more data. */
1161 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1162 (yy_n_chars), (size_t) num_to_read );
1164 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1167 if ( (yy_n_chars) == 0 )
1169 if ( number_to_move == YY_MORE_ADJ )
1171 ret_val = EOB_ACT_END_OF_FILE;
1177 ret_val = EOB_ACT_LAST_MATCH;
1178 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1179 YY_BUFFER_EOF_PENDING;
1184 ret_val = EOB_ACT_CONTINUE_SCAN;
1186 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1187 /* Extend the array by 50%, plus the number we really need. */
1188 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1189 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1190 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1191 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1194 (yy_n_chars) += number_to_move;
1195 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1196 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1198 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1203 /* yy_get_previous_state - get the state just before the EOB char was reached */
1205 static yy_state_type yy_get_previous_state (void)
1207 register yy_state_type yy_current_state;
1208 register char *yy_cp;
1210 yy_current_state = (yy_start);
1212 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1214 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1215 if ( yy_accept[yy_current_state] )
1217 (yy_last_accepting_state) = yy_current_state;
1218 (yy_last_accepting_cpos) = yy_cp;
1220 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1222 yy_current_state = (int) yy_def[yy_current_state];
1223 if ( yy_current_state >= 86 )
1224 yy_c = yy_meta[(unsigned int) yy_c];
1226 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1229 return yy_current_state;
1232 /* yy_try_NUL_trans - try to make a transition on the NUL character
1235 * next_state = yy_try_NUL_trans( current_state );
1237 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1239 register int yy_is_jam;
1240 register char *yy_cp = (yy_c_buf_p);
1242 register YY_CHAR yy_c = 1;
1243 if ( yy_accept[yy_current_state] )
1245 (yy_last_accepting_state) = yy_current_state;
1246 (yy_last_accepting_cpos) = yy_cp;
1248 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1250 yy_current_state = (int) yy_def[yy_current_state];
1251 if ( yy_current_state >= 86 )
1252 yy_c = yy_meta[(unsigned int) yy_c];
1254 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1255 yy_is_jam = (yy_current_state == 85);
1257 return yy_is_jam ? 0 : yy_current_state;
1260 static void yyunput (int c, register char * yy_bp )
1262 register char *yy_cp;
1264 yy_cp = (yy_c_buf_p);
1266 /* undo effects of setting up yytext */
1267 *yy_cp = (yy_hold_char);
1269 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1270 { /* need to shift things up to make room */
1271 /* +2 for EOB chars. */
1272 register int number_to_move = (yy_n_chars) + 2;
1273 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1274 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1275 register char *source =
1276 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1278 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1279 *--dest = *--source;
1281 yy_cp += (int) (dest - source);
1282 yy_bp += (int) (dest - source);
1283 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1284 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1286 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1287 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1290 *--yy_cp = (char) c;
1292 (yytext_ptr) = yy_bp;
1293 (yy_hold_char) = *yy_cp;
1294 (yy_c_buf_p) = yy_cp;
1299 static int yyinput (void)
1301 static int input (void)
1307 *(yy_c_buf_p) = (yy_hold_char);
1309 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1311 /* yy_c_buf_p now points to the character we want to return.
1312 * If this occurs *before* the EOB characters, then it's a
1313 * valid NUL; if not, then we've hit the end of the buffer.
1315 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1316 /* This was really a NUL. */
1317 *(yy_c_buf_p) = '\0';
1320 { /* need more input */
1321 int offset = (yy_c_buf_p) - (yytext_ptr);
1324 switch ( yy_get_next_buffer( ) )
1326 case EOB_ACT_LAST_MATCH:
1327 /* This happens because yy_g_n_b()
1328 * sees that we've accumulated a
1329 * token and flags that we need to
1330 * try matching the token before
1331 * proceeding. But for input(),
1332 * there's no matching to consider.
1333 * So convert the EOB_ACT_LAST_MATCH
1334 * to EOB_ACT_END_OF_FILE.
1337 /* Reset buffer status. */
1342 case EOB_ACT_END_OF_FILE:
1347 if ( ! (yy_did_buffer_switch_on_eof) )
1356 case EOB_ACT_CONTINUE_SCAN:
1357 (yy_c_buf_p) = (yytext_ptr) + offset;
1363 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1364 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1365 (yy_hold_char) = *++(yy_c_buf_p);
1369 #endif /* ifndef YY_NO_INPUT */
1371 /** Immediately switch to a different input stream.
1372 * @param input_file A readable stream.
1374 * @note This function does not reset the start condition to @c INITIAL .
1376 void yyrestart (FILE * input_file )
1379 if ( ! YY_CURRENT_BUFFER ){
1380 yyensure_buffer_stack ();
1381 YY_CURRENT_BUFFER_LVALUE =
1382 yy_create_buffer(yyin,YY_BUF_SIZE );
1385 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1386 yy_load_buffer_state( );
1389 /** Switch to a different input buffer.
1390 * @param new_buffer The new input buffer.
1393 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1396 /* TODO. We should be able to replace this entire function body
1398 * yypop_buffer_state();
1399 * yypush_buffer_state(new_buffer);
1401 yyensure_buffer_stack ();
1402 if ( YY_CURRENT_BUFFER == new_buffer )
1405 if ( YY_CURRENT_BUFFER )
1407 /* Flush out information for old buffer. */
1408 *(yy_c_buf_p) = (yy_hold_char);
1409 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1410 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1413 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1414 yy_load_buffer_state( );
1416 /* We don't actually know whether we did this switch during
1417 * EOF (yywrap()) processing, but the only time this flag
1418 * is looked at is after yywrap() is called, so it's safe
1419 * to go ahead and always set it.
1421 (yy_did_buffer_switch_on_eof) = 1;
1424 static void yy_load_buffer_state (void)
1426 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1427 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1428 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1429 (yy_hold_char) = *(yy_c_buf_p);
1432 /** Allocate and initialize an input buffer state.
1433 * @param file A readable stream.
1434 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1436 * @return the allocated buffer state.
1438 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1442 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1444 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1446 b->yy_buf_size = size;
1448 /* yy_ch_buf has to be 2 characters longer than the size given because
1449 * we need to put in 2 end-of-buffer characters.
1451 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1452 if ( ! b->yy_ch_buf )
1453 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1455 b->yy_is_our_buffer = 1;
1457 yy_init_buffer(b,file );
1462 /** Destroy the buffer.
1463 * @param b a buffer created with yy_create_buffer()
1466 void yy_delete_buffer (YY_BUFFER_STATE b )
1472 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1473 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1475 if ( b->yy_is_our_buffer )
1476 yyfree((void *) b->yy_ch_buf );
1478 yyfree((void *) b );
1482 extern int isatty (int );
1483 #endif /* __cplusplus */
1485 /* Initializes or reinitializes a buffer.
1486 * This function is sometimes called more than once on the same buffer,
1487 * such as during a yyrestart() or at EOF.
1489 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1494 yy_flush_buffer(b );
1496 b->yy_input_file = file;
1497 b->yy_fill_buffer = 1;
1499 /* If b is the current buffer, then yy_init_buffer was _probably_
1500 * called from yyrestart() or through yy_get_next_buffer.
1501 * In that case, we don't want to reset the lineno or column.
1503 if (b != YY_CURRENT_BUFFER){
1504 b->yy_bs_lineno = 1;
1505 b->yy_bs_column = 0;
1508 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1513 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1514 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1517 void yy_flush_buffer (YY_BUFFER_STATE b )
1524 /* We always need two end-of-buffer characters. The first causes
1525 * a transition to the end-of-buffer state. The second causes
1526 * a jam in that state.
1528 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1529 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1531 b->yy_buf_pos = &b->yy_ch_buf[0];
1534 b->yy_buffer_status = YY_BUFFER_NEW;
1536 if ( b == YY_CURRENT_BUFFER )
1537 yy_load_buffer_state( );
1540 /** Pushes the new state onto the stack. The new state becomes
1541 * the current state. This function will allocate the stack
1543 * @param new_buffer The new state.
1546 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1548 if (new_buffer == NULL)
1551 yyensure_buffer_stack();
1553 /* This block is copied from yy_switch_to_buffer. */
1554 if ( YY_CURRENT_BUFFER )
1556 /* Flush out information for old buffer. */
1557 *(yy_c_buf_p) = (yy_hold_char);
1558 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1559 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1562 /* Only push if top exists. Otherwise, replace top. */
1563 if (YY_CURRENT_BUFFER)
1564 (yy_buffer_stack_top)++;
1565 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1567 /* copied from yy_switch_to_buffer. */
1568 yy_load_buffer_state( );
1569 (yy_did_buffer_switch_on_eof) = 1;
1572 /** Removes and deletes the top of the stack, if present.
1573 * The next element becomes the new top.
1576 void yypop_buffer_state (void)
1578 if (!YY_CURRENT_BUFFER)
1581 yy_delete_buffer(YY_CURRENT_BUFFER );
1582 YY_CURRENT_BUFFER_LVALUE = NULL;
1583 if ((yy_buffer_stack_top) > 0)
1584 --(yy_buffer_stack_top);
1586 if (YY_CURRENT_BUFFER) {
1587 yy_load_buffer_state( );
1588 (yy_did_buffer_switch_on_eof) = 1;
1592 /* Allocates the stack if it does not exist.
1593 * Guarantees space for at least one push.
1595 static void yyensure_buffer_stack (void)
1599 if (!(yy_buffer_stack)) {
1601 /* First allocation is just for 2 elements, since we don't know if this
1602 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1603 * immediate realloc on the next call.
1606 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1607 (num_to_alloc * sizeof(struct yy_buffer_state*)
1609 if ( ! (yy_buffer_stack) )
1610 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1612 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1614 (yy_buffer_stack_max) = num_to_alloc;
1615 (yy_buffer_stack_top) = 0;
1619 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1621 /* Increase the buffer to prepare for a possible push. */
1622 int grow_size = 8 /* arbitrary grow size */;
1624 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1625 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1627 num_to_alloc * sizeof(struct yy_buffer_state*)
1629 if ( ! (yy_buffer_stack) )
1630 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1632 /* zero only the new slots.*/
1633 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1634 (yy_buffer_stack_max) = num_to_alloc;
1638 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1639 * @param base the character buffer
1640 * @param size the size in bytes of the character buffer
1642 * @return the newly allocated buffer state object.
1644 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1649 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1650 base[size-1] != YY_END_OF_BUFFER_CHAR )
1651 /* They forgot to leave room for the EOB's. */
1654 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1656 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1658 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1659 b->yy_buf_pos = b->yy_ch_buf = base;
1660 b->yy_is_our_buffer = 0;
1661 b->yy_input_file = 0;
1662 b->yy_n_chars = b->yy_buf_size;
1663 b->yy_is_interactive = 0;
1665 b->yy_fill_buffer = 0;
1666 b->yy_buffer_status = YY_BUFFER_NEW;
1668 yy_switch_to_buffer(b );
1673 /** Setup the input buffer state to scan a string. The next call to yylex() will
1674 * scan from a @e copy of @a str.
1675 * @param yystr a NUL-terminated string to scan
1677 * @return the newly allocated buffer state object.
1678 * @note If you want to scan bytes that may contain NUL values, then use
1679 * yy_scan_bytes() instead.
1681 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1684 return yy_scan_bytes(yystr,strlen(yystr) );
1687 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1688 * scan from a @e copy of @a bytes.
1689 * @param bytes the byte buffer to scan
1690 * @param len the number of bytes in the buffer pointed to by @a bytes.
1692 * @return the newly allocated buffer state object.
1694 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1701 /* Get memory for full buffer, including space for trailing EOB's. */
1702 n = _yybytes_len + 2;
1703 buf = (char *) yyalloc(n );
1705 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1707 for ( i = 0; i < _yybytes_len; ++i )
1708 buf[i] = yybytes[i];
1710 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1712 b = yy_scan_buffer(buf,n );
1714 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1716 /* It's okay to grow etc. this buffer, and we should throw it
1717 * away when we're done.
1719 b->yy_is_our_buffer = 1;
1724 #ifndef YY_EXIT_FAILURE
1725 #define YY_EXIT_FAILURE 2
1728 static void yy_fatal_error (yyconst char* msg )
1730 (void) fprintf( stderr, "%s\n", msg );
1731 exit( YY_EXIT_FAILURE );
1734 /* Redefine yyless() so it works in section 3 code. */
1740 /* Undo effects of setting up yytext. */ \
1741 int yyless_macro_arg = (n); \
1742 YY_LESS_LINENO(yyless_macro_arg);\
1743 yytext[yyleng] = (yy_hold_char); \
1744 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1745 (yy_hold_char) = *(yy_c_buf_p); \
1746 *(yy_c_buf_p) = '\0'; \
1747 yyleng = yyless_macro_arg; \
1751 /* Accessor methods (get/set functions) to struct members. */
1753 /** Get the current line number.
1756 int yyget_lineno (void)
1762 /** Get the input stream.
1765 FILE *yyget_in (void)
1770 /** Get the output stream.
1773 FILE *yyget_out (void)
1778 /** Get the length of the current token.
1781 int yyget_leng (void)
1786 /** Get the current token.
1790 char *yyget_text (void)
1795 /** Set the current line number.
1796 * @param line_number
1799 void yyset_lineno (int line_number )
1802 yylineno = line_number;
1805 /** Set the input stream. This does not discard the current
1807 * @param in_str A readable stream.
1809 * @see yy_switch_to_buffer
1811 void yyset_in (FILE * in_str )
1816 void yyset_out (FILE * out_str )
1821 int yyget_debug (void)
1823 return yy_flex_debug;
1826 void yyset_debug (int bdebug )
1828 yy_flex_debug = bdebug ;
1831 static int yy_init_globals (void)
1833 /* Initialization is the same as for the non-reentrant scanner.
1834 * This function is called from yylex_destroy(), so don't allocate here.
1837 (yy_buffer_stack) = 0;
1838 (yy_buffer_stack_top) = 0;
1839 (yy_buffer_stack_max) = 0;
1840 (yy_c_buf_p) = (char *) 0;
1844 /* Defined in main.c */
1853 /* For future reference: Set errno on error, since we are called by
1859 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1860 int yylex_destroy (void)
1863 /* Pop the buffer stack, destroying each element. */
1864 while(YY_CURRENT_BUFFER){
1865 yy_delete_buffer(YY_CURRENT_BUFFER );
1866 YY_CURRENT_BUFFER_LVALUE = NULL;
1867 yypop_buffer_state();
1870 /* Destroy the stack itself. */
1871 yyfree((yy_buffer_stack) );
1872 (yy_buffer_stack) = NULL;
1874 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1875 * yylex() is called, initialization will occur. */
1882 * Internal utility routines.
1886 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1889 for ( i = 0; i < n; ++i )
1894 #ifdef YY_NEED_STRLEN
1895 static int yy_flex_strlen (yyconst char * s )
1898 for ( n = 0; s[n]; ++n )
1905 void *yyalloc (yy_size_t size )
1907 return (void *) malloc( size );
1910 void *yyrealloc (void * ptr, yy_size_t size )
1912 /* The cast to (char *) in the following accommodates both
1913 * implementations that use char* generic pointers, and those
1914 * that use void* generic pointers. It works with the latter
1915 * because both ANSI C and C++ allow castless assignment from
1916 * any pointer type to void*, and deal with argument conversions
1917 * as though doing an assignment.
1919 return (void *) realloc( (char *) ptr, size );
1922 void yyfree (void * ptr )
1924 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1927 #define YYTABLES_NAME "yytables"
1929 #line 52 "/home/Patrick/work/coreboot/util/sconfig/sconfig.l"