2 #line 3 "/coreboot/util/bincfg/bincfg.lex.c_shipped"
4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11 #define YY_FLEX_SUBMINOR_VERSION 39
12 #if YY_FLEX_SUBMINOR_VERSION > 0
16 /* First, we deal with platform-specific or compiler-specific issues. */
18 /* begin standard C headers. */
24 /* end standard C headers. */
26 /* flex integer type definitions */
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t;
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
57 /* Limits of integral types. */
59 #define INT8_MIN (-128)
62 #define INT16_MIN (-32767-1)
65 #define INT32_MIN (-2147483647-1)
68 #define INT8_MAX (127)
71 #define INT16_MAX (32767)
74 #define INT32_MAX (2147483647)
77 #define UINT8_MAX (255U)
80 #define UINT16_MAX (65535U)
83 #define UINT32_MAX (4294967295U)
88 #endif /* ! FLEXINT_H */
92 /* The "const" storage-class-modifier is valid. */
95 #else /* ! __cplusplus */
97 /* C99 requires __STDC__ to be defined as 1. */
98 #if defined (__STDC__)
102 #endif /* defined (__STDC__) */
103 #endif /* ! __cplusplus */
106 #define yyconst const
111 /* Returned upon end-of-file. */
114 /* Promotes a possibly negative, possibly signed char to an unsigned
115 * integer for use as an array index. If the signed char is negative,
116 * we want to instead treat it as an 8-bit unsigned char, hence the
119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
121 /* Enter a start condition. This macro really ought to take a parameter,
122 * but we do it the disgusting crufty way forced on us by the ()-less
123 * definition of BEGIN.
125 #define BEGIN (yy_start) = 1 + 2 *
127 /* Translate the current start state into a value that can be later handed
128 * to BEGIN to return to the state. The YYSTATE alias is for lex
131 #define YY_START (((yy_start) - 1) / 2)
132 #define YYSTATE YY_START
134 /* Action number for EOF rule of a given start state. */
135 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
137 /* Special action meaning "start processing a new file". */
138 #define YY_NEW_FILE yyrestart(yyin )
140 #define YY_END_OF_BUFFER_CHAR 0
142 /* Size of default input buffer. */
145 /* On IA-64, the buffer size is 16k, not 8k.
146 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
147 * Ditto for the __ia64__ case accordingly.
149 #define YY_BUF_SIZE 32768
151 #define YY_BUF_SIZE 16384
152 #endif /* __ia64__ */
155 /* The state buf must be large enough to hold one state per character in the main buffer.
157 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
159 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
160 #define YY_TYPEDEF_YY_BUFFER_STATE
161 typedef struct yy_buffer_state *YY_BUFFER_STATE;
164 #ifndef YY_TYPEDEF_YY_SIZE_T
165 #define YY_TYPEDEF_YY_SIZE_T
166 typedef size_t yy_size_t;
169 extern yy_size_t yyleng;
171 extern FILE *yyin, *yyout;
173 #define EOB_ACT_CONTINUE_SCAN 0
174 #define EOB_ACT_END_OF_FILE 1
175 #define EOB_ACT_LAST_MATCH 2
177 #define YY_LESS_LINENO(n)
178 #define YY_LINENO_REWIND_TO(ptr)
180 /* Return all but the first "n" matched characters back to the input stream. */
184 /* Undo effects of setting up yytext. */ \
185 int yyless_macro_arg = (n); \
186 YY_LESS_LINENO(yyless_macro_arg);\
187 *yy_cp = (yy_hold_char); \
188 YY_RESTORE_YY_MORE_OFFSET \
189 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
190 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
194 #define unput(c) yyunput( c, (yytext_ptr) )
196 #ifndef YY_STRUCT_YY_BUFFER_STATE
197 #define YY_STRUCT_YY_BUFFER_STATE
198 struct yy_buffer_state
202 char *yy_ch_buf; /* input buffer */
203 char *yy_buf_pos; /* current position in input buffer */
205 /* Size of input buffer in bytes, not including room for EOB
208 yy_size_t yy_buf_size;
210 /* Number of characters read into yy_ch_buf, not including EOB
213 yy_size_t yy_n_chars;
215 /* Whether we "own" the buffer - i.e., we know we created it,
216 * and can realloc() it to grow it, and should free() it to
219 int yy_is_our_buffer;
221 /* Whether this is an "interactive" input source; if so, and
222 * if we're using stdio for input, then we want to use getc()
223 * instead of fread(), to make sure we stop fetching input after
226 int yy_is_interactive;
228 /* Whether we're considered to be at the beginning of a line.
229 * If so, '^' rules will be active on the next match, otherwise
234 int yy_bs_lineno; /**< The line count. */
235 int yy_bs_column; /**< The column count. */
237 /* Whether to try to fill the input buffer when we reach the
242 int yy_buffer_status;
244 #define YY_BUFFER_NEW 0
245 #define YY_BUFFER_NORMAL 1
246 /* When an EOF's been seen but there's still some text to process
247 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
248 * shouldn't try reading from the input source any more. We might
249 * still have a bunch of tokens to match, though, because of
250 * possible backing-up.
252 * When we actually see the EOF, we change the status to "new"
253 * (via yyrestart()), so that the user can continue scanning by
254 * just pointing yyin at a new input file.
256 #define YY_BUFFER_EOF_PENDING 2
259 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
261 /* Stack of input buffers. */
262 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
263 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
264 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
266 /* We provide macros for accessing buffer states in case in the
267 * future we want to put the buffer states in a more general
270 * Returns the top of the stack, or NULL.
272 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
273 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
276 /* Same as previous macro, but useful when we know that the buffer stack is not
277 * NULL or when we need an lvalue. For internal use only.
279 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
281 /* yy_hold_char holds the character lost when yytext is formed. */
282 static char yy_hold_char;
283 static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
286 /* Points to current character in buffer. */
287 static char *yy_c_buf_p = (char *) 0;
288 static int yy_init = 0; /* whether we need to initialize */
289 static int yy_start = 0; /* start state number */
291 /* Flag which is used to allow yywrap()'s to do buffer switches
292 * instead of setting up a fresh yyin. A bit of a hack ...
294 static int yy_did_buffer_switch_on_eof;
296 void yyrestart (FILE *input_file );
297 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
298 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
299 void yy_delete_buffer (YY_BUFFER_STATE b );
300 void yy_flush_buffer (YY_BUFFER_STATE b );
301 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
302 void yypop_buffer_state (void );
304 static void yyensure_buffer_stack (void );
305 static void yy_load_buffer_state (void );
306 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
308 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
310 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
311 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
312 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
314 void *yyalloc (yy_size_t );
315 void *yyrealloc (void *,yy_size_t );
316 void yyfree (void * );
318 #define yy_new_buffer yy_create_buffer
320 #define yy_set_interactive(is_interactive) \
322 if ( ! YY_CURRENT_BUFFER ){ \
323 yyensure_buffer_stack (); \
324 YY_CURRENT_BUFFER_LVALUE = \
325 yy_create_buffer(yyin,YY_BUF_SIZE ); \
327 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
330 #define yy_set_bol(at_bol) \
332 if ( ! YY_CURRENT_BUFFER ){\
333 yyensure_buffer_stack (); \
334 YY_CURRENT_BUFFER_LVALUE = \
335 yy_create_buffer(yyin,YY_BUF_SIZE ); \
337 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
340 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
342 /* Begin user sect3 */
345 #define YY_SKIP_YYWRAP
347 typedef unsigned char YY_CHAR;
349 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
351 typedef int yy_state_type;
358 #define yytext_ptr yytext
360 static yy_state_type yy_get_previous_state (void );
361 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
362 static int yy_get_next_buffer (void );
363 static void yy_fatal_error (yyconst char msg[] );
365 /* Done after the current pattern has been matched and before the
366 * corresponding action - sets up yytext.
368 #define YY_DO_BEFORE_ACTION \
369 (yytext_ptr) = yy_bp; \
370 yyleng = (size_t) (yy_cp - yy_bp); \
371 (yy_hold_char) = *yy_cp; \
373 (yy_c_buf_p) = yy_cp;
375 #define YY_NUM_RULES 14
376 #define YY_END_OF_BUFFER 15
377 /* This struct is not used in this scanner,
378 but its presence is necessary. */
381 flex_int32_t yy_verify;
384 static yyconst flex_int16_t yy_accept[38] =
386 0, 0, 15, 14, 11, 14, 14, 13, 8, 14,
387 2, 2, 9, 10, 6, 7, 4, 5, 11, 0,
388 1, 0, 12, 2, 2, 0, 0, 0, 2, 2,
392 static yyconst flex_int32_t yy_ec[256] =
394 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
395 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
397 1, 2, 1, 4, 5, 1, 6, 1, 1, 1,
398 1, 1, 7, 8, 9, 10, 1, 11, 12, 12,
399 12, 12, 12, 12, 12, 12, 12, 13, 1, 1,
400 14, 1, 1, 1, 15, 15, 15, 15, 16, 15,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 17, 1, 18, 1, 1, 1, 15, 15, 15, 15,
405 16, 15, 1, 1, 1, 1, 1, 1, 1, 1,
406 1, 1, 1, 1, 1, 1, 1, 1, 1, 19,
407 1, 1, 20, 1, 21, 1, 1, 1, 1, 1,
408 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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,
416 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
417 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424 static yyconst flex_int32_t yy_meta[22] =
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 2, 2, 1, 1, 2, 2, 1, 1, 1, 1,
431 static yyconst flex_int16_t yy_base[41] =
433 0, 0, 56, 69, 20, 49, 43, 69, 69, 13,
434 16, 26, 69, 69, 69, 69, 69, 69, 25, 40,
435 69, 31, 69, 23, 0, 18, 36, 0, 0, 38,
436 29, 40, 0, 48, 50, 52, 69, 64, 66, 29
439 static yyconst flex_int16_t yy_def[41] =
441 37, 1, 37, 37, 37, 38, 39, 37, 37, 37,
442 37, 37, 37, 37, 37, 37, 37, 37, 37, 38,
443 37, 39, 37, 37, 12, 37, 37, 40, 12, 37,
444 37, 37, 40, 37, 37, 37, 0, 37, 37, 37
447 static yyconst flex_int16_t yy_nxt[91] =
449 4, 5, 5, 6, 7, 8, 4, 9, 10, 4,
450 11, 12, 13, 14, 4, 4, 15, 16, 4, 17,
451 18, 19, 19, 24, 25, 26, 19, 19, 30, 30,
452 33, 27, 26, 23, 28, 26, 29, 29, 27, 32,
453 32, 27, 31, 21, 31, 23, 32, 32, 30, 30,
454 32, 32, 21, 34, 35, 37, 35, 37, 36, 36,
455 36, 36, 36, 36, 20, 20, 22, 22, 3, 37,
456 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
457 37, 37, 37, 37, 37, 37, 37, 37, 37, 37
460 static yyconst flex_int16_t yy_chk[91] =
462 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
463 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
464 1, 5, 5, 10, 10, 11, 19, 19, 26, 26,
465 40, 11, 24, 22, 11, 12, 12, 12, 24, 31,
466 31, 12, 27, 20, 27, 7, 27, 27, 30, 30,
467 32, 32, 6, 30, 34, 3, 34, 0, 34, 34,
468 35, 35, 36, 36, 38, 38, 39, 39, 37, 37,
469 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
470 37, 37, 37, 37, 37, 37, 37, 37, 37, 37
473 static yy_state_type yy_last_accepting_state;
474 static char *yy_last_accepting_cpos;
476 extern int yy_flex_debug;
477 int yy_flex_debug = 0;
479 /* The intent behind this definition is that it'll catch
480 * any uses of REJECT which flex missed.
482 #define REJECT reject_used_but_not_detected
483 #define yymore() yymore_used_but_not_detected
484 #define YY_MORE_ADJ 0
485 #define YY_RESTORE_YY_MORE_OFFSET
488 * bincfg - Compiler/Decompiler for data blobs with specs
489 * Copyright (C) 2017 Damien Zammit <damien@zamaudio.com>
491 * This program is free software: you can redistribute it and/or modify
492 * it under the terms of the GNU General Public License as published by
493 * the Free Software Foundation, either version 3 of the License, or
494 * (at your option) any later version.
496 * This program is distributed in the hope that it will be useful,
497 * but WITHOUT ANY WARRANTY; without even the implied warranty of
498 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
499 * GNU General Public License for more details.
504 #include "bincfg.tab.h"
506 extern struct blob binary;
508 unsigned int parsehex (char *s)
510 unsigned int i, nib, val = 0;
511 unsigned int nibs = strlen(s) - 2;
513 for (i = 2; i < nibs + 2; i++) {
514 if (s[i] >= '0' && s[i] <= '9') {
516 } else if (s[i] >= 'a' && s[i] <= 'f') {
517 nib = s[i] - 'a' + 10;
518 } else if (s[i] >= 'A' && s[i] <= 'F') {
519 nib = s[i] - 'A' + 10;
523 val |= nib << (((nibs - 1) - (i - 2)) * 4);
528 char* stripquotes (char *string)
531 unsigned int len = strlen(string);
532 if (len >= 2 && string[0] == '"' && string[len - 1] == '"') {
533 stripped = (char *) malloc (len - 1);
534 if (stripped == NULL) {
535 printf("Out of memory\n");
538 snprintf (stripped, len - 1, "%s", string + 1);
546 #ifndef YY_NO_UNISTD_H
547 /* Special case for "unistd.h", since it is non-ANSI. We include it way
548 * down here because we want the user's section 1 to have been scanned first.
549 * The user has a chance to override it with an option.
554 #ifndef YY_EXTRA_TYPE
555 #define YY_EXTRA_TYPE void *
558 static int yy_init_globals (void );
560 /* Accessor methods to globals.
561 These are made visible to non-reentrant scanners for convenience. */
563 int yylex_destroy (void );
565 int yyget_debug (void );
567 void yyset_debug (int debug_flag );
569 YY_EXTRA_TYPE yyget_extra (void );
571 void yyset_extra (YY_EXTRA_TYPE user_defined );
573 FILE *yyget_in (void );
575 void yyset_in (FILE * in_str );
577 FILE *yyget_out (void );
579 void yyset_out (FILE * out_str );
581 yy_size_t yyget_leng (void );
583 char *yyget_text (void );
585 int yyget_lineno (void );
587 void yyset_lineno (int line_number );
589 /* Macros after this point can all be overridden by user definitions in
593 #ifndef YY_SKIP_YYWRAP
595 extern "C" int yywrap (void );
597 extern int yywrap (void );
602 static void yy_flex_strncpy (char *,yyconst char *,int );
605 #ifdef YY_NEED_STRLEN
606 static int yy_flex_strlen (yyconst char * );
612 static int yyinput (void );
614 static int input (void );
619 /* Amount of stuff to slurp up with each read. */
620 #ifndef YY_READ_BUF_SIZE
622 /* On IA-64, the buffer size is 16k, not 8k */
623 #define YY_READ_BUF_SIZE 16384
625 #define YY_READ_BUF_SIZE 8192
626 #endif /* __ia64__ */
629 /* Copy whatever the last rule matched to the standard output. */
631 /* This used to be an fputs(), but since the string might contain NUL's,
632 * we now use fwrite().
634 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
637 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
638 * is returned in "result".
641 #define YY_INPUT(buf,result,max_size) \
642 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
646 for ( n = 0; n < max_size && \
647 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
650 buf[n++] = (char) c; \
651 if ( c == EOF && ferror( yyin ) ) \
652 YY_FATAL_ERROR( "input in flex scanner failed" ); \
658 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
660 if( errno != EINTR) \
662 YY_FATAL_ERROR( "input in flex scanner failed" ); \
673 /* No semi-colon after return; correct usage is to write "yyterminate();" -
674 * we don't want an extra ';' after the "return" because that will cause
675 * some compilers to complain about unreachable statements.
678 #define yyterminate() return YY_NULL
681 /* Number of entries by which start-condition stack grows. */
682 #ifndef YY_START_STACK_INCR
683 #define YY_START_STACK_INCR 25
686 /* Report a fatal error. */
687 #ifndef YY_FATAL_ERROR
688 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
691 /* end tables serialization structures and prototypes */
693 /* Default declaration of generated scanner - a define so the user can
694 * easily add parameters.
697 #define YY_DECL_IS_OURS 1
699 extern int yylex (void);
701 #define YY_DECL int yylex (void)
702 #endif /* !YY_DECL */
704 /* Code executed at the beginning of each rule, after yytext and yyleng
707 #ifndef YY_USER_ACTION
708 #define YY_USER_ACTION
711 /* Code executed at the end of each rule. */
713 #define YY_BREAK break;
716 #define YY_RULE_SETUP \
719 /** The main scanner function which does all the work.
723 register yy_state_type yy_current_state;
724 register char *yy_cp, *yy_bp;
736 (yy_start) = 1; /* first start state */
744 if ( ! YY_CURRENT_BUFFER ) {
745 yyensure_buffer_stack ();
746 YY_CURRENT_BUFFER_LVALUE =
747 yy_create_buffer(yyin,YY_BUF_SIZE );
750 yy_load_buffer_state( );
755 while ( 1 ) /* loops until end-of-file is reached */
757 yy_cp = (yy_c_buf_p);
759 /* Support of yytext. */
760 *yy_cp = (yy_hold_char);
762 /* yy_bp points to the position in yy_ch_buf of the start of
767 yy_current_state = (yy_start);
771 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
772 if ( yy_accept[yy_current_state] )
774 (yy_last_accepting_state) = yy_current_state;
775 (yy_last_accepting_cpos) = yy_cp;
777 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
779 yy_current_state = (int) yy_def[yy_current_state];
780 if ( yy_current_state >= 38 )
781 yy_c = yy_meta[(unsigned int) yy_c];
783 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
786 while ( yy_base[yy_current_state] != 69 );
789 yy_act = yy_accept[yy_current_state];
791 { /* have to back up */
792 yy_cp = (yy_last_accepting_cpos);
793 yy_current_state = (yy_last_accepting_state);
794 yy_act = yy_accept[yy_current_state];
799 do_action: /* This label is used only to access EOF actions. */
802 { /* beginning of action switch */
803 case 0: /* must back up */
804 /* undo the effects of YY_DO_BEFORE_ACTION */
805 *yy_cp = (yy_hold_char);
806 yy_cp = (yy_last_accepting_cpos);
807 yy_current_state = (yy_last_accepting_state);
811 /* rule 1 can match eol */
814 yylval.str = stripquotes(yytext);
821 yylval.u32 = atoi(yytext);
828 yylval.u32 = parsehex(yytext);
875 /* rule 11 can match eol */
877 /* ignore whitespace */;
880 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
881 (yy_c_buf_p) = yy_cp -= 1;
882 YY_DO_BEFORE_ACTION; /* set up yytext again */
884 /* ignore comments */
892 case YY_STATE_EOF(INITIAL):
900 case YY_END_OF_BUFFER:
902 /* Amount of text matched not including the EOB char. */
903 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
905 /* Undo the effects of YY_DO_BEFORE_ACTION. */
906 *yy_cp = (yy_hold_char);
907 YY_RESTORE_YY_MORE_OFFSET
909 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
911 /* We're scanning a new file or input source. It's
912 * possible that this happened because the user
913 * just pointed yyin at a new source and called
914 * yylex(). If so, then we have to assure
915 * consistency between YY_CURRENT_BUFFER and our
916 * globals. Here is the right place to do so, because
917 * this is the first action (other than possibly a
918 * back-up) that will match for the new input source.
920 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
921 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
922 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
925 /* Note that here we test for yy_c_buf_p "<=" to the position
926 * of the first EOB in the buffer, since yy_c_buf_p will
927 * already have been incremented past the NUL character
928 * (since all states make transitions on EOB to the
929 * end-of-buffer state). Contrast this with the test
932 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
933 { /* This was really a NUL. */
934 yy_state_type yy_next_state;
936 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
938 yy_current_state = yy_get_previous_state( );
940 /* Okay, we're now positioned to make the NUL
941 * transition. We couldn't have
942 * yy_get_previous_state() go ahead and do it
943 * for us because it doesn't know how to deal
944 * with the possibility of jamming (and we don't
945 * want to build jamming into it because then it
946 * will run more slowly).
949 yy_next_state = yy_try_NUL_trans( yy_current_state );
951 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
955 /* Consume the NUL. */
956 yy_cp = ++(yy_c_buf_p);
957 yy_current_state = yy_next_state;
963 yy_cp = (yy_c_buf_p);
968 else switch ( yy_get_next_buffer( ) )
970 case EOB_ACT_END_OF_FILE:
972 (yy_did_buffer_switch_on_eof) = 0;
976 /* Note: because we've taken care in
977 * yy_get_next_buffer() to have set up
978 * yytext, we can now set up
979 * yy_c_buf_p so that if some total
980 * hoser (like flex itself) wants to
981 * call the scanner after we return the
982 * YY_NULL, it'll still work - another
983 * YY_NULL will get returned.
985 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
987 yy_act = YY_STATE_EOF(YY_START);
993 if ( ! (yy_did_buffer_switch_on_eof) )
999 case EOB_ACT_CONTINUE_SCAN:
1001 (yytext_ptr) + yy_amount_of_matched_text;
1003 yy_current_state = yy_get_previous_state( );
1005 yy_cp = (yy_c_buf_p);
1006 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1009 case EOB_ACT_LAST_MATCH:
1011 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1013 yy_current_state = yy_get_previous_state( );
1015 yy_cp = (yy_c_buf_p);
1016 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1017 goto yy_find_action;
1024 "fatal flex scanner internal error--no action found" );
1025 } /* end of action switch */
1026 } /* end of scanning one token */
1027 } /* end of user's declarations */
1028 } /* end of yylex */
1030 /* yy_get_next_buffer - try to read in a new buffer
1032 * Returns a code representing an action:
1033 * EOB_ACT_LAST_MATCH -
1034 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1035 * EOB_ACT_END_OF_FILE - end of file
1037 static int yy_get_next_buffer (void)
1039 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1040 register char *source = (yytext_ptr);
1041 register int number_to_move, i;
1044 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1046 "fatal flex scanner internal error--end of buffer missed" );
1048 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1049 { /* Don't try to fill the buffer, so this is an EOF. */
1050 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1052 /* We matched a single character, the EOB, so
1053 * treat this as a final EOF.
1055 return EOB_ACT_END_OF_FILE;
1060 /* We matched some text prior to the EOB, first
1063 return EOB_ACT_LAST_MATCH;
1067 /* Try to read more data. */
1069 /* First move last chars to start of buffer. */
1070 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1072 for ( i = 0; i < number_to_move; ++i )
1073 *(dest++) = *(source++);
1075 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1076 /* don't do the read, it's not guaranteed to return an EOF,
1079 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1083 yy_size_t num_to_read =
1084 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1086 while ( num_to_read <= 0 )
1087 { /* Not enough room in the buffer - grow it. */
1089 /* just a shorter name for the current buffer */
1090 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1092 int yy_c_buf_p_offset =
1093 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1095 if ( b->yy_is_our_buffer )
1097 yy_size_t new_size = b->yy_buf_size * 2;
1099 if ( new_size <= 0 )
1100 b->yy_buf_size += b->yy_buf_size / 8;
1102 b->yy_buf_size *= 2;
1104 b->yy_ch_buf = (char *)
1105 /* Include room in for 2 EOB chars. */
1106 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1109 /* Can't grow it, we don't own it. */
1112 if ( ! b->yy_ch_buf )
1114 "fatal error - scanner input buffer overflow" );
1116 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1118 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1123 if ( num_to_read > YY_READ_BUF_SIZE )
1124 num_to_read = YY_READ_BUF_SIZE;
1126 /* Read in more data. */
1127 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1128 (yy_n_chars), num_to_read );
1130 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1133 if ( (yy_n_chars) == 0 )
1135 if ( number_to_move == YY_MORE_ADJ )
1137 ret_val = EOB_ACT_END_OF_FILE;
1143 ret_val = EOB_ACT_LAST_MATCH;
1144 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1145 YY_BUFFER_EOF_PENDING;
1150 ret_val = EOB_ACT_CONTINUE_SCAN;
1152 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1153 /* Extend the array by 50%, plus the number we really need. */
1154 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1155 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1156 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1157 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1160 (yy_n_chars) += number_to_move;
1161 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1162 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1164 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1169 /* yy_get_previous_state - get the state just before the EOB char was reached */
1171 static yy_state_type yy_get_previous_state (void)
1173 register yy_state_type yy_current_state;
1174 register char *yy_cp;
1176 yy_current_state = (yy_start);
1178 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1180 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1181 if ( yy_accept[yy_current_state] )
1183 (yy_last_accepting_state) = yy_current_state;
1184 (yy_last_accepting_cpos) = yy_cp;
1186 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1188 yy_current_state = (int) yy_def[yy_current_state];
1189 if ( yy_current_state >= 38 )
1190 yy_c = yy_meta[(unsigned int) yy_c];
1192 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1195 return yy_current_state;
1198 /* yy_try_NUL_trans - try to make a transition on the NUL character
1201 * next_state = yy_try_NUL_trans( current_state );
1203 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1205 register int yy_is_jam;
1206 register char *yy_cp = (yy_c_buf_p);
1208 register YY_CHAR yy_c = 1;
1209 if ( yy_accept[yy_current_state] )
1211 (yy_last_accepting_state) = yy_current_state;
1212 (yy_last_accepting_cpos) = yy_cp;
1214 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1216 yy_current_state = (int) yy_def[yy_current_state];
1217 if ( yy_current_state >= 38 )
1218 yy_c = yy_meta[(unsigned int) yy_c];
1220 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1221 yy_is_jam = (yy_current_state == 37);
1223 return yy_is_jam ? 0 : yy_current_state;
1228 static int yyinput (void)
1230 static int input (void)
1236 *(yy_c_buf_p) = (yy_hold_char);
1238 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1240 /* yy_c_buf_p now points to the character we want to return.
1241 * If this occurs *before* the EOB characters, then it's a
1242 * valid NUL; if not, then we've hit the end of the buffer.
1244 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1245 /* This was really a NUL. */
1246 *(yy_c_buf_p) = '\0';
1249 { /* need more input */
1250 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1253 switch ( yy_get_next_buffer( ) )
1255 case EOB_ACT_LAST_MATCH:
1256 /* This happens because yy_g_n_b()
1257 * sees that we've accumulated a
1258 * token and flags that we need to
1259 * try matching the token before
1260 * proceeding. But for input(),
1261 * there's no matching to consider.
1262 * So convert the EOB_ACT_LAST_MATCH
1263 * to EOB_ACT_END_OF_FILE.
1266 /* Reset buffer status. */
1271 case EOB_ACT_END_OF_FILE:
1276 if ( ! (yy_did_buffer_switch_on_eof) )
1285 case EOB_ACT_CONTINUE_SCAN:
1286 (yy_c_buf_p) = (yytext_ptr) + offset;
1292 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1293 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1294 (yy_hold_char) = *++(yy_c_buf_p);
1298 #endif /* ifndef YY_NO_INPUT */
1300 /** Immediately switch to a different input stream.
1301 * @param input_file A readable stream.
1303 * @note This function does not reset the start condition to @c INITIAL .
1305 void yyrestart (FILE * input_file )
1308 if ( ! YY_CURRENT_BUFFER ){
1309 yyensure_buffer_stack ();
1310 YY_CURRENT_BUFFER_LVALUE =
1311 yy_create_buffer(yyin,YY_BUF_SIZE );
1314 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1315 yy_load_buffer_state( );
1318 /** Switch to a different input buffer.
1319 * @param new_buffer The new input buffer.
1322 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1325 /* TODO. We should be able to replace this entire function body
1327 * yypop_buffer_state();
1328 * yypush_buffer_state(new_buffer);
1330 yyensure_buffer_stack ();
1331 if ( YY_CURRENT_BUFFER == new_buffer )
1334 if ( YY_CURRENT_BUFFER )
1336 /* Flush out information for old buffer. */
1337 *(yy_c_buf_p) = (yy_hold_char);
1338 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1339 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1342 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1343 yy_load_buffer_state( );
1345 /* We don't actually know whether we did this switch during
1346 * EOF (yywrap()) processing, but the only time this flag
1347 * is looked at is after yywrap() is called, so it's safe
1348 * to go ahead and always set it.
1350 (yy_did_buffer_switch_on_eof) = 1;
1353 static void yy_load_buffer_state (void)
1355 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1356 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1357 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1358 (yy_hold_char) = *(yy_c_buf_p);
1361 /** Allocate and initialize an input buffer state.
1362 * @param file A readable stream.
1363 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1365 * @return the allocated buffer state.
1367 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1371 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1373 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1375 b->yy_buf_size = size;
1377 /* yy_ch_buf has to be 2 characters longer than the size given because
1378 * we need to put in 2 end-of-buffer characters.
1380 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1381 if ( ! b->yy_ch_buf )
1382 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1384 b->yy_is_our_buffer = 1;
1386 yy_init_buffer(b,file );
1391 /** Destroy the buffer.
1392 * @param b a buffer created with yy_create_buffer()
1395 void yy_delete_buffer (YY_BUFFER_STATE b )
1401 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1402 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1404 if ( b->yy_is_our_buffer )
1405 yyfree((void *) b->yy_ch_buf );
1407 yyfree((void *) b );
1410 /* Initializes or reinitializes a buffer.
1411 * This function is sometimes called more than once on the same buffer,
1412 * such as during a yyrestart() or at EOF.
1414 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1419 yy_flush_buffer(b );
1421 b->yy_input_file = file;
1422 b->yy_fill_buffer = 1;
1424 /* If b is the current buffer, then yy_init_buffer was _probably_
1425 * called from yyrestart() or through yy_get_next_buffer.
1426 * In that case, we don't want to reset the lineno or column.
1428 if (b != YY_CURRENT_BUFFER){
1429 b->yy_bs_lineno = 1;
1430 b->yy_bs_column = 0;
1433 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1438 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1439 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1442 void yy_flush_buffer (YY_BUFFER_STATE b )
1449 /* We always need two end-of-buffer characters. The first causes
1450 * a transition to the end-of-buffer state. The second causes
1451 * a jam in that state.
1453 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1454 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1456 b->yy_buf_pos = &b->yy_ch_buf[0];
1459 b->yy_buffer_status = YY_BUFFER_NEW;
1461 if ( b == YY_CURRENT_BUFFER )
1462 yy_load_buffer_state( );
1465 /** Pushes the new state onto the stack. The new state becomes
1466 * the current state. This function will allocate the stack
1468 * @param new_buffer The new state.
1471 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1473 if (new_buffer == NULL)
1476 yyensure_buffer_stack();
1478 /* This block is copied from yy_switch_to_buffer. */
1479 if ( YY_CURRENT_BUFFER )
1481 /* Flush out information for old buffer. */
1482 *(yy_c_buf_p) = (yy_hold_char);
1483 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1484 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1487 /* Only push if top exists. Otherwise, replace top. */
1488 if (YY_CURRENT_BUFFER)
1489 (yy_buffer_stack_top)++;
1490 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1492 /* copied from yy_switch_to_buffer. */
1493 yy_load_buffer_state( );
1494 (yy_did_buffer_switch_on_eof) = 1;
1497 /** Removes and deletes the top of the stack, if present.
1498 * The next element becomes the new top.
1501 void yypop_buffer_state (void)
1503 if (!YY_CURRENT_BUFFER)
1506 yy_delete_buffer(YY_CURRENT_BUFFER );
1507 YY_CURRENT_BUFFER_LVALUE = NULL;
1508 if ((yy_buffer_stack_top) > 0)
1509 --(yy_buffer_stack_top);
1511 if (YY_CURRENT_BUFFER) {
1512 yy_load_buffer_state( );
1513 (yy_did_buffer_switch_on_eof) = 1;
1517 /* Allocates the stack if it does not exist.
1518 * Guarantees space for at least one push.
1520 static void yyensure_buffer_stack (void)
1522 yy_size_t num_to_alloc;
1524 if (!(yy_buffer_stack)) {
1526 /* First allocation is just for 2 elements, since we don't know if this
1527 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1528 * immediate realloc on the next call.
1531 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1532 (num_to_alloc * sizeof(struct yy_buffer_state*)
1534 if ( ! (yy_buffer_stack) )
1535 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1537 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1539 (yy_buffer_stack_max) = num_to_alloc;
1540 (yy_buffer_stack_top) = 0;
1544 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1546 /* Increase the buffer to prepare for a possible push. */
1547 int grow_size = 8 /* arbitrary grow size */;
1549 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1550 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1552 num_to_alloc * sizeof(struct yy_buffer_state*)
1554 if ( ! (yy_buffer_stack) )
1555 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1557 /* zero only the new slots.*/
1558 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1559 (yy_buffer_stack_max) = num_to_alloc;
1563 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1564 * @param base the character buffer
1565 * @param size the size in bytes of the character buffer
1567 * @return the newly allocated buffer state object.
1569 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1574 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1575 base[size-1] != YY_END_OF_BUFFER_CHAR )
1576 /* They forgot to leave room for the EOB's. */
1579 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1581 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1583 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1584 b->yy_buf_pos = b->yy_ch_buf = base;
1585 b->yy_is_our_buffer = 0;
1586 b->yy_input_file = 0;
1587 b->yy_n_chars = b->yy_buf_size;
1588 b->yy_is_interactive = 0;
1590 b->yy_fill_buffer = 0;
1591 b->yy_buffer_status = YY_BUFFER_NEW;
1593 yy_switch_to_buffer(b );
1598 /** Setup the input buffer state to scan a string. The next call to yylex() will
1599 * scan from a @e copy of @a str.
1600 * @param yystr a NUL-terminated string to scan
1602 * @return the newly allocated buffer state object.
1603 * @note If you want to scan bytes that may contain NUL values, then use
1604 * yy_scan_bytes() instead.
1606 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1609 return yy_scan_bytes(yystr,strlen(yystr) );
1612 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1613 * scan from a @e copy of @a bytes.
1614 * @param yybytes the byte buffer to scan
1615 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1617 * @return the newly allocated buffer state object.
1619 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1626 /* Get memory for full buffer, including space for trailing EOB's. */
1627 n = _yybytes_len + 2;
1628 buf = (char *) yyalloc(n );
1630 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1632 for ( i = 0; i < _yybytes_len; ++i )
1633 buf[i] = yybytes[i];
1635 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1637 b = yy_scan_buffer(buf,n );
1639 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1641 /* It's okay to grow etc. this buffer, and we should throw it
1642 * away when we're done.
1644 b->yy_is_our_buffer = 1;
1649 #ifndef YY_EXIT_FAILURE
1650 #define YY_EXIT_FAILURE 2
1653 static void yy_fatal_error (yyconst char* msg )
1655 (void) fprintf( stderr, "%s\n", msg );
1656 exit( YY_EXIT_FAILURE );
1659 /* Redefine yyless() so it works in section 3 code. */
1665 /* Undo effects of setting up yytext. */ \
1666 int yyless_macro_arg = (n); \
1667 YY_LESS_LINENO(yyless_macro_arg);\
1668 yytext[yyleng] = (yy_hold_char); \
1669 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1670 (yy_hold_char) = *(yy_c_buf_p); \
1671 *(yy_c_buf_p) = '\0'; \
1672 yyleng = yyless_macro_arg; \
1676 /* Accessor methods (get/set functions) to struct members. */
1678 /** Get the current line number.
1681 int yyget_lineno (void)
1687 /** Get the input stream.
1690 FILE *yyget_in (void)
1695 /** Get the output stream.
1698 FILE *yyget_out (void)
1703 /** Get the length of the current token.
1706 yy_size_t yyget_leng (void)
1711 /** Get the current token.
1715 char *yyget_text (void)
1720 /** Set the current line number.
1721 * @param line_number
1724 void yyset_lineno (int line_number )
1727 yylineno = line_number;
1730 /** Set the input stream. This does not discard the current
1732 * @param in_str A readable stream.
1734 * @see yy_switch_to_buffer
1736 void yyset_in (FILE * in_str )
1741 void yyset_out (FILE * out_str )
1746 int yyget_debug (void)
1748 return yy_flex_debug;
1751 void yyset_debug (int bdebug )
1753 yy_flex_debug = bdebug ;
1756 static int yy_init_globals (void)
1758 /* Initialization is the same as for the non-reentrant scanner.
1759 * This function is called from yylex_destroy(), so don't allocate here.
1762 (yy_buffer_stack) = 0;
1763 (yy_buffer_stack_top) = 0;
1764 (yy_buffer_stack_max) = 0;
1765 (yy_c_buf_p) = (char *) 0;
1769 /* Defined in main.c */
1778 /* For future reference: Set errno on error, since we are called by
1784 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1785 int yylex_destroy (void)
1788 /* Pop the buffer stack, destroying each element. */
1789 while(YY_CURRENT_BUFFER){
1790 yy_delete_buffer(YY_CURRENT_BUFFER );
1791 YY_CURRENT_BUFFER_LVALUE = NULL;
1792 yypop_buffer_state();
1795 /* Destroy the stack itself. */
1796 yyfree((yy_buffer_stack) );
1797 (yy_buffer_stack) = NULL;
1799 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1800 * yylex() is called, initialization will occur. */
1807 * Internal utility routines.
1811 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1814 for ( i = 0; i < n; ++i )
1819 #ifdef YY_NEED_STRLEN
1820 static int yy_flex_strlen (yyconst char * s )
1823 for ( n = 0; s[n]; ++n )
1830 void *yyalloc (yy_size_t size )
1832 return (void *) malloc( size );
1835 void *yyrealloc (void * ptr, yy_size_t size )
1837 /* The cast to (char *) in the following accommodates both
1838 * implementations that use char* generic pointers, and those
1839 * that use void* generic pointers. It works with the latter
1840 * because both ANSI C and C++ allow castless assignment from
1841 * any pointer type to void*, and deal with argument conversions
1842 * as though doing an assignment.
1844 return (void *) realloc( (char *) ptr, size );
1847 void yyfree (void * ptr )
1849 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1852 #define YYTABLES_NAME "yytables"
1854 void set_input_string(char* in) {