Ignore:
Timestamp:
Mar 10, 2008, 5:39:36 PM (16 years ago)
Author:
dai_9181
Message:

・ジェネリックな型をパラメータに持つメソッドのオーバーロード解決に対応した。
・型パラメータの制約クラス指定に対応した。

File:
1 edited

Legend:

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

    r402 r424  
    8484// ジェネリクスのクラス型記述を分析
    8585///////////////////////////////////////////////////
    86 void SplitGenericClassInstance( const char *fullName, char *className, Jenga::Common::Strings &typeParameters )
     86void SplitGenericClassInstance( const char *fullName, char *className, Jenga::Common::Strings &typeParameters, bool isDefiningClass, Jenga::Common::Strings *pTypeParameterBaseClassNames )
    8787{
     88    if( isDefiningClass )
     89    {
     90        if( !pTypeParameterBaseClassNames )
     91        {
     92            SetError();
     93        }
     94        pTypeParameterBaseClassNames->clear();
     95    }
     96
    8897    int i = 0;
    8998    typeParameters.clear();
     
    109118                SetError(1,NULL,cp);
    110119            }
    111 
    112120            typeParameters.push_back( temporary );
     121
     122            if( isDefiningClass )
     123            {
     124                // クラス定義中にこの関数が呼び出されたとき
     125
     126                if( fullName[i] == 1 && fullName[i+1] == ESC_AS )
     127                {
     128                    // 型パラメータの制約クラスを取得
     129                    i += 2;
     130                    GetIdentifierToken( temporary, fullName, i );
     131                    if( temporary[0] == '\0' )
     132                    {
     133                        extern int cp;
     134                        SetError(1,NULL,cp);
     135                    }
     136                }
     137                else
     138                {
     139                    temporary[0] = 0;
     140                }
     141                pTypeParameterBaseClassNames->push_back( temporary );
     142            }
    113143
    114144            if( fullName[i] == ',' )
Note: See TracChangeset for help on using the changeset viewer.