version 1.38 | | version 1.39 |
---|
| | |
/* A lexical scanner generated by flex */ | | /* A lexical scanner generated by flex */ |
| | |
/* Scanner skeleton version: | | /* Scanner skeleton version: |
* $NetBSD: flex.skl,v 1.15 2000/06/17 11:56:21 assar Exp $ | | * $Header: /cvsroot/crossfire/crossfire/common/loader.c,v 1.39 2003/03/08 05:35:32 mwedel Exp $ |
*/ | | */ |
| | |
#define FLEX_SCANNER | | #define FLEX_SCANNER |
| | |
| | |
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 *yy_str )); | | YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); |
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, yy_size_t 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_realloc YY_PROTO(( void *, yy_size_t )); |
| | static void yy_flex_free YY_PROTO(( void * )); |
| | |
#define yy_new_buffer yy_create_buffer | | #define yy_new_buffer yy_create_buffer |
| | |
| | |
extern char *yytext; | | extern char *yytext; |
#define yytext_ptr yytext | | #define yytext_ptr yytext |
| | |
static void *yy_flex_alloc YY_PROTO(( yy_size_t )); | | |
#ifndef YY_USES_REJECT | | |
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); | | |
#endif | | |
static void yy_flex_free YY_PROTO(( void * )); | | |
| | |
static yy_state_type yy_get_previous_state YY_PROTO(( void )); | | static yy_state_type yy_get_previous_state YY_PROTO(( void )); |
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); | | static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); |
static int yy_get_next_buffer YY_PROTO(( void )); | | static int yy_get_next_buffer YY_PROTO(( void )); |
| | |
#line 2 "loader.l" | | #line 2 "loader.l" |
/* | | /* |
* static char *rcsid_object_c = | | * static char *rcsid_object_c = |
* "$Id: loader.c,v 1.38 2003/02/14 05:54:13 garbled Exp $"; | | * "$Id: loader.c,v 1.39 2003/03/08 05:35:32 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
/* Don't have to link with -lfl with this */ | | /* Don't have to link with -lfl with this */ |
/* need yy_push_state, yy_pop_state */ | | /* need yy_push_state, yy_pop_state */ |
#define YY_STACK_USED 1 | | #define YY_STACK_USED 1 |
#line 2059 "loader.c" | | #line 2057 "loader.c" |
| | |
/* Macros after this point can all be overridden by user definitions in | | /* Macros after this point can all be overridden by user definitions in |
* section 1. | | * section 1. |
| | |
#endif | | #endif |
| | |
#ifndef YY_NO_UNPUT | | #ifndef YY_NO_UNPUT |
static void yyunput YY_PROTO(( int c, char *buf_ptr )) | | static void yyunput YY_PROTO(( int c, char *buf_ptr )); |
#ifdef __GNUC__ | | |
__attribute__ ((unused)) | | |
#endif | | |
; | | |
#endif | | #endif |
| | |
#ifndef yytext_ptr | | #ifndef yytext_ptr |
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, yy_size_t )); | | static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); |
#endif | | #endif |
| | |
#ifdef YY_NEED_STRLEN | | #ifdef YY_NEED_STRLEN |
static yy_size_t yy_flex_strlen YY_PROTO(( yyconst char * )); | | static int yy_flex_strlen YY_PROTO(( yyconst char * )); |
#endif | | #endif |
| | |
#ifndef YY_NO_INPUT | | #ifndef YY_NO_INPUT |
| | |
/* This used to be an fputs(), but since the string might contain NUL's, | | /* This used to be an fputs(), but since the string might contain NUL's, |
* we now use fwrite(). | | * we now use fwrite(). |
*/ | | */ |
#define ECHO (void) fwrite( yytext, (size_t)yyleng, 1, yyout ) | | #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) |
#endif | | #endif |
| | |
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, | | /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, |
| | |
YY_FATAL_ERROR( "input in flex scanner failed" ); \ | | YY_FATAL_ERROR( "input in flex scanner failed" ); \ |
result = n; \ | | result = n; \ |
} \ | | } \ |
else if ( ((result = fread( buf, 1, (size_t)max_size, yyin )) == 0) \ | | else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ |
&& ferror( yyin ) ) \ | | && ferror( yyin ) ) \ |
YY_FATAL_ERROR( "input in flex scanner failed" ); | | YY_FATAL_ERROR( "input in flex scanner failed" ); |
#endif | | #endif |
| | |
| | |
/* Code executed at the end of each rule. */ | | /* Code executed at the end of each rule. */ |
#ifndef YY_BREAK | | #ifndef YY_BREAK |
#define YY_BREAK /*LINTED*/break; | | #define YY_BREAK break; |
#endif | | #endif |
| | |
#define YY_RULE_SETUP \ | | #define YY_RULE_SETUP \ |
| | |
YY_DECL | | YY_DECL |
{ | | { |
register yy_state_type yy_current_state; | | register yy_state_type yy_current_state; |
register char *yy_cp, *yy_bp; | | register char *yy_cp = NULL, *yy_bp = NULL; |
register int yy_act; | | register int yy_act; |
| | |
#line 222 "loader.l" | | #line 222 "loader.l" |
| | |
| | |
| | |
| | |
#line 2228 "loader.c" | | #line 2222 "loader.c" |
| | |
#if defined(YY_USES_REJECT) && (defined(__GNUC__) || defined(lint)) | | |
/* XXX: shut up `unused label' warning with %options yylineno */ | | |
if (/*CONSTCOND*/0 && yy_full_match) | | |
goto find_rule; | | |
#endif | | |
if ( yy_init ) | | if ( yy_init ) |
{ | | { |
yy_init = 0; | | yy_init = 0; |
| | |
yy_load_buffer_state(); | | yy_load_buffer_state(); |
} | | } |
| | |
while (/*CONSTCOND*/ 1 ) /* loops until end-of-file is reached */ | | while ( 1 ) /* loops until end-of-file is reached */ |
{ | | { |
yy_cp = yy_c_buf_p; | | yy_cp = yy_c_buf_p; |
| | |
| | |
case 40: | | case 40: |
YY_RULE_SETUP | | YY_RULE_SETUP |
#line 362 "loader.l" | | #line 362 "loader.l" |
op->stats.exp = atol(yval()); | | op->stats.exp = atoll(yval()); |
YY_BREAK | | YY_BREAK |
case 41: | | case 41: |
YY_RULE_SETUP | | YY_RULE_SETUP |
| | |
#line 1027 "loader.l" | | #line 1027 "loader.l" |
ECHO; | | ECHO; |
YY_BREAK | | YY_BREAK |
#line 4224 "loader.c" | | #line 4213 "loader.c" |
| | |
case YY_END_OF_BUFFER: | | case YY_END_OF_BUFFER: |
{ | | { |
| | |
/* Reset buffer status. */ | | /* Reset buffer status. */ |
yyrestart( yyin ); | | yyrestart( yyin ); |
| | |
/*FALLTHROUGH*/ | | /* fall through */ |
| | |
case EOB_ACT_END_OF_FILE: | | case EOB_ACT_END_OF_FILE: |
{ | | { |
| | |
yyconst char *yy_str; | | yyconst char *yy_str; |
#endif | | #endif |
{ | | { |
yy_size_t len; | | int len; |
for ( len = 0; yy_str[len]; ++len ) | | for ( len = 0; yy_str[len]; ++len ) |
; | | ; |
| | |
| | |
| | |
#ifndef YY_NO_SCAN_BYTES | | #ifndef YY_NO_SCAN_BYTES |
#ifdef YY_USE_PROTOS | | #ifdef YY_USE_PROTOS |
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, yy_size_t len ) | | YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) |
#else | | #else |
YY_BUFFER_STATE yy_scan_bytes( bytes, len ) | | YY_BUFFER_STATE yy_scan_bytes( bytes, len ) |
yyconst char *bytes; | | yyconst char *bytes; |
yy_size_t len; | | int len; |
#endif | | #endif |
{ | | { |
YY_BUFFER_STATE b; | | YY_BUFFER_STATE b; |
char *buf; | | char *buf; |
yy_size_t n, i; | | yy_size_t n; |
| | int i; |
| | |
/* Get memory for full buffer, including space for trailing EOB's. */ | | /* Get memory for full buffer, including space for trailing EOB's. */ |
n = len + 2; | | n = len + 2; |
| | |
| | |
#ifndef yytext_ptr | | #ifndef yytext_ptr |
#ifdef YY_USE_PROTOS | | #ifdef YY_USE_PROTOS |
static void yy_flex_strncpy( char *s1, yyconst char *s2, yy_size_t n ) | | static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) |
#else | | #else |
static void yy_flex_strncpy( s1, s2, n ) | | static void yy_flex_strncpy( s1, s2, n ) |
char *s1; | | char *s1; |
yyconst char *s2; | | yyconst char *s2; |
yy_size_t n; | | int n; |
#endif | | #endif |
{ | | { |
register yy_size_t i; | | register int i; |
for ( i = 0; i < n; ++i ) | | for ( i = 0; i < n; ++i ) |
s1[i] = s2[i]; | | s1[i] = s2[i]; |
} | | } |
| | |
| | |
#ifdef YY_NEED_STRLEN | | #ifdef YY_NEED_STRLEN |
#ifdef YY_USE_PROTOS | | #ifdef YY_USE_PROTOS |
static yy_size_t yy_flex_strlen( yyconst char *s ) | | static int yy_flex_strlen( yyconst char *s ) |
#else | | #else |
static yy_size_t yy_flex_strlen( s ) | | static int yy_flex_strlen( s ) |
yyconst char *s; | | yyconst char *s; |
#endif | | #endif |
{ | | { |
register yy_size_t n; | | register int n; |
for ( n = 0; s[n]; ++n ) | | for ( n = 0; s[n]; ++n ) |
; | | ; |
| | |
| | |
return (void *) malloc( size ); | | return (void *) malloc( size ); |
} | | } |
| | |
#ifndef YY_USES_REJECT | | |
#ifdef YY_USE_PROTOS | | #ifdef YY_USE_PROTOS |
static void *yy_flex_realloc( void *ptr, yy_size_t size ) | | static void *yy_flex_realloc( void *ptr, yy_size_t size ) |
#else | | #else |
| | |
*/ | | */ |
return (void *) realloc( (char *) ptr, size ); | | return (void *) realloc( (char *) ptr, size ); |
} | | } |
#endif | | |
| | |
#ifdef YY_USE_PROTOS | | #ifdef YY_USE_PROTOS |
static void yy_flex_free( void *ptr ) | | static void yy_flex_free( void *ptr ) |
| | |
if(op->stats.maxgrace!=op2->stats.maxgrace) | | if(op->stats.maxgrace!=op2->stats.maxgrace) |
save_long(buf, "maxgrace", op->stats.maxgrace); | | save_long(buf, "maxgrace", op->stats.maxgrace); |
if(op->stats.exp!=op2->stats.exp) | | if(op->stats.exp!=op2->stats.exp) |
save_long(buf, "exp", op->stats.exp); | | save_long_long(buf, "exp", op->stats.exp); |
if(op->expmul!=op2->expmul) | | if(op->expmul!=op2->expmul) |
save_double(buf, "expmul", op->expmul); | | save_double(buf, "expmul", op->expmul); |
if(op->stats.food!=op2->stats.food) | | if(op->stats.food!=op2->stats.food) |