Changeset 109 in dev for BasicCompiler32
- Timestamp:
- May 6, 2007, 7:09:04 PM (18 years ago)
- Location:
- BasicCompiler32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/Compile_Func.cpp
r97 r109 12 12 case FUNC_SIZEOF: 13 13 case FUNC_VARPTR: 14 case FUNC_OBJPTR: 14 15 return DEF_DWORD; 15 16 case FUNC_GETDOUBLE: … … 35 36 if(lstrcmpi(FuncName,"SizeOf")==0) return FUNC_SIZEOF; 36 37 if(lstrcmpi(FuncName,"VarPtr")==0) return FUNC_VARPTR; 38 if(lstrcmpi(FuncName,"ObjPtr")==0) return FUNC_OBJPTR; 37 39 if(lstrcmpi(FuncName,"GetDouble")==0) return FUNC_GETDOUBLE; 38 40 if(lstrcmpi(FuncName,"GetSingle")==0) return FUNC_GETSINGLE; … … 376 378 SetVarPtrToEax(&RelativeVar); 377 379 380 // TODO: 取り除く(この動きはObjPtrに託す) 378 381 if( beforeType == DEF_OBJECT && lstrcmpi( Parameter, "This" ) != 0 ){ 379 382 //参照をオブジェクトポインタに変更 … … 381 384 //mov eax,dword ptr[eax] 382 385 op_mov_RM( sizeof(long), REG_EAX, REG_EAX, 0, MOD_BASE ); 386 } 387 } 388 void Opcode_Func_ObjPtr( const char *Parameter, Type &resultType, bool isCallOn ){ 389 if( isCallOn == false ){ 390 // 戻り値の型を取得するだけ 391 392 //変数のアドレスを取得 393 if(!GetVarType( Parameter, resultType, true )) return; 394 395 resultType.PtrLevelUp(); 396 397 return; 398 } 399 400 RELATIVE_VAR RelativeVar; 401 402 //変数のアドレスを取得 403 if(!GetVarOffsetReadOnly( Parameter, &RelativeVar, resultType )) return; 404 405 int beforeType = resultType.GetBasicType(); 406 407 resultType.PtrLevelUp(); 408 409 SetVarPtrToEax(&RelativeVar); 410 411 if( beforeType == DEF_OBJECT && lstrcmpi( Parameter, "This" ) != 0 ){ 412 //参照をオブジェクトポインタに変更 413 414 //mov eax,dword ptr[eax] 415 op_mov_RM( sizeof(long), REG_EAX, REG_EAX, 0, MOD_BASE ); 416 } 417 else{ 418 SetError(134,NULL,cp ); 383 419 } 384 420 } … … 472 508 Opcode_Func_VarPtr( Parameter, resultType, isCallOn ); 473 509 break; 510 case FUNC_OBJPTR: 511 Opcode_Func_ObjPtr( Parameter, resultType, isCallOn ); 512 break; 474 513 475 514 case FUNC_GETDOUBLE: -
BasicCompiler32/FunctionValue.h
r3 r109 10 10 //メモリ操作 11 11 #define FUNC_VARPTR 0x0591 12 #define FUNC_OBJPTR 0x0592 12 13 13 14 //その他
Note:
See TracChangeset
for help on using the changeset viewer.