Changeset 128 in dev for BasicCompiler64/NumOpe.cpp


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

Blittable型を導入した。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler64/NumOpe.cpp

    r122 r128  
    224224    return false;
    225225}
    226 bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool *pIsClassName, bool isProcedureCallOnly ){
     226bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool isWantObject, bool *pIsClassName, bool isProcedureCallOnly ){
    227227    char parameter[VN_SIZE];
    228228
     
    252252        bool isClassName = false;
    253253        Type leftType;
    254         if( !TermOpe( termLeft, baseType, leftType, isLiteral, pbUseHeap, &isClassName ) ){
     254        if( GetTermType( termLeft, leftType, isLiteral, &isClassName ) ){
     255            if( isClassName == false && Smoothie::Meta::blittableTypes.IsExist( leftType ) ){
     256                // 左側のオブジェクト部分がBlittable型のとき
     257
     258                char temporary[VN_SIZE];
     259                lstrcpy( temporary, termLeft );
     260                sprintf( termLeft, "%s(%s)",
     261                    Smoothie::Meta::blittableTypes.Find( leftType ).GetCreateStaticMethodFullName().c_str(),
     262                    temporary );
     263            }
     264        }
     265
     266        if( !TermOpe( termLeft, baseType, leftType, isLiteral, pbUseHeap, true, &isClassName ) ){
    255267            goto globalArea;
    256268        }
     
    705717                    //型名
    706718                    if( Type::StringToType( term, resultType ) ){
     719
     720                        if( resultType.IsObject() ){
     721                            if( resultType.GetClass().IsBlittableType() ){
     722                                // Blittable型のときは基本型として扱う
     723                                // ※ただし、コンパイル中のメソッドがBlittable型クラスに属していないこと
     724                                if( UserProc::IsLocalAreaCompiling()
     725                                    && UserProc::CompilingUserProc().HasParentClass()
     726                                    && UserProc::CompilingUserProc().GetParentClass().IsBlittableType() )
     727                                {
     728                                    // コンパイル中のメソッドがBlittable型クラスに属している
     729                                }
     730                                else{
     731                                    resultType = resultType.GetClass().GetBlittableType();
     732                                }
     733                            }
     734                        }
     735
    707736                        resultType.SetBasicType( resultType.GetBasicType() | FLAG_CAST );
    708737                    }
Note: See TracChangeset for help on using the changeset viewer.