Ignore:
Timestamp:
May 18, 2007, 4:42:36 AM (17 years ago)
Author:
dai_9181
Message:

Blittable型を導入した。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/NumOpe_GetType.cpp

    r117 r128  
    294294}
    295295
    296 bool GetTermType( const char *term, Type &resultType, bool &isLiteral, bool *pIsClassName = NULL ){
     296bool GetTermType( const char *term, Type &resultType, bool &isLiteral, bool *pIsClassName ){
    297297    char parameter[VN_SIZE];
    298298
     
    322322        bool isClassName = false;
    323323        Type leftType;
    324         if( !GetTermType( termLeft, leftType, isLiteral, &isClassName ) ){
     324        if( GetTermType( termLeft, leftType, isLiteral, &isClassName ) ){
     325            if( isClassName == false && Smoothie::Meta::blittableTypes.IsExist( leftType ) ){
     326                // 左側のオブジェクト部分がBlittable型のとき
     327
     328                char temporary[VN_SIZE];
     329                lstrcpy( temporary, termLeft );
     330                sprintf( termLeft, "%s(%s)",
     331                    Smoothie::Meta::blittableTypes.Find( leftType ).GetCreateStaticMethodFullName().c_str(),
     332                    temporary );
     333
     334                if( !GetTermType( termLeft, leftType, isLiteral, &isClassName ) ){
     335                    goto globalArea;
     336                }
     337            }
     338        }
     339        else{
    325340            goto globalArea;
    326341        }
     
    615630                    //型名
    616631                    if( Type::StringToType( term, resultType ) ){
     632
     633                        if( resultType.IsObject() ){
     634                            if( resultType.GetClass().IsBlittableType() ){
     635                                // Blittable型のときは基本型として扱う
     636                                // ※ただし、コンパイル中のメソッドがBlittable型クラスに属していないこと
     637                                if( UserProc::IsLocalAreaCompiling()
     638                                    && UserProc::CompilingUserProc().HasParentClass()
     639                                    && UserProc::CompilingUserProc().GetParentClass().IsBlittableType() )
     640                                {
     641                                    // コンパイル中のメソッドがBlittable型クラスに属している
     642                                }
     643                                else{
     644                                    resultType = resultType.GetClass().GetBlittableType();
     645                                }
     646                            }
     647                        }
     648
    617649                        resultType.SetBasicType( resultType.GetBasicType() | FLAG_CAST );
    618650                    }
     
    656688                    //////////////////
    657689                    // 何らかの識別子
    658 
    659                         if( strstr(term,"T.B")){
    660                             int test=0;
    661                         }
    662690
    663691                    bool isLiteral = true;
Note: See TracChangeset for help on using the changeset viewer.