Changeset 426 in dev


Ignore:
Timestamp:
Mar 10, 2008, 7:04:08 PM (16 years ago)
Author:
dai_9181
Message:

組み込み関数_System_Newを実装。

Location:
trunk/abdev/BasicCompiler32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler32/Compile_Func.cpp

    r424 r426  
    2222    if( lstrcmpi( FuncName, "_System_GetBp" ) == 0 )    return FUNC_SYSTEM_GET_BP;
    2323    if( lstrcmpi( FuncName, "_System_GetSp" ) == 0 )    return FUNC_SYSTEM_GET_SP;
     24    if( lstrcmp( FuncName, "_System_New" ) == 0 )       return FUNC_SYSTEM_NEW;
    2425    if( lstrcmpi( FuncName, "GetDouble" ) == 0 )        return FUNC_GETDOUBLE;
    2526    if( lstrcmpi( FuncName, "GetSingle" ) == 0 )        return FUNC_GETSINGLE;
     
    606607}
    607608
     609void Opcode_Func_System_New( const char *parameter, Type &resultType, bool isCallOn )
     610{
     611    if( !compiler.StringToType( parameter, resultType ) )
     612    {
     613        SetError();
     614        return;
     615    }
     616    if( !resultType.IsObject() )
     617    {
     618        SetError();
     619        return;
     620    }
     621
     622    if( isCallOn )
     623    {
     624        Type tempResultType;
     625        if( !Operator_New( parameter, resultType, tempResultType ) )
     626        {
     627            return;
     628        }
     629
     630        if( !resultType.Equals( tempResultType ) )
     631        {
     632            SetError();
     633        }
     634
     635        //pop eax
     636        compiler.codeGenerator.op_pop( REG_EAX );
     637    }
     638}
     639
    608640void Opcode_Func_GetPtrData(const char *Parameter,const int type){
    609641    Type tempType;
     
    716748            resultType.SetBasicType( DEF_LONG );
    717749            break;
     750        case FUNC_SYSTEM_NEW:
     751            Opcode_Func_System_New( Parameter, resultType, isCallOn );
     752            break;
    718753
    719754        case FUNC_GETDOUBLE:
  • trunk/abdev/BasicCompiler32/FunctionValue.h

    r359 r426  
    2121#define FUNC_SYSTEM_GET_BP  0x0625
    2222#define FUNC_SYSTEM_GET_SP  0x0626
     23#define FUNC_SYSTEM_NEW     0x0627
    2324
    2425//ポインタ
Note: See TracChangeset for help on using the changeset viewer.