diff options
author | Vern Paxson <vern@ee.lbl.gov> | 1993-10-03 16:01:56 +0000 |
---|---|---|
committer | Vern Paxson <vern@ee.lbl.gov> | 1993-10-03 16:01:56 +0000 |
commit | 1fd6facb52598dc4b6c307101fbd3de5cd8bf0a1 (patch) | |
tree | 9255a7f1572adfb2a74e909b0dd1a5c469403cd9 /flex.skl | |
parent | 640e372ac8831e9566c47e0fbf4230ecb86105ba (diff) |
Minimized use of YY_CHAR
Diffstat (limited to 'flex.skl')
-rw-r--r-- | flex.skl | 38 |
1 files changed, 19 insertions, 19 deletions
@@ -218,8 +218,8 @@ struct yy_buffer_state istream* yy_input_file; %* - YY_CHAR *yy_ch_buf; /* input buffer */ - YY_CHAR *yy_buf_pos; /* current position in input buffer */ + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. @@ -256,7 +256,7 @@ static YY_BUFFER_STATE yy_current_buffer = 0; %- Standard (non-C++) definition /* yy_hold_char holds the character lost when yytext is formed. */ -static YY_CHAR yy_hold_char; +static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ @@ -266,7 +266,7 @@ int yyleng; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; /* Points to current character in buffer. */ -static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0; +static char *yy_c_buf_p = (char *) 0; static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ @@ -275,7 +275,7 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -static void yyunput YY_PROTO(( YY_CHAR c, YY_CHAR *buf_ptr )); +static void yyunput YY_PROTO(( int c, char *buf_ptr )); void yyrestart YY_PROTO(( FILE *input_file )); void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); @@ -320,7 +320,7 @@ static int yy_get_next_buffer YY_PROTO(( void )); YY_DECL { register yy_state_type yy_current_state; - register YY_CHAR *yy_cp, *yy_bp; + register char *yy_cp, *yy_bp; register int yy_act; %% user's declarations go here @@ -547,8 +547,8 @@ static int yy_get_next_buffer() int yyFlexLexer::yy_get_next_buffer() %* { - register YY_CHAR *dest = yy_current_buffer->yy_ch_buf; - register YY_CHAR *source = yytext_ptr - 1; /* copy prev. char, too */ + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr - 1; /* copy prev. char, too */ register int number_to_move, i; int ret_val; @@ -584,7 +584,7 @@ int yyFlexLexer::yy_get_next_buffer() int yy_c_buf_p_offset = yy_c_buf_p - b->yy_ch_buf; b->yy_buf_size *= 2; - b->yy_ch_buf = (YY_CHAR *) + b->yy_ch_buf = (char *) yy_flex_realloc( (void *) b->yy_ch_buf, b->yy_buf_size ); @@ -649,7 +649,7 @@ yy_state_type yyFlexLexer::yy_get_previous_state() %* { register yy_state_type yy_current_state; - register YY_CHAR *yy_cp; + register char *yy_cp; %% code to get the start state into yy_current_state goes here @@ -688,17 +688,17 @@ yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state ) %- #ifdef YY_USE_PROTOS -static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp ) +static void yyunput( int c, register char *yy_bp ) #else static void yyunput( c, yy_bp ) -YY_CHAR c; -register YY_CHAR *yy_bp; +int c; +register char *yy_bp; #endif %+ -void yyFlexLexer::yyunput( YY_CHAR c, register YY_CHAR *yy_bp ) +void yyFlexLexer::yyunput( int c, register char* yy_bp ) %* { - register YY_CHAR *yy_cp = yy_c_buf_p; + register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; @@ -707,9 +707,9 @@ void yyFlexLexer::yyunput( YY_CHAR c, register YY_CHAR *yy_bp ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = yy_n_chars + 2; - register YY_CHAR *dest = &yy_current_buffer->yy_ch_buf[ + register char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; - register YY_CHAR *source = + register char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) @@ -726,7 +726,7 @@ void yyFlexLexer::yyunput( YY_CHAR c, register YY_CHAR *yy_bp ) if ( yy_cp > yy_bp && yy_cp[-1] == '\n' ) yy_cp[-2] = '\n'; - *--yy_cp = c; + *--yy_cp = (char) c; /* Note: the formal parameter *must* be called "yy_bp" for this * macro to now work correctly. @@ -901,7 +901,7 @@ YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size ) /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (YY_CHAR *) yy_flex_alloc( b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); |