version 1.3 | | version 1.4 |
---|
| | |
/* A lexical scanner generated by flex */ | | /* A lexical scanner generated by flex */ |
| | |
/* Scanner skeleton version: | | /* Scanner skeleton version: |
* $Header: /cvsroot/crossfire/crossfire/random_maps/reader.c,v 1.3 1999/07/13 05:09:41 cvs Exp $ | | * $Header: /cvsroot/crossfire/crossfire/random_maps/reader.c,v 1.4 2000/06/02 08:42:56 cvs Exp $ |
*/ | | */ |
| | |
#define FLEX_SCANNER | | #define FLEX_SCANNER |
| | |
{ \ | | { \ |
/* Undo effects of setting up yytext. */ \ | | /* Undo effects of setting up yytext. */ \ |
*yy_cp = yy_hold_char; \ | | *yy_cp = yy_hold_char; \ |
| | YY_RESTORE_YY_MORE_OFFSET \ |
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ | | yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ |
YY_DO_BEFORE_ACTION; /* set up yytext again */ \ | | YY_DO_BEFORE_ACTION; /* set up yytext again */ \ |
} \ | | } \ |
| | |
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) | | #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) |
| | |
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); | | YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); |
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str )); | | YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); |
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); | | YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); |
| | |
static void *yy_flex_alloc YY_PROTO(( yy_size_t )); | | static void *yy_flex_alloc YY_PROTO(( yy_size_t )); |
| | |
#define REJECT reject_used_but_not_detected | | #define REJECT reject_used_but_not_detected |
#define yymore() yymore_used_but_not_detected | | #define yymore() yymore_used_but_not_detected |
#define YY_MORE_ADJ 0 | | #define YY_MORE_ADJ 0 |
| | #define YY_RESTORE_YY_MORE_OFFSET |
char *yytext; | | char *yytext; |
#line 1 "reader.l" | | #line 1 "reader.l" |
#define INITIAL 0 | | #define INITIAL 0 |
#line 2 "reader.l" | | #line 2 "reader.l" |
/* | | /* |
* static char *reader_l = | | * static char *reader_l = |
* "$Id: reader.c,v 1.3 1999/07/13 05:09:41 cvs Exp $"; | | * "$Id: reader.c,v 1.4 2000/06/02 08:42:56 cvs Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); | | static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); |
#endif | | #endif |
| | |
| | #ifdef YY_NEED_STRLEN |
| | static int yy_flex_strlen YY_PROTO(( yyconst char * )); |
| | #endif |
| | |
#ifndef YY_NO_INPUT | | #ifndef YY_NO_INPUT |
#ifdef __cplusplus | | #ifdef __cplusplus |
static int yyinput YY_PROTO(( void )); | | static int yyinput YY_PROTO(( void )); |
| | |
| | |
/* Undo the effects of YY_DO_BEFORE_ACTION. */ | | /* Undo the effects of YY_DO_BEFORE_ACTION. */ |
*yy_cp = yy_hold_char; | | *yy_cp = yy_hold_char; |
| | YY_RESTORE_YY_MORE_OFFSET |
| | |
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) | | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) |
{ | | { |
| | |
{ /* Don't try to fill the buffer, so this is an EOF. */ | | { /* Don't try to fill the buffer, so this is an EOF. */ |
if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) | | if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) |
{ | | { |
/* We matched a singled characater, the EOB, so | | /* We matched a single character, the EOB, so |
* treat this as a final EOF. | | * treat this as a final EOF. |
*/ | | */ |
return EOB_ACT_END_OF_FILE; | | return EOB_ACT_END_OF_FILE; |
| | |
/* don't do the read, it's not guaranteed to return an EOF, | | /* don't do the read, it's not guaranteed to return an EOF, |
* just force an EOF | | * just force an EOF |
*/ | | */ |
yy_n_chars = 0; | | yy_current_buffer->yy_n_chars = yy_n_chars = 0; |
| | |
else | | else |
{ | | { |
| | |
/* Read in more data. */ | | /* Read in more data. */ |
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), | | YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), |
yy_n_chars, num_to_read ); | | yy_n_chars, num_to_read ); |
| | |
| | yy_current_buffer->yy_n_chars = yy_n_chars; |
} | | } |
| | |
if ( yy_n_chars == 0 ) | | if ( yy_n_chars == 0 ) |
| | |
| | |
yy_cp += (int) (dest - source); | | yy_cp += (int) (dest - source); |
yy_bp += (int) (dest - source); | | yy_bp += (int) (dest - source); |
| | yy_current_buffer->yy_n_chars = |
yy_n_chars = yy_current_buffer->yy_buf_size; | | yy_n_chars = yy_current_buffer->yy_buf_size; |
| | |
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) | | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) |
| | |
| | |
else | | else |
{ /* need more input */ | | { /* need more input */ |
yytext_ptr = yy_c_buf_p; | | int offset = yy_c_buf_p - yytext_ptr; |
++yy_c_buf_p; | | ++yy_c_buf_p; |
| | |
switch ( yy_get_next_buffer() ) | | switch ( yy_get_next_buffer() ) |
{ | | { |
| | case EOB_ACT_LAST_MATCH: |
| | /* This happens because yy_g_n_b() |
| | * sees that we've accumulated a |
| | * token and flags that we need to |
| | * try matching the token before |
| | * proceeding. But for input(), |
| | * there's no matching to consider. |
| | * So convert the EOB_ACT_LAST_MATCH |
| | * to EOB_ACT_END_OF_FILE. |
| | */ |
| | |
| | /* Reset buffer status. */ |
| | yyrestart( yyin ); |
| | |
| | /* fall through */ |
| | |
case EOB_ACT_END_OF_FILE: | | case EOB_ACT_END_OF_FILE: |
{ | | { |
if ( yywrap() ) | | if ( yywrap() ) |
{ | | |
yy_c_buf_p = | | |
yytext_ptr + YY_MORE_ADJ; | | |
return EOF; | | return EOF; |
} | | |
| | |
if ( ! yy_did_buffer_switch_on_eof ) | | if ( ! yy_did_buffer_switch_on_eof ) |
YY_NEW_FILE; | | YY_NEW_FILE; |
| | |
} | | } |
| | |
case EOB_ACT_CONTINUE_SCAN: | | case EOB_ACT_CONTINUE_SCAN: |
yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; | | yy_c_buf_p = yytext_ptr + offset; |
break; | | break; |
| | |
case EOB_ACT_LAST_MATCH: | | |
#ifdef __cplusplus | | |
YY_FATAL_ERROR( | | |
"unexpected last match in yyinput()" ); | | |
#else | | |
YY_FATAL_ERROR( | | |
"unexpected last match in input()" ); | | |
#endif | | |
} | | } |
} | | } |
} | | } |
| | |
#endif | | #endif |
| | |
{ | | { |
| | if ( ! b ) |
| | return; |
| | |
b->yy_n_chars = 0; | | b->yy_n_chars = 0; |
| | |
/* We always need two end-of-buffer characters. The first causes | | /* We always need two end-of-buffer characters. The first causes |
| | |
| | |
#ifndef YY_NO_SCAN_STRING | | #ifndef YY_NO_SCAN_STRING |
#ifdef YY_USE_PROTOS | | #ifdef YY_USE_PROTOS |
YY_BUFFER_STATE yy_scan_string( yyconst char *str ) | | YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) |
#else | | #else |
YY_BUFFER_STATE yy_scan_string( str ) | | YY_BUFFER_STATE yy_scan_string( yy_str ) |
yyconst char *str; | | yyconst char *yy_str; |
#endif | | #endif |
{ | | { |
int len; | | int len; |
for ( len = 0; str[len]; ++len ) | | for ( len = 0; yy_str[len]; ++len ) |
; | | ; |
| | |
return yy_scan_bytes( str, len ); | | return yy_scan_bytes( yy_str, len ); |
} | | } |
#endif | | #endif |
| | |
| | |
{ \ | | { \ |
/* Undo effects of setting up yytext. */ \ | | /* Undo effects of setting up yytext. */ \ |
yytext[yyleng] = yy_hold_char; \ | | yytext[yyleng] = yy_hold_char; \ |
yy_c_buf_p = yytext + n - YY_MORE_ADJ; \ | | yy_c_buf_p = yytext + n; \ |
yy_hold_char = *yy_c_buf_p; \ | | yy_hold_char = *yy_c_buf_p; \ |
*yy_c_buf_p = '\0'; \ | | *yy_c_buf_p = '\0'; \ |
yyleng = n; \ | | yyleng = n; \ |
| | |
} | | } |
#endif | | #endif |
| | |
| | #ifdef YY_NEED_STRLEN |
| | #ifdef YY_USE_PROTOS |
| | static int yy_flex_strlen( yyconst char *s ) |
| | #else |
| | static int yy_flex_strlen( s ) |
| | yyconst char *s; |
| | #endif |
| | { |
| | register int n; |
| | for ( n = 0; s[n]; ++n ) |
| | ; |
| | |
| | return n; |
| | } |
| | #endif |
| | |
| | |
#ifdef YY_USE_PROTOS | | #ifdef YY_USE_PROTOS |
static void *yy_flex_alloc( yy_size_t size ) | | static void *yy_flex_alloc( yy_size_t size ) |