Index: trunk/ab5.0/abdev/BasicCompiler_Common/src/Delegate.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/src/Delegate.cpp	(revision 570)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/src/Delegate.cpp	(revision 571)
@@ -9,5 +9,7 @@
 
 	// パラメータを解析
-	ActiveBasic::Compiler::LexicalAnalyzer::AnalyzeParameter( params, paramStr.c_str(), sourceIndex );
+	Jenga::Common::Strings parameterStrings;
+	SplitParameter( paramStr, parameterStrings );
+	ActiveBasic::Compiler::LexicalAnalyzer::AnalyzeParameter( params, parameterStrings, sourceIndex );
 
 	// 動的パラメータを作る
Index: trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Procedure.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Procedure.cpp	(revision 570)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Procedure.cpp	(revision 571)
@@ -3,5 +3,5 @@
 using namespace ActiveBasic::Compiler;
 
-bool LexicalAnalyzer::AnalyzeParameter( Parameters &params, const char *sourceOfParams, int nowLine )
+bool LexicalAnalyzer::AnalyzeParameter( Parameters &params, const Jenga::Common::Strings &parameterStrings, int nowLine )
 {
 	int i2,i3,sw;
@@ -9,7 +9,9 @@
 
 	//パラメータ
-	int i = 0;
-	while(1){
-		if( sourceOfParams[i] == '\0' )
+	BOOST_FOREACH( const std::string &paramStr, parameterStrings )
+	{
+		int i = 0;
+
+		if( paramStr[i] == '\0' )
 		{
 			break;
@@ -18,9 +20,9 @@
 		//ByRef
 		bool isRef;
-		if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYVAL){
+		if(paramStr[i]==1&&paramStr[i+1]==ESC_BYVAL){
 			isRef = false;
 			i+=2;
 		}
-		else if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYREF){
+		else if(paramStr[i]==1&&paramStr[i+1]==ESC_BYREF){
 			isRef = true;
 			i+=2;
@@ -34,25 +36,25 @@
 		sw=0;
 		for(i2=0;;i++,i2++){
-			if(sourceOfParams[i]=='('){
+			if(paramStr[i]=='('){
 				if(!sw) sw=1;
 
-				i3=GetStringInPare(name+i2,sourceOfParams+i);
+				i3=GetStringInPare(name+i2,paramStr.c_str()+i);
 				i2+=i3-1;
 				i+=i3-1;
 				continue;
 			}
-			if(sourceOfParams[i]=='['){
+			if(paramStr[i]=='['){
 				if(!sw) sw=1;
 
-				i3=GetStringInBracket(name+i2,sourceOfParams+i);
+				i3=GetStringInBracket(name+i2,paramStr.c_str()+i);
 				i2+=i3-1;
 				i+=i3-1;
 				continue;
 			}
-			if(!IsVariableChar(sourceOfParams[i])){
+			if(!IsVariableChar(paramStr[i])){
 				name[i2]=0;
 				break;
 			}
-			name[i2]=sourceOfParams[i];
+			name[i2]=paramStr[i];
 		}
 		if(sw){
@@ -81,7 +83,7 @@
 		Type type( DEF_NON );
 		char initValue[8192] = "";
-		if( sourceOfParams[i] == '=' ){
+		if( paramStr[i] == '=' ){
 			i++;
-			i = GetOneParameter( sourceOfParams, i, initValue );
+			i = GetOneParameter( paramStr.c_str(), i, initValue );
 
 			// TODO: エラー用 fix me!!!
@@ -95,19 +97,19 @@
 			}
 		}
-		else if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_AS){
+		else if(paramStr[i]==1&&paramStr[i+1]==ESC_AS){
 			// As指定
 			i+=2;
 
 			i2=0;
-			while(sourceOfParams[i]=='*'){
-				temporary[i2]=sourceOfParams[i];
+			while(paramStr[i]=='*'){
+				temporary[i2]=paramStr[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];
+				if(!IsVariableChar(paramStr[i])){
+					if(paramStr[i]==1&&(paramStr[i+1]==ESC_FUNCTION||paramStr[i+1]==ESC_SUB)){
+						temporary[i2++]=paramStr[i++];
+						temporary[i2]=paramStr[i];
 						continue;
 					}
@@ -115,5 +117,5 @@
 					break;
 				}
-				temporary[i2]=sourceOfParams[i];
+				temporary[i2]=paramStr[i];
 			}
 
@@ -144,18 +146,4 @@
 		//パラメータを追加
 		params.push_back( pParam );
-
-		if( sourceOfParams[i] == ',' )
-		{
-			i++;
-			continue;
-		}
-		else if( sourceOfParams[i] == '\0' )
-		{
-			break;
-		}
-		else{
-			compiler.errorMessenger.Output(1,NULL,nowLine);
-			break;
-		}
 	}
 
Index: trunk/ab5.0/abdev/BasicCompiler_Common/src/Procedure.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/src/Procedure.cpp	(revision 570)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/src/Procedure.cpp	(revision 571)
@@ -98,6 +98,4 @@
 bool UserProc::SetParamsAndReturnType( const char *sourceOfParams, int nowLine, bool isStatic ){
 	int i = 0;
-	int i2,i3,sw;
-	char temporary[8192],temp2[VN_SIZE];
 
 	//ソースコードの位置
@@ -146,272 +144,15 @@
 	}
 
-	// パラメータを分割
 	Jenga::Common::Strings parameters;
+
+	// パラメータ
 	SplitParameter( parametersStr1, parameters );
-	BOOST_FOREACH( const std::string &paramStr, parameters )
-	{
-		int i = 0;
-
-		bool isRef = false;
-		if( paramStr[i] == 1 )
-		{
-			if( paramStr[i+1] == ESC_BYVAL )
-			{
-				isRef = false;
-				i += 2;
-			}
-			else if( paramStr[i+1] == ESC_BYREF )
-			{
-				isRef = true;
-				i += 2;
-			}
-		}
-
-		//パラメータ名
-		bool isArray = false;
-		Subscripts subscripts;
-		char name[VN_SIZE];
-		sw=0;
-		for(i2=0;;i++,i2++){
-			if(paramStr[i]=='('){
-				if(!sw) sw=1;
-
-				i3=GetStringInPare(name+i2,paramStr.c_str()+i);
-				i2+=i3-1;
-				i+=i3-1;
-				continue;
-			}
-			if(paramStr[i]=='['){
-				if(!sw) sw=1;
-
-				i3=GetStringInBracket(name+i2,paramStr.c_str()+i);
-				i2+=i3-1;
-				i+=i3-1;
-				continue;
-			}
-			if(!IsVariableChar(paramStr[i])){
-				name[i2]=0;
-				break;
-			}
-			name[i2]=paramStr[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 );
-		char initValue[8192] = "";
-		if( paramStr[i] == '=' ){
-			i++;
-			i = GetOneParameter( paramStr.c_str(), i, initValue );
-			if( paramStr[i-1] == ',' )
-			{
-				i--;
-			}
-
-			// TODO: エラー用 fix me!!!
-			//cp = nowLine;
-
-			NumOpe_GetType( initValue, GetStringTypeInfo(), type );
-			
-			if( IS_LITERAL(type.GetIndex()) )
-			{
-				type.SetIndex( -1 );
-			}
-		}
-		else if(paramStr[i]==1&&paramStr[i+1]==ESC_AS){
-			// As指定
-			i+=2;
-
-			i2=0;
-			lstrcpy( temporary, paramStr.c_str() + i );
-
-			compiler.StringToType( temporary, type );
-
-			if( type.IsNull() ){
-				compiler.errorMessenger.Output(3,temporary,nowLine);
-				type.SetBasicType( DEF_PTR_VOID );
-			}
-
-			if( type.IsObject() ){
-				if( type.GetClass().IsBlittableType() ){
-					// Blittable型のときは基本型として扱う
-					type = type.GetClass().GetBlittableType();
-				}
-			}
-		}
-		else{
-			type.SetBasicType( Type::GetBasicTypeFromSimpleName(name) );
-			compiler.errorMessenger.Output(-103,name,nowLine);
-		}
-
-		Parameter *pParam = new Parameter( name, type, isRef, initValue );
-		if( isArray ){
-			pParam->SetArray( subscripts );
-		}
-
-		//パラメータを追加
-		this->params.push_back( pParam );
-	}
-
+	ActiveBasic::Compiler::LexicalAnalyzer::AnalyzeParameter( params, parameters, nowLine );
+
+	// 省略可能パラメータ（古い仕様。非推奨）
 	this->secondParmNum = (int)this->params.size();
-
 	SplitParameter( parametersStr2, parameters );
-	BOOST_FOREACH( const std::string &paramStr, parameters )
-	{
-		int i = 0;
-
-		bool isRef = false;
-		if( paramStr[i] == 1 )
-		{
-			if( paramStr[i+1] == ESC_BYVAL )
-			{
-				isRef = true;
-				i += 2;
-			}
-			else if( paramStr[i+1] == ESC_BYREF )
-			{
-				isRef = false;
-				i += 2;
-			}
-		}
-
-		//パラメータ名
-		bool isArray = false;
-		Subscripts subscripts;
-		char name[VN_SIZE];
-		sw=0;
-		for(i2=0;;i++,i2++){
-			if(paramStr[i]=='('){
-				if(!sw) sw=1;
-
-				i3=GetStringInPare(name+i2,paramStr.c_str()+i);
-				i2+=i3-1;
-				i+=i3-1;
-				continue;
-			}
-			if(paramStr[i]=='['){
-				if(!sw) sw=1;
-
-				i3=GetStringInBracket(name+i2,paramStr.c_str()+i);
-				i2+=i3-1;
-				i+=i3-1;
-				continue;
-			}
-			if(!IsVariableChar(paramStr[i])){
-				name[i2]=0;
-				break;
-			}
-			name[i2]=paramStr[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 );
-		char initValue[8192] = "";
-		if( paramStr[i] == '=' ){
-			i++;
-			i = GetOneParameter( paramStr.c_str(), i, initValue );
-			if( paramStr[i-1] == ',' )
-			{
-				i--;
-			}
-
-			// TODO: エラー用 fix me!!!
-			//cp = nowLine;
-
-			NumOpe_GetType( initValue, GetStringTypeInfo(), type );
-			
-			if( IS_LITERAL(type.GetIndex()) )
-			{
-				type.SetIndex( -1 );
-			}
-		}
-		else if(paramStr[i]==1&&paramStr[i+1]==ESC_AS){
-			// As指定
-			i+=2;
-
-			i2=0;
-			while(paramStr[i]=='*'){
-				temporary[i2]=paramStr[i];
-				i++;
-				i2++;
-			}
-			for(;;i++,i2++){
-				if(!IsVariableChar(paramStr[i])){
-					if(paramStr[i]==1&&(paramStr[i+1]==ESC_FUNCTION||paramStr[i+1]==ESC_SUB)){
-						temporary[i2++]=paramStr[i++];
-						temporary[i2]=paramStr[i];
-						continue;
-					}
-					temporary[i2]=0;
-					break;
-				}
-				temporary[i2]=paramStr[i];
-			}
-
-			compiler.StringToType( temporary, type );
-
-			if( type.IsNull() ){
-				compiler.errorMessenger.Output(3,temporary,nowLine);
-				type.SetBasicType( DEF_PTR_VOID );
-			}
-
-			if( type.IsObject() ){
-				if( type.GetClass().IsBlittableType() ){
-					// Blittable型のときは基本型として扱う
-					type = type.GetClass().GetBlittableType();
-				}
-			}
-		}
-		else{
-			type.SetBasicType( Type::GetBasicTypeFromSimpleName(temporary) );
-			compiler.errorMessenger.Output(-103,temporary,nowLine);
-		}
-
-		Parameter *pParam = new Parameter( name, type, isRef, initValue );
-		if( isArray ){
-			pParam->SetArray( subscripts );
-		}
-
-		//パラメータを追加
-		this->params.push_back( pParam );
-	}
+	ActiveBasic::Compiler::LexicalAnalyzer::AnalyzeParameter( params, parameters, nowLine );
+
 
 	if(returnTypeStr[0]){
