Changeset 378 in dev


Ignore:
Timestamp:
Dec 16, 2007, 11:44:29 PM (16 years ago)
Author:
dai_9181
Message:
 
Location:
trunk/abdev/BasicCompiler_Common
Files:
6 edited

Legend:

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

    r322 r378  
    9191}
    9292void ts(const char *msg){
    93     MessageBox(0,msg,"TestMessage",0);
     93    MessageBox(0,FormatEscapeSequenceStringToDefaultString(msg).c_str(),"TestMessage",0);
    9494}
    9595void ts(const char *msg,const char *title){
    96     MessageBox(0,msg,title,0);
     96    MessageBox(0,FormatEscapeSequenceStringToDefaultString(msg).c_str(),title,0);
    9797}
    9898
  • trunk/abdev/BasicCompiler_Common/include/Class.h

    r376 r378  
    121121        return actualTypeParameters;
    122122    }
     123
     124    std::string GetFullNameWithActualGenericTypeParameters() const;
    123125};
    124126typedef std::vector<Interface *> Interfaces;
  • trunk/abdev/BasicCompiler_Common/include/Type.h

    r370 r378  
    233233    bool HasActualGenericType() const;
    234234
     235    //型名を取得
     236    std::string ToString() const;
     237
    235238
    236239private:
  • trunk/abdev/BasicCompiler_Common/src/Class.cpp

    r376 r378  
    5050}
    5151
     52std::string Interface::GetFullNameWithActualGenericTypeParameters() const
     53{
     54    std::string interfaceName = this->GetClass().GetFullName();
     55    if( actualTypeParameters.size() )
     56    {
     57        std::string actualGenericTypesName;
     58        BOOST_FOREACH( const Type &typeParameter, actualTypeParameters )
     59        {
     60            if( actualGenericTypesName.size() )
     61            {
     62                actualGenericTypesName += ",";
     63            }
     64            actualGenericTypesName += typeParameter.ToString();
     65        }
     66
     67        interfaceName += "<" + actualGenericTypesName + ">";
     68    }
     69    return interfaceName;
     70}
    5271
    5372bool CClass::IsClass() const
     
    344363            1, ESC_OPERATOR,
    345364            1, ESC_AS,
    346             interfaceClass.GetName().c_str()
     365            pDestInterface->GetFullNameWithActualGenericTypeParameters().c_str()
    347366        );
    348367
     
    539558            }
    540559
     560            if( !pInterface->GetClass().IsReady() ){
     561                // インターフェイスが未解析のとき
     562                compiler.GetObjectModule().meta.GetClasses().LookaheadClass( pInterface->GetClass().GetName().c_str() );
     563            }
     564
    541565            CMethod *pMethodForOverride = pInterface->GetDynamicMethods().FindForOverride( pUserProc );
    542566            if( pMethodForOverride )
  • trunk/abdev/BasicCompiler_Common/src/Class_Collect.cpp

    r376 r378  
    326326            SplitGenericClassInstance( temporary, className, typeParameters );
    327327
    328             CClass *pobj_c = const_cast<CClass *>( this->Find(namespaceScopes, temporary) );
     328            CClass *pobj_c = const_cast<CClass *>( this->Find(namespaceScopes, className) );
    329329            if(!pobj_c) continue;
    330330
  • trunk/abdev/BasicCompiler_Common/src/Type.cpp

    r370 r378  
    477477{
    478478    return ( actualGenericTypes.size() > 0 );
     479}
     480
     481std::string Type::ToString() const
     482{
     483    const char *basicTypeName = BasicTypeToCharPtr( *this );
     484    if( basicTypeName )
     485    {
     486        return basicTypeName;
     487    }
     488
     489    if( IsTypeParameter() )
     490    {
     491        return GetFormalTypeName();
     492    }
     493
     494    std::string typeName = GetClass().GetFullName();
     495    if( HasActualGenericType() )
     496    {
     497        std::string actualGenericTypesName;
     498        BOOST_FOREACH( const GenericType &actualGenericType, actualGenericTypes )
     499        {
     500            if( actualGenericTypesName.size() )
     501            {
     502                actualGenericTypesName += ",";
     503            }
     504            actualGenericTypesName += actualGenericType.GetName();
     505        }
     506
     507        typeName += "<" + actualGenericTypesName + ">";
     508    }
     509    return typeName;
    479510}
    480511
Note: See TracChangeset for help on using the changeset viewer.