Index: trunk/ab5.0/abdev/ab_common/ab_common.vcproj
===================================================================
--- trunk/ab5.0/abdev/ab_common/ab_common.vcproj	(revision 505)
+++ trunk/ab5.0/abdev/ab_common/ab_common.vcproj	(revision 507)
@@ -320,4 +320,8 @@
 					>
 				</File>
+				<File
+					RelativePath=".\include\NamespaceSupporter.h"
+					>
+				</File>
 			</Filter>
 		</Filter>
@@ -340,4 +344,8 @@
 				<File
 					RelativePath=".\src\Namespace.cpp"
+					>
+				</File>
+				<File
+					RelativePath=".\src\NamespaceSupporter.cpp"
 					>
 				</File>
Index: trunk/ab5.0/abdev/ab_common/include/Namespace.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Namespace.h	(revision 505)
+++ trunk/ab5.0/abdev/ab_common/include/Namespace.h	(revision 507)
@@ -1,7 +1,3 @@
 #pragma once
-
-#include <vector>
-#include <string>
-#include <boost/foreach.hpp>
 
 
Index: trunk/ab5.0/abdev/ab_common/include/NamespaceSupporter.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/NamespaceSupporter.h	(revision 507)
+++ trunk/ab5.0/abdev/ab_common/include/NamespaceSupporter.h	(revision 507)
@@ -0,0 +1,121 @@
+#pragma once
+
+namespace ActiveBasic{ namespace Common{ namespace Lexical{
+
+
+class NamespaceSupporter
+{
+	const NamespaceScopesCollection *allNamespaceScopesCollection;
+
+	// Importsされた名前空間
+	NamespaceScopesCollection importedNamespaces;
+
+	// 現在の名前空間
+	NamespaceScopes livingNamespaceScopes;
+
+public:
+	NamespaceSupporter()
+		: allNamespaceScopesCollection( NULL )
+	{
+	}
+
+	void RegistAllNamespaceScopesCollection( const NamespaceScopesCollection *allNamespaceScopesCollection )
+	{
+		this->allNamespaceScopesCollection = allNamespaceScopesCollection;
+	}
+
+	NamespaceScopesCollection &GetImportedNamespaces()
+	{
+		return importedNamespaces;
+	}
+	void SetImportedNamespaces( const NamespaceScopesCollection &namespaces )
+	{
+		this->importedNamespaces = namespaces;
+	}
+	bool ImportsNamespace( const NamespaceScopes &namespaceScopes );
+	bool ImportsNamespace( const std::string &namespaceStr );
+
+	NamespaceScopes &GetLivingNamespaceScopes()
+	{
+		return livingNamespaceScopes;
+	}
+	void SetLivingNamespaceScopes( const NamespaceScopes &namespaceScopes )
+	{
+		this->livingNamespaceScopes = namespaceScopes;
+	}
+	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 std::string &entryName ) const
+	{
+		if( namespaceScopes.IsEqual( entryName ) )
+		{
+			return true;
+		}
+
+		std::string thisStr = namespaceScopes.ToString();
+
+		NamespaceScopes tempLivingNamespaceScopes = livingNamespaceScopes;
+
+		while( tempLivingNamespaceScopes.size() )
+		{
+			std::string tempStr = tempLivingNamespaceScopes.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 ) const
+	{
+		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;
+	}
+};
+
+
+}}}
Index: trunk/ab5.0/abdev/ab_common/src/NamespaceSupporter.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/NamespaceSupporter.cpp	(revision 507)
+++ trunk/ab5.0/abdev/ab_common/src/NamespaceSupporter.cpp	(revision 507)
@@ -0,0 +1,21 @@
+#include "stdafx.h"
+
+using namespace ActiveBasic::Common::Lexical;
+
+bool NamespaceSupporter::ImportsNamespace( const NamespaceScopes &namespaceScopes )
+{
+	if( !allNamespaceScopesCollection->IsExist( namespaceScopes ) ){
+		return false;
+	}
+
+	this->importedNamespaces.push_back( namespaceScopes );
+
+	return true;
+}
+
+bool NamespaceSupporter::ImportsNamespace( const std::string &namespaceStr )
+{
+	NamespaceScopes namespaceScopes( namespaceStr );
+
+	return ImportsNamespace( namespaceScopes );
+}
Index: trunk/ab5.0/abdev/ab_common/stdafx.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/stdafx.h	(revision 505)
+++ trunk/ab5.0/abdev/ab_common/stdafx.h	(revision 507)
@@ -34,2 +34,3 @@
 
 #include <Namespace.h>
+#include <NamespaceSupporter.h>
