Index: BasicCompiler64/Compile_Var.cpp
===================================================================
--- BasicCompiler64/Compile_Var.cpp	(revision 73)
+++ BasicCompiler64/Compile_Var.cpp	(revision 75)
@@ -3,17 +3,14 @@
 
 //変数
-VARIABLE *GlobalVar;
+Variables globalVars;
 int MaxGlobalVarNum;
 int AllGlobalVarSize;
 int AllInitGlobalVarSize;
-VARIABLE *LocalVar;
+
 int MaxLocalVarNum;
 int AllLocalVarSize;
 
 
-void SetRelativeOffset(int *pType,LONG_PTR lpIndex,RELATIVE_VAR *pRelativeVar,char *lpPtrOffset){
-	int i2;
-
-
+void SetRelativeOffset( Type &resultType, RELATIVE_VAR *pRelativeVar,const char *lpPtrOffset){
 	/////////////////////////////////////////////
 	// 先頭ポインタをr12に取得してメモリへ退避
@@ -31,7 +28,10 @@
 
 	int reg=REG_NON;
-	i2=NumOpe(&reg,lpPtrOffset,0,0,0);
-	if(!IsWholeNumberType(i2)) SetError(46,NULL,cp);
-	ExtendTypeTo64(i2,reg);
+	Type type;
+	NumOpe( &reg, lpPtrOffset, Type(), type );
+	if( !type.IsWhole() ){
+		SetError(46,NULL,cp);
+	}
+	ExtendTypeTo64(type.GetBasicType(),reg);
 
 	if(reg==REG_R14){
@@ -40,11 +40,11 @@
 	}
 
-	if(PTR_LEVEL(*pType)){
-		*pType = PTR_LEVEL_DOWN( *pType );
-
-		i2=GetTypeSize(*pType,lpIndex);
-		if(i2>=2){
+	if( resultType.PtrLevel() ){
+		resultType.PtrLevelDown();
+
+		int typeSize = resultType.GetSize();
+		if(typeSize>=2){
 			//imul reg,i2
-			op_imul_RV(sizeof(_int64),reg,i2);
+			op_imul_RV(sizeof(_int64),reg,typeSize);
 		}
 	}
@@ -80,7 +80,7 @@
 	}
 }
-BOOL GetArrayOffset(int *SubScripts,char *array,int type,LONG_PTR lpIndex){
+bool GetArrayOffset(const int *SubScripts,char *array, const Type &type){
 	extern HANDLE hHeap;
-	int i,i2,i3,i4,TypeSize;
+	int i,i2,i3,i4;
 	char temporary[VN_SIZE],*pParm[MAX_PARMS];
 
@@ -101,5 +101,5 @@
 			if(SubScripts[i3]==-1){
 				for(i3--;i3>=0;i3--) HeapDefaultFree(pParm[i3]);
-				return 0;
+				return false;
 			}
 
@@ -114,5 +114,5 @@
 				if(SubScripts[i3]!=-1){
 					for(i3--;i3>=0;i3--) HeapDefaultFree(pParm[i3]);
-					return 0;
+					return false;
 				}
 				break;
@@ -136,17 +136,19 @@
 
 		int reg=REG_NON;
-		TYPEINFO TypeInfo;
+		Type type;
 		BOOL bUseHeap;
-		TypeInfo.type=NumOpe(&reg,pParm[i],DEF_LONG,-1,&TypeInfo.u.lpIndex,&bUseHeap);
-		if(TypeInfo.type==DEF_OBJECT){
+		NumOpe( &reg, pParm[i], Type( DEF_LONG ), type, &bUseHeap );
+		if( type.IsObject() ){
 			//キャスト演算子のオーバーロードに対応する
 			CallCastOperatorProc(reg,
-				TypeInfo.type,TypeInfo.u.lpIndex,
-				bUseHeap,DEF_LONG,-1);
-			TypeInfo.type=DEF_LONG;
-		}
-
-		if(!IsWholeNumberType(TypeInfo.type)) SetError(46,NULL,cp);
-		ExtendTypeTo64(TypeInfo.type,reg);
+				type,
+				bUseHeap, Type(DEF_LONG) );
+			type.SetBasicType( DEF_LONG );
+		}
+
+		if( !type.IsWhole() ){
+			SetError(46,NULL,cp);
+		}
+		ExtendTypeTo64( type.GetBasicType(), reg );
 
 		if(reg==REG_R14){
@@ -168,6 +170,4 @@
 		HeapDefaultFree(pParm[i]);
 	}
-
-	TypeSize=GetTypeSize(type,lpIndex);
 
 	//imul r12,TypeSize
@@ -175,5 +175,5 @@
 	OpBuffer[obp++]=(char)0x69;
 	OpBuffer[obp++]=(char)0xE4;
-	*((long *)(OpBuffer+obp))=TypeSize;
+	*((long *)(OpBuffer+obp))=type.GetSize();
 	obp+=sizeof(long);
 
@@ -186,7 +186,7 @@
 	OpBuffer[obp++]=(char)0xDC;
 
-	return 1;
+	return true;
 }
-BOOL GetMemberOffset(bool isErrorEnabled, bool isWriteAccess, CClass *pobj_c, char *member, int *pType, RELATIVE_VAR *pRelativeVar, LONG_PTR *plpNestIndex, BOOL bPrivateAccess){
+bool _member_offset(bool isErrorEnabled, bool isWriteAccess, const CClass &objClass, const char *member, RELATIVE_VAR *pRelativeVar, Type &resultType, BOOL bPrivateAccess){
 	int i;
 
@@ -202,5 +202,5 @@
 	CClass::RefType refType;
 	lstrcpy(VarName,member);
-	if(!GetVarFormatString(VarName,array,lpPtrOffset,NestMember,refType)) return 0;
+	if(!GetVarFormatString(VarName,array,lpPtrOffset,NestMember,refType)) return false;
 
 
@@ -209,19 +209,19 @@
 	////////////////////////////
 
-	int offset = pobj_c->GetMemberOffset( VarName, &i );
-	if(i==pobj_c->iMemberNum){
+	int offset = objClass.GetMemberOffset( VarName, &i );
+	if(i==objClass.iMemberNum){
 		if(isErrorEnabled) SetError(103,VarName,cp);
-		return 0;
-	}
-
-	CMember *pMember=pobj_c->ppobj_Member[i];
+		return false;
+	}
+
+	CMember *pMember=objClass.ppobj_Member[i];
 
 
 	//アクセシビリティをチェック
-	if(pobj_c==pobj_CompilingClass){
+	if(&objClass==pobj_CompilingClass){
 		//同一クラスオブジェクトの場合はプライベートアクセスを容認する
 		if(pMember->dwAccess==ACCESS_NON){
 			if(isErrorEnabled) SetError(107,VarName,cp);
-			return 0;
+			return false;
 		}
 	}
@@ -230,9 +230,9 @@
 			pMember->dwAccess==ACCESS_NON){
 			if(isErrorEnabled) SetError(107,VarName,cp);
-			return 0;
+			return false;
 		}
 		else if(bPrivateAccess==0&&pMember->dwAccess==ACCESS_PROTECTED){
 			if(isErrorEnabled) SetError(108,VarName,cp);
-			return 0;
+			return false;
 		}
 	}
@@ -242,5 +242,5 @@
 	if( pMember->IsConst() &&		//定数メンバである
 		isWriteAccess &&							//書き込みアクセスを要求されている
-		pobj_c->IsCompilingConstructor() == false	//コンストラクタ コンパイル中を除く
+		objClass.IsCompilingConstructor() == false	//コンストラクタ コンパイル中を除く
 		){
 			//Const定義の変数に書き込みアクセスをしようとした場合
@@ -248,9 +248,8 @@
 	}
 
-	*pType=pMember->TypeInfo.type;
-	*plpNestIndex=pMember->TypeInfo.u.lpIndex;
+	resultType = *pMember;
 
 	//ポインタ変数の場合
-	if(IsPtrType(*pType)){
+	if( resultType.IsPointer() ){
 		if(pMember->SubScripts[0]==-1){
 			lstrcpy(lpPtrOffset,array);
@@ -261,5 +260,5 @@
 		if(lpPtrOffset[0]){
 			if(isErrorEnabled) SetError(16,member,cp);
-			return 0;
+			return false;
 		}
 	}
@@ -276,10 +275,10 @@
 	if(array[0]){
 		//配列オフセット
-		if(!GetArrayOffset(pMember->SubScripts,array,*pType,pMember->TypeInfo.u.lpIndex)){
+		if(!GetArrayOffset(pMember->SubScripts,array,*pMember)){
 			if(isErrorEnabled) SetError(14,member,cp);
 		}
 	}
 	else if(pMember->SubScripts[0]!=-1){
-		*pType|=FLAG_PTR;
+		resultType.SetBasicType( resultType.GetBasicType() | FLAG_PTR );
 	}
 
@@ -287,27 +286,28 @@
 		//入れ子構造の場合
 
-		if(*pType==DEF_OBJECT || *pType==DEF_STRUCT){
+		if( resultType.IsObject() || resultType.IsStruct() ){
 			if( refType != CClass::Dot ){
 				if(isErrorEnabled) SetError(104,member,cp);
-				return 0;
-			}
-
-			if( *pType==DEF_OBJECT ){
+				return false;
+			}
+
+			if( resultType.IsObject() ){
 				// 参照内容へのポインタを抽出
 				SetRelativeOffset( *pRelativeVar );
 			}
 		}
-		else if(*pType==DEF_PTR_OBJECT||*pType==DEF_PTR_STRUCT){
+		else if( resultType.IsObjectPtr() || resultType.IsStructPtr() ){
 			//構造体ポインタ型メンバ変数
 
 			if(lpPtrOffset[0]){
 				//pObj[n].member
-				if( ( *pType==DEF_PTR_OBJECT||*pType==DEF_PTR_STRUCT )&& refType != CClass::Dot ){
-					if(isErrorEnabled) SetError(104,member,cp);
-					return 0;
+				if( ( resultType.IsObjectPtr() || resultType.IsStructPtr() )
+					&& refType != CClass::Dot ){
+						if(isErrorEnabled) SetError(104,member,cp);
+						return false;
 				}
 
 				//直接参照に切り替え
-				SetRelativeOffset(pType,*plpNestIndex,pRelativeVar,lpPtrOffset);
+				SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
 				pRelativeVar->dwKind=VAR_DIRECTMEM;
 
@@ -316,7 +316,8 @@
 			else{
 				//pObj->member
-				if( ( *pType==DEF_PTR_OBJECT||*pType==DEF_PTR_STRUCT )&& refType != CClass::Pointer ){
-					if(isErrorEnabled) SetError(104,member,cp);
-					return 0;
+				if( (resultType.IsObjectPtr() || resultType.IsStructPtr() )
+					&& refType != CClass::Pointer ){
+						if(isErrorEnabled) SetError(104,member,cp);
+						return false;
 				}
 
@@ -324,5 +325,6 @@
 			}
 		}
-		else if(*pType==MAKE_PTR_TYPE(DEF_OBJECT,2) || *pType==MAKE_PTR_TYPE(DEF_STRUCT,2)){
+		else if( resultType.GetBasicType() == MAKE_PTR_TYPE(DEF_OBJECT,2)
+			|| resultType.GetBasicType() == MAKE_PTR_TYPE(DEF_STRUCT,2)){
 			//構造体ポインタのポインタ型メンバ変数
 
@@ -331,9 +333,9 @@
 				if( refType != CClass::Pointer ){
 					if(isErrorEnabled) SetError(104,member,cp);
-					return 0;
+					return false;
 				}
 
 				//直接参照に切り替え
-				SetRelativeOffset(pType,*plpNestIndex,pRelativeVar,lpPtrOffset);
+				SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
 				pRelativeVar->dwKind=VAR_DIRECTMEM;
 
@@ -345,25 +347,24 @@
 			else{
 				if(isErrorEnabled) SetError(104,member,cp);
-				return 0;
-			}
-		}
-
-		if(!GetMemberOffset(
+				return false;
+			}
+		}
+
+		if(!_member_offset(
 			isErrorEnabled,
 			isWriteAccess,
-			pMember->TypeInfo.u.pobj_Class,
+			pMember->GetClass(),
 			NestMember,
-			pType,
 			pRelativeVar,
-			plpNestIndex,
-			0)) return 0;
+			resultType,
+			0)) return false;
 	}
 
 	if(lpPtrOffset[0]){
-		SetRelativeOffset(pType,*plpNestIndex,pRelativeVar,lpPtrOffset);
+		SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
 		pRelativeVar->dwKind=VAR_DIRECTMEM;
 	}
 
-	return 1;
+	return true;
 }
 void GetWithName(char *buffer){
@@ -380,5 +381,4 @@
 	//自身のオブジェクトのThisポインタをregにコピー
 
-	extern VARIABLE *LocalVar;
 	RELATIVE_VAR RelativeVar;
 	RelativeVar.dwKind=VAR_LOCAL;
@@ -388,8 +388,6 @@
 	SetReg_WholeVariable(DEF_PTR_VOID,&RelativeVar,reg);
 }
-BOOL GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpIndex,int *pss){
-	extern BOOL bCompilingGlobal;
+bool GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType,int *pss){
 	int i;
-	LONG_PTR lpIndex;
 	char variable[VN_SIZE],member[VN_SIZE],VarName[VN_SIZE],array[VN_SIZE],lpPtrOffset[VN_SIZE];
 
@@ -406,8 +404,10 @@
 
 		void *pInfo;
-		int idProc=GetProc(VarName,&pInfo);
+		int idProc=GetProc(VarName,(void **)&pInfo);
 
 		if(idProc){
 			pRelativeVar->dwKind=VAR_DIRECTMEM;
+
+			Type type;
 
 			//////////////////////////////////////////////////////
@@ -420,5 +420,5 @@
 				////////////////
 
-				*pType=CallProc(idProc,pInfo,VarName,array,&lpIndex);
+				CallProc(idProc,pInfo,VarName,array,type);
 
 				//戻り値をr11にコピー
@@ -430,13 +430,11 @@
 			}////////////////////////////////////////////
 
-			LONG_PTR lp2;
-			if(!GetMemberOffset(
+			if(!_member_offset(
 				isErrorEnabled,
 				isWriteAccess,
-				(CClass *)lpIndex,
-				member,pType,pRelativeVar,&lp2,0)) return 0;
-			if(plpIndex) *plpIndex=lp2;
-
-			return 1;
+				type.GetClass(),
+				member,pRelativeVar,resultType,0)) return false;
+
+			return true;
 		}
 	}
@@ -447,24 +445,18 @@
 	GetVarFormatString(VarName,array,lpPtrOffset,member,refType);
 
-	int *pSubScripts;
+	const int *pSubScripts;
 	bool bConst = false;
 
 
-	if(bCompilingGlobal==0){
+	if( UserProc::IsLocalAreaCompiling() ){
 		//////////////////
 		// ローカル変数
 		//////////////////
 
-		for(i=MaxLocalVarNum-1;i>=0;i--){	//レキシカルスコープを考慮してバックサーチ
-			if( LocalVar[i].bLiving											//現在のスコープで有効なもの
-				&& LocalVar[i].ScopeLevel <= obj_LexScopes.GetNowLevel()	//現在のスコープレベルを超さないもの（Returnによる解放処理中を考慮）
-				){
-					if(lstrcmp(VarName,LocalVar[i].name)==0) break;
-			}
-		}
-		if(i>=0){
+		const Variable *pVar = UserProc::CompilingUserProc().localVars.BackSearch( VarName );
+		if( pVar ){
 			//ポインタ変数の場合
-			if(IsPtrType(LocalVar[i].type)){
-				if(LocalVar[i].SubScripts[0]==-1){
+			if( pVar->IsPointer() ){
+				if( !pVar->IsArray() ){
 					lstrcpy(lpPtrOffset,array);
 					array[0]=0;
@@ -475,20 +467,18 @@
 					SetError(16,variable,cp);
 					pRelativeVar->dwKind=NON_VAR;
-					return 0;
+					return false;
 				}
 			}
 
-			pRelativeVar->offset=-LocalVar[i].offset;
+			pRelativeVar->offset=-pVar->offset;
 			pRelativeVar->bOffsetOffset=0;
-			if(LocalVar[i].fRef){
+			if( pVar->IsRef() ){
 				// 参照型
 				pRelativeVar->dwKind = VAR_REFLOCAL;
 			}
 			else pRelativeVar->dwKind=VAR_LOCAL;
-			*pType=LocalVar[i].type;
-			lpIndex=LocalVar[i].u.index;
-			if(plpIndex) *plpIndex=lpIndex;
-			pSubScripts=LocalVar[i].SubScripts;
-			bConst = LocalVar[i].bConst;
+			resultType = *pVar;
+			pSubScripts=pVar->GetSubScriptsPtr();
+			bConst = pVar->IsConst();
 
 			goto ok;
@@ -506,9 +496,8 @@
 			SetThisPtrToReg(REG_R11);
 
-			*pType=DEF_OBJECT;
 			pRelativeVar->dwKind=VAR_DIRECTMEM;
 
-			if(plpIndex) *plpIndex=(LONG_PTR)pobj_CompilingClass;
-			return 1;
+			resultType.SetType( DEF_OBJECT, pobj_CompilingClass );
+			return true;
 		}
 
@@ -542,126 +531,111 @@
 
 		pRelativeVar->dwKind=VAR_DIRECTMEM;
-		if(!GetMemberOffset(
+		if(!_member_offset(
 			isErrorEnabled,
 			isWriteAccess,
-			pobj_CompilingClass,
+			*pobj_CompilingClass,
 			variable,
-			pType,
 			pRelativeVar,
-			&lpIndex,1)) return 0;
-		if(plpIndex) *plpIndex=lpIndex;
-		return 1;
+			resultType,1)) return false;
+		return true;
 	}
 
 NonClassMember:
 
-	//////////////////////////
-	// 静的ローカル変数
-	// ※"Static.Object.Method.Variable"
-	//////////////////////////
-
-	char temporary[VN_SIZE];
-	extern SubInfo *pCompilingSubInfo;
-	if(pCompilingSubInfo){
-		GetNowStaticVarFullName(VarName,temporary);
-
-		for(i=0;i<MaxGlobalVarNum;i++){
-			if(lstrcmp(temporary,GlobalVar[i].name)==0) break;
-		}
-		if(i!=MaxGlobalVarNum){
+	{
+		const Variable *pVar;
+
+		//////////////////////////
+		// 静的ローカル変数
+		// ※"Static.Object.Method.Variable"
+		//////////////////////////
+
+		char temporary[VN_SIZE];
+		if( UserProc::IsLocalAreaCompiling() ){
+			GetNowStaticVarFullName(VarName,temporary);
+
+			pVar = globalVars.Find( temporary );
+			if( pVar ){
+				goto GlobalOk;
+			}
+		}
+
+
+		//////////////////////////
+		// クラスの静的メンバ
+		//////////////////////////
+
+		if(member[0]){
+			lstrcpy(temporary,member);
+
+			char tempMember[VN_SIZE];
+			char tempArray[VN_SIZE];
+			{
+				CClass::RefType refType;
+				GetVarFormatString(temporary,tempArray,lpPtrOffset,tempMember, refType );
+			}
+
+			char temp2[VN_SIZE];
+			sprintf(temp2,"%s.%s",VarName,temporary);
+			pVar = globalVars.Find( temp2 );
+			if( pVar ){
+				lstrcpy(member,tempMember);
+				lstrcpy(array,tempArray);
+				goto GlobalOk;
+			}
+		}
+
+		if(pobj_CompilingClass){
+			//自身のクラスから静的メンバを参照する場合
+			char temp2[VN_SIZE];
+			sprintf(temp2,"%s.%s",pobj_CompilingClass->name,VarName);
+			pVar = globalVars.Find( temp2 );
+			if( pVar ){
+				goto GlobalOk;
+			}
+		}
+
+		/////////////////////
+		// グローバル変数
+		/////////////////////
+
+		pVar = globalVars.BackSearch( VarName );
+		if( pVar ){
 			goto GlobalOk;
 		}
-	}
-
-
-	//////////////////////////
-	// クラスの静的メンバ
-	//////////////////////////
-
-	if(member[0]){
-		lstrcpy(temporary,member);
-
-		char tempMember[VN_SIZE];
-		char tempArray[VN_SIZE];
-		{
-			CClass::RefType refType;
-			GetVarFormatString(temporary,tempArray,lpPtrOffset,tempMember, refType );
-		}
-
-		char temp2[VN_SIZE];
-		sprintf(temp2,"%s.%s",VarName,temporary);
-		for(i=0;i<MaxGlobalVarNum;i++){
-			if(lstrcmp(temp2,GlobalVar[i].name)==0) break;
-		}
-
-		if(i!=MaxGlobalVarNum){
-			lstrcpy(member,tempMember);
-			lstrcpy(array,tempArray);
-			goto GlobalOk;
-		}
-	}
-
-	if(pobj_CompilingClass){
-		//自身のクラスから静的メンバを参照する場合
-		char temp2[VN_SIZE];
-		sprintf(temp2,"%s.%s",pobj_CompilingClass->name,VarName);
-		for(i=0;i<MaxGlobalVarNum;i++){
-			if(lstrcmp(temp2,GlobalVar[i].name)==0) break;
-		}
-
-		if(i!=MaxGlobalVarNum){
-			goto GlobalOk;
-		}
-	}
-
-	/////////////////////
-	// グローバル変数
-	/////////////////////
-
-	for(i=MaxGlobalVarNum-1;i>=0;i--){	//レキシカルスコープを考慮してバックサーチ
-		if( GlobalVar[i].bLiving										//現在のスコープで有効なもの
-			&& GlobalVar[i].ScopeLevel <= obj_LexScopes.GetNowLevel()	//現在のスコープレベルを超さないもの（Returnによる解放処理中を考慮）
-			){
-				if(lstrcmp(VarName,GlobalVar[i].name)==0) break;
-		}
-	}
-	if(i>=0){
-		goto GlobalOk;
-	}
-
-	if(isErrorEnabled) SetError(3,variable,cp);
-	pRelativeVar->dwKind=NON_VAR;
-	return 0;
+
+		if(isErrorEnabled) SetError(3,variable,cp);
+		pRelativeVar->dwKind=NON_VAR;
+		return false;
 
 
 
 GlobalOk:
-	//ポインタ変数の場合
-	if(IsPtrType(GlobalVar[i].type)){
-		if(GlobalVar[i].SubScripts[0]==-1){
-			lstrcpy(lpPtrOffset,array);
-			array[0]=0;
-		}
-	}
-	else{
-		if(lpPtrOffset[0]){
-			SetError(16,variable,cp);
-			pRelativeVar->dwKind=NON_VAR;
-			return 0;
-		}
-	}
-
-	pRelativeVar->offset=GlobalVar[i].offset;
-	pRelativeVar->bOffsetOffset=0;
-	if(GlobalVar[i].fRef){
-		// 参照型
-		pRelativeVar->dwKind = VAR_REFGLOBAL;
-	}
-	else pRelativeVar->dwKind=VAR_GLOBAL;
-	*pType=GlobalVar[i].type;
-	lpIndex=GlobalVar[i].u.index;
-	if(plpIndex) *plpIndex=lpIndex;
-	pSubScripts=GlobalVar[i].SubScripts;
-	bConst = GlobalVar[i].bConst;
+		//ポインタ変数の場合
+		if( pVar->IsPointer() ){
+			if( !pVar->IsArray() ){
+				lstrcpy(lpPtrOffset,array);
+				array[0]=0;
+			}
+		}
+		else{
+			if(lpPtrOffset[0]){
+				SetError(16,variable,cp);
+				pRelativeVar->dwKind=NON_VAR;
+				return false;
+			}
+		}
+
+		pRelativeVar->offset=pVar->offset;
+		pRelativeVar->bOffsetOffset=0;
+		if( pVar->IsRef() ){
+			// 参照型
+			pRelativeVar->dwKind = VAR_REFGLOBAL;
+		}
+		else pRelativeVar->dwKind=VAR_GLOBAL;
+		resultType = *pVar;
+		pSubScripts=pVar->GetSubScriptsPtr();
+		bConst = pVar->IsConst();
+	}
 
 
@@ -671,5 +645,5 @@
 	if( bConst && isWriteAccess ){
 		//Const定義の変数に書き込みアクセスをしようとした場合
-		if( *pType == DEF_OBJECT ){
+		if( resultType.IsObject() ){
 			//オブジェクト定数
 			SetError(130, VarName, cp );
@@ -683,7 +657,7 @@
 	if(array[0]==0&&pSubScripts[0]!=-1){
 		//配列の先頭ポインタを示す場合
-		*pType|=FLAG_PTR;
+		resultType.SetBasicType( resultType.GetBasicType() | FLAG_PTR );
 		if(pss) memcpy(pss,pSubScripts,MAX_ARRAYDIM);
-		return 1;
+		return true;
 	}
 
@@ -696,25 +670,25 @@
 	}
 	if(array[0]){
-		if(!GetArrayOffset(pSubScripts,array,*pType,lpIndex)){
+		if(!GetArrayOffset(pSubScripts,array,resultType)){
 			SetError(14,variable,cp);
 			pRelativeVar->dwKind=NON_VAR;
-			return 0;
+			return false;
 		}
 	}
 	if(member[0]){
-		if(*pType==DEF_OBJECT || *pType==DEF_STRUCT){
+		if( resultType.IsObject() || resultType.IsStruct() ){
 			//実態オブジェクトのメンバを参照（obj.member）
 			if( refType != CClass::Dot ){
 				SetError(104,VarName,cp);
 				pRelativeVar->dwKind=NON_VAR;
-				return 0;
-			}
-
-			if( *pType==DEF_OBJECT ){
+				return false;
+			}
+
+			if( resultType.IsObject() ){
 				// 参照内容へのポインタを抽出
 				SetRelativeOffset( *pRelativeVar );
 			}
 		}
-		else if(*pType==DEF_PTR_OBJECT || *pType==DEF_PTR_STRUCT){
+		else if( resultType.IsObjectPtr() || resultType.IsStructPtr() ){
 			//ポインタオブジェクトが示すメンバを参照
 			if(lpPtrOffset[0]){
@@ -723,7 +697,7 @@
 					SetError(104,VarName,cp);
 					pRelativeVar->dwKind=NON_VAR;
-					return 0;
+					return false;
 				}
-				SetRelativeOffset(pType,lpIndex,pRelativeVar,lpPtrOffset);
+				SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
 				pRelativeVar->dwKind=VAR_DIRECTMEM;
 			}
@@ -733,5 +707,5 @@
 					SetError(104,VarName,cp);
 					pRelativeVar->dwKind=NON_VAR;
-					return 0;
+					return false;
 				}
 
@@ -743,5 +717,5 @@
 			}
 		}
-		else if(*pType==MAKE_PTR_TYPE(DEF_OBJECT,2) || *pType==MAKE_PTR_TYPE(DEF_STRUCT,2)){
+		else if( resultType.GetBasicType()==MAKE_PTR_TYPE(DEF_OBJECT,2) || resultType.GetBasicType()==MAKE_PTR_TYPE(DEF_STRUCT,2)){
 			//ポインタオブジェクトが示すメンバを参照
 			if(lpPtrOffset[0]){
@@ -750,8 +724,8 @@
 					SetError(104,VarName,cp);
 					pRelativeVar->dwKind=NON_VAR;
-					return 0;
+					return false;
 				}
 
-				SetRelativeOffset(pType,lpIndex,pRelativeVar,lpPtrOffset);
+				SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
 				pRelativeVar->dwKind=VAR_DIRECTMEM;
 
@@ -765,5 +739,5 @@
 				SetError(104,VarName,cp);
 				pRelativeVar->dwKind=NON_VAR;
-				return 0;
+				return false;
 			}
 		}
@@ -771,29 +745,27 @@
 			SetError(102,VarName,cp);
 			pRelativeVar->dwKind=NON_VAR;
-			return 0;
-		}
-
-		LONG_PTR lp2;
-		if(!GetMemberOffset(
+			return false;
+		}
+
+		if(!_member_offset(
 			isErrorEnabled,
 			isWriteAccess,
-			(CClass *)lpIndex,
-			member,pType,pRelativeVar,&lp2,0)) return 0;
-		if(plpIndex) *plpIndex=lp2;
-
-		return 1;
+			resultType.GetClass(),
+			member,pRelativeVar,resultType,0)) return false;
+
+		return true;
 	}
 
 	if(lpPtrOffset[0]){
-		SetRelativeOffset(pType,lpIndex,pRelativeVar,lpPtrOffset);
+		SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
 		pRelativeVar->dwKind=VAR_DIRECTMEM;
 	}
 
-	return 1;
+	return true;
 }
 
-BOOL SetInitGlobalData(int offset,int type,LONG_PTR lpIndex,int *SubScripts,char *InitBuf){
+bool SetInitGlobalData(int offset,const Type &type,const int *SubScripts,char *InitBuf){
 	extern BYTE *initGlobalBuf;
-	int i,i2,i3,TypeSize;
+	int i,i2,i3;
 	char temporary[VN_SIZE];
 
@@ -802,8 +774,8 @@
 		InitBuf[lstrlen(InitBuf)-1]=0;
 
-		TypeSize=GetTypeSize(type,lpIndex);
+		int typeSize = type.GetSize();
 
 		if(SubScripts[0]!=-1){
-			TypeSize*=JumpSubScripts(SubScripts+1);
+			typeSize*=JumpSubScripts(SubScripts+1);
 			i=0;
 			i2=0;
@@ -815,41 +787,38 @@
 				i=GetOneParameter(InitBuf,i,temporary);
 				if(!SetInitGlobalData(
-					offset+i2*TypeSize,
+					offset+i2*typeSize,
 					type,
-					lpIndex,
 					SubScripts+1,
-					temporary)) return 0;
+					temporary)) return false;
 				i2++;
 				if(InitBuf[i]=='\0') break;
 			}
-			return -1;
-		}
-
-		if(type==DEF_STRUCT){
-			CClass *pobj_c;
-			pobj_c=(CClass *)lpIndex;
-
-			for(i=0,i2=0;i2<pobj_c->iMemberNum;i2++){
+			return true;
+		}
+
+		if(type.IsStruct()){
+			const CClass &objClass = type.GetClass();
+
+			for(i=0,i2=0;i2<objClass.iMemberNum;i2++){
 				i=GetOneParameter(InitBuf,i,temporary);
 
-				i3=pobj_c->GetMemberOffset( pobj_c->ppobj_Member[i2]->name, NULL );
+				i3=objClass.GetMemberOffset( objClass.ppobj_Member[i2]->name, NULL );
 
 				if(!SetInitGlobalData(offset+i3,
-					pobj_c->ppobj_Member[i2]->TypeInfo.type,
-					pobj_c->ppobj_Member[i2]->TypeInfo.u.lpIndex,
-					pobj_c->ppobj_Member[i2]->SubScripts,
-					temporary)) return 0;
+					*objClass.ppobj_Member[i2],
+					objClass.ppobj_Member[i2]->SubScripts,
+					temporary)) return false;
 
 				if(InitBuf[i]=='\0') break;
 			}
-			if(i2+1!=pobj_c->iMemberNum){
+			if(i2+1!=objClass.iMemberNum){
 				SetError(41,0,cp);
-				return 0;
-			}
-			return 1;
+				return false;
+			}
+			return true;
 		}
 
 		SetError(41,0,cp);
-		return 0;
+		return false;
 	}
 
@@ -859,26 +828,24 @@
 	///////////////////////////////////////
 
-	if( type == DEF_OBJECT || type == DEF_STRUCT ){
+	if( type.IsObject() || type.IsStruct() ){
 		//オブジェクトまたは構造体の場合はありえない
 		SetError(300,NULL,cp);
-		return 0;
+		return false;
 	}
 
 	if(SubScripts[0]!=-1){
 		SetError(41,0,cp);
-		return 0;
+		return false;
 	}
 
 	double dbl;
 	_int64 i64data;
-	int CalcType;
-	LONG_PTR lpCalcIndex;
-
-	CalcType=StaticCalculation(false, InitBuf,type,&i64data,&lpCalcIndex);
-	if(!CalcType){
+	Type calcType;
+
+	if( !StaticCalculation(false, InitBuf,type.GetBasicType(),&i64data,calcType) ){
 		//動的データだった場合
-		return 0;
-	}
-	if(IsRealNumberType(CalcType)){
+		return false;
+	}
+	if( calcType.IsReal() ){
 		memcpy(&dbl,&i64data,sizeof(double));
 		i64data=(_int64)dbl;
@@ -889,15 +856,15 @@
 	CheckDifferentType(
 		type,
-		lpIndex,
-		CalcType,
-		lpCalcIndex,
+		calcType,
 		0,0);
 
-	if(type==DEF_DOUBLE)
+	if( type.IsDouble() ){
 		*(double *)(initGlobalBuf+offset)=(double)dbl;
-	else if(type==DEF_SINGLE)
-			*(float *)(initGlobalBuf+offset)=(float)dbl;
-	else if(type==DEF_INT64||type==DEF_QWORD||IsPtrType(type)){
-		if(type==typeOfPtrChar&&lpCalcIndex==LITERAL_STRING){
+	}
+	else if( type.IsSingle() ){
+		*(float *)(initGlobalBuf+offset)=(float)dbl;
+	}
+	else if( type.Is64() || type.IsPointer() ){
+		if(type.GetBasicType()==typeOfPtrChar && type.GetIndex()==LITERAL_STRING){
 			//文字列定数のとき
 
@@ -923,15 +890,18 @@
 		}
 	}
-	else if(type==DEF_LONG||type==DEF_DWORD)
+	else if( type.IsDWord() || type.IsLong() ){
 		*(DWORD *)(initGlobalBuf+offset)=(DWORD)i64data;
-	else if(type==DEF_INTEGER||type==DEF_WORD || (isUnicode&&type==DEF_CHAR))
+	}
+	else if( type.IsWord() || type.IsInteger() ){
 		*(WORD *)(initGlobalBuf+offset)=(WORD)i64data;
-	else if(type==DEF_SBYTE||type==DEF_BYTE||type==DEF_BOOLEAN || (isUnicode==false&&type==DEF_CHAR))
+	}
+	else if( type.IsSByte() || type.IsByte() || type.IsBoolean() ){
 		*(BYTE *)(initGlobalBuf+offset)=(BYTE)i64data;
-
-	return 1;
+	}
+
+	return true;
 }
-BOOL InitLocalVar(int offset,int type,LONG_PTR lpIndex,int *SubScripts,char *InitBuf){
-	int i,i2,i3,TypeSize;
+bool InitLocalVar(int offset,const Type &type,const int *SubScripts,char *InitBuf){
+	int i,i2,i3;
 	char temporary[VN_SIZE];
 
@@ -940,8 +910,8 @@
 		InitBuf[lstrlen(InitBuf)-1]=0;
 
-		TypeSize=GetTypeSize(type,lpIndex);
+		int typeSize = type.GetSize();
 
 		if(SubScripts[0]!=-1){
-			TypeSize*=JumpSubScripts(SubScripts+1);
+			typeSize*=JumpSubScripts(SubScripts+1);
 			i=0;
 			i2=0;
@@ -949,45 +919,42 @@
 				if(SubScripts[0]<i2){
 					SetError(41,0,cp);
-					return 0;
+					return false;
 				}
 				i=GetOneParameter(InitBuf,i,temporary);
 				if(!InitLocalVar(
-					offset+i2*TypeSize,
+					offset+i2*typeSize,
 					type,
-					lpIndex,
 					SubScripts+1,
-					temporary)) return 0;
+					temporary)) return false;
 				i2++;
 				if(InitBuf[i]=='\0') break;
 			}
-			return -1;
-		}
-
-		if(type==DEF_STRUCT){
-			CClass *pobj_c;
-			pobj_c=(CClass *)lpIndex;
-
-			for(i=0,i2=0;i2<pobj_c->iMemberNum;i2++){
+			return true;
+		}
+
+		if(type.IsStruct()){
+			const CClass &objClass = type.GetClass();
+
+			for(i=0,i2=0;i2<objClass.iMemberNum;i2++){
 				i=GetOneParameter(InitBuf,i,temporary);
 
-				i3=pobj_c->GetMemberOffset( pobj_c->ppobj_Member[i2]->name, NULL );
+				i3=objClass.GetMemberOffset( objClass.ppobj_Member[i2]->name, NULL );
 
 				if(!InitLocalVar(offset+i3,
-					pobj_c->ppobj_Member[i2]->TypeInfo.type,
-					pobj_c->ppobj_Member[i2]->TypeInfo.u.lpIndex,
-					pobj_c->ppobj_Member[i2]->SubScripts,
-					temporary)) return 0;
+					*objClass.ppobj_Member[i2],
+					objClass.ppobj_Member[i2]->SubScripts,
+					temporary)) return false;
 
 				if(InitBuf[i]=='\0') break;
 			}
-			if(i2+1!=pobj_c->iMemberNum){
+			if(i2+1!=objClass.iMemberNum){
 				SetError(41,0,cp);
 				return 0;
 			}
-			return 1;
+			return true;
 		}
 
 		SetError(41,0,cp);
-		return 0;
+		return false;
 	}
 
@@ -999,17 +966,16 @@
 	if(SubScripts[0]!=-1){
 		SetError(41,0,cp);
-		return 0;
+		return false;
 	}
 
 	double dbl;
 	_int64 i64data;
-	int CalcType;
-	LONG_PTR lpCalcIndex;
-	CalcType=StaticCalculation(false, InitBuf,type,&i64data,&lpCalcIndex);
-	if(!CalcType){
+	Type calcType;
+
+	if( !StaticCalculation(false, InitBuf,type.GetBasicType(),&i64data,calcType) ){
 		//動的データだった場合
-		return 0;
-	}
-	if(IsRealNumberType(CalcType)){
+		return false;
+	}
+	if( calcType.IsReal() ){
 		memcpy(&dbl,&i64data,sizeof(double));
 		i64data=(_int64)dbl;
@@ -1020,10 +986,8 @@
 	CheckDifferentType(
 		type,
-		lpIndex,
-		CalcType,
-		lpCalcIndex,
+		calcType,
 		0,0);
 
-	if(type==DEF_DOUBLE){
+	if( type.IsDouble() ){
 		memcpy(&i64data,&dbl,sizeof(double));
 
@@ -1037,5 +1001,5 @@
 		obp+=sizeof(long);
 	}
-	else if(type==DEF_SINGLE){
+	else if( type.IsSingle() ){
 		float flt;
 		flt=(float)dbl;
@@ -1047,6 +1011,6 @@
 		obp+=sizeof(long)+sizeof(long);
 	}
-	else if(type==DEF_INT64||type==DEF_QWORD||IsPtrType(type)){
-		if(type==typeOfPtrChar&&lpCalcIndex==LITERAL_STRING){
+	else if( type.Is64() || type.IsPointer() ){
+		if(type.GetBasicType()==typeOfPtrChar && type.GetIndex()==LITERAL_STRING){
 			//文字列定数のとき
 
@@ -1088,5 +1052,5 @@
 		}
 	}
-	else if(type==DEF_LONG||type==DEF_DWORD){
+	else if( type.IsDWord() || type.IsLong() ){
 		//mov dword ptr[rsp+offset],value
 		op_mov_MV(sizeof(long),REG_RSP,offset,USE_OFFSET,(int)i64data);
@@ -1095,5 +1059,5 @@
 		obp+=sizeof(long)+sizeof(long);
 	}
-	else if(type==DEF_INTEGER||type==DEF_WORD || (isUnicode&&type==DEF_CHAR)){
+	else if( type.IsWord() || type.IsInteger() ){
 		//mov word ptr[rsp+offset],value
 		op_mov_MV(sizeof(short),REG_RSP,offset,USE_OFFSET,(int)i64data);
@@ -1102,5 +1066,5 @@
 		obp+=sizeof(long)+sizeof(short);
 	}
-	else if(type==DEF_SBYTE||type==DEF_BYTE||type==DEF_BOOLEAN || (isUnicode==false&&type==DEF_CHAR)){
+	else if( type.IsSByte() || type.IsByte() || type.IsBoolean() ){
 		//mov byte ptr[rsp+offset],value
 		op_mov_MV(sizeof(char),REG_RSP,offset,USE_OFFSET,(int)i64data);
@@ -1109,15 +1073,14 @@
 		obp+=sizeof(long)+sizeof(char);
 	}
-	return 1;
+	return true;
 }
 
-void dim(bool isRef, char *VarName,int *SubScripts,TYPEINFO &TypeInfo,int TypeSize,char *InitBuf,char *ConstractParameter,DWORD dwFlags){
-	extern BOOL bCompilingGlobal;
-	if(bCompilingGlobal){
+void dim(bool isRef, char *VarName,int *SubScripts,Type &type,char *InitBuf,char *ConstractParameter,DWORD dwFlags){
+	if( UserProc::IsGlobalAreaCompiling() ){
 		/////////////////////////
 		// グローバル変数
 		/////////////////////////
 
-		AddGlobalVariable(isRef,VarName,SubScripts,&TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags);
+		AddGlobalVariable(isRef,VarName,SubScripts,type,InitBuf,ConstractParameter,dwFlags);
 	}
 	else{
@@ -1126,49 +1089,36 @@
 		/////////////////
 
-		int i2,i3;
-
-		for(i2=0;i2<MaxLocalVarNum;i2++){
-			if(LocalVar[i2].bLiving&&obj_LexScopes.GetNowLevel()==LocalVar[i2].ScopeLevel){
-				if(lstrcmp(LocalVar[i2].name,VarName)==0){
-					//２重定義のエラー
-					SetError(15,VarName,cp);
-					return;
-				}
-			}
-		}
-
-		LocalVar=(VARIABLE *)HeapReAlloc(hHeap,0,LocalVar,(MaxLocalVarNum+1)*sizeof(VARIABLE));
-		VARIABLE *pVar = &LocalVar[MaxLocalVarNum];
-		MaxLocalVarNum++;
-
-		if( isRef ){
-			//参照型
-			pVar->fRef = REF_VARIABLE;
-			TypeSize = PTR_SIZE;
-		}
-		else pVar->fRef=0;
-
-		for(i2=1,i3=0;i3<255;i3++){
-			//配列要素数
-			pVar->SubScripts[i3]=SubScripts[i3];
-
-			if(SubScripts[i3]==-1) break;
-			i2*=SubScripts[i3]+1;
-		}
-		int VarSize=TypeSize*i2;
-		if(VarSize%8) VarSize+=8-(VarSize%8);
-
-		//変数データを追加
-		lstrcpy(pVar->name,VarName);
-		if(dwFlags & DIMFLAG_CONST) pVar->bConst = true;
-		else pVar->bConst = false;
-		if(SubScripts[0]==-1) pVar->bArray=0;
-		else pVar->bArray=1;
-		pVar->type=TypeInfo.type;
-		pVar->u.index=TypeInfo.u.lpIndex;
+		if( UserProc::CompilingUserProc().localVars.DuplicateCheck( VarName ) ){
+			//２重定義のエラー
+			SetError(15,VarName,cp);
+			return;
+		}
+
+		bool isConst = ( dwFlags & DIMFLAG_CONST ) ? true:false;
+
+		Variable *pVar = new Variable( VarName, type, isConst, isRef );
+
+		if( SubScripts[0] != -1 ){
+			//配列あり
+			pVar->SetArray( SubScripts );
+		}
+
+		//コンストラクタ用パラメータ
+		pVar->paramStrForConstructor = ConstractParameter;
+
+		//レキシカルスコープ
+		pVar->ScopeLevel=obj_LexScopes.GetNowLevel();
+		pVar->ScopeStartAddress=obj_LexScopes.GetStartAddress();
+		pVar->bLiving=TRUE;
+
+		//エラー用
+		pVar->source_code_address=cp;
+
+		// 変数を追加
+		UserProc::CompilingUserProc().localVars.push_back( pVar );
 
 		//アラインメントを考慮
-		if( pVar->type==DEF_STRUCT ){
-			int alignment = pVar->u.pobj_c->iAlign;
+		if( pVar->IsStruct() ){
+			int alignment = pVar->GetClass().iAlign;
 			if( alignment ){
 				if( AllLocalVarSize % alignment ){
@@ -1178,6 +1128,6 @@
 		}
 
-		AllLocalVarSize+=VarSize;
-		pVar->offset=AllLocalVarSize;
+		AllLocalVarSize += pVar->GetMemorySize();
+		pVar->offset = AllLocalVarSize;
 
 		//レキシカルスコープ
@@ -1188,13 +1138,13 @@
 		if(InitBuf[0]){
 			//初期代入時のみ、書き込みアクセスを許可する
-			bool bConstBack = pVar->bConst;
-			pVar->bConst = false;
+			if( isConst ){
+				pVar->ConstOff();
+			}
 
 			int result = 0;
-			if( pVar->type != DEF_OBJECT ){
+			if( !pVar->IsObject() ){
 				result = InitLocalVar(-pVar->offset,
-					pVar->type,
-					pVar->u.index,
-					pVar->SubScripts,
+					*pVar,
+					pVar->GetSubScriptsPtr(),
 					InitBuf);
 			}
@@ -1207,5 +1157,7 @@
 			}
 
-			pVar->bConst = bConstBack;
+			if( isConst ){
+				pVar->ConstOn();
+			}
 		}
 		else{
@@ -1216,5 +1168,5 @@
 
 			//mov rdx, VarSize
-			op_mov_RV( sizeof(_int64), REG_RDX, VarSize );
+			op_mov_RV( sizeof(_int64), REG_RDX, pVar->GetMemorySize() );
 
 			//mov rcx, rsp
@@ -1228,12 +1180,12 @@
 
 			//call FillMemory
-			DECLAREINFO *pdi;
-			pdi=GetDeclareHash("FillMemory");
-			op_call( pdi );
+			DllProc *pDllProc;
+			pDllProc=GetDeclareHash("FillMemory");
+			op_call( pDllProc );
 		}
 	}
 
 	//コンストラクタ呼び出し
-	if(TypeInfo.type==DEF_OBJECT&&(dwFlags&DIMFLAG_NONCALL_CONSTRACTOR)==0&&InitBuf[0]=='\0'){
+	if( type.IsObject() &&(dwFlags&DIMFLAG_NONCALL_CONSTRACTOR)==0&&InitBuf[0]=='\0'){
 		char objectSize[255];
 		if( SubScripts[0] == -1 ){
@@ -1246,10 +1198,9 @@
 			sprintf( objectSize, "%d", SubScripts[0] );
 		}
-		Operator_New( *TypeInfo.u.pobj_Class, objectSize, ConstractParameter, TypeInfo );
-
-		int type;
-		LONG_PTR lpIndex;
+		Operator_New( type.GetClass(), objectSize, ConstractParameter, type );
+
+		Type tempType;
 		RELATIVE_VAR RelativeVar;
-		GetVarOffset( true, false, VarName, &type, &RelativeVar, &lpIndex );
+		GetVarOffset( true, false, VarName, &RelativeVar, tempType );
 		if( RelativeVar.dwKind == VAR_DIRECTMEM ){
 			SetError();
@@ -1258,139 +1209,11 @@
 	}
 
-	if(TypeInfo.type==DEF_OBJECT){
-		if(TypeInfo.u.pobj_Class->IsAbstract()){
+	if( type.IsObject() ){
+		if( type.GetClass().IsAbstract() ){
 			//抽象クラスだったとき
-			SetError(125,TypeInfo.u.pobj_Class->name,cp);
+			SetError(125,type.GetClass().name,cp);
 		}
 	}
 }
-void dim(char *Parameter,DWORD dwFlags){
-	extern BOOL bCompilingGlobal;
-	extern HANDLE hHeap;
-	int i2;
-	char VarName[VN_SIZE];
-
-	//参照型かどうか
-	bool isRef = false;
-
-	i2 = 0;
-
-	if( Parameter[i2] == 1 && Parameter[i2+1] == ESC_BYREF ){
-		//参照型
-		isRef = true;
-		Parameter += 2;
-	}
-
-	if(dwFlags & DIMFLAG_CONST){
-
-		//////////////////////////////////
-		// 定数変数の場合を考慮
-		//////////////////////////////////
-		for(;;i2++){
-			if(Parameter[i2] == '=' ||
-				Parameter[i2] == 1 && Parameter[i2] == ESC_AS ||
-				Parameter[i2] =='('){
-					VarName[i2] = 0;
-					break;
-			}
-			VarName[i2] = Parameter[i2];
-		}
-
-		//定数と２重定義されていないる場合は抜け出す
-		if(CDBConst::obj.GetType(VarName)){
-			return;
-		}
-
-		//定数マクロとして定義されている場合は抜け出す
-		if(GetConstHash(VarName)){
-			return;
-		}
-	}
-
-
-	//構文を解析
-	int SubScripts[MAX_ARRAYDIM];
-	TYPEINFO TypeInfo;
-	char InitBuf[8192];
-	char ConstractParameter[VN_SIZE];
-	if(!GetDimentionFormat(Parameter, isRef , VarName,SubScripts,&TypeInfo,InitBuf,ConstractParameter))
-		return;
-
-
-	//定数と２重定義されていないかを調べる
-	if(CDBConst::obj.GetType(VarName)){
-		SetError(15,VarName,cp);
-		return;
-	}
-
-	//定数マクロとして定義されている場合
-	if(GetConstHash(VarName)){
-		SetError(15,VarName,cp);
-		return;
-	}
-
-
-	//タイプサイズを取得
-	int TypeSize;
-	TypeSize=GetTypeSize(TypeInfo.type,TypeInfo.u.lpIndex);
-
-	extern BOOL bCompilingGlobal;
-	if(dwFlags&DIMFLAG_STATIC){
-		if(bCompilingGlobal){
-			SetError(60,NULL,cp);
-			return;
-		}
-
-		/////////////////////
-		// Static変数
-		// ※"Static.Object.Method.Variable"
-		/////////////////////
-
-		char temporary[VN_SIZE];
-		GetNowStaticVarFullName(VarName,temporary);
-
-		dim( isRef,temporary,SubScripts,TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags );
-
-		/*
-		Note: 静的変数のコンストラクタ呼び出しは
-			_System_InitStaticLocalVariables関数内で一括して行う
-		*/
-	}
-	else{
-		dim( isRef,VarName,SubScripts,TypeInfo,TypeSize,InitBuf,ConstractParameter,dwFlags );
-	}
-}
-void OpcodeDim(char *Parameter,DWORD dwFlags){
-	int i,i2,i3,IsStr=0;
-	char temporary[8192];
-
-	for(i=0,i2=0;;i++,i2++){
-		if(Parameter[i]=='\"') IsStr^=1;
-		if(Parameter[i]=='('&&IsStr==0){
-			i3=GetStringInPare(temporary+i2,Parameter+i);
-			i+=i3-1;
-			i2+=i3-1;
-			continue;
-		}
-		if(Parameter[i]=='['&&IsStr==0){
-			i3=GetStringInBracket(temporary+i2,Parameter+i);
-			i+=i3-1;
-			i2+=i3-1;
-			continue;
-		}
-		if((Parameter[i]==','&&IsStr==0)||
-			Parameter[i]=='\0'){
-			temporary[i2]=0;
-
-			dim(temporary,dwFlags);
-
-			if(Parameter[i]=='\0') break;
-			i2=-1;
-			continue;
-		}
-		temporary[i2]=Parameter[i];
-	}
-}
-
 void SetVarPtrToReg(int reg,RELATIVE_VAR *pRelativeVar){
 	if(!IsGeneralReg(reg)) SetError(300,NULL,cp);
