Index: trunk/abdev/BasicCompiler32/NumOpe.cpp
===================================================================
--- trunk/abdev/BasicCompiler32/NumOpe.cpp	(revision 412)
+++ trunk/abdev/BasicCompiler32/NumOpe.cpp	(revision 415)
@@ -140,5 +140,5 @@
 	return true;
 }
-bool TermMemberOpe( const Type &leftType, const Type &baseType, Type &resultType, const char *termFull, const char *termLeft, const char *member )
+bool TermMemberOpe( const Type &leftType, const Type &baseType, Type &resultType, const char *termFull, const char *termLeft, const char *member, bool &isVariable, RELATIVE_VAR &relativeVar )
 {
 	const CClass &objClass = leftType.GetClass();
@@ -179,6 +179,6 @@
 				compiler.codeGenerator.op_mov_RR( REG_ECX, useReg );
 
-				RELATIVE_VAR relativeVar;
-				relativeVar.dwKind=VAR_DIRECTMEM;
+				RELATIVE_VAR tempRelativeVar;
+				tempRelativeVar.dwKind=VAR_DIRECTMEM;
 
 				if( !_member_offset(
@@ -186,10 +186,10 @@
 					false,	//読み込み専用
 					leftType,
-					VarName,&relativeVar,classType,0)){
+					VarName,&tempRelativeVar,classType,0)){
 						return false;
 				}
 
 				// オブジェクトメンバのポインタをeaxにコピー
-				if( !VarToReg( relativeVar, baseType, resultType ) ){
+				if( !VarToReg( tempRelativeVar, baseType, resultType ) ){
 					SetError(11,termFull,cp);
 				}
@@ -225,5 +225,4 @@
 		compiler.codeGenerator.op_mov_RR( REG_ECX, useReg );
 
-		RELATIVE_VAR relativeVar;
 		relativeVar.dwKind=VAR_DIRECTMEM;
 
@@ -236,7 +235,6 @@
 		}
 
-		if( !VarToReg( relativeVar, baseType, resultType ) ){
-			SetError(11,termFull,cp);
-		}
+		// 変数として扱う
+		isVariable = true;
 
 		return true;
@@ -271,5 +269,7 @@
 
 				// まずはプロパティ値を取得
-				TermMemberOpe( leftType, baseType, resultType, termFull, termLeft, methodName );
+				bool dummyIsVariable;
+				RELATIVE_VAR dummyRelativeVar;
+				TermMemberOpe( leftType, baseType, resultType, termFull, termLeft, methodName, dummyIsVariable, dummyRelativeVar );
 
 				// 戻り値のオブジェクトインスタンスのインデクサを呼び出す
@@ -278,5 +278,5 @@
 				sprintf( temp2, "%s.%s", termLeft, methodName );
 				Type classType = resultType;
-				return TermMemberOpe( classType, baseType, resultType, termFull, temp2, temporary );
+				return TermMemberOpe( classType, baseType, resultType, termFull, temp2, temporary, isVariable, relativeVar );
 			}
 
@@ -324,5 +324,6 @@
 	return false;
 }
-bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool isWantObject, bool *pIsClassName, bool isProcedureCallOnly ){
+bool _TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool *pIsClassName, bool isProcedureCallOnly, bool &isVariable, RELATIVE_VAR &relativeVar, bool isWriteAccess )
+{
 	char parameter[VN_SIZE];
 
@@ -364,5 +365,5 @@
 		}
 
-		if( !TermOpe( termLeft, baseType, leftType, isLiteral, pbUseHeap, true, &isClassName ) ){
+		if( !TermOpe( termLeft, baseType, leftType, isLiteral, pbUseHeap, &isClassName ) ){
 			goto globalArea;
 		}
@@ -382,5 +383,5 @@
 		}
 
-		return TermMemberOpe( leftType, baseType, resultType, termFull, termLeft, member );
+		return TermMemberOpe( leftType, baseType, resultType, termFull, termLeft, member, isVariable, relativeVar );
 	}
 globalArea:
@@ -545,8 +546,7 @@
 	////////////////////////////////
 
-	RELATIVE_VAR relativeVar;
 	if(GetVarOffset(
 		false,	//エラー表示なし
-		false,	//読み込み専用
+		isWriteAccess,
 		termFull,
 		&relativeVar,resultType)){
@@ -555,7 +555,6 @@
 		//////////
 
-		if( !VarToReg( relativeVar, baseType, resultType ) ){
-			SetError(11,termFull,cp);
-		}
+		// 変数として扱う
+		isVariable = true;
 
 		isLiteral = false;
@@ -610,4 +609,33 @@
 
 	return false;
+}
+
+bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool *pIsClassName, bool isProcedureCallOnly, bool isWriteAccess )
+{
+	RELATIVE_VAR relativeVar;
+	bool isVariable = false;
+	bool result = _TermOpe( term, baseType, resultType, isLiteral, pbUseHeap, pIsClassName, isProcedureCallOnly, isVariable, relativeVar, isWriteAccess );
+
+	if( isVariable )
+	{
+		// 変数の場合はeaxに変数ポインタを格納する
+		if( !VarToReg( relativeVar, baseType, resultType ) ){
+			SetError(11,term,cp);
+		}
+	}
+
+	return result;
+}
+bool TermOpeOnlyVariable( const char *term, Type &resultType, RELATIVE_VAR &relativeVar, bool isWriteAccess )
+{
+	bool isLiteral, isVariable = false;
+	bool result = _TermOpe( term, Type(), resultType, isLiteral, NULL, NULL, false, isVariable, relativeVar, isWriteAccess );
+
+	if( !isVariable )
+	{
+		SetError();
+	}
+
+	return result;
 }
 
