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

📄 lex.cc_command.cpp

📁 这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用于网络游戏医学图像网关的高qos要求.更详细的内容可阅读相应的材料
💻 CPP
📖 第 1 页 / 共 4 页
字号:
			ace_cc_yy_c_buf_p = ace_cc_yytext_ptr + ace_cc_yy_amount_of_matched_text;

			ace_cc_yy_current_state = ace_cc_yy_get_previous_state();

			/* Okay, we're now positioned to make the NUL
			 * transition.  We couldn't have
			 * ace_cc_yy_get_previous_state() go ahead and do it
			 * for us because it doesn't know how to deal
			 * with the possibility of jamming (and we don't
			 * want to build jamming into it because then it
			 * will run more slowly).
			 */

			ace_cc_yy_next_state = ace_cc_yy_try_NUL_trans( ace_cc_yy_current_state );

			ace_cc_yy_bp = ace_cc_yytext_ptr + ACE_CC_YY_MORE_ADJ;

			if ( ace_cc_yy_next_state )
				{
				/* Consume the NUL. */
				ace_cc_yy_cp = ++ace_cc_yy_c_buf_p;
				ace_cc_yy_current_state = ace_cc_yy_next_state;
				goto ace_cc_yy_match;
				}

			else
				{
				ace_cc_yy_cp = ace_cc_yy_c_buf_p;
				goto ace_cc_yy_find_action;
				}
			}

		else switch ( ace_cc_yy_get_next_buffer() )
			{
			case EOB_ACT_END_OF_FILE:
				{
#if (ace_cc_yywrap() != 1)
				ace_cc_yy_did_buffer_switch_on_eof = 0;
#endif

				if ( ace_cc_yywrap() )
					{
					/* Note: because we've taken care in
					 * ace_cc_yy_get_next_buffer() to have set up
					 * ace_cc_yytext, we can now set up
					 * ace_cc_yy_c_buf_p so that if some total
					 * hoser (like flex itself) wants to
					 * call the scanner after we return the
					 * ACE_CC_YY_NULL, it'll still work - another
					 * ACE_CC_YY_NULL will get returned.
					 */
					ace_cc_yy_c_buf_p = ace_cc_yytext_ptr + ACE_CC_YY_MORE_ADJ;

					ace_cc_yy_act = ACE_CC_YY_STATE_EOF(ACE_CC_YY_START);
					goto do_action;
					}

				else
					{
#if (ace_cc_yywrap() != 1)
					if ( ! ace_cc_yy_did_buffer_switch_on_eof )
						ACE_CC_YY_NEW_FILE;
#endif
					}
				break;
				}

			case EOB_ACT_CONTINUE_SCAN:
				ace_cc_yy_c_buf_p =
					ace_cc_yytext_ptr + ace_cc_yy_amount_of_matched_text;

				ace_cc_yy_current_state = ace_cc_yy_get_previous_state();

				ace_cc_yy_cp = ace_cc_yy_c_buf_p;
				ace_cc_yy_bp = ace_cc_yytext_ptr + ACE_CC_YY_MORE_ADJ;
				goto ace_cc_yy_match;

			case EOB_ACT_LAST_MATCH:
				ace_cc_yy_c_buf_p =
				&ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[ace_cc_yy_n_chars];

				ace_cc_yy_current_state = ace_cc_yy_get_previous_state();

				ace_cc_yy_cp = ace_cc_yy_c_buf_p;
				ace_cc_yy_bp = ace_cc_yytext_ptr + ACE_CC_YY_MORE_ADJ;
				goto ace_cc_yy_find_action;
			}
		break;
		}

	default:
		ACE_CC_YY_FATAL_ERROR(
			"fatal flex scanner internal error--no action found" );
	} /* end of action switch */
		} /* end of scanning one token */
	} /* end of ace_cc_yylex */


/* ace_cc_yy_get_next_buffer - try to read in a new buffer
 *
 * Returns a code representing an action:
 *	EOB_ACT_LAST_MATCH -
 *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
 *	EOB_ACT_END_OF_FILE - end of file
 */

static int ace_cc_yy_get_next_buffer()
	{
	register char *dest = ace_cc_yy_current_buffer->ace_cc_yy_ch_buf;
	register char *source = ace_cc_yytext_ptr;
	register int number_to_move, i;
	int ret_val;

	if ( ace_cc_yy_c_buf_p > &ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[ace_cc_yy_n_chars + 1] )
		ACE_CC_YY_FATAL_ERROR(
		"fatal flex scanner internal error--end of buffer missed" );

	if ( ace_cc_yy_current_buffer->ace_cc_yy_fill_buffer == 0 )
		{ /* Don't try to fill the buffer, so this is an EOF. */
		if ( ace_cc_yy_c_buf_p - ace_cc_yytext_ptr - ACE_CC_YY_MORE_ADJ == 1 )
			{
			/* We matched a single character, the EOB, so
			 * treat this as a final EOF.
			 */
			return EOB_ACT_END_OF_FILE;
			}

		else
			{
			/* We matched some text prior to the EOB, first
			 * process it.
			 */
			return EOB_ACT_LAST_MATCH;
			}
		}

	/* Try to read more data. */

	/* First move last chars to start of buffer. */
	number_to_move = (int) (ace_cc_yy_c_buf_p - ace_cc_yytext_ptr) - 1;

	for ( i = 0; i < number_to_move; ++i )
		*(dest++) = *(source++);

	if ( ace_cc_yy_current_buffer->ace_cc_yy_buffer_status == ACE_CC_YY_BUFFER_EOF_PENDING )
		/* don't do the read, it's not guaranteed to return an EOF,
		 * just force an EOF
		 */
		ace_cc_yy_current_buffer->ace_cc_yy_n_chars = ace_cc_yy_n_chars = 0;

	else
		{
		int num_to_read =
			ace_cc_yy_current_buffer->ace_cc_yy_buf_size - number_to_move - 1;

		while ( num_to_read <= 0 )
			{ /* Not enough room in the buffer - grow it. */
#ifdef ACE_CC_YY_USES_REJECT
			ACE_CC_YY_FATAL_ERROR(
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
#else

			/* just a shorter name for the current buffer */
			ACE_CC_YY_BUFFER_STATE b = ace_cc_yy_current_buffer;

			int ace_cc_yy_c_buf_p_offset =
				(int) (ace_cc_yy_c_buf_p - b->ace_cc_yy_ch_buf);

			if ( b->ace_cc_yy_is_our_buffer )
				{
				int new_size = b->ace_cc_yy_buf_size * 2;

				if ( new_size <= 0 )
					b->ace_cc_yy_buf_size += b->ace_cc_yy_buf_size / 8;
				else
					b->ace_cc_yy_buf_size *= 2;

				b->ace_cc_yy_ch_buf = (char *)
					/* Include room in for 2 EOB chars. */
					ace_cc_yy_flex_realloc( (void *) b->ace_cc_yy_ch_buf,
							 b->ace_cc_yy_buf_size + 2 );
				}
			else
				/* Can't grow it, we don't own it. */
				b->ace_cc_yy_ch_buf = 0;

			if ( ! b->ace_cc_yy_ch_buf )
				ACE_CC_YY_FATAL_ERROR(
				"fatal error - scanner input buffer overflow" );

			ace_cc_yy_c_buf_p = &b->ace_cc_yy_ch_buf[ace_cc_yy_c_buf_p_offset];

			num_to_read = ace_cc_yy_current_buffer->ace_cc_yy_buf_size -
						number_to_move - 1;
#endif
			}

		if ( num_to_read > ACE_CC_YY_READ_BUF_SIZE )
			num_to_read = ACE_CC_YY_READ_BUF_SIZE;

		/* Read in more data. */
		ACE_CC_YY_INPUT( (&ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[number_to_move]),
			ace_cc_yy_n_chars, num_to_read );

		ace_cc_yy_current_buffer->ace_cc_yy_n_chars = ace_cc_yy_n_chars;
		}

	if ( ace_cc_yy_n_chars == 0 )
		{
		if ( number_to_move == ACE_CC_YY_MORE_ADJ )
			{
			ret_val = EOB_ACT_END_OF_FILE;
			ace_cc_yyrestart( ace_cc_yyin );
			}

		else
			{
			ret_val = EOB_ACT_LAST_MATCH;
			ace_cc_yy_current_buffer->ace_cc_yy_buffer_status =
				ACE_CC_YY_BUFFER_EOF_PENDING;
			}
		}

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

	ace_cc_yy_n_chars += number_to_move;
	ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[ace_cc_yy_n_chars] = ACE_CC_YY_END_OF_BUFFER_CHAR;
	ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[ace_cc_yy_n_chars + 1] = ACE_CC_YY_END_OF_BUFFER_CHAR;

	ace_cc_yytext_ptr = &ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[0];

	return ret_val;
	}


/* ace_cc_yy_get_previous_state - get the state just before the EOB char was reached */

static ace_cc_yy_state_type ace_cc_yy_get_previous_state()
	{
	register ace_cc_yy_state_type ace_cc_yy_current_state;
	register char *ace_cc_yy_cp;

	ace_cc_yy_current_state = ace_cc_yy_start;
	ace_cc_yy_current_state += ACE_CC_YY_AT_BOL();

	for ( ace_cc_yy_cp = ace_cc_yytext_ptr + ACE_CC_YY_MORE_ADJ; ace_cc_yy_cp < ace_cc_yy_c_buf_p; ++ace_cc_yy_cp )
		{
		register ACE_CC_YY_CHAR ace_cc_yy_c = (*ace_cc_yy_cp ? ace_cc_yy_ec[ACE_CC_YY_SC_TO_UI(*ace_cc_yy_cp)] : 1);
		if ( ace_cc_yy_accept[ace_cc_yy_current_state] )
			{
			ace_cc_yy_last_accepting_state = ace_cc_yy_current_state;
			ace_cc_yy_last_accepting_cpos = ace_cc_yy_cp;
			}
		while ( ace_cc_yy_chk[ace_cc_yy_base[ace_cc_yy_current_state] + ace_cc_yy_c] != ace_cc_yy_current_state )
			{
			ace_cc_yy_current_state = (int) ace_cc_yy_def[ace_cc_yy_current_state];
			if ( ace_cc_yy_current_state >= 124 )
				ace_cc_yy_c = ace_cc_yy_meta[(unsigned int) ace_cc_yy_c];
			}
		ace_cc_yy_current_state = ace_cc_yy_nxt[ace_cc_yy_base[ace_cc_yy_current_state] + (unsigned int) ace_cc_yy_c];
		}

	return ace_cc_yy_current_state;
	}


/* ace_cc_yy_try_NUL_trans - try to make a transition on the NUL character
 *
 * synopsis
 *	next_state = ace_cc_yy_try_NUL_trans( current_state );
 */

#ifdef ACE_CC_YY_USE_PROTOS
static ace_cc_yy_state_type ace_cc_yy_try_NUL_trans( ace_cc_yy_state_type ace_cc_yy_current_state )
#else
static ace_cc_yy_state_type ace_cc_yy_try_NUL_trans( ace_cc_yy_current_state )
ace_cc_yy_state_type ace_cc_yy_current_state;
#endif
	{
	register int ace_cc_yy_is_jam;
	register char *ace_cc_yy_cp = ace_cc_yy_c_buf_p;

	register ACE_CC_YY_CHAR ace_cc_yy_c = 1;
	if ( ace_cc_yy_accept[ace_cc_yy_current_state] )
		{
		ace_cc_yy_last_accepting_state = ace_cc_yy_current_state;
		ace_cc_yy_last_accepting_cpos = ace_cc_yy_cp;
		}
	while ( ace_cc_yy_chk[ace_cc_yy_base[ace_cc_yy_current_state] + ace_cc_yy_c] != ace_cc_yy_current_state )
		{
		ace_cc_yy_current_state = (int) ace_cc_yy_def[ace_cc_yy_current_state];
		if ( ace_cc_yy_current_state >= 124 )
			ace_cc_yy_c = ace_cc_yy_meta[(unsigned int) ace_cc_yy_c];
		}
	ace_cc_yy_current_state = ace_cc_yy_nxt[ace_cc_yy_base[ace_cc_yy_current_state] + (unsigned int) ace_cc_yy_c];
	ace_cc_yy_is_jam = (ace_cc_yy_current_state == 123);

	return ace_cc_yy_is_jam ? 0 : ace_cc_yy_current_state;
	}


#ifndef ACE_CC_YY_NO_UNPUT
#ifdef ACE_CC_YY_USE_PROTOS
static void ace_cc_yyunput( int c, register char *ace_cc_yy_bp )
#else
static void ace_cc_yyunput( c, ace_cc_yy_bp )
int c;
register char *ace_cc_yy_bp;
#endif
	{
	register char *ace_cc_yy_cp = ace_cc_yy_c_buf_p;

	/* undo effects of setting up ace_cc_yytext */
	*ace_cc_yy_cp = ace_cc_yy_hold_char;

	if ( ace_cc_yy_cp < ace_cc_yy_current_buffer->ace_cc_yy_ch_buf + 2 )
		{ /* need to shift things up to make room */
		/* +2 for EOB chars. */
		register int number_to_move = ace_cc_yy_n_chars + 2;
		register char *dest = &ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[
					ace_cc_yy_current_buffer->ace_cc_yy_buf_size + 2];
		register char *source =
				&ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[number_to_move];

		while ( source > ace_cc_yy_current_buffer->ace_cc_yy_ch_buf )
			*--dest = *--source;

		ace_cc_yy_cp += (int) (dest - source);
		ace_cc_yy_bp += (int) (dest - source);
		ace_cc_yy_current_buffer->ace_cc_yy_n_chars =
			ace_cc_yy_n_chars = ace_cc_yy_current_buffer->ace_cc_yy_buf_size;

		if ( ace_cc_yy_cp < ace_cc_yy_current_buffer->ace_cc_yy_ch_buf + 2 )
			ACE_CC_YY_FATAL_ERROR( "flex scanner push-back overflow" );
		}

	*--ace_cc_yy_cp = (char) c;


	ace_cc_yytext_ptr = ace_cc_yy_bp;
	ace_cc_yy_hold_char = *ace_cc_yy_cp;
	ace_cc_yy_c_buf_p = ace_cc_yy_cp;
	}
#endif	/* ifndef ACE_CC_YY_NO_UNPUT */

#ifndef ACE_CC_YY_NO_INPUT
#ifdef __cplusplus
static int ace_cc_yyinput()
#else
static int input()
#endif
	{
	int c;

	*ace_cc_yy_c_buf_p = ace_cc_yy_hold_char;

	if ( *ace_cc_yy_c_buf_p == ACE_CC_YY_END_OF_BUFFER_CHAR )
		{
		/* ace_cc_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 ( ace_cc_yy_c_buf_p < &ace_cc_yy_current_buffer->ace_cc_yy_ch_buf[ace_cc_yy_n_chars] )
			/* This was really a NUL. */
			*ace_cc_yy_c_buf_p = '\0';

		else
			{ /* need more input */
			int offset = ace_cc_yy_c_buf_p - ace_cc_yytext_ptr;
			++ace_cc_yy_c_buf_p;

			switch ( ace_cc_yy_get_next_buffer() )
				{
				case EOB_ACT_LAST_MATCH:
					/* This happens because ace_cc_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. */
					ace_cc_yyrestart( ace_cc_yyin );

					/* fall through */

				case EOB_ACT_END_OF_FILE:
					{
					if ( ace_cc_yywrap() )
						return EOF;

                                        /*					if ( ! ace_cc_yy_did_buffer_switch_on_eof )
						ACE_CC_YY_NEW_FILE;
#ifdef __cplusplus
					return ace_cc_yyinput();
#else
					return input();
                                        #endif */
					}

				case EOB_ACT_CONTINUE_SCAN:
					ace_cc_yy_c_buf_p = ace_cc_yytext_ptr + offset;
					break;
				}
			}
		}

	c = *(unsigned char *) ace_cc_yy_c_buf_p;	/* cast for 8-bit char's */
	*ace_cc_yy_c_buf_p = '\0';	/* preserve ace_cc_yytext */
	ace_cc_yy_hold_char = *++ace_cc_yy_c_buf_p;

	ace_cc_yy_current_buffer->ace_cc_yy_at_bol = (c == '\n');

	return c;
	}
#endif /* ! ACE_CC_YY_NO_INPUT */


#ifdef ACE_CC_YY_USE_PROTOS
void ace_cc_yyrestart( FILE *input_file )
#else
void ace_cc_yyrestart( input_file )

⌨️ 快捷键说明

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