Ignore:
Timestamp:
Jun 10, 2008, 11:40:17 PM (16 years ago)
Author:
dai_9181
Message:

libファイルを跨ったテンプレート展開に対応。

File:
1 edited

Legend:

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

    r632 r636  
    2525    const CClass *pCompilingClass;
    2626
    27     // オブジェクトモジュール
    28     ObjectModule *pObjectModule;
    29     ObjectModule *pNowObjectModule;
     27    // 現在参照したいソースコードのオブジェクト モジュール インデックス
     28    int currentRelationalObjectModuleIndexForSource;
     29
     30
    3031
    3132public:
    3233
    33     Compiler()
    34         : isBuildSuccessful( false )
    35         , pObjectModule( new ObjectModule )
    36         , targetModuleType( ActiveBasic::Common::TargetModuleType::Exe )
    37         , isDebug( false )
    38         , isUnicode( false )
    39         , isCore( false )
    40     {
    41         SelectObjectModule( *pObjectModule );
    42         Symbol::RegistNamespaceSupporter( &namespaceSupporter );
    43     }
    44     ~Compiler()
    45     {
    46         delete pObjectModule;
    47         Clear();
    48     }
    49     void Clear()
    50     {
    51         BOOST_FOREACH( ObjectModule *pStaticLibrary, staticLibraries )
    52         {
    53             delete pStaticLibrary;
    54         }
    55         staticLibraries.clear();
    56     }
    57 
     34    Compiler();
     35    ~Compiler();
     36
     37    // 静的リンクの準備を行う(オブジェクトモジュール同士の名前リストの結合など、前処理を行う)
     38    void PreStaticLink( const ObjectModules &staticLibraries );
     39
     40    // 静的リンクを行う
    5841    void StaticLink( ObjectModules &staticLibraries );
    5942
     
    10386    ObjectModules staticLibraries;
    10487
     88    ObjectModule *pSelectedObjectModule;
     89
    10590    // オブジェクトモジュール
    10691    ObjectModule &GetObjectModule()
    10792    {
    108         return *pNowObjectModule;
    109     }
    110     void SelectObjectModule( ObjectModule &objectModule )
    111     {
    112         pNowObjectModule = &objectModule;
    113 
    114         namespaceSupporter.RegistAllNamespaceScopesCollection( &GetObjectModule().meta.GetNamespaces() );
     93        return *pSelectedObjectModule;
     94    }
     95
     96    void SelectObjectModule( ObjectModule *pObjectModule )
     97    {
     98        this->pSelectedObjectModule = pObjectModule;
     99    }
     100
     101    // 現在参照すべきソースコード
     102    const BasicSource &GetCurrentSource()
     103    {
     104        return staticLibraries[currentRelationalObjectModuleIndexForSource]->GetSource();
     105    }
     106
     107    // 現在参照すべきソースコードを格納するオブジェクトモジュールのインデックス
     108    int GetCurrentRelationalObjectModuleIndexForSource() const
     109    {
     110        return currentRelationalObjectModuleIndexForSource;
     111    }
     112    void SetCurrentRelationalObjectModuleIndexForSource( int currentRelationalObjectModuleIndexForSource )
     113    {
     114        this->currentRelationalObjectModuleIndexForSource = currentRelationalObjectModuleIndexForSource;
    115115    }
    116116
Note: See TracChangeset for help on using the changeset viewer.