Index: /BasicCompiler32/Compile_Statement.cpp
===================================================================
--- /BasicCompiler32/Compile_Statement.cpp	(revision 121)
+++ /BasicCompiler32/Compile_Statement.cpp	(revision 122)
@@ -4,30 +4,43 @@
 void OpcodeOthers(char *Command){
 	int i,i2;
-	char buffer[8192];
 	UserProc *pUserProc;
 
+	char leftTerm[8192];
+	int lastParePos = 0;
 	for(i=0;;i++){
-		if(Command[i]=='['){
-			i2=GetStringInBracket(buffer+i,Command+i);
+		if(Command[i]=='\"'){
+			//ダブルクォートは不正なのでエラー扱い
+			leftTerm[i]=0;
+			SetError(3,leftTerm,cp);
+			return;
+		}
+
+		if(Command[i]=='('){
+			lastParePos = i;
+			i2=GetStringInPare(leftTerm+i,Command+i);
 			i+=i2-1;
 			continue;
 		}
-		if(Command[i]==1&&Command[i+1]==ESC_PSMEM){
-			buffer[i]=Command[i];
-			i++;
-			buffer[i]=Command[i];
+		if(Command[i]=='['){
+			i2=GetStringInBracket(leftTerm+i,Command+i);
+			i+=i2-1;
 			continue;
 		}
-		if(!IsVariableChar(Command[i])){
-			buffer[i]=0;
+		if(Command[i]=='\0'){
+			leftTerm[i] = 0;
 			break;
 		}
-		buffer[i]=Command[i];
-	}
-
+
+		if( IsNumCalcMark( Command, i ) ){
+			leftTerm[i] = 0;
+			break;
+		}
+
+		leftTerm[i]=Command[i];
+	}
 	if(!(
-		IsVariableTopChar(buffer[0])||
-		buffer[0]=='.'||
-		(buffer[0]==1&&buffer[1]==ESC_PSMEM)
+		IsVariableTopChar(leftTerm[0])||
+		leftTerm[0]=='.'||
+		(leftTerm[0]==1&&leftTerm[1]==ESC_PSMEM)
 		)){
 		SetError(1,NULL,cp);
@@ -36,5 +49,5 @@
 
 
-	if(Command[i]=='\0'){
+	if(Command[i]=='\0' && lastParePos == 0){
 		//////////////////////////////
 		// パラメータ無しのマクロ検索
@@ -58,5 +71,7 @@
 
 		if(pUserProc){
-			if( !pUserProc->IsMacro() ) SetError(10,Command,cp);
+			if( !pUserProc->IsMacro() ){
+				SetError(10,Command,cp);
+			}
 
 			Opcode_CallProc("",pUserProc,0,"",0);
@@ -71,27 +86,11 @@
 	}
 
-	int idProc;
-	void *pProc;
-	idProc=GetProc(buffer,(void **)&pProc);
-
-	int i4;
-	char temp2[VN_SIZE];
-	if(idProc){
-		if(Command[i]!='('){
-			SetError(10,buffer,cp);
-			return;
-		}
-		i4=GetStringInPare_RemovePare(temp2,Command+i+1);
-
-		//閉じカッコ")"に続く文字がNULLでないときはエラーにする
-		if(Command[i+1+i4+1]!='\0') SetError(42,NULL,cp);
-
-		////////////////
-		// 呼び出し
-		////////////////
-
-		Type resultType;
-		CallProc(idProc,pProc,buffer,temp2,resultType);
-
+
+	Type resultType;
+	bool isLiteral;
+	BOOL bUseHeap;
+	bool result = TermOpe( leftTerm, Type(), resultType, isLiteral, &bUseHeap, NULL, true );
+
+	if( result ){
 
 		/////////////////////
@@ -110,12 +109,11 @@
 			FreeTempObject(REG_EBX,&resultType.GetClass());
 		}
+
+		//成功
 		return;
 	}
 
-
-	//////////////////////////
-	// その他は代入演算を行う
-	//////////////////////////
-	OpcodeCalc(Command);
+	// 失敗
+	SetError(1, NULL,cp);
 }
 
Index: /BasicCompiler32/NumOpe.cpp
===================================================================
--- /BasicCompiler32/NumOpe.cpp	(revision 121)
+++ /BasicCompiler32/NumOpe.cpp	(revision 122)
@@ -227,5 +227,5 @@
 	return false;
 }
-bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool *pIsClassName = NULL ){
+bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool *pIsClassName, bool isProcedureCallOnly ){
 	char parameter[VN_SIZE];
 
@@ -293,5 +293,5 @@
 
 
-	if(lstrcmpi(termFull,"This")==0){
+	if(lstrcmpi(termFull,"This")==0 && isProcedureCallOnly == false ){
 		//Thisオブジェクト
 		resultType.SetType( DEF_OBJECT, pobj_CompilingClass );
@@ -387,4 +387,8 @@
 			return true;
 		}
+	}
+	else if( isProcedureCallOnly ){
+		// 関数呼び出し以外は受け付けない
+		return false;
 	}
 
Index: /BasicCompiler32/Opcode.h
===================================================================
--- /BasicCompiler32/Opcode.h	(revision 121)
+++ /BasicCompiler32/Opcode.h	(revision 122)
@@ -102,4 +102,5 @@
 //NumOpe.cpp
 void PushReturnValue(int type);
+bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool *pIsClassName = NULL, bool isProcedureCallOnly = false );
 bool NumOpe( int reg,
 			const char *expression,
Index: /BasicCompiler64/Compile_Statement.cpp
===================================================================
--- /BasicCompiler64/Compile_Statement.cpp	(revision 121)
+++ /BasicCompiler64/Compile_Statement.cpp	(revision 122)
@@ -4,30 +4,43 @@
 void OpcodeOthers(char *Command){
 	int i,i2;
-	char buffer[8192];
 	UserProc *pUserProc;
 
+	char leftTerm[8192];
+	int lastParePos = 0;
 	for(i=0;;i++){
-		if(Command[i]=='['){
-			i2=GetStringInBracket(buffer+i,Command+i);
+		if(Command[i]=='\"'){
+			//ダブルクォートは不正なのでエラー扱い
+			leftTerm[i]=0;
+			SetError(3,leftTerm,cp);
+			return;
+		}
+
+		if(Command[i]=='('){
+			lastParePos = i;
+			i2=GetStringInPare(leftTerm+i,Command+i);
 			i+=i2-1;
 			continue;
 		}
-		if(Command[i]==1&&Command[i+1]==ESC_PSMEM){
-			buffer[i]=Command[i];
-			i++;
-			buffer[i]=Command[i];
+		if(Command[i]=='['){
+			i2=GetStringInBracket(leftTerm+i,Command+i);
+			i+=i2-1;
 			continue;
 		}
-		if(!IsVariableChar(Command[i])){
-			buffer[i]=0;
+		if(Command[i]=='\0'){
+			leftTerm[i] = 0;
 			break;
 		}
-		buffer[i]=Command[i];
-	}
-
+
+		if( IsNumCalcMark( Command, i ) ){
+			leftTerm[i] = 0;
+			break;
+		}
+
+		leftTerm[i]=Command[i];
+	}
 	if(!(
-		IsVariableTopChar(buffer[0])||
-		buffer[0]=='.'||
-		(buffer[0]==1&&buffer[1]==ESC_PSMEM)
+		IsVariableTopChar(leftTerm[0])||
+		leftTerm[0]=='.'||
+		(leftTerm[0]==1&&leftTerm[1]==ESC_PSMEM)
 		)){
 		SetError(1,NULL,cp);
@@ -36,5 +49,5 @@
 
 
-	if(Command[i]=='\0'){
+	if(Command[i]=='\0' && lastParePos == 0){
 		//////////////////////////////
 		// パラメータ無しのマクロ検索
@@ -73,27 +86,18 @@
 	}
 
-	int idProc;
-	void *pProc;
-	idProc=GetProc(buffer,(void **)&pProc);
-
-	int i4;
-	char temp2[VN_SIZE];
-	if(idProc){
-		if(Command[i]!='('){
-			SetError(10,buffer,cp);
-			return;
-		}
-		i4=GetStringInPare_RemovePare(temp2,Command+i+1);
-
-		//閉じカッコ")"に続く文字がNULLでないときはエラーにする
-		if(Command[i+1+i4+1]!='\0') SetError(42,NULL,cp);
-
-		////////////////
-		// 呼び出し
-		////////////////
-
-		Type resultType;
-		CallProc(idProc,pProc,buffer,temp2,resultType);
-
+	if( pobj_reg ){
+		SetError();
+	}
+	pobj_reg=new CRegister(REG_RAX);
+
+	Type resultType;
+	bool isLiteral;
+	BOOL bUseHeap;
+	bool result = TermOpe( leftTerm, Type(), resultType, isLiteral, &bUseHeap, NULL, true );
+
+	delete pobj_reg;
+	pobj_reg = NULL;
+
+	if( result ){
 
 		/////////////////////
@@ -107,12 +111,11 @@
 			FreeTempObject(REG_R14,&resultType.GetClass());
 		}
-		return;
-	}
-
-
-	//////////////////////////
-	// その他は代入演算を行う
-	//////////////////////////
-	OpcodeCalc(Command);
+
+		//成功
+		return;
+	}
+
+	// 失敗
+	SetError(1, NULL,cp);
 }
 
Index: /BasicCompiler64/NumOpe.cpp
===================================================================
--- /BasicCompiler64/NumOpe.cpp	(revision 121)
+++ /BasicCompiler64/NumOpe.cpp	(revision 122)
@@ -224,5 +224,5 @@
 	return false;
 }
-bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool *pIsClassName = NULL ){
+bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool *pIsClassName, bool isProcedureCallOnly ){
 	char parameter[VN_SIZE];
 
@@ -290,5 +290,5 @@
 
 
-	if(lstrcmpi(termFull,"This")==0){
+	if(lstrcmpi(termFull,"This")==0 && isProcedureCallOnly == false ){
 		//Thisオブジェクト
 		resultType.SetType( DEF_OBJECT, pobj_CompilingClass );
@@ -386,4 +386,8 @@
 			return true;
 		}
+	}
+	else if( isProcedureCallOnly ){
+		// 関数呼び出し以外は受け付けない
+		return false;
 	}
 
@@ -775,8 +779,4 @@
 					//////////////////
 					// 何らかの識別子
-
-	if( (string)term=="ParentArea.NamespaceEnumTest.x"){
-		int test=0;
-	}
 
 					bool isLiteral;
Index: /BasicCompiler64/Opcode.h
===================================================================
--- /BasicCompiler64/Opcode.h	(revision 121)
+++ /BasicCompiler64/Opcode.h	(revision 122)
@@ -251,4 +251,5 @@
 
 //NumOpe.cpp
+bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool *pIsClassName = NULL, bool isProcedureCallOnly = false );
 bool NumOpe( int *pReg,
 		   const char *Command,
@@ -297,11 +298,4 @@
 //increment.cpp
 void IncDec(int idCalc, char *lpszLeft, char *lpszRight);
-
-//calc2.cpp
-#define EXP_TYPE_NUMBER	1
-#define EXP_TYPE_EAX	2
-#define EXP_TYPE_FPU	3
-#define EXP_TYPE_VAR	4
-int NumOpEx(char *Command,double *pDbl,DWORD *pdwType,RELATIVE_VAR *pRelativeVar);
 
 //Compile_Calc_PushVar.cpp
