Index: BasicCompiler_Common/include/Namespace.h
===================================================================
--- BasicCompiler_Common/include/Namespace.h	(revision 103)
+++ BasicCompiler_Common/include/Namespace.h	(revision 105)
@@ -11,5 +11,5 @@
 public:
 	NamespaceScopes(){}
-	NamespaceScopes( const char *name );
+	NamespaceScopes( const string &namespaceStr );
 	~NamespaceScopes(){}
 
@@ -114,2 +114,24 @@
 	}
 };
+
+class NamespaceScopesCollection : public vector<NamespaceScopes>
+{
+public:
+	bool IsExist( const NamespaceScopes &namespaceScopes ) const
+	{
+		const NamespaceScopesCollection &namespaceScopesCollection = *this;
+		BOOST_FOREACH( const NamespaceScopes &tempNamespaceScopes, namespaceScopesCollection ){
+			if( tempNamespaceScopes.IsEqual( namespaceScopes ) ){
+				return true;
+			}
+		}
+		return false;
+	}
+	bool IsExist( const string &namespaceStr ) const
+	{
+		return IsExist( NamespaceScopes( namespaceStr ) );
+	}
+	void SplitNamespace( const char *fullName, char *namespaceStr, char *simpleName ) const;
+
+	static bool CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection );
+};
Index: BasicCompiler_Common/include/Smoothie.h
===================================================================
--- BasicCompiler_Common/include/Smoothie.h	(revision 103)
+++ BasicCompiler_Common/include/Smoothie.h	(revision 105)
@@ -48,4 +48,5 @@
 		static TypeDefCollection typeDefs;
 		static vector<ProcPointer *> procPointers;
+		static NamespaceScopesCollection namespaceScopesCollection;
 	};
 };
Index: BasicCompiler_Common/src/Namespace.cpp
===================================================================
--- BasicCompiler_Common/src/Namespace.cpp	(revision 103)
+++ BasicCompiler_Common/src/Namespace.cpp	(revision 105)
@@ -2,7 +2,7 @@
 
 
-NamespaceScopes::NamespaceScopes( const char *namespaceStr ){
+NamespaceScopes::NamespaceScopes( const string &namespaceStr ){
 	int i = 0;
-	while( namespaceStr[i] ){
+	while( i < (int)namespaceStr.size() ){
 		char temporary[VN_SIZE];
 		for( int i2=0; ; i2++, i++ ){
@@ -61,2 +61,81 @@
 	return IsCoverd( namespaceScopes.ToString() );
 }
+
+
+void NamespaceScopesCollection::SplitNamespace( const char *fullName, char *namespaceStr, char *simpleName ) const
+{
+	NamespaceScopes namespaceScopes( fullName );
+	bool hasSimpleName = false;
+	while( namespaceScopes.size() > 0 ){
+		if( IsExist( namespaceScopes ) ){
+			break;
+		}
+		namespaceScopes.pop_back();
+
+		hasSimpleName = true;
+	}
+
+	lstrcpy( namespaceStr, namespaceScopes.ToString().c_str() );
+
+	bool hasNamespace = false;
+	if( namespaceStr[0] ){
+		hasNamespace = true;
+	}
+
+	int dotLength = 0;
+	if( hasSimpleName && hasNamespace ){
+		dotLength = 1;
+	}
+
+	lstrcpy( simpleName, fullName + lstrlen( namespaceStr ) + dotLength );
+}
+bool NamespaceScopesCollection::CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection )
+{
+	int i, i2;
+	char temporary[VN_SIZE];
+
+	bool isSuccessful = true;
+
+	// 名前空間管理
+	NamespaceScopes namespaceScopes;
+
+	for(i=0;;i++){
+		if(source[i]=='\0') break;
+
+		if( source[i] == 1 && source[i+1] == ESC_NAMESPACE ){
+			for(i+=2,i2=0;;i2++,i++){
+				if( IsCommandDelimitation( source[i] ) ){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=source[i];
+			}
+			namespaceScopes.push_back( temporary );
+
+			if( !namespaceScopesCollection.IsExist( namespaceScopes ) ){
+				namespaceScopesCollection.push_back( namespaceScopes );
+			}
+
+			continue;
+		}
+		else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
+			if( namespaceScopes.size() <= 0 ){
+				SetError(12, "End Namespace", i );
+				isSuccessful = false;
+			}
+			else{
+				namespaceScopes.pop_back();
+			}
+
+			i += 2;
+			continue;
+		}
+	}
+
+	if( namespaceScopes.size() > 0 ){
+		SetError(63,NULL,-1);
+		isSuccessful = false;
+	}
+
+	return isSuccessful;
+}
Index: BasicCompiler_Common/src/Smoothie.cpp
===================================================================
--- BasicCompiler_Common/src/Smoothie.cpp	(revision 103)
+++ BasicCompiler_Common/src/Smoothie.cpp	(revision 105)
@@ -8,2 +8,3 @@
 TypeDefCollection Smoothie::Meta::typeDefs;
 vector<ProcPointer *> Smoothie::Meta::procPointers;
+NamespaceScopesCollection Smoothie::Meta::namespaceScopesCollection;
