Index: trunk/abdev/BasicCompiler64/BasicCompiler.vcproj
===================================================================
--- trunk/abdev/BasicCompiler64/BasicCompiler.vcproj	(revision 204)
+++ trunk/abdev/BasicCompiler64/BasicCompiler.vcproj	(revision 206)
@@ -55,5 +55,5 @@
 				RuntimeLibrary="1"
 				RuntimeTypeInfo="true"
-				UsePrecompiledHeader="0"
+				UsePrecompiledHeader="2"
 				PrecompiledHeaderFile=".\Debug/BasicCompiler.pch"
 				AssemblerListingLocation=".\Debug/"
@@ -167,5 +167,5 @@
 				RuntimeLibrary="1"
 				RuntimeTypeInfo="true"
-				UsePrecompiledHeader="0"
+				UsePrecompiledHeader="2"
 				PrecompiledHeaderFile=".\Release/BasicCompiler.pch"
 				AssemblerListingLocation=".\Release/"
@@ -246,8 +246,4 @@
 			</File>
 			<File
-				RelativePath="..\BasicCompiler_Common\BasicFixed.h"
-				>
-			</File>
-			<File
 				RelativePath="CommandValue.h"
 				>
@@ -263,4 +259,8 @@
 			<File
 				RelativePath="..\BasicCompiler_Common\include\option.h"
+				>
+			</File>
+			<File
+				RelativePath=".\stdafx.h"
 				>
 			</File>
@@ -289,5 +289,5 @@
 				>
 				<File
-					RelativePath="..\BasicCompiler_Common\include\ClassImpl.h"
+					RelativePath="..\BasicCompiler_Common\include\Class.h"
 					>
 				</File>
@@ -301,4 +301,8 @@
 				</File>
 				<File
+					RelativePath="..\BasicCompiler_Common\include\Const.h"
+					>
+				</File>
+				<File
 					RelativePath="..\BasicCompiler_Common\include\DataTable.h"
 					>
@@ -313,13 +317,25 @@
 				</File>
 				<File
+					RelativePath="..\BasicCompiler_Common\include\Member.h"
+					>
+				</File>
+				<File
 					RelativePath="..\BasicCompiler_Common\include\MetaImpl.h"
 					>
 				</File>
 				<File
+					RelativePath="..\BasicCompiler_Common\include\Method.h"
+					>
+				</File>
+				<File
 					RelativePath="..\BasicCompiler_Common\include\NamespaceSupporter.h"
 					>
 				</File>
 				<File
-					RelativePath="..\BasicCompiler_Common\include\ProcedureImpl.h"
+					RelativePath="..\BasicCompiler_Common\include\Parameter.h"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\include\Procedure.h"
 					>
 				</File>
@@ -329,13 +345,25 @@
 				</File>
 				<File
+					RelativePath="..\BasicCompiler_Common\include\Prototype.h"
+					>
+				</File>
+				<File
 					RelativePath="..\BasicCompiler_Common\include\SmoothieImpl.h"
 					>
 				</File>
 				<File
+					RelativePath="..\BasicCompiler_Common\include\Symbol.h"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\include\Type.h"
+					>
+				</File>
+				<File
 					RelativePath="..\BasicCompiler_Common\include\TypeDef.h"
 					>
 				</File>
 				<File
-					RelativePath="..\BasicCompiler_Common\include\VariableImpl.h"
+					RelativePath="..\BasicCompiler_Common\include\Variable.h"
 					>
 				</File>
@@ -396,4 +424,24 @@
 						Name="VCResourceCompilerTool"
 						PreprocessorDefinitions="_DEBUG;JPN;$(NoInherit)"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\stdafx.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						UsePrecompiledHeader="1"
 					/>
 				</FileConfiguration>
@@ -981,16 +1029,4 @@
 				</Filter>
 				<Filter
-					Name="Constant"
-					>
-					<File
-						RelativePath="..\BasicCompiler_Common\Const.cpp"
-						>
-					</File>
-					<File
-						RelativePath="..\BasicCompiler_Common\Const.h"
-						>
-					</File>
-				</Filter>
-				<Filter
 					Name="Variable"
 					>
@@ -1021,5 +1057,5 @@
 				>
 				<File
-					RelativePath="..\BasicCompiler_Common\src\ClassImpl.cpp"
+					RelativePath="..\BasicCompiler_Common\src\Class.cpp"
 					>
 				</File>
@@ -1033,4 +1069,8 @@
 				</File>
 				<File
+					RelativePath="..\BasicCompiler_Common\src\Const.cpp"
+					>
+				</File>
+				<File
 					RelativePath="..\BasicCompiler_Common\src\DataTable.cpp"
 					>
@@ -1045,9 +1085,13 @@
 				</File>
 				<File
+					RelativePath="..\BasicCompiler_Common\src\Method.cpp"
+					>
+				</File>
+				<File
 					RelativePath="..\BasicCompiler_Common\src\NamespaceSupporter.cpp"
 					>
 				</File>
 				<File
-					RelativePath="..\BasicCompiler_Common\src\ProcedureImpl.cpp"
+					RelativePath="..\BasicCompiler_Common\src\Procedure.cpp"
 					>
 				</File>
@@ -1061,9 +1105,17 @@
 				</File>
 				<File
+					RelativePath="..\BasicCompiler_Common\src\Symbol.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\src\Type.cpp"
+					>
+				</File>
+				<File
 					RelativePath="..\BasicCompiler_Common\src\TypeDef.cpp"
 					>
 				</File>
 				<File
-					RelativePath="..\BasicCompiler_Common\src\VariableImpl.cpp"
+					RelativePath="..\BasicCompiler_Common\src\Variable.cpp"
 					>
 				</File>
Index: trunk/abdev/BasicCompiler64/CLockParameter.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/CLockParameter.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/CLockParameter.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include "../BasicCompiler_Common/common.h"
 #include "opcode.h"
Index: trunk/abdev/BasicCompiler64/CParameter.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/CParameter.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/CParameter.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include "../BasicCompiler_Common/common.h"
 #include "opcode.h"
@@ -110,5 +112,5 @@
 
 				//call free
-				extern UserProc *pSub_free;
+				extern const UserProc *pSub_free;
 				op_call(pSub_free);
 			}
@@ -133,5 +135,5 @@
 
 		//call calloc
-		extern UserProc *pSub_calloc;
+		extern const UserProc *pSub_calloc;
 		op_call(pSub_calloc);
 
Index: trunk/abdev/BasicCompiler64/Compile_Calc.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Compile_Calc.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/Compile_Calc.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include <jenga/include/smoothie/Smoothie.h>
 #include <jenga/include/smoothie/LexicalAnalysis.h>
@@ -94,5 +96,7 @@
 			}
 			else{
-				if(GetConstHash(variable)){
+				if( compiler.GetMeta().GetGlobalConsts().IsExist(variable)
+					|| compiler.GetMeta().GetGlobalConstMacros().IsExist(variable) )
+				{
 					//定数リストに該当したとき
 					SetError(1,NULL,cp);
@@ -234,5 +238,5 @@
 	if( varType.IsObject() && compiler.GetMeta().GetBlittableTypes().IsExist( calcType ) ){
 		// Blittable型をオブジェクトとして扱う
-		vector<UserProc *> userProcs;
+		vector<const UserProc *> userProcs;
 		compiler.GetMeta().GetBlittableTypes().GetClass( calcType ).GetStaticMethods().Enum( "_Create", userProcs );
 		if( userProcs.size() != 1 ){
@@ -240,5 +244,5 @@
 			return;
 		}
-		UserProc *pUserProc = userProcs[0];
+		const UserProc *pUserProc = userProcs[0];
 
 		// mov rcx, rax
Index: trunk/abdev/BasicCompiler64/Compile_Calc_PushVar.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Compile_Calc_PushVar.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/Compile_Calc_PushVar.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include "../BasicCompiler_Common/common.h"
 #include "Opcode.h"
Index: trunk/abdev/BasicCompiler64/Compile_CallProc.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Compile_CallProc.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/Compile_CallProc.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include <jenga/include/smoothie/Smoothie.h>
 
@@ -12,5 +14,5 @@
 void Call_DebugSys_SaveContext(){
 	//call _System_GetEip
-	extern UserProc *pSub_System_GetEip;
+	extern const UserProc *pSub_System_GetEip;
 	op_call(pSub_System_GetEip);
 
@@ -22,5 +24,5 @@
 
 	//call _DebugSys_SaveContext
-	extern UserProc *pSub_DebugSys_SaveContext;
+	extern const UserProc *pSub_DebugSys_SaveContext;
 	op_call(pSub_DebugSys_SaveContext);
 }
@@ -99,5 +101,5 @@
 }
 
-bool Opcode_CallProc(const char *Parameter,UserProc *pUserProc,DWORD dwFlags,const char *ObjectName,int RefType){
+bool Opcode_CallProc(const char *Parameter,const UserProc *pUserProc,DWORD dwFlags,const char *ObjectName,int RefType){
 	// TODO: RefTypeは不必要なので削除する
 	int i2;
@@ -128,5 +130,5 @@
 			if(lstrcmpi(ObjectName,"Super")==0){
 				//クラスメンバ関数内から基底クラスの呼び出し
-				pobj_c=Smoothie::Temp::pCompilingClass;
+				pobj_c=compiler.pCompilingClass;
 			}
 			else{
@@ -153,5 +155,5 @@
 			else{
 				//クラスメンバ関数内から同一クラスのメンバ関数の呼び出し
-				pobj_c=Smoothie::Temp::pCompilingClass;
+				pobj_c=compiler.pCompilingClass;
 			}
 		}
@@ -182,5 +184,5 @@
 		if(ObjectName[0]){
 			//外部からの呼び出し
-			if(pobj_c==Smoothie::Temp::pCompilingClass){
+			if(pobj_c==compiler.pCompilingClass){
 				//同一クラスオブジェクトの場合はプライベートアクセスを容認する
 				if( pMethod->IsNoneAccess() ){
@@ -279,5 +281,5 @@
 
 			//call calloc
-			extern UserProc *pSub_calloc;
+			extern const UserProc *pSub_calloc;
 			op_call(pSub_calloc);
 
Index: trunk/abdev/BasicCompiler64/Compile_Func.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Compile_Func.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/Compile_Func.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include <jenga/include/smoothie/Smoothie.h>
 
@@ -46,7 +48,7 @@
 	}
 
-	int SubScripts[MAX_ARRAYDIM];
+	Subscripts subscripts;
 	RELATIVE_VAR RelativeVar;
-	if(!GetVarOffsetReadOnly(tempParm,&RelativeVar,type,SubScripts)) return;
+	if(!GetVarOffsetReadOnly(tempParm,&RelativeVar,type,&subscripts)) return;
 
 	if(type.GetBasicType()&FLAG_PTR){
@@ -59,5 +61,5 @@
 	int typeSize = type.GetSize();
 
-	if(bArrayHead) typeSize*=JumpSubScripts(SubScripts);
+	if(bArrayHead) typeSize*=JumpSubScripts(subscripts);
 
 	//mov rax,TypeSize
@@ -68,5 +70,5 @@
 void Opcode_Func_AddressOf( const char *name ){
 	extern int cp;
-	UserProc *pUserProc;
+	const UserProc *pUserProc;
 
 	extern LONG_PTR ProcPtr_BaseIndex;
@@ -74,5 +76,5 @@
 		//左辺の型にのっとり、オーバーロードを解決
 
-		std::vector<UserProc *> subs;
+		std::vector<const UserProc *> subs;
 		GetOverloadSubHash( name, subs );
 		if( subs.size() == 0 ){
@@ -131,5 +133,5 @@
 			SetThisPtrToReg(REG_RCX);
 
-			pobj_c=Smoothie::Temp::pCompilingClass;
+			pobj_c=compiler.pCompilingClass;
 		}
 
Index: trunk/abdev/BasicCompiler64/Compile_Interface.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Compile_Interface.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/Compile_Interface.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include "../BasicCompiler_Common/common.h"
 #include "opcode.h"
Index: trunk/abdev/BasicCompiler64/Compile_Object.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Compile_Object.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/Compile_Object.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include "../BasicCompiler_Common/common.h"
 #include "opcode.h"
@@ -33,8 +35,8 @@
 	////////////////////////
 
-	std::vector<UserProc *> subs;
+	std::vector<const UserProc *> subs;
 	pobj_c->GetMethods().Enum( pobj_c->GetName().c_str(), subs );
 
-	UserProc *pUserProc;
+	const UserProc *pUserProc;
 	if( subs.size() > 0 ){
 		//オーバーロードを解決
@@ -142,5 +144,5 @@
 
 		//call _System_GC_malloc_ForObject
-		extern UserProc *pSub_System_GC_malloc_ForObject;
+		extern const UserProc *pSub_System_GC_malloc_ForObject;
 		op_call(pSub_System_GC_malloc_ForObject);
 	}
@@ -150,5 +152,5 @@
 
 		//call _System_GC_malloc_ForObjectPtr
-		extern UserProc *pSub_System_GC_malloc_ForObjectPtr;
+		extern const UserProc *pSub_System_GC_malloc_ForObjectPtr;
 		op_call(pSub_System_GC_malloc_ForObjectPtr);
 	}
@@ -185,6 +187,6 @@
 	op_mov_RV(sizeof(_int64),REG_RCX,0);
 	obp-=sizeof(long);
-	pobj_SubAddrSchedule->add(method->pUserProc,0);
-	method->pUserProc->Using();
+	pobj_SubAddrSchedule->add(&method->GetUserProc(),0);
+	method->GetUserProc().Using();
 	obp+=sizeof(long);
 
@@ -299,10 +301,10 @@
 	if( isSweeping ){
 		//call _System_GC_free_for_SweepingDelete
-		extern UserProc *pSub_System_GC_free_for_SweepingDelete;
+		extern const UserProc *pSub_System_GC_free_for_SweepingDelete;
 		op_call(pSub_System_GC_free_for_SweepingDelete);
 	}
 	else{
 		//call free
-		extern UserProc *pSub_free;
+		extern const UserProc *pSub_free;
 		op_call(pSub_free);
 	}
Index: trunk/abdev/BasicCompiler64/Compile_ProcOp.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Compile_ProcOp.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/Compile_ProcOp.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include <jenga/include/smoothie/Smoothie.h>
 #include <jenga/include/smoothie/LexicalAnalysis.h>
@@ -5,6 +7,5 @@
 #include <Compiler.h>
 #include <LexicalScopingImpl.h>
-#include <ClassImpl.h>
-#include <VariableImpl.h>
+#include <Class.h>
 
 #include "../BasicCompiler_Common/common.h"
@@ -31,6 +32,5 @@
 		}
 
-		UserProc *pBackUserProc;
-		pBackUserProc = &UserProc::CompilingUserProc();
+		const UserProc *pBackUserProc = &UserProc::CompilingUserProc();
 		UserProc::CompileStartForGlobalArea();
 
@@ -54,5 +54,5 @@
 
 		//_System_StartupProgramの呼び出し
-		extern UserProc *pSub_System_StartupProgram;
+		extern const UserProc *pSub_System_StartupProgram;
 		op_call(pSub_System_StartupProgram);
 
@@ -82,8 +82,8 @@
 		StackFrameSchedule=obp-sizeof(long);
 
-		BOOST_FOREACH( Variable *pVar, globalVars ){
+		BOOST_FOREACH( Variable *pVar, compiler.GetMeta().GetGlobalVars() ){
 			if(memicmp(pVar->GetName().c_str(),"Static%",7)==0){
 				//コンストラクタ呼び出し
-				if( pVar->IsObject() ){
+				if( pVar->GetType().IsObject() ){
 
 					//エラー用
@@ -92,7 +92,7 @@
 					CallConstructor(
 						pVar->GetName().c_str(),
-						pVar->GetSubScriptsPtr(),
-						*pVar,
-						pVar->paramStrForConstructor.c_str());
+						pVar->GetSubscripts(),
+						pVar->GetType(),
+						pVar->GetParamStrForConstructor().c_str());
 				}
 			}
@@ -113,6 +113,5 @@
 
 
-		UserProc *pBackUserProc;
-		pBackUserProc = &UserProc::CompilingUserProc();
+		const UserProc *pBackUserProc = &UserProc::CompilingUserProc();
 		UserProc::CompileStartForGlobalArea();
 
@@ -212,5 +211,5 @@
 	}
 }
-void AutoGeneration(UserProc &userProc){
+void AutoGeneration(const UserProc &userProc){
 	if( userProc.GetName() == "InitializeUserTypes"
 		&& userProc.HasParentClass()
@@ -229,8 +228,7 @@
 	}
 }
-void _compile_proc(UserProc *pUserProc){
+void _compile_proc(const UserProc *pUserProc){
 	extern char *basbuf;
 	extern HANDLE hHeap;
-	extern GlobalProc **ppSubHash;
 	extern BOOL bDebugCompile;
 	int i3,i4;
@@ -239,8 +237,10 @@
 	if( pUserProc->IsUsing() == false || pUserProc->IsCompiled() ) return;
 
-	if( pUserProc->localVars.size() ){
+	if( pUserProc->GetLocalVars().size() ){
 		SetError();
 		return;
 	}
+
+	trace_for_sourcecodestep( "★★★ " << pUserProc->GetFullName() << "のコンパイルを開始" );
 
 	pUserProc->CompleteCompile();
@@ -259,8 +259,8 @@
 	else bDebugSupportProc=0;
 
-	pUserProc->beginOpAddress=obp;
+	pUserProc->SetBeginOpAddress( obp );
 
 	//コンパイル中の関数が属するクラス
-	Smoothie::Temp::pCompilingClass=pUserProc->GetParentClassPtr();
+	compiler.pCompilingClass=pUserProc->GetParentClassPtr();
 
 	//コンパイルスタートをクラス管理クラスに追加
@@ -294,5 +294,5 @@
 		pobj_sf=0;
 
-		pUserProc->endOpAddress=obp;
+		pUserProc->SetEndOpAddress( obp );
 		return;
 	}
@@ -360,8 +360,8 @@
 		Parameter &param = *pUserProc->RealParams()[i3];
 
-		Variable *pVar = new VariableImpl( param.GetVarName(), param, false, param.IsRef() );
+		Variable *pVar = new Variable( param.GetVarName(), param, false, param.IsRef(), "" );
 
 		if( param.IsArray() ){
-			pVar->SetArray( param.GetSubScriptsPtr() );
+			pVar->SetArray( param.GetSubscripts() );
 		}
 
@@ -381,12 +381,12 @@
 		}
 		AllLocalVarSize+=varSize;
-		pVar->offset=AllLocalVarSize;
+		pVar->SetOffsetAddress( AllLocalVarSize );
 
 		//レキシカルスコープ情報
-		pVar->ScopeLevel=GetLexicalScopes().GetNowLevel();
-		pVar->ScopeStartAddress=GetLexicalScopes().GetStartAddress();
+		pVar->SetScopeLevel( GetLexicalScopes().GetNowLevel() );
+		pVar->SetScopeStartAddress( GetLexicalScopes().GetStartAddress() );
 		pVar->bLiving=TRUE;
 
-		pUserProc->localVars.push_back( pVar );
+		pUserProc->GetLocalVars().push_back( pVar );
 	}
 
@@ -507,10 +507,10 @@
 
 		//call _DebugSys_StartProc
-		extern UserProc *pSub_DebugSys_StartProc;
+		extern const UserProc *pSub_DebugSys_StartProc;
 		op_call(pSub_DebugSys_StartProc);
 	}
 
-	if(Smoothie::Temp::pCompilingClass){
-		if( pUserProc->GetName() == Smoothie::Temp::pCompilingClass->GetName() ){
+	if(compiler.pCompilingClass){
+		if( pUserProc->GetName() == compiler.pCompilingClass->GetName() ){
 			////////////////////////////////////
 			// コンストラクタをコンパイルするとき
@@ -518,11 +518,11 @@
 
 			//コンストラクタのコンパイル開始を通知
-			Smoothie::Temp::pCompilingClass->NotifyStartConstructorCompile();
+			compiler.pCompilingClass->NotifyStartConstructorCompile();
 
 			//基底クラスかどうかの識別
 			//（継承元がインターフェイスの場合も基底クラスと見なす）
 			BOOL bThisIsSuperClass;
-			if( !Smoothie::Temp::pCompilingClass->HasSuperClass() ) bThisIsSuperClass=1;
-			else if( Smoothie::Temp::pCompilingClass->GetSuperClass().GetConstructorMethod() == NULL ){
+			if( !compiler.pCompilingClass->HasSuperClass() ) bThisIsSuperClass=1;
+			else if( compiler.pCompilingClass->GetSuperClass().GetConstructorMethod() == NULL ){
 				//インターフェイスを継承したときはコンストラクタを持たない
 				bThisIsSuperClass=1;
@@ -543,5 +543,5 @@
 					temporary[i4]=basbuf[i3];
 				}
-				if( Smoothie::Temp::pCompilingClass->GetSuperClass().GetName() == temporary ){
+				if( compiler.pCompilingClass->GetSuperClass().GetName() == temporary ){
 					//基底クラスのコンストラクタを呼び出す
 					cp=i3;
@@ -560,6 +560,6 @@
 					Type dummyType;
 					CallProc( PROC_DEFAULT
-						, Smoothie::Temp::pCompilingClass->GetSuperClass().GetConstructorMethod()->pUserProc
-						, Smoothie::Temp::pCompilingClass->GetSuperClass().GetConstructorMethod()->pUserProc->GetName().c_str()
+						, &compiler.pCompilingClass->GetSuperClass().GetConstructorMethod()->GetUserProc()
+						, compiler.pCompilingClass->GetSuperClass().GetConstructorMethod()->GetUserProc().GetName().c_str()
 						, temporary
 						, dummyType );
@@ -568,5 +568,5 @@
 					//基底クラスのコンストラクタを暗黙的に呼び出す
 					Opcode_CallProc("",
-						Smoothie::Temp::pCompilingClass->GetSuperClass().GetConstructorMethod()->pUserProc,
+						&compiler.pCompilingClass->GetSuperClass().GetConstructorMethod()->GetUserProc(),
 						0,
 						"",
@@ -576,8 +576,8 @@
 
 			//仮想関数テーブルを初期化
-			if( Smoothie::Temp::pCompilingClass->IsExistVirtualFunctions()
-				&& !Smoothie::Temp::pCompilingClass->IsAbstract() ){
+			if( compiler.pCompilingClass->IsExistVirtualFunctions()
+				&& !compiler.pCompilingClass->IsAbstract() ){
 					//関数テーブルに値をセット
-					int offset = (int)Smoothie::Temp::pCompilingClass->GetVtblGlobalOffset();
+					int offset = (int)compiler.pCompilingClass->GetVtblGlobalOffset();
 
 					//mov rax,offset
@@ -598,5 +598,5 @@
 
 			//デストラクタのコンパイル開始を通知
-			Smoothie::Temp::pCompilingClass->NotifyStartDestructorCompile();
+			compiler.pCompilingClass->NotifyStartDestructorCompile();
 		}
 	}
@@ -624,11 +624,11 @@
 	//////////////////////////////////////////
 
-	if( Smoothie::Temp::pCompilingClass ){
-
-		if( Smoothie::Temp::pCompilingClass->IsCompilingConstructor() ){
+	if( compiler.pCompilingClass ){
+
+		if( compiler.pCompilingClass->IsCompilingConstructor() ){
 			// コンストラクタをコンパイルしていたとき
 
 			// コンストラクタのコンパイルが完了したことを通知
-			Smoothie::Temp::pCompilingClass->NotifyFinishConstructorCompile();
+			compiler.pCompilingClass->NotifyFinishConstructorCompile();
 		}
 		else if( pUserProc->IsDestructor() ){
@@ -638,14 +638,14 @@
 
 			// デストラクタのコンパイルが完了したことを通知
-			Smoothie::Temp::pCompilingClass->NotifyFinishDestructorCompile();
-
-			if( Smoothie::Temp::pCompilingClass->HasSuperClass() ){
+			compiler.pCompilingClass->NotifyFinishDestructorCompile();
+
+			if( compiler.pCompilingClass->HasSuperClass() ){
 				/* サブクラスのデストラクタをコンパイルしているときは、
 					基底クラスのデストラクタを呼び出す */
 
-				const CMethod *method = Smoothie::Temp::pCompilingClass->GetSuperClass().GetDestructorMethod();
+				const CMethod *method = compiler.pCompilingClass->GetSuperClass().GetDestructorMethod();
 				if( method ){
 					Opcode_CallProc("",
-						method->pUserProc,
+						&method->GetUserProc(),
 						0,
 						"",
@@ -694,5 +694,5 @@
 	if(bDebugCompile&&bDebugSupportProc==0){
 		//call _DebugSys_EndProc
-		extern UserProc *pSub_DebugSys_EndProc;
+		extern const UserProc *pSub_DebugSys_EndProc;
 		op_call(pSub_DebugSys_EndProc);
 	}
@@ -745,7 +745,9 @@
 	}
 	HeapDefaultFree(pLocalVarAddrSchedule);
-	BOOST_FOREACH( Variable *pVar, pUserProc->localVars ){
+	BOOST_FOREACH( Variable *pVar, pUserProc->GetLocalVars() ){
 		//後にデバッグで利用する
-		pVar->offset = AllLocalVarSize + pobj_sf->GetFrameSize() - pVar->offset;
+		pVar->SetOffsetAddress(
+			AllLocalVarSize + pobj_sf->GetFrameSize() - pVar->GetOffsetAddress()
+		);
 	}
 
@@ -785,5 +787,5 @@
 
 
-	pUserProc->endOpAddress=obp;
+	pUserProc->SetEndOpAddress( obp );
 
 
@@ -793,5 +795,5 @@
 }
 
-void CompileBufferInProcedure( UserProc &userProc ){
+void CompileBufferInProcedure( const UserProc &userProc ){
 	if( userProc.IsUsing() == false || userProc.IsCompiled() ) return;
 
@@ -809,11 +811,8 @@
 }
 void CompileLocal(){
-	extern GlobalProc **ppSubHash;
-	int i2;
-
 	extern BOOL bDll;
 	if(bDll){
 		//DLLの場合はグローバル変数を初期化するための関数を一番初めにコンパイルする
-		UserProc *pUserProc=GetSubHash("_System_InitDllGlobalVariables");
+		const UserProc *pUserProc = GetSubHash("_System_InitDllGlobalVariables");
 		if(pUserProc){
 			CompileBufferInProcedure( *pUserProc );
@@ -823,24 +822,22 @@
 
 	//_System_TypeBase_InitializeUserTypesは一番最後にコンパイル
-	extern UserProc *pSubStaticMethod_System_TypeBase_InitializeUserTypes;
+	extern const UserProc *pSubStaticMethod_System_TypeBase_InitializeUserTypes;
 	pSubStaticMethod_System_TypeBase_InitializeUserTypes->CompleteCompile();
 
 	//_System_InitStaticLocalVariablesは一番最後にコンパイル
 	//※一般関数内の静的変数オブジェクトをすべて収集しなければならない
-	extern UserProc *pSub_System_InitStaticLocalVariables;
+	extern const UserProc *pSub_System_InitStaticLocalVariables;
 	pSub_System_InitStaticLocalVariables->CompleteCompile();
 
 	//_System_Call_Destructor_of_GlobalObjectは一番最後にコンパイル
-	extern UserProc *pSub_System_Call_Destructor_of_GlobalObject;
+	extern const UserProc *pSub_System_Call_Destructor_of_GlobalObject;
 	pSub_System_Call_Destructor_of_GlobalObject->CompleteCompile();
 
 repeat:
-	GlobalProc *pGlobalProc;
-	for(i2=0;i2<MAX_HASH;i2++){
-		pGlobalProc=ppSubHash[i2];
-		while(pGlobalProc){
-			CompileBufferInProcedure( *pGlobalProc );
-			pGlobalProc=pGlobalProc->pNextData;
-		}
+	compiler.GetMeta().GetUserProcs().Iterator_Reset();
+	while( compiler.GetMeta().GetUserProcs().Iterator_HasNext() )
+	{
+		UserProc *pUserProc = compiler.GetMeta().GetUserProcs().Iterator_GetNext();
+		CompileBufferInProcedure( *pUserProc );
 	}
 
@@ -856,10 +853,10 @@
 	if( IsNeedProcCompile() ){
 		//プロシージャコンパイルによって、プロシージャコンパイルが必要になる場合
-		for(i2=0;i2<MAX_HASH;i2++){
-			pGlobalProc=ppSubHash[i2];
-			while(pGlobalProc){
-				CompileBufferInProcedure( *pGlobalProc );
-				pGlobalProc=pGlobalProc->pNextData;
-			}
+
+		compiler.GetMeta().GetUserProcs().Iterator_Reset();
+		while( compiler.GetMeta().GetUserProcs().Iterator_HasNext() )
+		{
+			UserProc *pUserProc = compiler.GetMeta().GetUserProcs().Iterator_GetNext();
+			CompileBufferInProcedure( *pUserProc );
 		}
 	}
Index: trunk/abdev/BasicCompiler64/Compile_Set_Var.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Compile_Set_Var.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/Compile_Set_Var.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include "../BasicCompiler_Common/common.h"
 #include "Opcode.h"
@@ -78,5 +80,5 @@
 
 					//call free
-					extern UserProc *pSub_free;
+					extern const UserProc *pSub_free;
 					op_call(pSub_free);
 				}
Index: trunk/abdev/BasicCompiler64/Compile_Statement.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Compile_Statement.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/Compile_Statement.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include <jenga/include/smoothie/LexicalAnalysis.h>
 
@@ -9,5 +11,4 @@
 void OpcodeOthers(const char *Command){
 	int i,i2;
-	UserProc *pUserProc;
 
 	char leftTerm[8192];
@@ -59,5 +60,5 @@
 		//////////////////////////////
 
-		pUserProc=GetSubHash(Command);
+		const UserProc *pUserProc=GetSubHash(Command);
 
 		//GetSubHash内でエラー提示が行われた場合
@@ -737,5 +738,5 @@
 
 				if(type1.IsObject()){
-					std::vector<UserProc *> subs;
+					std::vector<const UserProc *> subs;
 					type1.GetClass().GetMethods().Enum( CALC_EQUAL, subs );
 					if( subs.size() == 0 ){
@@ -747,6 +748,5 @@
 
 					//オーバーロードを解決
-					UserProc *pUserProc;
-					pUserProc=OverloadSolution("==",subs, params, NULL);
+					const UserProc *pUserProc = OverloadSolution("==",subs, params, NULL);
 
 					delete params[0];
@@ -892,5 +892,5 @@
 
 	//call _System_GetEip
-	extern UserProc *pSub_System_GetEip;
+	extern const UserProc *pSub_System_GetEip;
 	op_call(pSub_System_GetEip);
 
@@ -953,5 +953,5 @@
 		//戻り値をセット
 		if(Parameter[0]){
-			UserProc &proc = UserProc::CompilingUserProc();
+			const UserProc &proc = UserProc::CompilingUserProc();
 
 			const char *temp = "_System_ReturnValue";
Index: trunk/abdev/BasicCompiler64/Compile_Var.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Compile_Var.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/Compile_Var.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include <jenga/include/smoothie/Smoothie.h>
 #include <jenga/include/smoothie/LexicalAnalysis.h>
@@ -5,5 +7,5 @@
 #include <CodeGenerator.h>
 #include <Compiler.h>
-#include <VariableImpl.h>
+#include <Variable.h>
 
 #include "../BasicCompiler_Common/common.h"
@@ -11,5 +13,5 @@
 
 //変数
-Variables globalVars;
+// TODO: xml未完成
 int AllGlobalVarSize;
 int AllInitGlobalVarSize;
@@ -86,5 +88,5 @@
 	}
 }
-bool GetArrayOffset(const int *SubScripts,char *array, const Type &type){
+bool GetArrayOffset(const Subscripts &subscripts,char *array, const Type &type){
 	extern HANDLE hHeap;
 	int i,i2,i3,i4;
@@ -105,5 +107,6 @@
 		}
 		if(array[i]==','||array[i]=='\0'){
-			if(SubScripts[i3]==-1){
+			if( i3 >= (int)subscripts.size() )
+			{
 				for(i3--;i3>=0;i3--) HeapDefaultFree(pParm[i3]);
 				return false;
@@ -118,5 +121,6 @@
 
 			if(array[i]=='\0'){
-				if(SubScripts[i3]!=-1){
+				if( i3 < (int)subscripts.size() )
+				{
 					for(i3--;i3>=0;i3--) HeapDefaultFree(pParm[i3]);
 					return false;
@@ -166,5 +170,5 @@
 		pobj_sf->pop(REG_R12);
 
-		for(i2=i+1,i4=1;i2<i3;i2++) i4*=SubScripts[i2]+1;
+		for(i2=i+1,i4=1;i2<i3;i2++) i4*=subscripts[i2]+1;
 
 		//imul reg,i4
@@ -204,5 +208,5 @@
 	char lpPtrOffset[VN_SIZE];	//第2次配列
 	char NestMember[VN_SIZE];	//入れ子メンバ
-	CClass::RefType refType;
+	ReferenceKind refType;
 	lstrcpy(VarName,member);
 	if(!GetVarFormatString(VarName,array,lpPtrOffset,NestMember,refType)) return false;
@@ -224,5 +228,5 @@
 
 	//アクセシビリティをチェック
-	if(&objClass==Smoothie::Temp::pCompilingClass){
+	if(&objClass==compiler.pCompilingClass){
 		//同一クラスオブジェクトの場合はプライベートアクセスを容認する
 		if(pMember->IsNoneAccess()){
@@ -257,5 +261,5 @@
 	//ポインタ変数の場合
 	if( resultType.IsPointer() ){
-		if(pMember->SubScripts[0]==-1){
+		if( pMember->GetSubscripts().size() == 0 ){
 			lstrcpy(lpPtrOffset,array);
 			array[0]=0;
@@ -280,9 +284,9 @@
 	if(array[0]){
 		//配列オフセット
-		if(!GetArrayOffset(pMember->SubScripts,array,pMember->GetType())){
+		if(!GetArrayOffset(pMember->GetSubscripts(),array,pMember->GetType())){
 			if(isErrorEnabled) SetError(14,member,cp);
 		}
 	}
-	else if(pMember->SubScripts[0]!=-1){
+	else if( pMember->GetSubscripts().size() > 0 ){
 		resultType.SetBasicType( resultType.GetBasicType() | FLAG_PTR );
 	}
@@ -292,5 +296,5 @@
 
 		if( resultType.IsObject() || resultType.IsStruct() ){
-			if( refType != CClass::Dot ){
+			if( refType != RefDot ){
 				if(isErrorEnabled) SetError(104,member,cp);
 				return false;
@@ -308,5 +312,5 @@
 				//pObj[n].member
 				if( ( resultType.IsObjectPtr() || resultType.IsStructPtr() )
-					&& refType != CClass::Dot ){
+					&& refType != RefDot ){
 						if(isErrorEnabled) SetError(104,member,cp);
 						return false;
@@ -322,5 +326,5 @@
 				//pObj->member
 				if( (resultType.IsObjectPtr() || resultType.IsStructPtr() )
-					&& refType != CClass::Pointer ){
+					&& refType != RefPointer ){
 						if(isErrorEnabled) SetError(104,member,cp);
 						return false;
@@ -336,5 +340,5 @@
 			if(lpPtrOffset[0]){
 				//ppObj[n]->member
-				if( refType != CClass::Pointer ){
+				if( refType != RefPointer ){
 					if(isErrorEnabled) SetError(104,member,cp);
 					return false;
@@ -385,5 +389,5 @@
 	SetReg_WholeVariable(DEF_PTR_VOID,&RelativeVar,reg);
 }
-bool GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType,int *pss){
+bool GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType, Subscripts *pResultSubscripts ){
 	char variable[VN_SIZE];
 
@@ -399,5 +403,5 @@
 
 	// 先頭オブジェクトまたはクラス名と入れ子メンバに分割
-	CClass::RefType refType;
+	ReferenceKind refType;
 	char member[VN_SIZE],array[VN_SIZE],lpPtrOffset[VN_SIZE];
 	GetVarFormatString(simpleName,array,lpPtrOffset,member,refType);
@@ -412,5 +416,5 @@
 	}
 
-	const int *pSubScripts;
+	const Subscripts *pSubscripts;
 	bool bConst = false;
 
@@ -421,8 +425,8 @@
 		//////////////////
 
-		const Variable *pVar = UserProc::CompilingUserProc().localVars.BackSearch( VarName );
+		const Variable *pVar = UserProc::CompilingUserProc().GetLocalVars().BackSearch( Symbol( VarName ) );
 		if( pVar ){
 			//ポインタ変数の場合
-			if( pVar->IsPointer() ){
+			if( pVar->GetType().IsPointer() ){
 				if( !pVar->IsArray() ){
 					lstrcpy(lpPtrOffset,array);
@@ -438,5 +442,5 @@
 			}
 
-			pRelativeVar->offset=-pVar->offset;
+			pRelativeVar->offset=-pVar->GetOffsetAddress();
 			pRelativeVar->bOffsetOffset=0;
 			if( pVar->IsRef() ){
@@ -445,6 +449,6 @@
 			}
 			else pRelativeVar->dwKind=VAR_LOCAL;
-			resultType = *pVar;
-			pSubScripts=pVar->GetSubScriptsPtr();
+			resultType = pVar->GetType();
+			pSubscripts = &pVar->GetSubscripts();
 			bConst = pVar->IsConst();
 
@@ -454,5 +458,5 @@
 
 
-	if(Smoothie::Temp::pCompilingClass){
+	if(compiler.pCompilingClass){
 		//////////////////////
 		// クラスメンバの参照
@@ -465,5 +469,5 @@
 			pRelativeVar->dwKind=VAR_DIRECTMEM;
 
-			resultType.SetType( DEF_OBJECT, Smoothie::Temp::pCompilingClass );
+			resultType.SetType( DEF_OBJECT, compiler.pCompilingClass );
 			return true;
 		}
@@ -478,5 +482,5 @@
 
 			bool isFound = false;
-			BOOST_FOREACH( CMember *pMember, Smoothie::Temp::pCompilingClass->GetDynamicMembers() ){
+			BOOST_FOREACH( CMember *pMember, compiler.pCompilingClass->GetDynamicMembers() ){
 				if( pMember->GetName() == VarName ){
 					isFound = true;
@@ -492,6 +496,6 @@
 		if( isWriteAccess &&
 			pMethod->IsConst() &&
-			Smoothie::Temp::pCompilingClass->IsCompilingConstructor() == false &&
-			Smoothie::Temp::pCompilingClass->IsCompilingDestructor() == false
+			compiler.pCompilingClass->IsCompilingConstructor() == false &&
+			compiler.pCompilingClass->IsCompilingDestructor() == false
 			){
 				SetError(131, NULL, cp );
@@ -505,5 +509,5 @@
 			isErrorEnabled,
 			isWriteAccess,
-			*Smoothie::Temp::pCompilingClass,
+			*compiler.pCompilingClass,
 			variable,
 			pRelativeVar,
@@ -526,5 +530,5 @@
 			GetNowStaticVarFullName(VarName,temporary);
 
-			pVar = globalVars.Find( temporary );
+			pVar = compiler.GetMeta().GetGlobalVars().Find( Symbol( temporary ) );
 			if( pVar ){
 				goto GlobalOk;
@@ -545,5 +549,5 @@
 			char tempArray[VN_SIZE];
 			{
-				CClass::RefType refType;
+				ReferenceKind refType;
 				GetVarFormatString(temporary,tempArray,lpPtrOffset,tempMember, refType );
 			}
@@ -557,5 +561,5 @@
 			char temp2[VN_SIZE];
 			sprintf(temp2,"%s.%s",VarName,temporary);
-			pVar = globalVars.Find( temp2 );
+			pVar = compiler.GetMeta().GetGlobalVars().Find( Symbol( temp2 ) );
 			if( pVar ){
 				lstrcpy(member,tempMember);
@@ -565,9 +569,9 @@
 		}
 
-		if(Smoothie::Temp::pCompilingClass){
+		if(compiler.pCompilingClass){
 			//自身のクラスから静的メンバを参照する場合
 			char temp2[VN_SIZE];
-			sprintf(temp2,"%s.%s",Smoothie::Temp::pCompilingClass->GetName().c_str(),VarName);
-			pVar = globalVars.Find( temp2 );
+			sprintf(temp2,"%s.%s",compiler.pCompilingClass->GetName().c_str(),VarName);
+			pVar = compiler.GetMeta().GetGlobalVars().Find( Symbol( temp2 ) );
 			if( pVar ){
 				goto GlobalOk;
@@ -579,5 +583,5 @@
 		/////////////////////
 
-		pVar = globalVars.BackSearch( VarName );
+		pVar = compiler.GetMeta().GetGlobalVars().BackSearch( Symbol( VarName ) );
 		if( pVar ){
 			goto GlobalOk;
@@ -592,5 +596,5 @@
 GlobalOk:
 		//ポインタ変数の場合
-		if( pVar->IsPointer() ){
+		if( pVar->GetType().IsPointer() ){
 			if( !pVar->IsArray() ){
 				lstrcpy(lpPtrOffset,array);
@@ -606,5 +610,5 @@
 		}
 
-		pRelativeVar->offset=pVar->offset;
+		pRelativeVar->offset=pVar->GetOffsetAddress();
 		pRelativeVar->bOffsetOffset=0;
 		if( pVar->IsRef() ){
@@ -613,6 +617,6 @@
 		}
 		else pRelativeVar->dwKind=VAR_GLOBAL;
-		resultType = *pVar;
-		pSubScripts=pVar->GetSubScriptsPtr();
+		resultType = pVar->GetType();
+		pSubscripts=&pVar->GetSubscripts();
 		bConst = pVar->IsConst();
 	}
@@ -634,8 +638,12 @@
 	}
 
-	if(array[0]==0&&pSubScripts[0]!=-1){
+	if( array[0] == 0 && pSubscripts->size() > 0 ){
 		//配列の先頭ポインタを示す場合
 		resultType.SetBasicType( resultType.GetBasicType() | FLAG_PTR );
-		if(pss) memcpy(pss,pSubScripts,MAX_ARRAYDIM);
+
+		if( pResultSubscripts )
+		{
+			(*pResultSubscripts) = *pSubscripts;
+		}
 		return true;
 	}
@@ -649,5 +657,5 @@
 	}
 	if(array[0]){
-		if(!GetArrayOffset(pSubScripts,array,resultType)){
+		if(!GetArrayOffset(*pSubscripts,array,resultType)){
 			SetError(14,variable,cp);
 			pRelativeVar->dwKind=NON_VAR;
@@ -658,5 +666,5 @@
 		if( resultType.IsObject() || resultType.IsStruct() ){
 			//実態オブジェクトのメンバを参照（obj.member）
-			if( refType != CClass::Dot ){
+			if( refType != RefDot ){
 				SetError(104,VarName,cp);
 				pRelativeVar->dwKind=NON_VAR;
@@ -673,5 +681,5 @@
 			if(lpPtrOffset[0]){
 				//pObj[n].member
-				if( refType != CClass::Dot ){
+				if( refType != RefDot ){
 					SetError(104,VarName,cp);
 					pRelativeVar->dwKind=NON_VAR;
@@ -683,5 +691,5 @@
 			else{
 				//pObj->member
-				if( refType != CClass::Pointer ){
+				if( refType != RefPointer ){
 					SetError(104,VarName,cp);
 					pRelativeVar->dwKind=NON_VAR;
@@ -700,5 +708,5 @@
 			if(lpPtrOffset[0]){
 				//ppObj[n]->member
-				if( refType != CClass::Pointer ){
+				if( refType != RefPointer ){
 					SetError(104,VarName,cp);
 					pRelativeVar->dwKind=NON_VAR;
@@ -744,7 +752,7 @@
 }
 
-bool SetInitGlobalData(int offset,const Type &type,const int *SubScripts,const char *lpszInitBuf){
+bool SetInitGlobalData(int offset,const Type &type,const Subscripts &subscripts,const char *lpszInitBuf){
 	extern BYTE *initGlobalBuf;
-	int i,i2,i3;
+	int i2,i3;
 	char temporary[VN_SIZE];
 	char InitBuf[VN_SIZE];
@@ -757,21 +765,29 @@
 		int typeSize = type.GetSize();
 
-		if(SubScripts[0]!=-1){
-			typeSize*=JumpSubScripts(SubScripts+1);
-			i=0;
-			i2=0;
-			while(1){
-				if(SubScripts[0]<i2){
-					SetError(41,0,cp);
-					return 0;
-				}
-				i=GetOneParameter(InitBuf,i,temporary);
-				if(!SetInitGlobalData(
-					offset+i2*typeSize,
-					type,
-					SubScripts+1,
-					temporary)) return false;
-				i2++;
-				if(InitBuf[i]=='\0') break;
+		if( subscripts.size() > 0 ){
+			Subscripts nestSubscripts;
+			for( int i=1; i<(int)subscripts.size(); i++ )
+			{
+				nestSubscripts.push_back( subscripts[i] );
+			}
+
+			typeSize*=JumpSubScripts( nestSubscripts );
+			{
+				int i=0;
+				i2=0;
+				while(1){
+					if( subscripts[0] < i2 ){
+						SetError(41,0,cp);
+						return 0;
+					}
+					i=GetOneParameter(InitBuf,i,temporary);
+					if(!SetInitGlobalData(
+						offset+i2*typeSize,
+						type,
+						nestSubscripts,
+						temporary)) return false;
+					i2++;
+					if(InitBuf[i]=='\0') break;
+				}
 			}
 			return true;
@@ -794,5 +810,5 @@
 				if(!SetInitGlobalData(offset+i3,
 					pMember->GetType(),
-					pMember->SubScripts,
+					pMember->GetSubscripts(),
 					temporary)) return false;
 			}
@@ -815,5 +831,5 @@
 	}
 
-	if(SubScripts[0]!=-1){
+	if( subscripts.size() > 0 ){
 		SetError(41,0,cp);
 		return false;
@@ -883,6 +899,6 @@
 	return true;
 }
-bool InitLocalVar(int offset,const Type &type,const int *SubScripts,const char *lpszInitBuf){
-	int i,i2,i3;
+bool InitLocalVar(int offset,const Type &type,const Subscripts &subscripts,const char *lpszInitBuf){
+	int i2,i3;
 	char temporary[VN_SIZE];
 	char InitBuf[VN_SIZE];
@@ -895,21 +911,29 @@
 		int typeSize = type.GetSize();
 
-		if(SubScripts[0]!=-1){
-			typeSize*=JumpSubScripts(SubScripts+1);
-			i=0;
-			i2=0;
-			while(1){
-				if(SubScripts[0]<i2){
-					SetError(41,0,cp);
-					return false;
-				}
-				i=GetOneParameter(InitBuf,i,temporary);
-				if(!InitLocalVar(
-					offset+i2*typeSize,
-					type,
-					SubScripts+1,
-					temporary)) return false;
-				i2++;
-				if(InitBuf[i]=='\0') break;
+		if( subscripts.size() > 0 ){
+			Subscripts nestSubscripts;
+			for( int i=1; i<(int)subscripts.size(); i++ )
+			{
+				nestSubscripts.push_back( subscripts[i] );
+			}
+
+			typeSize*=JumpSubScripts( nestSubscripts );
+			{
+				int i=0;
+				i2=0;
+				while(1){
+					if( subscripts[0] < i2 ){
+						SetError(41,0,cp);
+						return 0;
+					}
+					i=GetOneParameter(InitBuf,i,temporary);
+					if(!InitLocalVar(
+						offset+i2*typeSize,
+						type,
+						nestSubscripts,
+						temporary)) return false;
+					i2++;
+					if(InitBuf[i]=='\0') break;
+				}
 			}
 			return true;
@@ -932,5 +956,5 @@
 				if(!InitLocalVar(offset+i3,
 					pMember->GetType(),
-					pMember->SubScripts,
+					pMember->GetSubscripts(),
 					temporary)) return false;
 
@@ -949,5 +973,5 @@
 	///////////////////////////////////////
 
-	if(SubScripts[0]!=-1){
+	if( subscripts.size() > 0 ){
 		SetError(41,0,cp);
 		return false;
@@ -1061,5 +1085,5 @@
 }
 
-void dim( char *VarName,int *SubScripts,Type &type,const char *InitBuf,const char *ConstractParameter,DWORD dwFlags){
+void dim( char *VarName, const Subscripts &subscripts, Type &type,const char *InitBuf,const char *ConstractParameter,DWORD dwFlags){
 	if( UserProc::IsGlobalAreaCompiling() ){
 		/////////////////////////
@@ -1067,6 +1091,5 @@
 		/////////////////////////
 
-		//OpcodeOthers( ( (string)"OutputDebugString(Ex\"" + VarName + "\r\n\")" ).c_str() );
-		AddGlobalVariable(VarName,SubScripts,type,InitBuf,ConstractParameter,dwFlags);
+		AddGlobalVariable(VarName,subscripts,type,InitBuf,ConstractParameter,dwFlags);
 	}
 	else{
@@ -1075,5 +1098,5 @@
 		/////////////////
 
-		if( UserProc::CompilingUserProc().localVars.DuplicateCheck( VarName ) ){
+		if( UserProc::CompilingUserProc().GetLocalVars().DuplicateCheck( VarName ) ){
 			//２重定義のエラー
 			SetError(15,VarName,cp);
@@ -1083,17 +1106,14 @@
 		bool isConst = ( dwFlags & DIMFLAG_CONST ) ? true:false;
 
-		Variable *pVar = new VariableImpl( VarName, type, isConst );
-
-		if( SubScripts[0] != -1 ){
+		Variable *pVar = new Variable( VarName, type, isConst, false, ConstractParameter );
+
+		if( subscripts.size() > 0 ){
 			//配列あり
-			pVar->SetArray( SubScripts );
-		}
-
-		//コンストラクタ用パラメータ
-		pVar->paramStrForConstructor = ConstractParameter;
+			pVar->SetArray( subscripts );
+		}
 
 		//レキシカルスコープ
-		pVar->ScopeLevel=GetLexicalScopes().GetNowLevel();
-		pVar->ScopeStartAddress=GetLexicalScopes().GetStartAddress();
+		pVar->SetScopeLevel( GetLexicalScopes().GetNowLevel() );
+		pVar->SetScopeStartAddress( GetLexicalScopes().GetStartAddress() );
 		pVar->bLiving=TRUE;
 
@@ -1102,9 +1122,9 @@
 
 		// 変数を追加
-		UserProc::CompilingUserProc().localVars.push_back( pVar );
+		UserProc::CompilingUserProc().GetLocalVars().push_back( pVar );
 
 		//アラインメントを考慮
-		if( pVar->IsStruct() ){
-			int alignment = pVar->GetClass().iAlign;
+		if( pVar->GetType().IsStruct() ){
+			int alignment = pVar->GetType().GetClass().iAlign;
 
 			if( alignment ){
@@ -1126,9 +1146,9 @@
 
 		AllLocalVarSize += pVar->GetMemorySize();
-		pVar->offset = AllLocalVarSize;
+		pVar->SetOffsetAddress( AllLocalVarSize );
 
 		//レキシカルスコープ
-		pVar->ScopeLevel=GetLexicalScopes().GetNowLevel();
-		pVar->ScopeStartAddress=GetLexicalScopes().GetStartAddress();
+		pVar->SetScopeLevel( GetLexicalScopes().GetNowLevel() );
+		pVar->SetScopeStartAddress( GetLexicalScopes().GetStartAddress() );
 		pVar->bLiving=TRUE;
 
@@ -1140,8 +1160,8 @@
 
 			int result = 0;
-			if( !pVar->IsObject() ){
-				result = InitLocalVar(-pVar->offset,
-					*pVar,
-					pVar->GetSubScriptsPtr(),
+			if( !pVar->GetType().IsObject() ){
+				result = InitLocalVar(-pVar->GetOffsetAddress(),
+					pVar->GetType(),
+					pVar->GetSubscripts(),
 					InitBuf);
 			}
@@ -1171,5 +1191,5 @@
 
 			//add rcx, offset
-			op_add_RV( REG_RCX, -pVar->offset );
+			op_add_RV( REG_RCX, -pVar->GetOffsetAddress() );
 			obp-=sizeof(long);
 			AddLocalVarAddrSchedule();
@@ -1186,12 +1206,12 @@
 	if( type.IsObject() &&(dwFlags&DIMFLAG_NONCALL_CONSTRACTOR)==0&&InitBuf[0]=='\0'){
 		char objectSize[255];
-		if( SubScripts[0] == -1 ){
+		if( subscripts.size() == 0 ){
 			objectSize[0] = 0;
 		}
 		else{
-			if( SubScripts[1] != -1 ){
+			if( subscripts.size() > 1 ){
 				SetError(300,NULL,cp);
 			}
-			sprintf( objectSize, "%d", SubScripts[0] );
+			sprintf( objectSize, "%d", subscripts[0] );
 		}
 		Operator_New( type.GetClass(), objectSize, ConstractParameter, type );
@@ -1304,5 +1324,5 @@
 
 bool Compile_AddGlobalRootsForGc(){
-	UserProc *pUserProc_AddGlobalRootPtr = GetClassMethod( "_System_CGarbageCollection", "AddGlobalRootPtr" );
+	const UserProc *pUserProc_AddGlobalRootPtr = GetClassMethod( "_System_CGarbageCollection", "AddGlobalRootPtr" );
 	if( !pUserProc_AddGlobalRootPtr ){
 		SetError(3, "_System_CGarbageCollection.AddGlobalRootPtr", -1 );
@@ -1310,6 +1330,6 @@
 	}
 
-	BOOST_FOREACH( const Variable *pVar, globalVars ){
-		if( pVar->IsObject() || pVar->IsPointer() || pVar->IsStruct() ){
+	BOOST_FOREACH( const Variable *pVar, compiler.GetMeta().GetGlobalVars() ){
+		if( pVar->GetType().IsObject() || pVar->GetType().IsPointer() || pVar->GetType().IsStruct() ){
 			// オブジェクトまたはポインタだったとき
 			// ※構造体も含む（暫定対応）
@@ -1321,5 +1341,5 @@
 			// ルートポインタを引き渡す
 			//mov rdx,offset
-			op_mov_RV(sizeof(_int64), REG_RDX,(int)pVar->offset);
+			op_mov_RV(sizeof(_int64), REG_RDX,(int)pVar->GetOffsetAddress());
 			obp-=sizeof(long);
 			pobj_GlobalVarSchedule->add();
Index: trunk/abdev/BasicCompiler64/MakePeHdr.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/MakePeHdr.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/MakePeHdr.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include <jenga/include/common/Environment.h>
 
@@ -4,8 +6,11 @@
 
 #include <LexicalScopingImpl.h>
-#include <ClassImpl.h>
+#include <Class.h>
 #include <Compiler.h>
 
+#include <../Enum.h>
+
 #include "../BasicCompiler_Common/common.h"
+#include "../BasicCompiler_Common/DebugSection.h"
 #include "Opcode.h"
 
@@ -16,5 +21,5 @@
 
 // グローバル関数、静的メソッド
-UserProc
+const UserProc
 	*pSub_System_StartupProgram,
 	*pSub_DebugSys_StartProc,
@@ -36,5 +41,5 @@
 
 // 動的メソッド
-UserProc
+const UserProc
 	*pUserProc_System_CGarbageCollection_RegisterGlobalRoots;
 
@@ -160,5 +165,5 @@
 
 	//クラス名を取得（詳細情報はGetAllClassInfoで取得）
-	//   GetSubInfo関数の中で参照されるオブジェクト名を事前に取得する。
+	//   CollectUserProcs関数の中で参照されるオブジェクト名を事前に取得する。
 	//     ※オブジェクトの内容までは取得しない
 	compiler.GetMeta().GetClasses().CollectClassesForNameOnly( Smoothie::Lexical::source );
@@ -171,11 +176,25 @@
 
 	//サブルーチン（ユーザー定義、DLL関数）の識別子、アドレスを取得
-	Smoothie::Temp::pCompilingClass = NULL;
-	GetSubInfo();
-
-	//クラス情報を取得（※注 - GetSubInfoの後に呼び出す）
+	compiler.pCompilingClass = NULL;
+	UserProcs::CollectUserProcs( Smoothie::Lexical::source, compiler.GetMeta().GetUserProcs() );
+
+	// クラス情報を取得（※注 - CollectUserProcsの後に呼び出す）
 	compiler.GetMeta().GetClasses().GetAllClassInfo();
 
-	compiler.GetMeta().AutoWrite( Jenga::Common::Environment::GetAppDir() + "\\meta_test.xml" );
+	// サブルーチン（ユーザー定義、DLL関数）のイテレータの準備
+	compiler.GetMeta().GetUserProcs().Iterator_Init();
+
+	/*
+	if( !compiler.GetMeta().Write( Jenga::Common::Environment::GetAppDir() + "\\meta_test.xml" ) )
+	{
+		MessageBox(0,"XML書き込みに失敗","test",0);
+	}
+	MetaImpl *pTempMeta = new MetaImpl();
+	if( !pTempMeta->Read( Jenga::Common::Environment::GetAppDir() + "\\meta_test.xml" ) )
+	{
+		MessageBox(0,"XML読み込みに失敗","test",0);
+	}
+	compiler.GetMeta() = (*pTempMeta);
+	*/
 
 	//コードと行番号の関係
@@ -347,4 +366,6 @@
 		extern CStackFrame *pobj_sf;
 		pobj_sf=new CStackFrame();
+
+		trace_for_sourcecodestep( "★★★ グローバル領域のコンパイルを開始" );
 
 
@@ -399,5 +420,5 @@
 
 		//call _System_Call_Destructor_of_GlobalObject
-		extern UserProc *pSub_System_Call_Destructor_of_GlobalObject;
+		extern const UserProc *pSub_System_Call_Destructor_of_GlobalObject;
 		op_call(pSub_System_Call_Destructor_of_GlobalObject);
 
@@ -557,28 +578,26 @@
 		ExportNamesLength=lstrlen(lpExportNames)+1;
 
-		extern GlobalProc **ppSubHash;
-		GlobalProc *pUserProc,*psi2;
+		UserProc *pUserProc,*psi2;
 		while(1){
 			//辞書順にサーチ
 			temporary[0]=0;
-			for(i=0,psi2=0;i<MAX_HASH;i++){
-				pUserProc=ppSubHash[i];
-				while(pUserProc){
-					if(pUserProc->IsExport()){
-						if(temporary[0]=='\0'){
+			compiler.GetMeta().GetUserProcs().Iterator_Reset();
+			while( compiler.GetMeta().GetUserProcs().Iterator_HasNext() )
+			{
+				pUserProc = compiler.GetMeta().GetUserProcs().Iterator_GetNext();
+				if(pUserProc->IsExport()){
+					if(temporary[0]=='\0'){
+						lstrcpy(temporary,pUserProc->GetName().c_str());
+						psi2=pUserProc;
+					}
+					else{
+						i3=lstrlen(temporary);
+						i4=(int)pUserProc->GetName().size();
+						if(i3<i4) i3=i4;
+						if(memcmp(temporary,pUserProc->GetName().c_str(),i3)>0){
 							lstrcpy(temporary,pUserProc->GetName().c_str());
 							psi2=pUserProc;
 						}
-						else{
-							i3=lstrlen(temporary);
-							i4=(int)pUserProc->GetName().size();
-							if(i3<i4) i3=i4;
-							if(memcmp(temporary,pUserProc->GetName().c_str(),i3)>0){
-								lstrcpy(temporary,pUserProc->GetName().c_str());
-								psi2=pUserProc;
-							}
-						}
 					}
-					pUserProc=pUserProc->pNextData;
 				}
 			}
@@ -589,9 +608,9 @@
 
 			if( pUserProc->GetName() == "DllMain" ){
-				DllMain_EntryPoint=pUserProc->beginOpAddress;
+				DllMain_EntryPoint=pUserProc->GetBeginOpAddress();
 			}
 
 			lpdwExportAddressTable=(DWORD *)HeapReAlloc(hHeap,0,lpdwExportAddressTable,(ExportNum+1)*sizeof(DWORD));
-			lpdwExportAddressTable[ExportNum]=pUserProc->beginOpAddress;
+			lpdwExportAddressTable[ExportNum]=pUserProc->GetBeginOpAddress();
 
 			lpdwExportNamePointerTable=(DWORD *)HeapReAlloc(hHeap,0,lpdwExportNamePointerTable,(ExportNum+1)*sizeof(DWORD));
@@ -800,7 +819,9 @@
 	//（デバッグ情報で利用される）
 	extern int AllInitGlobalVarSize;
-	BOOST_FOREACH( Variable *pVar, globalVars ){
-		if(pVar->offset&0x80000000){
-			pVar->offset=(pVar->offset&0x7FFFFFFF)+AllInitGlobalVarSize;
+	BOOST_FOREACH( Variable *pVar, compiler.GetMeta().GetGlobalVars() ){
+		if(pVar->GetOffsetAddress()&0x80000000){
+			pVar->SetOffsetAddress(
+				(pVar->GetOffsetAddress()&0x7FFFFFFF)+AllInitGlobalVarSize
+			);
 		}
 	}
@@ -1088,6 +1109,5 @@
 	// ※x86はRVAからのオフセット。x64はRPI（実行中アドレス）からのオフセット
 	for(i=0;i<pobj_ImportAddrSchedule->num;i++){
-		DllProc *pDllProc;
-		pDllProc=pobj_ImportAddrSchedule->ppdi[i];
+		const DllProc *pDllProc = pobj_ImportAddrSchedule->ppdi[i];
 		*((long *)(OpBuffer+pobj_ImportAddrSchedule->pObpValues[i]))=
 			MemPos_ImportSection+
@@ -1101,6 +1121,6 @@
 	// プロシージャポインタスケジュール
 	for(i=0;i<pobj_SubAddrSchedule->num;i++){
-		if(pobj_SubAddrSchedule->ppsi[i]->beginOpAddress==0
-			&&pobj_SubAddrSchedule->ppsi[i]->endOpAddress==0){
+		if(pobj_SubAddrSchedule->ppsi[i]->GetBeginOpAddress()==0
+			&&pobj_SubAddrSchedule->ppsi[i]->GetEndOpAddress()==0){
 			SetError(300,NULL,-1);
 		}
@@ -1108,9 +1128,9 @@
 		if(pobj_SubAddrSchedule->pbCall[i]){
 			*((long *)(OpBuffer+pobj_SubAddrSchedule->pObpValues[i]))=
-				pobj_SubAddrSchedule->ppsi[i]->beginOpAddress-(pobj_SubAddrSchedule->pObpValues[i]+sizeof(long));
+				pobj_SubAddrSchedule->ppsi[i]->GetBeginOpAddress()-(pobj_SubAddrSchedule->pObpValues[i]+sizeof(long));
 		}
 		else{
 			*((long *)(OpBuffer+pobj_SubAddrSchedule->pObpValues[i]))=
-				pobj_SubAddrSchedule->ppsi[i]->beginOpAddress+ImageBase+MemPos_CodeSection;
+				pobj_SubAddrSchedule->ppsi[i]->GetBeginOpAddress()+ImageBase+MemPos_CodeSection;
 		}
 	}
Index: trunk/abdev/BasicCompiler64/NumOpe.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/NumOpe.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/NumOpe.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include <jenga/include/smoothie/Smoothie.h>
 #include <jenga/include/smoothie/LexicalAnalysis.h>
@@ -164,16 +166,15 @@
 	// 動的メソッドを検索
 	///////////////////////////////////////////////////////////////////
-	vector<UserProc *> userProcs;
+	vector<const UserProc *> userProcs;
 
 	char methodName[VN_SIZE], lpPtrOffset[VN_SIZE], parameter[VN_SIZE], dummy[1];
-	CClass::RefType refType;
+	ReferenceKind refType;
 	lstrcpy( methodName, member );
 	GetVarFormatString(methodName,parameter,lpPtrOffset,dummy,refType);
 
 	objClass.GetMethods().Enum( methodName, userProcs );
-	UserProc *pUserProc;
 	if(userProcs.size()){
 		//オーバーロードを解決
-		pUserProc=OverloadSolutionWithStrParam(termFull,userProcs,parameter,termLeft);
+		const UserProc *pUserProc = OverloadSolutionWithStrParam(termFull,userProcs,parameter,termLeft);
 
 		if( pUserProc ){
@@ -245,6 +246,6 @@
 	// パース
 	char member[VN_SIZE];
-	CClass::RefType refType;
-	if( CClass::SplitName( termFull, termLeft, member, refType ) ){
+	ReferenceKind refType;
+	if( SplitMemberName( termFull, termLeft, member, refType ) ){
 		///////////////////////////////////////////////////////////////////
 		// オブジェクトとメンバに分解できるとき
@@ -309,5 +310,5 @@
 	if(lstrcmpi(termFull,"This")==0 && isProcedureCallOnly == false ){
 		//Thisオブジェクト
-		resultType.SetType( DEF_OBJECT, Smoothie::Temp::pCompilingClass );
+		resultType.SetType( DEF_OBJECT, compiler.pCompilingClass );
 
 		SetThisPtrToReg( UseReg );
@@ -385,21 +386,27 @@
 			return true;
 		}
-		else if(GetConstCalcBuffer(procName,parameter,temporary)){
-			/////////////////////////
-			// マクロ関数
-			/////////////////////////
-
-			//閉じカッコ")"に続く文字がNULLでないときはエラーにする
-			if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp);
-
-			//マクロ関数の場合
-			NumOpe(&UseReg,temporary,Type(),resultType);
-
-			if(!IS_LITERAL(resultType.GetIndex())){
-				//リテラル値ではなかったとき
-				isLiteral = false;
-			}
-
-			return true;
+
+		ConstMacro *pConstMacro = compiler.GetMeta().GetGlobalConstMacros().Find( procName );
+		if( pConstMacro )
+		{
+			if( pConstMacro->GetCalcBuffer( parameter, temporary ) )
+			{
+				/////////////////////////
+				// マクロ関数
+				/////////////////////////
+
+				//閉じカッコ")"に続く文字がNULLでないときはエラーにする
+				if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp);
+
+				//マクロ関数の場合
+				NumOpe(&UseReg, temporary,Type(),resultType);
+
+				if(!IS_LITERAL(resultType.GetIndex())){
+					//リテラル値ではなかったとき
+					isLiteral = false;
+				}
+
+				return true;
+			}
 		}
 	}
@@ -905,10 +912,10 @@
 					//////////////
 
-					i3 = CDBConst::obj.GetBasicType(term);
+					i3 = compiler.GetMeta().GetGlobalConsts().GetBasicType(term);
 					if(i3){
-						if( CDBConst::obj.IsStringPtr( term ) ){
+						if( compiler.GetMeta().GetGlobalConsts().IsStringPtr( term ) ){
 							//リテラル文字列
 
-							double dbl = CDBConst::obj.GetDoubleData(term);
+							double dbl = compiler.GetMeta().GetGlobalConsts().GetDoubleData(term);
 							memcpy(&i64data,&dbl,sizeof(double));
 
@@ -924,5 +931,5 @@
 						if(IsRealNumberType(i3)){
 							//実数
-							double dbl = CDBConst::obj.GetDoubleData(term);
+							double dbl = compiler.GetMeta().GetGlobalConsts().GetDoubleData(term);
 							memcpy(&i64data,&dbl,sizeof(double));
 							goto Literal;
@@ -930,5 +937,5 @@
 						else if(IsWholeNumberType(i3)){
 							//整数
-							i64data = CDBConst::obj.GetWholeData(term);
+							i64data = compiler.GetMeta().GetGlobalConsts().GetWholeData(term);
 							goto Literal;
 						}
Index: trunk/abdev/BasicCompiler64/NumOpe_Arithmetic.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/NumOpe_Arithmetic.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/NumOpe_Arithmetic.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include <Compiler.h>
 
@@ -561,5 +563,5 @@
 
 		//call pow
-		extern UserProc *pSub_pow;
+		extern const UserProc *pSub_pow;
 		op_call(pSub_pow);
 
Index: trunk/abdev/BasicCompiler64/NumOpe_Logical.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/NumOpe_Logical.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/NumOpe_Logical.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include "../BasicCompiler_Common/common.h"
 #include "Opcode.h"
Index: trunk/abdev/BasicCompiler64/NumOpe_Relation.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/NumOpe_Relation.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/NumOpe_Relation.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include "../BasicCompiler_Common/common.h"
 #include "Opcode.h"
Index: trunk/abdev/BasicCompiler64/NumOpe_TypeOperation.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/NumOpe_TypeOperation.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/NumOpe_TypeOperation.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include <jenga/include/smoothie/Smoothie.h>
 
Index: trunk/abdev/BasicCompiler64/Opcode.h
===================================================================
--- trunk/abdev/BasicCompiler64/Opcode.h	(revision 204)
+++ trunk/abdev/BasicCompiler64/Opcode.h	(revision 206)
@@ -1,3 +1,6 @@
-//Opcode.h
+#pragma once
+
+#include <Type.h>
+#include <Procedure.h>
 
 
@@ -323,11 +326,11 @@
 bool _member_offset(bool isErrorEnabled, bool isWriteAccess, const CClass &objClass, const char *member, RELATIVE_VAR *pRelativeVar, Type &resultType, BOOL bPrivateAccess);
 void SetThisPtrToReg(int reg);
-bool GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType,int *pss = NULL);
-bool SetInitGlobalData(int offset,const Type &type,const int *SubScripts,const char *InitBuf);
+bool GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType, Subscripts *pResultSubscripts = NULL );
+bool SetInitGlobalData(int offset,const Type &type,const Subscripts &subscripts,const char *InitBuf);
 #define DIMFLAG_INITDEBUGVAR			0x01
 #define DIMFLAG_NONCALL_CONSTRACTOR		0x02
 #define DIMFLAG_STATIC					0x04
 #define DIMFLAG_CONST					0x08
-void dim( char *VarName,int *SubScripts,Type &type, const char *InitBuf,const char *ConstractParameter,DWORD dwFlags);
+void dim( char *VarName, const Subscripts &subscripts, Type &type, const char *InitBuf,const char *ConstractParameter,DWORD dwFlags);
 void SetVarPtrToReg(int reg,RELATIVE_VAR *pRelativeVar);
 bool Compile_AddGlobalRootsForGc();
@@ -356,6 +359,6 @@
 
 public:
-	UserProc *_OverloadSolution( const char *name, std::vector<UserProc *> &subs, bool isEnabledReturnType = false );
-	UserProc *OverloadSolution( const char *name, std::vector<UserProc *> &subs, bool isEnabledReturnType = false );
+	const UserProc *_OverloadSolution( const char *name, std::vector<const UserProc *> &subs, bool isEnabledReturnType = false );
+	const UserProc *OverloadSolution( const char *name, std::vector<const UserProc *> &subs, bool isEnabledReturnType = false );
 
 	void ApplyDefaultParameters( const Parameters &params );
@@ -389,5 +392,5 @@
 #define PROCFLAG_NEW	1
 bool Opcode_CallProcPtr(const char *variable, const char *lpszParms,ProcPointer *pProcPointer);
-bool Opcode_CallProc(const char *Parameter,UserProc *pUserProc,DWORD dwFlags,const char *ObjectName,int RefType);
+bool Opcode_CallProc(const char *Parameter,const UserProc *pUserProc,DWORD dwFlags,const char *ObjectName,int RefType);
 bool Opcode_CallDllProc( const char *lpszParms,DllProc *pDllProc);
 
@@ -401,5 +404,5 @@
 //OperatorProc.cpp
 void FreeTempObject(int reg,const CClass *pobj_c);
-int CallOperatorProc(int idCalc, const Type &baseType, int *type_stack,LONG_PTR *index_stack,BOOL *bUseHeap,int &sp);
+int CallOperatorProc(BYTE idCalc, const Type &baseType, int *type_stack,LONG_PTR *index_stack,BOOL *bUseHeap,int &sp);
 void CallCastOperatorProc(int reg,Type &calcType,BOOL bCalcUseHeap,const Type &toType);
 void CallIndexerGetterProc(int reg,const CClass *pobj_Class,char *ObjectName,char *Parameter,Type &resultType);
@@ -512,5 +515,5 @@
 void op_fld_ptr_esp(int type);
 void op_zero_reg(int reg);
-void op_call( UserProc *pUserProc );
-void op_call( DllProc *pDllProc );
+void op_call( const UserProc *pUserProc );
+void op_call( const DllProc *pDllProc );
 void op_ret();
Index: trunk/abdev/BasicCompiler64/OperatorProc.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/OperatorProc.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/OperatorProc.cpp	(revision 206)
@@ -1,2 +1,6 @@
+#include "stdafx.h"
+
+#include <jenga/include/smoothie/LexicalAnalysis.h>
+
 #include "../BasicCompiler_Common/common.h"
 #include "Opcode.h"
@@ -16,5 +20,5 @@
 
 		//call DestructorProcAddr
-		op_call( method->pUserProc );
+		op_call( &method->GetUserProc() );
 	}
 
@@ -23,14 +27,14 @@
 
 	//call free
-	extern UserProc *pSub_free;
+	extern const UserProc *pSub_free;
 	op_call(pSub_free);
 }
 
-int CallOperatorProc(int idCalc, const Type &baseType, int *type_stack,LONG_PTR *index_stack,BOOL *bUseHeap,int &sp){
+int CallOperatorProc(BYTE idCalc, const Type &baseType, int *type_stack,LONG_PTR *index_stack,BOOL *bUseHeap,int &sp){
 	//オーバーロードされたオペレータ関数を呼び出す
 	CClass *pobj_c;
 	pobj_c=(CClass *)index_stack[sp-2];
 
-	std::vector<UserProc *> subs;
+	std::vector<const UserProc *> subs;
 	pobj_c->GetMethods().Enum( idCalc, subs );
 	if( subs.size() == 0 ){
@@ -58,5 +62,5 @@
 	if(idCalc==CALC_EQUAL) lstrcpy(temporary,"==");
 	else GetCalcName(idCalc,temporary);
-	UserProc *pUserProc = OverloadSolution( temporary, subs, params, baseType );
+	const UserProc *pUserProc = OverloadSolution( temporary, subs, params, baseType );
 
 	if(!pUserProc){
@@ -118,5 +122,5 @@
 
 			//call calloc
-			extern UserProc *pSub_calloc;
+			extern const UserProc *pSub_calloc;
 			op_call(pSub_calloc);
 
@@ -319,5 +323,5 @@
 void CallIndexerGetterProc(int reg,const CClass *pobj_Class,char *ObjectName,char *Parameter,Type &resultType ){
 
-	std::vector<UserProc *> subs;
+	std::vector<const UserProc *> subs;
 	pobj_Class->GetMethods().Enum( CALC_ARRAY_GET, subs );
 	if( subs.size() == 0 ){
Index: trunk/abdev/BasicCompiler64/Register.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/Register.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/Register.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include "../BasicCompiler_Common/common.h"
 #include "Opcode.h"
Index: trunk/abdev/BasicCompiler64/amd64_main.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/amd64_main.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/amd64_main.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include "../BasicCompiler_Common/common.h"
 #include "Opcode.h"
@@ -1791,5 +1793,5 @@
 /////////////////////////////
 
-void op_call( UserProc *pUserProc ){
+void op_call( const UserProc *pUserProc ){
 	OpBuffer[obp++] = (char)0xE8;
 	pobj_SubAddrSchedule->add( pUserProc, 1 );
@@ -1797,5 +1799,5 @@
 	obp += sizeof(long);
 }
-void op_call( DllProc *pDllProc ){
+void op_call( const DllProc *pDllProc ){
 	OpBuffer[obp++] = (char)0xFF;
 	OpBuffer[obp++] = (char)0x15;
Index: trunk/abdev/BasicCompiler64/increment.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/increment.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/increment.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include "../BasicCompiler_Common/common.h"
 #include "Opcode.h"
Index: trunk/abdev/BasicCompiler64/stack_frame.cpp
===================================================================
--- trunk/abdev/BasicCompiler64/stack_frame.cpp	(revision 204)
+++ trunk/abdev/BasicCompiler64/stack_frame.cpp	(revision 206)
@@ -1,2 +1,4 @@
+#include "stdafx.h"
+
 #include "../BasicCompiler_Common/common.h"
 #include "Opcode.h"
