2 #define YY_INT_ALIGNED short int
4 /* A lexical scanner generated by flex */
7 #define YY_FLEX_MAJOR_VERSION 2
8 #define YY_FLEX_MINOR_VERSION 6
9 #define YY_FLEX_SUBMINOR_VERSION 4
10 #if YY_FLEX_SUBMINOR_VERSION > 0
14 /* First, we deal with platform-specific or compiler-specific issues. */
16 /* begin standard C headers. */
22 /* end standard C headers. */
24 /* flex integer type definitions */
29 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
31 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
33 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
34 * if you want the limit (max/min) macros for int types.
36 #ifndef __STDC_LIMIT_MACROS
37 #define __STDC_LIMIT_MACROS 1
41 typedef int8_t flex_int8_t;
42 typedef uint8_t flex_uint8_t;
43 typedef int16_t flex_int16_t;
44 typedef uint16_t flex_uint16_t;
45 typedef int32_t flex_int32_t;
46 typedef uint32_t flex_uint32_t;
48 typedef signed char flex_int8_t;
49 typedef short int flex_int16_t;
50 typedef int flex_int32_t;
51 typedef unsigned char flex_uint8_t;
52 typedef unsigned short int flex_uint16_t;
53 typedef unsigned int flex_uint32_t;
55 /* Limits of integral types. */
57 #define INT8_MIN (-128)
60 #define INT16_MIN (-32767-1)
63 #define INT32_MIN (-2147483647-1)
66 #define INT8_MAX (127)
69 #define INT16_MAX (32767)
72 #define INT32_MAX (2147483647)
75 #define UINT8_MAX (255U)
78 #define UINT16_MAX (65535U)
81 #define UINT32_MAX (4294967295U)
85 #define SIZE_MAX (~(size_t)0)
90 #endif /* ! FLEXINT_H */
92 /* begin standard C++ headers. */
94 /* TODO: this is always defined, so inline it */
97 #if defined(__GNUC__) && __GNUC__ >= 3
98 #define yynoreturn __attribute__((__noreturn__))
103 /* Returned upon end-of-file. */
106 /* Promotes a possibly negative, possibly signed char to an
107 * integer in range [0..255] for use as an array index.
109 #define YY_SC_TO_UI(c) ((YY_CHAR) (c))
111 /* Enter a start condition. This macro really ought to take a parameter,
112 * but we do it the disgusting crufty way forced on us by the ()-less
113 * definition of BEGIN.
115 #define BEGIN (yy_start) = 1 + 2 *
116 /* Translate the current start state into a value that can be later handed
117 * to BEGIN to return to the state. The YYSTATE alias is for lex
120 #define YY_START (((yy_start) - 1) / 2)
121 #define YYSTATE YY_START
122 /* Action number for EOF rule of a given start state. */
123 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
124 /* Special action meaning "start processing a new file". */
125 #define YY_NEW_FILE yyrestart( yyin )
126 #define YY_END_OF_BUFFER_CHAR 0
128 /* Size of default input buffer. */
131 /* On IA-64, the buffer size is 16k, not 8k.
132 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
133 * Ditto for the __ia64__ case accordingly.
135 #define YY_BUF_SIZE 32768
137 #define YY_BUF_SIZE 16384
138 #endif /* __ia64__ */
141 /* The state buf must be large enough to hold one state per character in the main buffer.
143 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
145 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
146 #define YY_TYPEDEF_YY_BUFFER_STATE
147 typedef struct yy_buffer_state *YY_BUFFER_STATE;
150 #ifndef YY_TYPEDEF_YY_SIZE_T
151 #define YY_TYPEDEF_YY_SIZE_T
152 typedef size_t yy_size_t;
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)
164 #define YY_LINENO_REWIND_TO(ptr)
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 */ \
179 #define unput(c) yyunput( c, (yytext_ptr) )
181 #ifndef YY_STRUCT_YY_BUFFER_STATE
182 #define YY_STRUCT_YY_BUFFER_STATE
183 struct yy_buffer_state
187 char *yy_ch_buf; /* input buffer */
188 char *yy_buf_pos; /* current position in input buffer */
190 /* Size of input buffer in bytes, not including room for EOB
195 /* Number of characters read into yy_ch_buf, not including EOB
200 /* Whether we "own" the buffer - i.e., we know we created it,
201 * and can realloc() it to grow it, and should free() it to
204 int yy_is_our_buffer;
206 /* Whether this is an "interactive" input source; if so, and
207 * if we're using stdio for input, then we want to use getc()
208 * instead of fread(), to make sure we stop fetching input after
211 int yy_is_interactive;
213 /* Whether we're considered to be at the beginning of a line.
214 * If so, '^' rules will be active on the next match, otherwise
219 int yy_bs_lineno; /**< The line count. */
220 int yy_bs_column; /**< The column count. */
222 /* Whether to try to fill the input buffer when we reach the
227 int yy_buffer_status;
229 #define YY_BUFFER_NEW 0
230 #define YY_BUFFER_NORMAL 1
231 /* When an EOF's been seen but there's still some text to process
232 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
233 * shouldn't try reading from the input source any more. We might
234 * still have a bunch of tokens to match, though, because of
235 * possible backing-up.
237 * When we actually see the EOF, we change the status to "new"
238 * (via yyrestart()), so that the user can continue scanning by
239 * just pointing yyin at a new input file.
241 #define YY_BUFFER_EOF_PENDING 2
244 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
246 /* Stack of input buffers. */
247 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
248 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
249 static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
251 /* We provide macros for accessing buffer states in case in the
252 * future we want to put the buffer states in a more general
255 * Returns the top of the stack, or NULL.
257 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
258 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
260 /* Same as previous macro, but useful when we know that the buffer stack is not
261 * NULL or when we need an lvalue. For internal use only.
263 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
265 /* yy_hold_char holds the character lost when yytext is formed. */
266 static char yy_hold_char;
267 static int yy_n_chars; /* number of characters read into yy_ch_buf */
270 /* Points to current character in buffer. */
271 static char *yy_c_buf_p = NULL;
272 static int yy_init = 0; /* whether we need to initialize */
273 static int yy_start = 0; /* start state number */
275 /* Flag which is used to allow yywrap()'s to do buffer switches
276 * instead of setting up a fresh yyin. A bit of a hack ...
278 static int yy_did_buffer_switch_on_eof;
280 void yyrestart ( FILE *input_file );
281 void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
282 YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
283 void yy_delete_buffer ( YY_BUFFER_STATE b );
284 void yy_flush_buffer ( YY_BUFFER_STATE b );
285 void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
286 void yypop_buffer_state ( void );
288 static void yyensure_buffer_stack ( void );
289 static void yy_load_buffer_state ( void );
290 static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
291 #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
293 YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
294 YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
295 YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
297 void *yyalloc ( yy_size_t );
298 void *yyrealloc ( void *, yy_size_t );
299 void yyfree ( void * );
301 #define yy_new_buffer yy_create_buffer
302 #define yy_set_interactive(is_interactive) \
304 if ( ! YY_CURRENT_BUFFER ){ \
305 yyensure_buffer_stack (); \
306 YY_CURRENT_BUFFER_LVALUE = \
307 yy_create_buffer( yyin, YY_BUF_SIZE ); \
309 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
311 #define yy_set_bol(at_bol) \
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_at_bol = at_bol; \
320 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
322 /* Begin user sect3 */
323 typedef flex_uint8_t YY_CHAR;
325 FILE *yyin = NULL, *yyout = NULL;
327 typedef int yy_state_type;
336 #define yytext_ptr yytext
338 static yy_state_type yy_get_previous_state ( void );
339 static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
340 static int yy_get_next_buffer ( void );
341 static void yynoreturn yy_fatal_error ( const char* msg );
343 /* Done after the current pattern has been matched and before the
344 * corresponding action - sets up yytext.
346 #define YY_DO_BEFORE_ACTION \
347 (yytext_ptr) = yy_bp; \
348 yyleng = (int) (yy_cp - yy_bp); \
349 (yy_hold_char) = *yy_cp; \
351 (yy_c_buf_p) = yy_cp;
352 #define YY_NUM_RULES 49
353 #define YY_END_OF_BUFFER 50
354 /* This struct is not used in this scanner,
355 but its presence is necessary. */
358 flex_int32_t yy_verify;
361 static const flex_int16_t yy_accept[209] =
363 0, 0, 50, 48, 1, 3, 48, 48, 48, 44,
364 44, 41, 45, 45, 45, 45, 45, 45, 48, 48,
365 48, 48, 48, 48, 48, 48, 48, 42, 48, 1,
366 3, 48, 0, 48, 48, 0, 2, 44, 45, 48,
367 48, 10, 48, 48, 45, 48, 48, 48, 48, 48,
368 48, 48, 48, 48, 48, 35, 48, 48, 48, 48,
369 48, 17, 48, 48, 48, 48, 48, 48, 48, 48,
370 48, 48, 47, 47, 48, 0, 43, 48, 48, 25,
371 48, 48, 34, 38, 48, 48, 48, 48, 48, 23,
372 48, 33, 48, 48, 48, 18, 7, 48, 21, 22,
374 48, 9, 48, 48, 29, 48, 48, 30, 8, 48,
375 0, 48, 4, 48, 48, 48, 48, 48, 48, 31,
376 48, 48, 48, 32, 28, 48, 48, 48, 48, 48,
377 48, 46, 46, 6, 48, 48, 48, 13, 48, 48,
378 48, 48, 48, 48, 15, 48, 48, 48, 48, 48,
379 5, 26, 48, 48, 19, 48, 48, 14, 48, 48,
380 48, 48, 48, 48, 27, 36, 48, 48, 48, 48,
381 48, 48, 48, 48, 11, 48, 48, 48, 48, 48,
382 12, 20, 48, 48, 48, 48, 48, 48, 48, 48,
383 48, 24, 48, 48, 37, 48, 48, 48, 48, 48,
385 48, 16, 48, 48, 40, 48, 39, 0
388 static const YY_CHAR yy_ec[256] =
390 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
391 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 2, 1, 5, 6, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 7, 1, 8, 7, 9,
395 7, 7, 7, 7, 7, 7, 7, 1, 1, 1,
396 10, 1, 1, 1, 11, 11, 11, 11, 11, 11,
397 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 1, 12, 1, 13, 14, 15, 16,
401 17, 18, 19, 20, 21, 1, 1, 22, 23, 24,
402 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
403 35, 1, 1, 36, 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,
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,
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,
420 static const YY_CHAR yy_meta[37] =
422 1, 2, 2, 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 const flex_int16_t yy_base[216] =
430 0, 0, 277, 0, 274, 278, 272, 35, 39, 36,
431 240, 0, 48, 51, 55, 75, 61, 58, 22, 252,
432 62, 81, 75, 74, 255, 82, 48, 0, 0, 269,
433 278, 104, 265, 109, 93, 266, 278, 0, 108, 111,
434 247, 0, 246, 235, 123, 242, 237, 247, 245, 249,
435 236, 238, 242, 242, 236, 0, 228, 230, 232, 231,
436 233, 0, 104, 229, 223, 223, 117, 233, 225, 231,
437 218, 123, 0, 278, 136, 238, 0, 229, 215, 228,
438 218, 225, 0, 0, 215, 221, 218, 209, 217, 0,
439 215, 0, 215, 205, 204, 0, 0, 207, 0, 0,
441 213, 0, 205, 204, 0, 195, 195, 0, 0, 217,
442 216, 191, 0, 204, 203, 196, 200, 190, 186, 0,
443 196, 184, 198, 0, 0, 185, 192, 179, 182, 171,
444 180, 0, 278, 0, 182, 186, 178, 0, 177, 179,
445 175, 177, 167, 172, 0, 165, 165, 164, 160, 160,
446 0, 0, 172, 174, 0, 158, 162, 0, 169, 173,
447 154, 162, 153, 160, 0, 0, 152, 151, 45, 161,
448 148, 146, 156, 139, 0, 156, 150, 148, 149, 152,
449 0, 0, 136, 129, 132, 127, 123, 138, 119, 132,
450 123, 0, 125, 133, 0, 127, 119, 126, 107, 103,
452 93, 0, 63, 49, 0, 61, 0, 278, 45, 155,
453 157, 159, 161, 163, 165
456 static const flex_int16_t yy_def[216] =
458 208, 1, 208, 209, 208, 208, 209, 210, 211, 209,
459 10, 209, 10, 10, 10, 10, 10, 10, 209, 209,
460 209, 209, 209, 209, 209, 209, 209, 209, 209, 208,
461 208, 210, 212, 213, 211, 214, 208, 10, 10, 10,
462 209, 209, 209, 209, 10, 209, 209, 209, 209, 209,
463 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
464 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
465 209, 209, 209, 208, 213, 215, 40, 209, 209, 209,
466 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
467 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
469 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
470 208, 209, 209, 209, 209, 209, 209, 209, 209, 209,
471 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
472 209, 209, 208, 209, 209, 209, 209, 209, 209, 209,
473 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
474 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
475 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
476 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
477 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
478 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
480 209, 209, 209, 209, 209, 209, 209, 0, 208, 208,
481 208, 208, 208, 208, 208
484 static const flex_int16_t yy_nxt[315] =
486 4, 5, 6, 7, 8, 9, 10, 11, 10, 12,
487 13, 4, 14, 13, 15, 16, 17, 18, 19, 20,
488 21, 4, 22, 4, 23, 24, 4, 25, 26, 4,
489 27, 4, 4, 4, 4, 28, 33, 33, 51, 34,
490 36, 37, 38, 38, 38, 29, 39, 52, 39, 39,
491 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
492 176, 39, 39, 39, 39, 39, 39, 39, 39, 39,
493 54, 71, 41, 177, 43, 207, 72, 206, 49, 42,
494 44, 39, 39, 39, 48, 55, 56, 205, 64, 57,
495 50, 45, 61, 58, 36, 37, 59, 65, 62, 46,
497 63, 66, 47, 60, 68, 33, 33, 69, 73, 204,
498 76, 76, 70, 29, 39, 39, 39, 77, 77, 77,
499 203, 77, 202, 77, 77, 77, 77, 77, 77, 39,
500 39, 39, 97, 98, 102, 103, 108, 76, 76, 109,
501 110, 201, 200, 199, 198, 197, 196, 195, 194, 193,
502 192, 191, 190, 189, 81, 32, 32, 35, 35, 33,
503 33, 75, 75, 36, 36, 76, 76, 188, 187, 186,
504 185, 184, 183, 182, 181, 180, 179, 178, 175, 174,
505 173, 172, 171, 170, 169, 168, 167, 166, 165, 164,
506 163, 162, 161, 160, 159, 158, 157, 156, 155, 154,
508 153, 152, 151, 150, 149, 148, 147, 146, 145, 144,
509 143, 142, 141, 140, 139, 138, 137, 136, 135, 134,
510 133, 132, 131, 130, 129, 128, 127, 126, 125, 124,
511 123, 122, 121, 120, 119, 118, 117, 116, 115, 114,
512 113, 112, 111, 107, 106, 105, 104, 101, 100, 99,
513 96, 95, 94, 93, 92, 91, 90, 89, 88, 87,
514 86, 85, 84, 83, 82, 80, 79, 78, 37, 74,
515 30, 67, 53, 40, 31, 30, 208, 3, 208, 208,
516 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
517 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
519 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
523 static const flex_int16_t yy_chk[315] =
525 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
526 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
527 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
528 1, 1, 1, 1, 1, 1, 8, 8, 19, 8,
529 9, 9, 10, 10, 10, 209, 10, 19, 10, 10,
530 10, 10, 10, 10, 13, 13, 13, 14, 14, 14,
531 169, 15, 15, 15, 18, 18, 18, 17, 17, 17,
532 21, 27, 14, 169, 15, 206, 27, 204, 18, 14,
533 15, 16, 16, 16, 17, 21, 21, 203, 24, 21,
534 18, 16, 23, 22, 35, 35, 22, 24, 23, 16,
536 23, 24, 16, 22, 26, 32, 32, 26, 32, 201,
537 34, 34, 26, 34, 39, 39, 39, 40, 40, 40,
538 200, 40, 199, 40, 40, 40, 40, 40, 40, 45,
539 45, 45, 63, 63, 67, 67, 72, 75, 75, 72,
540 75, 198, 197, 196, 194, 193, 191, 190, 189, 188,
541 187, 186, 185, 184, 45, 210, 210, 211, 211, 212,
542 212, 213, 213, 214, 214, 215, 215, 183, 180, 179,
543 178, 177, 176, 174, 173, 172, 171, 170, 168, 167,
544 164, 163, 162, 161, 160, 159, 157, 156, 154, 153,
545 150, 149, 148, 147, 146, 144, 143, 142, 141, 140,
547 139, 137, 136, 135, 131, 130, 129, 128, 127, 126,
548 123, 122, 121, 119, 118, 117, 116, 115, 114, 112,
549 111, 110, 107, 106, 104, 103, 101, 98, 95, 94,
550 93, 91, 89, 88, 87, 86, 85, 82, 81, 80,
551 79, 78, 76, 71, 70, 69, 68, 66, 65, 64,
552 61, 60, 59, 58, 57, 55, 54, 53, 52, 51,
553 50, 49, 48, 47, 46, 44, 43, 41, 36, 33,
554 30, 25, 20, 11, 7, 5, 3, 208, 208, 208,
555 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
556 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
558 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
562 static yy_state_type yy_last_accepting_state;
563 static char *yy_last_accepting_cpos;
565 extern int yy_flex_debug;
566 int yy_flex_debug = 0;
568 /* The intent behind this definition is that it'll catch
569 * any uses of REJECT which flex missed.
571 #define REJECT reject_used_but_not_detected
572 #define yymore() yymore_used_but_not_detected
573 #define YY_MORE_ADJ 0
574 #define YY_RESTORE_YY_MORE_OFFSET
576 /* sconfig, coreboot device tree compiler */
577 /* SPDX-License-Identifier: GPL-2.0-only */
579 #include "sconfig.tab.h"
585 #ifndef YY_NO_UNISTD_H
586 /* Special case for "unistd.h", since it is non-ANSI. We include it way
587 * down here because we want the user's section 1 to have been scanned first.
588 * The user has a chance to override it with an option.
593 #ifndef YY_EXTRA_TYPE
594 #define YY_EXTRA_TYPE void *
597 static int yy_init_globals ( void );
599 /* Accessor methods to globals.
600 These are made visible to non-reentrant scanners for convenience. */
602 int yylex_destroy ( void );
604 int yyget_debug ( void );
606 void yyset_debug ( int debug_flag );
608 YY_EXTRA_TYPE yyget_extra ( void );
610 void yyset_extra ( YY_EXTRA_TYPE user_defined );
612 FILE *yyget_in ( void );
614 void yyset_in ( FILE * _in_str );
616 FILE *yyget_out ( void );
618 void yyset_out ( FILE * _out_str );
620 int yyget_leng ( void );
622 char *yyget_text ( void );
624 int yyget_lineno ( void );
626 void yyset_lineno ( int _line_number );
628 /* Macros after this point can all be overridden by user definitions in
632 #ifndef YY_SKIP_YYWRAP
634 extern "C" int yywrap ( void );
636 extern int yywrap ( void );
642 static void yyunput ( int c, char *buf_ptr );
647 static void yy_flex_strncpy ( char *, const char *, int );
650 #ifdef YY_NEED_STRLEN
651 static int yy_flex_strlen ( const char * );
656 static int yyinput ( void );
658 static int input ( void );
663 /* Amount of stuff to slurp up with each read. */
664 #ifndef YY_READ_BUF_SIZE
666 /* On IA-64, the buffer size is 16k, not 8k */
667 #define YY_READ_BUF_SIZE 16384
669 #define YY_READ_BUF_SIZE 8192
670 #endif /* __ia64__ */
673 /* Copy whatever the last rule matched to the standard output. */
675 /* This used to be an fputs(), but since the string might contain NUL's,
676 * we now use fwrite().
678 #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
681 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
682 * is returned in "result".
685 #define YY_INPUT(buf,result,max_size) \
686 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
690 for ( n = 0; n < max_size && \
691 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
694 buf[n++] = (char) c; \
695 if ( c == EOF && ferror( yyin ) ) \
696 YY_FATAL_ERROR( "input in flex scanner failed" ); \
702 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
704 if( errno != EINTR) \
706 YY_FATAL_ERROR( "input in flex scanner failed" ); \
717 /* No semi-colon after return; correct usage is to write "yyterminate();" -
718 * we don't want an extra ';' after the "return" because that will cause
719 * some compilers to complain about unreachable statements.
722 #define yyterminate() return YY_NULL
725 /* Number of entries by which start-condition stack grows. */
726 #ifndef YY_START_STACK_INCR
727 #define YY_START_STACK_INCR 25
730 /* Report a fatal error. */
731 #ifndef YY_FATAL_ERROR
732 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
735 /* end tables serialization structures and prototypes */
737 /* Default declaration of generated scanner - a define so the user can
738 * easily add parameters.
741 #define YY_DECL_IS_OURS 1
743 extern int yylex (void);
745 #define YY_DECL int yylex (void)
746 #endif /* !YY_DECL */
748 /* Code executed at the beginning of each rule, after yytext and yyleng
751 #ifndef YY_USER_ACTION
752 #define YY_USER_ACTION
755 /* Code executed at the end of each rule. */
757 #define YY_BREAK /*LINTED*/break;
760 #define YY_RULE_SETUP \
763 /** The main scanner function which does all the work.
767 yy_state_type yy_current_state;
780 (yy_start) = 1; /* first start state */
788 if ( ! YY_CURRENT_BUFFER ) {
789 yyensure_buffer_stack ();
790 YY_CURRENT_BUFFER_LVALUE =
791 yy_create_buffer( yyin, YY_BUF_SIZE );
794 yy_load_buffer_state( );
799 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
801 yy_cp = (yy_c_buf_p);
803 /* Support of yytext. */
804 *yy_cp = (yy_hold_char);
806 /* yy_bp points to the position in yy_ch_buf of the start of
811 yy_current_state = (yy_start);
815 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
816 if ( yy_accept[yy_current_state] )
818 (yy_last_accepting_state) = yy_current_state;
819 (yy_last_accepting_cpos) = yy_cp;
821 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
823 yy_current_state = (int) yy_def[yy_current_state];
824 if ( yy_current_state >= 209 )
825 yy_c = yy_meta[yy_c];
827 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
830 while ( yy_base[yy_current_state] != 278 );
833 yy_act = yy_accept[yy_current_state];
835 { /* have to back up */
836 yy_cp = (yy_last_accepting_cpos);
837 yy_current_state = (yy_last_accepting_state);
838 yy_act = yy_accept[yy_current_state];
843 do_action: /* This label is used only to access EOF actions. */
846 { /* beginning of action switch */
847 case 0: /* must back up */
848 /* undo the effects of YY_DO_BEFORE_ACTION */
849 *yy_cp = (yy_hold_char);
850 yy_cp = (yy_last_accepting_cpos);
851 yy_current_state = (yy_last_accepting_state);
859 /* rule 2 can match eol */
864 /* rule 3 can match eol */
894 {return(ASSOCIATION);}
902 {return(FW_CONFIG_TABLE);}
906 {return(FW_CONFIG_FIELD);}
910 {return(FW_CONFIG_OPTION);}
914 {return(FW_CONFIG_PROBE);}
918 {return(FW_CONFIG_UNPROVISIONED);}
922 {yylval.number=1; return(BOOL);}
926 {yylval.number=0; return(BOOL);}
930 {yylval.number=3; return(STATUS);}
934 {yylval.number=5; return(STATUS);}
938 {yylval.number=PCI; return(BUS);}
942 {yylval.number=PNP; return(BUS);}
946 {yylval.number=I2C; return(BUS);}
950 {yylval.number=CPU_CLUSTER; return(BUS);}
954 {yylval.number=CPU; return(BUS);}
958 {yylval.number=DOMAIN; return(BUS);}
962 {yylval.number=GENERIC; return(BUS);}
966 {yylval.number=MMIO; return(BUS);}
970 {yylval.number=SPI; return(BUS);}
974 {yylval.number=USB; return(BUS);}
978 {yylval.number=GPIO; return(BUS);}
982 {yylval.number=MDIO; return(BUS);}
986 {yylval.number=IRQ; return(RESOURCE);}
990 {yylval.number=DRQ; return(RESOURCE);}
994 {yylval.number=IO; return(RESOURCE);}
1002 {return(SUBSYSTEMID);}
1010 {return(SLOT_DESC);}
1014 {return(SMBIOS_DEV_INFO);}
1026 {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
1030 {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
1034 {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
1037 /* rule 46 can match eol */
1039 {yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
1042 /* rule 47 can match eol */
1044 {yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
1048 {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(STRING);}
1054 case YY_STATE_EOF(INITIAL):
1057 case YY_END_OF_BUFFER:
1059 /* Amount of text matched not including the EOB char. */
1060 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1062 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1063 *yy_cp = (yy_hold_char);
1064 YY_RESTORE_YY_MORE_OFFSET
1066 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1068 /* We're scanning a new file or input source. It's
1069 * possible that this happened because the user
1070 * just pointed yyin at a new source and called
1071 * yylex(). If so, then we have to assure
1072 * consistency between YY_CURRENT_BUFFER and our
1073 * globals. Here is the right place to do so, because
1074 * this is the first action (other than possibly a
1075 * back-up) that will match for the new input source.
1077 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1078 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1079 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1082 /* Note that here we test for yy_c_buf_p "<=" to the position
1083 * of the first EOB in the buffer, since yy_c_buf_p will
1084 * already have been incremented past the NUL character
1085 * (since all states make transitions on EOB to the
1086 * end-of-buffer state). Contrast this with the test
1089 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1090 { /* This was really a NUL. */
1091 yy_state_type yy_next_state;
1093 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1095 yy_current_state = yy_get_previous_state( );
1097 /* Okay, we're now positioned to make the NUL
1098 * transition. We couldn't have
1099 * yy_get_previous_state() go ahead and do it
1100 * for us because it doesn't know how to deal
1101 * with the possibility of jamming (and we don't
1102 * want to build jamming into it because then it
1103 * will run more slowly).
1106 yy_next_state = yy_try_NUL_trans( yy_current_state );
1108 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1110 if ( yy_next_state )
1112 /* Consume the NUL. */
1113 yy_cp = ++(yy_c_buf_p);
1114 yy_current_state = yy_next_state;
1120 yy_cp = (yy_c_buf_p);
1121 goto yy_find_action;
1125 else switch ( yy_get_next_buffer( ) )
1127 case EOB_ACT_END_OF_FILE:
1129 (yy_did_buffer_switch_on_eof) = 0;
1133 /* Note: because we've taken care in
1134 * yy_get_next_buffer() to have set up
1135 * yytext, we can now set up
1136 * yy_c_buf_p so that if some total
1137 * hoser (like flex itself) wants to
1138 * call the scanner after we return the
1139 * YY_NULL, it'll still work - another
1140 * YY_NULL will get returned.
1142 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1144 yy_act = YY_STATE_EOF(YY_START);
1150 if ( ! (yy_did_buffer_switch_on_eof) )
1156 case EOB_ACT_CONTINUE_SCAN:
1158 (yytext_ptr) + yy_amount_of_matched_text;
1160 yy_current_state = yy_get_previous_state( );
1162 yy_cp = (yy_c_buf_p);
1163 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1166 case EOB_ACT_LAST_MATCH:
1168 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1170 yy_current_state = yy_get_previous_state( );
1172 yy_cp = (yy_c_buf_p);
1173 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1174 goto yy_find_action;
1181 "fatal flex scanner internal error--no action found" );
1182 } /* end of action switch */
1183 } /* end of scanning one token */
1184 } /* end of user's declarations */
1185 } /* end of yylex */
1187 /* yy_get_next_buffer - try to read in a new buffer
1189 * Returns a code representing an action:
1190 * EOB_ACT_LAST_MATCH -
1191 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1192 * EOB_ACT_END_OF_FILE - end of file
1194 static int yy_get_next_buffer (void)
1196 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1197 char *source = (yytext_ptr);
1198 int number_to_move, i;
1201 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1203 "fatal flex scanner internal error--end of buffer missed" );
1205 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1206 { /* Don't try to fill the buffer, so this is an EOF. */
1207 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1209 /* We matched a single character, the EOB, so
1210 * treat this as a final EOF.
1212 return EOB_ACT_END_OF_FILE;
1217 /* We matched some text prior to the EOB, first
1220 return EOB_ACT_LAST_MATCH;
1224 /* Try to read more data. */
1226 /* First move last chars to start of buffer. */
1227 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1229 for ( i = 0; i < number_to_move; ++i )
1230 *(dest++) = *(source++);
1232 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1233 /* don't do the read, it's not guaranteed to return an EOF,
1236 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1241 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1243 while ( num_to_read <= 0 )
1244 { /* Not enough room in the buffer - grow it. */
1246 /* just a shorter name for the current buffer */
1247 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1249 int yy_c_buf_p_offset =
1250 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1252 if ( b->yy_is_our_buffer )
1254 int new_size = b->yy_buf_size * 2;
1256 if ( new_size <= 0 )
1257 b->yy_buf_size += b->yy_buf_size / 8;
1259 b->yy_buf_size *= 2;
1261 b->yy_ch_buf = (char *)
1262 /* Include room in for 2 EOB chars. */
1263 yyrealloc( (void *) b->yy_ch_buf,
1264 (yy_size_t) (b->yy_buf_size + 2) );
1267 /* Can't grow it, we don't own it. */
1268 b->yy_ch_buf = NULL;
1270 if ( ! b->yy_ch_buf )
1272 "fatal error - scanner input buffer overflow" );
1274 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1276 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1281 if ( num_to_read > YY_READ_BUF_SIZE )
1282 num_to_read = YY_READ_BUF_SIZE;
1284 /* Read in more data. */
1285 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1286 (yy_n_chars), num_to_read );
1288 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1291 if ( (yy_n_chars) == 0 )
1293 if ( number_to_move == YY_MORE_ADJ )
1295 ret_val = EOB_ACT_END_OF_FILE;
1301 ret_val = EOB_ACT_LAST_MATCH;
1302 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1303 YY_BUFFER_EOF_PENDING;
1308 ret_val = EOB_ACT_CONTINUE_SCAN;
1310 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1311 /* Extend the array by 50%, plus the number we really need. */
1312 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1313 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1314 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1315 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1316 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1317 /* "- 2" to take care of EOB's */
1318 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1321 (yy_n_chars) += number_to_move;
1322 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1323 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1325 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1330 /* yy_get_previous_state - get the state just before the EOB char was reached */
1332 static yy_state_type yy_get_previous_state (void)
1334 yy_state_type yy_current_state;
1337 yy_current_state = (yy_start);
1339 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1341 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1342 if ( yy_accept[yy_current_state] )
1344 (yy_last_accepting_state) = yy_current_state;
1345 (yy_last_accepting_cpos) = yy_cp;
1347 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1349 yy_current_state = (int) yy_def[yy_current_state];
1350 if ( yy_current_state >= 209 )
1351 yy_c = yy_meta[yy_c];
1353 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1356 return yy_current_state;
1359 /* yy_try_NUL_trans - try to make a transition on the NUL character
1362 * next_state = yy_try_NUL_trans( current_state );
1364 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1367 char *yy_cp = (yy_c_buf_p);
1370 if ( yy_accept[yy_current_state] )
1372 (yy_last_accepting_state) = yy_current_state;
1373 (yy_last_accepting_cpos) = yy_cp;
1375 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1377 yy_current_state = (int) yy_def[yy_current_state];
1378 if ( yy_current_state >= 209 )
1379 yy_c = yy_meta[yy_c];
1381 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1382 yy_is_jam = (yy_current_state == 208);
1384 return yy_is_jam ? 0 : yy_current_state;
1389 static void yyunput (int c, char * yy_bp )
1393 yy_cp = (yy_c_buf_p);
1395 /* undo effects of setting up yytext */
1396 *yy_cp = (yy_hold_char);
1398 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1399 { /* need to shift things up to make room */
1400 /* +2 for EOB chars. */
1401 int number_to_move = (yy_n_chars) + 2;
1402 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1403 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1405 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1407 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1408 *--dest = *--source;
1410 yy_cp += (int) (dest - source);
1411 yy_bp += (int) (dest - source);
1412 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1413 (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1415 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1416 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1419 *--yy_cp = (char) c;
1421 (yytext_ptr) = yy_bp;
1422 (yy_hold_char) = *yy_cp;
1423 (yy_c_buf_p) = yy_cp;
1430 static int yyinput (void)
1432 static int input (void)
1438 *(yy_c_buf_p) = (yy_hold_char);
1440 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1442 /* yy_c_buf_p now points to the character we want to return.
1443 * If this occurs *before* the EOB characters, then it's a
1444 * valid NUL; if not, then we've hit the end of the buffer.
1446 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1447 /* This was really a NUL. */
1448 *(yy_c_buf_p) = '\0';
1451 { /* need more input */
1452 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1455 switch ( yy_get_next_buffer( ) )
1457 case EOB_ACT_LAST_MATCH:
1458 /* This happens because yy_g_n_b()
1459 * sees that we've accumulated a
1460 * token and flags that we need to
1461 * try matching the token before
1462 * proceeding. But for input(),
1463 * there's no matching to consider.
1464 * So convert the EOB_ACT_LAST_MATCH
1465 * to EOB_ACT_END_OF_FILE.
1468 /* Reset buffer status. */
1473 case EOB_ACT_END_OF_FILE:
1478 if ( ! (yy_did_buffer_switch_on_eof) )
1487 case EOB_ACT_CONTINUE_SCAN:
1488 (yy_c_buf_p) = (yytext_ptr) + offset;
1494 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1495 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1496 (yy_hold_char) = *++(yy_c_buf_p);
1500 #endif /* ifndef YY_NO_INPUT */
1502 /** Immediately switch to a different input stream.
1503 * @param input_file A readable stream.
1505 * @note This function does not reset the start condition to @c INITIAL .
1507 void yyrestart (FILE * input_file )
1510 if ( ! YY_CURRENT_BUFFER ){
1511 yyensure_buffer_stack ();
1512 YY_CURRENT_BUFFER_LVALUE =
1513 yy_create_buffer( yyin, YY_BUF_SIZE );
1516 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1517 yy_load_buffer_state( );
1520 /** Switch to a different input buffer.
1521 * @param new_buffer The new input buffer.
1524 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1527 /* TODO. We should be able to replace this entire function body
1529 * yypop_buffer_state();
1530 * yypush_buffer_state(new_buffer);
1532 yyensure_buffer_stack ();
1533 if ( YY_CURRENT_BUFFER == new_buffer )
1536 if ( YY_CURRENT_BUFFER )
1538 /* Flush out information for old buffer. */
1539 *(yy_c_buf_p) = (yy_hold_char);
1540 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1541 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1544 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1545 yy_load_buffer_state( );
1547 /* We don't actually know whether we did this switch during
1548 * EOF (yywrap()) processing, but the only time this flag
1549 * is looked at is after yywrap() is called, so it's safe
1550 * to go ahead and always set it.
1552 (yy_did_buffer_switch_on_eof) = 1;
1555 static void yy_load_buffer_state (void)
1557 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1558 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1559 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1560 (yy_hold_char) = *(yy_c_buf_p);
1563 /** Allocate and initialize an input buffer state.
1564 * @param file A readable stream.
1565 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1567 * @return the allocated buffer state.
1569 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1573 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1575 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1577 b->yy_buf_size = size;
1579 /* yy_ch_buf has to be 2 characters longer than the size given because
1580 * we need to put in 2 end-of-buffer characters.
1582 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1583 if ( ! b->yy_ch_buf )
1584 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1586 b->yy_is_our_buffer = 1;
1588 yy_init_buffer( b, file );
1593 /** Destroy the buffer.
1594 * @param b a buffer created with yy_create_buffer()
1597 void yy_delete_buffer (YY_BUFFER_STATE b )
1603 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1604 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1606 if ( b->yy_is_our_buffer )
1607 yyfree( (void *) b->yy_ch_buf );
1609 yyfree( (void *) b );
1612 /* Initializes or reinitializes a buffer.
1613 * This function is sometimes called more than once on the same buffer,
1614 * such as during a yyrestart() or at EOF.
1616 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1621 yy_flush_buffer( b );
1623 b->yy_input_file = file;
1624 b->yy_fill_buffer = 1;
1626 /* If b is the current buffer, then yy_init_buffer was _probably_
1627 * called from yyrestart() or through yy_get_next_buffer.
1628 * In that case, we don't want to reset the lineno or column.
1630 if (b != YY_CURRENT_BUFFER){
1631 b->yy_bs_lineno = 1;
1632 b->yy_bs_column = 0;
1635 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1640 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1641 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1644 void yy_flush_buffer (YY_BUFFER_STATE b )
1651 /* We always need two end-of-buffer characters. The first causes
1652 * a transition to the end-of-buffer state. The second causes
1653 * a jam in that state.
1655 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1656 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1658 b->yy_buf_pos = &b->yy_ch_buf[0];
1661 b->yy_buffer_status = YY_BUFFER_NEW;
1663 if ( b == YY_CURRENT_BUFFER )
1664 yy_load_buffer_state( );
1667 /** Pushes the new state onto the stack. The new state becomes
1668 * the current state. This function will allocate the stack
1670 * @param new_buffer The new state.
1673 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1675 if (new_buffer == NULL)
1678 yyensure_buffer_stack();
1680 /* This block is copied from yy_switch_to_buffer. */
1681 if ( YY_CURRENT_BUFFER )
1683 /* Flush out information for old buffer. */
1684 *(yy_c_buf_p) = (yy_hold_char);
1685 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1686 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1689 /* Only push if top exists. Otherwise, replace top. */
1690 if (YY_CURRENT_BUFFER)
1691 (yy_buffer_stack_top)++;
1692 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1694 /* copied from yy_switch_to_buffer. */
1695 yy_load_buffer_state( );
1696 (yy_did_buffer_switch_on_eof) = 1;
1699 /** Removes and deletes the top of the stack, if present.
1700 * The next element becomes the new top.
1703 void yypop_buffer_state (void)
1705 if (!YY_CURRENT_BUFFER)
1708 yy_delete_buffer(YY_CURRENT_BUFFER );
1709 YY_CURRENT_BUFFER_LVALUE = NULL;
1710 if ((yy_buffer_stack_top) > 0)
1711 --(yy_buffer_stack_top);
1713 if (YY_CURRENT_BUFFER) {
1714 yy_load_buffer_state( );
1715 (yy_did_buffer_switch_on_eof) = 1;
1719 /* Allocates the stack if it does not exist.
1720 * Guarantees space for at least one push.
1722 static void yyensure_buffer_stack (void)
1724 yy_size_t num_to_alloc;
1726 if (!(yy_buffer_stack)) {
1728 /* First allocation is just for 2 elements, since we don't know if this
1729 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1730 * immediate realloc on the next call.
1732 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1733 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1734 (num_to_alloc * sizeof(struct yy_buffer_state*)
1736 if ( ! (yy_buffer_stack) )
1737 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1739 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1741 (yy_buffer_stack_max) = num_to_alloc;
1742 (yy_buffer_stack_top) = 0;
1746 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1748 /* Increase the buffer to prepare for a possible push. */
1749 yy_size_t grow_size = 8 /* arbitrary grow size */;
1751 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1752 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1754 num_to_alloc * sizeof(struct yy_buffer_state*)
1756 if ( ! (yy_buffer_stack) )
1757 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1759 /* zero only the new slots.*/
1760 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1761 (yy_buffer_stack_max) = num_to_alloc;
1765 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1766 * @param base the character buffer
1767 * @param size the size in bytes of the character buffer
1769 * @return the newly allocated buffer state object.
1771 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1776 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1777 base[size-1] != YY_END_OF_BUFFER_CHAR )
1778 /* They forgot to leave room for the EOB's. */
1781 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1783 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1785 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
1786 b->yy_buf_pos = b->yy_ch_buf = base;
1787 b->yy_is_our_buffer = 0;
1788 b->yy_input_file = NULL;
1789 b->yy_n_chars = b->yy_buf_size;
1790 b->yy_is_interactive = 0;
1792 b->yy_fill_buffer = 0;
1793 b->yy_buffer_status = YY_BUFFER_NEW;
1795 yy_switch_to_buffer( b );
1800 /** Setup the input buffer state to scan a string. The next call to yylex() will
1801 * scan from a @e copy of @a str.
1802 * @param yystr a NUL-terminated string to scan
1804 * @return the newly allocated buffer state object.
1805 * @note If you want to scan bytes that may contain NUL values, then use
1806 * yy_scan_bytes() instead.
1808 YY_BUFFER_STATE yy_scan_string (const char * yystr )
1811 return yy_scan_bytes( yystr, (int) strlen(yystr) );
1814 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1815 * scan from a @e copy of @a bytes.
1816 * @param yybytes the byte buffer to scan
1817 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1819 * @return the newly allocated buffer state object.
1821 YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
1828 /* Get memory for full buffer, including space for trailing EOB's. */
1829 n = (yy_size_t) (_yybytes_len + 2);
1830 buf = (char *) yyalloc( n );
1832 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1834 for ( i = 0; i < _yybytes_len; ++i )
1835 buf[i] = yybytes[i];
1837 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1839 b = yy_scan_buffer( buf, n );
1841 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1843 /* It's okay to grow etc. this buffer, and we should throw it
1844 * away when we're done.
1846 b->yy_is_our_buffer = 1;
1851 #ifndef YY_EXIT_FAILURE
1852 #define YY_EXIT_FAILURE 2
1855 static void yynoreturn yy_fatal_error (const char* msg )
1857 fprintf( stderr, "%s\n", msg );
1858 exit( YY_EXIT_FAILURE );
1861 /* Redefine yyless() so it works in section 3 code. */
1867 /* Undo effects of setting up yytext. */ \
1868 int yyless_macro_arg = (n); \
1869 YY_LESS_LINENO(yyless_macro_arg);\
1870 yytext[yyleng] = (yy_hold_char); \
1871 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1872 (yy_hold_char) = *(yy_c_buf_p); \
1873 *(yy_c_buf_p) = '\0'; \
1874 yyleng = yyless_macro_arg; \
1878 /* Accessor methods (get/set functions) to struct members. */
1880 /** Get the current line number.
1883 int yyget_lineno (void)
1889 /** Get the input stream.
1892 FILE *yyget_in (void)
1897 /** Get the output stream.
1900 FILE *yyget_out (void)
1905 /** Get the length of the current token.
1908 int yyget_leng (void)
1913 /** Get the current token.
1917 char *yyget_text (void)
1922 /** Set the current line number.
1923 * @param _line_number line number
1926 void yyset_lineno (int _line_number )
1929 yylineno = _line_number;
1932 /** Set the input stream. This does not discard the current
1934 * @param _in_str A readable stream.
1936 * @see yy_switch_to_buffer
1938 void yyset_in (FILE * _in_str )
1943 void yyset_out (FILE * _out_str )
1948 int yyget_debug (void)
1950 return yy_flex_debug;
1953 void yyset_debug (int _bdebug )
1955 yy_flex_debug = _bdebug ;
1958 static int yy_init_globals (void)
1960 /* Initialization is the same as for the non-reentrant scanner.
1961 * This function is called from yylex_destroy(), so don't allocate here.
1964 (yy_buffer_stack) = NULL;
1965 (yy_buffer_stack_top) = 0;
1966 (yy_buffer_stack_max) = 0;
1967 (yy_c_buf_p) = NULL;
1971 /* Defined in main.c */
1980 /* For future reference: Set errno on error, since we are called by
1986 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1987 int yylex_destroy (void)
1990 /* Pop the buffer stack, destroying each element. */
1991 while(YY_CURRENT_BUFFER){
1992 yy_delete_buffer( YY_CURRENT_BUFFER );
1993 YY_CURRENT_BUFFER_LVALUE = NULL;
1994 yypop_buffer_state();
1997 /* Destroy the stack itself. */
1998 yyfree((yy_buffer_stack) );
1999 (yy_buffer_stack) = NULL;
2001 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2002 * yylex() is called, initialization will occur. */
2009 * Internal utility routines.
2013 static void yy_flex_strncpy (char* s1, const char * s2, int n )
2017 for ( i = 0; i < n; ++i )
2022 #ifdef YY_NEED_STRLEN
2023 static int yy_flex_strlen (const char * s )
2026 for ( n = 0; s[n]; ++n )
2033 void *yyalloc (yy_size_t size )
2035 return malloc(size);
2038 void *yyrealloc (void * ptr, yy_size_t size )
2041 /* The cast to (char *) in the following accommodates both
2042 * implementations that use char* generic pointers, and those
2043 * that use void* generic pointers. It works with the latter
2044 * because both ANSI C and C++ allow castless assignment from
2045 * any pointer type to void*, and deal with argument conversions
2046 * as though doing an assignment.
2048 return realloc(ptr, size);
2051 void yyfree (void * ptr )
2053 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2056 #define YYTABLES_NAME "yytables"