Index: trunk/ab5.0/abdev/BasicCompiler_Common/include/Class.h
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/include/Class.h	(revision 564)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/include/Class.h	(revision 565)
@@ -497,9 +497,4 @@
 	CClass *Add( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine);
 
-	virtual void InitStaticMember();
-
-	virtual void Compile_System_InitializeUserTypes();
-	virtual void Compile_System_InitializeUserTypesForBaseType();
-
 	const CClass *Find( const NamespaceScopes &namespaceScopes, const std::string &name ) const;
 	const CClass *Find( const std::string &fullName ) const;
Index: trunk/ab5.0/abdev/BasicCompiler_Common/include/ProcedureGenerator.h
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/include/ProcedureGenerator.h	(revision 565)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/include/ProcedureGenerator.h	(revision 565)
@@ -0,0 +1,15 @@
+#pragma once
+
+namespace ActiveBasic{ namespace Compiler{
+
+
+class ProcedureGenerator
+{
+public:
+	static void Generate_InitStaticMember( const Classes &classes );
+	static void Generate_System_InitializeUserTypes( const Classes &classes );
+	static void Generate_System_InitializeUserTypesForBaseType( const Classes &classes );
+};
+
+
+}}
Index: trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp	(revision 564)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp	(revision 565)
@@ -648,190 +648,4 @@
 }
 
-
-void Classes::InitStaticMember(){
-	//静的メンバをグローバル領域に作成
-
-	//イテレータをリセット
-
-	extern int cp;
-	int back_cp=cp;
-
-	this->Iterator_Reset();
-	while(this->Iterator_HasNext()){
-		CClass &objClass = *this->Iterator_GetNext();
-		if( objClass.isTargetObjectModule == false )
-		{
-			// 静的リンクライブラリの場合は飛ばす（既にインスタンスが定義済みであるため）
-			continue;
-		}
-
-		// 名前空間をセット
-		compiler.GetNamespaceSupporter().GetLivingNamespaceScopes() = objClass.GetNamespaceScopes();
-
-		DWORD dwFlags = 0;
-		if( objClass.GetName() == "_System_TypeBase" )
-		{
-			// _System_TypeBaseクラスはグローバル、スタティック領域を初期化するためのクラスなのでここでの初期化は除外する
-			dwFlags |= DIMFLAG_NONCALL_CONSTRACTOR;
-		}
-
-		// コンパイル中クラスとしてセット
-		compiler.SetCompilingClass( &objClass );
-
-		const EnumInfo *pEnumInfo = NULL;
-		if( objClass.IsEnum() )
-		{
-			pEnumInfo = compiler.enumInfoCollection.Find( objClass );
-		}
-
-		int i=0;
-		BOOST_FOREACH( Member *member, objClass.GetStaticMembers() )
-		{
-			if( pEnumInfo )
-			{
-				cp = pEnumInfo->GetEnumMember( member->GetName() ).GetSourceIndex();
-			}
-
-			char temporary[VN_SIZE];
-			sprintf(temporary,"%s.%s",objClass.GetName().c_str(),member->GetName().c_str());
-			dim(
-				temporary,
-				member->GetSubscripts(),
-				member->GetType(),
-				member->GetInitializeExpression().c_str(),
-				member->GetConstructParameter().c_str(),
-				dwFlags);
-
-			i++;
-		}
-
-		compiler.SetCompilingClass( NULL );
-	}
-
-	compiler.GetNamespaceSupporter().GetLivingNamespaceScopes().clear();
-
-	cp=back_cp;
-}
-
-void Classes::Compile_System_InitializeUserTypes(){
-	char temporary[VN_SIZE];
-
-	////////////////////////////////////////////////////////////////////
-	// クラス登録
-	////////////////////////////////////////////////////////////////////
-
-	// イテレータをリセット
-	Iterator_Reset();
-
-	while( Iterator_HasNext() ){
-		const CClass &objClass = *Iterator_GetNext();
-
-		if( !objClass.IsUsing() ){
-			// 未使用のクラスは無視する
-			continue;
-		}
-
-		std::string referenceOffsetsBuffer;
-		int numOfReference = 0;
-		objClass.GetReferenceOffsetsInitializeBuffer( referenceOffsetsBuffer, numOfReference );
-
-		sprintf( temporary
-			, "Add(%c%c_System_TypeForClass[strNamespace=\"%s\",name=\"%s\",fullName=\"%s\",referenceOffsets=[%s],numOfReference=%d])"
-			, 1
-			, ESC_SYSTEM_STATIC_NEW
-			, objClass.GetNamespaceScopes().ToString().c_str()		// 名前空間
-			, objClass.GetName().c_str()							// クラス名
-			, objClass.GetFullName().c_str()						// フルネーム
-			, referenceOffsetsBuffer.c_str()						// 参照メンバオフセット配列
-			, numOfReference										// 参照メンバの個数
-			);
-
-		// コンパイル
-		ChangeOpcode( temporary );
-
-		objClass.SetTypeInfoDataTableOffset(
-			compiler.GetObjectModule().dataTable.GetLastMadeConstObjectDataTableOffset()
-		);
-	}
-}
-void Classes::Compile_System_InitializeUserTypesForBaseType()
-{
-	extern int cp;
-	cp = -1;
-	////////////////////////////////////////////////////////////////////
-	// 基底クラスを登録
-	////////////////////////////////////////////////////////////////////
-
-	char temporary[8192];
-	sprintf(temporary, "%c%ctempType=Nothing%c%c_System_TypeForClass"
-		, HIBYTE( COM_DIM )
-		, LOBYTE( COM_DIM )
-		, 1
-		, ESC_AS
-		);
-	ChangeOpcode( temporary );
-
-	// イテレータをリセット
-	Iterator_Reset();
-
-	while( Iterator_HasNext() ){
-		const CClass &objClass = *Iterator_GetNext();
-
-		if( !objClass.IsUsing() ){
-			// 未使用のクラスは無視する
-			continue;
-		}
-
-		if( objClass.HasSuperClass() || objClass.GetDynamicMembers().size() ){
-			sprintf( temporary
-				, "tempType=Search(\"%s\") As ActiveBasic.Core._System_TypeForClass"
-				, objClass.GetFullName().c_str()
-			);
-
-			// コンパイル
-			MakeMiddleCode( temporary );
-			ChangeOpcode( temporary );
-
-			sprintf( temporary
-				, "tempType.SetClassInfo(%d,_System_GetComVtbl(%s),_System_GetVtblList(%s),_System_GetDefaultConstructor(%s),_System_GetDestructor(%s))"
-				, objClass.GetSize()
-				, objClass.GetFullName().c_str()
-				, objClass.GetFullName().c_str()
-				, objClass.GetFullName().c_str()
-				, objClass.GetFullName().c_str()
-				, objClass.GetName().c_str()
-			);
-
-			// コンパイル
-			ChangeOpcode( temporary );
-
-			if( objClass.HasSuperClass() )
-			{
-				sprintf( temporary
-					, "tempType.SetBaseType(Search(\"%s\"))"
-					, objClass.GetSuperClass().GetFullName().c_str()
-				);
-
-				// コンパイル
-				ChangeOpcode( temporary );
-			}
-
-			if( objClass.GetDynamicMembers().size() )
-			{
-				// メンバの型を示すTypeInfoオブジェクトへのDataOffset配列の静的データ定義文字列を取得
-				sprintf(
-					temporary,
-					"tempType.SetMembers([%s],[%s],[%s],%d)",
-					objClass.GetStaticDefiningStringAsMemberNames().c_str(),
-					objClass.GetStaticDefiningStringAsMemberTypeInfoNames().c_str(),
-					objClass.GetStaticDefiningStringAsMemberOffsets().c_str(),
-					objClass.GetDynamicMembers().size()
-				);
-				ChangeOpcode( temporary );
-			}
-		}
-	}
-}
-
 const CClass *Classes::Find( const NamespaceScopes &namespaceScopes, const std::string &name ) const
 {
Index: trunk/ab5.0/abdev/BasicCompiler_Common/src/ProcedureGenerator.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/src/ProcedureGenerator.cpp	(revision 565)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/src/ProcedureGenerator.cpp	(revision 565)
@@ -0,0 +1,197 @@
+#include "stdafx.h"
+
+#ifdef _AMD64_
+#include "../../compiler_x64/opcode.h"
+#else
+#include "../../compiler_x86/opcode.h"
+#endif
+
+using namespace ActiveBasic::Compiler;
+
+void ProcedureGenerator::Generate_InitStaticMember( const Classes &classes )
+{
+	//静的メンバをグローバル領域に作成
+
+	//イテレータをリセット
+
+	extern int cp;
+	int back_cp=cp;
+
+	classes.Iterator_Reset();
+	while(classes.Iterator_HasNext()){
+		CClass &objClass = *classes.Iterator_GetNext();
+		if( objClass.isTargetObjectModule == false )
+		{
+			// 静的リンクライブラリの場合は飛ばす（既にインスタンスが定義済みであるため）
+			continue;
+		}
+
+		// 名前空間をセット
+		compiler.GetNamespaceSupporter().GetLivingNamespaceScopes() = objClass.GetNamespaceScopes();
+
+		DWORD dwFlags = 0;
+		if( objClass.GetName() == "_System_TypeBase" )
+		{
+			// _System_TypeBaseクラスはグローバル、スタティック領域を初期化するためのクラスなのでここでの初期化は除外する
+			dwFlags |= DIMFLAG_NONCALL_CONSTRACTOR;
+		}
+
+		// コンパイル中クラスとしてセット
+		compiler.SetCompilingClass( &objClass );
+
+		const EnumInfo *pEnumInfo = NULL;
+		if( objClass.IsEnum() )
+		{
+			pEnumInfo = compiler.enumInfoCollection.Find( objClass );
+		}
+
+		int i=0;
+		BOOST_FOREACH( Member *member, objClass.GetStaticMembers() )
+		{
+			if( pEnumInfo )
+			{
+				cp = pEnumInfo->GetEnumMember( member->GetName() ).GetSourceIndex();
+			}
+
+			char temporary[VN_SIZE];
+			sprintf(temporary,"%s.%s",objClass.GetName().c_str(),member->GetName().c_str());
+			dim(
+				temporary,
+				member->GetSubscripts(),
+				member->GetType(),
+				member->GetInitializeExpression().c_str(),
+				member->GetConstructParameter().c_str(),
+				dwFlags);
+
+			i++;
+		}
+
+		compiler.SetCompilingClass( NULL );
+	}
+
+	compiler.GetNamespaceSupporter().GetLivingNamespaceScopes().clear();
+
+	cp=back_cp;
+}
+
+void ProcedureGenerator::Generate_System_InitializeUserTypes( const Classes &classes )
+{
+	char temporary[VN_SIZE];
+
+	////////////////////////////////////////////////////////////////////
+	// クラス登録
+	////////////////////////////////////////////////////////////////////
+
+	// イテレータをリセット
+	classes.Iterator_Reset();
+
+	while( classes.Iterator_HasNext() ){
+		const CClass &objClass = *classes.Iterator_GetNext();
+
+		if( !objClass.IsUsing() ){
+			// 未使用のクラスは無視する
+			continue;
+		}
+
+		std::string referenceOffsetsBuffer;
+		int numOfReference = 0;
+		objClass.GetReferenceOffsetsInitializeBuffer( referenceOffsetsBuffer, numOfReference );
+
+		sprintf( temporary
+			, "Add(%c%c_System_TypeForClass[strNamespace=\"%s\",name=\"%s\",fullName=\"%s\",referenceOffsets=[%s],numOfReference=%d])"
+			, 1
+			, ESC_SYSTEM_STATIC_NEW
+			, objClass.GetNamespaceScopes().ToString().c_str()		// 名前空間
+			, objClass.GetName().c_str()							// クラス名
+			, objClass.GetFullName().c_str()						// フルネーム
+			, referenceOffsetsBuffer.c_str()						// 参照メンバオフセット配列
+			, numOfReference										// 参照メンバの個数
+			);
+
+		// コンパイル
+		ChangeOpcode( temporary );
+
+		objClass.SetTypeInfoDataTableOffset(
+			compiler.GetObjectModule().dataTable.GetLastMadeConstObjectDataTableOffset()
+		);
+	}
+}
+
+void ProcedureGenerator::Generate_System_InitializeUserTypesForBaseType( const Classes &classes )
+{
+	extern int cp;
+	cp = -1;
+	////////////////////////////////////////////////////////////////////
+	// 基底クラスを登録
+	////////////////////////////////////////////////////////////////////
+
+	char temporary[8192];
+	sprintf(temporary, "%c%ctempType=Nothing%c%c_System_TypeForClass"
+		, HIBYTE( COM_DIM )
+		, LOBYTE( COM_DIM )
+		, 1
+		, ESC_AS
+		);
+	ChangeOpcode( temporary );
+
+	// イテレータをリセット
+	classes.Iterator_Reset();
+
+	while( classes.Iterator_HasNext() ){
+		const CClass &objClass = *classes.Iterator_GetNext();
+
+		if( !objClass.IsUsing() ){
+			// 未使用のクラスは無視する
+			continue;
+		}
+
+		if( objClass.HasSuperClass() || objClass.GetDynamicMembers().size() ){
+			sprintf( temporary
+				, "tempType=Search(\"%s\") As ActiveBasic.Core._System_TypeForClass"
+				, objClass.GetFullName().c_str()
+			);
+
+			// コンパイル
+			MakeMiddleCode( temporary );
+			ChangeOpcode( temporary );
+
+			sprintf( temporary
+				, "tempType.SetClassInfo(%d,_System_GetComVtbl(%s),_System_GetVtblList(%s),_System_GetDefaultConstructor(%s),_System_GetDestructor(%s))"
+				, objClass.GetSize()
+				, objClass.GetFullName().c_str()
+				, objClass.GetFullName().c_str()
+				, objClass.GetFullName().c_str()
+				, objClass.GetFullName().c_str()
+				, objClass.GetName().c_str()
+			);
+
+			// コンパイル
+			ChangeOpcode( temporary );
+
+			if( objClass.HasSuperClass() )
+			{
+				sprintf( temporary
+					, "tempType.SetBaseType(Search(\"%s\"))"
+					, objClass.GetSuperClass().GetFullName().c_str()
+				);
+
+				// コンパイル
+				ChangeOpcode( temporary );
+			}
+
+			if( objClass.GetDynamicMembers().size() )
+			{
+				// メンバの型を示すTypeInfoオブジェクトへのDataOffset配列の静的データ定義文字列を取得
+				sprintf(
+					temporary,
+					"tempType.SetMembers([%s],[%s],[%s],%d)",
+					objClass.GetStaticDefiningStringAsMemberNames().c_str(),
+					objClass.GetStaticDefiningStringAsMemberTypeInfoNames().c_str(),
+					objClass.GetStaticDefiningStringAsMemberOffsets().c_str(),
+					objClass.GetDynamicMembers().size()
+				);
+				ChangeOpcode( temporary );
+			}
+		}
+	}
+}
Index: trunk/ab5.0/abdev/compiler_x86/Compile_ProcOp.cpp
===================================================================
--- trunk/ab5.0/abdev/compiler_x86/Compile_ProcOp.cpp	(revision 564)
+++ trunk/ab5.0/abdev/compiler_x86/Compile_ProcOp.cpp	(revision 565)
@@ -53,5 +53,7 @@
 
 		//クラスに属する静的メンバを定義
-		compiler.GetObjectModule().meta.GetClasses().InitStaticMember();
+		ActiveBasic::Compiler::ProcedureGenerator::Generate_InitStaticMember(
+			compiler.GetObjectModule().meta.GetClasses()
+		);
 
 		GetGlobalDataForDll();
@@ -202,7 +204,9 @@
 	if( userProc.GetName() == "InitializeUserTypes"
 		&& userProc.HasParentClass()
-		&& userProc.GetParentClass().GetName() == "_System_TypeBase" ){
-
-			compiler.GetObjectModule().meta.GetClasses().Compile_System_InitializeUserTypes();
+		&& userProc.GetParentClass().GetName() == "_System_TypeBase" )
+	{
+		ActiveBasic::Compiler::ProcedureGenerator::Generate_System_InitializeUserTypes(
+			compiler.GetObjectModule().meta.GetClasses()
+		);
 	}
 	else if( userProc.GetName() == "InitializeUserTypesForBaseType"
@@ -210,5 +214,7 @@
 		&& userProc.GetParentClass().GetName() == "_System_TypeBase" )
 	{
-		compiler.GetObjectModule().meta.GetClasses().Compile_System_InitializeUserTypesForBaseType();
+		ActiveBasic::Compiler::ProcedureGenerator::Generate_System_InitializeUserTypesForBaseType(
+			compiler.GetObjectModule().meta.GetClasses()
+		);
 	}
 	else if( userProc.GetName() == "RegisterGlobalRoots"
@@ -232,5 +238,7 @@
 
 		//クラスに属する静的メンバを定義
-		compiler.GetObjectModule().meta.GetClasses().InitStaticMember();
+		ActiveBasic::Compiler::ProcedureGenerator::Generate_InitStaticMember(
+			compiler.GetObjectModule().meta.GetClasses()
+		);
 
 		//グローバル実行領域をコンパイル開始
Index: trunk/ab5.0/abdev/compiler_x86/compiler_x86.vcproj
===================================================================
--- trunk/ab5.0/abdev/compiler_x86/compiler_x86.vcproj	(revision 564)
+++ trunk/ab5.0/abdev/compiler_x86/compiler_x86.vcproj	(revision 565)
@@ -1289,4 +1289,8 @@
 				</File>
 				<File
+					RelativePath="..\BasicCompiler_Common\src\ProcedureGenerator.cpp"
+					>
+				</File>
+				<File
 					RelativePath="..\BasicCompiler_Common\src\VtblGenerator.cpp"
 					>
@@ -1486,4 +1490,8 @@
 				</File>
 				<File
+					RelativePath="..\BasicCompiler_Common\include\ProcedureGenerator.h"
+					>
+				</File>
+				<File
 					RelativePath="..\BasicCompiler_Common\include\VtblGenerator.h"
 					>
Index: trunk/ab5.0/abdev/compiler_x86/stdafx.h
===================================================================
--- trunk/ab5.0/abdev/compiler_x86/stdafx.h	(revision 564)
+++ trunk/ab5.0/abdev/compiler_x86/stdafx.h	(revision 565)
@@ -72,2 +72,3 @@
 #include <LexicalAnalyzer.h>
 #include <VtblGenerator.h>
+#include <ProcedureGenerator.h>
