Index: BasicCompiler_Common/common.h
===================================================================
--- BasicCompiler_Common/common.h	(revision 73)
+++ BasicCompiler_Common/common.h	(revision 75)
@@ -37,4 +37,5 @@
 #include "../BasicCompiler_Common/psapi.h"
 #include "../BasicCompiler_Common/BreakPoint.h"
+#include "../BasicCompiler_Common/LexicalScoping.h"
 
 
@@ -152,4 +153,7 @@
 #include "Const.h"
 
+// 変数管理用のクラス
+#include "Variable.h"
+
 // パラメータ管理用のクラス
 #include "Parameter.h"
@@ -172,7 +176,4 @@
 
 //変数
-#define REF_PARAMETER 1
-#define OBJECT_PARAMETER 2
-#define REF_VARIABLE 4
 struct VARIABLE{
 	char name[255];
@@ -219,59 +220,4 @@
 };
 
-struct PARAMETER_INFO{
-	char *name;
-	int type;
-	union{
-		LONG_PTR index;
-		CClass *pobj_c;
-	}u;
-
-	BOOL bByVal;
-	BOOL bArray;
-	int SubScripts[MAX_ARRAYDIM];
-};
-
-#define DECLARE_DYNAMIC	1
-#define DECLARE_STATIC	2
-struct DECLAREINFO{
-	DWORD dwType;
-
-	char *file;
-	char *name;
-	char *alias;
-	BOOL bCdecl;
-
-	//パラメータ
-	PARAMETER_INFO *pParmInfo;
-	int ParmNum;
-
-	//戻り値
-	int ReturnType;
-	union{
-		LONG_PTR ReturnIndex;
-		CClass *Return_pobj_c;
-	}u;
-
-	union{
-		int LookupAddress;
-		int StaticProc_CodeAddress;
-	};
-
-	BOOL bUse;
-
-	int pos;
-
-	DECLAREINFO *pNextData;
-};
-struct PROCPTRINFO{
-	PARAMETER_INFO *pParmInfo;
-	int ParmNum;
-
-	int ReturnType;
-	union{
-		LONG_PTR ReturnIndex;
-		CClass *Return_pobj_c;
-	}u;
-};
 struct CONSTINFO{
 	char *name;
@@ -361,11 +307,10 @@
 #include "../BasicCompiler_Common/PESchedule.h"
 #include "../BasicCompiler_Common/DebugSection.h"
-#include "../BasicCompiler_Common/LexicalScoping.h"
-#include "../BasicCompiler_Common/Variable.h"
+#include "../BasicCompiler_Common/VariableOpe.h"
 #include "../BasicCompiler_Common/Exception.h"
 
 
 
-int StaticCalculation(bool enableerror, const char *Command,int BaseType,_int64 *pi64data,LONG_PTR *plpIndex,BOOL bDebuggingWatchList=0);
+bool StaticCalculation(bool enableerror, const char *Command,int BaseType,_int64 *pi64data,Type &resultType,BOOL bDebuggingWatchList=0, bool *pIsMemoryAccessError=NULL);
 
 
@@ -384,28 +329,26 @@
 
 //hash.cpp
-int hash_default(char *name);
+int hash_default(const char *name);
 CONSTINFO *GetConstHash(char *name);
-DECLAREINFO *GetDeclareHash(char *name);
-SubInfo *GetSubHash(const char *name,BOOL bError=0);
-SubInfo *GetMethodHash(char *ObjectName,char *MethodName,char *Parameter,BOOL bError=0);
-void GetOverloadSubHash( const char *lpszName, std::vector<SubInfo *> &subs );
+DllProc *GetDeclareHash(char *name);
+UserProc *GetSubHash(const char *name,BOOL bError=0);
+UserProc *GetMethodHash(const char *ObjectName,const char *MethodName,const char *Parameter,BOOL bError=0);
+void GetOverloadSubHash( const char *lpszName, std::vector<UserProc *> &subs );
 
 //Object.cpp
-void AddClassName(char *Parameter,int NowLine);
-void CallConstructor(char *VarName,int *SubScripts,TYPEINFO &TypeInfo,char *Parameter);
+void CallConstructor( const char *ObjectName,const int *SubScripts, const Type &type,const char *Parameter);
+bool Operator_New( const char *expression, const Type &baseType, Type &resultType );
 
 //Overload.sbp
-SubInfo *OverloadSolutionWithStrParam(
+UserProc *OverloadSolutionWithStrParam(
 	const char *name,
-	std::vector<SubInfo *> &subs,
+	std::vector<UserProc *> &subs,
 	const char *Parameter,
-	const char *ObjectName,
-	TYPEINFO *pReturnTypeInfo);
-SubInfo *OverloadSolution(
+	const char *ObjectName);
+UserProc *OverloadSolution(
 	const char *name,
-	std::vector<SubInfo *> &subs,
-	const PARAMETER_INFO *ppi,
-	const int ParmNum,
-	TYPEINFO *pReturnTypeInfo);
+	std::vector<UserProc *> &subs,
+	const Parameters &params,
+	const Type &returnType );
 
 //Debug.cpp
@@ -416,5 +359,5 @@
 void Debugger_Pause(void);
 ULONG_PTR rva_to_real(DWORD p);
-SubInfo *GetSubFromObp(ULONG_PTR pos);
+UserProc *GetSubFromObp(ULONG_PTR pos);
 void ReadOpBuffer();
 void DebugProgram(void);
@@ -428,5 +371,5 @@
 ULONG_PTR Debugging_GetVarPtr(RELATIVE_VAR *pRelativeVar);
 ULONG_PTR Debugging_GetThisPtrOffset(LONG_PTR obp_Rip);
-int Debugging_GetVarOffset(char *variable,int *pType,RELATIVE_VAR *pRelativeVar,LONG_PTR *plpIndex,int *pss);
+int Debugging_GetVarOffset( char *variable,RELATIVE_VAR *pRelativeVar, Type &resultType, int *pss);
 
 //MakeExe.cpp
@@ -462,11 +405,11 @@
 
 //CommandFormat.cpp
-void ComOpen(char *Parameter,char *buffer,int NowLine);
+void ComOpen(char *Parameter,char *buffer,int nowLine);
 void ComClose(char *Parameter,char *buffer);
 void ComField(char *Parameter,char *buffer);
-void ComLine(char *Parameter,char *buffer,int NowLine);
-void ComCircle(char *Parameter,char *buffer,int NowLine);
-void ComPSet(char *Parameter,char *buffer,int NowLine);
-void ComPaint(char *Parameter,char *buffer,int NowLine);
+void ComLine(char *Parameter,char *buffer,int nowLine);
+void ComCircle(char *Parameter,char *buffer,int nowLine);
+void ComPSet(char *Parameter,char *buffer,int nowLine);
+void ComPaint(char *Parameter,char *buffer,int nowLine);
 
 // StrOperation.cpp
@@ -512,5 +455,5 @@
 BOOL GetConstCalcBuffer(char *name,char *Parameter,char *pCalcBuffer);
 DWORD GetConstValue(char *name,double *dbl,char *buffer,LONG_PTR *plpIndex);
-bool IsStringObjectType(const TYPEINFO &TypeInfo);
+bool IsStringObjectType(const Type &TypeInfo);
 int IsStrCalculation(char *Command);
 BYTE GetCalcId(const char *Command,int *pi);
@@ -518,8 +461,7 @@
 					   char *values[255],long calc[255],long stack[255]);
 
-//NumOpe_GetType_Old.cpp
+//NumOpe_GetType.cpp
 int AutoBigCast(int BaseType,int CalcType);
 BOOL CheckCalcType(int idCalc,int *type,int sp);
-int NumOpe_GetType_Old( const char *Command, TYPEINFO *pBaseTypeInfo, LONG_PTR *plpIndex );
 bool NumOpe_GetType( const char *expression, const Type &baseType, Type &resultType );
 
@@ -529,15 +471,13 @@
 void SplitObjectName(const char *name,char *ObjectName,int *pRefType);
 bool SplitMemberName( const char *desc, char *object, char *member );
-int CallProc(int idProc,void *pInfo,char *name,char *Parameter,LONG_PTR *plpRetIndex);
-BOOL CallPropertyMethod(char *variable,char *RightSide,TYPEINFO *pRetTypeInfo);
-int GetReturnTypeOfProc(int idProc,void *pInfo,char *name,char *Parameter,LONG_PTR *plpRetIndex);
-BOOL GetReturnTypeOfPropertyMethod(char *variable,char *RightSide,TYPEINFO *pRetTypeInfo);
-bool GetReturnTypeOfIndexerGetterProc(CClass *pobj_Class,TYPEINFO &RetTypeInfo);
-BOOL CompareParameter(PARAMETER_INFO *ppi1,int pi_num1,PARAMETER_INFO *ppi2,int pi_num2);
-SubInfo *AddSubData(char *buffer,int NowLine,BOOL bVirtual,CClass *pobj_c,BOOL bStatic=0);
+bool CallProc( int kind, const void *pProc, const char *fullCallName, const char *lpszParms, Type &resultType, bool isCallOn = true );
+bool CallPropertyMethod( const char *variable, const char *rightSide, Type &resultType);
+bool GetReturnTypeOfPropertyMethod( const char *variable, const char *rightSide, Type &resultType );
+bool GetReturnTypeOfIndexerGetterProc( const CClass &objClass, Type &resultType );
+UserProc *AddSubData(char *buffer,int nowLine,BOOL bVirtual,CClass *pobj_c, bool isStatic = false );
 void GetSubInfo(void);
-void DeleteSubInfo(SubInfo **ppSubHash,char **ppMacroNames,int MacroNum);
+void DeleteSubInfo(UserProc **ppSubHash,char **ppMacroNames,int MacroNum);
 void DeleteDeclareInfo(void);
-int AddProcPtrInfo(char *buffer,DWORD dwProcType);
+int AddProcPtrInfo( char *buffer, DWORD dwProcType, int nowLine );
 void DeleteProcPtrInfo(void);
 
@@ -581,7 +521,9 @@
 //error.cpp
 void SetError(int ErrorNum,const char *KeyWord,int pos);
+void SetError(int ErrorNum,const string &keyWord,int pos);
 void SetError();
 void CompileMessage(char *buffer);
 bool CheckDifferentType(const int VarType,const LONG_PTR lpVarIndex,const int CalcType,const LONG_PTR lpCalcIndex,const char *pszFuncName,const int ParmNum);
+bool CheckDifferentType( const Type &varType,const Type &calcType,const char *pszFuncName,const int ParmNum);
 
 //Compile.cpp
