Index: trunk/abdev/BasicCompiler32/BasicCompiler.vcproj
===================================================================
--- trunk/abdev/BasicCompiler32/BasicCompiler.vcproj	(revision 192)
+++ trunk/abdev/BasicCompiler32/BasicCompiler.vcproj	(revision 193)
@@ -1287,4 +1287,12 @@
 					>
 				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\src\TypeDef.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\src\VariableImpl.cpp"
+					>
+				</File>
 			</Filter>
 		</Filter>
@@ -1380,4 +1388,12 @@
 					>
 				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\include\TypeDef.h"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\include\VariableImpl.h"
+					>
+				</File>
 			</Filter>
 		</Filter>
Index: trunk/abdev/BasicCompiler32/Compile_Calc.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/Compile_Calc.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler32/Compile_Calc.cpp	(revision 193)
@@ -1,4 +1,6 @@
 #include <jenga/include/smoothie/Smoothie.h>
 #include <jenga/include/smoothie/LexicalAnalysis.h>
+
+#include <Compiler.h>
 
 #include "../BasicCompiler_Common/common.h"
@@ -622,8 +624,8 @@
 
 
-	if( varType.IsObject() && Smoothie::GetMeta().blittableTypes.IsExist( calcType ) ){
+	if( varType.IsObject() && compiler.GetMeta().GetBlittableTypes().IsExist( calcType ) ){
 		// Blittable型をオブジェクトとして扱う
 		vector<UserProc *> userProcs;
-		Smoothie::GetMeta().blittableTypes.GetClass( calcType ).GetStaticMethods().Enum( "_Create", userProcs );
+		compiler.GetMeta().GetBlittableTypes().GetClass( calcType ).GetStaticMethods().Enum( "_Create", userProcs );
 		if( userProcs.size() != 1 ){
 			SetError();
Index: trunk/abdev/BasicCompiler32/Compile_CallProc.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/Compile_CallProc.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler32/Compile_CallProc.cpp	(revision 193)
@@ -1,3 +1,5 @@
 #include <jenga/include/smoothie/Smoothie.h>
+
+#include <Compiler.h>
 
 #include "../BasicCompiler_Common/common.h"
@@ -129,5 +131,5 @@
 				pobj_c = &varType.GetClass();
 				if( NATURAL_TYPE( varType.GetBasicType() ) != DEF_OBJECT ){
-					pobj_c=Smoothie::GetMeta().GetClasses().Find(ObjectName);
+					pobj_c=compiler.GetMeta().GetClasses().Find(ObjectName);
 					if( pobj_c ){
 						isStatic = true;
Index: trunk/abdev/BasicCompiler32/Compile_Func.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/Compile_Func.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler32/Compile_Func.cpp	(revision 193)
@@ -1,3 +1,5 @@
 #include <jenga/include/smoothie/Smoothie.h>
+
+#include <Compiler.h>
 
 #include "../BasicCompiler_Common/common.h"
@@ -178,5 +180,5 @@
 		tempParm=temp2;
 
-		type.SetType( DEF_OBJECT, Smoothie::GetMeta().GetClasses().GetStringClassPtr() );
+		type.SetType( DEF_OBJECT, compiler.GetMeta().GetClasses().GetStringClassPtr() );
 	}
 
@@ -230,5 +232,5 @@
 
 		//オーバーロードを解決
-		pUserProc=OverloadSolution(name,subs,Smoothie::GetMeta().GetProcPointers()[ProcPtr_BaseIndex]->Params(), Type() );
+		pUserProc=OverloadSolution(name,subs,compiler.GetMeta().GetProcPointers()[ProcPtr_BaseIndex]->Params(), Type() );
 
 		if(!pUserProc){
@@ -318,5 +320,5 @@
 void Opcode_Func_SizeOf( const string &typeName ){
 	Type tempType;
-	if( !Type::StringToType( typeName, tempType ) ){
+	if( !Compiler::StringToType( typeName, tempType ) ){
 		SetError(3,typeName,cp);
 		return;
Index: trunk/abdev/BasicCompiler32/Compile_ProcOp.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/Compile_ProcOp.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler32/Compile_ProcOp.cpp	(revision 193)
@@ -3,6 +3,8 @@
 
 #include <Program.h>
+#include <Compiler.h>
 #include <LexicalScopingImpl.h>
 #include <ClassImpl.h>
+#include <VariableImpl.h>
 
 #include "../BasicCompiler_Common/common.h"
@@ -55,5 +57,5 @@
 
 		//クラスに属する静的メンバを定義
-		Smoothie::GetMeta().GetClasses().InitStaticMember();
+		compiler.GetMeta().GetClasses().InitStaticMember();
 
 		GetGlobalDataForDll();
@@ -224,5 +226,5 @@
 		&& userProc.GetParentClass().GetName() == "_System_TypeBase" ){
 
-			Smoothie::GetMeta().GetClasses().Compile_System_InitializeUserTypes();
+			compiler.GetMeta().GetClasses().Compile_System_InitializeUserTypes();
 	}
 	else if( userProc.GetName() == "RegisterGlobalRoots"
@@ -273,5 +275,5 @@
 
 	//コンパイルスタートをクラス管理クラスに追加
-	Smoothie::GetMeta().GetClasses().StartCompile( pUserProc );
+	compiler.GetMeta().GetClasses().StartCompile( pUserProc );
 
 	//コンパイル中の関数
@@ -282,5 +284,5 @@
 
 	// コンパイル中の関数でImportsされている名前空間
-	Smoothie::Temp::importedNamespaces = pUserProc->GetImportedNamespaces();
+	compiler.SetImportedNamespaces( pUserProc->GetImportedNamespaces() );
 
 	if(pUserProc->IsSystem()){
@@ -318,5 +320,5 @@
 		Parameter &param = *pUserProc->RealParams()[i3];
 
-		Variable *pVar = new Variable( param.GetVarName(), param, false, param.IsRef() );
+		Variable *pVar = new VariableImpl( param.GetVarName(), param, false, param.IsRef() );
 
 		if( param.IsArray() ){
@@ -395,9 +397,9 @@
 		else{
 			if( pUserProc->ReturnType().IsObject() ){
-				sprintf(temporary,"%s=Nothing%c%c%s",temp,1,ESC_AS, pUserProc->ReturnType().ToString().c_str() );
+				sprintf(temporary,"%s=Nothing%c%c%s",temp,1,ESC_AS, Compiler::TypeToString( pUserProc->ReturnType() ).c_str() );
 			}
 			else{
 				//戻り値用の変数の定義
-				sprintf(temporary,"%s%c%c%s",temp,1,ESC_AS, pUserProc->ReturnType().ToString().c_str() );
+				sprintf(temporary,"%s%c%c%s",temp,1,ESC_AS, Compiler::TypeToString( pUserProc->ReturnType() ).c_str() );
 			}
 
Index: trunk/abdev/BasicCompiler32/Compile_Var.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/Compile_Var.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler32/Compile_Var.cpp	(revision 193)
@@ -5,4 +5,5 @@
 #include <CodeGenerator.h>
 #include <Compiler.h>
+#include <VariableImpl.h>
 
 #include "../BasicCompiler_Common/common.h"
@@ -367,5 +368,5 @@
 	// 名前空間を分離
 	char namespaceStr[VN_SIZE]="", simpleName[VN_SIZE];
-	Smoothie::GetMeta().namespaceScopesCollection.SplitNamespace( variable, namespaceStr, simpleName );
+	compiler.GetMeta().GetNamespaces().SplitNamespace( variable, namespaceStr, simpleName );
 
 	// 先頭オブジェクトまたはクラス名と入れ子メンバに分割
@@ -461,5 +462,5 @@
 		//Const修飾子のメソッド内でメンバ書き込みアクセスが発生したとき
 		//（コンストラクタ、デストラクタ内を除く）
-		const CMethod *pMethod = Smoothie::GetMeta().GetClasses().GetNowCompilingMethodInfo();
+		const CMethod *pMethod = compiler.GetMeta().GetClasses().GetNowCompilingMethodInfo();
 		if( isWriteAccess &&
 			pMethod->IsConst() &&
@@ -524,8 +525,8 @@
 			}
 
-			int typeDefIndex = Smoothie::GetMeta().typeDefs.GetIndex( VarName );
+			int typeDefIndex = compiler.GetMeta().GetTypeDefs().GetIndex( VarName );
 			if( typeDefIndex != -1 ){
 				// TypeDef後の型名だったとき
-				lstrcpy( VarName, Smoothie::GetMeta().typeDefs[typeDefIndex].GetBaseName().c_str() );
+				lstrcpy( VarName, compiler.GetMeta().GetTypeDefs()[typeDefIndex].GetBaseName().c_str() );
 			}
 
@@ -832,5 +833,5 @@
 			char *temp;
 			temp=(char *)i64data;
-			i2=Compiler::GetNativeCode().GetDataTable().AddString(temp,lstrlen(temp));
+			i2=compiler.GetNativeCode().GetDataTable().AddString(temp,lstrlen(temp));
 			HeapDefaultFree(temp);
 
@@ -1022,5 +1023,5 @@
 			char *temp;
 			temp=(char *)i64data;
-			i2=Compiler::GetNativeCode().GetDataTable().AddString(temp,lstrlen(temp));
+			i2=compiler.GetNativeCode().GetDataTable().AddString(temp,lstrlen(temp));
 			HeapDefaultFree(temp);
 
@@ -1095,5 +1096,5 @@
 		bool isConst = ( dwFlags & DIMFLAG_CONST ) ? true:false;
 
-		Variable *pVar = new Variable( VarName, type, isConst );
+		Variable *pVar = new VariableImpl( VarName, type, isConst );
 
 		if( SubScripts[0] != -1 ){
Index: trunk/abdev/BasicCompiler32/MakePeHdr.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/MakePeHdr.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler32/MakePeHdr.cpp	(revision 193)
@@ -140,7 +140,7 @@
 	//////////////////
 	// データテーブル
-	Compiler::GetNativeCode().GetDataTable().Init();
+	compiler.GetNativeCode().GetDataTable().Init();
 	if(bDebugCompile){
-		Compiler::GetNativeCode().GetDataTable().Add( (long)0x00000002 );
+		compiler.GetNativeCode().GetDataTable().Add( (long)0x00000002 );
 	}
 
@@ -166,10 +166,10 @@
 
 	//関数ポインタ情報を初期化
-	Smoothie::GetMeta().GetProcPointers().clear();
+	compiler.GetMeta().GetProcPointers().clear();
 
 	// 名前空間情報を取得
 	NamespaceScopesCollection::CollectNamespaces(
 		Smoothie::Lexical::source.GetBuffer(),
-		Smoothie::GetMeta().namespaceScopesCollection
+		compiler.GetMeta().GetNamespaces()
 	);
 
@@ -177,8 +177,8 @@
 	//   GetSubInfo関数の中で参照されるオブジェクト名を事前に取得する。
 	//     ※オブジェクトの内容までは取得しない
-	Smoothie::GetMeta().GetClasses().CollectClassesForNameOnly( Smoothie::Lexical::source );
+	compiler.GetMeta().GetClasses().CollectClassesForNameOnly( Smoothie::Lexical::source );
 
 	//TypeDef情報を初期化
-	Smoothie::GetMeta().typeDefs.Init();
+	compiler.GetMeta().GetTypeDefs().Init();
 
 	//定数情報を取得
@@ -190,7 +190,7 @@
 
 	//クラス情報を取得（※注 - GetSubInfoの後に呼び出す）
-	Smoothie::GetMeta().GetClasses().GetAllClassInfo();
-
-	if( !Smoothie::GetMeta().AutoWrite( Jenga::Common::Environment::GetAppDir() + "\\meta_test.xml" ) )
+	compiler.GetMeta().GetClasses().GetAllClassInfo();
+
+	if( !compiler.GetMeta().AutoWrite( Jenga::Common::Environment::GetAppDir() + "\\meta_test.xml" ) )
 	{
 		ts(0);
@@ -415,5 +415,5 @@
 
 		//クラスに属する静的メンバを定義
-		Smoothie::GetMeta().GetClasses().InitStaticMember();
+		compiler.GetMeta().GetClasses().InitStaticMember();
 
 		//グローバル実行領域をコンパイル開始
@@ -884,6 +884,6 @@
 
 	//データセクションのファイル上のサイズ
-	if(Compiler::GetNativeCode().GetDataTable().GetSize()%FILE_ALIGNMENT) FileSize_DataSection=Compiler::GetNativeCode().GetDataTable().GetSize()+(FILE_ALIGNMENT-Compiler::GetNativeCode().GetDataTable().GetSize()%FILE_ALIGNMENT);
-	else FileSize_DataSection=Compiler::GetNativeCode().GetDataTable().GetSize();
+	if(compiler.GetNativeCode().GetDataTable().GetSize()%FILE_ALIGNMENT) FileSize_DataSection=compiler.GetNativeCode().GetDataTable().GetSize()+(FILE_ALIGNMENT-compiler.GetNativeCode().GetDataTable().GetSize()%FILE_ALIGNMENT);
+	else FileSize_DataSection=compiler.GetNativeCode().GetDataTable().GetSize();
 	if(FileSize_DataSection) bUse_DataSection=1;
 	else bUse_DataSection=0;
@@ -1076,5 +1076,5 @@
 	////////////////////////////////////////
 	//仮想関数データテーブルスケジュール
-	Smoothie::GetMeta().GetClasses().ActionVtblSchedule(ImageBase,MemPos_CodeSection);
+	compiler.GetMeta().GetClasses().ActionVtblSchedule(ImageBase,MemPos_CodeSection);
 
 
@@ -1611,5 +1611,5 @@
 	if(bUse_DataSection){
 		//データ テーブル
-		WriteFile(hFile,Compiler::GetNativeCode().GetDataTable().GetPtr(),Compiler::GetNativeCode().GetDataTable().GetSize(),(DWORD *)&i2,NULL);
+		WriteFile(hFile,compiler.GetNativeCode().GetDataTable().GetPtr(),compiler.GetNativeCode().GetDataTable().GetSize(),(DWORD *)&i2,NULL);
 		i+=i2;
 	}
@@ -1723,4 +1723,4 @@
 
 	//クラスに関するメモリを解放
-	Smoothie::GetMeta().GetClasses().Clear();
+	compiler.GetMeta().GetClasses().Clear();
 }
Index: trunk/abdev/BasicCompiler32/NumOpe.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/NumOpe.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler32/NumOpe.cpp	(revision 193)
@@ -82,5 +82,5 @@
 	SetStringQuotes( parameter );
 
-	Operator_New( *Smoothie::GetMeta().GetClasses().GetStringClassPtr(), "", parameter, Type( DEF_OBJECT, *Smoothie::GetMeta().GetClasses().GetStringClassPtr() ) );
+	Operator_New( *compiler.GetMeta().GetClasses().GetStringClassPtr(), "", parameter, Type( DEF_OBJECT, *compiler.GetMeta().GetClasses().GetStringClassPtr() ) );
 
 	free( parameter );
@@ -261,5 +261,5 @@
 		Type leftType;
 		if( GetTermType( termLeft, leftType, isLiteral, &isClassName ) ){
-			if( isClassName == false && Smoothie::GetMeta().blittableTypes.IsExist( leftType ) ){
+			if( isClassName == false && compiler.GetMeta().GetBlittableTypes().IsExist( leftType ) ){
 				// 左側のオブジェクト部分がBlittable型のとき
 
@@ -267,5 +267,5 @@
 				lstrcpy( temporary, termLeft );
 				sprintf( termLeft, "%s(%s)",
-					Smoothie::GetMeta().blittableTypes.Find( leftType ).GetCreateStaticMethodFullName().c_str(),
+					compiler.GetMeta().GetBlittableTypes().Find( leftType ).GetCreateStaticMethodFullName().c_str(),
 					temporary );
 			}
@@ -296,5 +296,5 @@
 
 	if( pIsClassName ){
-		if( Smoothie::GetMeta().GetClasses().Find( termFull ) ){
+		if( compiler.GetMeta().GetClasses().Find( termFull ) ){
 			*pIsClassName = true;
 			return true;
@@ -593,5 +593,5 @@
 		}
 
-		i2 = Compiler::GetNativeCode().GetDataTable().AddBinary( binary, num * tempBaseType.GetSize() );
+		i2 = compiler.GetNativeCode().GetDataTable().AddBinary( binary, num * tempBaseType.GetSize() );
 
 		//mov eax,i2
@@ -709,5 +709,5 @@
 					// As演算子の右辺値
 					//型名
-					if( Type::StringToType( term, resultType ) ){
+					if( Compiler::StringToType( term, resultType ) ){
 						resultType.SetBasicType( resultType.GetBasicType() | FLAG_CAST );
 					}
@@ -740,5 +740,5 @@
 
 						type_stack[sp]=DEF_OBJECT;
-						index_stack[sp]=(LONG_PTR)Smoothie::GetMeta().GetClasses().GetStringClassPtr();
+						index_stack[sp]=(LONG_PTR)compiler.GetMeta().GetClasses().GetStringClassPtr();
 						bLiteralCalculation=0;
 
@@ -751,5 +751,5 @@
 					bLiteralCalculation=0;
 
-					i2=Compiler::GetNativeCode().GetDataTable().AddString(term,i3);
+					i2=compiler.GetNativeCode().GetDataTable().AddString(term,i3);
 
 					//push DataSize
@@ -838,5 +838,5 @@
 						}
 						else{
-							index_stack[sp] = (LONG_PTR)Smoothie::GetMeta().GetClasses().GetObjectClassPtr();
+							index_stack[sp] = (LONG_PTR)compiler.GetMeta().GetClasses().GetObjectClassPtr();
 						}
 
Index: trunk/abdev/BasicCompiler64/BasicCompiler.vcproj
===================================================================
--- trunk/abdev/BasicCompiler64/BasicCompiler.vcproj	(revision 192)
+++ trunk/abdev/BasicCompiler64/BasicCompiler.vcproj	(revision 193)
@@ -313,4 +313,8 @@
 					>
 				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\include\SmoothieImpl.h"
+					>
+				</File>
 			</Filter>
 		</Filter>
Index: trunk/abdev/BasicCompiler64/MakePeHdr.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/MakePeHdr.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler64/MakePeHdr.cpp	(revision 193)
@@ -177,5 +177,5 @@
 	Smoothie::GetMeta().GetClasses().GetAllClassInfo();
 
-	Smoothie::GetMeta().Write( Jenga::Common::Environment::GetAppDir() + "\\meta_test.xml" );
+	Smoothie::GetMeta().AutoWrite( Jenga::Common::Environment::GetAppDir() + "\\meta_test.xml" );
 
 	//コードと行番号の関係
Index: trunk/abdev/BasicCompiler_Common/Compile.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/Compile.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/Compile.cpp	(revision 193)
@@ -5,4 +5,5 @@
 #include <LexicalScopingImpl.h>
 #include <CodeGenerator.h>
+#include <Compiler.h>
 
 #include "../BasicCompiler_Common/common.h"
@@ -260,8 +261,8 @@
 				break;
 			case ESC_IMPORTS:
-				Smoothie::Temp::importedNamespaces.Imports( Command + 2 );
+				compiler.ImportsNamespace( Command + 2 );
 				break;
 			case ESC_CLEARNAMESPACEIMPORTED:
-				Smoothie::Temp::importedNamespaces.clear();
+				compiler.GetImportedNamespaces().clear();
 				break;
 
Index: trunk/abdev/BasicCompiler_Common/Const.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/Const.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/Const.cpp	(revision 193)
@@ -1,2 +1,4 @@
+#include <Compiler.h>
+
 #include "common.h"
 #include OPCODE_H_PATH	//opcode.h
@@ -12,5 +14,5 @@
 		return false;
 	}
-	return NamespaceScopes::IsSameArea( this->namespaceScopes, namespaceScopes );
+	return compiler.IsSameAreaNamespace( this->namespaceScopes, namespaceScopes );
 }
 bool ConstBase::IsEqualSymbol( const string &fullName ) const
Index: trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp	(revision 193)
@@ -1,5 +1,7 @@
 #include <jenga/include/smoothie/Smoothie.h>
 
+#include <Compiler.h>
 #include <ClassImpl.h>
+#include <VariableImpl.h>
 
 #include "../BasicCompiler_Common/common.h"
@@ -32,5 +34,5 @@
 		(*p)+=lstrlen(buffer+(*p))+1;
 
-		type.SetIndex( (LONG_PTR)Smoothie::GetMeta().GetClasses().Find(szClassName) );
+		type.SetIndex( (LONG_PTR)compiler.GetMeta().GetClasses().Find(szClassName) );
 	}
 	else{
@@ -119,13 +121,13 @@
 
 	//イテレータをリセット
-	Smoothie::GetMeta().GetClasses().Iterator_Reset();
+	compiler.GetMeta().GetClasses().Iterator_Reset();
 
 	//個数
-	*(long *)(buffer+i2)=Smoothie::GetMeta().GetClasses().Iterator_GetMaxCount();
-	i2+=sizeof(long);
-
-	while(Smoothie::GetMeta().GetClasses().Iterator_HasNext()){
+	*(long *)(buffer+i2)=compiler.GetMeta().GetClasses().Iterator_GetMaxCount();
+	i2+=sizeof(long);
+
+	while(compiler.GetMeta().GetClasses().Iterator_HasNext()){
 		CClass *pobj_c;
-		pobj_c=Smoothie::GetMeta().GetClasses().Iterator_GetNext();
+		pobj_c=compiler.GetMeta().GetClasses().Iterator_GetNext();
 
 		//クラス名
@@ -139,11 +141,11 @@
 	// TypeDef情報
 	//////////////////
-	*(long *)(buffer+i2)=(int)Smoothie::GetMeta().typeDefs.size();
-	i2+=sizeof(long);
-	for(i3=0;i3<(int)Smoothie::GetMeta().typeDefs.size();i3++){
-		lstrcpy(buffer+i2,Smoothie::GetMeta().typeDefs[i3].GetName().c_str() );
-		i2+=lstrlen(buffer+i2)+1;
-
-		lstrcpy(buffer+i2,Smoothie::GetMeta().typeDefs[i3].GetBaseName().c_str() );
+	*(long *)(buffer+i2)=(int)compiler.GetMeta().GetTypeDefs().size();
+	i2+=sizeof(long);
+	for(i3=0;i3<(int)compiler.GetMeta().GetTypeDefs().size();i3++){
+		lstrcpy(buffer+i2,compiler.GetMeta().GetTypeDefs()[i3].GetName().c_str() );
+		i2+=lstrlen(buffer+i2)+1;
+
+		lstrcpy(buffer+i2,compiler.GetMeta().GetTypeDefs()[i3].GetBaseName().c_str() );
 		i2+=lstrlen(buffer+i2)+1;
 
@@ -307,9 +309,9 @@
 
 	//イテレータをリセット
-	Smoothie::GetMeta().GetClasses().Iterator_Reset();
-
-	while(Smoothie::GetMeta().GetClasses().Iterator_HasNext()){
+	compiler.GetMeta().GetClasses().Iterator_Reset();
+
+	while(compiler.GetMeta().GetClasses().Iterator_HasNext()){
 		CClass *pobj_c;
-		pobj_c=Smoothie::GetMeta().GetClasses().Iterator_GetNext();
+		pobj_c=compiler.GetMeta().GetClasses().Iterator_GetNext();
 
 
@@ -497,5 +499,5 @@
 	}
 
-	Smoothie::GetMeta().SetClasses( this->pobj_DBClass );
+	compiler.GetMeta().SetClasses( this->pobj_DBClass );
 
 
@@ -505,5 +507,5 @@
 
 	//初期化
-	Smoothie::GetMeta().typeDefs.clear();
+	compiler.GetMeta().GetTypeDefs().clear();
 
 	//個数を取得
@@ -515,5 +517,5 @@
 
 		// 名前空間に未対応
-		Smoothie::GetMeta().typeDefs.push_back( TypeDef( NamespaceScopes(), temp5, buffer+i2, -1 ) );
+		compiler.GetMeta().GetTypeDefs().push_back( TypeDef( NamespaceScopes(), temp5, buffer+i2, -1 ) );
 
 		i2+=lstrlen(buffer+i2)+1;
@@ -546,5 +548,5 @@
 		bool isArray = (buffer[i2++]) ? true:false;
 
-		Variable *pVar = new Variable( name, type, false, isRef );
+		Variable *pVar = new VariableImpl( name, type, false, isRef );
 
 		if(isArray){
@@ -592,5 +594,5 @@
 		const CClass *pClass = NULL;
 		if(szParentClassName[0]){
-			pClass=Smoothie::GetMeta().GetClasses().Find(szParentClassName);
+			pClass=compiler.GetMeta().GetClasses().Find(szParentClassName);
 		}
 
@@ -636,5 +638,5 @@
 			bool isArray = (buffer[i2++]) ? true:false;
 
-			Variable *pVar = new Variable( name, type, false, isRef );
+			Variable *pVar = new VariableImpl( name, type, false, isRef );
 
 			if(isArray){
@@ -697,5 +699,5 @@
 		i2+=lstrlen(buffer+i2)+1;
 
-		pobj_c =  const_cast<CClass *>( Smoothie::GetMeta().GetClasses().Find(szClassName) );
+		pobj_c =  const_cast<CClass *>( compiler.GetMeta().GetClasses().Find(szClassName) );
 
 		//仮想関数の数
@@ -748,5 +750,5 @@
 			const CClass *pobj_InheritsClass = NULL;
 			if(szInherits[0]){
-				pobj_InheritsClass=Smoothie::GetMeta().GetClasses().Find(szInherits);
+				pobj_InheritsClass=compiler.GetMeta().GetClasses().Find(szInherits);
 			}
 
@@ -945,5 +947,5 @@
 
 	// クラス情報
-	Smoothie::GetMeta().SetClasses( this->pobj_DBClass );
+	compiler.GetMeta().SetClasses( this->pobj_DBClass );
 
 	//定数を取得
Index: trunk/abdev/BasicCompiler_Common/Diagnose.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/Diagnose.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/Diagnose.cpp	(revision 193)
@@ -1,4 +1,5 @@
 #include <jenga/include/smoothie/Smoothie.h>
 
+#include <Compiler.h>
 #include <Program.h>
 
@@ -68,10 +69,10 @@
 		// イテレータをリセット
 		extern Classes *pobj_DBClass;
-		Smoothie::GetMeta().GetClasses().Iterator_Reset();
+		compiler.GetMeta().GetClasses().Iterator_Reset();
 
-		while( Smoothie::GetMeta().GetClasses().Iterator_HasNext() ){
+		while( compiler.GetMeta().GetClasses().Iterator_HasNext() ){
 			int codeSizeOfClass = 0;
 
-			CClass &objClass = *Smoothie::GetMeta().GetClasses().Iterator_GetNext();
+			CClass &objClass = *compiler.GetMeta().GetClasses().Iterator_GetNext();
 
 			if( !objClass.IsEnum() ){
@@ -108,10 +109,10 @@
 		// イテレータをリセット
 		extern Classes *pobj_DBClass;
-		Smoothie::GetMeta().GetClasses().Iterator_Reset();
+		compiler.GetMeta().GetClasses().Iterator_Reset();
 
-		while( Smoothie::GetMeta().GetClasses().Iterator_HasNext() ){
+		while( compiler.GetMeta().GetClasses().Iterator_HasNext() ){
 			int codeSizeOfClass = 0;
 
-			CClass &objClass = *Smoothie::GetMeta().GetClasses().Iterator_GetNext();
+			CClass &objClass = *compiler.GetMeta().GetClasses().Iterator_GetNext();
 
 			// 動的メソッド
Index: trunk/abdev/BasicCompiler_Common/NumOpe_GetType.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/NumOpe_GetType.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/NumOpe_GetType.cpp	(revision 193)
@@ -1,4 +1,6 @@
 #include <jenga/include/smoothie/Smoothie.h>
 #include <jenga/include/smoothie/LexicalAnalysis.h>
+
+#include <Compiler.h>
 
 #include "common.h"
@@ -284,5 +286,5 @@
 	}
 
-	if( !Type::StringToType( TypeName, resultType ) ){
+	if( !Compiler::StringToType( TypeName, resultType ) ){
 		return false;
 	}
@@ -326,5 +328,5 @@
 		Type leftType;
 		if( GetTermType( termLeft, leftType, isLiteral, &isClassName ) ){
-			if( isClassName == false && Smoothie::GetMeta().blittableTypes.IsExist( leftType ) ){
+			if( isClassName == false && compiler.GetMeta().GetBlittableTypes().IsExist( leftType ) ){
 				// 左側のオブジェクト部分がBlittable型のとき
 
@@ -332,5 +334,5 @@
 				lstrcpy( temporary, termLeft );
 				sprintf( termLeft, "%s(%s)",
-					Smoothie::GetMeta().blittableTypes.Find( leftType ).GetCreateStaticMethodFullName().c_str(),
+					compiler.GetMeta().GetBlittableTypes().Find( leftType ).GetCreateStaticMethodFullName().c_str(),
 					temporary );
 
@@ -396,5 +398,5 @@
 
 	if( pIsClassName ){
-		if( Smoothie::GetMeta().GetClasses().Find( termFull ) ){
+		if( compiler.GetMeta().GetClasses().Find( termFull ) ){
 			*pIsClassName = true;
 			return true;
@@ -635,5 +637,5 @@
 					// As演算子の右辺値
 					//型名
-					if( Type::StringToType( term, resultType ) ){
+					if( Compiler::StringToType( term, resultType ) ){
 
 						if( resultType.IsObject() ){
@@ -673,5 +675,5 @@
 						//要求タイプがオブジェクト、または未定のとき
 						type_stack[sp]=DEF_OBJECT;
-						index_stack[sp]=(LONG_PTR)Smoothie::GetMeta().GetClasses().GetStringClassPtr();
+						index_stack[sp]=(LONG_PTR)compiler.GetMeta().GetClasses().GetStringClassPtr();
 						bLiteralCalculation=0;
 
@@ -718,5 +720,5 @@
 						}
 						else{
-							index_stack[sp] = (LONG_PTR)Smoothie::GetMeta().GetClasses().GetObjectClassPtr();
+							index_stack[sp] = (LONG_PTR)compiler.GetMeta().GetClasses().GetObjectClassPtr();
 						}
 						bLiteralCalculation = 0;
Index: trunk/abdev/BasicCompiler_Common/Object.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/Object.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/Object.cpp	(revision 193)
@@ -1,3 +1,3 @@
-#include <CodeGenerator.h>
+#include <Compiler.h>
 
 #include "../BasicCompiler_Common/common.h"
@@ -116,5 +116,5 @@
 	}
 
-	if( !Type::StringToType( typeName, resultType ) ){
+	if( !Compiler::StringToType( typeName, resultType ) ){
 		SetError(3,typeName,cp);
 		return false;
Index: trunk/abdev/BasicCompiler_Common/Subroutine.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/Subroutine.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/Subroutine.cpp	(revision 193)
@@ -2,4 +2,5 @@
 #include <jenga/include/smoothie/LexicalAnalysis.h>
 
+#include <Compiler.h>
 #include <ProcedureImpl.h>
 
@@ -164,5 +165,5 @@
 		GetVarType(fullCallName,type,false);
 
-		ProcPointer *pProcPtr = Smoothie::GetMeta().GetProcPointers()[type.GetIndex()];
+		ProcPointer *pProcPtr = compiler.GetMeta().GetProcPointers()[type.GetIndex()];
 		resultType = pProcPtr->ReturnType();
 
@@ -631,5 +632,5 @@
 
 	// Importsされた名前空間の管理
-	NamespaceScopesCollection &importedNamespaces = Smoothie::Temp::importedNamespaces;
+	NamespaceScopesCollection &importedNamespaces = compiler.GetImportedNamespaces();
 	importedNamespaces.clear();
 
@@ -685,5 +686,5 @@
 				temporary[i2]=basbuf[i];
 			}
-			if( !importedNamespaces.Imports( temporary ) )
+			if( !compiler.ImportsNamespace( temporary ) )
 			{
 				SetError(64,temporary,cp );
Index: trunk/abdev/BasicCompiler_Common/VariableOpe.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/VariableOpe.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/VariableOpe.cpp	(revision 193)
@@ -2,5 +2,7 @@
 #include <jenga/include/smoothie/LexicalAnalysis.h>
 
+#include <Compiler.h>
 #include <LexicalScopingImpl.h>
+#include <VariableImpl.h>
 
 #include "../BasicCompiler_Common/common.h"
@@ -215,5 +217,5 @@
 		if(lpIndex==-1) lstrcpy(name,"VoidPtr");
 		else{
-			if( Smoothie::GetMeta().GetProcPointers()[lpIndex]->ReturnType().IsNull() )
+			if( compiler.GetMeta().GetProcPointers()[lpIndex]->ReturnType().IsNull() )
 				lstrcpy(name,"*Sub");
 			else lstrcpy(name,"*Function");
@@ -230,5 +232,5 @@
 
 Type GetStringTypeInfo(){
-	Type type( DEF_OBJECT, *Smoothie::GetMeta().GetClasses().GetStringClassPtr() );
+	Type type( DEF_OBJECT, *compiler.GetMeta().GetClasses().GetStringClassPtr() );
 	return type;
 }
@@ -567,5 +569,5 @@
 	// 名前空間を分離
 	char namespaceStr[VN_SIZE]="", simpleName[VN_SIZE];
-	Smoothie::GetMeta().namespaceScopesCollection.SplitNamespace( variable, namespaceStr, simpleName );
+	compiler.GetMeta().GetNamespaces().SplitNamespace( variable, namespaceStr, simpleName );
 
 	// 先頭オブジェクトまたはクラス名と入れ子メンバに分割
@@ -660,8 +662,8 @@
 		}
 
-		int typeDefIndex = Smoothie::GetMeta().typeDefs.GetIndex( VarName );
+		int typeDefIndex = compiler.GetMeta().GetTypeDefs().GetIndex( VarName );
 		if( typeDefIndex != -1 ){
 			// TypeDef後の型名だったとき
-			lstrcpy( VarName, Smoothie::GetMeta().typeDefs[typeDefIndex].GetBaseName().c_str() );
+			lstrcpy( VarName, compiler.GetMeta().GetTypeDefs()[typeDefIndex].GetBaseName().c_str() );
 		}
 
@@ -870,5 +872,5 @@
 		}
 
-		if( !Type::StringToType( temporary, type ) ){
+		if( !Compiler::StringToType( temporary, type ) ){
 			SetError(3,temporary,cp);
 			type.SetBasicType( DEF_LONG );
@@ -974,5 +976,5 @@
 	bool isConst = ( dwFlag & DIMFLAG_CONST ) ? true:false;
 
-	Variable *pVar = new Variable( Smoothie::Temp::liveingNamespaceScopes, name, type, isConst );
+	Variable *pVar = new VariableImpl( Smoothie::Temp::liveingNamespaceScopes, name, type, isConst );
 
 	if( SubScripts[0] != -1 ){
Index: trunk/abdev/BasicCompiler_Common/VariableOpe.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/VariableOpe.h	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/VariableOpe.h	(revision 193)
@@ -12,4 +12,5 @@
 int GetPtrType(int type);
 BOOL GetTypeName(int type,LONG_PTR lpIndex,char *name);
+Type GetStringTypeInfo();
 void GetWithName(char *buffer);
 BOOL GetVarFormatString(char *buffer,char *array,char *array2,char *NestMember, CClass::RefType &refType );
Index: trunk/abdev/BasicCompiler_Common/calculation.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/calculation.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/calculation.cpp	(revision 193)
@@ -1,3 +1,5 @@
 #include <jenga/include/smoothie/LexicalAnalysis.h>
+
+#include <Compiler.h>
 
 #include "../BasicCompiler_Common/common.h"
@@ -486,5 +488,5 @@
 
 						Type tempType;
-						if( !Type::StringToType( temp2, tempType ) ){
+						if( !Compiler::StringToType( temp2, tempType ) ){
 							if(enableerror) SetError(3,temp2,cp);
 							return false;
@@ -690,5 +692,5 @@
 						{
 							Type tempType;
-							if( !Type::StringToType( Parms, tempType ) ){
+							if( !Compiler::StringToType( Parms, tempType ) ){
 								if(bDebuggingWatchList){
 									if( pIsMemoryAccessError ) *pIsMemoryAccessError = true;
Index: trunk/abdev/BasicCompiler_Common/hash.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/hash.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/hash.cpp	(revision 193)
@@ -1,3 +1,5 @@
 #include <jenga/include/smoothie/Smoothie.h>
+
+#include <Compiler.h>
 
 #include "../BasicCompiler_Common/common.h"
@@ -91,5 +93,5 @@
 			}
 			else{
-				pobj_c=Smoothie::GetMeta().GetClasses().Find(ObjName);
+				pobj_c=compiler.GetMeta().GetClasses().Find(ObjName);
 				if( pobj_c ){
 					isStatic = true;
@@ -189,5 +191,5 @@
 
 UserProc *GetClassMethod( const char *className, const char *methodName ){
-	const CClass *pClass = Smoothie::GetMeta().GetClasses().Find( className );
+	const CClass *pClass = compiler.GetMeta().GetClasses().Find( className );
 	if( pClass ){
 		vector<UserProc *> userProcs;
Index: trunk/abdev/BasicCompiler_Common/include/ClassImpl.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/ClassImpl.h	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/include/ClassImpl.h	(revision 193)
@@ -14,4 +14,6 @@
 	{
 	}
+
+	virtual bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
 
 	//継承させる
@@ -62,4 +64,6 @@
 	virtual void Compile_System_InitializeUserTypes();
 
+	virtual const CClass *Find( const NamespaceScopes &namespaceScopes, const string &name ) const;
+
 
 	// XMLシリアライズ用
Index: trunk/abdev/BasicCompiler_Common/include/Compiler.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/Compiler.h	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/include/Compiler.h	(revision 193)
@@ -2,11 +2,74 @@
 
 #include <CodeGenerator.h>
+#include <MetaImpl.h>
+
 class Compiler
 {
-	static NativeCode nativeCode;
+	NativeCode nativeCode;
+	MetaImpl metaImpl;
+
+	NamespaceScopesCollection importedNamespaces;
+
 public:
-	static NativeCode &GetNativeCode()
+	NativeCode &GetNativeCode()
 	{
 		return nativeCode;
 	}
+
+	MetaImpl &GetMeta()
+	{
+		return metaImpl;
+	}
+
+	NamespaceScopesCollection &GetImportedNamespaces()
+	{
+		return importedNamespaces;
+	}
+	void SetImportedNamespaces( const NamespaceScopesCollection &namespaces )
+	{
+		this->importedNamespaces = namespaces;
+	}
+	bool ImportsNamespace( const std::string &namespaceStr )
+	{
+		NamespaceScopes namespaceScopes( namespaceStr );
+		if( !this->GetMeta().GetNamespaces().IsExist( namespaceScopes ) ){
+			return false;
+		}
+
+		this->importedNamespaces.push_back( namespaceScopes );
+
+		return true;
+	}
+
+	static bool StringToType( const std::string &typeName, Type &type );
+	static const std::string TypeToString( const Type &type );
+
+	// 指定された名前空間が同一エリアと見なされるかどうかをチェック
+	bool IsSameAreaNamespace( const NamespaceScopes &baseNamespaceScopes, const NamespaceScopes &entryNamespaceScopes ){
+		if( entryNamespaceScopes.size() ){
+			if( baseNamespaceScopes.IsCoverd( entryNamespaceScopes ) ){
+				// 包括しているときは同一と見なす
+				return true;
+			}
+		}
+		else{
+			if( baseNamespaceScopes.size() ){
+				// 名前空間の判断が必要なとき
+				if( this->importedNamespaces.IsImported( baseNamespaceScopes )
+					|| baseNamespaceScopes.IsLiving() ){
+					// Using指定があるとき
+					// または
+					// 指定された名前空間が現在の名前空間スコープと同一のとき
+					return true;
+				}
+			}
+			else{
+				return true;
+			}
+		}
+
+		return false;
+	}
 };
+
+static Compiler compiler;
Index: trunk/abdev/BasicCompiler_Common/include/MetaImpl.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/MetaImpl.h	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/include/MetaImpl.h	(revision 193)
@@ -7,12 +7,23 @@
 #include <ClassImpl.h>
 #include <ProcedureImpl.h>
+#include <TypeDef.h>
 
 class MetaImpl : public Meta
 {
+	// 名前空間
+	NamespaceScopesCollection namespaceScopesCollection;
+
+	// クラス
 	ClassesImpl classesImpl;
 	Classes *pNowClassesForDebugger;
 
+	// blittable型
+	BlittableTypes blittableTypes;
+
+	// TypeDef
+	TypeDefCollection typeDefs;
+
 public:
-	MetaImpl( ClassesImpl *pClasses )
+	MetaImpl()
 		: Meta( new ProcPointersImpl() )
 		, classesImpl()
@@ -20,9 +31,13 @@
 	{
 	}
-	MetaImpl()
-		: Meta()
+
+	const NamespaceScopesCollection &GetNamespaces() const
 	{
+		return namespaceScopesCollection;
 	}
-
+	NamespaceScopesCollection &GetNamespaces()
+	{
+		return namespaceScopesCollection;
+	}
 
 	virtual Classes &GetClasses()
@@ -33,4 +48,14 @@
 	{
 		this->pNowClassesForDebugger = pClasses;
+	}
+
+	BlittableTypes &GetBlittableTypes()
+	{
+		return blittableTypes;
+	}
+
+	TypeDefCollection &GetTypeDefs()
+	{
+		return typeDefs;
 	}
 
Index: trunk/abdev/BasicCompiler_Common/include/ProcedureImpl.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/ProcedureImpl.h	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/include/ProcedureImpl.h	(revision 193)
@@ -49,4 +49,6 @@
 	}
 
+	virtual bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
+
 	virtual bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine );
 };
Index: trunk/abdev/BasicCompiler_Common/include/SmoothieImpl.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/SmoothieImpl.h	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/include/SmoothieImpl.h	(revision 193)
@@ -9,5 +9,5 @@
 {
 	friend Smoothie;
-	static MetaImpl metaImpl;
+
 public:
 	SmoothieImpl()
@@ -15,3 +15,6 @@
 	{
 	}
+
+	// blittable型
+	BlittableTypes blittableTypes;
 };
Index: trunk/abdev/BasicCompiler_Common/include/TypeDef.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/TypeDef.h	(revision 193)
+++ trunk/abdev/BasicCompiler_Common/include/TypeDef.h	(revision 193)
@@ -0,0 +1,56 @@
+#pragma once
+
+#include <vector>
+#include <string>
+
+#include <jenga/include/smoothie/Type.h>
+#include <jenga/include/smoothie/Namespace.h>
+
+using namespace std;
+
+class TypeDefCollection;
+
+class TypeDef{
+	friend TypeDefCollection;
+
+	NamespaceScopes namespaceScopes;
+
+	string name;
+	string baseName;
+	Type baseType;
+public:
+	TypeDef( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName, int nowLine );
+	~TypeDef();
+
+	const string &GetName() const
+	{
+		return name;
+	}
+	const string &GetBaseName() const
+	{
+		return baseName;
+	}
+	const Type &GetBaseType() const
+	{
+		return baseType;
+	}
+
+	bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
+	bool IsEqualSymbol( const string &name ) const;
+};
+
+class TypeDefCollection : public vector<TypeDef>
+{
+public:
+	TypeDefCollection();
+	~TypeDefCollection();
+
+	void Add( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName, int nowLine );
+	int GetIndex( const NamespaceScopes &namespaceScopes, const string &name ) const;
+	int GetIndex( const string &fullName ) const;
+
+private:
+	void Add( const NamespaceScopes &namespaceScopes, const string &expression, int nowLine );
+public:
+	void Init();
+};
Index: trunk/abdev/BasicCompiler_Common/include/VariableImpl.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/VariableImpl.h	(revision 193)
+++ trunk/abdev/BasicCompiler_Common/include/VariableImpl.h	(revision 193)
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <jenga/include/smoothie/Variable.h>
+
+
+class VariableImpl : public Variable
+{
+public:
+	VariableImpl( const string &name, const Type &type, bool isConst = false, bool isRef = false )
+		: Variable( name, type, isConst, isRef )
+	{
+	}
+	VariableImpl( const NamespaceScopes &namespaceScopes, const string &name, const Type &type, bool isConst = false, bool isRef = false )
+		: Variable( namespaceScopes, name, type, isConst, isRef )
+	{
+	}
+
+	virtual bool IsEqualSymbol( const Symbol &symbol, bool isSupportStaticMember ) const;
+};
Index: trunk/abdev/BasicCompiler_Common/src/ClassImpl.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/src/ClassImpl.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/src/ClassImpl.cpp	(revision 193)
@@ -76,4 +76,13 @@
 
 
+bool ClassImpl::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const
+{
+	if( GetName() != name ){
+		return false;
+	}
+
+	return compiler.IsSameAreaNamespace( GetNamespaceScopes(), namespaceScopes );
+}
+
 bool ClassImpl::Inherits( const char *inheritNames, int nowLine ){
 	int i = 0;
@@ -91,5 +100,5 @@
 
 		//継承元クラスを取得
-		const CClass *pInheritsClass = Smoothie::GetMeta().GetClasses().Find(temporary);
+		const CClass *pInheritsClass = compiler.GetMeta().GetClasses().Find(temporary);
 		if( !pInheritsClass ){
 			SmoothieException::Throw(106,temporary,nowLine);
@@ -121,5 +130,5 @@
 	if( !isInheritsClass ){
 		// クラスを一つも継承していないとき
-		const CClass *pObjectClass = Smoothie::GetMeta().GetClasses().Find("Object");
+		const CClass *pObjectClass = compiler.GetMeta().GetClasses().Find("Object");
 		if( !pObjectClass ){
 			SmoothieException::Throw(106,"Object",i);
@@ -145,5 +154,5 @@
 
 		//継承元クラスを取得
-		const CClass *pInheritsClass = Smoothie::GetMeta().GetClasses().Find(temporary);
+		const CClass *pInheritsClass = compiler.GetMeta().GetClasses().Find(temporary);
 		if( !pInheritsClass ){
 			SmoothieException::Throw(106,temporary,nowLine);
@@ -184,5 +193,5 @@
 		//継承先が読み取られていないとき
 		pobj_LoopRefCheck->add(this->GetName().c_str());
-		Smoothie::GetMeta().GetClasses().GetClass_recur(inheritsClass.GetName().c_str());
+		compiler.GetMeta().GetClasses().GetClass_recur(inheritsClass.GetName().c_str());
 		pobj_LoopRefCheck->del(this->GetName().c_str());
 	}
@@ -246,5 +255,5 @@
 		//継承先が読み取られていないとき
 		pobj_LoopRefCheck->add(this->GetName().c_str());
-		Smoothie::GetMeta().GetClasses().GetClass_recur(inheritsInterface.GetName().c_str());
+		compiler.GetMeta().GetClasses().GetClass_recur(inheritsInterface.GetName().c_str());
 		pobj_LoopRefCheck->del(this->GetName().c_str());
 	}
@@ -470,5 +479,5 @@
 	}
 
-	vtbl_offset=Compiler::GetNativeCode().GetDataTable().AddBinary((void *)ppsi,GetVtblNum()*sizeof(LONG_PTR));
+	vtbl_offset=compiler.GetNativeCode().GetDataTable().AddBinary((void *)ppsi,GetVtblNum()*sizeof(LONG_PTR));
 
 	for( int i=0; i < GetVtblNum(); i++ ){
@@ -484,5 +493,5 @@
 
 	LONG_PTR *pVtbl;
-	pVtbl=(LONG_PTR *)((char *)Compiler::GetNativeCode().GetDataTable().GetPtr()+vtbl_offset);
+	pVtbl=(LONG_PTR *)((char *)compiler.GetNativeCode().GetDataTable().GetPtr()+vtbl_offset);
 
 	int i;
@@ -505,5 +514,5 @@
 
 	// Blittable型管理オブジェクトを初期化
-	Smoothie::GetMeta().blittableTypes.clear();
+	compiler.GetMeta().GetBlittableTypes().clear();
 
 	// 名前空間管理
@@ -512,5 +521,5 @@
 
 	// Importsされた名前空間の管理
-	NamespaceScopesCollection &importedNamespaces = Smoothie::Temp::importedNamespaces;
+	NamespaceScopesCollection &importedNamespaces = compiler.GetImportedNamespaces();
 	importedNamespaces.clear();
 
@@ -549,5 +558,5 @@
 				temporary[i2]=source[i];
 			}
-			if( !importedNamespaces.Imports( temporary ) )
+			if( !compiler.ImportsNamespace( temporary ) )
 			{
 				SmoothieException::Throw(64,temporary,i );
@@ -580,5 +589,5 @@
 					i+=10;
 					i+=GetStringInPare_RemovePare(temporary,source.GetBuffer()+i)+1;
-					Type::StringToType( temporary, blittableType );
+					Compiler::StringToType( temporary, blittableType );
 				}
 
@@ -625,5 +634,5 @@
 
 					// Blittable型として登録
-					Smoothie::GetMeta().blittableTypes.push_back( BlittableType( blittableType, pClass ) );
+					compiler.GetMeta().GetBlittableTypes().push_back( BlittableType( blittableType, pClass ) );
 				}
 		}
@@ -783,5 +792,6 @@
 
 				//継承元クラスを取得
-				const CClass *pInheritsClass = Find(temporary);
+				const Classes &classes = *this;
+				const CClass *pInheritsClass = classes.Find(temporary);
 				if( !pInheritsClass ){
 					SetError(106,temporary,i);
@@ -1283,2 +1293,40 @@
 	}*/
 }
+
+const CClass *ClassesImpl::Find( const NamespaceScopes &namespaceScopes, const string &name ) const
+{
+	int key;
+	key=GetHashCode(name.c_str());
+
+	if( namespaceScopes.size() == 0 && name == "Object" ){
+		return GetObjectClassPtr();
+	}
+	else if( namespaceScopes.size() == 0 && name == "String" ){
+		return GetStringClassPtr();
+	}
+
+	if(pobj_ClassHash[key]){
+		CClass *pobj_c;
+		pobj_c=pobj_ClassHash[key];
+		while(1){
+			if( pobj_c->IsEqualSymbol( namespaceScopes, name ) ){
+				//名前空間とクラス名が一致した
+				return pobj_c;
+			}
+
+			if(pobj_c->pobj_NextClass==0) break;
+			pobj_c=pobj_c->pobj_NextClass;
+		}
+	}
+
+	// TypeDefも見る
+	int index = compiler.GetMeta().GetTypeDefs().GetIndex( namespaceScopes, name );
+	if( index != -1 ){
+		Type type = compiler.GetMeta().GetTypeDefs()[index].GetBaseType();
+		if( type.IsObject() ){
+			return &type.GetClass();
+		}
+	}
+
+	return NULL;
+}
Index: trunk/abdev/BasicCompiler_Common/src/Compiler.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/src/Compiler.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/src/Compiler.cpp	(revision 193)
@@ -1,3 +1,121 @@
+#include <jenga/include/smoothie/Type.h>
+#include <jenga/include/smoothie/SmoothieException.h>
+
 #include <Compiler.h>
 
-NativeCode Compiler::nativeCode;
+
+bool Compiler::StringToType( const string &typeName, Type &type ){
+	type.SetIndex( -1 );
+
+	if( typeName[0] == '*' ){
+		if( typeName.size() >= 3
+			&& typeName[1] == 1 && ( typeName[2] == ESC_FUNCTION || typeName[2] == ESC_SUB ) ){
+				//関数ポインタ（*Function）
+				type.SetBasicType( DEF_PTR_PROC );
+				type.SetIndex( compiler.GetMeta().GetProcPointers().Add( typeName ) );
+				return true;
+		}
+
+		const string &nextTypeName = typeName.substr( 1 );
+
+		if( !StringToType( nextTypeName, type ) ){
+			return false;
+		}
+
+		type.PtrLevelUp();
+
+		return true;
+	}
+
+	{
+		int basicType;
+		if( Type::StringToBasicType( typeName, basicType ) ){
+			// 基本型だったとき
+			type.SetBasicType( basicType );
+			return true;
+		}
+	}
+
+	// Object型だったとき
+	if( typeName == "Object" ){
+		type.SetType( DEF_OBJECT, compiler.GetMeta().GetClasses().GetObjectClassPtr() );
+		return true;
+	}
+
+	// String型だったとき
+	if( typeName == "String" ){
+		type.SetType( DEF_OBJECT, compiler.GetMeta().GetClasses().GetStringClassPtr() );
+		return true;
+	}
+
+
+	////////////////////
+	// TypeDefされた型
+	////////////////////
+	int i=compiler.GetMeta().GetTypeDefs().GetIndex( typeName );
+	if(i!=-1){
+		type = compiler.GetMeta().GetTypeDefs()[i].GetBaseType();
+		return true;
+	}
+
+	//クラス
+	const CClass *pobj_c = compiler.GetMeta().GetClasses().Find( typeName );
+	if(pobj_c){
+		type.SetClassPtr( pobj_c );
+
+		if( pobj_c->IsStructure() ){
+			type.SetBasicType( DEF_STRUCT );
+		}
+		else{
+			type.SetBasicType( DEF_OBJECT );
+		}
+		return true;
+	}
+
+	return false;
+}
+
+const string Compiler::TypeToString( const Type &type )
+{
+	if( PTR_LEVEL( type.GetBasicType() ) ){
+		//ポインタレベルが1以上の場合
+		Type tempType( type );
+		tempType.PtrLevelDown();
+
+		return (string)"*" + TypeToString( type );
+	}
+	else if( type.IsObject() || type.IsStruct() ){
+		//オブジェクトまたは構造体
+
+		if( !( type.GetIndex() == 0 || type.GetIndex() == -1 ) ){
+			if( type.GetClass().GetNamespaceScopes().size() >= 1 )
+			{
+				return type.GetClass().GetNamespaceScopes().ToString() + "." + type.GetClass().GetName();
+			}
+			return type.GetClass().GetName();
+		}
+	}
+	else if( type.IsProcPtr() ){
+		if( type.GetIndex() == 0 || type.GetIndex() == -1 ){
+			return "VoidPtr";
+		}
+		else{
+			if( compiler.GetMeta().GetProcPointers()[type.GetIndex()]->ReturnType().IsNull() ){
+				return "*Sub";
+			}
+			return "*Function";
+		}
+	}
+	else{
+		// 基本型
+		const char *lpszTypeName = Type::BasicTypeToCharPtr( type );
+		if( lpszTypeName )
+		{
+			return (const string)lpszTypeName;
+		}
+	}
+
+	SmoothieException::Throw( 1 );
+
+	return (string)"(null)";
+}
Index: trunk/abdev/BasicCompiler_Common/src/ProcedureImpl.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/src/ProcedureImpl.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/src/ProcedureImpl.cpp	(revision 193)
@@ -2,4 +2,5 @@
 #include <jenga/include/smoothie/LexicalAnalysis.h>
 
+#include <Compiler.h>
 #include <ProcedureImpl.h>
 
@@ -104,5 +105,5 @@
 			//cp = nowLine;
 
-			NumOpe_GetType( initValue, Type::String(), type );
+			NumOpe_GetType( initValue, GetStringTypeInfo(), type );
 		}
 		else if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_AS){
@@ -129,5 +130,5 @@
 			}
 
-			Type::StringToType( temporary, type );
+			Compiler::StringToType( temporary, type );
 
 			if( type.IsNull() ){
@@ -257,5 +258,5 @@
 				}
 
-				Type::StringToType( temporary, type );
+				Compiler::StringToType( temporary, type );
 
 				if( type.IsNull() ){
@@ -326,5 +327,5 @@
 					temporary[i3]=sourceOfParams[i2];
 				}
-				Type::StringToType( temporary, this->returnType );
+				Compiler::StringToType( temporary, this->returnType );
 				if( this->returnType.IsNull() ) SmoothieException::Throw(3,temporary,nowLine);
 
@@ -387,5 +388,5 @@
 	}
 
-	return NamespaceScopes::IsSameArea( GetNamespaceScopes(), namespaceScopes );
+	return compiler.IsSameAreaNamespace( GetNamespaceScopes(), namespaceScopes );
 }
 bool GlobalProc::IsEqualSymbol( const GlobalProc &globalProc ) const
@@ -402,4 +403,11 @@
 }
 
+bool DllProcImpl::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const
+{
+	if( GetName() != name ){
+		return false;
+	}
+	return compiler.IsSameAreaNamespace( this->GetNamespaceScopes(), namespaceScopes );
+}
 bool DllProcImpl::SetParamsAndReturnType( const char *sourceOfParams, int nowLine ){
 	int i = 0;
@@ -505,5 +513,5 @@
 			}
 
-			Type::StringToType( temporary, type );
+			Compiler::StringToType( temporary, type );
 
 			if( type.IsNull() ){
@@ -559,5 +567,5 @@
 					temporary[i3]=sourceOfParams[i2];
 				}
-				Type::StringToType( temporary, this->returnType );
+				Compiler::StringToType( temporary, this->returnType );
 				if( this->returnType.IsNull() ) SmoothieException::Throw(3,temporary,nowLine);
 
@@ -676,5 +684,5 @@
 			}
 
-			Type::StringToType( temporary, type );
+			Compiler::StringToType( temporary, type );
 
 			if( type.IsNull() ){
@@ -730,5 +738,5 @@
 					temporary[i3]=sourceOfParams[i2];
 				}
-				Type::StringToType( temporary, this->returnType );
+				Compiler::StringToType( temporary, this->returnType );
 				if( this->returnType.IsNull() ) SmoothieException::Throw(3,temporary,nowLine);
 
Index: trunk/abdev/BasicCompiler_Common/src/SmoothieImpl.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/src/SmoothieImpl.cpp	(revision 192)
+++ trunk/abdev/BasicCompiler_Common/src/SmoothieImpl.cpp	(revision 193)
@@ -6,13 +6,3 @@
 #include <LexicalScopingImpl.h>
 
-MetaImpl SmoothieImpl::metaImpl(
-	new ClassesImpl()
-);
-
 CLexicalScopes *Smoothie::Temp::pLexicalScopes = new LexicalScopesImpl();
-
-
-Meta &Smoothie::GetMeta()
-{
-	return SmoothieImpl::metaImpl;
-}
Index: trunk/abdev/BasicCompiler_Common/src/TypeDef.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/src/TypeDef.cpp	(revision 193)
+++ trunk/abdev/BasicCompiler_Common/src/TypeDef.cpp	(revision 193)
@@ -0,0 +1,242 @@
+#include <jenga/include/smoothie/Smoothie.h>
+#include <jenga/include/smoothie/Class.h>
+#include <jenga/include/smoothie/SmoothieException.h>
+
+#include <TypeDef.h>
+#include <Compiler.h>
+
+TypeDef::TypeDef( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName, int nowLine )
+	: namespaceScopes( namespaceScopes )
+	, name( name )
+	, baseName( baseName )
+{
+	if( !Compiler::StringToType( baseName, baseType ) ){
+		SmoothieException::Throw(3, baseName, nowLine );
+		return;
+	}
+}
+TypeDef::~TypeDef(){
+}
+
+bool TypeDef::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const
+{
+	if( GetName() != name ){
+		return false;
+	}
+	return compiler.IsSameAreaNamespace( this->namespaceScopes, namespaceScopes );
+}
+bool TypeDef::IsEqualSymbol( const string &fullName ) const
+{
+	char AreaName[VN_SIZE] = "";		//オブジェクト変数
+	char NestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = CClass::SplitName( fullName.c_str(), AreaName, NestName );
+
+	if( IsEqualSymbol( NamespaceScopes( AreaName ), NestName ) ){
+		return true;
+	}
+
+	if( isNest ){
+		// 静的メンバを考慮
+
+		char AreaName2[VN_SIZE] = "";		//オブジェクト変数
+		char NestName2[VN_SIZE] = "";		//入れ子メンバ
+		bool isNest = CClass::SplitName( AreaName, AreaName2, NestName2 );
+		lstrcat( NestName2, "." );
+		lstrcat( NestName2, NestName );
+
+		return IsEqualSymbol( NamespaceScopes( AreaName2 ), NestName2 );
+	}
+
+	return false;
+}
+
+
+
+TypeDefCollection::TypeDefCollection(){
+}
+TypeDefCollection::~TypeDefCollection(){
+}
+void TypeDefCollection::Add( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName, int nowLine ){
+	TypeDef typeDef( namespaceScopes, name, baseName, nowLine );
+	this->push_back( typeDef );
+}
+int TypeDefCollection::GetIndex( const NamespaceScopes &namespaceScopes, const string &name ) const{
+	int max = (int)(*this).size();
+	for( int i=0; i<max; i++ ){
+		if( (*this)[i].IsEqualSymbol( namespaceScopes, name ) ){
+			return i;
+		}
+	}
+	return -1;
+}
+int TypeDefCollection::GetIndex( const string &fullName ) const{
+	char AreaName[VN_SIZE] = "";		//オブジェクト変数
+	char NestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = CClass::SplitName( fullName.c_str(), AreaName, NestName );
+
+	return GetIndex( NamespaceScopes( AreaName ), NestName );
+}
+
+void TypeDefCollection::Add( const NamespaceScopes &namespaceScopes, const string &expression, int nowLine ){
+	int i;
+	char temporary[VN_SIZE];
+
+	for(i=0;;i++){
+		if(expression[i]=='='||expression[i]=='\0'){
+			temporary[i]=0;
+			break;
+		}
+		temporary[i]=expression[i];
+	}
+
+	if(expression[i]!='='){
+		SmoothieException::Throw(10,"TypeDef",nowLine);
+		return;
+	}
+
+	const char *pTemp=expression.c_str()+i+1;
+
+	//識別文字のエラーチェック（新しい型）
+	i=0;
+	for(;;i++){
+		if(temporary[i]=='\0') break;
+		if(!IsVariableChar(temporary[i])){
+			SmoothieException::Throw(10,"TypeDef",nowLine);
+			return;
+		}
+	}
+
+	//識別文字のエラーチェック（コピー元の型）
+	if(pTemp[0]=='*'&&pTemp[1]==1&&(pTemp[2]==ESC_FUNCTION||pTemp[2]==ESC_SUB)){
+		//関数ポインタ
+		if(pTemp[3]!='('){
+			SmoothieException::Throw(10,"TypeDef",nowLine);
+			return;
+		}
+	}
+	else{
+		i=0;
+		while(pTemp[i]=='*') i++;
+		for(;;i++){
+			if(pTemp[i]=='\0') break;
+			if(!IsVariableChar(pTemp[i])){
+				SmoothieException::Throw(10,"TypeDef",nowLine);
+				return;
+			}
+		}
+	}
+
+	//識別子が重複している場合はエラーにする
+	if(lstrcmp(temporary,pTemp)==0){
+		SmoothieException::Throw(1,NULL,nowLine);
+		return;
+	}
+
+
+
+	//////////////////////////
+	// TypeDef情報を追加
+	//////////////////////////
+
+	Add( namespaceScopes, temporary, pTemp, nowLine );
+}
+
+void TypeDefCollection::Init(){
+	// 初期化
+	clear();
+
+	// 名前空間管理
+	NamespaceScopes &namespaceScopes = Smoothie::Temp::liveingNamespaceScopes;
+	namespaceScopes.clear();
+
+	// Importsされた名前空間の管理
+	NamespaceScopesCollection &importedNamespaces = compiler.GetImportedNamespaces();
+	importedNamespaces.clear();
+
+	int i=-1, i2;
+	char temporary[VN_SIZE];
+	while(1){
+		extern char *basbuf;
+
+		i++;
+
+		if( basbuf[i] == 1 && basbuf[i+1] == ESC_NAMESPACE ){
+			for(i+=2,i2=0;;i2++,i++){
+				if( IsCommandDelimitation( basbuf[i] ) ){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=basbuf[i];
+			}
+			namespaceScopes.push_back( temporary );
+
+			continue;
+		}
+		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){
+			if( namespaceScopes.size() <= 0 ){
+				SmoothieException::Throw(12, "End Namespace", i );
+			}
+			else{
+				namespaceScopes.pop_back();
+			}
+
+			i += 2;
+			continue;
+		}
+		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_IMPORTS ){
+			for(i+=2,i2=0;;i2++,i++){
+				if( IsCommandDelimitation( basbuf[i] ) ){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=basbuf[i];
+			}
+			if( !compiler.ImportsNamespace( temporary ) )
+			{
+				SmoothieException::Throw(64,temporary,i );
+			}
+
+			continue;
+		}
+		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_CLEARNAMESPACEIMPORTED ){
+			importedNamespaces.clear();
+			continue;
+		}
+
+		if( basbuf[i]==1 ){
+			char temporary[VN_SIZE];
+			if(basbuf[i+1]==ESC_TYPEDEF){
+				int i2 = 0;
+				for(i+=2;;i2++,i++){
+					if(basbuf[i]=='\n'){
+						temporary[i2]=0;
+						break;
+					}
+					temporary[i2]=basbuf[i];
+					if(basbuf[i]=='\0') break;
+				}
+				Add( namespaceScopes, temporary, i );
+
+				continue;
+			}
+			else if( basbuf[i+1] == ESC_CONST && basbuf[i+2] == 1 && basbuf[i+3] == ESC_ENUM ){
+				int i2 = 0;
+				for(i+=4;;i2++,i++){
+					if(!IsVariableChar(basbuf[i])){
+						temporary[i2]=0;
+						break;
+					}
+					temporary[i2]=basbuf[i];
+					if(basbuf[i]=='\0') break;
+				}
+				Add( namespaceScopes, temporary, "Long", i );
+			}
+		}
+
+		//次の行
+		for(;;i++){
+			if(IsCommandDelimitation(basbuf[i])) break;
+		}
+		if(basbuf[i]=='\0') break;
+	}
+}
Index: trunk/abdev/BasicCompiler_Common/src/VariableImpl.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/src/VariableImpl.cpp	(revision 193)
+++ trunk/abdev/BasicCompiler_Common/src/VariableImpl.cpp	(revision 193)
@@ -0,0 +1,22 @@
+#include <Compiler.h>
+#include <VariableImpl.h>
+
+bool VariableImpl::IsEqualSymbol( const Symbol &symbol, bool isSupportStaticMember ) const
+{
+	if( GetName() == symbol.GetName()
+		&& compiler.IsSameAreaNamespace( this->GetNamespaceScopes(), symbol.GetNamespaceScopes() ) )
+	{
+		return true;
+	}
+
+	if( isSupportStaticMember && symbol.GetNamespaceScopes().size() >= 1 )
+	{
+		// 静的メンバを考慮
+		NamespaceScopes namespaceScopes( symbol.GetNamespaceScopes() );
+		string name = namespaceScopes[namespaceScopes.size()-1] + "." + symbol.GetName();
+		namespaceScopes.pop_back();
+
+		return IsEqualSymbol( Symbol( namespaceScopes, name ), false );
+	}
+	return false;
+}
