⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scan.cpp

📁 一个俄国人写的内存数据库系统
💻 CPP
📖 第 1 页 / 共 3 页
字号:
	if ( yy_n_chars == 0 )		{		if ( number_to_move - YY_MORE_ADJ == 1 )			{			ret_val = EOB_ACT_END_OF_FILE;			yyrestart( yyin );			}		else			{			ret_val = EOB_ACT_LAST_MATCH;			yy_current_buffer->yy_buffer_status =				YY_BUFFER_EOF_PENDING;			}		}	else		ret_val = EOB_ACT_CONTINUE_SCAN;	yy_n_chars += number_to_move;	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;	/* yytext begins at the second character in yy_ch_buf; the first	 * character is the one which preceded it before reading in the latest	 * buffer; it needs to be kept around in case it's a newline, so	 * yy_get_previous_state() will have with '^' rules active.	 */	yytext_ptr = &yy_current_buffer->yy_ch_buf[1];	return ret_val;	}/* yy_get_previous_state - get the state just before the EOB char was reached */static yy_state_type yy_get_previous_state()	{	register yy_state_type yy_current_state;	register char *yy_cp;	yy_current_state = yy_start;	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )		{		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);		if ( yy_accept[yy_current_state] )			{			yy_last_accepting_state = yy_current_state;			yy_last_accepting_cpos = yy_cp;			}		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )			{			yy_current_state = (int) yy_def[yy_current_state];			if ( yy_current_state >= 95 )				yy_c = yy_meta[(unsigned int) yy_c];			}		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];		}	return yy_current_state;	}/* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis *	next_state = yy_try_NUL_trans( current_state ); */#ifdef YY_USE_PROTOSstatic yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )#elsestatic yy_state_type yy_try_NUL_trans( yy_current_state )yy_state_type yy_current_state;#endif	{	register int yy_is_jam;	register char *yy_cp = yy_c_buf_p;	register YY_CHAR yy_c = 1;	if ( yy_accept[yy_current_state] )		{		yy_last_accepting_state = yy_current_state;		yy_last_accepting_cpos = yy_cp;		}	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )		{		yy_current_state = (int) yy_def[yy_current_state];		if ( yy_current_state >= 95 )			yy_c = yy_meta[(unsigned int) yy_c];		}	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];	yy_is_jam = (yy_current_state == 94);	return yy_is_jam ? 0 : yy_current_state;	}#ifdef YY_USE_PROTOSstatic void yyunput( int c, register char *yy_bp )#elsestatic void yyunput( c, yy_bp )int c;register char *yy_bp;#endif	{	register char *yy_cp = yy_c_buf_p;	/* undo effects of setting up yytext */	*yy_cp = yy_hold_char;	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )		{ /* need to shift things up to make room */		/* +2 for EOB chars. */		register int number_to_move = yy_n_chars + 2;		register char *dest = &yy_current_buffer->yy_ch_buf[					yy_current_buffer->yy_buf_size + 2];		register char *source =				&yy_current_buffer->yy_ch_buf[number_to_move];		while ( source > yy_current_buffer->yy_ch_buf )			*--dest = *--source;		yy_cp += dest - source;		yy_bp += dest - source;		yy_n_chars = yy_current_buffer->yy_buf_size;		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )			YY_FATAL_ERROR( "flex scanner push-back overflow" );		}	if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )		yy_cp[-2] = '\n';	*--yy_cp = (char) c;	/* Note: the formal parameter *must* be called "yy_bp" for this	 * macro to now work correctly.	 */	YY_DO_BEFORE_ACTION; /* set up yytext again */	}#ifdef __cplusplusstatic int yyinput()#elsestatic int input()#endif	{	int c;	*yy_c_buf_p = yy_hold_char;	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )		{		/* yy_c_buf_p now points to the character we want to return.		 * If this occurs *before* the EOB characters, then it's a		 * valid NUL; if not, then we've hit the end of the buffer.		 */		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )			/* This was really a NUL. */			*yy_c_buf_p = '\0';		else			{ /* need more input */			yytext_ptr = yy_c_buf_p;			++yy_c_buf_p;			switch ( yy_get_next_buffer() )				{				case EOB_ACT_END_OF_FILE:					{					if ( yywrap() )						{						yy_c_buf_p =						yytext_ptr + YY_MORE_ADJ;						return EOF;						}					YY_NEW_FILE;#ifdef __cplusplus					return yyinput();#else					return input();#endif					}				case EOB_ACT_CONTINUE_SCAN:					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;					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				}			}		}	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */	*yy_c_buf_p = '\0';	/* preserve yytext */	yy_hold_char = *++yy_c_buf_p;	return c;	}#ifdef YY_USE_PROTOSvoid yyrestart( FILE *input_file )#elsevoid yyrestart( input_file )FILE *input_file;#endif	{	if ( ! yy_current_buffer )		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );	yy_init_buffer( yy_current_buffer, input_file );	yy_load_buffer_state();	}#ifdef YY_USE_PROTOSvoid yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )#elsevoid yy_switch_to_buffer( new_buffer )YY_BUFFER_STATE new_buffer;#endif	{	if ( yy_current_buffer == new_buffer )		return;	if ( yy_current_buffer )		{		/* Flush out information for old buffer. */		*yy_c_buf_p = yy_hold_char;		yy_current_buffer->yy_buf_pos = yy_c_buf_p;		yy_current_buffer->yy_n_chars = yy_n_chars;		}	yy_current_buffer = new_buffer;	yy_load_buffer_state();	/* We don't actually know whether we did this switch during	 * EOF (yywrap()) processing, but the only time this flag	 * is looked at is after yywrap() is called, so it's safe	 * to go ahead and always set it.	 */	yy_did_buffer_switch_on_eof = 1;	}#ifdef YY_USE_PROTOSvoid yy_load_buffer_state( void )#elsevoid yy_load_buffer_state()#endif	{	yy_n_chars = yy_current_buffer->yy_n_chars;	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;	yyin = yy_current_buffer->yy_input_file;	yy_hold_char = *yy_c_buf_p;	}#ifdef YY_USE_PROTOSYY_BUFFER_STATE yy_create_buffer( FILE *file, int size )#elseYY_BUFFER_STATE yy_create_buffer( file, size )FILE *file;int size;#endif	{	YY_BUFFER_STATE b;	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );	if ( ! b )		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );	b->yy_buf_size = 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 = (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()" );	yy_init_buffer( b, file );	return b;	}#ifdef YY_USE_PROTOSvoid yy_delete_buffer( YY_BUFFER_STATE b )#elsevoid yy_delete_buffer( b )YY_BUFFER_STATE b;#endif	{	if ( b == yy_current_buffer )		yy_current_buffer = (YY_BUFFER_STATE) 0;	yy_flex_free( (void *) b->yy_ch_buf );	yy_flex_free( (void *) b );	}#ifdef YY_USE_PROTOSvoid yy_init_buffer( YY_BUFFER_STATE b, FILE *file )#elsevoid yy_init_buffer( b, file )YY_BUFFER_STATE b;FILE *file;#endif	{	b->yy_input_file = file;	/* We put in the '\n' and start reading from [1] so that an	 * initial match-at-newline will be true.	 */	b->yy_ch_buf[0] = '\n';	b->yy_n_chars = 1;	/* We always need two end-of-buffer characters.  The first causes	 * a transition to the end-of-buffer state.  The second causes	 * a jam in that state.	 */	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;	b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;	b->yy_buf_pos = &b->yy_ch_buf[1];	b->yy_is_interactive = file ? isatty( fileno(file) ) : 0;	b->yy_fill_buffer = 1;	b->yy_buffer_status = YY_BUFFER_NEW;	}#ifdef YY_USE_PROTOSstatic void yy_push_state( int new_state )#elsestatic void yy_push_state( new_state )int new_state;#endif	{	if ( yy_start_stack_ptr >= yy_start_stack_depth )		{		int new_size;		yy_start_stack_depth += YY_START_STACK_INCR;		new_size = yy_start_stack_depth * sizeof( int );		if ( ! yy_start_stack )			yy_start_stack = (int *) yy_flex_alloc( new_size );		else			yy_start_stack = (int *) yy_flex_realloc(					(void *) yy_start_stack, new_size );		if ( ! yy_start_stack )			YY_FATAL_ERROR(			"out of memory expanding start-condition stack" );		}	yy_start_stack[yy_start_stack_ptr++] = YY_START;	BEGIN(new_state);	}static void yy_pop_state()	{	if ( --yy_start_stack_ptr < 0 )		YY_FATAL_ERROR( "start-condition stack underflow" );	BEGIN(yy_start_stack[yy_start_stack_ptr]);	}static int yy_top_state()	{	return yy_start_stack[yy_start_stack_ptr - 1];	}#ifdef YY_USE_PROTOSstatic void yy_fatal_error( const char msg[] )#elsestatic void yy_fatal_error( msg )char msg[];#endif	{	(void) fprintf( stderr, "%s\n", msg );	exit( 1 );	}/* Redefine yyless() so it works in section 3 code. */#undef yyless#define yyless(n) \	do \		{ \		/* Undo effects of setting up yytext. */ \		yytext[yyleng] = yy_hold_char; \		yy_c_buf_p = yytext + n - YY_MORE_ADJ; \		yy_hold_char = *yy_c_buf_p; \		*yy_c_buf_p = '\0'; \		yyleng = n; \		} \	while ( 0 )/* Internal utility routines. */#ifndef yytext_ptr#ifdef YY_USE_PROTOSstatic void yy_flex_strncpy( char *s1, const char *s2, int n )#elsestatic void yy_flex_strncpy( s1, s2, n )char *s1;const char *s2;int n;#endif	{	register int i;	for ( i = 0; i < n; ++i )		s1[i] = s2[i];	}#endif#ifdef YY_USE_PROTOSstatic void *yy_flex_alloc( unsigned int size )#elsestatic void *yy_flex_alloc( size )unsigned int size;#endif	{	return (void *) malloc( size );	}#ifdef YY_USE_PROTOSstatic void *yy_flex_realloc( void *ptr, unsigned int size )#elsestatic void *yy_flex_realloc( ptr, size )void *ptr;unsigned int size;#endif	{	return (void *) realloc( ptr, size );	}#ifdef YY_USE_PROTOSstatic void yy_flex_free( void *ptr )#elsestatic void yy_flex_free( ptr )void *ptr;#endif	{	free( ptr );	}# line 59 "scan.l"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -