Index: trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Procedure.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Procedure.cpp	(revision 572)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Procedure.cpp	(revision 573)
@@ -275,4 +275,196 @@
 	BOOST_FOREACH( Parameter *pParam, userProc.GetParameters() ){
 		userProc.RealParams().push_back( new Parameter( *pParam ) );
+	}
+
+	return true;
+}
+
+bool LexicalAnalyzer::SetParamsAndReturnType( Procedure *pProc, const char *sourceOfParams, bool isSupportEllipse, int nowLine ){
+	int i = 0;
+	int i2,i3,sw;
+	char temporary[8192],temp2[VN_SIZE];
+
+	//ソースコードの位置
+	pProc->SetCodePos( nowLine );
+
+	//パラメータ
+	if(sourceOfParams[i]!='('){
+		compiler.errorMessenger.Output(1,NULL,nowLine);
+		return 0;
+	}
+	i++;
+	while(1){
+		if(sourceOfParams[i]==')') break;
+
+		//ByRef
+		bool isRef;
+		if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYVAL){
+			isRef = false;
+			i+=2;
+		}
+		else if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYREF){
+			isRef = true;
+			i+=2;
+		}
+		else isRef = false;
+
+		//パラメータ名
+		bool isArray = false;
+		Subscripts subscripts;
+		char name[VN_SIZE];
+		sw=0;
+		for(i2=0;;i++,i2++){
+			if(sourceOfParams[i]=='('){
+				if(!sw) sw=1;
+
+				i3=GetStringInPare(name+i2,sourceOfParams+i);
+				i2+=i3-1;
+				i+=i3-1;
+				continue;
+			}
+			if(sourceOfParams[i]=='['){
+				if(!sw) sw=1;
+
+				i3=GetStringInBracket(name+i2,sourceOfParams+i);
+				i2+=i3-1;
+				i+=i3-1;
+				continue;
+			}
+			if(!IsVariableChar(sourceOfParams[i])){
+				name[i2]=0;
+				break;
+			}
+			name[i2]=sourceOfParams[i];
+		}
+		if(sw){
+			//配列パラメータ
+			if( isRef == false ) compiler.errorMessenger.Output(29,NULL,nowLine);
+			isArray = true;
+
+			if((name[i2-2]=='('&&name[i2-1]==')')||
+				(name[i2-2]=='['&&name[i2-1]==']'))
+			{
+				subscripts.push_back( LONG_MAX );
+
+				name[i2-2]=0;
+			}
+			else{
+				GetArrange(name,temp2,subscripts);
+				lstrcpy(name,temp2);
+			}
+
+			i2=lstrlen(name);
+		}
+
+		//型
+		Type type( DEF_NON );
+		if( isSupportEllipse && lstrcmp(name,"...")==0 )
+		{
+			type.SetBasicType( DEF_ELLIPSE );
+		}
+		else if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_AS)
+		{
+			i+=2;
+
+			i2=0;
+			while(sourceOfParams[i]=='*'){
+				temporary[i2]=sourceOfParams[i];
+				i++;
+				i2++;
+			}
+			for(;;i++,i2++){
+				if(!IsVariableChar(sourceOfParams[i])){
+					if(sourceOfParams[i]==1&&(sourceOfParams[i+1]==ESC_FUNCTION||sourceOfParams[i+1]==ESC_SUB)){
+						temporary[i2++]=sourceOfParams[i++];
+						temporary[i2]=sourceOfParams[i];
+						continue;
+					}
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=sourceOfParams[i];
+			}
+
+			compiler.StringToType( temporary, type );
+
+			if( type.IsNull() ){
+				compiler.errorMessenger.Output(3,temporary,nowLine);
+				type.SetBasicType( DEF_PTR_VOID );
+			}
+		}
+		else{
+			type.SetBasicType( Type::GetBasicTypeFromSimpleName(temporary) );
+			compiler.errorMessenger.Output(-103,temporary,nowLine);
+		}
+
+		Parameter *pParam = new Parameter( name, type, isRef );
+		if( isArray ){
+			pParam->SetArray( subscripts );
+		}
+
+		//パラメータを追加
+		pProc->GetParameters().push_back( pParam );
+
+		if(sourceOfParams[i]==','){
+			i++;
+			continue;
+		}
+		else if(sourceOfParams[i]==')') continue;
+		else{
+			compiler.errorMessenger.Output(1,NULL,nowLine);
+			break;
+		}
+	}
+	i++;
+
+	if(sourceOfParams[i]){
+		///////////////////
+		// 戻り値を取得
+		///////////////////
+
+		i2=lstrlen(sourceOfParams)-2;
+
+		int sw_as=0;
+		for(;i2>0;i2--){
+			if(sourceOfParams[i2]==')') break;
+
+			if(sourceOfParams[i2]==1&&sourceOfParams[i2+1]==ESC_AS){
+				i2+=2;
+				i3=0;
+				while(sourceOfParams[i2]=='*') temporary[i3++]=sourceOfParams[i2++];
+				for(;;i2++,i3++){
+					if(!IsVariableChar(sourceOfParams[i2])){
+						temporary[i3]=0;
+						break;
+					}
+					temporary[i3]=sourceOfParams[i2];
+				}
+				compiler.StringToType( temporary, pProc->ReturnType() );
+				if( pProc->ReturnType().IsNull() ) compiler.errorMessenger.Output(3,temporary,nowLine);
+
+				sw_as=1;
+				break;
+			}
+		}
+	}
+	else{
+		//戻り値なしのSub定義
+		pProc->ReturnType().SetNull();
+	}
+
+	//戻り値のエラーチェック
+	if( pProc->IsFunction() ){
+		// Function定義
+
+		if( pProc->ReturnType().IsNull() ){
+			// 戻り値がない
+			compiler.errorMessenger.Output(26,pProc->GetName(),nowLine);
+		}
+	}
+	else{
+		if( !pProc->ReturnType().IsNull() ){
+			// Sub定義なのに、戻り値がある
+			compiler.errorMessenger.Output(38,pProc->GetName(),nowLine);
+		}
 	}
 
@@ -549,5 +741,5 @@
 	// パラメータを解析
 	// ※第1パラメータにに指定するデータの例："( s As String ) As String"
-	pDllProc->SetParamsAndReturnType( buffer + i, nowLine );
+	LexicalAnalyzer::SetParamsAndReturnType( pDllProc, buffer + i, true, nowLine );
 
 	// パラメータのエラーチェック
Index: trunk/ab5.0/abdev/BasicCompiler_Common/src/Procedure.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/src/Procedure.cpp	(revision 572)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/src/Procedure.cpp	(revision 573)
@@ -134,364 +134,4 @@
 }
 
-bool DllProc::SetParamsAndReturnType( const char *sourceOfParams, int nowLine ){
-	int i = 0;
-	int i2,i3,sw;
-	char temporary[8192],temp2[VN_SIZE];
-
-	//ソースコードの位置
-	this->codePos = nowLine;
-
-	//パラメータ
-	if(sourceOfParams[i]!='('){
-		compiler.errorMessenger.Output(1,NULL,nowLine);
-		return 0;
-	}
-	i++;
-
-	while(1){
-		if(sourceOfParams[i]==')') break;
-
-		//ByRef
-		bool isRef;
-		if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYVAL){
-			isRef = false;
-			i+=2;
-		}
-		else if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYREF){
-			isRef = true;
-			i+=2;
-		}
-		else isRef = false;
-
-		//パラメータ名
-		bool isArray = false;
-		Subscripts subscripts;
-		char name[VN_SIZE];
-		sw=0;
-		for(i2=0;;i++,i2++){
-			if(sourceOfParams[i]=='('){
-				if(!sw) sw=1;
-
-				i3=GetStringInPare(name+i2,sourceOfParams+i);
-				i2+=i3-1;
-				i+=i3-1;
-				continue;
-			}
-			if(sourceOfParams[i]=='['){
-				if(!sw) sw=1;
-
-				i3=GetStringInBracket(name+i2,sourceOfParams+i);
-				i2+=i3-1;
-				i+=i3-1;
-				continue;
-			}
-			if(!IsVariableChar(sourceOfParams[i])){
-				name[i2]=0;
-				break;
-			}
-			name[i2]=sourceOfParams[i];
-		}
-		if(sw){
-			//配列パラメータ
-			if( isRef == false ) compiler.errorMessenger.Output(29,NULL,nowLine);
-			isArray = true;
-
-			if((name[i2-2]=='('&&name[i2-1]==')')||
-				(name[i2-2]=='['&&name[i2-1]==']'))
-			{
-				subscripts.push_back( LONG_MAX );
-
-				name[i2-2]=0;
-			}
-			else{
-				GetArrange(name,temp2,subscripts);
-				lstrcpy(name,temp2);
-			}
-
-			i2=lstrlen(name);
-		}
-
-		//型
-		Type type( DEF_NON );
-		if(lstrcmp(name,"...")==0) type.SetBasicType( DEF_ELLIPSE );
-		else if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_AS){
-			i+=2;
-
-			i2=0;
-			while(sourceOfParams[i]=='*'){
-				temporary[i2]=sourceOfParams[i];
-				i++;
-				i2++;
-			}
-			for(;;i++,i2++){
-				if(!IsVariableChar(sourceOfParams[i])){
-					if(sourceOfParams[i]==1&&(sourceOfParams[i+1]==ESC_FUNCTION||sourceOfParams[i+1]==ESC_SUB)){
-						temporary[i2++]=sourceOfParams[i++];
-						temporary[i2]=sourceOfParams[i];
-						continue;
-					}
-					temporary[i2]=0;
-					break;
-				}
-				temporary[i2]=sourceOfParams[i];
-			}
-
-			compiler.StringToType( temporary, type );
-
-			if( type.IsNull() ){
-				compiler.errorMessenger.Output(3,temporary,nowLine);
-				type.SetBasicType( DEF_PTR_VOID );
-			}
-		}
-		else{
-			type.SetBasicType( Type::GetBasicTypeFromSimpleName(temporary) );
-			compiler.errorMessenger.Output(-103,temporary,nowLine);
-		}
-
-		Parameter *pParam = new Parameter( name, type, isRef );
-		if( isArray ){
-			pParam->SetArray( subscripts );
-		}
-
-		//パラメータを追加
-		this->GetParameters().push_back( pParam );
-
-		if(sourceOfParams[i]==','){
-			i++;
-			continue;
-		}
-		else if(sourceOfParams[i]==')') continue;
-		else{
-			compiler.errorMessenger.Output(1,NULL,nowLine);
-			break;
-		}
-	}
-	i++;
-
-	if(sourceOfParams[i]){
-		///////////////////
-		// 戻り値を取得
-		///////////////////
-
-		i2=lstrlen(sourceOfParams)-2;
-
-		int sw_as=0;
-		for(;i2>0;i2--){
-			if(sourceOfParams[i2]==')') break;
-
-			if(sourceOfParams[i2]==1&&sourceOfParams[i2+1]==ESC_AS){
-				i2+=2;
-				i3=0;
-				while(sourceOfParams[i2]=='*') temporary[i3++]=sourceOfParams[i2++];
-				for(;;i2++,i3++){
-					if(!IsVariableChar(sourceOfParams[i2])){
-						temporary[i3]=0;
-						break;
-					}
-					temporary[i3]=sourceOfParams[i2];
-				}
-				compiler.StringToType( temporary, this->returnType );
-				if( this->returnType.IsNull() ) compiler.errorMessenger.Output(3,temporary,nowLine);
-
-				sw_as=1;
-				break;
-			}
-		}
-	}
-	else{
-		//戻り値なしのSub定義
-		this->returnType.SetNull();
-	}
-
-	return true;
-}
-
-bool ProcPointer::SetParamsAndReturnType( const char *sourceOfParams, int nowLine ){
-	int i = 0;
-	int i2,i3,sw;
-	char temporary[8192],temp2[VN_SIZE];
-
-	//ソースコードの位置
-	this->codePos = nowLine;
-
-	//パラメータ
-	if(sourceOfParams[i]!='('){
-		compiler.errorMessenger.Output(1,NULL,nowLine);
-		return 0;
-	}
-	i++;
-	while(1){
-		if(sourceOfParams[i]==')') break;
-
-		//ByRef
-		bool isRef;
-		if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYVAL){
-			isRef = false;
-			i+=2;
-		}
-		else if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYREF){
-			isRef = true;
-			i+=2;
-		}
-		else isRef = false;
-
-		//パラメータ名
-		bool isArray = false;
-		Subscripts subscripts;
-		char name[VN_SIZE];
-		sw=0;
-		for(i2=0;;i++,i2++){
-			if(sourceOfParams[i]=='('){
-				if(!sw) sw=1;
-
-				i3=GetStringInPare(name+i2,sourceOfParams+i);
-				i2+=i3-1;
-				i+=i3-1;
-				continue;
-			}
-			if(sourceOfParams[i]=='['){
-				if(!sw) sw=1;
-
-				i3=GetStringInBracket(name+i2,sourceOfParams+i);
-				i2+=i3-1;
-				i+=i3-1;
-				continue;
-			}
-			if(!IsVariableChar(sourceOfParams[i])){
-				name[i2]=0;
-				break;
-			}
-			name[i2]=sourceOfParams[i];
-		}
-		if(sw){
-			//配列パラメータ
-			if( isRef == false ) compiler.errorMessenger.Output(29,NULL,nowLine);
-			isArray = true;
-
-			if((name[i2-2]=='('&&name[i2-1]==')')||
-				(name[i2-2]=='['&&name[i2-1]==']'))
-			{
-				subscripts.push_back( LONG_MAX );
-
-				name[i2-2]=0;
-			}
-			else{
-				GetArrange(name,temp2,subscripts);
-				lstrcpy(name,temp2);
-			}
-
-			i2=lstrlen(name);
-		}
-
-		//型
-		Type type( DEF_NON );
-		if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_AS){
-			i+=2;
-
-			i2=0;
-			while(sourceOfParams[i]=='*'){
-				temporary[i2]=sourceOfParams[i];
-				i++;
-				i2++;
-			}
-			for(;;i++,i2++){
-				if(!IsVariableChar(sourceOfParams[i])){
-					if(sourceOfParams[i]==1&&(sourceOfParams[i+1]==ESC_FUNCTION||sourceOfParams[i+1]==ESC_SUB)){
-						temporary[i2++]=sourceOfParams[i++];
-						temporary[i2]=sourceOfParams[i];
-						continue;
-					}
-					temporary[i2]=0;
-					break;
-				}
-				temporary[i2]=sourceOfParams[i];
-			}
-
-			compiler.StringToType( temporary, type );
-
-			if( type.IsNull() ){
-				compiler.errorMessenger.Output(3,temporary,nowLine);
-				type.SetBasicType( DEF_PTR_VOID );
-			}
-		}
-		else{
-			type.SetBasicType( Type::GetBasicTypeFromSimpleName(temporary) );
-			compiler.errorMessenger.Output(-103,temporary,nowLine);
-		}
-
-		Parameter *pParam = new Parameter( name, type, isRef );
-		if( isArray ){
-			pParam->SetArray( subscripts );
-		}
-
-		//パラメータを追加
-		this->GetParameters().push_back( pParam );
-
-		if(sourceOfParams[i]==','){
-			i++;
-			continue;
-		}
-		else if(sourceOfParams[i]==')') continue;
-		else{
-			compiler.errorMessenger.Output(1,NULL,nowLine);
-			break;
-		}
-	}
-	i++;
-
-	if(sourceOfParams[i]){
-		///////////////////
-		// 戻り値を取得
-		///////////////////
-
-		i2=lstrlen(sourceOfParams)-2;
-
-		int sw_as=0;
-		for(;i2>0;i2--){
-			if(sourceOfParams[i2]==')') break;
-
-			if(sourceOfParams[i2]==1&&sourceOfParams[i2+1]==ESC_AS){
-				i2+=2;
-				i3=0;
-				while(sourceOfParams[i2]=='*') temporary[i3++]=sourceOfParams[i2++];
-				for(;;i2++,i3++){
-					if(!IsVariableChar(sourceOfParams[i2])){
-						temporary[i3]=0;
-						break;
-					}
-					temporary[i3]=sourceOfParams[i2];
-				}
-				compiler.StringToType( temporary, this->returnType );
-				if( this->returnType.IsNull() ) compiler.errorMessenger.Output(3,temporary,nowLine);
-
-				sw_as=1;
-				break;
-			}
-		}
-	}
-	else{
-		//戻り値なしのSub定義
-		this->returnType.SetNull();
-	}
-
-	//戻り値のエラーチェック
-	if( IsFunction() ){
-		// Function定義
-
-		if( this->ReturnType().IsNull() ){
-			// 戻り値がない
-			compiler.errorMessenger.Output(26,this->GetName(),nowLine);
-		}
-	}
-	else{
-		if( !this->ReturnType().IsNull() ){
-			// Sub定義なのに、戻り値がある
-			compiler.errorMessenger.Output(38,this->GetName(),nowLine);
-		}
-	}
-
-	return true;
-}
-
 int ProcPointers::Add( const std::string &typeExpression )
 {
@@ -508,5 +148,5 @@
 	//buffer[0]は'('となっている
 	extern int cp;
-	pProcPointer->SetParamsAndReturnType( paramStr.c_str(), cp );
+	LexicalAnalyzer::SetParamsAndReturnType( pProcPointer, paramStr.c_str(), false, cp );
 
 	this->push_back( pProcPointer );
