1 /* A lexical scanner generated by flex */
3 /* Scanner skeleton version:
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
17 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
35 /* Use prototypes in function declarations. */
38 /* The "const" storage-class-modifier is valid. */
41 #else /* ! __cplusplus */
49 #endif /* ! __cplusplus */
68 #define YY_PROTO(proto) proto
70 #define YY_PROTO(proto) ()
73 /* Returned upon end-of-file. */
76 /* Promotes a possibly negative, possibly signed char to an unsigned
77 * integer for use as an array index. If the signed char is negative,
78 * we want to instead treat it as an 8-bit unsigned char, hence the
81 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
83 /* Enter a start condition. This macro really ought to take a parameter,
84 * but we do it the disgusting crufty way forced on us by the ()-less
85 * definition of BEGIN.
87 #define BEGIN yy_start = 1 + 2 *
89 /* Translate the current start state into a value that can be later handed
90 * to BEGIN to return to the state. The YYSTATE alias is for lex
93 #define YY_START ((yy_start - 1) / 2)
94 #define YYSTATE YY_START
96 /* Action number for EOF rule of a given start state. */
97 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
99 /* Special action meaning "start processing a new file". */
100 #define YY_NEW_FILE yyrestart( yyin )
102 #define YY_END_OF_BUFFER_CHAR 0
104 /* Size of default input buffer. */
105 #define YY_BUF_SIZE 16384
107 typedef struct yy_buffer_state *YY_BUFFER_STATE;
112 extern FILE *yyin, *yyout;
116 #define EOB_ACT_CONTINUE_SCAN 0
117 #define EOB_ACT_END_OF_FILE 1
118 #define EOB_ACT_LAST_MATCH 2
120 /* The funky do-while in the following #define is used to turn the definition
121 * int a single C statement (which needs a semi-colon terminator). This
122 * avoids problems with code like:
124 * if ( condition_holds )
127 * do_something_else();
129 * Prior to using the do-while the compiler would get upset at the
130 * "else" because it interpreted the "if" statement as being all
131 * done when it reached the ';' after the yyless() call.
134 /* Return all but the first 'n' matched characters back to the input stream. */
139 /* Undo effects of setting up yytext. */ \
140 *yy_cp = yy_hold_char; \
141 YY_RESTORE_YY_MORE_OFFSET \
142 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
143 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
147 #define unput(c) yyunput( c, yytext_ptr )
149 /* The following is because we cannot portably get our hands on size_t
150 * (without autoconf's help, which isn't available because we want
151 * flex-generated scanners to compile on their own).
153 typedef unsigned int yy_size_t;
156 struct yy_buffer_state
163 istream* yy_input_file;
167 char *yy_ch_buf; /* input buffer */
168 char *yy_buf_pos; /* current position in input buffer */
170 /* Size of input buffer in bytes, not including room for EOB
173 yy_size_t yy_buf_size;
175 /* Number of characters read into yy_ch_buf, not including EOB
180 /* Whether we "own" the buffer - i.e., we know we created it,
181 * and can realloc() it to grow it, and should free() it to
184 int yy_is_our_buffer;
186 /* Whether this is an "interactive" input source; if so, and
187 * if we're using stdio for input, then we want to use getc()
188 * instead of fread(), to make sure we stop fetching input after
191 int yy_is_interactive;
193 /* Whether we're considered to be at the beginning of a line.
194 * If so, '^' rules will be active on the next match, otherwise
199 /* Whether to try to fill the input buffer when we reach the
204 int yy_buffer_status;
205 #define YY_BUFFER_NEW 0
206 #define YY_BUFFER_NORMAL 1
207 /* When an EOF's been seen but there's still some text to process
208 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
209 * shouldn't try reading from the input source any more. We might
210 * still have a bunch of tokens to match, though, because of
211 * possible backing-up.
213 * When we actually see the EOF, we change the status to "new"
214 * (via yyrestart()), so that the user can continue scanning by
215 * just pointing yyin at a new input file.
217 #define YY_BUFFER_EOF_PENDING 2
220 %- Standard (non-C++) definition
222 static YY_BUFFER_STATE yy_current_buffer = 0;
226 /* We provide macros for accessing buffer states in case in the
227 * future we want to put the buffer states in a more general
230 #define YY_CURRENT_BUFFER yy_current_buffer
233 %- Standard (non-C++) definition
235 /* yy_hold_char holds the character lost when yytext is formed. */
236 static char yy_hold_char;
238 static int yy_n_chars; /* number of characters read into yy_ch_buf */
243 /* Points to current character in buffer. */
244 static char *yy_c_buf_p = (char *) 0;
245 static int yy_init = 1; /* whether we need to initialize */
246 static int yy_start = 0; /* start state number */
248 /* Flag which is used to allow yywrap()'s to do buffer switches
249 * instead of setting up a fresh yyin. A bit of a hack ...
251 static int yy_did_buffer_switch_on_eof;
253 void yyrestart YY_PROTO(( FILE *input_file ));
255 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
256 void yy_load_buffer_state YY_PROTO(( void ));
257 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
258 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
259 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
260 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
261 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
263 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
264 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
265 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
269 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
270 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
271 static void yy_flex_free YY_PROTO(( void * ));
273 #define yy_new_buffer yy_create_buffer
275 #define yy_set_interactive(is_interactive) \
277 if ( ! yy_current_buffer ) \
278 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
279 yy_current_buffer->yy_is_interactive = is_interactive; \
282 #define yy_set_bol(at_bol) \
284 if ( ! yy_current_buffer ) \
285 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
286 yy_current_buffer->yy_at_bol = at_bol; \
289 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
291 %% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
294 %- Standard (non-C++) definition
296 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
297 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
298 static int yy_get_next_buffer YY_PROTO(( void ));
299 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
303 /* Done after the current pattern has been matched and before the
304 * corresponding action - sets up yytext.
306 #define YY_DO_BEFORE_ACTION \
307 yytext_ptr = yy_bp; \
308 %% code to fiddle yytext and yyleng for yymore() goes here
309 yy_hold_char = *yy_cp; \
311 %% code to copy yytext_ptr to yytext[] goes here, if %array
316 %% data tables for the DFA and the user's section 1 definitions go here
319 /* Macros after this point can all be overridden by user definitions in
323 #ifndef YY_SKIP_YYWRAP
325 extern "C" int yywrap YY_PROTO(( void ));
327 extern int yywrap YY_PROTO(( void ));
334 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
340 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
343 #ifdef YY_NEED_STRLEN
344 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
348 %- Standard (non-C++) definition
351 static int yyinput YY_PROTO(( void ));
353 static int input YY_PROTO(( void ));
360 static int yy_start_stack_ptr = 0;
361 static int yy_start_stack_depth = 0;
362 static int *yy_start_stack = 0;
363 #ifndef YY_NO_PUSH_STATE
364 static void yy_push_state YY_PROTO(( int new_state ));
366 #ifndef YY_NO_POP_STATE
367 static void yy_pop_state YY_PROTO(( void ));
369 #ifndef YY_NO_TOP_STATE
370 static int yy_top_state YY_PROTO(( void ));
374 #define YY_NO_PUSH_STATE 1
375 #define YY_NO_POP_STATE 1
376 #define YY_NO_TOP_STATE 1
379 #ifdef YY_MALLOC_DECL
387 /* Just try to get by without declaring the routines.. This will fail
388 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
389 * or sizeof(void*) != sizeof(int).
394 /* Amount of stuff to slurp up with each read. */
395 #ifndef YY_READ_BUF_SIZE
396 #define YY_READ_BUF_SIZE 8192
399 /* Copy whatever the last rule matched to the standard output. */
402 %- Standard (non-C++) definition
404 /* This used to be an fputs(), but since the string might contain NUL's,
405 * we now use fwrite().
407 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
410 #define ECHO LexerOutput( yytext, yyleng )
415 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
416 * is returned in "result".
419 #define YY_INPUT(buf,result,max_size) \
420 %% fread()/read() definition of YY_INPUT goes here unless we're doing C++
424 if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
425 YY_FATAL_ERROR( "input in flex scanner failed" );
430 /* No semi-colon after return; correct usage is to write "yyterminate();" -
431 * we don't want an extra ';' after the "return" because that will cause
432 * some compilers to complain about unreachable statements.
435 #define yyterminate() return YY_NULL
438 /* Number of entries by which start-condition stack grows. */
439 #ifndef YY_START_STACK_INCR
440 #define YY_START_STACK_INCR 25
443 /* Report a fatal error. */
444 #ifndef YY_FATAL_ERROR
447 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
450 #define YY_FATAL_ERROR(msg) LexerError( msg )
455 /* Default declaration of generated scanner - a define so the user can
456 * easily add parameters.
459 %- Standard (non-C++) definition
461 #define YY_DECL int yylex YY_PROTO(( void ))
464 #define YY_DECL int yyFlexLexer::yylex()
469 /* Code executed at the beginning of each rule, after yytext and yyleng
472 #ifndef YY_USER_ACTION
473 #define YY_USER_ACTION
476 /* Code executed at the end of each rule. */
478 #define YY_BREAK break;
481 %% YY_RULE_SETUP definition goes here
486 register yy_state_type yy_current_state;
487 register char *yy_cp, *yy_bp;
490 %% user's declarations go here
502 yy_start = 1; /* first start state */
524 if ( ! yy_current_buffer )
526 yy_create_buffer( yyin, YY_BUF_SIZE );
528 yy_load_buffer_state();
531 while ( 1 ) /* loops until end-of-file is reached */
533 %% yymore()-related code goes here
537 /* Support of yytext. */
538 *yy_cp = yy_hold_char;
540 /* yy_bp points to the position in yy_ch_buf of the start of
545 %% code to set up and find next match goes here
549 %% code to find the action number goes here
554 %% code for yylineno update goes here
557 do_action: /* This label is used only to access EOF actions. */
559 %% debug code goes here
563 { /* beginning of action switch */
567 case YY_END_OF_BUFFER:
569 /* Amount of text matched not including the EOB char. */
570 int yy_amount_of_matched_text = (int) (yy_cp - (char *) yytext_ptr) - 1;
572 /* Undo the effects of YY_DO_BEFORE_ACTION. */
573 *yy_cp = yy_hold_char;
574 YY_RESTORE_YY_MORE_OFFSET
576 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
578 /* We're scanning a new file or input source. It's
579 * possible that this happened because the user
580 * just pointed yyin at a new source and called
581 * yylex(). If so, then we have to assure
582 * consistency between yy_current_buffer and our
583 * globals. Here is the right place to do so, because
584 * this is the first action (other than possibly a
585 * back-up) that will match for the new input source.
587 yy_n_chars = yy_current_buffer->yy_n_chars;
588 yy_current_buffer->yy_input_file = yyin;
589 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
592 /* Note that here we test for yy_c_buf_p "<=" to the position
593 * of the first EOB in the buffer, since yy_c_buf_p will
594 * already have been incremented past the NUL character
595 * (since all states make transitions on EOB to the
596 * end-of-buffer state). Contrast this with the test
599 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
600 { /* This was really a NUL. */
601 yy_state_type yy_next_state;
603 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
605 yy_current_state = yy_get_previous_state();
607 /* Okay, we're now positioned to make the NUL
608 * transition. We couldn't have
609 * yy_get_previous_state() go ahead and do it
610 * for us because it doesn't know how to deal
611 * with the possibility of jamming (and we don't
612 * want to build jamming into it because then it
613 * will run more slowly).
616 yy_next_state = yy_try_NUL_trans( yy_current_state );
618 yy_bp = yytext_ptr + YY_MORE_ADJ;
622 /* Consume the NUL. */
623 yy_cp = ++yy_c_buf_p;
624 yy_current_state = yy_next_state;
630 %% code to do back-up for compressed tables and set up yy_cp goes here
636 else switch ( yy_get_next_buffer() )
638 case EOB_ACT_END_OF_FILE:
640 yy_did_buffer_switch_on_eof = 0;
644 /* Note: because we've taken care in
645 * yy_get_next_buffer() to have set up
646 * yytext, we can now set up
647 * yy_c_buf_p so that if some total
648 * hoser (like flex itself) wants to
649 * call the scanner after we return the
650 * YY_NULL, it'll still work - another
651 * YY_NULL will get returned.
653 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
655 yy_act = YY_STATE_EOF(YY_START);
661 if ( ! yy_did_buffer_switch_on_eof )
667 case EOB_ACT_CONTINUE_SCAN:
669 yytext_ptr + yy_amount_of_matched_text;
671 yy_current_state = yy_get_previous_state();
674 yy_bp = yytext_ptr + YY_MORE_ADJ;
677 case EOB_ACT_LAST_MATCH:
679 &yy_current_buffer->yy_ch_buf[yy_n_chars];
681 yy_current_state = yy_get_previous_state();
684 yy_bp = yytext_ptr + YY_MORE_ADJ;
692 "fatal flex scanner internal error--no action found" );
693 } /* end of action switch */
694 } /* end of scanning one token */
699 yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )
707 yylineno = 1; // this will only get updated if %option yylineno
709 yy_did_buffer_switch_on_eof = 0;
711 yy_looking_for_trail_begin = 0;
714 yy_more_offset = yy_prev_more_offset = 0;
716 yy_start_stack_ptr = yy_start_stack_depth = 0;
719 yy_current_buffer = 0;
721 #ifdef YY_USES_REJECT
722 yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2];
728 yyFlexLexer::~yyFlexLexer()
731 yy_delete_buffer( yy_current_buffer );
734 void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out )
738 yy_delete_buffer( yy_current_buffer );
739 yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
746 #ifdef YY_INTERACTIVE
747 int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
749 int yyFlexLexer::LexerInput( char* buf, int max_size )
752 if ( yyin->eof() || yyin->fail() )
755 #ifdef YY_INTERACTIVE
767 (void) yyin->read( buf, max_size );
772 return yyin->gcount();
776 void yyFlexLexer::LexerOutput( const char* buf, int size )
778 (void) yyout->write( buf, size );
783 /* yy_get_next_buffer - try to read in a new buffer
785 * Returns a code representing an action:
786 * EOB_ACT_LAST_MATCH -
787 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
788 * EOB_ACT_END_OF_FILE - end of file
793 static int yy_get_next_buffer()
796 int yyFlexLexer::yy_get_next_buffer()
800 register char *dest = yy_current_buffer->yy_ch_buf;
801 register char *source = yytext_ptr;
802 register int number_to_move, i;
805 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
807 "fatal flex scanner internal error--end of buffer missed" );
809 if ( yy_current_buffer->yy_fill_buffer == 0 )
810 { /* Don't try to fill the buffer, so this is an EOF. */
811 if ( yy_c_buf_p - (char *) yytext_ptr - YY_MORE_ADJ == 1 )
813 /* We matched a single character, the EOB, so
814 * treat this as a final EOF.
816 return EOB_ACT_END_OF_FILE;
821 /* We matched some text prior to the EOB, first
824 return EOB_ACT_LAST_MATCH;
828 /* Try to read more data. */
830 /* First move last chars to start of buffer. */
831 number_to_move = (int) (yy_c_buf_p - (char *) yytext_ptr) - 1;
833 for ( i = 0; i < number_to_move; ++i )
834 *(dest++) = *(source++);
836 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
837 /* don't do the read, it's not guaranteed to return an EOF,
840 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
845 yy_current_buffer->yy_buf_size - number_to_move - 1;
847 while ( num_to_read <= 0 )
848 { /* Not enough room in the buffer - grow it. */
849 #ifdef YY_USES_REJECT
851 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
854 /* just a shorter name for the current buffer */
855 YY_BUFFER_STATE b = yy_current_buffer;
857 int yy_c_buf_p_offset =
858 (int) (yy_c_buf_p - b->yy_ch_buf);
860 if ( b->yy_is_our_buffer )
862 int new_size = b->yy_buf_size * 2;
865 b->yy_buf_size += b->yy_buf_size / 8;
869 b->yy_ch_buf = (char *)
870 /* Include room in for 2 EOB chars. */
871 yy_flex_realloc( (void *) b->yy_ch_buf,
872 b->yy_buf_size + 2 );
875 /* Can't grow it, we don't own it. */
878 if ( ! b->yy_ch_buf )
880 "fatal error - scanner input buffer overflow" );
882 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
884 num_to_read = yy_current_buffer->yy_buf_size -
889 if ( num_to_read > YY_READ_BUF_SIZE )
890 num_to_read = YY_READ_BUF_SIZE;
892 /* Read in more data. */
893 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
894 yy_n_chars, num_to_read );
896 yy_current_buffer->yy_n_chars = yy_n_chars;
899 if ( yy_n_chars == 0 )
901 if ( number_to_move == YY_MORE_ADJ )
903 ret_val = EOB_ACT_END_OF_FILE;
909 ret_val = EOB_ACT_LAST_MATCH;
910 yy_current_buffer->yy_buffer_status =
911 YY_BUFFER_EOF_PENDING;
916 ret_val = EOB_ACT_CONTINUE_SCAN;
918 yy_n_chars += number_to_move;
919 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
920 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
922 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
928 /* yy_get_previous_state - get the state just before the EOB char was reached */
932 static yy_state_type yy_get_previous_state()
935 yy_state_type yyFlexLexer::yy_get_previous_state()
939 register yy_state_type yy_current_state;
940 register char *yy_cp;
942 %% code to get the start state into yy_current_state goes here
945 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
947 %% code to find the next state goes here
951 return yy_current_state;
955 /* yy_try_NUL_trans - try to make a transition on the NUL character
958 * next_state = yy_try_NUL_trans( current_state );
964 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
966 static yy_state_type yy_try_NUL_trans( yy_current_state )
967 yy_state_type yy_current_state;
971 yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
975 register int yy_is_jam;
976 %% code to find the next state, and perhaps do backing up, goes here
979 return yy_is_jam ? 0 : yy_current_state;
987 static void yyunput( int c, register char *yy_bp )
989 static void yyunput( c, yy_bp )
991 register char *yy_bp;
995 void yyFlexLexer::yyunput( int c, register char* yy_bp )
999 register char *yy_cp = yy_c_buf_p;
1001 /* undo effects of setting up yytext */
1002 *yy_cp = yy_hold_char;
1004 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1005 { /* need to shift things up to make room */
1006 /* +2 for EOB chars. */
1007 register int number_to_move = yy_n_chars + 2;
1008 register char *dest = &yy_current_buffer->yy_ch_buf[
1009 yy_current_buffer->yy_buf_size + 2];
1010 register char *source =
1011 &yy_current_buffer->yy_ch_buf[number_to_move];
1013 while ( source > yy_current_buffer->yy_ch_buf )
1014 *--dest = *--source;
1016 yy_cp += (int) (dest - source);
1017 yy_bp += (int) (dest - source);
1018 yy_current_buffer->yy_n_chars =
1019 yy_n_chars = yy_current_buffer->yy_buf_size;
1021 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1022 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1025 *--yy_cp = (char) c;
1027 %% update yylineno here
1028 #line 1029 "flex.skl"
1031 yy_hold_char = *yy_cp;
1035 #line 1036 "flex.skl"
1036 #endif /* ifndef YY_NO_UNPUT */
1038 #line 1039 "flex.skl"
1042 #line 1043 "flex.skl"
1044 static int yyinput()
1049 #line 1050 "flex.skl"
1050 int yyFlexLexer::yyinput()
1052 #line 1053 "flex.skl"
1056 *yy_c_buf_p = yy_hold_char;
1058 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1060 /* yy_c_buf_p now points to the character we want to return.
1061 * If this occurs *before* the EOB characters, then it's a
1062 * valid NUL; if not, then we've hit the end of the buffer.
1064 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1065 /* This was really a NUL. */
1069 { /* need more input */
1070 int offset = yy_c_buf_p - (char *) yytext_ptr;
1073 switch ( yy_get_next_buffer() )
1075 case EOB_ACT_LAST_MATCH:
1076 /* This happens because yy_g_n_b()
1077 * sees that we've accumulated a
1078 * token and flags that we need to
1079 * try matching the token before
1080 * proceeding. But for input(),
1081 * there's no matching to consider.
1082 * So convert the EOB_ACT_LAST_MATCH
1083 * to EOB_ACT_END_OF_FILE.
1086 /* Reset buffer status. */
1091 case EOB_ACT_END_OF_FILE:
1096 if ( ! yy_did_buffer_switch_on_eof )
1105 case EOB_ACT_CONTINUE_SCAN:
1106 yy_c_buf_p = yytext_ptr + offset;
1112 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1113 *yy_c_buf_p = '\0'; /* preserve yytext */
1114 yy_hold_char = *++yy_c_buf_p;
1116 %% update BOL and yylineno
1117 #line 1118 "flex.skl"
1124 #line 1125 "flex.skl"
1125 #ifdef YY_USE_PROTOS
1126 void yyrestart( FILE *input_file )
1128 void yyrestart( input_file )
1132 #line 1133 "flex.skl"
1133 void yyFlexLexer::yyrestart( istream* input_file )
1135 #line 1136 "flex.skl"
1137 if ( ! yy_current_buffer )
1138 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1140 yy_init_buffer( yy_current_buffer, input_file );
1141 yy_load_buffer_state();
1146 #line 1147 "flex.skl"
1147 #ifdef YY_USE_PROTOS
1148 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1150 void yy_switch_to_buffer( new_buffer )
1151 YY_BUFFER_STATE new_buffer;
1154 #line 1155 "flex.skl"
1155 void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1157 #line 1158 "flex.skl"
1159 if ( yy_current_buffer == new_buffer )
1162 if ( yy_current_buffer )
1164 /* Flush out information for old buffer. */
1165 *yy_c_buf_p = yy_hold_char;
1166 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1167 yy_current_buffer->yy_n_chars = yy_n_chars;
1170 yy_current_buffer = new_buffer;
1171 yy_load_buffer_state();
1173 /* We don't actually know whether we did this switch during
1174 * EOF (yywrap()) processing, but the only time this flag
1175 * is looked at is after yywrap() is called, so it's safe
1176 * to go ahead and always set it.
1178 yy_did_buffer_switch_on_eof = 1;
1183 #line 1184 "flex.skl"
1184 #ifdef YY_USE_PROTOS
1185 void yy_load_buffer_state( void )
1187 void yy_load_buffer_state()
1190 #line 1191 "flex.skl"
1191 void yyFlexLexer::yy_load_buffer_state()
1193 #line 1194 "flex.skl"
1195 yy_n_chars = yy_current_buffer->yy_n_chars;
1196 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1197 yyin = yy_current_buffer->yy_input_file;
1198 yy_hold_char = *yy_c_buf_p;
1203 #line 1204 "flex.skl"
1204 #ifdef YY_USE_PROTOS
1205 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1207 YY_BUFFER_STATE yy_create_buffer( file, size )
1212 #line 1213 "flex.skl"
1213 YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size )
1215 #line 1216 "flex.skl"
1219 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1221 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1223 b->yy_buf_size = size;
1225 /* yy_ch_buf has to be 2 characters longer than the size given because
1226 * we need to put in 2 end-of-buffer characters.
1228 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1229 if ( ! b->yy_ch_buf )
1230 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1232 b->yy_is_our_buffer = 1;
1234 yy_init_buffer( b, file );
1241 #line 1242 "flex.skl"
1242 #ifdef YY_USE_PROTOS
1243 void yy_delete_buffer( YY_BUFFER_STATE b )
1245 void yy_delete_buffer( b )
1249 #line 1250 "flex.skl"
1250 void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
1252 #line 1253 "flex.skl"
1257 if ( b == yy_current_buffer )
1258 yy_current_buffer = (YY_BUFFER_STATE) 0;
1260 if ( b->yy_is_our_buffer )
1261 yy_flex_free( (void *) b->yy_ch_buf );
1263 yy_flex_free( (void *) b );
1268 #line 1269 "flex.skl"
1269 #ifndef YY_ALWAYS_INTERACTIVE
1270 #ifndef YY_NEVER_INTERACTIVE
1271 extern int isatty YY_PROTO(( int ));
1275 #ifdef YY_USE_PROTOS
1276 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1278 void yy_init_buffer( b, file )
1284 #line 1285 "flex.skl"
1285 extern "C" int isatty YY_PROTO(( int ));
1286 void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
1288 #line 1289 "flex.skl"
1291 #line 1292 "flex.skl"
1292 yy_flush_buffer( b );
1294 b->yy_input_file = file;
1295 b->yy_fill_buffer = 1;
1298 #line 1299 "flex.skl"
1299 #if YY_ALWAYS_INTERACTIVE
1300 b->yy_is_interactive = 1;
1302 #if YY_NEVER_INTERACTIVE
1303 b->yy_is_interactive = 0;
1305 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1309 #line 1310 "flex.skl"
1310 b->yy_is_interactive = 0;
1312 #line 1313 "flex.skl"
1317 #line 1318 "flex.skl"
1318 #ifdef YY_USE_PROTOS
1319 void yy_flush_buffer( YY_BUFFER_STATE b )
1321 void yy_flush_buffer( b )
1326 #line 1327 "flex.skl"
1327 void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
1329 #line 1330 "flex.skl"
1336 /* We always need two end-of-buffer characters. The first causes
1337 * a transition to the end-of-buffer state. The second causes
1338 * a jam in that state.
1340 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1341 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1343 b->yy_buf_pos = &b->yy_ch_buf[0];
1346 b->yy_buffer_status = YY_BUFFER_NEW;
1348 if ( b == yy_current_buffer )
1349 yy_load_buffer_state();
1352 #line 1353 "flex.skl"
1355 #ifndef YY_NO_SCAN_BUFFER
1357 #line 1358 "flex.skl"
1358 #ifdef YY_USE_PROTOS
1359 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1361 YY_BUFFER_STATE yy_scan_buffer( base, size )
1369 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1370 base[size-1] != YY_END_OF_BUFFER_CHAR )
1371 /* They forgot to leave room for the EOB's. */
1374 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1376 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1378 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1379 b->yy_buf_pos = b->yy_ch_buf = base;
1380 b->yy_is_our_buffer = 0;
1381 b->yy_input_file = 0;
1382 b->yy_n_chars = b->yy_buf_size;
1383 b->yy_is_interactive = 0;
1385 b->yy_fill_buffer = 0;
1386 b->yy_buffer_status = YY_BUFFER_NEW;
1388 yy_switch_to_buffer( b );
1394 #line 1395 "flex.skl"
1397 #ifndef YY_NO_SCAN_STRING
1399 #line 1400 "flex.skl"
1400 #ifdef YY_USE_PROTOS
1401 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1403 YY_BUFFER_STATE yy_scan_string( yy_str )
1404 yyconst char *yy_str;
1408 for ( len = 0; yy_str[len]; ++len )
1411 return yy_scan_bytes( yy_str, len );
1415 #line 1416 "flex.skl"
1418 #ifndef YY_NO_SCAN_BYTES
1420 #line 1421 "flex.skl"
1421 #ifdef YY_USE_PROTOS
1422 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1424 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1425 yyconst char *bytes;
1434 /* Get memory for full buffer, including space for trailing EOB's. */
1436 buf = (char *) yy_flex_alloc( n );
1438 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1440 for ( i = 0; i < len; ++i )
1443 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1445 b = yy_scan_buffer( buf, n );
1447 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1449 /* It's okay to grow etc. this buffer, and we should throw it
1450 * away when we're done.
1452 b->yy_is_our_buffer = 1;
1458 #line 1459 "flex.skl"
1461 #ifndef YY_NO_PUSH_STATE
1463 #line 1464 "flex.skl"
1464 #ifdef YY_USE_PROTOS
1465 static void yy_push_state( int new_state )
1467 static void yy_push_state( new_state )
1471 #line 1472 "flex.skl"
1472 void yyFlexLexer::yy_push_state( int new_state )
1474 #line 1475 "flex.skl"
1476 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1480 yy_start_stack_depth += YY_START_STACK_INCR;
1481 new_size = yy_start_stack_depth * sizeof( int );
1483 if ( ! yy_start_stack )
1484 yy_start_stack = (int *) yy_flex_alloc( new_size );
1487 yy_start_stack = (int *) yy_flex_realloc(
1488 (void *) yy_start_stack, new_size );
1490 if ( ! yy_start_stack )
1492 "out of memory expanding start-condition stack" );
1495 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1502 #ifndef YY_NO_POP_STATE
1504 #line 1505 "flex.skl"
1505 static void yy_pop_state()
1507 #line 1508 "flex.skl"
1508 void yyFlexLexer::yy_pop_state()
1510 #line 1511 "flex.skl"
1512 if ( --yy_start_stack_ptr < 0 )
1513 YY_FATAL_ERROR( "start-condition stack underflow" );
1515 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1520 #ifndef YY_NO_TOP_STATE
1522 #line 1523 "flex.skl"
1523 static int yy_top_state()
1525 #line 1526 "flex.skl"
1526 int yyFlexLexer::yy_top_state()
1528 #line 1529 "flex.skl"
1530 return yy_start_stack[yy_start_stack_ptr - 1];
1534 #ifndef YY_EXIT_FAILURE
1535 #define YY_EXIT_FAILURE 2
1539 #line 1540 "flex.skl"
1540 #ifdef YY_USE_PROTOS
1541 static void yy_fatal_error( yyconst char msg[] )
1543 static void yy_fatal_error( msg )
1547 (void) fprintf( stderr, "%s\n", msg );
1548 exit( YY_EXIT_FAILURE );
1552 #line 1553 "flex.skl"
1554 void yyFlexLexer::LexerError( yyconst char msg[] )
1556 cerr << msg << '\n';
1557 exit( YY_EXIT_FAILURE );
1560 #line 1561 "flex.skl"
1563 /* Redefine yyless() so it works in section 3 code. */
1569 /* Undo effects of setting up yytext. */ \
1570 yytext[yyleng] = yy_hold_char; \
1571 yy_c_buf_p = yytext + n; \
1572 yy_hold_char = *yy_c_buf_p; \
1573 *yy_c_buf_p = '\0'; \
1579 /* Internal utility routines. */
1582 #ifdef YY_USE_PROTOS
1583 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1585 static void yy_flex_strncpy( s1, s2, n )
1592 for ( i = 0; i < n; ++i )
1597 #ifdef YY_NEED_STRLEN
1598 #ifdef YY_USE_PROTOS
1599 static int yy_flex_strlen( yyconst char *s )
1601 static int yy_flex_strlen( s )
1606 for ( n = 0; s[n]; ++n )
1614 #ifdef YY_USE_PROTOS
1615 static void *yy_flex_alloc( yy_size_t size )
1617 static void *yy_flex_alloc( size )
1621 return (void *) malloc( size );
1624 #ifdef YY_USE_PROTOS
1625 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1627 static void *yy_flex_realloc( ptr, size )
1632 /* The cast to (char *) in the following accommodates both
1633 * implementations that use char* generic pointers, and those
1634 * that use void* generic pointers. It works with the latter
1635 * because both ANSI C and C++ allow castless assignment from
1636 * any pointer type to void*, and deal with argument conversions
1637 * as though doing an assignment.
1639 return (void *) realloc( (char *) ptr, size );
1642 #ifdef YY_USE_PROTOS
1643 static void yy_flex_free( void *ptr )
1645 static void yy_flex_free( ptr )