Index: trunk/abdev/BasicCompiler_Common/include/Compiler.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/Compiler.h	(revision 193)
+++ trunk/abdev/BasicCompiler_Common/include/Compiler.h	(revision 195)
@@ -8,6 +8,4 @@
 	NativeCode nativeCode;
 	MetaImpl metaImpl;
-
-	NamespaceScopesCollection importedNamespaces;
 
 public:
@@ -22,54 +20,7 @@
 	}
 
-	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;
+extern Compiler compiler;
Index: trunk/abdev/BasicCompiler_Common/include/NamespaceSupporter.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/NamespaceSupporter.h	(revision 195)
+++ trunk/abdev/BasicCompiler_Common/include/NamespaceSupporter.h	(revision 195)
@@ -0,0 +1,107 @@
+#pragma once
+
+#include <Compiler.h>
+
+class NamespaceSupporter
+{
+	// Importsされた名前空間
+	NamespaceScopesCollection importedNamespaces;
+
+	// 現在の名前空間
+	NamespaceScopes livingNamespaceScopes;
+
+public:
+	NamespaceScopesCollection &GetImportedNamespaces()
+	{
+		return importedNamespaces;
+	}
+	void SetImportedNamespaces( const NamespaceScopesCollection &namespaces )
+	{
+		this->importedNamespaces = namespaces;
+	}
+	bool ImportsNamespace( const std::string &namespaceStr )
+	{
+		NamespaceScopes namespaceScopes( namespaceStr );
+		if( !compiler.GetMeta().GetNamespaces().IsExist( namespaceScopes ) ){
+			return false;
+		}
+
+		this->importedNamespaces.push_back( namespaceScopes );
+
+		return true;
+	}
+
+	NamespaceScopes &GetLivingNamespaceScopes()
+	{
+		return livingNamespaceScopes;
+	}
+	bool IsLiving( const NamespaceScopes &namespaceScopes ) const
+	{
+		return NamespaceScopes::IsBelong( namespaceScopes, livingNamespaceScopes );
+	}
+
+
+	// 包括しているかをチェック
+	// 例:
+	// this =   "Discoversoft.ActiveBasic"
+	// living = "Discoversoft.ActiveBasic"
+	// entryName =   "ActiveBasic"
+	// この場合、living は entryName を包括している。
+	bool IsCoverd( const NamespaceScopes &namespaceScopes, const string &entryName ) const
+	{
+		if( namespaceScopes.IsEqual( entryName ) ){
+			return true;
+		}
+
+		string thisStr = namespaceScopes.ToString();
+
+		NamespaceScopes tempLivingNamespaceScopes = livingNamespaceScopes;
+
+		while( tempLivingNamespaceScopes.size() ){
+			NamespaceScopes tempNamespaceScopes = tempLivingNamespaceScopes;
+
+			string tempStr = tempNamespaceScopes.ToString() + "." + entryName;
+			if( thisStr == tempStr ){
+				return true;
+			}
+
+			tempLivingNamespaceScopes.pop_back();
+		}
+		return false;
+	}
+	bool IsCoverd( const NamespaceScopes &baseNamespaceScopes, const NamespaceScopes &entryNamespaceScopes ) const
+	{
+		return IsCoverd( baseNamespaceScopes, entryNamespaceScopes.ToString() );
+	}
+
+
+	// 指定された名前空間が同一エリアと見なされるかどうかをチェック
+	bool IsSameAreaNamespace( const NamespaceScopes &baseNamespaceScopes, const NamespaceScopes &entryNamespaceScopes ){
+		if( entryNamespaceScopes.size() ){
+			if( IsCoverd( baseNamespaceScopes, entryNamespaceScopes ) ){
+				// 包括しているときは同一と見なす
+				return true;
+			}
+		}
+		else{
+			if( baseNamespaceScopes.size() ){
+				// 名前空間の判断が必要なとき
+				if( this->importedNamespaces.IsImported( baseNamespaceScopes )
+					|| IsLiving( baseNamespaceScopes ) ){
+					// Using指定があるとき
+					// または
+					// 指定された名前空間が現在の名前空間スコープと同一のとき
+					return true;
+				}
+			}
+			else{
+				return true;
+			}
+		}
+
+		return false;
+	}
+
+	static bool CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection );
+};
+extern NamespaceSupporter namespaceSupporter;
