3 #line 3 "heimdal/lib/com_err/lex.c"
5 #define YY_INT_ALIGNED short int
7 /* A lexical scanner generated by flex */
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 35
13 #if YY_FLEX_SUBMINOR_VERSION > 0
17 /* First, we deal with platform-specific or compiler-specific issues. */
19 /* begin standard C headers. */
25 /* end standard C headers. */
27 /* flex integer type definitions */
32 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
36 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
39 #ifndef __STDC_LIMIT_MACROS
40 #define __STDC_LIMIT_MACROS 1
44 typedef int8_t flex_int8_t;
45 typedef uint8_t flex_uint8_t;
46 typedef int16_t flex_int16_t;
47 typedef uint16_t flex_uint16_t;
48 typedef int32_t flex_int32_t;
49 typedef uint32_t flex_uint32_t;
51 typedef signed char flex_int8_t;
52 typedef short int flex_int16_t;
53 typedef int flex_int32_t;
54 typedef unsigned char flex_uint8_t;
55 typedef unsigned short int flex_uint16_t;
56 typedef unsigned int flex_uint32_t;
59 /* Limits of integral types. */
61 #define INT8_MIN (-128)
64 #define INT16_MIN (-32767-1)
67 #define INT32_MIN (-2147483647-1)
70 #define INT8_MAX (127)
73 #define INT16_MAX (32767)
76 #define INT32_MAX (2147483647)
79 #define UINT8_MAX (255U)
82 #define UINT16_MAX (65535U)
85 #define UINT32_MAX (4294967295U)
88 #endif /* ! FLEXINT_H */
92 /* The "const" storage-class-modifier is valid. */
95 #else /* ! __cplusplus */
97 /* C99 requires __STDC__ to be defined as 1. */
98 #if defined (__STDC__)
102 #endif /* defined (__STDC__) */
103 #endif /* ! __cplusplus */
106 #define yyconst const
111 /* Returned upon end-of-file. */
114 /* Promotes a possibly negative, possibly signed char to an unsigned
115 * integer for use as an array index. If the signed char is negative,
116 * we want to instead treat it as an 8-bit unsigned char, hence the
119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
121 /* Enter a start condition. This macro really ought to take a parameter,
122 * but we do it the disgusting crufty way forced on us by the ()-less
123 * definition of BEGIN.
125 #define BEGIN (yy_start) = 1 + 2 *
127 /* Translate the current start state into a value that can be later handed
128 * to BEGIN to return to the state. The YYSTATE alias is for lex
131 #define YY_START (((yy_start) - 1) / 2)
132 #define YYSTATE YY_START
134 /* Action number for EOF rule of a given start state. */
135 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
137 /* Special action meaning "start processing a new file". */
138 #define YY_NEW_FILE yyrestart(yyin )
140 #define YY_END_OF_BUFFER_CHAR 0
142 /* Size of default input buffer. */
144 #define YY_BUF_SIZE 16384
147 /* The state buf must be large enough to hold one state per character in the main buffer.
149 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
151 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
152 #define YY_TYPEDEF_YY_BUFFER_STATE
153 typedef struct yy_buffer_state *YY_BUFFER_STATE;
158 extern FILE *yyin, *yyout;
160 #define EOB_ACT_CONTINUE_SCAN 0
161 #define EOB_ACT_END_OF_FILE 1
162 #define EOB_ACT_LAST_MATCH 2
164 #define YY_LESS_LINENO(n)
166 /* Return all but the first "n" matched characters back to the input stream. */
170 /* Undo effects of setting up yytext. */ \
171 int yyless_macro_arg = (n); \
172 YY_LESS_LINENO(yyless_macro_arg);\
173 *yy_cp = (yy_hold_char); \
174 YY_RESTORE_YY_MORE_OFFSET \
175 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
176 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
180 #define unput(c) yyunput( c, (yytext_ptr) )
182 #ifndef YY_TYPEDEF_YY_SIZE_T
183 #define YY_TYPEDEF_YY_SIZE_T
184 typedef size_t yy_size_t;
187 #ifndef YY_STRUCT_YY_BUFFER_STATE
188 #define YY_STRUCT_YY_BUFFER_STATE
189 struct yy_buffer_state
193 char *yy_ch_buf; /* input buffer */
194 char *yy_buf_pos; /* current position in input buffer */
196 /* Size of input buffer in bytes, not including room for EOB
199 yy_size_t yy_buf_size;
201 /* Number of characters read into yy_ch_buf, not including EOB
206 /* Whether we "own" the buffer - i.e., we know we created it,
207 * and can realloc() it to grow it, and should free() it to
210 int yy_is_our_buffer;
212 /* Whether this is an "interactive" input source; if so, and
213 * if we're using stdio for input, then we want to use getc()
214 * instead of fread(), to make sure we stop fetching input after
217 int yy_is_interactive;
219 /* Whether we're considered to be at the beginning of a line.
220 * If so, '^' rules will be active on the next match, otherwise
225 int yy_bs_lineno; /**< The line count. */
226 int yy_bs_column; /**< The column count. */
228 /* Whether to try to fill the input buffer when we reach the
233 int yy_buffer_status;
235 #define YY_BUFFER_NEW 0
236 #define YY_BUFFER_NORMAL 1
237 /* When an EOF's been seen but there's still some text to process
238 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
239 * shouldn't try reading from the input source any more. We might
240 * still have a bunch of tokens to match, though, because of
241 * possible backing-up.
243 * When we actually see the EOF, we change the status to "new"
244 * (via yyrestart()), so that the user can continue scanning by
245 * just pointing yyin at a new input file.
247 #define YY_BUFFER_EOF_PENDING 2
250 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
252 /* Stack of input buffers. */
253 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
254 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
255 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
257 /* We provide macros for accessing buffer states in case in the
258 * future we want to put the buffer states in a more general
261 * Returns the top of the stack, or NULL.
263 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
264 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
267 /* Same as previous macro, but useful when we know that the buffer stack is not
268 * NULL or when we need an lvalue. For internal use only.
270 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
272 /* yy_hold_char holds the character lost when yytext is formed. */
273 static char yy_hold_char;
274 static int yy_n_chars; /* number of characters read into yy_ch_buf */
277 /* Points to current character in buffer. */
278 static char *yy_c_buf_p = (char *) 0;
279 static int yy_init = 0; /* whether we need to initialize */
280 static int yy_start = 0; /* start state number */
282 /* Flag which is used to allow yywrap()'s to do buffer switches
283 * instead of setting up a fresh yyin. A bit of a hack ...
285 static int yy_did_buffer_switch_on_eof;
287 void yyrestart (FILE *input_file );
288 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
289 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
290 void yy_delete_buffer (YY_BUFFER_STATE b );
291 void yy_flush_buffer (YY_BUFFER_STATE b );
292 void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
293 void yypop_buffer_state (void );
295 static void yyensure_buffer_stack (void );
296 static void yy_load_buffer_state (void );
297 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
299 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
301 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
302 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
303 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
305 void *yyalloc (yy_size_t );
306 void *yyrealloc (void *,yy_size_t );
307 void yyfree (void * );
309 #define yy_new_buffer yy_create_buffer
311 #define yy_set_interactive(is_interactive) \
313 if ( ! YY_CURRENT_BUFFER ){ \
314 yyensure_buffer_stack (); \
315 YY_CURRENT_BUFFER_LVALUE = \
316 yy_create_buffer(yyin,YY_BUF_SIZE ); \
318 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
321 #define yy_set_bol(at_bol) \
323 if ( ! YY_CURRENT_BUFFER ){\
324 yyensure_buffer_stack (); \
325 YY_CURRENT_BUFFER_LVALUE = \
326 yy_create_buffer(yyin,YY_BUF_SIZE ); \
328 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
331 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
333 /* Begin user sect3 */
335 typedef unsigned char YY_CHAR;
337 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
339 typedef int yy_state_type;
346 #define yytext_ptr yytext
348 static yy_state_type yy_get_previous_state (void );
349 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
350 static int yy_get_next_buffer (void );
351 static void yy_fatal_error (yyconst char msg[] );
353 /* Done after the current pattern has been matched and before the
354 * corresponding action - sets up yytext.
356 #define YY_DO_BEFORE_ACTION \
357 (yytext_ptr) = yy_bp; \
358 yyleng = (size_t) (yy_cp - yy_bp); \
359 (yy_hold_char) = *yy_cp; \
361 (yy_c_buf_p) = yy_cp;
363 #define YY_NUM_RULES 16
364 #define YY_END_OF_BUFFER 17
365 /* This struct is not used in this scanner,
366 but its presence is necessary. */
369 flex_int32_t yy_verify;
372 static yyconst flex_int16_t yy_accept[46] =
374 0, 0, 17, 15, 11, 12, 13, 10, 9, 14,
375 14, 14, 14, 10, 9, 14, 3, 14, 14, 1,
376 7, 14, 14, 8, 14, 14, 14, 14, 14, 14,
377 14, 6, 14, 14, 5, 14, 14, 14, 14, 14,
381 static yyconst flex_int32_t yy_ec[256] =
383 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
384 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
385 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
386 1, 2, 1, 4, 5, 1, 1, 1, 1, 1,
387 1, 1, 1, 1, 1, 1, 1, 6, 6, 6,
388 6, 6, 6, 6, 6, 6, 6, 1, 1, 1,
389 1, 1, 1, 1, 7, 7, 7, 7, 7, 7,
390 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
391 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
392 1, 1, 1, 1, 8, 1, 9, 10, 11, 12,
394 13, 14, 7, 7, 15, 7, 7, 16, 7, 17,
395 18, 19, 7, 20, 7, 21, 7, 7, 7, 22,
396 7, 7, 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,
401 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
402 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
403 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
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,
413 static yyconst flex_int32_t yy_meta[23] =
415 1, 1, 2, 1, 1, 3, 3, 3, 3, 3,
416 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
420 static yyconst flex_int16_t yy_base[48] =
422 0, 0, 56, 57, 57, 57, 57, 0, 49, 0,
423 12, 13, 34, 0, 47, 0, 0, 40, 31, 0,
424 0, 38, 36, 0, 30, 34, 32, 25, 22, 28,
425 34, 0, 19, 13, 0, 22, 30, 26, 26, 18,
426 12, 0, 14, 0, 57, 34, 23
429 static yyconst flex_int16_t yy_def[48] =
431 45, 1, 45, 45, 45, 45, 45, 46, 47, 47,
432 47, 47, 47, 46, 47, 47, 47, 47, 47, 47,
433 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
434 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
435 47, 47, 47, 47, 0, 45, 45
438 static yyconst flex_int16_t yy_nxt[80] =
440 4, 5, 6, 7, 8, 9, 10, 10, 10, 10,
441 10, 10, 11, 10, 12, 10, 10, 10, 13, 10,
442 10, 10, 17, 36, 21, 16, 44, 43, 18, 22,
443 42, 19, 20, 37, 14, 41, 14, 40, 39, 38,
444 35, 34, 33, 32, 31, 30, 29, 28, 27, 26,
445 25, 24, 15, 23, 15, 45, 3, 45, 45, 45,
446 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
447 45, 45, 45, 45, 45, 45, 45, 45, 45
450 static yyconst flex_int16_t yy_chk[80] =
452 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
453 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
454 1, 1, 11, 34, 12, 47, 43, 41, 11, 12,
455 40, 11, 11, 34, 46, 39, 46, 38, 37, 36,
456 33, 31, 30, 29, 28, 27, 26, 25, 23, 22,
457 19, 18, 15, 13, 9, 3, 45, 45, 45, 45,
458 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
459 45, 45, 45, 45, 45, 45, 45, 45, 45
462 static yy_state_type yy_last_accepting_state;
463 static char *yy_last_accepting_cpos;
465 extern int yy_flex_debug;
466 int yy_flex_debug = 0;
468 /* The intent behind this definition is that it'll catch
469 * any uses of REJECT which flex missed.
471 #define REJECT reject_used_but_not_detected
472 #define yymore() yymore_used_but_not_detected
473 #define YY_MORE_ADJ 0
474 #define YY_RESTORE_YY_MORE_OFFSET
479 * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
480 * (Royal Institute of Technology, Stockholm, Sweden).
481 * All rights reserved.
483 * Redistribution and use in source and binary forms, with or without
484 * modification, are permitted provided that the following conditions
487 * 1. Redistributions of source code must retain the above copyright
488 * notice, this list of conditions and the following disclaimer.
490 * 2. Redistributions in binary form must reproduce the above copyright
491 * notice, this list of conditions and the following disclaimer in the
492 * documentation and/or other materials provided with the distribution.
494 * 3. Neither the name of the Institute nor the names of its contributors
495 * may be used to endorse or promote products derived from this software
496 * without specific prior written permission.
498 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
499 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
500 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
501 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
502 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
503 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
504 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
505 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
506 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
507 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
512 * This is to handle the definition of this symbol in some AIX
513 * headers, which will conflict with the definition that lex will
514 * generate for it. It's only a problem for AIX lex.
519 #include "compile_et.h"
523 static unsigned lineno = 1;
524 static int getstring(void);
530 #line 530 "heimdal/lib/com_err/lex.c"
534 #ifndef YY_NO_UNISTD_H
535 /* Special case for "unistd.h", since it is non-ANSI. We include it way
536 * down here because we want the user's section 1 to have been scanned first.
537 * The user has a chance to override it with an option.
542 #ifndef YY_EXTRA_TYPE
543 #define YY_EXTRA_TYPE void *
546 static int yy_init_globals (void );
548 /* Accessor methods to globals.
549 These are made visible to non-reentrant scanners for convenience. */
551 int yylex_destroy (void );
553 int yyget_debug (void );
555 void yyset_debug (int debug_flag );
557 YY_EXTRA_TYPE yyget_extra (void );
559 void yyset_extra (YY_EXTRA_TYPE user_defined );
561 FILE *yyget_in (void );
563 void yyset_in (FILE * in_str );
565 FILE *yyget_out (void );
567 void yyset_out (FILE * out_str );
569 int yyget_leng (void );
571 char *yyget_text (void );
573 int yyget_lineno (void );
575 void yyset_lineno (int line_number );
577 /* Macros after this point can all be overridden by user definitions in
581 #ifndef YY_SKIP_YYWRAP
583 extern "C" int yywrap (void );
585 extern int yywrap (void );
589 static void yyunput (int c,char *buf_ptr );
592 static void yy_flex_strncpy (char *,yyconst char *,int );
595 #ifdef YY_NEED_STRLEN
596 static int yy_flex_strlen (yyconst char * );
602 static int yyinput (void );
604 static int input (void );
609 /* Amount of stuff to slurp up with each read. */
610 #ifndef YY_READ_BUF_SIZE
611 #define YY_READ_BUF_SIZE 8192
614 /* Copy whatever the last rule matched to the standard output. */
616 /* This used to be an fputs(), but since the string might contain NUL's,
617 * we now use fwrite().
619 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
622 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
623 * is returned in "result".
626 #define YY_INPUT(buf,result,max_size) \
627 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
631 for ( n = 0; n < max_size && \
632 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
635 buf[n++] = (char) c; \
636 if ( c == EOF && ferror( yyin ) ) \
637 YY_FATAL_ERROR( "input in flex scanner failed" ); \
643 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
645 if( errno != EINTR) \
647 YY_FATAL_ERROR( "input in flex scanner failed" ); \
658 /* No semi-colon after return; correct usage is to write "yyterminate();" -
659 * we don't want an extra ';' after the "return" because that will cause
660 * some compilers to complain about unreachable statements.
663 #define yyterminate() return YY_NULL
666 /* Number of entries by which start-condition stack grows. */
667 #ifndef YY_START_STACK_INCR
668 #define YY_START_STACK_INCR 25
671 /* Report a fatal error. */
672 #ifndef YY_FATAL_ERROR
673 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
676 /* end tables serialization structures and prototypes */
678 /* Default declaration of generated scanner - a define so the user can
679 * easily add parameters.
682 #define YY_DECL_IS_OURS 1
684 extern int yylex (void);
686 #define YY_DECL int yylex (void)
687 #endif /* !YY_DECL */
689 /* Code executed at the beginning of each rule, after yytext and yyleng
692 #ifndef YY_USER_ACTION
693 #define YY_USER_ACTION
696 /* Code executed at the end of each rule. */
698 #define YY_BREAK break;
701 #define YY_RULE_SETUP \
704 /** The main scanner function which does all the work.
708 register yy_state_type yy_current_state;
709 register char *yy_cp, *yy_bp;
714 #line 714 "heimdal/lib/com_err/lex.c"
725 (yy_start) = 1; /* first start state */
733 if ( ! YY_CURRENT_BUFFER ) {
734 yyensure_buffer_stack ();
735 YY_CURRENT_BUFFER_LVALUE =
736 yy_create_buffer(yyin,YY_BUF_SIZE );
739 yy_load_buffer_state( );
742 while ( 1 ) /* loops until end-of-file is reached */
744 yy_cp = (yy_c_buf_p);
746 /* Support of yytext. */
747 *yy_cp = (yy_hold_char);
749 /* yy_bp points to the position in yy_ch_buf of the start of
754 yy_current_state = (yy_start);
758 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
759 if ( yy_accept[yy_current_state] )
761 (yy_last_accepting_state) = yy_current_state;
762 (yy_last_accepting_cpos) = yy_cp;
764 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
766 yy_current_state = (int) yy_def[yy_current_state];
767 if ( yy_current_state >= 46 )
768 yy_c = yy_meta[(unsigned int) yy_c];
770 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
773 while ( yy_base[yy_current_state] != 57 );
776 yy_act = yy_accept[yy_current_state];
778 { /* have to back up */
779 yy_cp = (yy_last_accepting_cpos);
780 yy_current_state = (yy_last_accepting_state);
781 yy_act = yy_accept[yy_current_state];
786 do_action: /* This label is used only to access EOF actions. */
789 { /* beginning of action switch */
790 case 0: /* must back up */
791 /* undo the effects of YY_DO_BEFORE_ACTION */
792 *yy_cp = (yy_hold_char);
793 yy_cp = (yy_last_accepting_cpos);
794 yy_current_state = (yy_last_accepting_state);
840 { yylval.number = atoi(yytext); return NUMBER; }
853 /* rule 12 can match eol */
861 { return getstring(); }
866 { yylval.string = strdup(yytext); return STRING; }
878 #line 878 "heimdal/lib/com_err/lex.c"
879 case YY_STATE_EOF(INITIAL):
882 case YY_END_OF_BUFFER:
884 /* Amount of text matched not including the EOB char. */
885 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
887 /* Undo the effects of YY_DO_BEFORE_ACTION. */
888 *yy_cp = (yy_hold_char);
889 YY_RESTORE_YY_MORE_OFFSET
891 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
893 /* We're scanning a new file or input source. It's
894 * possible that this happened because the user
895 * just pointed yyin at a new source and called
896 * yylex(). If so, then we have to assure
897 * consistency between YY_CURRENT_BUFFER and our
898 * globals. Here is the right place to do so, because
899 * this is the first action (other than possibly a
900 * back-up) that will match for the new input source.
902 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
903 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
904 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
907 /* Note that here we test for yy_c_buf_p "<=" to the position
908 * of the first EOB in the buffer, since yy_c_buf_p will
909 * already have been incremented past the NUL character
910 * (since all states make transitions on EOB to the
911 * end-of-buffer state). Contrast this with the test
914 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
915 { /* This was really a NUL. */
916 yy_state_type yy_next_state;
918 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
920 yy_current_state = yy_get_previous_state( );
922 /* Okay, we're now positioned to make the NUL
923 * transition. We couldn't have
924 * yy_get_previous_state() go ahead and do it
925 * for us because it doesn't know how to deal
926 * with the possibility of jamming (and we don't
927 * want to build jamming into it because then it
928 * will run more slowly).
931 yy_next_state = yy_try_NUL_trans( yy_current_state );
933 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
937 /* Consume the NUL. */
938 yy_cp = ++(yy_c_buf_p);
939 yy_current_state = yy_next_state;
945 yy_cp = (yy_c_buf_p);
950 else switch ( yy_get_next_buffer( ) )
952 case EOB_ACT_END_OF_FILE:
954 (yy_did_buffer_switch_on_eof) = 0;
958 /* Note: because we've taken care in
959 * yy_get_next_buffer() to have set up
960 * yytext, we can now set up
961 * yy_c_buf_p so that if some total
962 * hoser (like flex itself) wants to
963 * call the scanner after we return the
964 * YY_NULL, it'll still work - another
965 * YY_NULL will get returned.
967 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
969 yy_act = YY_STATE_EOF(YY_START);
975 if ( ! (yy_did_buffer_switch_on_eof) )
981 case EOB_ACT_CONTINUE_SCAN:
983 (yytext_ptr) + yy_amount_of_matched_text;
985 yy_current_state = yy_get_previous_state( );
987 yy_cp = (yy_c_buf_p);
988 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
991 case EOB_ACT_LAST_MATCH:
993 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
995 yy_current_state = yy_get_previous_state( );
997 yy_cp = (yy_c_buf_p);
998 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1006 "fatal flex scanner internal error--no action found" );
1007 } /* end of action switch */
1008 } /* end of scanning one token */
1009 } /* end of yylex */
1011 /* yy_get_next_buffer - try to read in a new buffer
1013 * Returns a code representing an action:
1014 * EOB_ACT_LAST_MATCH -
1015 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1016 * EOB_ACT_END_OF_FILE - end of file
1018 static int yy_get_next_buffer (void)
1020 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1021 register char *source = (yytext_ptr);
1022 register int number_to_move, i;
1025 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1027 "fatal flex scanner internal error--end of buffer missed" );
1029 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1030 { /* Don't try to fill the buffer, so this is an EOF. */
1031 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1033 /* We matched a single character, the EOB, so
1034 * treat this as a final EOF.
1036 return EOB_ACT_END_OF_FILE;
1041 /* We matched some text prior to the EOB, first
1044 return EOB_ACT_LAST_MATCH;
1048 /* Try to read more data. */
1050 /* First move last chars to start of buffer. */
1051 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1053 for ( i = 0; i < number_to_move; ++i )
1054 *(dest++) = *(source++);
1056 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1057 /* don't do the read, it's not guaranteed to return an EOF,
1060 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1065 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1067 while ( num_to_read <= 0 )
1068 { /* Not enough room in the buffer - grow it. */
1070 /* just a shorter name for the current buffer */
1071 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1073 int yy_c_buf_p_offset =
1074 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1076 if ( b->yy_is_our_buffer )
1078 int new_size = b->yy_buf_size * 2;
1080 if ( new_size <= 0 )
1081 b->yy_buf_size += b->yy_buf_size / 8;
1083 b->yy_buf_size *= 2;
1085 b->yy_ch_buf = (char *)
1086 /* Include room in for 2 EOB chars. */
1087 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1090 /* Can't grow it, we don't own it. */
1093 if ( ! b->yy_ch_buf )
1095 "fatal error - scanner input buffer overflow" );
1097 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1099 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1104 if ( num_to_read > YY_READ_BUF_SIZE )
1105 num_to_read = YY_READ_BUF_SIZE;
1107 /* Read in more data. */
1108 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1109 (yy_n_chars), (size_t) num_to_read );
1111 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1114 if ( (yy_n_chars) == 0 )
1116 if ( number_to_move == YY_MORE_ADJ )
1118 ret_val = EOB_ACT_END_OF_FILE;
1124 ret_val = EOB_ACT_LAST_MATCH;
1125 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1126 YY_BUFFER_EOF_PENDING;
1131 ret_val = EOB_ACT_CONTINUE_SCAN;
1133 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1134 /* Extend the array by 50%, plus the number we really need. */
1135 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1136 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1137 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1138 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1141 (yy_n_chars) += number_to_move;
1142 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1143 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1145 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1150 /* yy_get_previous_state - get the state just before the EOB char was reached */
1152 static yy_state_type yy_get_previous_state (void)
1154 register yy_state_type yy_current_state;
1155 register char *yy_cp;
1157 yy_current_state = (yy_start);
1159 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1161 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1162 if ( yy_accept[yy_current_state] )
1164 (yy_last_accepting_state) = yy_current_state;
1165 (yy_last_accepting_cpos) = yy_cp;
1167 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1169 yy_current_state = (int) yy_def[yy_current_state];
1170 if ( yy_current_state >= 46 )
1171 yy_c = yy_meta[(unsigned int) yy_c];
1173 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1176 return yy_current_state;
1179 /* yy_try_NUL_trans - try to make a transition on the NUL character
1182 * next_state = yy_try_NUL_trans( current_state );
1184 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1186 register int yy_is_jam;
1187 register char *yy_cp = (yy_c_buf_p);
1189 register YY_CHAR yy_c = 1;
1190 if ( yy_accept[yy_current_state] )
1192 (yy_last_accepting_state) = yy_current_state;
1193 (yy_last_accepting_cpos) = yy_cp;
1195 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1197 yy_current_state = (int) yy_def[yy_current_state];
1198 if ( yy_current_state >= 46 )
1199 yy_c = yy_meta[(unsigned int) yy_c];
1201 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1202 yy_is_jam = (yy_current_state == 45);
1204 return yy_is_jam ? 0 : yy_current_state;
1207 static void yyunput (int c, register char * yy_bp )
1209 register char *yy_cp;
1211 yy_cp = (yy_c_buf_p);
1213 /* undo effects of setting up yytext */
1214 *yy_cp = (yy_hold_char);
1216 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1217 { /* need to shift things up to make room */
1218 /* +2 for EOB chars. */
1219 register int number_to_move = (yy_n_chars) + 2;
1220 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1221 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1222 register char *source =
1223 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1225 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1226 *--dest = *--source;
1228 yy_cp += (int) (dest - source);
1229 yy_bp += (int) (dest - source);
1230 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1231 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1233 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1234 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1237 *--yy_cp = (char) c;
1239 (yytext_ptr) = yy_bp;
1240 (yy_hold_char) = *yy_cp;
1241 (yy_c_buf_p) = yy_cp;
1246 static int yyinput (void)
1248 static int input (void)
1254 *(yy_c_buf_p) = (yy_hold_char);
1256 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1258 /* yy_c_buf_p now points to the character we want to return.
1259 * If this occurs *before* the EOB characters, then it's a
1260 * valid NUL; if not, then we've hit the end of the buffer.
1262 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1263 /* This was really a NUL. */
1264 *(yy_c_buf_p) = '\0';
1267 { /* need more input */
1268 int offset = (yy_c_buf_p) - (yytext_ptr);
1271 switch ( yy_get_next_buffer( ) )
1273 case EOB_ACT_LAST_MATCH:
1274 /* This happens because yy_g_n_b()
1275 * sees that we've accumulated a
1276 * token and flags that we need to
1277 * try matching the token before
1278 * proceeding. But for input(),
1279 * there's no matching to consider.
1280 * So convert the EOB_ACT_LAST_MATCH
1281 * to EOB_ACT_END_OF_FILE.
1284 /* Reset buffer status. */
1289 case EOB_ACT_END_OF_FILE:
1294 if ( ! (yy_did_buffer_switch_on_eof) )
1303 case EOB_ACT_CONTINUE_SCAN:
1304 (yy_c_buf_p) = (yytext_ptr) + offset;
1310 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1311 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1312 (yy_hold_char) = *++(yy_c_buf_p);
1316 #endif /* ifndef YY_NO_INPUT */
1318 /** Immediately switch to a different input stream.
1319 * @param input_file A readable stream.
1321 * @note This function does not reset the start condition to @c INITIAL .
1323 void yyrestart (FILE * input_file )
1326 if ( ! YY_CURRENT_BUFFER ){
1327 yyensure_buffer_stack ();
1328 YY_CURRENT_BUFFER_LVALUE =
1329 yy_create_buffer(yyin,YY_BUF_SIZE );
1332 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1333 yy_load_buffer_state( );
1336 /** Switch to a different input buffer.
1337 * @param new_buffer The new input buffer.
1340 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1343 /* TODO. We should be able to replace this entire function body
1345 * yypop_buffer_state();
1346 * yypush_buffer_state(new_buffer);
1348 yyensure_buffer_stack ();
1349 if ( YY_CURRENT_BUFFER == new_buffer )
1352 if ( YY_CURRENT_BUFFER )
1354 /* Flush out information for old buffer. */
1355 *(yy_c_buf_p) = (yy_hold_char);
1356 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1357 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1360 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1361 yy_load_buffer_state( );
1363 /* We don't actually know whether we did this switch during
1364 * EOF (yywrap()) processing, but the only time this flag
1365 * is looked at is after yywrap() is called, so it's safe
1366 * to go ahead and always set it.
1368 (yy_did_buffer_switch_on_eof) = 1;
1371 static void yy_load_buffer_state (void)
1373 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1374 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1375 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1376 (yy_hold_char) = *(yy_c_buf_p);
1379 /** Allocate and initialize an input buffer state.
1380 * @param file A readable stream.
1381 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1383 * @return the allocated buffer state.
1385 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1389 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1391 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1393 b->yy_buf_size = size;
1395 /* yy_ch_buf has to be 2 characters longer than the size given because
1396 * we need to put in 2 end-of-buffer characters.
1398 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1399 if ( ! b->yy_ch_buf )
1400 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1402 b->yy_is_our_buffer = 1;
1404 yy_init_buffer(b,file );
1409 /** Destroy the buffer.
1410 * @param b a buffer created with yy_create_buffer()
1413 void yy_delete_buffer (YY_BUFFER_STATE b )
1419 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1420 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1422 if ( b->yy_is_our_buffer )
1423 yyfree((void *) b->yy_ch_buf );
1425 yyfree((void *) b );
1429 extern int isatty (int );
1430 #endif /* __cplusplus */
1432 /* Initializes or reinitializes a buffer.
1433 * This function is sometimes called more than once on the same buffer,
1434 * such as during a yyrestart() or at EOF.
1436 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1441 yy_flush_buffer(b );
1443 b->yy_input_file = file;
1444 b->yy_fill_buffer = 1;
1446 /* If b is the current buffer, then yy_init_buffer was _probably_
1447 * called from yyrestart() or through yy_get_next_buffer.
1448 * In that case, we don't want to reset the lineno or column.
1450 if (b != YY_CURRENT_BUFFER){
1451 b->yy_bs_lineno = 1;
1452 b->yy_bs_column = 0;
1455 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1460 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1461 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1464 void yy_flush_buffer (YY_BUFFER_STATE b )
1471 /* We always need two end-of-buffer characters. The first causes
1472 * a transition to the end-of-buffer state. The second causes
1473 * a jam in that state.
1475 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1476 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1478 b->yy_buf_pos = &b->yy_ch_buf[0];
1481 b->yy_buffer_status = YY_BUFFER_NEW;
1483 if ( b == YY_CURRENT_BUFFER )
1484 yy_load_buffer_state( );
1487 /** Pushes the new state onto the stack. The new state becomes
1488 * the current state. This function will allocate the stack
1490 * @param new_buffer The new state.
1493 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1495 if (new_buffer == NULL)
1498 yyensure_buffer_stack();
1500 /* This block is copied from yy_switch_to_buffer. */
1501 if ( YY_CURRENT_BUFFER )
1503 /* Flush out information for old buffer. */
1504 *(yy_c_buf_p) = (yy_hold_char);
1505 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1506 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1509 /* Only push if top exists. Otherwise, replace top. */
1510 if (YY_CURRENT_BUFFER)
1511 (yy_buffer_stack_top)++;
1512 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1514 /* copied from yy_switch_to_buffer. */
1515 yy_load_buffer_state( );
1516 (yy_did_buffer_switch_on_eof) = 1;
1519 /** Removes and deletes the top of the stack, if present.
1520 * The next element becomes the new top.
1523 void yypop_buffer_state (void)
1525 if (!YY_CURRENT_BUFFER)
1528 yy_delete_buffer(YY_CURRENT_BUFFER );
1529 YY_CURRENT_BUFFER_LVALUE = NULL;
1530 if ((yy_buffer_stack_top) > 0)
1531 --(yy_buffer_stack_top);
1533 if (YY_CURRENT_BUFFER) {
1534 yy_load_buffer_state( );
1535 (yy_did_buffer_switch_on_eof) = 1;
1539 /* Allocates the stack if it does not exist.
1540 * Guarantees space for at least one push.
1542 static void yyensure_buffer_stack (void)
1546 if (!(yy_buffer_stack)) {
1548 /* First allocation is just for 2 elements, since we don't know if this
1549 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1550 * immediate realloc on the next call.
1553 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1554 (num_to_alloc * sizeof(struct yy_buffer_state*)
1556 if ( ! (yy_buffer_stack) )
1557 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1559 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1561 (yy_buffer_stack_max) = num_to_alloc;
1562 (yy_buffer_stack_top) = 0;
1566 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1568 /* Increase the buffer to prepare for a possible push. */
1569 int grow_size = 8 /* arbitrary grow size */;
1571 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1572 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1574 num_to_alloc * sizeof(struct yy_buffer_state*)
1576 if ( ! (yy_buffer_stack) )
1577 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1579 /* zero only the new slots.*/
1580 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1581 (yy_buffer_stack_max) = num_to_alloc;
1585 /** Setup the input buffer state to scan directly from a user-specified character buffer.
1586 * @param base the character buffer
1587 * @param size the size in bytes of the character buffer
1589 * @return the newly allocated buffer state object.
1591 YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1596 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1597 base[size-1] != YY_END_OF_BUFFER_CHAR )
1598 /* They forgot to leave room for the EOB's. */
1601 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1603 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1605 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1606 b->yy_buf_pos = b->yy_ch_buf = base;
1607 b->yy_is_our_buffer = 0;
1608 b->yy_input_file = 0;
1609 b->yy_n_chars = b->yy_buf_size;
1610 b->yy_is_interactive = 0;
1612 b->yy_fill_buffer = 0;
1613 b->yy_buffer_status = YY_BUFFER_NEW;
1615 yy_switch_to_buffer(b );
1620 /** Setup the input buffer state to scan a string. The next call to yylex() will
1621 * scan from a @e copy of @a str.
1622 * @param yystr a NUL-terminated string to scan
1624 * @return the newly allocated buffer state object.
1625 * @note If you want to scan bytes that may contain NUL values, then use
1626 * yy_scan_bytes() instead.
1628 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1631 return yy_scan_bytes(yystr,strlen(yystr) );
1634 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1635 * scan from a @e copy of @a bytes.
1636 * @param bytes the byte buffer to scan
1637 * @param len the number of bytes in the buffer pointed to by @a bytes.
1639 * @return the newly allocated buffer state object.
1641 YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1648 /* Get memory for full buffer, including space for trailing EOB's. */
1649 n = _yybytes_len + 2;
1650 buf = (char *) yyalloc(n );
1652 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1654 for ( i = 0; i < _yybytes_len; ++i )
1655 buf[i] = yybytes[i];
1657 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1659 b = yy_scan_buffer(buf,n );
1661 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1663 /* It's okay to grow etc. this buffer, and we should throw it
1664 * away when we're done.
1666 b->yy_is_our_buffer = 1;
1671 #ifndef YY_EXIT_FAILURE
1672 #define YY_EXIT_FAILURE 2
1675 static void yy_fatal_error (yyconst char* msg )
1677 (void) fprintf( stderr, "%s\n", msg );
1678 exit( YY_EXIT_FAILURE );
1681 /* Redefine yyless() so it works in section 3 code. */
1687 /* Undo effects of setting up yytext. */ \
1688 int yyless_macro_arg = (n); \
1689 YY_LESS_LINENO(yyless_macro_arg);\
1690 yytext[yyleng] = (yy_hold_char); \
1691 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1692 (yy_hold_char) = *(yy_c_buf_p); \
1693 *(yy_c_buf_p) = '\0'; \
1694 yyleng = yyless_macro_arg; \
1698 /* Accessor methods (get/set functions) to struct members. */
1700 /** Get the current line number.
1703 int yyget_lineno (void)
1709 /** Get the input stream.
1712 FILE *yyget_in (void)
1717 /** Get the output stream.
1720 FILE *yyget_out (void)
1725 /** Get the length of the current token.
1728 int yyget_leng (void)
1733 /** Get the current token.
1737 char *yyget_text (void)
1742 /** Set the current line number.
1743 * @param line_number
1746 void yyset_lineno (int line_number )
1749 yylineno = line_number;
1752 /** Set the input stream. This does not discard the current
1754 * @param in_str A readable stream.
1756 * @see yy_switch_to_buffer
1758 void yyset_in (FILE * in_str )
1763 void yyset_out (FILE * out_str )
1768 int yyget_debug (void)
1770 return yy_flex_debug;
1773 void yyset_debug (int bdebug )
1775 yy_flex_debug = bdebug ;
1778 static int yy_init_globals (void)
1780 /* Initialization is the same as for the non-reentrant scanner.
1781 * This function is called from yylex_destroy(), so don't allocate here.
1784 (yy_buffer_stack) = 0;
1785 (yy_buffer_stack_top) = 0;
1786 (yy_buffer_stack_max) = 0;
1787 (yy_c_buf_p) = (char *) 0;
1791 /* Defined in main.c */
1800 /* For future reference: Set errno on error, since we are called by
1806 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
1807 int yylex_destroy (void)
1810 /* Pop the buffer stack, destroying each element. */
1811 while(YY_CURRENT_BUFFER){
1812 yy_delete_buffer(YY_CURRENT_BUFFER );
1813 YY_CURRENT_BUFFER_LVALUE = NULL;
1814 yypop_buffer_state();
1817 /* Destroy the stack itself. */
1818 yyfree((yy_buffer_stack) );
1819 (yy_buffer_stack) = NULL;
1821 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1822 * yylex() is called, initialization will occur. */
1829 * Internal utility routines.
1833 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1836 for ( i = 0; i < n; ++i )
1841 #ifdef YY_NEED_STRLEN
1842 static int yy_flex_strlen (yyconst char * s )
1845 for ( n = 0; s[n]; ++n )
1852 void *yyalloc (yy_size_t size )
1854 return (void *) malloc( size );
1857 void *yyrealloc (void * ptr, yy_size_t size )
1859 /* The cast to (char *) in the following accommodates both
1860 * implementations that use char* generic pointers, and those
1861 * that use void* generic pointers. It works with the latter
1862 * because both ANSI C and C++ allow castless assignment from
1863 * any pointer type to void*, and deal with argument conversions
1864 * as though doing an assignment.
1866 return (void *) realloc( (char *) ptr, size );
1869 void yyfree (void * ptr )
1871 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1874 #define YYTABLES_NAME "yytables"
1880 #ifndef yywrap /* XXX */
1895 while(i < sizeof(x) - 1 && (c = input()) != EOF){
1902 lex_err_message("unterminated string");
1915 yylval.string = strdup(x);
1916 if (yylval.string == NULL)
1922 lex_err_message (const char *format, ...)
1926 va_start (args, format);
1927 fprintf (stderr, "%s:%d:", filename, lineno);
1928 vfprintf (stderr, format, args);