Index: trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
===================================================================
--- trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp	(revision 159)
+++ trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp	(revision 182)
@@ -1,2 +1,6 @@
+#include <jenga/include/smoothie/Smoothie.h>
+
+#include <ClassImpl.h>
+
 #include "../BasicCompiler_Common/common.h"
 
@@ -28,5 +32,5 @@
 		(*p)+=lstrlen(buffer+(*p))+1;
 
-		type.SetIndex( (LONG_PTR)pobj_DBClass->Find(szClassName) );
+		type.SetIndex( (LONG_PTR)Smoothie::GetMeta().GetClasses().Find(szClassName) );
 	}
 	else{
@@ -115,14 +119,13 @@
 
 	//イテレータをリセット
-	extern Classes *pobj_DBClass;
-	pobj_DBClass->Iterator_Reset();
+	Smoothie::GetMeta().GetClasses().Iterator_Reset();
 
 	//個数
-	*(long *)(buffer+i2)=pobj_DBClass->Iterator_GetMaxCount();
-	i2+=sizeof(long);
-
-	while(pobj_DBClass->Iterator_HasNext()){
+	*(long *)(buffer+i2)=Smoothie::GetMeta().GetClasses().Iterator_GetMaxCount();
+	i2+=sizeof(long);
+
+	while(Smoothie::GetMeta().GetClasses().Iterator_HasNext()){
 		CClass *pobj_c;
-		pobj_c=pobj_DBClass->Iterator_GetNext();
+		pobj_c=Smoothie::GetMeta().GetClasses().Iterator_GetNext();
 
 		//クラス名
@@ -136,11 +139,11 @@
 	// TypeDef情報
 	//////////////////
-	*(long *)(buffer+i2)=(int)Smoothie::meta.typeDefs.size();
-	i2+=sizeof(long);
-	for(i3=0;i3<(int)Smoothie::meta.typeDefs.size();i3++){
-		lstrcpy(buffer+i2,Smoothie::meta.typeDefs[i3].GetName().c_str() );
-		i2+=lstrlen(buffer+i2)+1;
-
-		lstrcpy(buffer+i2,Smoothie::meta.typeDefs[i3].GetBaseName().c_str() );
+	*(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() );
 		i2+=lstrlen(buffer+i2)+1;
 
@@ -156,5 +159,5 @@
 	*(long *)(buffer+i2)=(int)::globalVars.size();
 	i2+=sizeof(long);
-	foreach( Variable *pVar, ::globalVars ){
+	BOOST_FOREACH( Variable *pVar, ::globalVars ){
 		//変数名
 		lstrcpy(buffer+i2,pVar->GetName().c_str());
@@ -245,5 +248,5 @@
 			}
 
-			foreach( Variable *pVar, pUserProc->localVars ){
+			BOOST_FOREACH( Variable *pVar, pUserProc->localVars ){
 				lstrcpy(buffer+i2,pVar->GetName().c_str());
 				i2+=lstrlen(buffer+i2)+1;
@@ -304,9 +307,9 @@
 
 	//イテレータをリセット
-	pobj_DBClass->Iterator_Reset();
-
-	while(pobj_DBClass->Iterator_HasNext()){
+	Smoothie::GetMeta().GetClasses().Iterator_Reset();
+
+	while(Smoothie::GetMeta().GetClasses().Iterator_HasNext()){
 		CClass *pobj_c;
-		pobj_c=pobj_DBClass->Iterator_GetNext();
+		pobj_c=Smoothie::GetMeta().GetClasses().Iterator_GetNext();
 
 
@@ -324,7 +327,7 @@
 
 		//メンバ
-		*(long *)(buffer+i2)=(int)pobj_c->dynamicMembers.size();
-		i2+=sizeof(long);
-		foreach( CMember *member, pobj_c->dynamicMembers ){
+		*(long *)(buffer+i2)=(int)pobj_c->GetDynamicMembers().size();
+		i2+=sizeof(long);
+		BOOST_FOREACH( CMember *member, pobj_c->GetDynamicMembers() ){
 			// 名前
 			lstrcpy(buffer+i2,member->GetName().c_str());
@@ -353,7 +356,7 @@
 
 		//メソッド
-		*(long *)(buffer+i2)=(long)pobj_c->methods.size();
-		i2+=sizeof(long);
-		foreach( const CMethod *pMethod, pobj_c->methods ){
+		*(long *)(buffer+i2)=(long)pobj_c->GetMethods().size();
+		i2+=sizeof(long);
+		BOOST_FOREACH( const CMethod *pMethod, pobj_c->GetMethods() ){
 			*(Prototype::Accessibility *)(buffer+i2)=pMethod->GetAccessibility();
 			i2+=sizeof(Prototype::Accessibility);
@@ -371,7 +374,7 @@
 
 		//静的メンバ
-		*(long *)(buffer+i2)=(long)pobj_c->staticMembers.size();
-		i2+=sizeof(long);
-		foreach( CMember *member, pobj_c->staticMembers ){
+		*(long *)(buffer+i2)=(long)pobj_c->GetStaticMembers().size();
+		i2+=sizeof(long);
+		BOOST_FOREACH( CMember *member, pobj_c->GetStaticMembers() ){
 			// 名前
 			lstrcpy(buffer+i2,member->GetName().c_str());
@@ -432,5 +435,5 @@
 	char temp2[MAX_PATH],*temp5;
 
-	pobj_CompilingClass = NULL;
+	Smoothie::Temp::pCompilingClass = NULL;
 
 	i2=0;
@@ -482,5 +485,5 @@
 	///////////////////////////////////////////
 
-	this->pobj_DBClass=new Classes();
+	this->pobj_DBClass=new ClassesImpl();
 
 	int iMaxClassCount;
@@ -490,10 +493,9 @@
 		//クラス名
 		// TODO: 名前空間が未完成
-		pobj_DBClass->AddClass(NamespaceScopes(),NamespaceScopesCollection(),buffer+i2,0);
-		i2+=lstrlen(buffer+i2)+1;
-	}
-
-	extern Classes *pobj_DBClass;
-	pobj_DBClass=this->pobj_DBClass;
+		this->pobj_DBClass->Add(NamespaceScopes(),NamespaceScopesCollection(),buffer+i2,0);
+		i2+=lstrlen(buffer+i2)+1;
+	}
+
+	Smoothie::GetMeta().SetClasses( this->pobj_DBClass );
 
 
@@ -503,5 +505,5 @@
 
 	//初期化
-	Smoothie::meta.typeDefs.clear();
+	Smoothie::GetMeta().typeDefs.clear();
 
 	//個数を取得
@@ -513,5 +515,5 @@
 
 		// 名前空間に未対応
-		Smoothie::meta.typeDefs.push_back( TypeDef( NamespaceScopes(), temp5, buffer+i2 ) );
+		Smoothie::GetMeta().typeDefs.push_back( TypeDef( NamespaceScopes(), temp5, buffer+i2, -1 ) );
 
 		i2+=lstrlen(buffer+i2)+1;
@@ -590,5 +592,5 @@
 		const CClass *pClass = NULL;
 		if(szParentClassName[0]){
-			pClass=pobj_DBClass->Find(szParentClassName);
+			pClass=Smoothie::GetMeta().GetClasses().Find(szParentClassName);
 		}
 
@@ -695,5 +697,5 @@
 		i2+=lstrlen(buffer+i2)+1;
 
-		pobj_c =  const_cast<CClass *>( pobj_DBClass->Find(szClassName) );
+		pobj_c =  const_cast<CClass *>( Smoothie::GetMeta().GetClasses().Find(szClassName) );
 
 		//仮想関数の数
@@ -724,10 +726,10 @@
 			i2+=sizeof(Prototype::Accessibility);
 
-			CMember *member=new CMember( accessibility, name, type, false );
+			CMember *member=new CMember( accessibility, name, type, false, "", "" );
 
 			memcpy(member->SubScripts,buffer+i2,sizeof(int)*MAX_ARRAYDIM);
 			i2+=sizeof(int)*MAX_ARRAYDIM;
 
-			pobj_c->dynamicMembers.push_back( member );
+			pobj_c->GetDynamicMembers().push_back( member );
 		}
 
@@ -746,5 +748,5 @@
 			const CClass *pobj_InheritsClass = NULL;
 			if(szInherits[0]){
-				pobj_InheritsClass=pobj_DBClass->Find(szInherits);
+				pobj_InheritsClass=Smoothie::GetMeta().GetClasses().Find(szInherits);
 			}
 
@@ -764,5 +766,5 @@
 			CMethod *pMethod = new DynamicMethod( pUserProc, accessibility, 0,0,false, pobj_InheritsClass);
 
-			pobj_c->methods.push_back( pMethod );
+			pobj_c->GetMethods().push_back( pMethod );
 		}
 
@@ -786,10 +788,10 @@
 			i2+=sizeof(Prototype::Accessibility);
 
-			CMember *member=new CMember( accessibility, name, type, false );
+			CMember *member=new CMember( accessibility, name, type, false, "", "" );
 
 			memcpy(member->SubScripts,buffer+i2,sizeof(int)*MAX_ARRAYDIM);
 			i2+=sizeof(int)*MAX_ARRAYDIM;
 
-			pobj_c->staticMembers.push_back( member );
+			pobj_c->GetStaticMembers().push_back( member );
 		}
 	}
@@ -943,6 +945,5 @@
 
 	// クラス情報
-	extern Classes *pobj_DBClass;
-	pobj_DBClass=this->pobj_DBClass;
+	Smoothie::GetMeta().SetClasses( this->pobj_DBClass );
 
 	//定数を取得
@@ -979,6 +980,6 @@
 
 	//クラスに関するメモリを解放
-	delete pobj_DBClass;
-	pobj_DBClass=0;
+	delete this->pobj_DBClass;
+	this->pobj_DBClass=0;
 
 	//サブルーチン情報のメモリ解放
@@ -992,5 +993,5 @@
 
 	//コードバッファを解放
-	HeapDefaultFree(OpBuffer);
+	free(OpBuffer);
 	OpBuffer=0;
 
