Changeset 540 in dev


Ignore:
Timestamp:
May 4, 2008, 12:17:40 AM (16 years ago)
Author:
dai_9181
Message:

StartCompileメソッドを廃止し、Usingメソッドのオーバーロードに差し替えた。

Location:
trunk/ab5.0/abdev
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Class.h

    r539 r540  
    176176    }
    177177
     178    virtual void Using() const;
     179
    178180    void Readed(){
    179181        isReady = true;
     
    497499    const CClass *Find( const std::string &fullName ) const;
    498500
    499     void StartCompile( const UserProc *pUserProc );
    500 
    501501
    502502    /////////////////////////////
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp

    r538 r540  
    1414using namespace ActiveBasic::Compiler;
    1515
     16void CClass::Using() const
     17{
     18    if( this->IsUsing() )
     19    {
     20        // 既に使用することになっている
     21        return;
     22    }
     23
     24    Prototype::Using();
     25
     26    // 仮想関数になるメソッドに使用チェックをつける
     27    const CClass &objThis = *this;
     28    BOOST_FOREACH( const CMethod *pMethod, objThis.GetDynamicMethods() )
     29    {
     30        if( pMethod->IsVirtual() )
     31        {
     32            pMethod->GetUserProc().Using();
     33        }
     34    }
     35}
    1636
    1737bool CClass::IsClass() const
     
    11531173    return Find( NamespaceScopes( AreaName ), NestName );
    11541174}
    1155 void Classes::StartCompile( const UserProc *pUserProc ){
    1156     const CClass *pParentClass = pUserProc->GetParentClassPtr();
    1157     if( pParentClass ){
    1158         pParentClass->Using();
    1159 
    1160         // 仮想関数になるメソッドに使用チェックをつける
    1161         BOOST_FOREACH( const CMethod *pMethod, pParentClass->GetDynamicMethods() )
    1162         {
    1163             if( pMethod->IsVirtual() )
    1164             {
    1165                 pMethod->GetUserProc().Using();
    1166             }
    1167         }
    1168     }
    1169 }
    11701175
    11711176const CClass *Classes::GetStringClassPtr() const
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp

    r537 r540  
    239239    this->SetCompilingUserProc( pUserProc );
    240240
    241     //コンパイルスタートをクラス管理クラスに追加
    242     this->GetObjectModule().meta.GetClasses().StartCompile( pUserProc );
     241    if( pUserProc->HasParentClass() )
     242    {
     243        // クラスの使用チェック
     244        pUserProc->GetParentClass().Using();
     245    }
    243246
    244247    // コンパイル中の関数が属する名前空間
  • trunk/ab5.0/abdev/ab_common/include/Lexical/Prototype.h

    r516 r540  
    5757        return isUsing;
    5858    }
    59     void Using() const
     59    virtual void Using() const
    6060    {
    6161        isUsing = true;
Note: See TracChangeset for help on using the changeset viewer.