1 /* A lexical scanner generated by flex */
\r
3 /* Scanner skeleton version:
\r
4 * $Header: /cvs/code/nel/src/misc/config_file/cf_flex.skl,v 1.1 2002/08/20 11:37:35 lecroart Exp $
\r
8 #define YY_FLEX_MAJOR_VERSION 2
\r
9 #define YY_FLEX_MINOR_VERSION 5
\r
16 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
\r
34 #define isatty _isatty
\r
37 /* Use prototypes in function declarations. */
\r
38 #define YY_USE_PROTOS
\r
40 /* The "const" storage-class-modifier is valid. */
\r
41 #define YY_USE_CONST
\r
43 #else /* ! __cplusplus */
\r
47 #define YY_USE_PROTOS
\r
48 #define YY_USE_CONST
\r
50 #endif /* __STDC__ */
\r
51 #endif /* ! __cplusplus */
\r
58 #define YY_USE_CONST
\r
59 #define YY_USE_PROTOS
\r
63 #define yyconst const
\r
69 #ifdef YY_USE_PROTOS
\r
70 #define YY_PROTO(proto) proto
\r
72 #define YY_PROTO(proto) ()
\r
75 /* Returned upon end-of-file. */
\r
78 /* Promotes a possibly negative, possibly signed char to an unsigned
\r
79 * integer for use as an array index. If the signed char is negative,
\r
80 * we want to instead treat it as an 8-bit unsigned char, hence the
\r
83 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
\r
85 /* Enter a start condition. This macro really ought to take a parameter,
\r
86 * but we do it the disgusting crufty way forced on us by the ()-less
\r
87 * definition of BEGIN.
\r
89 #define BEGIN yy_start = 1 + 2 *
\r
91 /* Translate the current start state into a value that can be later handed
\r
92 * to BEGIN to return to the state. The YYSTATE alias is for lex
\r
95 #define YY_START ((yy_start - 1) / 2)
\r
96 #define YYSTATE YY_START
\r
98 /* Action number for EOF rule of a given start state. */
\r
99 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
\r
101 /* Special action meaning "start processing a new file". */
\r
102 #define YY_NEW_FILE yyrestart( yyin )
\r
104 #define YY_END_OF_BUFFER_CHAR 0
\r
106 /* Size of default input buffer. */
\r
107 #define YY_BUF_SIZE 16384
\r
109 typedef struct yy_buffer_state *YY_BUFFER_STATE;
\r
113 extern FILE *yyin, *yyout;
\r
116 #define EOB_ACT_CONTINUE_SCAN 0
\r
117 #define EOB_ACT_END_OF_FILE 1
\r
118 #define EOB_ACT_LAST_MATCH 2
\r
120 /* The funky do-while in the following #define is used to turn the definition
\r
121 * int a single C statement (which needs a semi-colon terminator). This
\r
122 * avoids problems with code like:
\r
124 * if ( condition_holds )
\r
127 * do_something_else();
\r
129 * Prior to using the do-while the compiler would get upset at the
\r
130 * "else" because it interpreted the "if" statement as being all
\r
131 * done when it reached the ';' after the yyless() call.
\r
134 /* Return all but the first 'n' matched characters back to the input stream. */
\r
136 #define yyless(n) \
\r
139 /* Undo effects of setting up yytext. */ \
\r
140 *yy_cp = yy_hold_char; \
\r
141 YY_RESTORE_YY_MORE_OFFSET \
\r
142 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
\r
143 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
\r
147 #define unput(c) yyunput( c, yytext_ptr )
\r
149 /* The following is because we cannot portably get our hands on size_t
\r
150 * (without autoconf's help, which isn't available because we want
\r
151 * flex-generated scanners to compile on their own).
\r
153 typedef unsigned int yy_size_t;
\r
156 struct yy_buffer_state
\r
159 FILE *yy_input_file;
\r
161 istream* yy_input_file;
\r
164 char *yy_ch_buf; /* input buffer */
\r
165 char *yy_buf_pos; /* current position in input buffer */
\r
167 /* Size of input buffer in bytes, not including room for EOB
\r
170 yy_size_t yy_buf_size;
\r
172 /* Number of characters read into yy_ch_buf, not including EOB
\r
177 /* Whether we "own" the buffer - i.e., we know we created it,
\r
178 * and can realloc() it to grow it, and should free() it to
\r
181 int yy_is_our_buffer;
\r
183 /* Whether this is an "interactive" input source; if so, and
\r
184 * if we're using stdio for input, then we want to use getc()
\r
185 * instead of fread(), to make sure we stop fetching input after
\r
188 int yy_is_interactive;
\r
190 /* Whether we're considered to be at the beginning of a line.
\r
191 * If so, '^' rules will be active on the next match, otherwise
\r
196 /* Whether to try to fill the input buffer when we reach the
\r
199 int yy_fill_buffer;
\r
201 int yy_buffer_status;
\r
202 #define YY_BUFFER_NEW 0
\r
203 #define YY_BUFFER_NORMAL 1
\r
204 /* When an EOF's been seen but there's still some text to process
\r
205 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
\r
206 * shouldn't try reading from the input source any more. We might
\r
207 * still have a bunch of tokens to match, though, because of
\r
208 * possible backing-up.
\r
210 * When we actually see the EOF, we change the status to "new"
\r
211 * (via yyrestart()), so that the user can continue scanning by
\r
212 * just pointing yyin at a new input file.
\r
214 #define YY_BUFFER_EOF_PENDING 2
\r
217 %- Standard (non-C++) definition
\r
218 static YY_BUFFER_STATE yy_current_buffer = 0;
\r
221 /* We provide macros for accessing buffer states in case in the
\r
222 * future we want to put the buffer states in a more general
\r
225 #define YY_CURRENT_BUFFER yy_current_buffer
\r
228 %- Standard (non-C++) definition
\r
229 /* yy_hold_char holds the character lost when yytext is formed. */
\r
230 static char yy_hold_char;
\r
232 static int yy_n_chars; /* number of characters read into yy_ch_buf */
\r
237 /* Points to current character in buffer. */
\r
238 static char *yy_c_buf_p = (char *) 0;
\r
239 static int yy_init = 1; /* whether we need to initialize */
\r
240 static int yy_start = 0; /* start state number */
\r
242 /* Flag which is used to allow yywrap()'s to do buffer switches
\r
243 * instead of setting up a fresh yyin. A bit of a hack ...
\r
245 static int yy_did_buffer_switch_on_eof;
\r
247 void yyrestart YY_PROTO(( FILE *input_file ));
\r
249 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
\r
250 void yy_load_buffer_state YY_PROTO(( void ));
\r
251 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
\r
252 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
\r
253 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
\r
254 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
\r
255 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
\r
257 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
\r
258 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
\r
259 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
\r
262 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
\r
263 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
\r
264 static void yy_flex_free YY_PROTO(( void * ));
\r
266 #define yy_new_buffer yy_create_buffer
\r
268 #define yy_set_interactive(is_interactive) \
\r
270 if ( ! yy_current_buffer ) \
\r
271 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
\r
272 yy_current_buffer->yy_is_interactive = is_interactive; \
\r
275 #define yy_set_bol(at_bol) \
\r
277 if ( ! yy_current_buffer ) \
\r
278 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
\r
279 yy_current_buffer->yy_at_bol = at_bol; \
\r
282 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
\r
284 %% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
\r
286 %- Standard (non-C++) definition
\r
287 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
\r
288 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
\r
289 static int yy_get_next_buffer YY_PROTO(( void ));
\r
290 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
\r
293 /* Done after the current pattern has been matched and before the
\r
294 * corresponding action - sets up yytext.
\r
296 #define YY_DO_BEFORE_ACTION \
\r
297 yytext_ptr = yy_bp; \
\r
298 %% code to fiddle yytext and yyleng for yymore() goes here
\r
299 yy_hold_char = *yy_cp; \
\r
301 %% code to copy yytext_ptr to yytext[] goes here, if %array
\r
302 yy_c_buf_p = yy_cp;
\r
304 %% data tables for the DFA and the user's section 1 definitions go here
\r
306 /* Macros after this point can all be overridden by user definitions in
\r
310 #ifndef YY_SKIP_YYWRAP
\r
312 extern "C" int yywrap YY_PROTO(( void ));
\r
314 extern int yywrap YY_PROTO(( void ));
\r
319 #ifndef YY_NO_UNPUT
\r
320 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
\r
325 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
\r
328 #ifdef YY_NEED_STRLEN
\r
329 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
\r
332 #ifndef YY_NO_INPUT
\r
333 %- Standard (non-C++) definition
\r
335 static int yyinput YY_PROTO(( void ));
\r
337 static int input YY_PROTO(( void ));
\r
343 static int yy_start_stack_ptr = 0;
\r
344 static int yy_start_stack_depth = 0;
\r
345 static int *yy_start_stack = 0;
\r
346 #ifndef YY_NO_PUSH_STATE
\r
347 static void yy_push_state YY_PROTO(( int new_state ));
\r
349 #ifndef YY_NO_POP_STATE
\r
350 static void yy_pop_state YY_PROTO(( void ));
\r
352 #ifndef YY_NO_TOP_STATE
\r
353 static int yy_top_state YY_PROTO(( void ));
\r
357 #define YY_NO_PUSH_STATE 1
\r
358 #define YY_NO_POP_STATE 1
\r
359 #define YY_NO_TOP_STATE 1
\r
362 #ifdef YY_MALLOC_DECL
\r
366 #ifndef __cplusplus
\r
367 #include <stdlib.h>
\r
370 /* Just try to get by without declaring the routines. This will fail
\r
371 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
\r
372 * or sizeof(void*) != sizeof(int).
\r
377 /* Amount of stuff to slurp up with each read. */
\r
378 #ifndef YY_READ_BUF_SIZE
\r
379 #define YY_READ_BUF_SIZE 8192
\r
382 /* Copy whatever the last rule matched to the standard output. */
\r
385 %- Standard (non-C++) definition
\r
386 /* This used to be an fputs(), but since the string might contain NUL's,
\r
387 * we now use fwrite().
\r
389 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
\r
391 #define ECHO LexerOutput( yytext, yyleng )
\r
395 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
\r
396 * is returned in "result".
\r
399 #define YY_INPUT(buf,result,max_size) \
\r
400 %% fread()/read() definition of YY_INPUT goes here unless we're doing C++
\r
402 if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
\r
403 YY_FATAL_ERROR( "input in flex scanner failed" );
\r
407 /* No semi-colon after return; correct usage is to write "yyterminate();" -
\r
408 * we don't want an extra ';' after the "return" because that will cause
\r
409 * some compilers to complain about unreachable statements.
\r
411 #ifndef yyterminate
\r
412 #define yyterminate() return YY_NULL
\r
415 /* Number of entries by which start-condition stack grows. */
\r
416 #ifndef YY_START_STACK_INCR
\r
417 #define YY_START_STACK_INCR 25
\r
420 /* Report a fatal error. */
\r
421 #ifndef YY_FATAL_ERROR
\r
423 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
\r
425 #define YY_FATAL_ERROR(msg) LexerError( msg )
\r
429 /* Default declaration of generated scanner - a define so the user can
\r
430 * easily add parameters.
\r
433 %- Standard (non-C++) definition
\r
434 #define YY_DECL int yylex YY_PROTO(( void ))
\r
436 #define YY_DECL int yyFlexLexer::yylex()
\r
440 /* Code executed at the beginning of each rule, after yytext and yyleng
\r
441 * have been set up.
\r
443 #ifndef YY_USER_ACTION
\r
444 #define YY_USER_ACTION
\r
447 /* Code executed at the end of each rule. */
\r
449 #define YY_BREAK break;
\r
452 %% YY_RULE_SETUP definition goes here
\r
456 register yy_state_type yy_current_state;
\r
457 register char *yy_cp, *yy_bp;
\r
458 register int yy_act;
\r
460 %% user's declarations go here
\r
466 #ifdef YY_USER_INIT
\r
471 yy_start = 1; /* first start state */
\r
487 if ( ! yy_current_buffer )
\r
488 yy_current_buffer =
\r
489 yy_create_buffer( yyin, YY_BUF_SIZE );
\r
491 yy_load_buffer_state();
\r
494 while ( 1 ) /* loops until end-of-file is reached */
\r
496 %% yymore()-related code goes here
\r
497 yy_cp = yy_c_buf_p;
\r
499 /* Support of yytext. */
\r
500 *yy_cp = yy_hold_char;
\r
502 /* yy_bp points to the position in yy_ch_buf of the start of
\r
507 %% code to set up and find next match goes here
\r
510 %% code to find the action number goes here
\r
512 YY_DO_BEFORE_ACTION;
\r
514 %% code for yylineno update goes here
\r
516 do_action: /* This label is used only to access EOF actions. */
\r
518 %% debug code goes here
\r
521 { /* beginning of action switch */
\r
524 case YY_END_OF_BUFFER:
\r
526 /* Amount of text matched not including the EOB char. */
\r
527 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
\r
529 /* Undo the effects of YY_DO_BEFORE_ACTION. */
\r
530 *yy_cp = yy_hold_char;
\r
531 YY_RESTORE_YY_MORE_OFFSET
\r
533 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
\r
535 /* We're scanning a new file or input source. It's
\r
536 * possible that this happened because the user
\r
537 * just pointed yyin at a new source and called
\r
538 * yylex(). If so, then we have to assure
\r
539 * consistency between yy_current_buffer and our
\r
540 * globals. Here is the right place to do so, because
\r
541 * this is the first action (other than possibly a
\r
542 * back-up) that will match for the new input source.
\r
544 yy_n_chars = yy_current_buffer->yy_n_chars;
\r
545 yy_current_buffer->yy_input_file = yyin;
\r
546 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
\r
549 /* Note that here we test for yy_c_buf_p "<=" to the position
\r
550 * of the first EOB in the buffer, since yy_c_buf_p will
\r
551 * already have been incremented past the NUL character
\r
552 * (since all states make transitions on EOB to the
\r
553 * end-of-buffer state). Contrast this with the test
\r
556 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
\r
557 { /* This was really a NUL. */
\r
558 yy_state_type yy_next_state;
\r
560 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
\r
562 yy_current_state = yy_get_previous_state();
\r
564 /* Okay, we're now positioned to make the NUL
\r
565 * transition. We couldn't have
\r
566 * yy_get_previous_state() go ahead and do it
\r
567 * for us because it doesn't know how to deal
\r
568 * with the possibility of jamming (and we don't
\r
569 * want to build jamming into it because then it
\r
570 * will run more slowly).
\r
573 yy_next_state = yy_try_NUL_trans( yy_current_state );
\r
575 yy_bp = yytext_ptr + YY_MORE_ADJ;
\r
577 if ( yy_next_state )
\r
579 /* Consume the NUL. */
\r
580 yy_cp = ++yy_c_buf_p;
\r
581 yy_current_state = yy_next_state;
\r
587 %% code to do back-up for compressed tables and set up yy_cp goes here
\r
588 goto yy_find_action;
\r
592 else switch ( yy_get_next_buffer() )
\r
594 case EOB_ACT_END_OF_FILE:
\r
596 yy_did_buffer_switch_on_eof = 0;
\r
600 /* Note: because we've taken care in
\r
601 * yy_get_next_buffer() to have set up
\r
602 * yytext, we can now set up
\r
603 * yy_c_buf_p so that if some total
\r
604 * hoser (like flex itself) wants to
\r
605 * call the scanner after we return the
\r
606 * YY_NULL, it'll still work - another
\r
607 * YY_NULL will get returned.
\r
609 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
\r
611 yy_act = YY_STATE_EOF(YY_START);
\r
617 if ( ! yy_did_buffer_switch_on_eof )
\r
623 case EOB_ACT_CONTINUE_SCAN:
\r
625 yytext_ptr + yy_amount_of_matched_text;
\r
627 yy_current_state = yy_get_previous_state();
\r
629 yy_cp = yy_c_buf_p;
\r
630 yy_bp = yytext_ptr + YY_MORE_ADJ;
\r
633 case EOB_ACT_LAST_MATCH:
\r
635 &yy_current_buffer->yy_ch_buf[yy_n_chars];
\r
637 yy_current_state = yy_get_previous_state();
\r
639 yy_cp = yy_c_buf_p;
\r
640 yy_bp = yytext_ptr + YY_MORE_ADJ;
\r
641 goto yy_find_action;
\r
648 "fatal flex scanner internal error--no action found" );
\r
649 } /* end of action switch */
\r
650 } /* end of scanning one token */
\r
651 } /* end of yylex */
\r
654 yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )
\r
662 yylineno = 1; // this will only get updated if %option yylineno
\r
664 yy_did_buffer_switch_on_eof = 0;
\r
666 yy_looking_for_trail_begin = 0;
\r
669 yy_more_offset = yy_prev_more_offset = 0;
\r
671 yy_start_stack_ptr = yy_start_stack_depth = 0;
\r
672 yy_start_stack = 0;
\r
674 yy_current_buffer = 0;
\r
676 #ifdef YY_USES_REJECT
\r
677 yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2];
\r
683 yyFlexLexer::~yyFlexLexer()
\r
685 delete yy_state_buf;
\r
686 yy_delete_buffer( yy_current_buffer );
\r
689 void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out )
\r
693 yy_delete_buffer( yy_current_buffer );
\r
694 yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
\r
701 #ifdef YY_INTERACTIVE
\r
702 int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
\r
704 int yyFlexLexer::LexerInput( char* buf, int max_size )
\r
707 if ( yyin->eof() || yyin->fail() )
\r
710 #ifdef YY_INTERACTIVE
\r
711 yyin->get( buf[0] );
\r
722 (void) yyin->read( buf, max_size );
\r
727 return yyin->gcount();
\r
731 void yyFlexLexer::LexerOutput( const char* buf, int size )
\r
733 (void) yyout->write( buf, size );
\r
737 /* yy_get_next_buffer - try to read in a new buffer
\r
739 * Returns a code representing an action:
\r
740 * EOB_ACT_LAST_MATCH -
\r
741 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
\r
742 * EOB_ACT_END_OF_FILE - end of file
\r
746 static int yy_get_next_buffer()
\r
748 int yyFlexLexer::yy_get_next_buffer()
\r
751 register char *dest = yy_current_buffer->yy_ch_buf;
\r
752 register char *source = yytext_ptr;
\r
753 register int number_to_move, i;
\r
756 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
\r
758 "fatal flex scanner internal error--end of buffer missed" );
\r
760 if ( yy_current_buffer->yy_fill_buffer == 0 )
\r
761 { /* Don't try to fill the buffer, so this is an EOF. */
\r
762 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
\r
764 /* We matched a single character, the EOB, so
\r
765 * treat this as a final EOF.
\r
767 return EOB_ACT_END_OF_FILE;
\r
772 /* We matched some text prior to the EOB, first
\r
775 return EOB_ACT_LAST_MATCH;
\r
779 /* Try to read more data. */
\r
781 /* First move last chars to start of buffer. */
\r
782 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
\r
784 for ( i = 0; i < number_to_move; ++i )
\r
785 *(dest++) = *(source++);
\r
787 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
\r
788 /* don't do the read, it's not guaranteed to return an EOF,
\r
789 * just force an EOF
\r
791 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
\r
796 yy_current_buffer->yy_buf_size - number_to_move - 1;
\r
798 while ( num_to_read <= 0 )
\r
799 { /* Not enough room in the buffer - grow it. */
\r
800 #ifdef YY_USES_REJECT
\r
802 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
\r
805 /* just a shorter name for the current buffer */
\r
806 YY_BUFFER_STATE b = yy_current_buffer;
\r
808 int yy_c_buf_p_offset =
\r
809 (int) (yy_c_buf_p - b->yy_ch_buf);
\r
811 if ( b->yy_is_our_buffer )
\r
813 int new_size = b->yy_buf_size * 2;
\r
815 if ( new_size <= 0 )
\r
816 b->yy_buf_size += b->yy_buf_size / 8;
\r
818 b->yy_buf_size *= 2;
\r
820 b->yy_ch_buf = (char *)
\r
821 /* Include room in for 2 EOB chars. */
\r
822 yy_flex_realloc( (void *) b->yy_ch_buf,
\r
823 b->yy_buf_size + 2 );
\r
826 /* Can't grow it, we don't own it. */
\r
829 if ( ! b->yy_ch_buf )
\r
831 "fatal error - scanner input buffer overflow" );
\r
833 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
\r
835 num_to_read = yy_current_buffer->yy_buf_size -
\r
836 number_to_move - 1;
\r
840 if ( num_to_read > YY_READ_BUF_SIZE )
\r
841 num_to_read = YY_READ_BUF_SIZE;
\r
843 /* Read in more data. */
\r
844 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
\r
845 yy_n_chars, num_to_read );
\r
847 yy_current_buffer->yy_n_chars = yy_n_chars;
\r
850 if ( yy_n_chars == 0 )
\r
852 if ( number_to_move == YY_MORE_ADJ )
\r
854 ret_val = EOB_ACT_END_OF_FILE;
\r
860 ret_val = EOB_ACT_LAST_MATCH;
\r
861 yy_current_buffer->yy_buffer_status =
\r
862 YY_BUFFER_EOF_PENDING;
\r
867 ret_val = EOB_ACT_CONTINUE_SCAN;
\r
869 yy_n_chars += number_to_move;
\r
870 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
\r
871 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
\r
873 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
\r
879 /* yy_get_previous_state - get the state just before the EOB char was reached */
\r
882 static yy_state_type yy_get_previous_state()
\r
884 yy_state_type yyFlexLexer::yy_get_previous_state()
\r
887 register yy_state_type yy_current_state;
\r
888 register char *yy_cp;
\r
890 %% code to get the start state into yy_current_state goes here
\r
892 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
\r
894 %% code to find the next state goes here
\r
897 return yy_current_state;
\r
901 /* yy_try_NUL_trans - try to make a transition on the NUL character
\r
904 * next_state = yy_try_NUL_trans( current_state );
\r
908 #ifdef YY_USE_PROTOS
\r
909 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
\r
911 static yy_state_type yy_try_NUL_trans( yy_current_state )
\r
912 yy_state_type yy_current_state;
\r
915 yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
\r
918 register int yy_is_jam;
\r
919 %% code to find the next state, and perhaps do backing up, goes here
\r
921 return yy_is_jam ? 0 : yy_current_state;
\r
926 #ifndef YY_NO_UNPUT
\r
927 #ifdef YY_USE_PROTOS
\r
928 static void yyunput( int c, register char *yy_bp )
\r
930 static void yyunput( c, yy_bp )
\r
932 register char *yy_bp;
\r
935 void yyFlexLexer::yyunput( int c, register char* yy_bp )
\r
938 register char *yy_cp = yy_c_buf_p;
\r
940 /* undo effects of setting up yytext */
\r
941 *yy_cp = yy_hold_char;
\r
943 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
\r
944 { /* need to shift things up to make room */
\r
945 /* +2 for EOB chars. */
\r
946 register int number_to_move = yy_n_chars + 2;
\r
947 register char *dest = &yy_current_buffer->yy_ch_buf[
\r
948 yy_current_buffer->yy_buf_size + 2];
\r
949 register char *source =
\r
950 &yy_current_buffer->yy_ch_buf[number_to_move];
\r
952 while ( source > yy_current_buffer->yy_ch_buf )
\r
953 *--dest = *--source;
\r
955 yy_cp += (int) (dest - source);
\r
956 yy_bp += (int) (dest - source);
\r
957 yy_current_buffer->yy_n_chars =
\r
958 yy_n_chars = yy_current_buffer->yy_buf_size;
\r
960 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
\r
961 YY_FATAL_ERROR( "flex scanner push-back overflow" );
\r
964 *--yy_cp = (char) c;
\r
966 %% update yylineno here
\r
968 yytext_ptr = yy_bp;
\r
969 yy_hold_char = *yy_cp;
\r
970 yy_c_buf_p = yy_cp;
\r
973 #endif /* ifndef YY_NO_UNPUT */
\r
979 static int yyinput()
\r
984 int yyFlexLexer::yyinput()
\r
989 *yy_c_buf_p = yy_hold_char;
\r
991 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
\r
993 /* yy_c_buf_p now points to the character we want to return.
\r
994 * If this occurs *before* the EOB characters, then it's a
\r
995 * valid NUL; if not, then we've hit the end of the buffer.
\r
997 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
\r
998 /* This was really a NUL. */
\r
999 *yy_c_buf_p = '\0';
\r
1002 { /* need more input */
\r
1003 int offset = (int)(yy_c_buf_p - yytext_ptr);
\r
1006 switch ( yy_get_next_buffer() )
\r
1008 case EOB_ACT_LAST_MATCH:
\r
1009 /* This happens because yy_g_n_b()
\r
1010 * sees that we've accumulated a
\r
1011 * token and flags that we need to
\r
1012 * try matching the token before
\r
1013 * proceeding. But for input(),
\r
1014 * there's no matching to consider.
\r
1015 * So convert the EOB_ACT_LAST_MATCH
\r
1016 * to EOB_ACT_END_OF_FILE.
\r
1019 /* Reset buffer status. */
\r
1020 yyrestart( yyin );
\r
1022 /* fall through */
\r
1024 case EOB_ACT_END_OF_FILE:
\r
1029 if ( ! yy_did_buffer_switch_on_eof )
\r
1031 #ifdef __cplusplus
\r
1038 case EOB_ACT_CONTINUE_SCAN:
\r
1039 yy_c_buf_p = yytext_ptr + offset;
\r
1045 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
\r
1046 *yy_c_buf_p = '\0'; /* preserve yytext */
\r
1047 yy_hold_char = *++yy_c_buf_p;
\r
1049 %% update BOL and yylineno
\r
1056 #ifdef YY_USE_PROTOS
\r
1057 void yyrestart( FILE *input_file )
\r
1059 void yyrestart( input_file )
\r
1063 void yyFlexLexer::yyrestart( istream* input_file )
\r
1066 if ( ! yy_current_buffer )
\r
1067 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
\r
1069 yy_init_buffer( yy_current_buffer, input_file );
\r
1070 yy_load_buffer_state();
\r
1075 #ifdef YY_USE_PROTOS
\r
1076 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
\r
1078 void yy_switch_to_buffer( new_buffer )
\r
1079 YY_BUFFER_STATE new_buffer;
\r
1082 void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
\r
1085 if ( yy_current_buffer == new_buffer )
\r
1088 if ( yy_current_buffer )
\r
1090 /* Flush out information for old buffer. */
\r
1091 *yy_c_buf_p = yy_hold_char;
\r
1092 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
\r
1093 yy_current_buffer->yy_n_chars = yy_n_chars;
\r
1096 yy_current_buffer = new_buffer;
\r
1097 yy_load_buffer_state();
\r
1099 /* We don't actually know whether we did this switch during
\r
1100 * EOF (yywrap()) processing, but the only time this flag
\r
1101 * is looked at is after yywrap() is called, so it's safe
\r
1102 * to go ahead and always set it.
\r
1104 yy_did_buffer_switch_on_eof = 1;
\r
1109 #ifdef YY_USE_PROTOS
\r
1110 void yy_load_buffer_state( void )
\r
1112 void yy_load_buffer_state()
\r
1115 void yyFlexLexer::yy_load_buffer_state()
\r
1118 yy_n_chars = yy_current_buffer->yy_n_chars;
\r
1119 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
\r
1120 yyin = yy_current_buffer->yy_input_file;
\r
1121 yy_hold_char = *yy_c_buf_p;
\r
1126 #ifdef YY_USE_PROTOS
\r
1127 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
\r
1129 YY_BUFFER_STATE yy_create_buffer( file, size )
\r
1134 YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size )
\r
1137 YY_BUFFER_STATE b;
\r
1139 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
\r
1141 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
\r
1143 b->yy_buf_size = size;
\r
1145 /* yy_ch_buf has to be 2 characters longer than the size given because
\r
1146 * we need to put in 2 end-of-buffer characters.
\r
1148 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
\r
1149 if ( ! b->yy_ch_buf )
\r
1150 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
\r
1152 b->yy_is_our_buffer = 1;
\r
1154 yy_init_buffer( b, file );
\r
1161 #ifdef YY_USE_PROTOS
\r
1162 void yy_delete_buffer( YY_BUFFER_STATE b )
\r
1164 void yy_delete_buffer( b )
\r
1165 YY_BUFFER_STATE b;
\r
1168 void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
\r
1174 if ( b == yy_current_buffer )
\r
1175 yy_current_buffer = (YY_BUFFER_STATE) 0;
\r
1177 if ( b->yy_is_our_buffer )
\r
1178 yy_flex_free( (void *) b->yy_ch_buf );
\r
1180 yy_flex_free( (void *) b );
\r
1185 #ifndef YY_ALWAYS_INTERACTIVE
\r
1186 #ifndef YY_NEVER_INTERACTIVE
\r
1187 extern int isatty YY_PROTO(( int ));
\r
1191 #ifdef YY_USE_PROTOS
\r
1192 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
\r
1194 void yy_init_buffer( b, file )
\r
1195 YY_BUFFER_STATE b;
\r
1200 extern "C" int isatty YY_PROTO(( int ));
\r
1201 void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
\r
1205 yy_flush_buffer( b );
\r
1207 b->yy_input_file = file;
\r
1208 b->yy_fill_buffer = 1;
\r
1211 #if YY_ALWAYS_INTERACTIVE
\r
1212 b->yy_is_interactive = 1;
\r
1214 #if YY_NEVER_INTERACTIVE
\r
1215 b->yy_is_interactive = 0;
\r
1217 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
\r
1221 b->yy_is_interactive = 0;
\r
1227 #ifdef YY_USE_PROTOS
\r
1228 void yy_flush_buffer( YY_BUFFER_STATE b )
\r
1230 void yy_flush_buffer( b )
\r
1231 YY_BUFFER_STATE b;
\r
1235 void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
\r
1241 b->yy_n_chars = 0;
\r
1243 /* We always need two end-of-buffer characters. The first causes
\r
1244 * a transition to the end-of-buffer state. The second causes
\r
1245 * a jam in that state.
\r
1247 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
\r
1248 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
\r
1250 b->yy_buf_pos = &b->yy_ch_buf[0];
\r
1253 b->yy_buffer_status = YY_BUFFER_NEW;
\r
1255 if ( b == yy_current_buffer )
\r
1256 yy_load_buffer_state();
\r
1261 #ifndef YY_NO_SCAN_BUFFER
\r
1263 #ifdef YY_USE_PROTOS
\r
1264 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
\r
1266 YY_BUFFER_STATE yy_scan_buffer( base, size )
\r
1271 YY_BUFFER_STATE b;
\r
1274 base[size-2] != YY_END_OF_BUFFER_CHAR ||
\r
1275 base[size-1] != YY_END_OF_BUFFER_CHAR )
\r
1276 /* They forgot to leave room for the EOB's. */
\r
1279 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
\r
1281 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
\r
1283 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
\r
1284 b->yy_buf_pos = b->yy_ch_buf = base;
\r
1285 b->yy_is_our_buffer = 0;
\r
1286 b->yy_input_file = 0;
\r
1287 b->yy_n_chars = b->yy_buf_size;
\r
1288 b->yy_is_interactive = 0;
\r
1290 b->yy_fill_buffer = 0;
\r
1291 b->yy_buffer_status = YY_BUFFER_NEW;
\r
1293 yy_switch_to_buffer( b );
\r
1301 #ifndef YY_NO_SCAN_STRING
\r
1303 #ifdef YY_USE_PROTOS
\r
1304 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
\r
1306 YY_BUFFER_STATE yy_scan_string( yy_str )
\r
1307 yyconst char *yy_str;
\r
1311 for ( len = 0; yy_str[len]; ++len )
\r
1314 return yy_scan_bytes( yy_str, len );
\r
1320 #ifndef YY_NO_SCAN_BYTES
\r
1322 #ifdef YY_USE_PROTOS
\r
1323 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
\r
1325 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
\r
1326 yyconst char *bytes;
\r
1330 YY_BUFFER_STATE b;
\r
1335 /* Get memory for full buffer, including space for trailing EOB's. */
\r
1337 buf = (char *) yy_flex_alloc( n );
\r
1339 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
\r
1341 for ( i = 0; i < len; ++i )
\r
1342 buf[i] = bytes[i];
\r
1344 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
\r
1346 b = yy_scan_buffer( buf, n );
\r
1348 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
\r
1350 /* It's okay to grow etc. this buffer, and we should throw it
\r
1351 * away when we're done.
\r
1353 b->yy_is_our_buffer = 1;
\r
1361 #ifndef YY_NO_PUSH_STATE
\r
1363 #ifdef YY_USE_PROTOS
\r
1364 static void yy_push_state( int new_state )
\r
1366 static void yy_push_state( new_state )
\r
1370 void yyFlexLexer::yy_push_state( int new_state )
\r
1373 if ( yy_start_stack_ptr >= yy_start_stack_depth )
\r
1375 yy_size_t new_size;
\r
1377 yy_start_stack_depth += YY_START_STACK_INCR;
\r
1378 new_size = yy_start_stack_depth * sizeof( int );
\r
1380 if ( ! yy_start_stack )
\r
1381 yy_start_stack = (int *) yy_flex_alloc( new_size );
\r
1384 yy_start_stack = (int *) yy_flex_realloc(
\r
1385 (void *) yy_start_stack, new_size );
\r
1387 if ( ! yy_start_stack )
\r
1389 "out of memory expanding start-condition stack" );
\r
1392 yy_start_stack[yy_start_stack_ptr++] = YY_START;
\r
1399 #ifndef YY_NO_POP_STATE
\r
1401 static void yy_pop_state()
\r
1403 void yyFlexLexer::yy_pop_state()
\r
1406 if ( --yy_start_stack_ptr < 0 )
\r
1407 YY_FATAL_ERROR( "start-condition stack underflow" );
\r
1409 BEGIN(yy_start_stack[yy_start_stack_ptr]);
\r
1414 #ifndef YY_NO_TOP_STATE
\r
1416 static int yy_top_state()
\r
1418 int yyFlexLexer::yy_top_state()
\r
1421 return yy_start_stack[yy_start_stack_ptr - 1];
\r
1425 #ifndef YY_EXIT_FAILURE
\r
1426 #define YY_EXIT_FAILURE 2
\r
1430 #ifdef YY_USE_PROTOS
\r
1431 static void yy_fatal_error( yyconst char msg[] )
\r
1433 static void yy_fatal_error( msg )
\r
1437 (void) fprintf( stderr, "%s\n", msg );
\r
1438 exit( YY_EXIT_FAILURE );
\r
1443 void yyFlexLexer::LexerError( yyconst char msg[] )
\r
1445 cerr << msg << '\n';
\r
1446 exit( YY_EXIT_FAILURE );
\r
1451 /* Redefine yyless() so it works in section 3 code. */
\r
1454 #define yyless(n) \
\r
1457 /* Undo effects of setting up yytext. */ \
\r
1458 yytext[yyleng] = yy_hold_char; \
\r
1459 yy_c_buf_p = yytext + n; \
\r
1460 yy_hold_char = *yy_c_buf_p; \
\r
1461 *yy_c_buf_p = '\0'; \
\r
1467 /* Internal utility routines. */
\r
1469 #ifndef yytext_ptr
\r
1470 #ifdef YY_USE_PROTOS
\r
1471 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
\r
1473 static void yy_flex_strncpy( s1, s2, n )
\r
1480 for ( i = 0; i < n; ++i )
\r
1485 #ifdef YY_NEED_STRLEN
\r
1486 #ifdef YY_USE_PROTOS
\r
1487 static int yy_flex_strlen( yyconst char *s )
\r
1489 static int yy_flex_strlen( s )
\r
1494 for ( n = 0; s[n]; ++n )
\r
1502 #ifdef YY_USE_PROTOS
\r
1503 static void *yy_flex_alloc( yy_size_t size )
\r
1505 static void *yy_flex_alloc( size )
\r
1509 return (void *) malloc( size );
\r
1512 #ifdef YY_USE_PROTOS
\r
1513 static void *yy_flex_realloc( void *ptr, yy_size_t size )
\r
1515 static void *yy_flex_realloc( ptr, size )
\r
1520 /* The cast to (char *) in the following accommodates both
\r
1521 * implementations that use char* generic pointers, and those
\r
1522 * that use void* generic pointers. It works with the latter
\r
1523 * because both ANSI C and C++ allow castless assignment from
\r
1524 * any pointer type to void*, and deal with argument conversions
\r
1525 * as though doing an assignment.
\r
1527 return (void *) realloc( (char *) ptr, size );
\r
1530 #ifdef YY_USE_PROTOS
\r
1531 static void yy_flex_free( void *ptr )
\r
1533 static void yy_flex_free( ptr )
\r