Index: BasicCompiler_Common/Class.cpp
===================================================================
--- BasicCompiler_Common/Class.cpp	(revision 101)
+++ BasicCompiler_Common/Class.cpp	(revision 102)
@@ -194,7 +194,23 @@
 }
 
-bool CClass::IsEqualSymbol() const
-{
-	return false;
+bool CClass::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const
+{
+	if( GetName() != name ){
+		return false;
+	}
+
+	return NamespaceScopes::IsSameArea( GetNamespaceScopes(), namespaceScopes );
+}
+bool CClass::IsEqualSymbol( const CClass &objClass ) const
+{
+	return IsEqualSymbol( objClass.GetNamespaceScopes(), objClass.GetName() );
+}
+bool CClass::IsEqualSymbol( const string &fullName ) const
+{
+	char AreaName[VN_SIZE] = "";		//オブジェクト変数
+	char NestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );
+
+	return IsEqualSymbol( NamespaceScopes( AreaName ), NestName );
 }
 
@@ -735,5 +751,5 @@
 
 
-int CDBClass::hash(const char *name){
+int CDBClass::hash(const char *name) const{
 	int key;
 
@@ -789,7 +805,12 @@
 }
 
-CClass *CDBClass::check(const char *name){
+CClass *CDBClass::Find( const string &fullName ) const
+{
+	char AreaName[VN_SIZE] = "";		//オブジェクト変数
+	char NestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );
+
 	int key;
-	key=hash(name);
+	key=hash(NestName);
 
 	if(pobj_ClassHash[key]){
@@ -797,6 +818,26 @@
 		pobj_c=pobj_ClassHash[key];
 		while(1){
-			if(lstrcmp(name,pobj_c->name)==0){
-				//重複した場合
+			if( pobj_c->IsEqualSymbol( fullName ) ){
+				//名前空間とクラス名が一致した
+				return pobj_c;
+			}
+
+			if(pobj_c->pobj_NextClass==0) break;
+			pobj_c=pobj_c->pobj_NextClass;
+		}
+	}
+	return NULL;
+}
+CClass *CDBClass::Find( const NamespaceScopes &namespaceScopes, const string &name ) const
+{
+	int key;
+	key=hash(name.c_str());
+
+	if(pobj_ClassHash[key]){
+		CClass *pobj_c;
+		pobj_c=pobj_ClassHash[key];
+		while(1){
+			if( pobj_c->IsEqualSymbol( namespaceScopes, name ) ){
+				//名前空間とクラス名が一致した
 				return pobj_c;
 			}
@@ -838,6 +879,6 @@
 		pobj_c2=pobj_ClassHash[key];
 		while(1){
-			if(lstrcmp(name,pobj_c2->name)==0){
-				//重複した場合
+			if( pobj_c2->IsEqualSymbol( namespaceScopes, name ) ){
+				//名前空間及びクラス名が重複した場合
 				SetError(15,name,nowLine);
 				return 0;
@@ -1100,8 +1141,38 @@
 	char temporary[8192];
 
+	// 名前空間管理
+	NamespaceScopes &namespaceScopes = Smoothie::Lexical::liveingNamespaceScopes;
+	namespaceScopes.clear();
+
 	for(i=0;;i++){
 		if(basbuf[i]=='\0') break;
 
-		CClass *pobj_c;
+
+		// 名前空間
+		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 ){
+				SetError(12, "End Namespace", i );
+			}
+			else{
+				namespaceScopes.pop_back();
+			}
+
+			i += 2;
+			continue;
+		}
+
+
 
 		if(basbuf[i]==1&&basbuf[i+1]==ESC_INTERFACE){
@@ -1117,5 +1188,5 @@
 			GetIdentifierToken( temporary, basbuf, i );
 
-			pobj_c=pobj_DBClass->check(temporary);
+			CClass *pobj_c=pobj_DBClass->Find(namespaceScopes, temporary);
 			if(!pobj_c) continue;
 
@@ -1155,5 +1226,5 @@
 
 				//継承元クラスを取得
-				CClass *pInheritsClass = check(temporary);
+				CClass *pInheritsClass = Find(temporary);
 				if( !pInheritsClass ){
 					SetError(106,temporary,i);
@@ -1263,5 +1334,5 @@
 			GetIdentifierToken( temporary, basbuf, i );
 
-			pobj_c=pobj_DBClass->check(temporary);
+			CClass *pobj_c=pobj_DBClass->Find(namespaceScopes, temporary);
 			if(!pobj_c) continue;
 
@@ -1320,5 +1391,5 @@
 
 				//継承元クラスを取得
-				CClass *pInheritsClass = check(temporary);
+				CClass *pInheritsClass = Find(temporary);
 				if( !pInheritsClass ){
 					SetError(106,temporary,i);
@@ -1328,5 +1399,5 @@
 				if( pInheritsClass->IsInterface() ){
 					// クラスを継承していないとき
-					CClass *pObjectClass = check("Object");
+					CClass *pObjectClass = Find("Object");
 					if( !pObjectClass ){
 						SetError(106,"Object",i);
