Ignore:
Timestamp:
May 3, 2008, 6:58:38 PM (16 years ago)
Author:
dai_9181
Message:

UserProcクラスによるコンパイル中関数管理用メソッドを除去(すべてCompilerクラス内で処理するようにした)。

Location:
trunk/ab5.0/abdev/BasicCompiler_Common
Files:
12 edited

Legend:

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

    r524 r537  
    242242
    243243            case ESC_TYPEDEF:
    244                 if( UserProc::IsLocalAreaCompiling() ){
     244                if( compiler.IsLocalAreaCompiling() ){
    245245                    // ローカル領域をコンパイルしているとき
    246246                    compiler.errorMessenger.Output(65,"TypeDef",cp );
     
    251251
    252252            case ESC_DELEGATE:
    253                 if( UserProc::IsLocalAreaCompiling() ){
     253                if( compiler.IsLocalAreaCompiling() ){
    254254                    // ローカル領域をコンパイルしているとき
    255255                    compiler.errorMessenger.Output(65,"Delegate",cp );
     
    335335                break;
    336336            case ESC_DECLARE:
    337                 if( UserProc::IsLocalAreaCompiling() ){
     337                if( compiler.IsLocalAreaCompiling() ){
    338338                    // ローカル領域をコンパイルしているとき
    339339                    compiler.errorMessenger.Output(65,"Declare",cp );
  • trunk/ab5.0/abdev/BasicCompiler_Common/NumOpe_GetType.cpp

    r536 r537  
    751751                                // Blittable型のときは基本型として扱う
    752752                                // ※ただし、コンパイル中のメソッドがBlittable型クラスに属していないこと
    753                                 if( UserProc::IsLocalAreaCompiling()
    754                                     && UserProc::CompilingUserProc().HasParentClass()
    755                                     && UserProc::CompilingUserProc().GetParentClass().IsBlittableType() )
     753                                if( compiler.IsLocalAreaCompiling()
     754                                    && compiler.GetCompilingUserProc().HasParentClass()
     755                                    && compiler.GetCompilingUserProc().GetParentClass().IsBlittableType() )
    756756                                {
    757757                                    // コンパイル中のメソッドがBlittable型クラスに属している
  • trunk/ab5.0/abdev/BasicCompiler_Common/VarList.cpp

    r536 r537  
    779779        if(pUserProc){
    780780            compiler.StartProcedureCompile( pUserProc );
    781             UserProc::CompileStartForUserProc( pUserProc );
    782781        }
    783782    }
  • trunk/ab5.0/abdev/BasicCompiler_Common/VariableOpe.cpp

    r536 r537  
    560560    const Variable *pVar = NULL;
    561561
    562     if( UserProc::IsLocalAreaCompiling() ){
     562    if( compiler.IsLocalAreaCompiling() ){
    563563        /////////////////
    564564        // ローカル変数
    565565        /////////////////
    566566
    567         pVar = UserProc::CompilingUserProc().GetLocalVars().BackSearch( LexicalAnalyzer::FullNameToSymbol( VarName ) );
     567        pVar = compiler.GetCompilingUserProc().GetLocalVars().BackSearch( LexicalAnalyzer::FullNameToSymbol( VarName ) );
    568568        if( pVar ){
    569569            goto ok;
     
    613613
    614614    char temporary[VN_SIZE];
    615     if( UserProc::IsLocalAreaCompiling() ){
     615    if( compiler.IsLocalAreaCompiling() ){
    616616        GetNowStaticVarFullName(VarName,temporary);
    617617
     
    905905
    906906BOOL GetNowStaticVarFullName(char *VarName,char *FullName){
    907     if( UserProc::IsGlobalAreaCompiling() ){
     907    if( compiler.IsGlobalAreaCompiling() ){
    908908        // グローバル領域をコンパイル中のとき
    909909        return 0;
    910910    }
    911911
    912     const UserProc &proc = UserProc::CompilingUserProc();
     912    const UserProc &proc = compiler.GetCompilingUserProc();
    913913
    914914    //Static識別
     
    10821082            // Blittable型のときは基本型として扱う
    10831083            // ※ただし、コンパイル中のメソッドがBlittable型クラスに属していないこと
    1084             if( UserProc::IsLocalAreaCompiling()
    1085                 && UserProc::CompilingUserProc().HasParentClass()
    1086                 && UserProc::CompilingUserProc().GetParentClass().IsBlittableType() )
     1084            if( compiler.IsLocalAreaCompiling()
     1085                && compiler.GetCompilingUserProc().HasParentClass()
     1086                && compiler.GetCompilingUserProc().GetParentClass().IsBlittableType() )
    10871087            {
    10881088                // コンパイル中のメソッドがBlittable型クラスに属している
     
    10941094    }
    10951095
    1096     if(dwFlags&DIMFLAG_STATIC){
    1097         if( UserProc::IsGlobalAreaCompiling() ){
     1096    if(dwFlags&DIMFLAG_STATIC)
     1097    {
     1098        if( compiler.IsGlobalAreaCompiling() )
     1099        {
    10981100            compiler.errorMessenger.Output(60,NULL,cp);
    10991101            return;
  • trunk/ab5.0/abdev/BasicCompiler_Common/WatchList.cpp

    r536 r537  
    351351    // ローカル変数
    352352    /////////////////
    353     if( UserProc::IsLocalAreaCompiling() ){
    354         const Variable *pVar = UserProc::CompilingUserProc().GetLocalVars().Find( LexicalAnalyzer::FullNameToSymbol( VarName ) );
     353    if( compiler.IsLocalAreaCompiling() ){
     354        const Variable *pVar = compiler.GetCompilingUserProc().GetLocalVars().Find( LexicalAnalyzer::FullNameToSymbol( VarName ) );
    355355
    356356        if( pVar ){
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h

    r536 r537  
    192192
    193193    void ClearCompilingUserProcAndClass();
     194    void StartGlobalAreaCompile();
     195    void FinishGlobalAreaCompile();
    194196    void SetCompilingClass( const CClass *pClass );
     197    void SetCompilingUserProc( const UserProc *pUserProc );
    195198    void StartProcedureCompile( const UserProc *pUserProc );
    196199    void FinishProcedureCompile();
    197200
    198201    bool IsGlobalAreaCompiling();
     202    bool IsLocalAreaCompiling();
    199203    const UserProc &GetCompilingUserProc();
    200204    bool IsCompilingClass();
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Procedure.h

    r524 r537  
    371371
    372372
    373 
    374     /////////////////////////////////////////////////////////////////
    375     // コンパイル中の関数を管理
    376     /////////////////////////////////////////////////////////////////
    377 private:
    378     static const UserProc *pCompilingUserProc;
    379 public:
    380373    static const UserProc *pGlobalProc;
    381     static void CompileStartForGlobalArea(){
    382         pCompilingUserProc = NULL;
    383     }
    384     static void CompileStartForUserProc( const UserProc *pUserProc ){
    385         pCompilingUserProc = pUserProc;
    386     }
    387     static bool IsGlobalAreaCompiling(){
    388         return ( pCompilingUserProc == NULL );
    389     }
    390     static bool IsLocalAreaCompiling(){
    391         return ( pCompilingUserProc != NULL );
    392     }
    393     static const UserProc &CompilingUserProc(){
    394         return *pCompilingUserProc;
    395     }
    396374};
    397375
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp

    r536 r537  
    222222}
    223223
     224void Compiler::SetCompilingUserProc( const UserProc *pUserProc )
     225{
     226    this->pCompilingUserProc = pUserProc;
     227
     228    this->SetCompilingClass( pUserProc->GetParentClassPtr() );
     229}
     230
     231void Compiler::StartGlobalAreaCompile()
     232{
     233    ClearCompilingUserProcAndClass();
     234}
     235
    224236void Compiler::StartProcedureCompile( const UserProc *pUserProc )
    225237{
    226238    //コンパイル中の関数
    227     this->pCompilingUserProc = pUserProc;
    228 
    229     //コンパイル中の関数が属するクラス
    230     this->SetCompilingClass( pUserProc->GetParentClassPtr() );
     239    this->SetCompilingUserProc( pUserProc );
    231240
    232241    //コンパイルスタートをクラス管理クラスに追加
    233242    this->GetObjectModule().meta.GetClasses().StartCompile( pUserProc );
    234243
    235     //コンパイル中の関数
    236     UserProc::CompileStartForUserProc( pUserProc );
    237 
    238244    // コンパイル中の関数が属する名前空間
    239245    this->GetNamespaceSupporter().SetLivingNamespaceScopes( pUserProc->GetNamespaceScopes() );
     
    255261    return ( pCompilingUserProc == NULL );
    256262}
     263bool Compiler::IsLocalAreaCompiling()
     264{
     265    return ( pCompilingUserProc != NULL );
     266}
    257267const UserProc &Compiler::GetCompilingUserProc()
    258268{
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Exception.cpp

    r524 r537  
    222222
    223223            // Catchアドレス
    224             const UserProc *pUserProc = &UserProc::CompilingUserProc();
    225             if( UserProc::IsGlobalAreaCompiling() )
     224            const UserProc *pUserProc = &compiler.GetCompilingUserProc();
     225            if( compiler.IsGlobalAreaCompiling() )
    226226            {
    227227                pUserProc = UserProc::pGlobalProc;
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalScope.cpp

    r485 r537  
    7171    CallDestructorsOfScopeEnd();
    7272
    73     Variables *pVars = UserProc::IsGlobalAreaCompiling() ?
     73    Variables *pVars = compiler.IsGlobalAreaCompiling() ?
    7474        &compiler.GetObjectModule().meta.GetGlobalVars() :
    75         &UserProc::CompilingUserProc().GetLocalVars();
     75        &compiler.GetCompilingUserProc().GetLocalVars();
    7676
    7777    //使用済みローカル変数の生存チェックを外す
     
    9898void LexicalScopes::CallDestructorsOfScopeEnd(){
    9999
    100     Variables *pVariabls = UserProc::IsGlobalAreaCompiling() ?
     100    Variables *pVariabls = compiler.IsGlobalAreaCompiling() ?
    101101        &compiler.GetObjectModule().meta.GetGlobalVars() :
    102         &UserProc::CompilingUserProc().GetLocalVars();
     102        &compiler.GetCompilingUserProc().GetLocalVars();
    103103
    104104
     
    109109        Variable *pVar = (*pVariabls)[i3];
    110110
    111         if( UserProc::IsGlobalAreaCompiling() && GetNowLevel() == 0 ){
     111        if( compiler.IsGlobalAreaCompiling() && GetNowLevel() == 0 ){
    112112            if( pVar->GetName() == "_System_GC" ){
    113113                indexSystemGC=i3;
     
    152152
    153153
    154             if( UserProc::IsGlobalAreaCompiling() ){
     154            if( compiler.IsGlobalAreaCompiling() ){
    155155                //ここには来ないハズ
    156156                compiler.errorMessenger.Output(300,NULL,cp);
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/NativeCode.cpp

    r465 r537  
    8585    if( scheduleType == Schedule::CatchAddress )
    8686    {
    87         const UserProc *pUserProc = &UserProc::CompilingUserProc();
    88         if( UserProc::IsGlobalAreaCompiling() )
     87        const UserProc *pUserProc = &compiler.GetCompilingUserProc();
     88        if( compiler.IsGlobalAreaCompiling() )
    8989        {
    9090            pUserProc = UserProc::pGlobalProc;
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Procedure.cpp

    r523 r537  
    483483}
    484484
    485 const UserProc *UserProc::pCompilingUserProc = NULL;
    486485const UserProc *UserProc::pGlobalProc = NULL;
    487486
Note: See TracChangeset for help on using the changeset viewer.