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

📄 fcl-scanner.cc

📁 parse fuzzy contrl language file
💻 CC
📖 第 1 页 / 共 5 页
字号:
		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )			/* This was really a NUL. */			*(yy_c_buf_p) = '\0';		else			{ /* need more input */			int offset = (yy_c_buf_p) - (yytext_ptr);			++(yy_c_buf_p);			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 );					/*FALLTHROUGH*/				case EOB_ACT_END_OF_FILE:					{					if ( yywrap( ) )						return EOF;					if ( ! (yy_did_buffer_switch_on_eof) )						YY_NEW_FILE;#ifdef __cplusplus					return yyinput();#else					return input();#endif					}				case EOB_ACT_CONTINUE_SCAN:					(yy_c_buf_p) = (yytext_ptr) + offset;					break;				}			}		}	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);/* %% [19.0] update BOL and yylineno */	return c;}/* %if-c-only */#endif	/* ifndef YY_NO_INPUT *//* %endif *//** Immediately switch to a different input stream. * @param input_file A readable stream. *  * @note This function does not reset the start condition to @c INITIAL . *//* %if-c-only */    void yyrestart  (FILE * input_file )/* %endif *//* %if-c++-only *//* %endif */{    	if ( ! YY_CURRENT_BUFFER ){        yyensure_buffer_stack ();		YY_CURRENT_BUFFER_LVALUE =            yy_create_buffer(yyin,YY_BUF_SIZE );	}	yy_init_buffer(YY_CURRENT_BUFFER,input_file );	yy_load_buffer_state( );}/** Switch to a different input buffer. * @param new_buffer The new input buffer. *  *//* %if-c-only */    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )/* %endif *//* %if-c++-only *//* %endif */{    	/* TODO. We should be able to replace this entire function body	 * with	 *		yypop_buffer_state();	 *		yypush_buffer_state(new_buffer);     */	yyensure_buffer_stack ();	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_LVALUE->yy_buf_pos = (yy_c_buf_p);		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);		}	YY_CURRENT_BUFFER_LVALUE = 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;}/* %if-c-only */static void yy_load_buffer_state  (void)/* %endif *//* %if-c++-only *//* %endif */{    	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;	(yy_hold_char) = *(yy_c_buf_p);}/** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. *  * @return the allocated buffer state. *//* %if-c-only */    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )/* %endif *//* %if-c++-only *//* %endif */{	YY_BUFFER_STATE b;    	b = (YY_BUFFER_STATE) yyalloc(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 *) yyalloc(b->yy_buf_size + 2  );	if ( ! b->yy_ch_buf )		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );	b->yy_is_our_buffer = 1;	yy_init_buffer(b,file );	return b;}/** Destroy the buffer. * @param b a buffer created with yy_create_buffer() *  *//* %if-c-only */    void yy_delete_buffer (YY_BUFFER_STATE  b )/* %endif *//* %if-c++-only *//* %endif */{    	if ( ! b )		return;	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;	if ( b->yy_is_our_buffer )		yyfree((void *) b->yy_ch_buf  );	yyfree((void *) b  );}/* %if-c-only */#ifndef __cplusplusextern int isatty (int );#endif /* __cplusplus */    /* %endif *//* %if-c++-only *//* %endif *//* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. *//* %if-c-only */    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )/* %endif *//* %if-c++-only *//* %endif */{	int oerrno = errno;    	yy_flush_buffer(b );	b->yy_input_file = file;	b->yy_fill_buffer = 1;    /* If b is the current buffer, then yy_init_buffer was _probably_     * called from yyrestart() or through yy_get_next_buffer.     * In that case, we don't want to reset the lineno or column.     */    if (b != YY_CURRENT_BUFFER){        b->yy_bs_lineno = 1;        b->yy_bs_column = 0;    }/* %if-c-only */        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;    /* %endif *//* %if-c++-only *//* %endif */	errno = oerrno;}/** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. *  *//* %if-c-only */    void yy_flush_buffer (YY_BUFFER_STATE  b )/* %endif *//* %if-c++-only *//* %endif */{    	if ( ! b )		return;	b->yy_n_chars = 0;	/* 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[0] = YY_END_OF_BUFFER_CHAR;	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;	b->yy_buf_pos = &b->yy_ch_buf[0];	b->yy_at_bol = 1;	b->yy_buffer_status = YY_BUFFER_NEW;	if ( b == YY_CURRENT_BUFFER )		yy_load_buffer_state( );}/* %if-c-or-c++ *//** Pushes the new state onto the stack. The new state becomes *  the current state. This function will allocate the stack *  if necessary. *  @param new_buffer The new state. *   *//* %if-c-only */void yypush_buffer_state (YY_BUFFER_STATE new_buffer )/* %endif *//* %if-c++-only *//* %endif */{    	if (new_buffer == NULL)		return;	yyensure_buffer_stack();	/* This block is copied from yy_switch_to_buffer. */	if ( YY_CURRENT_BUFFER )		{		/* Flush out information for old buffer. */		*(yy_c_buf_p) = (yy_hold_char);		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);		}	/* Only push if top exists. Otherwise, replace top. */	if (YY_CURRENT_BUFFER)		(yy_buffer_stack_top)++;	YY_CURRENT_BUFFER_LVALUE = new_buffer;	/* copied from yy_switch_to_buffer. */	yy_load_buffer_state( );	(yy_did_buffer_switch_on_eof) = 1;}/* %endif *//* %if-c-or-c++ *//** Removes and deletes the top of the stack, if present. *  The next element becomes the new top. *   *//* %if-c-only */void yypop_buffer_state (void)/* %endif *//* %if-c++-only *//* %endif */{    	if (!YY_CURRENT_BUFFER)		return;	yy_delete_buffer(YY_CURRENT_BUFFER );	YY_CURRENT_BUFFER_LVALUE = NULL;	if ((yy_buffer_stack_top) > 0)		--(yy_buffer_stack_top);	if (YY_CURRENT_BUFFER) {		yy_load_buffer_state( );		(yy_did_buffer_switch_on_eof) = 1;	}}/* %endif *//* %if-c-or-c++ *//* Allocates the stack if it does not exist. *  Guarantees space for at least one push. *//* %if-c-only */static void yyensure_buffer_stack (void)/* %endif *//* %if-c++-only *//* %endif */{	int num_to_alloc;    	if (!(yy_buffer_stack)) {		/* First allocation is just for 2 elements, since we don't know if this		 * scanner will even need a stack. We use 2 instead of 1 to avoid an		 * immediate realloc on the next call.         */		num_to_alloc = 1;		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc								(num_to_alloc * sizeof(struct yy_buffer_state*)								);				memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));						(yy_buffer_stack_max) = num_to_alloc;		(yy_buffer_stack_top) = 0;		return;	}	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){		/* Increase the buffer to prepare for a possible push. */		int grow_size = 8 /* arbitrary grow size */;		num_to_alloc = (yy_buffer_stack_max) + grow_size;		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc								((yy_buffer_stack),								num_to_alloc * sizeof(struct yy_buffer_state*)								);		/* zero only the new slots.*/		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));		(yy_buffer_stack_max) = num_to_alloc;	}}/* %endif *//* %if-c-only *//** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer *  * @return the newly allocated buffer state object.  */YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size ){	YY_BUFFER_STATE b;    	if ( size < 2 ||	     base[size-2] != YY_END_OF_BUFFER_CHAR ||	     base[size-1] != YY_END_OF_BUFFER_CHAR )		/* They forgot to leave room for the EOB's. */		return 0;	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );	if ( ! b )		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */	b->yy_buf_pos = b->yy_ch_buf = base;	b->yy_is_our_buffer = 0;	b->yy_input_file = 0;	b->yy_n_chars = b->yy_buf_size;	b->yy_is_interactive = 0;	b->yy_at_bol = 1;	b->yy_fill_buffer = 0;	b->yy_buffer_status = YY_BUFFER_NEW;	yy_switch_to_buffer(b  );	return b;}/* %endif *//* %if-c-only *//** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan *  * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use *       yy_scan_bytes() instead. */YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ){    	return yy_scan_bytes(yystr,strlen(yystr) );}/* %endif *//* %if-c-only *//** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. *  * @return the newly allocated buffer state object. */YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len ){	YY_BUFFER_STATE b;	char *buf;	yy_size_t n;	int i;    	/* Get memory for full buffer, including space for trailing EOB's. */	n = _yybytes_len + 2;	buf = (char *) yyalloc(n  );	if ( ! buf )		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );	for ( i = 0; i < _yybytes_len; ++i )		

⌨️ 快捷键说明

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