Ignore:
Timestamp:
Mar 6, 2008, 11:19:38 PM (16 years ago)
Author:
dai_9181
Message:

代入演算時の左辺に関数呼び出しの戻り値を評価してメンバを取得するようなコードが存在するとき、エラーになってしまっていたので改修した。(32bit版のみ対応)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler_Common/NumOpe_GetType.cpp

    r412 r415  
    298298}
    299299
    300 bool GetMemberTermType( const Type &leftType, const Type &baseType, Type &resultType, const char *termFull, const char *termLeft, const char *member )
     300bool GetMemberTermType( const Type &leftType, const Type &baseType, Type &resultType, const char *termFull, const char *termLeft, const char *member, bool *pIsVariable )
    301301{
    302302    ////////////////////////////////
     
    325325    if( GetMemberType( leftType, member, resultType, 0, false ) ){
    326326        // メンバが見つかったとき
     327
     328        if( pIsVariable )
     329        {
     330            *pIsVariable = true;
     331        }
     332
    327333        return true;
    328334    }
     
    357363}
    358364
    359 bool GetTermType( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, bool *pIsClassName )
     365bool GetTermType( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, bool *pIsClassName, bool *pIsVariable )
    360366{
    361367    char parameter[VN_SIZE];
     
    415421        }
    416422
    417         return GetMemberTermType( leftType, baseType, resultType, termFull, termLeft, member );
     423        return GetMemberTermType( leftType, baseType, resultType, termFull, termLeft, member, pIsVariable );
    418424    }
    419425
     
    551557        isLiteral = false;
    552558
     559        if( pIsVariable )
     560        {
     561            // 変数である
     562            *pIsVariable = true;
     563        }
     564
    553565        return true;
    554566    }
     
    572584
    573585    return false;
     586}
     587
     588bool GetTermType( const char *term, Type &resultType )
     589{
     590    bool isLiteral;
     591    return GetTermType( term, Type(), resultType, isLiteral );
     592}
     593
     594bool GetTermTypeOnlyVariable( const char *term, Type &resultType )
     595{
     596    bool isLiteral, isVariable = false;
     597    bool result = GetTermType( term, Type(), resultType, isLiteral, NULL, &isVariable );
     598    return ( result && isVariable );
    574599}
    575600
Note: See TracChangeset for help on using the changeset viewer.