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

📄 bootscanner.c

📁 PostgreSQL 8.1.4的源码 适用于Linux下的开源数据库系统
💻 C
📖 第 1 页 / 共 4 页
字号:
					pfree(newid);					return(ID);				}	YY_BREAKcase 27:YY_RULE_SETUP#line 112 "bootscanner.l"{					char   *newid;					Int_yytext[strlen(Int_yytext)-1] = '\0'; /* strip off quotes */					newid = scanstr((char*)Int_yytext+1);					Int_yylval.ival = EnterString(newid);					pfree(newid);					Int_yytext[strlen(Int_yytext)] = '"'; /* restore quotes */					return(ID);				}	YY_BREAKcase 28:#line 123 "bootscanner.l"case 29:#line 124 "bootscanner.l"case 30:YY_RULE_SETUP#line 124 "bootscanner.l"{							Int_yylval.ival = EnterString((char*)Int_yytext);							return(CONST_P);						}	YY_BREAKcase 31:YY_RULE_SETUP#line 129 "bootscanner.l"{					elog(ERROR, "syntax error at line %d: unexpected character \"%s\"", Int_yyline, Int_yytext);				}	YY_BREAKcase 32:YY_RULE_SETUP#line 135 "bootscanner.l"YY_FATAL_ERROR( "flex scanner jammed" );	YY_BREAK#line 981 "lex.Int_yy.c"case YY_STATE_EOF(INITIAL):	Int_yyterminate();	case YY_END_OF_BUFFER:		{		/* Amount of text matched not including the EOB char. */		int Int_yy_amount_of_matched_text = (int) (Int_yy_cp - Int_yytext_ptr) - 1;		/* Undo the effects of YY_DO_BEFORE_ACTION. */		*Int_yy_cp = Int_yy_hold_char;		YY_RESTORE_YY_MORE_OFFSET		if ( Int_yy_current_buffer->Int_yy_buffer_status == YY_BUFFER_NEW )			{			/* We're scanning a new file or input source.  It's			 * possible that this happened because the user			 * just pointed Int_yyin at a new source and called			 * Int_yylex().  If so, then we have to assure			 * consistency between Int_yy_current_buffer and our			 * globals.  Here is the right place to do so, because			 * this is the first action (other than possibly a			 * back-up) that will match for the new input source.			 */			Int_yy_n_chars = Int_yy_current_buffer->Int_yy_n_chars;			Int_yy_current_buffer->Int_yy_input_file = Int_yyin;			Int_yy_current_buffer->Int_yy_buffer_status = YY_BUFFER_NORMAL;			}		/* Note that here we test for Int_yy_c_buf_p "<=" to the position		 * of the first EOB in the buffer, since Int_yy_c_buf_p will		 * already have been incremented past the NUL character		 * (since all states make transitions on EOB to the		 * end-of-buffer state).  Contrast this with the test		 * in input().		 */		if ( Int_yy_c_buf_p <= &Int_yy_current_buffer->Int_yy_ch_buf[Int_yy_n_chars] )			{ /* This was really a NUL. */			Int_yy_state_type Int_yy_next_state;			Int_yy_c_buf_p = Int_yytext_ptr + Int_yy_amount_of_matched_text;			Int_yy_current_state = Int_yy_get_previous_state();			/* Okay, we're now positioned to make the NUL			 * transition.  We couldn't have			 * Int_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).			 */			Int_yy_next_state = Int_yy_try_NUL_trans( Int_yy_current_state );			Int_yy_bp = Int_yytext_ptr + YY_MORE_ADJ;			if ( Int_yy_next_state )				{				/* Consume the NUL. */				Int_yy_cp = ++Int_yy_c_buf_p;				Int_yy_current_state = Int_yy_next_state;				goto Int_yy_match;				}			else				{				Int_yy_cp = Int_yy_c_buf_p;				goto Int_yy_find_action;				}			}		else switch ( Int_yy_get_next_buffer() )			{			case EOB_ACT_END_OF_FILE:				{				Int_yy_did_buffer_switch_on_eof = 0;				if ( Int_yywrap() )					{					/* Note: because we've taken care in					 * Int_yy_get_next_buffer() to have set up					 * Int_yytext, we can now set up					 * Int_yy_c_buf_p so that if some total					 * hoser (like flex itself) wants to					 * call the scanner after we return the					 * YY_NULL, it'll still work - another					 * YY_NULL will get returned.					 */					Int_yy_c_buf_p = Int_yytext_ptr + YY_MORE_ADJ;					Int_yy_act = YY_STATE_EOF(YY_START);					goto do_action;					}				else					{					if ( ! Int_yy_did_buffer_switch_on_eof )						YY_NEW_FILE;					}				break;				}			case EOB_ACT_CONTINUE_SCAN:				Int_yy_c_buf_p =					Int_yytext_ptr + Int_yy_amount_of_matched_text;				Int_yy_current_state = Int_yy_get_previous_state();				Int_yy_cp = Int_yy_c_buf_p;				Int_yy_bp = Int_yytext_ptr + YY_MORE_ADJ;				goto Int_yy_match;			case EOB_ACT_LAST_MATCH:				Int_yy_c_buf_p =				&Int_yy_current_buffer->Int_yy_ch_buf[Int_yy_n_chars];				Int_yy_current_state = Int_yy_get_previous_state();				Int_yy_cp = Int_yy_c_buf_p;				Int_yy_bp = Int_yytext_ptr + YY_MORE_ADJ;				goto Int_yy_find_action;			}		break;		}	default:		YY_FATAL_ERROR(			"fatal flex scanner internal error--no action found" );	} /* end of action switch */		} /* end of scanning one token */	} /* end of Int_yylex *//* Int_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 Int_yy_get_next_buffer()	{	register char *dest = Int_yy_current_buffer->Int_yy_ch_buf;	register char *source = Int_yytext_ptr;	register int number_to_move, i;	int ret_val;	if ( Int_yy_c_buf_p > &Int_yy_current_buffer->Int_yy_ch_buf[Int_yy_n_chars + 1] )		YY_FATAL_ERROR(		"fatal flex scanner internal error--end of buffer missed" );	if ( Int_yy_current_buffer->Int_yy_fill_buffer == 0 )		{ /* Don't try to fill the buffer, so this is an EOF. */		if ( Int_yy_c_buf_p - Int_yytext_ptr - 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) (Int_yy_c_buf_p - Int_yytext_ptr) - 1;	for ( i = 0; i < number_to_move; ++i )		*(dest++) = *(source++);	if ( Int_yy_current_buffer->Int_yy_buffer_status == YY_BUFFER_EOF_PENDING )		/* don't do the read, it's not guaranteed to return an EOF,		 * just force an EOF		 */		Int_yy_current_buffer->Int_yy_n_chars = Int_yy_n_chars = 0;	else		{		int num_to_read =			Int_yy_current_buffer->Int_yy_buf_size - number_to_move - 1;		while ( num_to_read <= 0 )			{ /* Not enough room in the buffer - grow it. */#ifdef YY_USES_REJECT			YY_FATAL_ERROR("input buffer overflow, can't enlarge buffer because scanner uses REJECT" );#else			/* just a shorter name for the current buffer */			YY_BUFFER_STATE b = Int_yy_current_buffer;			int Int_yy_c_buf_p_offset =				(int) (Int_yy_c_buf_p - b->Int_yy_ch_buf);			if ( b->Int_yy_is_our_buffer )				{				int new_size = b->Int_yy_buf_size * 2;				if ( new_size <= 0 )					b->Int_yy_buf_size += b->Int_yy_buf_size / 8;				else					b->Int_yy_buf_size *= 2;				b->Int_yy_ch_buf = (char *)					/* Include room in for 2 EOB chars. */					Int_yy_flex_realloc( (void *) b->Int_yy_ch_buf,							 b->Int_yy_buf_size + 2 );				}			else				/* Can't grow it, we don't own it. */				b->Int_yy_ch_buf = 0;			if ( ! b->Int_yy_ch_buf )				YY_FATAL_ERROR(				"fatal error - scanner input buffer overflow" );			Int_yy_c_buf_p = &b->Int_yy_ch_buf[Int_yy_c_buf_p_offset];			num_to_read = Int_yy_current_buffer->Int_yy_buf_size -						number_to_move - 1;#endif			}		if ( num_to_read > YY_READ_BUF_SIZE )			num_to_read = YY_READ_BUF_SIZE;		/* Read in more data. */		YY_INPUT( (&Int_yy_current_buffer->Int_yy_ch_buf[number_to_move]),			Int_yy_n_chars, num_to_read );		Int_yy_current_buffer->Int_yy_n_chars = Int_yy_n_chars;		}	if ( Int_yy_n_chars == 0 )		{		if ( number_to_move == YY_MORE_ADJ )			{			ret_val = EOB_ACT_END_OF_FILE;			Int_yyrestart( Int_yyin );			}		else			{			ret_val = EOB_ACT_LAST_MATCH;			Int_yy_current_buffer->Int_yy_buffer_status =				YY_BUFFER_EOF_PENDING;			}		}	else		ret_val = EOB_ACT_CONTINUE_SCAN;	Int_yy_n_chars += number_to_move;	Int_yy_current_buffer->Int_yy_ch_buf[Int_yy_n_chars] = YY_END_OF_BUFFER_CHAR;	Int_yy_current_buffer->Int_yy_ch_buf[Int_yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;	Int_yytext_ptr = &Int_yy_current_buffer->Int_yy_ch_buf[0];	return ret_val;	}/* Int_yy_get_previous_state - get the state just before the EOB char was reached */static Int_yy_state_type Int_yy_get_previous_state()	{	register Int_yy_state_type Int_yy_current_state;	register char *Int_yy_cp;	Int_yy_current_state = Int_yy_start;	Int_yy_current_state += YY_AT_BOL();	for ( Int_yy_cp = Int_yytext_ptr + YY_MORE_ADJ; Int_yy_cp < Int_yy_c_buf_p; ++Int_yy_cp )		{		register YY_CHAR Int_yy_c = (*Int_yy_cp ? Int_yy_ec[YY_SC_TO_UI(*Int_yy_cp)] : 1);		if ( Int_yy_accept[Int_yy_current_state] )			{			Int_yy_last_accepting_state = Int_yy_current_state;			Int_yy_last_accepting_cpos = Int_yy_cp;			}		while ( Int_yy_chk[Int_yy_base[Int_yy_current_state] + Int_yy_c] != Int_yy_current_state )			{			Int_yy_current_state = (int) Int_yy_def[Int_yy_current_state];			if ( Int_yy_current_state >= 147 )				Int_yy_c = Int_yy_meta[(unsigned int) Int_yy_c];			}		Int_yy_current_state = Int_yy_nxt[Int_yy_base[Int_yy_current_state] + (unsigned int) Int_yy_c];		}	return Int_yy_current_state;	}/* Int_yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis *	next_state = Int_yy_try_NUL_trans( current_state ); */#ifdef YY_USE_PROTOSstatic Int_yy_state_type Int_yy_try_NUL_trans( Int_yy_state_type Int_yy_current_state )#elsestatic Int_yy_state_type Int_yy_try_NUL_trans( Int_yy_current_state )Int_yy_state_type Int_yy_current_state;#endif	{	register int Int_yy_is_jam;	register char *Int_yy_cp = Int_yy_c_buf_p;	register YY_CHAR Int_yy_c = 1;	if ( Int_yy_accept[Int_yy_current_state] )		{		Int_yy_last_accepting_state = Int_yy_current_state;		Int_yy_last_accepting_cpos = Int_yy_cp;		}	while ( Int_yy_chk[Int_yy_base[Int_yy_current_state] + Int_yy_c] != Int_yy_current_state )		{		Int_yy_current_state = (int) Int_yy_def[Int_yy_current_state];		if ( Int_yy_current_state >= 147 )			Int_yy_c = Int_yy_meta[(unsigned int) Int_yy_c];		}	Int_yy_current_state = Int_yy_nxt[Int_yy_base[Int_yy_current_state] + (unsigned int) Int_yy_c];	Int_yy_is_jam = (Int_yy_current_state == 146);	return Int_yy_is_jam ? 0 : Int_yy_current_state;	}#ifndef YY_NO_UNPUT#ifdef YY_USE_PROTOSstatic void Int_yyunput( int c, register char *Int_yy_bp )#elsestatic void Int_yyunput( c, Int_yy_bp )int c;register char *Int_yy_bp;#endif	{	register char *Int_yy_cp = Int_yy_c_buf_p;	/* undo effects of setting up Int_yytext */	*Int_yy_cp = Int_yy_hold_char;	if ( Int_yy_cp < Int_yy_current_buffer->Int_yy_ch_buf + 2 )		{ /* need to shift things up to make room */		/* +2 for EOB chars. */		register int number_to_move = Int_yy_n_chars + 2;		register char *dest = &Int_yy_current_buffer->Int_yy_ch_buf[					Int_yy_current_buffer->Int_yy_buf_size + 2];		register char *source =				&Int_yy_current_buffer->Int_yy_ch_buf[number_to_move];		while ( source > Int_yy_current_buffer->Int_yy_ch_buf )			*--dest = *--source;		Int_yy_cp += (int) (dest - source);		Int_yy_bp += (int) (dest - source);		Int_yy_current_buffer->Int_yy_n_chars =			Int_yy_n_chars = Int_yy_current_buffer->Int_yy_buf_size;		if ( Int_yy_cp < Int_yy_current_buffer->Int_yy_ch_buf + 2 )			YY_FATAL_ERROR( "flex scanner push-back overflow" );		}	*--Int_yy_cp = (char) c;	Int_yytext_ptr = Int_yy_bp;	Int_yy_hold_char = *Int_yy_cp;	Int_yy_c_buf_p = Int_yy_cp;	}#endif	/* ifndef YY_NO_UNPUT */#ifdef __cplusplusstatic int Int_yyinput()#elsestatic int input()#endif	{	int c;	*Int_yy_c_buf_p = Int_yy_hold_char;	if ( *Int_yy_c_buf_p == YY_END_OF_BUFFER_CHAR )		{		/* Int_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 ( Int_yy_c_buf_p < &Int_yy_current_buffer->Int_yy_ch_buf[Int_yy_n_chars] )			/* This was really a NUL. */			*Int_yy_c_buf_p = '\0';		else			{ /* need more input */			int offset = Int_yy_c_buf_p - Int_yytext_ptr;			++Int_yy_c_buf_p;			switch ( Int_yy_get_next_buffer() )				{				case EOB_ACT_LAST_MATCH:					/* This happens because Int_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. */					Int_yyrestart( Int_yyin );					/* fall through */				case EOB_ACT_END_OF_FILE:					{

⌨️ 快捷键说明

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