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 31
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 typedef int8_t flex_int8_t;
36 typedef uint8_t flex_uint8_t;
37 typedef int16_t flex_int16_t;
38 typedef uint16_t flex_uint16_t;
39 typedef int32_t flex_int32_t;
40 typedef uint32_t flex_uint32_t;
42 typedef signed char flex_int8_t;
43 typedef short int flex_int16_t;
44 typedef int flex_int32_t;
45 typedef unsigned char flex_uint8_t;
46 typedef unsigned short int flex_uint16_t;
47 typedef unsigned int flex_uint32_t;
50 /* Limits of integral types. */
52 #define INT8_MIN (-128)
55 #define INT16_MIN (-32767-1)
58 #define INT32_MIN (-2147483647-1)
61 #define INT8_MAX (127)
64 #define INT16_MAX (32767)
67 #define INT32_MAX (2147483647)
70 #define UINT8_MAX (255U)
73 #define UINT16_MAX (65535U)
76 #define UINT32_MAX (4294967295U)
79 #endif /* ! FLEXINT_H */
83 /* The "const" storage-class-modifier is valid. */
86 #else /* ! __cplusplus */
93 #endif /* ! __cplusplus */
101 /* Returned upon end-of-file. */
104 /* Promotes a possibly negative, possibly signed char to an unsigned
105 * integer for use as an array index. If the signed char is negative,
106 * we want to instead treat it as an 8-bit unsigned char, hence the
109 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned 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 *
117 /* Translate the current start state into a value that can be later handed
118 * to BEGIN to return to the state. The YYSTATE alias is for lex
121 #define YY_START (((yy_start) - 1) / 2)
122 #define YYSTATE YY_START
124 /* Action number for EOF rule of a given start state. */
125 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
127 /* Special action meaning "start processing a new file". */
128 #define YY_NEW_FILE yyrestart(yyin )
130 #define YY_END_OF_BUFFER_CHAR 0
132 /* Size of default input buffer. */
134 #define YY_BUF_SIZE 16384
137 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
138 #define YY_TYPEDEF_YY_BUFFER_STATE
139 typedef struct yy_buffer_state *YY_BUFFER_STATE;
144 extern FILE *yyin, *yyout;
146 #define EOB_ACT_CONTINUE_SCAN 0
147 #define EOB_ACT_END_OF_FILE 1
148 #define EOB_ACT_LAST_MATCH 2
150 #define YY_LESS_LINENO(n)
152 /* Return all but the first "n" matched characters back to the input stream. */
156 /* Undo effects of setting up yytext. */ \
157 int yyless_macro_arg = (n); \
158 YY_LESS_LINENO(yyless_macro_arg);\
159 *yy_cp = (yy_hold_char); \
160 YY_RESTORE_YY_MORE_OFFSET \
161 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
162 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
166 #define unput(c) yyunput( c, (yytext_ptr) )
168 /* The following is because we cannot portably get our hands on size_t
169 * (without autoconf's help, which isn't available because we want
170 * flex-generated scanners to compile on their own).
173 #ifndef YY_TYPEDEF_YY_SIZE_T
174 #define YY_TYPEDEF_YY_SIZE_T
175 typedef unsigned int yy_size_t;
178 #ifndef YY_STRUCT_YY_BUFFER_STATE
179 #define YY_STRUCT_YY_BUFFER_STATE
180 struct yy_buffer_state
184 char *yy_ch_buf; /* input buffer */
185 char *yy_buf_pos; /* current position in input buffer */
187 /* Size of input buffer in bytes, not including room for EOB
190 yy_size_t yy_buf_size;
192 /* Number of characters read into yy_ch_buf, not including EOB
197 /* Whether we "own" the buffer - i.e., we know we created it,
198 * and can realloc() it to grow it, and should free() it to
201 int yy_is_our_buffer;
203 /* Whether this is an "interactive" input source; if so, and
204 * if we're using stdio for input, then we want to use getc()
205 * instead of fread(), to make sure we stop fetching input after
208 int yy_is_interactive;
210 /* Whether we're considered to be at the beginning of a line.
211 * If so, '^' rules will be active on the next match, otherwise
216 int yy_bs_lineno; /**< The line count. */
217 int yy_bs_column; /**< The column count. */
219 /* Whether to try to fill the input buffer when we reach the
224 int yy_buffer_status;
226 #define YY_BUFFER_NEW 0
227 #define YY_BUFFER_NORMAL 1
228 /* When an EOF's been seen but there's still some text to process
229 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
230 * shouldn't try reading from the input source any more. We might
231 * still have a bunch of tokens to match, though, because of
232 * possible backing-up.
234 * When we actually see the EOF, we change the status to "new"
235 * (via yyrestart()), so that the user can continue scanning by
236 * just pointing yyin at a new input file.
238 #define YY_BUFFER_EOF_PENDING 2
241 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
243 /* Stack of input buffers. */
244 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
245 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
246 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
248 /* We provide macros for accessing buffer states in case in the
249 * future we want to put the buffer states in a more general
252 * Returns the top of the stack, or NULL.
254 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
255 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
258 /* Same as previous macro, but useful when we know that the buffer stack is not
259 * NULL or when we need an lvalue. For internal use only.
261 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
263 /* yy_hold_char holds the character lost when yytext is formed. */
264 static char yy_hold_char;
265 static int yy_n_chars; /* number of characters read into yy_ch_buf */
268 /* Points to current character in buffer. */
269 static char *yy_c_buf_p = (char *) 0;
270 static int yy_init = 1; /* whether we need to initialize */
271 static int yy_start = 0; /* start state number */
273 /* Flag which is used to allow yywrap()'s to do buffer switches
274 * instead of setting up a fresh yyin. A bit of a hack ...
276 static int yy_did_buffer_switch_on_eof;
278 void yyrestart (FILE *input_file );
279 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
280 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
281 void yy_delete_buffer (YY_BUFFER_STATE b );
282 void yy_flush_buffer (YY_BUFFER_STATE b );
283 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
284 void yypop_buffer_state (void );
286 static void yyensure_buffer_stack (void );
287 static void yy_load_buffer_state (void );
288 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
290 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
292 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
293 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
294 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
296 void *yyalloc (yy_size_t );
297 void *yyrealloc (void *,yy_size_t );
298 void yyfree (void * );
300 #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; \
312 #define yy_set_bol(at_bol) \
314 if ( ! YY_CURRENT_BUFFER ){\
315 yyensure_buffer_stack (); \
316 YY_CURRENT_BUFFER_LVALUE = \
317 yy_create_buffer(yyin,YY_BUF_SIZE ); \
319 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
322 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
324 /* Begin user sect3 */
326 typedef unsigned char YY_CHAR;
328 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
330 typedef int yy_state_type;
337 #define yytext_ptr yytext
339 static yy_state_type yy_get_previous_state (void );
340 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
341 static int yy_get_next_buffer (void );
342 static void yy_fatal_error (yyconst char msg[] );
344 /* Done after the current pattern has been matched and before the
345 * corresponding action - sets up yytext.
347 #define YY_DO_BEFORE_ACTION \
348 (yytext_ptr) = yy_bp; \
349 yyleng = (size_t) (yy_cp - yy_bp); \
350 (yy_hold_char) = *yy_cp; \
352 (yy_c_buf_p) = yy_cp;
354 #define YY_NUM_RULES 16
355 #define YY_END_OF_BUFFER 17
356 /* This struct is not used in this scanner,
357 but its presence is necessary. */
360 flex_int32_t yy_verify;
363 static yyconst flex_int16_t yy_accept[46] =
365 0, 0, 17, 15, 11, 12, 13, 10, 9, 14,
366 14, 14, 14, 10, 9, 14, 3, 14, 14, 1,
367 7, 14, 14, 8, 14, 14, 14, 14, 14, 14,
368 14, 6, 14, 14, 5, 14, 14, 14, 14, 14,
372 static yyconst flex_int32_t yy_ec[256] =
374 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
375 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 2, 1, 4, 5, 1, 1, 1, 1, 1,
378 1, 1, 1, 1, 1, 1, 1, 6, 6, 6,
379 6, 6, 6, 6, 6, 6, 6, 1, 1, 1,
380 1, 1, 1, 1, 7, 7, 7, 7, 7, 7,
381 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
382 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
383 1, 1, 1, 1, 8, 1, 9, 10, 11, 12,
385 13, 14, 7, 7, 15, 7, 7, 16, 7, 17,
386 18, 19, 7, 20, 7, 21, 7, 7, 7, 22,
387 7, 7, 1, 1, 1, 1, 1, 1, 1, 1,
388 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
389 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
390 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
391 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
392 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
393 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
394 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
396 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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, 1, 1, 1, 1, 1, 1,
400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
404 static yyconst flex_int32_t yy_meta[23] =
406 1, 1, 2, 1, 1, 3, 3, 3, 3, 3,
407 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
411 static yyconst flex_int16_t yy_base[48] =
413 0, 0, 56, 57, 57, 57, 57, 0, 49, 0,
414 12, 13, 34, 0, 47, 0, 0, 40, 31, 0,
415 0, 38, 36, 0, 30, 34, 32, 25, 22, 28,
416 34, 0, 19, 13, 0, 22, 30, 26, 26, 18,
417 12, 0, 14, 0, 57, 34, 23
420 static yyconst flex_int16_t yy_def[48] =
422 45, 1, 45, 45, 45, 45, 45, 46, 47, 47,
423 47, 47, 47, 46, 47, 47, 47, 47, 47, 47,
424 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
425 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
426 47, 47, 47, 47, 0, 45, 45
429 static yyconst flex_int16_t yy_nxt[80] =
431 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
432 10, 10, 11, 10, 12, 10, 10, 10, 13, 10,
433 10, 10, 17, 36, 21, 16, 44, 43, 18, 22,
434 42, 19, 20, 37, 14, 41, 14, 40, 39, 38,
435 35, 34, 33, 32, 31, 30, 29, 28, 27, 26,
436 25, 24, 15, 23, 15, 45, 3, 45, 45, 45,
437 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
438 45, 45, 45, 45, 45, 45, 45, 45, 45
441 static yyconst flex_int16_t yy_chk[80] =
443 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
444 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
445 1, 1, 11, 34, 12, 47, 43, 41, 11, 12,
446 40, 11, 11, 34, 46, 39, 46, 38, 37, 36,
447 33, 31, 30, 29, 28, 27, 26, 25, 23, 22,
448 19, 18, 15, 13, 9, 3, 45, 45, 45, 45,
449 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
450 45, 45, 45, 45, 45, 45, 45, 45, 45
453 static yy_state_type yy_last_accepting_state;
454 static char *yy_last_accepting_cpos;
456 extern int yy_flex_debug;
457 int yy_flex_debug = 0;
459 /* The intent behind this definition is that it'll catch
460 * any uses of REJECT which flex missed.
462 #define REJECT reject_used_but_not_detected
463 #define yymore() yymore_used_but_not_detected
464 #define YY_MORE_ADJ 0
465 #define YY_RESTORE_YY_MORE_OFFSET
470 * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
471 * (Royal Institute of Technology, Stockholm, Sweden).
472 * All rights reserved.
474 * Redistribution and use in source and binary forms, with or without
475 * modification, are permitted provided that the following conditions
478 * 1. Redistributions of source code must retain the above copyright
479 * notice, this list of conditions and the following disclaimer.
481 * 2. Redistributions in binary form must reproduce the above copyright
482 * notice, this list of conditions and the following disclaimer in the
483 * documentation and/or other materials provided with the distribution.
485 * 3. Neither the name of the Institute nor the names of its contributors
486 * may be used to endorse or promote products derived from this software
487 * without specific prior written permission.
489 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
490 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
491 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
492 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
493 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
494 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
495 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
496 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
497 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
498 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
503 * This is to handle the definition of this symbol in some AIX
504 * headers, which will conflict with the definition that lex will
505 * generate for it. It's only a problem for AIX lex.
510 #include "compile_et.h"
514 RCSID("$Id: lex.l,v 1.8 2005/05/16 08:52:54 lha Exp $");
516 static unsigned lineno = 1;
517 static int getstring(void);
527 #ifndef YY_NO_UNISTD_H
528 /* Special case for "unistd.h", since it is non-ANSI. We include it way
529 * down here because we want the user's section 1 to have been scanned first.
530 * The user has a chance to override it with an option.
535 #ifndef YY_EXTRA_TYPE
536 #define YY_EXTRA_TYPE void *
539 /* Macros after this point can all be overridden by user definitions in
543 #ifndef YY_SKIP_YYWRAP
545 extern "C" int yywrap (void );
547 extern int yywrap (void );
551 static void yyunput (int c,char *buf_ptr );
554 static void yy_flex_strncpy (char *,yyconst char *,int );
557 #ifdef YY_NEED_STRLEN
558 static int yy_flex_strlen (yyconst char * );
564 static int yyinput (void );
566 static int input (void );
571 /* Amount of stuff to slurp up with each read. */
572 #ifndef YY_READ_BUF_SIZE
573 #define YY_READ_BUF_SIZE 8192
576 /* Copy whatever the last rule matched to the standard output. */
578 /* This used to be an fputs(), but since the string might contain NUL's,
579 * we now use fwrite().
581 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
584 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
585 * is returned in "result".
588 #define YY_INPUT(buf,result,max_size) \
589 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
593 for ( n = 0; n < max_size && \
594 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
597 buf[n++] = (char) c; \
598 if ( c == EOF && ferror( yyin ) ) \
599 YY_FATAL_ERROR( "input in flex scanner failed" ); \
605 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
607 if( errno != EINTR) \
609 YY_FATAL_ERROR( "input in flex scanner failed" ); \
620 /* No semi-colon after return; correct usage is to write "yyterminate();" -
621 * we don't want an extra ';' after the "return" because that will cause
622 * some compilers to complain about unreachable statements.
625 #define yyterminate() return YY_NULL
628 /* Number of entries by which start-condition stack grows. */
629 #ifndef YY_START_STACK_INCR
630 #define YY_START_STACK_INCR 25
633 /* Report a fatal error. */
634 #ifndef YY_FATAL_ERROR
635 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
638 /* end tables serialization structures and prototypes */
640 /* Default declaration of generated scanner - a define so the user can
641 * easily add parameters.
644 #define YY_DECL_IS_OURS 1
646 extern int yylex (void);
648 #define YY_DECL int yylex (void)
649 #endif /* !YY_DECL */
651 /* Code executed at the beginning of each rule, after yytext and yyleng
654 #ifndef YY_USER_ACTION
655 #define YY_USER_ACTION
658 /* Code executed at the end of each rule. */
660 #define YY_BREAK break;
663 #define YY_RULE_SETUP \
666 /** The main scanner function which does all the work.
670 register yy_state_type yy_current_state;
671 register char *yy_cp, *yy_bp;
687 (yy_start) = 1; /* first start state */
695 if ( ! YY_CURRENT_BUFFER ) {
696 yyensure_buffer_stack ();
697 YY_CURRENT_BUFFER_LVALUE =
698 yy_create_buffer(yyin,YY_BUF_SIZE );
701 yy_load_buffer_state( );
704 while ( 1 ) /* loops until end-of-file is reached */
706 yy_cp = (yy_c_buf_p);
708 /* Support of yytext. */
709 *yy_cp = (yy_hold_char);
711 /* yy_bp points to the position in yy_ch_buf of the start of
716 yy_current_state = (yy_start);
720 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
721 if ( yy_accept[yy_current_state] )
723 (yy_last_accepting_state) = yy_current_state;
724 (yy_last_accepting_cpos) = yy_cp;
726 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
728 yy_current_state = (int) yy_def[yy_current_state];
729 if ( yy_current_state >= 46 )
730 yy_c = yy_meta[(unsigned int) yy_c];
732 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
735 while ( yy_base[yy_current_state] != 57 );
738 yy_act = yy_accept[yy_current_state];
740 { /* have to back up */
741 yy_cp = (yy_last_accepting_cpos);
742 yy_current_state = (yy_last_accepting_state);
743 yy_act = yy_accept[yy_current_state];
748 do_action: /* This label is used only to access EOF actions. */
751 { /* beginning of action switch */
752 case 0: /* must back up */
753 /* undo the effects of YY_DO_BEFORE_ACTION */
754 *yy_cp = (yy_hold_char);
755 yy_cp = (yy_last_accepting_cpos);
756 yy_current_state = (yy_last_accepting_state);
802 { yylval.number = atoi(yytext); return NUMBER; }
815 /* rule 12 can match eol */
823 { return getstring(); }
828 { yylval.string = strdup(yytext); return STRING; }
841 case YY_STATE_EOF(INITIAL):
844 case YY_END_OF_BUFFER:
846 /* Amount of text matched not including the EOB char. */
847 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
849 /* Undo the effects of YY_DO_BEFORE_ACTION. */
850 *yy_cp = (yy_hold_char);
851 YY_RESTORE_YY_MORE_OFFSET
853 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
855 /* We're scanning a new file or input source. It's
856 * possible that this happened because the user
857 * just pointed yyin at a new source and called
858 * yylex(). If so, then we have to assure
859 * consistency between YY_CURRENT_BUFFER and our
860 * globals. Here is the right place to do so, because
861 * this is the first action (other than possibly a
862 * back-up) that will match for the new input source.
864 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
865 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
866 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
869 /* Note that here we test for yy_c_buf_p "<=" to the position
870 * of the first EOB in the buffer, since yy_c_buf_p will
871 * already have been incremented past the NUL character
872 * (since all states make transitions on EOB to the
873 * end-of-buffer state). Contrast this with the test
876 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
877 { /* This was really a NUL. */
878 yy_state_type yy_next_state;
880 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
882 yy_current_state = yy_get_previous_state( );
884 /* Okay, we're now positioned to make the NUL
885 * transition. We couldn't have
886 * yy_get_previous_state() go ahead and do it
887 * for us because it doesn't know how to deal
888 * with the possibility of jamming (and we don't
889 * want to build jamming into it because then it
890 * will run more slowly).
893 yy_next_state = yy_try_NUL_trans( yy_current_state );
895 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
899 /* Consume the NUL. */
900 yy_cp = ++(yy_c_buf_p);
901 yy_current_state = yy_next_state;
907 yy_cp = (yy_c_buf_p);
912 else switch ( yy_get_next_buffer( ) )
914 case EOB_ACT_END_OF_FILE:
916 (yy_did_buffer_switch_on_eof) = 0;
920 /* Note: because we've taken care in
921 * yy_get_next_buffer() to have set up
922 * yytext, we can now set up
923 * yy_c_buf_p so that if some total
924 * hoser (like flex itself) wants to
925 * call the scanner after we return the
926 * YY_NULL, it'll still work - another
927 * YY_NULL will get returned.
929 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
931 yy_act = YY_STATE_EOF(YY_START);
937 if ( ! (yy_did_buffer_switch_on_eof) )
943 case EOB_ACT_CONTINUE_SCAN:
945 (yytext_ptr) + yy_amount_of_matched_text;
947 yy_current_state = yy_get_previous_state( );
949 yy_cp = (yy_c_buf_p);
950 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
953 case EOB_ACT_LAST_MATCH:
955 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
957 yy_current_state = yy_get_previous_state( );
959 yy_cp = (yy_c_buf_p);
960 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
968 "fatal flex scanner internal error--no action found" );
969 } /* end of action switch */
970 } /* end of scanning one token */
973 /* yy_get_next_buffer - try to read in a new buffer
975 * Returns a code representing an action:
976 * EOB_ACT_LAST_MATCH -
977 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
978 * EOB_ACT_END_OF_FILE - end of file
980 static int yy_get_next_buffer (void)
982 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
983 register char *source = (yytext_ptr);
984 register int number_to_move, i;
987 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
989 "fatal flex scanner internal error--end of buffer missed" );
991 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
992 { /* Don't try to fill the buffer, so this is an EOF. */
993 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
995 /* We matched a single character, the EOB, so
996 * treat this as a final EOF.
998 return EOB_ACT_END_OF_FILE;
1003 /* We matched some text prior to the EOB, first
1006 return EOB_ACT_LAST_MATCH;
1010 /* Try to read more data. */
1012 /* First move last chars to start of buffer. */
1013 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1015 for ( i = 0; i < number_to_move; ++i )
1016 *(dest++) = *(source++);
1018 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1019 /* don't do the read, it's not guaranteed to return an EOF,
1022 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1026 size_t num_to_read =
1027 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1029 while ( num_to_read <= 0 )
1030 { /* Not enough room in the buffer - grow it. */
1032 /* just a shorter name for the current buffer */
1033 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1035 int yy_c_buf_p_offset =
1036 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1038 if ( b->yy_is_our_buffer )
1040 int new_size = b->yy_buf_size * 2;
1042 if ( new_size <= 0 )
1043 b->yy_buf_size += b->yy_buf_size / 8;
1045 b->yy_buf_size *= 2;
1047 b->yy_ch_buf = (char *)
1048 /* Include room in for 2 EOB chars. */
1049 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1052 /* Can't grow it, we don't own it. */
1055 if ( ! b->yy_ch_buf )
1057 "fatal error - scanner input buffer overflow" );
1059 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1061 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1066 if ( num_to_read > YY_READ_BUF_SIZE )
1067 num_to_read = YY_READ_BUF_SIZE;
1069 /* Read in more data. */
1070 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1071 (yy_n_chars), num_to_read );
1073 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1076 if ( (yy_n_chars) == 0 )
1078 if ( number_to_move == YY_MORE_ADJ )
1080 ret_val = EOB_ACT_END_OF_FILE;
1086 ret_val = EOB_ACT_LAST_MATCH;
1087 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1088 YY_BUFFER_EOF_PENDING;
1093 ret_val = EOB_ACT_CONTINUE_SCAN;
1095 (yy_n_chars) += number_to_move;
1096 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1097 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1099 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1104 /* yy_get_previous_state - get the state just before the EOB char was reached */
1106 static yy_state_type yy_get_previous_state (void)
1108 register yy_state_type yy_current_state;
1109 register char *yy_cp;
1111 yy_current_state = (yy_start);
1113 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1115 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1116 if ( yy_accept[yy_current_state] )
1118 (yy_last_accepting_state) = yy_current_state;
1119 (yy_last_accepting_cpos) = yy_cp;
1121 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1123 yy_current_state = (int) yy_def[yy_current_state];
1124 if ( yy_current_state >= 46 )
1125 yy_c = yy_meta[(unsigned int) yy_c];
1127 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1130 return yy_current_state;
1133 /* yy_try_NUL_trans - try to make a transition on the NUL character
1136 * next_state = yy_try_NUL_trans( current_state );
1138 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1140 register int yy_is_jam;
1141 register char *yy_cp = (yy_c_buf_p);
1143 register YY_CHAR yy_c = 1;
1144 if ( yy_accept[yy_current_state] )
1146 (yy_last_accepting_state) = yy_current_state;
1147 (yy_last_accepting_cpos) = yy_cp;
1149 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1151 yy_current_state = (int) yy_def[yy_current_state];
1152 if ( yy_current_state >= 46 )
1153 yy_c = yy_meta[(unsigned int) yy_c];
1155 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1156 yy_is_jam = (yy_current_state == 45);
1158 return yy_is_jam ? 0 : yy_current_state;
1161 static void yyunput (int c, register char * yy_bp )
1163 register char *yy_cp;
1165 yy_cp = (yy_c_buf_p);
1167 /* undo effects of setting up yytext */
1168 *yy_cp = (yy_hold_char);
1170 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1171 { /* need to shift things up to make room */
1172 /* +2 for EOB chars. */
1173 register int number_to_move = (yy_n_chars) + 2;
1174 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1175 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1176 register char *source =
1177 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1179 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1180 *--dest = *--source;
1182 yy_cp += (int) (dest - source);
1183 yy_bp += (int) (dest - source);
1184 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1185 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1187 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1188 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1191 *--yy_cp = (char) c;
1193 (yytext_ptr) = yy_bp;
1194 (yy_hold_char) = *yy_cp;
1195 (yy_c_buf_p) = yy_cp;
1200 static int yyinput (void)
1202 static int input (void)
1208 *(yy_c_buf_p) = (yy_hold_char);
1210 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1212 /* yy_c_buf_p now points to the character we want to return.
1213 * If this occurs *before* the EOB characters, then it's a
1214 * valid NUL; if not, then we've hit the end of the buffer.
1216 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1217 /* This was really a NUL. */
1218 *(yy_c_buf_p) = '\0';
1221 { /* need more input */
1222 int offset = (yy_c_buf_p) - (yytext_ptr);
1225 switch ( yy_get_next_buffer( ) )
1227 case EOB_ACT_LAST_MATCH:
1228 /* This happens because yy_g_n_b()
1229 * sees that we've accumulated a
1230 * token and flags that we need to
1231 * try matching the token before
1232 * proceeding. But for input(),
1233 * there's no matching to consider.
1234 * So convert the EOB_ACT_LAST_MATCH
1235 * to EOB_ACT_END_OF_FILE.
1238 /* Reset buffer status. */
1243 case EOB_ACT_END_OF_FILE:
1248 if ( ! (yy_did_buffer_switch_on_eof) )
1257 case EOB_ACT_CONTINUE_SCAN:
1258 (yy_c_buf_p) = (yytext_ptr) + offset;
1264 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1265 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1266 (yy_hold_char) = *++(yy_c_buf_p);
1270 #endif /* ifndef YY_NO_INPUT */
1272 /** Immediately switch to a different input stream.
1273 * @param input_file A readable stream.
1275 * @note This function does not reset the start condition to @c INITIAL .
1277 void yyrestart (FILE * input_file )
1280 if ( ! YY_CURRENT_BUFFER ){
1281 yyensure_buffer_stack ();
1282 YY_CURRENT_BUFFER_LVALUE =
1283 yy_create_buffer(yyin,YY_BUF_SIZE );
1286 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1287 yy_load_buffer_state( );
1290 /** Switch to a different input buffer.
1291 * @param new_buffer The new input buffer.
1294 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1297 /* TODO. We should be able to replace this entire function body
1299 * yypop_buffer_state();
1300 * yypush_buffer_state(new_buffer);
1302 yyensure_buffer_stack ();
1303 if ( YY_CURRENT_BUFFER == new_buffer )
1306 if ( YY_CURRENT_BUFFER )
1308 /* Flush out information for old buffer. */
1309 *(yy_c_buf_p) = (yy_hold_char);
1310 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1311 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1314 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1315 yy_load_buffer_state( );
1317 /* We don't actually know whether we did this switch during
1318 * EOF (yywrap()) processing, but the only time this flag
1319 * is looked at is after yywrap() is called, so it's safe
1320 * to go ahead and always set it.
1322 (yy_did_buffer_switch_on_eof) = 1;
1325 static void yy_load_buffer_state (void)
1327 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1328 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1329 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1330 (yy_hold_char) = *(yy_c_buf_p);
1333 /** Allocate and initialize an input buffer state.
1334 * @param file A readable stream.
1335 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1337 * @return the allocated buffer state.
1339 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1343 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1345 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1347 b->yy_buf_size = size;
1349 /* yy_ch_buf has to be 2 characters longer than the size given because
1350 * we need to put in 2 end-of-buffer characters.
1352 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1353 if ( ! b->yy_ch_buf )
1354 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1356 b->yy_is_our_buffer = 1;
1358 yy_init_buffer(b,file );
1363 /** Destroy the buffer.
1364 * @param b a buffer created with yy_create_buffer()
1367 void yy_delete_buffer (YY_BUFFER_STATE b )
1373 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1374 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1376 if ( b->yy_is_our_buffer )
1377 yyfree((void *) b->yy_ch_buf );
1379 yyfree((void *) b );
1383 extern int isatty (int );
1384 #endif /* __cplusplus */
1386 /* Initializes or reinitializes a buffer.
1387 * This function is sometimes called more than once on the same buffer,
1388 * such as during a yyrestart() or at EOF.
1390 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1395 yy_flush_buffer(b );
1397 b->yy_input_file = file;
1398 b->yy_fill_buffer = 1;
1400 /* If b is the current buffer, then yy_init_buffer was _probably_
1401 * called from yyrestart() or through yy_get_next_buffer.
1402 * In that case, we don't want to reset the lineno or column.
1404 if (b != YY_CURRENT_BUFFER){
1405 b->yy_bs_lineno = 1;
1406 b->yy_bs_column = 0;
1409 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1414 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1415 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1418 void yy_flush_buffer (YY_BUFFER_STATE b )
1425 /* We always need two end-of-buffer characters. The first causes
1426 * a transition to the end-of-buffer state. The second causes
1427 * a jam in that state.
1429 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1430 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1432 b->yy_buf_pos = &b->yy_ch_buf[0];
1435 b->yy_buffer_status = YY_BUFFER_NEW;
1437 if ( b == YY_CURRENT_BUFFER )
1438 yy_load_buffer_state( );
1441 /** Pushes the new state onto the stack. The new state becomes
1442 * the current state. This function will allocate the stack
1444 * @param new_buffer The new state.
1447 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1449 if (new_buffer == NULL)
1452 yyensure_buffer_stack();
1454 /* This block is copied from yy_switch_to_buffer. */
1455 if ( YY_CURRENT_BUFFER )
1457 /* Flush out information for old buffer. */
1458 *(yy_c_buf_p) = (yy_hold_char);
1459 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1460 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1463 /* Only push if top exists. Otherwise, replace top. */
1464 if (YY_CURRENT_BUFFER)
1465 (yy_buffer_stack_top)++;
1466 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1468 /* copied from yy_switch_to_buffer. */
1469 yy_load_buffer_state( );
1470 (yy_did_buffer_switch_on_eof) = 1;
1473 /** Removes and deletes the top of the stack, if present.
1474 * The next element becomes the new top.
1477 void yypop_buffer_state (void)
1479 if (!YY_CURRENT_BUFFER)
1482 yy_delete_buffer(YY_CURRENT_BUFFER );
1483 YY_CURRENT_BUFFER_LVALUE = NULL;
1484 if ((yy_buffer_stack_top) > 0)
1485 --(yy_buffer_stack_top);
1487 if (YY_CURRENT_BUFFER) {
1488 yy_load_buffer_state( );
1489 (yy_did_buffer_switch_on_eof) = 1;
1493 /* Allocates the stack if it does not exist.
1494 * Guarantees space for at least one push.
1496 static void yyensure_buffer_stack (void)
1500 if (!(yy_buffer_stack)) {
1502 /* First allocation is just for 2 elements, since we don't know if this
1503 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1504 * immediate realloc on the next call.
1507 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1508 (num_to_alloc * sizeof(struct yy_buffer_state*)
1511 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1513 (yy_buffer_stack_max) = num_to_alloc;
1514 (yy_buffer_stack_top) = 0;
1518 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1520 /* Increase the buffer to prepare for a possible push. */
1521 int grow_size = 8 /* arbitrary grow size */;
1523 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1524 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1526 num_to_alloc * sizeof(struct yy_buffer_state*)
1529 /* zero only the new slots.*/
1530 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1531 (yy_buffer_stack_max) = num_to_alloc;
1535 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1536 * @param base the character buffer
1537 * @param size the size in bytes of the character buffer
1539 * @return the newly allocated buffer state object.
1541 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1546 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1547 base[size-1] != YY_END_OF_BUFFER_CHAR )
1548 /* They forgot to leave room for the EOB's. */
1551 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1553 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1555 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1556 b->yy_buf_pos = b->yy_ch_buf = base;
1557 b->yy_is_our_buffer = 0;
1558 b->yy_input_file = 0;
1559 b->yy_n_chars = b->yy_buf_size;
1560 b->yy_is_interactive = 0;
1562 b->yy_fill_buffer = 0;
1563 b->yy_buffer_status = YY_BUFFER_NEW;
1565 yy_switch_to_buffer(b );
1570 /** Setup the input buffer state to scan a string. The next call to yylex() will
1571 * scan from a @e copy of @a str.
1572 * @param str a NUL-terminated string to scan
1574 * @return the newly allocated buffer state object.
1575 * @note If you want to scan bytes that may contain NUL values, then use
1576 * yy_scan_bytes() instead.
1578 YY_BUFFER_STATE yy_scan_string (yyconst char * yy_str )
1581 return yy_scan_bytes(yy_str,strlen(yy_str) );
1584 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1585 * scan from a @e copy of @a bytes.
1586 * @param bytes the byte buffer to scan
1587 * @param len the number of bytes in the buffer pointed to by @a bytes.
1589 * @return the newly allocated buffer state object.
1591 YY_BUFFER_STATE yy_scan_bytes (yyconst char * bytes, int len )
1598 /* Get memory for full buffer, including space for trailing EOB's. */
1600 buf = (char *) yyalloc(n );
1602 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1604 for ( i = 0; i < len; ++i )
1607 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1609 b = yy_scan_buffer(buf,n );
1611 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1613 /* It's okay to grow etc. this buffer, and we should throw it
1614 * away when we're done.
1616 b->yy_is_our_buffer = 1;
1621 #ifndef YY_EXIT_FAILURE
1622 #define YY_EXIT_FAILURE 2
1625 static void yy_fatal_error (yyconst char* msg )
1627 (void) fprintf( stderr, "%s\n", msg );
1628 exit( YY_EXIT_FAILURE );
1631 /* Redefine yyless() so it works in section 3 code. */
1637 /* Undo effects of setting up yytext. */ \
1638 int yyless_macro_arg = (n); \
1639 YY_LESS_LINENO(yyless_macro_arg);\
1640 yytext[yyleng] = (yy_hold_char); \
1641 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1642 (yy_hold_char) = *(yy_c_buf_p); \
1643 *(yy_c_buf_p) = '\0'; \
1644 yyleng = yyless_macro_arg; \
1648 /* Accessor methods (get/set functions) to struct members. */
1650 /** Get the current line number.
1653 int yyget_lineno (void)
1659 /** Get the input stream.
1662 FILE *yyget_in (void)
1667 /** Get the output stream.
1670 FILE *yyget_out (void)
1675 /** Get the length of the current token.
1678 int yyget_leng (void)
1683 /** Get the current token.
1687 char *yyget_text (void)
1692 /** Set the current line number.
1693 * @param line_number
1696 void yyset_lineno (int line_number )
1699 yylineno = line_number;
1702 /** Set the input stream. This does not discard the current
1704 * @param in_str A readable stream.
1706 * @see yy_switch_to_buffer
1708 void yyset_in (FILE * in_str )
1713 void yyset_out (FILE * out_str )
1718 int yyget_debug (void)
1720 return yy_flex_debug;
1723 void yyset_debug (int bdebug )
1725 yy_flex_debug = bdebug ;
1728 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1729 int yylex_destroy (void)
1732 /* Pop the buffer stack, destroying each element. */
1733 while(YY_CURRENT_BUFFER){
1734 yy_delete_buffer(YY_CURRENT_BUFFER );
1735 YY_CURRENT_BUFFER_LVALUE = NULL;
1736 yypop_buffer_state();
1739 /* Destroy the stack itself. */
1740 yyfree((yy_buffer_stack) );
1741 (yy_buffer_stack) = NULL;
1747 * Internal utility routines.
1751 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1754 for ( i = 0; i < n; ++i )
1759 #ifdef YY_NEED_STRLEN
1760 static int yy_flex_strlen (yyconst char * s )
1763 for ( n = 0; s[n]; ++n )
1770 void *yyalloc (yy_size_t size )
1772 return (void *) malloc( size );
1775 void *yyrealloc (void * ptr, yy_size_t size )
1777 /* The cast to (char *) in the following accommodates both
1778 * implementations that use char* generic pointers, and those
1779 * that use void* generic pointers. It works with the latter
1780 * because both ANSI C and C++ allow castless assignment from
1781 * any pointer type to void*, and deal with argument conversions
1782 * as though doing an assignment.
1784 return (void *) realloc( (char *) ptr, size );
1787 void yyfree (void * ptr )
1789 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1792 #define YYTABLES_NAME "yytables"
1795 #undef YY_FLUSH_BUFFER
1797 #undef yy_new_buffer
1798 #undef yy_set_interactive
1800 #undef YY_DO_BEFORE_ACTION
1802 #ifdef YY_DECL_IS_OURS
1803 #undef YY_DECL_IS_OURS
1810 #ifndef yywrap /* XXX */
1825 while(i < sizeof(x) - 1 && (c = input()) != EOF){
1832 error_message("unterminated string");
1845 yylval.string = strdup(x);
1846 if (yylval.string == NULL)
1852 error_message (const char *format, ...)
1856 va_start (args, format);
1857 fprintf (stderr, "%s:%d:", filename, lineno);
1858 vfprintf (stderr, format, args);