Changeset 574 in dev for trunk


Ignore:
Timestamp:
May 7, 2008, 11:52:29 AM (16 years ago)
Author:
dai_9181
Message:

UserProcs::Insertメソッドを排除。

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

Legend:

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

    r573 r574  
    414414    }
    415415
    416     bool Insert( UserProc *pUserProc, int nowLine );
    417 
    418416    void EnumGlobalProcs( const char *simpleName, const char *localName, std::vector<const UserProc *> &subs );
    419417};
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Class.cpp

    r566 r574  
    590590        pUserProc->_paramStr = "";
    591591        pUserProc->Using();
    592         compiler.GetObjectModule().meta.GetUserProcs().Insert( pUserProc, -1 );
     592
     593        // 関数を追加
     594        if( compiler.GetObjectModule().meta.GetUserProcs().IsExist( pUserProc ) )
     595        {
     596            // 既に存在している
     597            compiler.errorMessenger.Output(15,pUserProc->GetName(),-1);
     598
     599            delete pUserProc;
     600        }
     601        else
     602        {
     603            compiler.GetObjectModule().meta.GetUserProcs().Put( pUserProc );
     604        }
    593605
    594606        LexicalAnalyzer::AddMethod(
     
    905917                if( pUserProc )
    906918                {
    907                     compiler.GetObjectModule().meta.GetUserProcs().Insert( pUserProc, i );
     919                    // 関数を追加
     920                    if( compiler.GetObjectModule().meta.GetUserProcs().IsExist( pUserProc ) )
     921                    {
     922                        // 既に存在している
     923                        compiler.errorMessenger.Output(15,pUserProc->GetName(),i);
     924
     925                        delete pUserProc;
     926                    }
     927                    else
     928                    {
     929                        compiler.GetObjectModule().meta.GetUserProcs().Put( pUserProc );
     930                    }
    908931
    909932                    //メンバ関数を追加
     
    12331256                    if( pUserProc )
    12341257                    {
    1235                         compiler.GetObjectModule().meta.GetUserProcs().Insert( pUserProc, i );
     1258                        // 関数を追加
     1259                        if( compiler.GetObjectModule().meta.GetUserProcs().IsExist( pUserProc ) )
     1260                        {
     1261                            // 既に存在している
     1262                            compiler.errorMessenger.Output(15,pUserProc->GetName(),i);
     1263
     1264                            delete pUserProc;
     1265                        }
     1266                        else
     1267                        {
     1268                            compiler.GetObjectModule().meta.GetUserProcs().Put( pUserProc );
     1269                        }
    12361270
    12371271                        //メソッドを追加
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Procedure.cpp

    r573 r574  
    872872
    873873            UserProc *pUserProc = ParseUserProc( namespaceScopes, importedNamespaces, temporary, i, false, NULL, false );
    874             userProcs.Insert( pUserProc, i );
     874
     875            // 関数を追加
     876            if( userProcs.IsExist( pUserProc ) )
     877            {
     878                // 既に存在している
     879                compiler.errorMessenger.Output(15,pUserProc->GetName(),i);
     880
     881                delete pUserProc;
     882            }
     883            else
     884            {
     885                userProcs.Put( pUserProc );
     886            }
    875887
    876888            /*  Sub ~ End Sub
     
    906918    sprintf(temporary,"%c%c%s()",1,ESC_SUB,compiler.globalAreaProcName.c_str());
    907919    UserProc *pUserProc = ParseUserProc( namespaceScopes, importedNamespaces, temporary, 0, false, NULL, false );
    908     userProcs.Insert( pUserProc, i );
     920
     921    // 関数を追加
     922    if( userProcs.IsExist( pUserProc ) )
     923    {
     924        // 既に存在している
     925        compiler.errorMessenger.Output(15,pUserProc->GetName(),i);
     926
     927        delete pUserProc;
     928    }
     929    else
     930    {
     931        userProcs.Put( pUserProc );
     932    }
    909933}
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Procedure.cpp

    r573 r574  
    9999
    100100
    101 bool UserProcs::Insert( UserProc *pUserProc, int nowLine )
    102 {
    103     /////////////////////////////////
    104     // ハッシュデータに追加
    105     /////////////////////////////////
    106 
    107     if( !Put( pUserProc ) )
    108     {
    109         // 重複しているため、失敗
    110         compiler.errorMessenger.Output(15,pUserProc->GetName().c_str(),nowLine);
    111         return false;
    112     }
    113 
    114     return true;
    115 }
    116 
    117101void UserProcs::EnumGlobalProcs( const char *simpleName, const char *localName, std::vector<const UserProc *> &subs )
    118102{
Note: See TracChangeset for help on using the changeset viewer.